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

ASoC: codecs: nau8821: convert to snd_soc_dapm_xxx()

This patch converts below functions.

dapm->dev -> snd_soc_dapm_to_dev()
dapm->card -> snd_soc_dapm_to_card()
dapm->component -> snd_soc_dapm_to_component()

dapm_kcontrol_get_value() -> snd_soc_dapm_kcontrol_get_value()

snd_soc_component_enable_pin() -> snd_soc_dapm_enable_pin()
snd_soc_component_enable_pin_unlocked() -> snd_soc_dapm_enable_pin_unlocked()
snd_soc_component_disable_pin() -> snd_soc_dapm_disable_pin()
snd_soc_component_disable_pin_unlocked() -> snd_soc_dapm_disable_pin_unlocked()
snd_soc_component_nc_pin() -> snd_soc_dapm_nc_pin()
snd_soc_component_nc_pin_unlocked() -> snd_soc_dapm_nc_pin_unlocked()
snd_soc_component_get_pin_status() -> snd_soc_dapm_get_pin_status()
snd_soc_component_force_enable_pin() -> snd_soc_dapm_force_enable_pin()
snd_soc_component_force_enable_pin_unlocked() -> snd_soc_dapm_force_enable_pin_unlocked()
snd_soc_component_force_bias_level() -> snd_soc_dapm_force_bias_level()
snd_soc_component_get_bias_level() -> snd_soc_dapm_get_bias_level()
snd_soc_component_init_bias_level() -> snd_soc_dapm_init_bias_level()
snd_soc_component_get_dapm() -> snd_soc_component_to_dapm()

snd_soc_dapm_kcontrol_component() -> snd_soc_dapm_kcontrol_to_component()
snd_soc_dapm_kcontrol_widget() -> snd_soc_dapm_kcontrol_to_widget()
snd_soc_dapm_kcontrol_dapm() -> snd_soc_dapm_kcontrol_to_dapm()
snd_soc_dapm_np_pin() -> snd_soc_dapm_disable_pin()

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/87ms4t4dss.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Kuninori Morimoto and committed by
Mark Brown
0314d787 588dc19b

