diff mbox

ASoC: DA7219: Exposes clock enable as a mixer setting

Message ID 1518766875-15164-3-git-send-email-akshu.agrawal@amd.com (mailing list archive)
State New, archived
Headers show

Commit Message

Akshu Agrawal Feb. 16, 2018, 7:41 a.m. UTC
This is required for designs which uses da7219 in master mode
and same clks are shared with other codecs. We need to enable
and disable the clk during playback and capture on other codecs.

Signed-off-by: Akshu Agrawal <akshu.agrawal@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
---
 sound/soc/codecs/da7219.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Mark Brown Feb. 16, 2018, 4:02 p.m. UTC | #1
On Fri, Feb 16, 2018 at 01:11:14PM +0530, Akshu Agrawal wrote:

> This is required for designs which uses da7219 in master mode
> and same clks are shared with other codecs. We need to enable
> and disable the clk during playback and capture on other codecs.

> +	/* Clock Enable */
> +	SOC_SINGLE("Clock Enable", DA7219_DAI_CLK_MODE,
> +		   DA7219_DAI_CLK_EN_SHIFT, DA7219_SWITCH_EN_MAX,
> +		   DA7219_NO_INVERT),

No, this isn't something users should be confronted with or have to
manage.  We have a clock API in the kernel, you should arrange for the
CODEC driver to provide a clock via that API and then the users should
be clock API consumers and enable it when they need it.

It's also an on/off control
diff mbox

Patch

diff --git a/sound/soc/codecs/da7219.c b/sound/soc/codecs/da7219.c
index 5e043d0..61ed8be 100644
--- a/sound/soc/codecs/da7219.c
+++ b/sound/soc/codecs/da7219.c
@@ -672,6 +672,11 @@  static int da7219_tonegen_freq_put(struct snd_kcontrol *kcontrol,
 	SOC_DOUBLE_R("Headphone ZC Gain Switch", DA7219_HP_L_CTRL,
 		     DA7219_HP_R_CTRL, DA7219_HP_L_AMP_ZC_EN_SHIFT,
 		     DA7219_SWITCH_EN_MAX, DA7219_NO_INVERT),
+
+	/* Clock Enable */
+	SOC_SINGLE("Clock Enable", DA7219_DAI_CLK_MODE,
+		   DA7219_DAI_CLK_EN_SHIFT, DA7219_SWITCH_EN_MAX,
+		   DA7219_NO_INVERT),
 };