diff options
author | Eric Nelson <eric@nelint.com> | 2016-06-06 19:14:51 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2016-06-15 09:09:26 -0400 |
commit | 08dea16e0960ea5caf7876045b747145cb677096 (patch) | |
tree | fe82f1e933151b82d45e1378e7055af6a5d38c0c /sound | |
parent | 3d632cc87204b51a4b32bdaa970fe6b8d879347e (diff) |
ASoC: sgtl5000: Disable internal PLL early
To handle the soft reboot case, the internal PLL must be
disabled in SGTL5000_CHIP_CLK_CTRL before clearing bits
SGTL5000_VCOAMP_POWERUP and SGTL5000_PLL_POWERUP in
register SGTL5000_CHIP_ANA_POWER.
Signed-off-by: Eric Nelson <eric@nelint.com>
Signed-off-by: Clemens Gruber <clemens.gruber@pqgruber.com>
Tested-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/codecs/sgtl5000.c | 9 | ||||
-rw-r--r-- | sound/soc/codecs/sgtl5000.h | 1 |
2 files changed, 9 insertions, 1 deletions
diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c index 42f2eb62664e..0916bb46ccf2 100644 --- a/sound/soc/codecs/sgtl5000.c +++ b/sound/soc/codecs/sgtl5000.c | |||
@@ -38,7 +38,6 @@ | |||
38 | /* default value of sgtl5000 registers */ | 38 | /* default value of sgtl5000 registers */ |
39 | static const struct reg_default sgtl5000_reg_defaults[] = { | 39 | static const struct reg_default sgtl5000_reg_defaults[] = { |
40 | { SGTL5000_CHIP_DIG_POWER, 0x0000 }, | 40 | { SGTL5000_CHIP_DIG_POWER, 0x0000 }, |
41 | { SGTL5000_CHIP_CLK_CTRL, 0x0008 }, | ||
42 | { SGTL5000_CHIP_I2S_CTRL, 0x0010 }, | 41 | { SGTL5000_CHIP_I2S_CTRL, 0x0010 }, |
43 | { SGTL5000_CHIP_SSS_CTRL, 0x0010 }, | 42 | { SGTL5000_CHIP_SSS_CTRL, 0x0010 }, |
44 | { SGTL5000_CHIP_ADCDAC_CTRL, 0x020c }, | 43 | { SGTL5000_CHIP_ADCDAC_CTRL, 0x020c }, |
@@ -1279,6 +1278,14 @@ static int sgtl5000_i2c_probe(struct i2c_client *client, | |||
1279 | dev_info(&client->dev, "sgtl5000 revision 0x%x\n", rev); | 1278 | dev_info(&client->dev, "sgtl5000 revision 0x%x\n", rev); |
1280 | sgtl5000->revision = rev; | 1279 | sgtl5000->revision = rev; |
1281 | 1280 | ||
1281 | /* reconfigure the clocks in case we're using the PLL */ | ||
1282 | ret = regmap_write(sgtl5000->regmap, | ||
1283 | SGTL5000_CHIP_CLK_CTRL, | ||
1284 | SGTL5000_CHIP_CLK_CTRL_DEFAULT); | ||
1285 | if (ret) | ||
1286 | dev_err(&client->dev, | ||
1287 | "Error %d initializing CHIP_CLK_CTRL\n", ret); | ||
1288 | |||
1282 | /* Follow section 2.2.1.1 of AN3663 */ | 1289 | /* Follow section 2.2.1.1 of AN3663 */ |
1283 | ana_pwr = SGTL5000_ANA_POWER_DEFAULT; | 1290 | ana_pwr = SGTL5000_ANA_POWER_DEFAULT; |
1284 | if (sgtl5000->num_supplies <= VDDD) { | 1291 | if (sgtl5000->num_supplies <= VDDD) { |
diff --git a/sound/soc/codecs/sgtl5000.h b/sound/soc/codecs/sgtl5000.h index 1be82379c689..22f3442af982 100644 --- a/sound/soc/codecs/sgtl5000.h +++ b/sound/soc/codecs/sgtl5000.h | |||
@@ -92,6 +92,7 @@ | |||
92 | /* | 92 | /* |
93 | * SGTL5000_CHIP_CLK_CTRL | 93 | * SGTL5000_CHIP_CLK_CTRL |
94 | */ | 94 | */ |
95 | #define SGTL5000_CHIP_CLK_CTRL_DEFAULT 0x0008 | ||
95 | #define SGTL5000_RATE_MODE_MASK 0x0030 | 96 | #define SGTL5000_RATE_MODE_MASK 0x0030 |
96 | #define SGTL5000_RATE_MODE_SHIFT 4 | 97 | #define SGTL5000_RATE_MODE_SHIFT 4 |
97 | #define SGTL5000_RATE_MODE_WIDTH 2 | 98 | #define SGTL5000_RATE_MODE_WIDTH 2 |