]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ASoC: codecs: hdac_hdmi: convert to snd_soc_dapm_xxx()
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tue, 11 Nov 2025 00:22:36 +0000 (00:22 +0000)
committerMark Brown <broonie@kernel.org>
Mon, 17 Nov 2025 00:15:20 +0000 (00:15 +0000)
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>
sound/soc/codecs/hdac_hdmi.c

index e50afd0bfcecc7c960d70ec52351e0f261d88f12..2652fcf2a3a345908d426b3a39f8e1fdb00688cf 100644 (file)
@@ -769,7 +769,8 @@ static int hdac_hdmi_pin_output_widget_event(struct snd_soc_dapm_widget *w,
                                        struct snd_kcontrol *kc, int event)
 {
        struct hdac_hdmi_port *port = w->priv;
-       struct hdac_device *hdev = dev_to_hdac_dev(w->dapm->dev);
+       struct device *dev = snd_soc_dapm_to_dev(w->dapm);
+       struct hdac_device *hdev = dev_to_hdac_dev(dev);
        struct hdac_hdmi_pcm *pcm;
 
        dev_dbg(&hdev->dev, "%s: widget: %s event: %x\n",
@@ -814,7 +815,8 @@ static int hdac_hdmi_cvt_output_widget_event(struct snd_soc_dapm_widget *w,
                                        struct snd_kcontrol *kc, int event)
 {
        struct hdac_hdmi_cvt *cvt = w->priv;
-       struct hdac_device *hdev = dev_to_hdac_dev(w->dapm->dev);
+       struct device *dev = snd_soc_dapm_to_dev(w->dapm);
+       struct hdac_device *hdev = dev_to_hdac_dev(dev);
        struct hdac_hdmi_priv *hdmi = hdev_to_hdmi_priv(hdev);
        struct hdac_hdmi_pcm *pcm;
 
@@ -869,7 +871,8 @@ static int hdac_hdmi_pin_mux_widget_event(struct snd_soc_dapm_widget *w,
                                        struct snd_kcontrol *kc, int event)
 {
        struct hdac_hdmi_port *port = w->priv;
-       struct hdac_device *hdev = dev_to_hdac_dev(w->dapm->dev);
+       struct device *dev = snd_soc_dapm_to_dev(w->dapm);
+       struct hdac_device *hdev = dev_to_hdac_dev(dev);
        int mux_idx;
 
        dev_dbg(&hdev->dev, "%s: widget: %s event: %x\n",
@@ -878,7 +881,7 @@ static int hdac_hdmi_pin_mux_widget_event(struct snd_soc_dapm_widget *w,
        if (!kc)
                kc  = w->kcontrols[0];
 
-       mux_idx = dapm_kcontrol_get_value(kc);
+       mux_idx = snd_soc_dapm_kcontrol_get_value(kc);
 
        /* set the device if pin is mst_capable */
        if (hdac_hdmi_port_select_set(hdev, port) < 0)
@@ -901,10 +904,11 @@ static int hdac_hdmi_set_pin_port_mux(struct snd_kcontrol *kcontrol,
        int ret;
        struct hdac_hdmi_port *p, *p_next;
        struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
-       struct snd_soc_dapm_widget *w = snd_soc_dapm_kcontrol_widget(kcontrol);
+       struct snd_soc_dapm_widget *w = snd_soc_dapm_kcontrol_to_widget(kcontrol);
        struct snd_soc_dapm_context *dapm = w->dapm;
+       struct device *dev = snd_soc_dapm_to_dev(dapm);
        struct hdac_hdmi_port *port = w->priv;
-       struct hdac_device *hdev = dev_to_hdac_dev(dapm->dev);
+       struct hdac_device *hdev = dev_to_hdac_dev(dev);
        struct hdac_hdmi_priv *hdmi = hdev_to_hdmi_priv(hdev);
        struct hdac_hdmi_pcm *pcm;
        const char *cvt_name =  e->texts[ucontrol->value.enumerated.item[0]];
@@ -1070,9 +1074,11 @@ static void hdac_hdmi_add_pinmux_cvt_route(struct hdac_device *hdev,
  */
 static int create_fill_widget_route_map(struct snd_soc_dapm_context *dapm)
 {
+       struct device *dev = snd_soc_dapm_to_dev(dapm);
+       struct snd_soc_card *card = snd_soc_dapm_to_card(dapm);
        struct snd_soc_dapm_widget *widgets;
        struct snd_soc_dapm_route *route;
-       struct hdac_device *hdev = dev_to_hdac_dev(dapm->dev);
+       struct hdac_device *hdev = dev_to_hdac_dev(dev);
        struct hdac_hdmi_priv *hdmi = hdev_to_hdmi_priv(hdev);
        struct snd_soc_dai_driver *dai_drv = hdmi->dai_drv;
        char widget_name[NAME_SIZE];
@@ -1083,7 +1089,7 @@ static int create_fill_widget_route_map(struct snd_soc_dapm_context *dapm)
        if (list_empty(&hdmi->cvt_list) || list_empty(&hdmi->pin_list))
                return -EINVAL;
 
-       widgets = devm_kzalloc(dapm->dev, (sizeof(*widgets) *
+       widgets = devm_kzalloc(dev, (sizeof(*widgets) *
                                ((2 * hdmi->num_ports) + hdmi->num_cvt)),
                                GFP_KERNEL);
 
@@ -1093,7 +1099,7 @@ static int create_fill_widget_route_map(struct snd_soc_dapm_context *dapm)
        /* DAPM widgets to represent each converter widget */
        list_for_each_entry(cvt, &hdmi->cvt_list, head) {
                sprintf(widget_name, "Converter %d", cvt->nid);
-               ret = hdac_hdmi_fill_widget_info(dapm->dev, &widgets[i],
+               ret = hdac_hdmi_fill_widget_info(dev, &widgets[i],
                        snd_soc_dapm_aif_in, cvt,
                        widget_name, dai_drv[i].playback.stream_name, NULL, 0,
                        hdac_hdmi_cvt_output_widget_event,
@@ -1107,7 +1113,7 @@ static int create_fill_widget_route_map(struct snd_soc_dapm_context *dapm)
                for (j = 0; j < pin->num_ports; j++) {
                        sprintf(widget_name, "hif%d-%d Output",
                                pin->nid, pin->ports[j].id);
-                       ret = hdac_hdmi_fill_widget_info(dapm->dev, &widgets[i],
+                       ret = hdac_hdmi_fill_widget_info(dev, &widgets[i],
                                        snd_soc_dapm_output, &pin->ports[j],
                                        widget_name, NULL, NULL, 0,
                                        hdac_hdmi_pin_output_widget_event,
@@ -1140,7 +1146,7 @@ static int create_fill_widget_route_map(struct snd_soc_dapm_context *dapm)
                }
        }
 
-       route = devm_kzalloc(dapm->dev, (sizeof(*route) * num_routes),
+       route = devm_kzalloc(dev, (sizeof(*route) * num_routes),
                                                        GFP_KERNEL);
        if (!route)
                return -ENOMEM;
@@ -1166,7 +1172,7 @@ static int create_fill_widget_route_map(struct snd_soc_dapm_context *dapm)
                ((2 * hdmi->num_ports) + hdmi->num_cvt));
 
        snd_soc_dapm_add_routes(dapm, route, num_routes);
-       snd_soc_dapm_new_widgets(dapm->card);
+       snd_soc_dapm_new_widgets(card);
 
        return 0;
 
@@ -1666,8 +1672,7 @@ static int hdmi_codec_probe(struct snd_soc_component *component)
 {
        struct hdac_hdmi_priv *hdmi = snd_soc_component_get_drvdata(component);
        struct hdac_device *hdev = hdmi->hdev;
-       struct snd_soc_dapm_context *dapm =
-               snd_soc_component_get_dapm(component);
+       struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component);
        struct hdac_ext_link *hlink;
        int ret;
 
@@ -1698,7 +1703,7 @@ static int hdmi_codec_probe(struct snd_soc_component *component)
 
        hdac_hdmi_present_sense_all_pins(hdev, hdmi, true);
        /* Imp: Store the card pointer in hda_codec */
-       hdmi->card = dapm->card->snd_card;
+       hdmi->card = component->card->snd_card;
 
        /*
         * Setup a device_link between card device and HDMI codec device.