aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator/slg51000-regulator.c
AgeCommit message (Collapse)Author
2022-12-14regulator: slg51000: Wait after asserting CS pinKonrad Dybcio
[ Upstream commit 0b24dfa587c6cc7484cfb170da5c7dd73451f670 ] 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> Link: https://lore.kernel.org/r/20221118131035.54874-1-konrad.dybcio@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-09-09regulator: slg51000: use devm_gpiod_get_optional() in probeDmitry Torokhov
The CS GPIO line is clearly optional GPIO (and marked as such in the binding document) and we should handle it accordingly. The current code treats all errors as meaning that there is no GPIO defined, which is wrong, as it does not handle deferrals raised by the underlying code properly, nor does it recognize non-existing GPIO from any other initialization error. As far as I can see the only reason the driver, unlike all others, is using OF-specific devm_gpiod_get_from_of_node() so that it can assign a custom label to the selected GPIO line. Given that noone else needs that, it should not be doing that either. Let's switch to using more appropriate devm_gpiod_get_optional(). Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Link: https://lore.kernel.org/r/20190904214200.GA66118@dtor-ws Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-08regulator: slg51000: Fix a couple NULL vs IS_ERR() checksDan Carpenter
The devm_gpiod_get_from_of_node() function never returns NULL, it returns error pointers on error. Fixes: a867bde3dd03 ("regulator: slg51000: add slg51000 regulator driver") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Link: https://lore.kernel.org/r/20190808103335.GD30506@mwanda Signed-off-by: Mark Brown <broonie@kernel.org>
2019-05-24regulator: slg51000: Remove unneeded regl_pdata from struct slg51000Axel Lin
Just use a local variable *ena_gpiod in slg51000_of_parse_cb instead. With this change, the struct slg51000_pdata can be removed. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-05-24regulator: slg51000: Constify slg51000_regl_ops and slg51000_switch_opsAxel Lin
These regulator_ops variables never need to be modified, make them const so compiler can put them to .rodata. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-05-13regulator: slg51000: add slg51000 regulator driverEric Jeong
Adding regulator driver for the device Dialog SLG51000. The SLG51000 device contains seven compact and customizable low dropout regulators and is designed for high performance camera modules and other small multi-rail applications. Signed-off-by: Eric Jeong <eric.jeong.opensource@diasemi.com> Signed-off-by: Mark Brown <broonie@kernel.org>