summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorShengjiu Wang <shengjiu.wang@freescale.com>2015-05-05 10:09:59 +0800
committerNitin Garg <nitin.garg@freescale.com>2015-09-17 09:22:52 -0500
commit1ec92d1cf49aa42beddfcb884e5bbfa30f340e8f (patch)
tree728451a8362ed07ffe1117790248ea161cbed51a /sound
parent3241216e250430a27b30eaf7f7df3e5e006acfb5 (diff)
MLK-10813-1: ASoC: imx-wm8958: Enable mclk output for codec
In imx6ul, the mclk need to be enable by gpr. Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/fsl/imx-wm8958.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/sound/soc/fsl/imx-wm8958.c b/sound/soc/fsl/imx-wm8958.c
index cc955d3e5513..3675d0c8e942 100644
--- a/sound/soc/fsl/imx-wm8958.c
+++ b/sound/soc/fsl/imx-wm8958.c
@@ -23,6 +23,7 @@
#include <sound/soc-dapm.h>
#include <linux/pinctrl/consumer.h>
#include <linux/mfd/wm8994/registers.h>
+#include <linux/mfd/syscon.h>
#include "../fsl/fsl_sai.h"
#include "../codecs/wm8994.h"
@@ -37,6 +38,7 @@ struct imx_wm8958_data {
unsigned int clk_frequency;
bool is_codec_master;
int sr_stream[2];
+ struct regmap *gpr;
};
struct imx_priv {
@@ -395,7 +397,7 @@ static int imx_wm8958_set_bias_level_post(struct snd_soc_card *card,
static int imx_wm8958_probe(struct platform_device *pdev)
{
- struct device_node *cpu_np, *codec_np;
+ struct device_node *cpu_np, *codec_np, *gpr_np;
struct device_node *np = pdev->dev.of_node;
struct platform_device *cpu_pdev;
struct imx_priv *priv = &card_priv;
@@ -439,6 +441,18 @@ static int imx_wm8958_probe(struct platform_device *pdev)
goto fail;
}
+ gpr_np = of_parse_phandle(pdev->dev.of_node, "gpr", 0);
+ if (gpr_np) {
+ data->gpr = syscon_node_to_regmap(gpr_np);
+ if (IS_ERR(data->gpr)) {
+ ret = PTR_ERR(data->gpr);
+ dev_err(&pdev->dev, "failed to get gpr regmap\n");
+ goto fail;
+ }
+ if (data->gpr)
+ regmap_update_bits(data->gpr, 4, 1<<20, 1<<20);
+ }
+
if (of_property_read_bool(np, "codec-master")) {
data->dai.dai_fmt = SND_SOC_DAIFMT_CBM_CFM;
data->is_codec_master = true;