未验证 提交 42302b20 编写于 作者: P Pierre-Louis Bossart 提交者: Mark Brown

ASoC: Intel: sof_es8336: get codec device with ACPI instead of bus search

We have an existing 'adev' handle from which we can find the codec
device, no need for an I2C bus search.

This change aligns this driver will all other I2S-based machine
drivers.
Signed-off-by: NPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: NBard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: NPéter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20220308192610.392950-13-pierre-louis.bossart@linux.intel.comSigned-off-by: NMark Brown <broonie@kernel.org>
上级 5a6cfba5
...@@ -515,9 +515,10 @@ static int sof_es8336_probe(struct platform_device *pdev) ...@@ -515,9 +515,10 @@ static int sof_es8336_probe(struct platform_device *pdev)
return ret; return ret;
/* get speaker enable GPIO */ /* get speaker enable GPIO */
codec_dev = bus_find_device_by_name(&i2c_bus_type, NULL, codec_name); codec_dev = acpi_get_first_physical_node(adev);
if (!codec_dev) if (!codec_dev)
return -EPROBE_DEFER; return -EPROBE_DEFER;
priv->codec_dev = get_device(codec_dev);
ret = devm_acpi_dev_add_driver_gpios(codec_dev, gpio_mapping); ret = devm_acpi_dev_add_driver_gpios(codec_dev, gpio_mapping);
if (ret) if (ret)
...@@ -530,7 +531,6 @@ static int sof_es8336_probe(struct platform_device *pdev) ...@@ -530,7 +531,6 @@ static int sof_es8336_probe(struct platform_device *pdev)
goto err; goto err;
} }
priv->codec_dev = codec_dev;
INIT_LIST_HEAD(&priv->hdmi_pcm_list); INIT_LIST_HEAD(&priv->hdmi_pcm_list);
snd_soc_card_set_drvdata(card, priv); snd_soc_card_set_drvdata(card, priv);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册