Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ASoC: codecs: wcd939x: use snd_kcontrol_chip() instead of snd_soc_kcontrol_component()

We have very similar name functions (A)(B). Both gets component from
snd_kcontrol, but (A) is used in callback functions which is registered
through snd_soc_add_component_controls(), (B) is used through
snd_soc_dapm_new_widgets().

(A) snd_soc_kcontrol_component()
(B) snd_soc_dapm_kcontrol_component()

(B) is using very picky way to get component but using it is necessary in
ASoC. But (A) is just wrapper function to snd_kcontrol_chip(), and directly
using it without wrapper is very common way on ALSA.
To reduce confusions of similar function, let's use common way on (A).

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87wm4ynm7v.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Kuninori Morimoto and committed by
Mark Brown
f4ae2720 661584c2

+12 -12
+12 -12
sound/soc/codecs/wcd939x.c
··· 1433 1433 static int wcd939x_tx_mode_get(struct snd_kcontrol *kcontrol, 1434 1434 struct snd_ctl_elem_value *ucontrol) 1435 1435 { 1436 - struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); 1436 + struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 1437 1437 struct wcd939x_priv *wcd939x = snd_soc_component_get_drvdata(component); 1438 1438 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; 1439 1439 int path = e->shift_l; ··· 1446 1446 static int wcd939x_tx_mode_put(struct snd_kcontrol *kcontrol, 1447 1447 struct snd_ctl_elem_value *ucontrol) 1448 1448 { 1449 - struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); 1449 + struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 1450 1450 struct wcd939x_priv *wcd939x = snd_soc_component_get_drvdata(component); 1451 1451 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; 1452 1452 int path = e->shift_l; ··· 1464 1464 static int wcd939x_rx_hph_mode_get(struct snd_kcontrol *kcontrol, 1465 1465 struct snd_ctl_elem_value *ucontrol) 1466 1466 { 1467 - struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); 1467 + struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 1468 1468 struct wcd939x_priv *wcd939x = snd_soc_component_get_drvdata(component); 1469 1469 1470 1470 ucontrol->value.integer.value[0] = wcd939x->hph_mode; ··· 1475 1475 static int wcd939x_rx_hph_mode_put(struct snd_kcontrol *kcontrol, 1476 1476 struct snd_ctl_elem_value *ucontrol) 1477 1477 { 1478 - struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); 1478 + struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 1479 1479 struct wcd939x_priv *wcd939x = snd_soc_component_get_drvdata(component); 1480 1480 u32 mode_val; 1481 1481 ··· 1520 1520 struct snd_ctl_elem_value *ucontrol) 1521 1521 { 1522 1522 struct soc_mixer_control *mc = (struct soc_mixer_control *)(kcontrol->private_value); 1523 - struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); 1523 + struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 1524 1524 struct wcd939x_priv *wcd939x = snd_soc_component_get_drvdata(component); 1525 1525 1526 1526 if (mc->shift) ··· 1535 1535 struct snd_ctl_elem_value *ucontrol) 1536 1536 { 1537 1537 struct soc_mixer_control *mc = (struct soc_mixer_control *)(kcontrol->private_value); 1538 - struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); 1538 + struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 1539 1539 struct wcd939x_priv *wcd939x = snd_soc_component_get_drvdata(component); 1540 1540 struct wcd939x_sdw_priv *wcd = wcd939x->sdw_priv[AIF1_PB]; 1541 1541 bool value = !!ucontrol->value.integer.value[0]; ··· 1557 1557 static int wcd939x_ldoh_get(struct snd_kcontrol *kcontrol, 1558 1558 struct snd_ctl_elem_value *ucontrol) 1559 1559 { 1560 - struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); 1560 + struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 1561 1561 struct wcd939x_priv *wcd939x = snd_soc_component_get_drvdata(component); 1562 1562 1563 1563 ucontrol->value.integer.value[0] = wcd939x->ldoh ? 1 : 0; ··· 1568 1568 static int wcd939x_ldoh_put(struct snd_kcontrol *kcontrol, 1569 1569 struct snd_ctl_elem_value *ucontrol) 1570 1570 { 1571 - struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); 1571 + struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 1572 1572 struct wcd939x_priv *wcd939x = snd_soc_component_get_drvdata(component); 1573 1573 1574 1574 if (wcd939x->ldoh == !!ucontrol->value.integer.value[0]) ··· 1789 1789 struct snd_ctl_elem_value *ucontrol) 1790 1790 { 1791 1791 struct soc_mixer_control *mixer = (struct soc_mixer_control *)kcontrol->private_value; 1792 - struct snd_soc_component *comp = snd_soc_kcontrol_component(kcontrol); 1792 + struct snd_soc_component *comp = snd_kcontrol_chip(kcontrol); 1793 1793 struct wcd939x_priv *wcd939x = snd_soc_component_get_drvdata(comp); 1794 1794 struct wcd939x_sdw_priv *wcd = wcd939x->sdw_priv[mixer->shift]; 1795 1795 unsigned int portidx = wcd->ch_info[mixer->reg].port_num; ··· 1816 1816 struct snd_ctl_elem_value *ucontrol) 1817 1817 { 1818 1818 struct soc_mixer_control *mixer = (struct soc_mixer_control *)kcontrol->private_value; 1819 - struct snd_soc_component *comp = snd_soc_kcontrol_component(kcontrol); 1819 + struct snd_soc_component *comp = snd_kcontrol_chip(kcontrol); 1820 1820 struct wcd939x_priv *wcd939x = snd_soc_component_get_drvdata(comp); 1821 1821 struct wcd939x_sdw_priv *wcd = wcd939x->sdw_priv[mixer->shift]; 1822 1822 unsigned int portidx = wcd->ch_info[mixer->reg].port_num; ··· 2432 2432 static int wcd939x_get_hph_type(struct snd_kcontrol *kcontrol, 2433 2433 struct snd_ctl_elem_value *ucontrol) 2434 2434 { 2435 - struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); 2435 + struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 2436 2436 struct wcd939x_priv *wcd939x = snd_soc_component_get_drvdata(component); 2437 2437 2438 2438 ucontrol->value.integer.value[0] = wcd_mbhc_get_hph_type(wcd939x->wcd_mbhc); ··· 2444 2444 struct snd_ctl_elem_value *ucontrol) 2445 2445 { 2446 2446 struct soc_mixer_control *mc = (struct soc_mixer_control *)(kcontrol->private_value); 2447 - struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); 2447 + struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 2448 2448 struct wcd939x_priv *wcd939x = snd_soc_component_get_drvdata(component); 2449 2449 bool hphr = mc->shift; 2450 2450 u32 zl, zr;