regulator: slg51000: Wait after asserting CS pin

Message ID 20221118131035.54874-1-konrad.dybcio@linaro.org
State New
Headers
Series regulator: slg51000: Wait after asserting CS pin |

Commit Message

Konrad Dybcio Nov. 18, 2022, 1:10 p.m. UTC
  Sony's downstream driver [1], among some other changes, adds a
seemingly random 10ms usleep_range, which turned out to be necessary
for the hardware to function properly on at least Sony Xperia 1 IV.
Without this, I2C transactions with the SLG51000 straight up fail.

Relax (10-10ms -> 10-11ms) and add the aforementioned sleep to make
sure the hardware has some time to wake up.

(nagara-2.0.0-mlc/vendor/semc/hardware/camera-kernel-module/)
[1] https://developer.sony.com/file/download/open-source-archive-for-64-0-m-4-29/

Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
---
 drivers/regulator/slg51000-regulator.c | 2 ++
 1 file changed, 2 insertions(+)
  

Comments

Mark Brown Nov. 18, 2022, 3:03 p.m. UTC | #1
On Fri, 18 Nov 2022 14:10:35 +0100, Konrad Dybcio wrote:
> Sony's downstream driver [1], among some other changes, adds a
> seemingly random 10ms usleep_range, which turned out to be necessary
> for the hardware to function properly on at least Sony Xperia 1 IV.
> Without this, I2C transactions with the SLG51000 straight up fail.
> 
> Relax (10-10ms -> 10-11ms) and add the aforementioned sleep to make
> sure the hardware has some time to wake up.
> 
> [...]

Applied to

   broonie/regulator.git for-next

Thanks!

[1/1] regulator: slg51000: Wait after asserting CS pin
      commit: 0b24dfa587c6cc7484cfb170da5c7dd73451f670

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark
  

Patch

diff --git a/drivers/regulator/slg51000-regulator.c b/drivers/regulator/slg51000-regulator.c
index 75a941fb3c2b..1b2eee95ad3f 100644
--- a/drivers/regulator/slg51000-regulator.c
+++ b/drivers/regulator/slg51000-regulator.c
@@ -457,6 +457,8 @@  static int slg51000_i2c_probe(struct i2c_client *client)
 		chip->cs_gpiod = cs_gpiod;
 	}
 
+	usleep_range(10000, 11000);
+
 	i2c_set_clientdata(client, chip);
 	chip->chip_irq = client->irq;
 	chip->dev = dev;