From 55af2d23c6c9caf7da6c9a55bbea83dccbc1af2b Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Mon, 5 Aug 2013 18:20:53 +0100 Subject: [PATCH 1/3] ASoC: pcm1792a: Fix build with !OF Signed-off-by: Mark Brown --- sound/soc/codecs/pcm1792a.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sound/soc/codecs/pcm1792a.c b/sound/soc/codecs/pcm1792a.c index 3f83bf9895d4..72cf8353e812 100644 --- a/sound/soc/codecs/pcm1792a.c +++ b/sound/soc/codecs/pcm1792a.c @@ -169,13 +169,11 @@ static struct snd_soc_dai_driver pcm1792a_dai = { .ops = &pcm1792a_dai_ops, }; -#ifdef CONFIG_OF static const struct of_device_id pcm1792a_of_match[] = { { .compatible = "ti,pcm1792a", }, { } }; MODULE_DEVICE_TABLE(of, pcm1792a_of_match); -#endif static const struct regmap_config pcm1792a_regmap = { .reg_bits = 8, @@ -231,7 +229,7 @@ static struct spi_driver pcm1792a_codec_driver = { .driver = { .name = "pcm1792a", .owner = THIS_MODULE, - .of_match_table = pcm1792a_of_match, + .of_match_table = of_match_ptr(pcm1792a_of_match), }, .id_table = pcm1792a_spi_ids, .probe = pcm1792a_spi_probe, From 5332e1d26fd182444e15e6481029347ab032d7cb Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Tue, 13 Aug 2013 18:29:44 +0100 Subject: [PATCH 2/3] ASoC: pcm1792a: Remove empty capture DAI stub These intialisations are just what will be done for static data anyway so remove them. Signed-off-by: Mark Brown --- sound/soc/codecs/pcm1792a.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/sound/soc/codecs/pcm1792a.c b/sound/soc/codecs/pcm1792a.c index 72cf8353e812..c57d3a5665c5 100644 --- a/sound/soc/codecs/pcm1792a.c +++ b/sound/soc/codecs/pcm1792a.c @@ -162,10 +162,6 @@ static struct snd_soc_dai_driver pcm1792a_dai = { .channels_max = 2, .rates = PCM1792A_RATES, .formats = PCM1792A_FORMATS, }, - .capture = { - .channels_min = 0, - .channels_max = 0, - }, .ops = &pcm1792a_dai_ops, }; From e7a5cb4223c86df522a97e21742aeef153db4ebb Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Tue, 13 Aug 2013 18:30:00 +0100 Subject: [PATCH 3/3] ASoC: pcm1792a: Add DAPM support Provide DAPM for the device, ensuring operation with DAPM required by the core and making it easier to hook up external hardware to it. Signed-off-by: Mark Brown --- sound/soc/codecs/pcm1792a.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/sound/soc/codecs/pcm1792a.c b/sound/soc/codecs/pcm1792a.c index c57d3a5665c5..2a8eccf64c76 100644 --- a/sound/soc/codecs/pcm1792a.c +++ b/sound/soc/codecs/pcm1792a.c @@ -154,6 +154,20 @@ static const struct snd_kcontrol_new pcm1792a_controls[] = { pcm1792a_dac_tlv), }; +static const struct snd_soc_dapm_widget pcm1792a_dapm_widgets[] = { +SND_SOC_DAPM_OUTPUT("IOUTL+"), +SND_SOC_DAPM_OUTPUT("IOUTL-"), +SND_SOC_DAPM_OUTPUT("IOUTR+"), +SND_SOC_DAPM_OUTPUT("IOUTR-"), +}; + +static const struct snd_soc_dapm_route pcm1792a_dapm_routes[] = { + { "IOUTL+", NULL, "Playback" }, + { "IOUTL-", NULL, "Playback" }, + { "IOUTR+", NULL, "Playback" }, + { "IOUTR-", NULL, "Playback" }, +}; + static struct snd_soc_dai_driver pcm1792a_dai = { .name = "pcm1792a-hifi", .playback = { @@ -184,6 +198,10 @@ static const struct regmap_config pcm1792a_regmap = { static struct snd_soc_codec_driver soc_codec_dev_pcm1792a = { .controls = pcm1792a_controls, .num_controls = ARRAY_SIZE(pcm1792a_controls), + .dapm_widgets = pcm1792a_dapm_widgets, + .num_dapm_widgets = ARRAY_SIZE(pcm1792a_dapm_widgets), + .dapm_routes = pcm1792a_dapm_routes, + .num_dapm_routes = ARRAY_SIZE(pcm1792a_dapm_routes), }; static int pcm1792a_spi_probe(struct spi_device *spi)