diff options
author | fang hui <hui.fang@nxp.com> | 2016-10-27 14:20:53 +0800 |
---|---|---|
committer | Mohammed Habibulla <moch@google.com> | 2016-11-14 13:33:09 -0800 |
commit | 782c54641732f487ab441dc14f7eb0c83820a963 (patch) | |
tree | 3fc74e84ee76957471dc65f455483a1f213685fb | |
parent | 774955b0fb4a6a633b5897b78e639819c4301a96 (diff) | |
download | imx-v4.1-782c54641732f487ab441dc14f7eb0c83820a963.tar.gz |
Fix sgtl5000 probe issue on iopb board
On iopb board, the SYS_MCLK of sgtl5000 is from sai1 clock.
On codec driver, after clk_prepare_enable, still no clock on sai1.
Need set SAI1_MCLK_DIR to enable codec MCLK.
Change-Id: Ic963994ea6f363afd60d307614fda9b722b92865
Signed-off-by: fang hui <hui.fang@nxp.com>
-rw-r--r-- | sound/soc/codecs/sgtl5000.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c index 3a29c0ac5d8a..85f0553f1f72 100644 --- a/sound/soc/codecs/sgtl5000.c +++ b/sound/soc/codecs/sgtl5000.c @@ -29,6 +29,7 @@ #include <sound/soc.h> #include <sound/soc-dapm.h> #include <sound/initval.h> +#include <linux/mfd/syscon.h> #include "sgtl5000.h" @@ -1428,6 +1429,8 @@ static int sgtl5000_fill_defaults(struct sgtl5000_priv *sgtl5000) static int sgtl5000_i2c_probe(struct i2c_client *client, const struct i2c_device_id *id) { + struct device_node *gpr_np; + struct regmap *gpr; struct sgtl5000_priv *sgtl5000; int ret, reg, rev; struct device_node *np = client->dev.of_node; @@ -1444,6 +1447,26 @@ static int sgtl5000_i2c_probe(struct i2c_client *client, return ret; } + gpr_np = of_parse_phandle(np, "gpr", 0); + if (gpr_np) { + u32 para[4]; + + gpr = syscon_node_to_regmap(gpr_np); + if (IS_ERR(gpr)) { + ret = PTR_ERR(gpr); + dev_err(&client->dev, "Failed to get gpr regmap\n"); + return ret; + } + + ret = of_property_read_u32_array(np, "gpr", para, 4); + if(ret) { + dev_err(&client->dev, "Failed to get of_property_read_u32_array, ret %d\n", ret); + return ret; + } + + regmap_update_bits(gpr, para[1], para[2], para[3]); + } + sgtl5000->mclk = devm_clk_get(&client->dev, NULL); if (IS_ERR(sgtl5000->mclk)) { ret = PTR_ERR(sgtl5000->mclk); |