wl1273.c (75bf465f0bc33e9b776a46d6a1b9b990f5fb7c37) wl1273.c (5e518eddd11e8f71aaffc954dc7ee9572fc59808)
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * ALSA SoC WL1273 codec driver
4 *
5 * Author: Matti Aaltonen, <matti.j.aaltonen@nokia.com>
6 *
7 * Copyright: (C) 2010, 2011 Nokia Corporation
8 */

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

178{
179 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol);
180 struct wl1273_priv *wl1273 = snd_soc_component_get_drvdata(component);
181
182 if (wl1273->mode == ucontrol->value.enumerated.item[0])
183 return 0;
184
185 /* Do not allow changes while stream is running */
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * ALSA SoC WL1273 codec driver
4 *
5 * Author: Matti Aaltonen, <matti.j.aaltonen@nokia.com>
6 *
7 * Copyright: (C) 2010, 2011 Nokia Corporation
8 */

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

178{
179 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol);
180 struct wl1273_priv *wl1273 = snd_soc_component_get_drvdata(component);
181
182 if (wl1273->mode == ucontrol->value.enumerated.item[0])
183 return 0;
184
185 /* Do not allow changes while stream is running */
186 if (snd_soc_component_is_active(component))
186 if (snd_soc_component_active(component))
187 return -EPERM;
188
189 if (ucontrol->value.enumerated.item[0] >= ARRAY_SIZE(wl1273_audio_route))
190 return -EINVAL;
191
192 wl1273->mode = ucontrol->value.enumerated.item[0];
193
194 return 1;

--- 314 unchanged lines hidden ---
187 return -EPERM;
188
189 if (ucontrol->value.enumerated.item[0] >= ARRAY_SIZE(wl1273_audio_route))
190 return -EINVAL;
191
192 wl1273->mode = ucontrol->value.enumerated.item[0];
193
194 return 1;

--- 314 unchanged lines hidden ---