ASoC: cs4270: Add DAPM support
authorMark Brown <broonie@linaro.org>
Sun, 11 Aug 2013 11:29:07 +0000 (12:29 +0100)
committerMark Brown <broonie@linaro.org>
Sun, 18 Aug 2013 17:27:40 +0000 (18:27 +0100)
This makes it possible to hook the device into a more complex board and
ensures it will continue to work with non-DAPM support removed from the
core.

Signed-off-by: Mark Brown <broonie@linaro.org>
sound/soc/codecs/cs4270.c

index 8e4779812b96c03d11f07ca6a4c47ca628b3295b..83c835d9fd884b18a87cdbb5420838b8fd9229f0 100644 (file)
@@ -139,6 +139,22 @@ struct cs4270_private {
        struct regulator_bulk_data supplies[ARRAY_SIZE(supply_names)];
 };
 
+static const struct snd_soc_dapm_widget cs4270_dapm_widgets[] = {
+SND_SOC_DAPM_INPUT("AINL"),
+SND_SOC_DAPM_INPUT("AINR"),
+
+SND_SOC_DAPM_OUTPUT("AOUTL"),
+SND_SOC_DAPM_OUTPUT("AOUTR"),
+};
+
+static const struct snd_soc_dapm_route cs4270_dapm_routes[] = {
+       { "Capture", NULL, "AINA" },
+       { "Capture", NULL, "AINB" },
+
+       { "AOUTA", NULL, "Playback" },
+       { "AOUTB", NULL, "Playback" },
+};
+
 /**
  * struct cs4270_mode_ratios - clock ratio tables
  * @ratio: the ratio of MCLK to the sample rate
@@ -612,6 +628,10 @@ static const struct snd_soc_codec_driver soc_codec_device_cs4270 = {
 
        .controls =             cs4270_snd_controls,
        .num_controls =         ARRAY_SIZE(cs4270_snd_controls),
+       .dapm_widgets =         cs4270_dapm_widgets,
+       .num_dapm_widgets =     ARRAY_SIZE(cs4270_dapm_widgets),
+       .dapm_routes =          cs4270_dapm_routes,
+       .num_dapm_routes =      ARRAY_SIZE(cs4270_dapm_routes),
 };
 
 /*