+11 -17
+11 -17
sound/soc/codecs/nau8821.c
··· 1047 1047 { 1048 1048 struct snd_soc_dapm_context *dapm = nau8821->dapm; 1049 1049 struct regmap *regmap = nau8821->regmap; 1050 - struct snd_soc_component *component = snd_soc_dapm_to_component(dapm); 1051 1050 1052 1051 /* Detach 2kOhm Resistors from MICBIAS to MICGND */ 1053 1052 regmap_update_bits(regmap, NAU8821_R74_MIC_BIAS, ··· 1054 1055 /* HPL/HPR short to ground */ 1055 1056 regmap_update_bits(regmap, NAU8821_R0D_JACK_DET_CTRL, 1056 1057 NAU8821_SPKR_DWN1R | NAU8821_SPKR_DWN1L, 0); 1057 - snd_soc_component_disable_pin(component, "MICBIAS"); 1058 + snd_soc_dapm_disable_pin(dapm, "MICBIAS"); 1058 1059 snd_soc_dapm_sync(dapm); 1059 1060 1060 1061 /* Disable & mask both insertion & ejection IRQs */ ··· 1079 1080 NAU8821_JACK_DET_DB_BYPASS, NAU8821_JACK_DET_DB_BYPASS); 1080 1081 1081 1082 /* Close clock for jack type detection at manual mode */ 1082 - if (dapm->bias_level < SND_SOC_BIAS_PREPARE) 1083 + if (snd_soc_dapm_get_bias_level(dapm) < SND_SOC_BIAS_PREPARE) 1083 1084 nau8821_configure_sysclk(nau8821, NAU8821_CLK_DIS, 0); 1084 1085 1085 1086 /* Recover to normal channel input */ ··· 1105 1106 struct nau8821 *nau8821 = 1106 1107 container_of(work, struct nau8821, jdet_work.work); 1107 1108 struct snd_soc_dapm_context *dapm = nau8821->dapm; 1108 - struct snd_soc_component *component = snd_soc_dapm_to_component(dapm); 1109 1109 struct regmap *regmap = nau8821->regmap; 1110 1110 int jack_status_reg, mic_detected, event = 0, event_mask = 0; 1111 1111 ··· 1131 1133 NAU8821_IRQ_KEY_RELEASE_DIS | 1132 1134 NAU8821_IRQ_KEY_PRESS_DIS, 0); 1133 1135 } else { 1134 - snd_soc_component_disable_pin(component, "MICBIAS"); 1135 - snd_soc_dapm_sync(nau8821->dapm); 1136 + snd_soc_dapm_disable_pin(dapm, "MICBIAS"); 1137 + snd_soc_dapm_sync(dapm); 1136 1138 } 1137 1139 } else { 1138 1140 dev_dbg(nau8821->dev, "Headphone connected\n"); 1139 1141 event |= SND_JACK_HEADPHONE; 1140 - snd_soc_component_disable_pin(component, "MICBIAS"); 1142 + snd_soc_dapm_disable_pin(dapm, "MICBIAS"); 1141 1143 snd_soc_dapm_sync(dapm); 1142 1144 } 1143 1145 ··· 1160 1162 nau8821_irq_status_clear(regmap, NAU8821_JACK_INSERT_DETECTED); 1161 1163 1162 1164 /* Enable internal VCO needed for interruptions */ 1163 - if (nau8821->dapm->bias_level < SND_SOC_BIAS_PREPARE) 1165 + if (snd_soc_dapm_get_bias_level(nau8821->dapm) < SND_SOC_BIAS_PREPARE) 1164 1166 nau8821_configure_sysclk(nau8821, NAU8821_CLK_INTERNAL, 0); 1165 1167 1166 1168 /* Chip needs one FSCLK cycle in order to generate interruptions, ··· 1189 1191 { 1190 1192 struct nau8821 *nau8821 = (struct nau8821 *)data; 1191 1193 struct regmap *regmap = nau8821->regmap; 1192 - struct snd_soc_component *component; 1193 1194 int active_irq, event = 0, event_mask = 0; 1194 1195 1195 1196 if (regmap_read(regmap, NAU8821_R10_IRQ_STATUS, &active_irq)) { ··· 1219 1222 NAU8821_MICDET_MASK, NAU8821_MICDET_EN); 1220 1223 if (nau8821_is_jack_inserted(regmap)) { 1221 1224 /* Detect microphone and jack type */ 1222 - component = snd_soc_dapm_to_component(nau8821->dapm); 1223 - snd_soc_component_force_enable_pin(component, "MICBIAS"); 1225 + snd_soc_dapm_force_enable_pin(nau8821->dapm, "MICBIAS"); 1224 1226 snd_soc_dapm_sync(nau8821->dapm); 1225 1227 schedule_delayed_work(&nau8821->jdet_work, msecs_to_jiffies(20)); 1226 1228 /* Turn off insertion interruption at manual mode */ ··· 1257 1261 static int nau8821_component_probe(struct snd_soc_component *component) 1258 1262 { 1259 1263 struct nau8821 *nau8821 = snd_soc_component_get_drvdata(component); 1260 - struct snd_soc_dapm_context *dapm = 1261 - snd_soc_component_get_dapm(component); 1264 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1262 1265 1263 1266 nau8821->dapm = dapm; 1264 1267 ··· 1559 1564 1560 1565 case SND_SOC_BIAS_STANDBY: 1561 1566 /* Setup codec configuration after resume */ 1562 - if (snd_soc_component_get_bias_level(component) == 1563 - SND_SOC_BIAS_OFF) 1567 + if (snd_soc_dapm_get_bias_level(nau8821->dapm) == SND_SOC_BIAS_OFF) 1564 1568 nau8821_resume_setup(nau8821); 1565 1569 break; 1566 1570 ··· 1597 1603 1598 1604 if (nau8821->irq) 1599 1605 disable_irq(nau8821->irq); 1600 - snd_soc_component_force_bias_level(component, SND_SOC_BIAS_OFF); 1606 + snd_soc_dapm_force_bias_level(nau8821->dapm, SND_SOC_BIAS_OFF); 1601 1607 /* Power down codec power; don't support button wakeup */ 1602 - snd_soc_component_disable_pin(component, "MICBIAS"); 1608 + snd_soc_dapm_disable_pin(nau8821->dapm, "MICBIAS"); 1603 1609 snd_soc_dapm_sync(nau8821->dapm); 1604 1610 regcache_cache_only(nau8821->regmap, true); 1605 1611 regcache_mark_dirty(nau8821->regmap);