浏览代码

ASoC: tlv320aic26: Add basic DAPM support

Provide external widgets for the CODEC to ensure the device continues to
function with DAPM mandatory and to make it easier to hook the device up
to other components.

Signed-off-by: Mark Brown <broonie@linaro.org>
Mark Brown 12 年之前
父节点
当前提交
4a11bc2fdd
共有 1 个文件被更改,包括 20 次插入0 次删除
  1. 20 0
      sound/soc/codecs/tlv320aic26.c

+ 20 - 0
sound/soc/codecs/tlv320aic26.c

@@ -119,6 +119,22 @@ static int aic26_reg_write(struct snd_soc_codec *codec, unsigned int reg,
 	return 0;
 	return 0;
 }
 }
 
 
+static const struct snd_soc_dapm_widget tlv320aic26_dapm_widgets[] = {
+SND_SOC_DAPM_INPUT("MICIN"),
+SND_SOC_DAPM_INPUT("AUX"),
+
+SND_SOC_DAPM_OUTPUT("HPL"),
+SND_SOC_DAPM_OUTPUT("HPR"),
+};
+
+static const struct snd_soc_dapm_route tlv320aic26_dapm_routes[] = {
+	{ "Capture", NULL, "MICIN" },
+	{ "Capture", NULL, "AUX" },
+
+	{ "HPL", NULL, "Playback" },
+	{ "HPR", NULL, "Playback" },
+};
+
 /* ---------------------------------------------------------------------
 /* ---------------------------------------------------------------------
  * Digital Audio Interface Operations
  * Digital Audio Interface Operations
  */
  */
@@ -402,6 +418,10 @@ static struct snd_soc_codec_driver aic26_soc_codec_dev = {
 	.write = aic26_reg_write,
 	.write = aic26_reg_write,
 	.reg_cache_size = AIC26_NUM_REGS,
 	.reg_cache_size = AIC26_NUM_REGS,
 	.reg_word_size = sizeof(u16),
 	.reg_word_size = sizeof(u16),
+	.dapm_widgets = tlv320aic26_dapm_widgets,
+	.num_dapm_widgets = ARRAY_SIZE(tlv320aic26_dapm_widgets),
+	.dapm_routes = tlv320aic26_dapm_routes,
+	.num_dapm_routes = ARRAY_SIZE(tlv320aic26_dapm_routes),
 };
 };
 
 
 /* ---------------------------------------------------------------------
 /* ---------------------------------------------------------------------