rt1316-sdw.c (03ab8e6297acd1bc0eedaa050e2a1635c576fd11) rt1316-sdw.c (f9e9bdd5bb180325256e3bdfeb9c4c6526133478)
1// SPDX-License-Identifier: GPL-2.0-only
2//
3// rt1316-sdw.c -- rt1316 SDCA ALSA SoC amplifier audio driver
4//
5// Copyright(c) 2021 Realtek Semiconductor Corp.
6//
7//
8#include <linux/delay.h>

--- 583 unchanged lines hidden (view full) ---

592
593static const struct snd_soc_component_driver soc_component_sdw_rt1316 = {
594 .controls = rt1316_snd_controls,
595 .num_controls = ARRAY_SIZE(rt1316_snd_controls),
596 .dapm_widgets = rt1316_dapm_widgets,
597 .num_dapm_widgets = ARRAY_SIZE(rt1316_dapm_widgets),
598 .dapm_routes = rt1316_dapm_routes,
599 .num_dapm_routes = ARRAY_SIZE(rt1316_dapm_routes),
1// SPDX-License-Identifier: GPL-2.0-only
2//
3// rt1316-sdw.c -- rt1316 SDCA ALSA SoC amplifier audio driver
4//
5// Copyright(c) 2021 Realtek Semiconductor Corp.
6//
7//
8#include <linux/delay.h>

--- 583 unchanged lines hidden (view full) ---

592
593static const struct snd_soc_component_driver soc_component_sdw_rt1316 = {
594 .controls = rt1316_snd_controls,
595 .num_controls = ARRAY_SIZE(rt1316_snd_controls),
596 .dapm_widgets = rt1316_dapm_widgets,
597 .num_dapm_widgets = ARRAY_SIZE(rt1316_dapm_widgets),
598 .dapm_routes = rt1316_dapm_routes,
599 .num_dapm_routes = ARRAY_SIZE(rt1316_dapm_routes),
600 .endianness = 1,
600};
601
602static const struct snd_soc_dai_ops rt1316_aif_dai_ops = {
603 .hw_params = rt1316_sdw_hw_params,
604 .hw_free = rt1316_sdw_pcm_hw_free,
605 .set_stream = rt1316_set_sdw_stream,
606 .shutdown = rt1316_sdw_shutdown,
607};

--- 62 unchanged lines hidden (view full) ---

670 /* Regmap Initialization */
671 regmap = devm_regmap_init_sdw(slave, &rt1316_sdw_regmap);
672 if (IS_ERR(regmap))
673 return PTR_ERR(regmap);
674
675 return rt1316_sdw_init(&slave->dev, regmap, slave);
676}
677
601};
602
603static const struct snd_soc_dai_ops rt1316_aif_dai_ops = {
604 .hw_params = rt1316_sdw_hw_params,
605 .hw_free = rt1316_sdw_pcm_hw_free,
606 .set_stream = rt1316_set_sdw_stream,
607 .shutdown = rt1316_sdw_shutdown,
608};

--- 62 unchanged lines hidden (view full) ---

671 /* Regmap Initialization */
672 regmap = devm_regmap_init_sdw(slave, &rt1316_sdw_regmap);
673 if (IS_ERR(regmap))
674 return PTR_ERR(regmap);
675
676 return rt1316_sdw_init(&slave->dev, regmap, slave);
677}
678
679static int rt1316_sdw_remove(struct sdw_slave *slave)
680{
681 struct rt1316_sdw_priv *rt1316 = dev_get_drvdata(&slave->dev);
682
683 if (rt1316->first_hw_init)
684 pm_runtime_disable(&slave->dev);
685
686 return 0;
687}
688
678static const struct sdw_device_id rt1316_id[] = {
679 SDW_SLAVE_ENTRY_EXT(0x025d, 0x1316, 0x3, 0x1, 0),
680 {},
681};
682MODULE_DEVICE_TABLE(sdw, rt1316_id);
683
684static int __maybe_unused rt1316_dev_suspend(struct device *dev)
685{

--- 43 unchanged lines hidden (view full) ---

729
730static struct sdw_driver rt1316_sdw_driver = {
731 .driver = {
732 .name = "rt1316-sdca",
733 .owner = THIS_MODULE,
734 .pm = &rt1316_pm,
735 },
736 .probe = rt1316_sdw_probe,
689static const struct sdw_device_id rt1316_id[] = {
690 SDW_SLAVE_ENTRY_EXT(0x025d, 0x1316, 0x3, 0x1, 0),
691 {},
692};
693MODULE_DEVICE_TABLE(sdw, rt1316_id);
694
695static int __maybe_unused rt1316_dev_suspend(struct device *dev)
696{

--- 43 unchanged lines hidden (view full) ---

740
741static struct sdw_driver rt1316_sdw_driver = {
742 .driver = {
743 .name = "rt1316-sdca",
744 .owner = THIS_MODULE,
745 .pm = &rt1316_pm,
746 },
747 .probe = rt1316_sdw_probe,
748 .remove = rt1316_sdw_remove,
737 .ops = &rt1316_slave_ops,
738 .id_table = rt1316_id,
739};
740module_sdw_driver(rt1316_sdw_driver);
741
742MODULE_DESCRIPTION("ASoC RT1316 driver SDCA SDW");
743MODULE_AUTHOR("Shuming Fan <shumingf@realtek.com>");
744MODULE_LICENSE("GPL");
749 .ops = &rt1316_slave_ops,
750 .id_table = rt1316_id,
751};
752module_sdw_driver(rt1316_sdw_driver);
753
754MODULE_DESCRIPTION("ASoC RT1316 driver SDCA SDW");
755MODULE_AUTHOR("Shuming Fan <shumingf@realtek.com>");
756MODULE_LICENSE("GPL");