Skip to content

RFC ASoC: sgtl5000: fix use of regulators and internal LDO

Eric Nelson alsa-devel 1 version In review

Get series with b4
b4 am 1424991273-10081-1-git-send-email-eric.nelson@boundarydevices.com

Versions newest first

  1. v1 RFC Latest6 patches 22 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6ASoC: sgtl5000: fix regulator supportsound/soc/codecs/sgtl5000.c+78 -2653 replies
2/6ASoC: sgtl5000: write all default registerssound/soc/codecs/sgtl5000.c+6 -73 replies
3/6ASoC: sgtl5000: initialize CHIP_ANA_POWER to power-on defaultssound/soc/codecs/sgtl5000.c sound/soc/codecs/sgtl5000.h+10 -323 replies
4/6ASoC: sgtl5000: check return valuessound/soc/codecs/sgtl5000.c+15 -60 replies
5/6ASoC: sgtl5000: disable internal PLL earlysound/soc/codecs/sgtl5000.c sound/soc/codecs/sgtl5000.h+9 -13 replies
6/6ASoC: sgtl5000: Don't disable regulators in SND_SOC_BIAS_OFFsound/soc/codecs/sgtl5000.c+5 -273 replies

Reviews trailers per patch

None of the 6 patches has a Reviewed-by or Acked-by.

PatchFabio Estevam
1/6
2/6T-b
3/6
4/6
5/6T-b
6/6

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH RFC 0/6] ASoC: sgtl5000: fix use of regulators and internal LDO

This patch set addresses a structural problem in the handling of regulators for VDDIO, VDDA, and VDDD in the SGTL5000 driver.

The first two of these power rails must be powered on prior to any I2C communication, and yet the regulators were tied to the codec, which is instantiated only after a fair amount of I2C communication takes place.

In other words, these regulators could never have function, and we can surmise that no user of this driver has switched power supply rails connected to them.

The third power rail (VDDD) can be derived internally (by using I2C registers) though the data sheet says that if an external VDDD is used, it should be enabled before MCLK is started and I2C activity begins.

Patch 1 moves the regulators to the I2C device and initializes them before
I2C activity.
Patch 2 addresses an issue found during development of the patch and is
somewhat unrelated to regulators. It is included for discussion
Patch 3 removes the root cause of patch 2
Patch 4 adds return value checks when setting the LINREG and ANA_POWER
registers
Patch 5 addresses the cause of follow-on failures and the source of the
error in patch 3.
Patch 6 removes the naive use of the supplies to lower power consumption
and replaces it with something more modest.

The patch set is being sent as an RFC for discussion, and should probably be squashed into two or three patches covering the regulator updates (patches 1, 3-5 and perhaps 6), initialization error handling (patch 2).

Eric Nelson (6):
ASoC: sgtl5000: fix regulator support
ASoC: sgtl5000: write all default registers
ASoC: sgtl5000: initialize CHIP_ANA_POWER to power-on defaults
ASoC: sgtl5000: check return values
ASoC: sgtl5000: disable internal PLL early
ASoC: sgtl5000: Don't disable regulators in SND_SOC_BIAS_OFF

 sound/soc/codecs/sgtl5000.c | 417 +++++++++++---------------------------------
 sound/soc/codecs/sgtl5000.h |   2 +
 2 files changed, 102 insertions(+), 317 deletions(-)
Signature · 1 line
1.9.1