Skip to contentSkip to conversation

regulator: add s2dos05 regulator support

PATCH In review Dzmitry Sankouski 2 participants 2 messages Aug 5, 2025 – Aug 12, 2025

Subsystems (3)

v8 of 17 In review Latest is v17 →

lore
Share & tools
lore
#0 lore raw

PATCH v8 1/1 regulator: add s2dos05 regulator support

S2DOS05 has 1 buck and 4 LDO regulators, used for powering panel/touchscreen.

---
The S2DOS05 is a companion power management IC for the panel and touchscreen
in smart phones. Provides voltage regulators and
ADC for power/current measurements.
---
Changes in v8:
- refactoring and optimizations
- Link to v7: https://lore.kernel.org/r/20250802-starqltechn_integration_upstream-v7-1-98ed0e1e1185@gmail.com

Changes in v7:
- rebase on latest linux-next
- update cc list
- Link to v6: https://lore.kernel.org/r/20241007-starqltechn_integration_upstream-v6-0-264309aa66de@gmail.com

Changes in v6:
- fix uninitialized ret variable
- Link to v5: https://lore.kernel.org/r/20240617-starqltechn_integration_upstream-v5-0-ea1109029ba5@gmail.com

Changes in v5:
- Split patchset per subsystem
- Rewrite cover letter
- Link to v4: https://lore.kernel.org/r/20240913-starqltechn_integration_upstream-v4-0-2d2efd5c5877@gmail.com

Changes in v4:
- Rewrite max77705, max77705_charger, max77705_fuel_gauge from scratch
- Reorder patches:
- squash max77705 subdevice bindings in core file because
no resources there
- split device tree changes
- Use _ as space for filenames in power/supply like the majority
- Replace gcc-845 freq_tbl frequencies patch with new approach,
based on automatic m/n/pre_div value generation
- Link to v3: https://lore.kernel.org/r/20240618-starqltechn_integration_upstream-v3-0-e3f6662017ac@gmail.com

Changes in version 3:
- s2dos05 driver converted to MFD

Changes in version 2:
- s2dos05 regulator:
- hex to decimal in regulator values
- fix compatible value
- remove interrupt specific code, because it's empty in vendor kernel, and I cannot test it on available hardware anyway.
---
Changes in v8:
- return immediately, if any regulator register fails
- move config assignment out of regulator loop
- inline ret variable
- remove unneeded rdata
- inline i declaration
- use dev_err_probe over dev_err in probe function
- increment copyright year

Changes in v7:
- rebase on latest linux-next
- update cc list
- run sparse and smatch again

Changes in v6:
- run sparse and smatch
- initialize ret variable

Changes in v5:
- fix Kconfig and module description to be the same
- make regulators const
- code refactoring
- replace s2m* pattern on s2* to include s2dos05

Changes in v4:
- remove excessive linux/module.h import
- use generic regulator helpers
- use of_match
- use devm_* for mem allocations
- use // style comment
- drop all junk Samsung code
- adjust to depend on sec-core

---
 MAINTAINERS                           |   2 +-
 drivers/regulator/Kconfig             |   8 ++
 drivers/regulator/Makefile            |   1 +
 drivers/regulator/s2dos05-regulator.c | 165 ++++++++++++++++++++++++++++++++++
 include/linux/regulator/s2dos05.h     |  73 +++++++++++++++
 5 files changed, 248 insertions(+), 1 deletion(-)
MAINTAINERS +1 -1
index 494b12c03de7..12dd90438bd7 100644
@@ -22391,7 +22391,7 @@ F:	Documentation/devicetree/bindings/regulator/samsung,s2m*.yaml
 F:	Documentation/devicetree/bindings/regulator/samsung,s5m*.yaml
 F:	drivers/clk/clk-s2mps11.c
 F:	drivers/mfd/sec*.[ch]
-F:	drivers/regulator/s2m*.c
+F:	drivers/regulator/s2*.c
 F:	drivers/regulator/s5m*.c
 F:	drivers/rtc/rtc-s5m.c
 F:	include/linux/mfd/samsung/
drivers/regulator/Kconfig +8 -0
index eaa6df1c9f80..2399c8a9a1c5 100644
@@ -1344,6 +1344,14 @@ config REGULATOR_RTQ2208
 	  and two ldos. It features wide output voltage range from 0.4V to 2.05V
 	  and the capability to configure the corresponding power stages.
 
+config REGULATOR_S2DOS05
+	tristate "Samsung S2DOS05 voltage regulator"
+	depends on MFD_SEC_CORE || COMPILE_TEST
+	help
+	  This driver provides support for the voltage regulators of the S2DOS05.
+	  The S2DOS05 is a companion power management IC for the smart phones.
+	  The S2DOS05 has 4 LDOs and 1 BUCK outputs.
+
 config REGULATOR_S2MPA01
 	tristate "Samsung S2MPA01 voltage regulator"
 	depends on MFD_SEC_CORE || COMPILE_TEST
drivers/regulator/Makefile +1 -0
index be98b29d6675..78605b0fa0b2 100644
@@ -156,6 +156,7 @@ obj-$(CONFIG_REGULATOR_RTMV20)	+= rtmv20-regulator.o
 obj-$(CONFIG_REGULATOR_RTQ2134) += rtq2134-regulator.o
 obj-$(CONFIG_REGULATOR_RTQ6752)	+= rtq6752-regulator.o
 obj-$(CONFIG_REGULATOR_RTQ2208) += rtq2208-regulator.o
+obj-$(CONFIG_REGULATOR_S2DOS05) += s2dos05-regulator.o
 obj-$(CONFIG_REGULATOR_S2MPA01) += s2mpa01.o
 obj-$(CONFIG_REGULATOR_S2MPS11) += s2mps11.o
 obj-$(CONFIG_REGULATOR_S5M8767) += s5m8767.o
drivers/regulator/s2dos05-regulator.c new file +165 -0

165 lines not on this page · raw message

include/linux/regulator/s2dos05.h new file +73 -0

73 lines not on this page · raw message

---
base-commit: b9ddaa95fd283bce7041550ddbbe7e764c477110
change-id: 20240617-starqltechn_integration_upstream-bc86850b2fe3

Best regards,

Signature · 1 line
Dzmitry Sankouski <[email protected]>
maintainer
#1 lore raw
Quoted 4 lines · Dzmitry Sankouski

S2DOS05 has 1 buck and 4 LDO regulators, used for powering panel/touchscreen.

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-next

Thanks!

[1/1] regulator: add s2dos05 regulator support

      commit: bb2441402392ef1f49563be68e8f0dcb127ac965

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