Skip to content

Commit 08dea16

Browse files
ericnelsonazbroonie
authored andcommitted
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 <[email protected]> Signed-off-by: Clemens Gruber <[email protected]> Tested-by: Fabio Estevam <[email protected]> Signed-off-by: Mark Brown <[email protected]>
1 parent 3d632cc commit 08dea16

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

sound/soc/codecs/sgtl5000.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
/* default value of sgtl5000 registers */
3939
static const struct reg_default sgtl5000_reg_defaults[] = {
4040
{ SGTL5000_CHIP_DIG_POWER, 0x0000 },
41-
{ SGTL5000_CHIP_CLK_CTRL, 0x0008 },
4241
{ SGTL5000_CHIP_I2S_CTRL, 0x0010 },
4342
{ SGTL5000_CHIP_SSS_CTRL, 0x0010 },
4443
{ SGTL5000_CHIP_ADCDAC_CTRL, 0x020c },
@@ -1279,6 +1278,14 @@ static int sgtl5000_i2c_probe(struct i2c_client *client,
12791278
dev_info(&client->dev, "sgtl5000 revision 0x%x\n", rev);
12801279
sgtl5000->revision = rev;
12811280

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+
12821289
/* Follow section 2.2.1.1 of AN3663 */
12831290
ana_pwr = SGTL5000_ANA_POWER_DEFAULT;
12841291
if (sgtl5000->num_supplies <= VDDD) {

sound/soc/codecs/sgtl5000.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@
9292
/*
9393
* SGTL5000_CHIP_CLK_CTRL
9494
*/
95+
#define SGTL5000_CHIP_CLK_CTRL_DEFAULT 0x0008
9596
#define SGTL5000_RATE_MODE_MASK 0x0030
9697
#define SGTL5000_RATE_MODE_SHIFT 4
9798
#define SGTL5000_RATE_MODE_WIDTH 2

0 commit comments

Comments
 (0)