soc-component.c (448cc2fb3a7b327823a9afd374808c37b8e6194f) soc-component.c (403f830e7a0be5a9e33c7a9d208574f79887ec57)
1// SPDX-License-Identifier: GPL-2.0
2//
3// soc-component.c
4//
5// Copyright 2009-2011 Wolfson Microelectronics PLC.
6// Copyright (C) 2019 Renesas Electronics Corp.
7//
8// Mark Brown <broonie@opensource.wolfsonmicro.com>

--- 918 unchanged lines hidden (view full) ---

927 /* FIXME: use 1st pointer */
928 for_each_rtd_components(rtd, i, component)
929 if (component->driver->pointer)
930 return component->driver->pointer(component, substream);
931
932 return 0;
933}
934
1// SPDX-License-Identifier: GPL-2.0
2//
3// soc-component.c
4//
5// Copyright 2009-2011 Wolfson Microelectronics PLC.
6// Copyright (C) 2019 Renesas Electronics Corp.
7//
8// Mark Brown <broonie@opensource.wolfsonmicro.com>

--- 918 unchanged lines hidden (view full) ---

927 /* FIXME: use 1st pointer */
928 for_each_rtd_components(rtd, i, component)
929 if (component->driver->pointer)
930 return component->driver->pointer(component, substream);
931
932 return 0;
933}
934
935void snd_soc_pcm_component_delay(struct snd_pcm_substream *substream,
936 snd_pcm_sframes_t *cpu_delay,
937 snd_pcm_sframes_t *codec_delay)
938{
939 struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
940 struct snd_soc_component *component;
941 snd_pcm_sframes_t delay;
942 int i;
943
944 /*
945 * We're looking for the delay through the full audio path so it needs to
946 * be the maximum of the Components doing transmit and the maximum of the
947 * Components doing receive (ie, all CPUs and all CODECs) rather than
948 * just the maximum of all Components.
949 */
950 for_each_rtd_components(rtd, i, component) {
951 if (!component->driver->delay)
952 continue;
953
954 delay = component->driver->delay(component, substream);
955
956 if (snd_soc_component_is_codec(component))
957 *codec_delay = max(*codec_delay, delay);
958 else
959 *cpu_delay = max(*cpu_delay, delay);
960 }
961}
962
935int snd_soc_pcm_component_ioctl(struct snd_pcm_substream *substream,
936 unsigned int cmd, void *arg)
937{
938 struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
939 struct snd_soc_component *component;
940 int i;
941
942 /* FIXME: use 1st ioctl */

--- 274 unchanged lines hidden ---
963int snd_soc_pcm_component_ioctl(struct snd_pcm_substream *substream,
964 unsigned int cmd, void *arg)
965{
966 struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
967 struct snd_soc_component *component;
968 int i;
969
970 /* FIXME: use 1st ioctl */

--- 274 unchanged lines hidden ---