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

ASoC: codecs: hdac_hdmi: 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/87ldkd5sfn.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Kuninori Morimoto and committed by
Mark Brown
f2d57e22 a3151663

+20 -15
+20 -15
sound/soc/codecs/hdac_hdmi.c
··· 769 769 struct snd_kcontrol *kc, int event) 770 770 { 771 771 struct hdac_hdmi_port *port = w->priv; 772 - struct hdac_device *hdev = dev_to_hdac_dev(w->dapm->dev); 772 + struct device *dev = snd_soc_dapm_to_dev(w->dapm); 773 + struct hdac_device *hdev = dev_to_hdac_dev(dev); 773 774 struct hdac_hdmi_pcm *pcm; 774 775 775 776 dev_dbg(&hdev->dev, "%s: widget: %s event: %x\n", ··· 815 814 struct snd_kcontrol *kc, int event) 816 815 { 817 816 struct hdac_hdmi_cvt *cvt = w->priv; 818 - struct hdac_device *hdev = dev_to_hdac_dev(w->dapm->dev); 817 + struct device *dev = snd_soc_dapm_to_dev(w->dapm); 818 + struct hdac_device *hdev = dev_to_hdac_dev(dev); 819 819 struct hdac_hdmi_priv *hdmi = hdev_to_hdmi_priv(hdev); 820 820 struct hdac_hdmi_pcm *pcm; 821 821 ··· 871 869 struct snd_kcontrol *kc, int event) 872 870 { 873 871 struct hdac_hdmi_port *port = w->priv; 874 - struct hdac_device *hdev = dev_to_hdac_dev(w->dapm->dev); 872 + struct device *dev = snd_soc_dapm_to_dev(w->dapm); 873 + struct hdac_device *hdev = dev_to_hdac_dev(dev); 875 874 int mux_idx; 876 875 877 876 dev_dbg(&hdev->dev, "%s: widget: %s event: %x\n", ··· 881 878 if (!kc) 882 879 kc = w->kcontrols[0]; 883 880 884 - mux_idx = dapm_kcontrol_get_value(kc); 881 + mux_idx = snd_soc_dapm_kcontrol_get_value(kc); 885 882 886 883 /* set the device if pin is mst_capable */ 887 884 if (hdac_hdmi_port_select_set(hdev, port) < 0) ··· 904 901 int ret; 905 902 struct hdac_hdmi_port *p, *p_next; 906 903 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; 907 - struct snd_soc_dapm_widget *w = snd_soc_dapm_kcontrol_widget(kcontrol); 904 + struct snd_soc_dapm_widget *w = snd_soc_dapm_kcontrol_to_widget(kcontrol); 908 905 struct snd_soc_dapm_context *dapm = w->dapm; 906 + struct device *dev = snd_soc_dapm_to_dev(dapm); 909 907 struct hdac_hdmi_port *port = w->priv; 910 - struct hdac_device *hdev = dev_to_hdac_dev(dapm->dev); 908 + struct hdac_device *hdev = dev_to_hdac_dev(dev); 911 909 struct hdac_hdmi_priv *hdmi = hdev_to_hdmi_priv(hdev); 912 910 struct hdac_hdmi_pcm *pcm; 913 911 const char *cvt_name = e->texts[ucontrol->value.enumerated.item[0]]; ··· 1074 1070 */ 1075 1071 static int create_fill_widget_route_map(struct snd_soc_dapm_context *dapm) 1076 1072 { 1073 + struct device *dev = snd_soc_dapm_to_dev(dapm); 1074 + struct snd_soc_card *card = snd_soc_dapm_to_card(dapm); 1077 1075 struct snd_soc_dapm_widget *widgets; 1078 1076 struct snd_soc_dapm_route *route; 1079 - struct hdac_device *hdev = dev_to_hdac_dev(dapm->dev); 1077 + struct hdac_device *hdev = dev_to_hdac_dev(dev); 1080 1078 struct hdac_hdmi_priv *hdmi = hdev_to_hdmi_priv(hdev); 1081 1079 struct snd_soc_dai_driver *dai_drv = hdmi->dai_drv; 1082 1080 char widget_name[NAME_SIZE]; ··· 1089 1083 if (list_empty(&hdmi->cvt_list) || list_empty(&hdmi->pin_list)) 1090 1084 return -EINVAL; 1091 1085 1092 - widgets = devm_kzalloc(dapm->dev, (sizeof(*widgets) * 1086 + widgets = devm_kzalloc(dev, (sizeof(*widgets) * 1093 1087 ((2 * hdmi->num_ports) + hdmi->num_cvt)), 1094 1088 GFP_KERNEL); 1095 1089 ··· 1099 1093 /* DAPM widgets to represent each converter widget */ 1100 1094 list_for_each_entry(cvt, &hdmi->cvt_list, head) { 1101 1095 sprintf(widget_name, "Converter %d", cvt->nid); 1102 - ret = hdac_hdmi_fill_widget_info(dapm->dev, &widgets[i], 1096 + ret = hdac_hdmi_fill_widget_info(dev, &widgets[i], 1103 1097 snd_soc_dapm_aif_in, cvt, 1104 1098 widget_name, dai_drv[i].playback.stream_name, NULL, 0, 1105 1099 hdac_hdmi_cvt_output_widget_event, ··· 1113 1107 for (j = 0; j < pin->num_ports; j++) { 1114 1108 sprintf(widget_name, "hif%d-%d Output", 1115 1109 pin->nid, pin->ports[j].id); 1116 - ret = hdac_hdmi_fill_widget_info(dapm->dev, &widgets[i], 1110 + ret = hdac_hdmi_fill_widget_info(dev, &widgets[i], 1117 1111 snd_soc_dapm_output, &pin->ports[j], 1118 1112 widget_name, NULL, NULL, 0, 1119 1113 hdac_hdmi_pin_output_widget_event, ··· 1146 1140 } 1147 1141 } 1148 1142 1149 - route = devm_kzalloc(dapm->dev, (sizeof(*route) * num_routes), 1143 + route = devm_kzalloc(dev, (sizeof(*route) * num_routes), 1150 1144 GFP_KERNEL); 1151 1145 if (!route) 1152 1146 return -ENOMEM; ··· 1172 1166 ((2 * hdmi->num_ports) + hdmi->num_cvt)); 1173 1167 1174 1168 snd_soc_dapm_add_routes(dapm, route, num_routes); 1175 - snd_soc_dapm_new_widgets(dapm->card); 1169 + snd_soc_dapm_new_widgets(card); 1176 1170 1177 1171 return 0; 1178 1172 ··· 1672 1666 { 1673 1667 struct hdac_hdmi_priv *hdmi = snd_soc_component_get_drvdata(component); 1674 1668 struct hdac_device *hdev = hdmi->hdev; 1675 - struct snd_soc_dapm_context *dapm = 1676 - snd_soc_component_get_dapm(component); 1669 + struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 1677 1670 struct hdac_ext_link *hlink; 1678 1671 int ret; 1679 1672 ··· 1703 1698 1704 1699 hdac_hdmi_present_sense_all_pins(hdev, hdmi, true); 1705 1700 /* Imp: Store the card pointer in hda_codec */ 1706 - hdmi->card = dapm->card->snd_card; 1701 + hdmi->card = component->card->snd_card; 1707 1702 1708 1703 /* 1709 1704 * Setup a device_link between card device and HDMI codec device.