Skip to contentSkip to conversation

regulator: Add Fairchild FAN53555 driver

PATCH Applied Alexander Shiyan 2 participants 3 messages Jun 21, 2024 – Jul 1, 2024 Voltage and current regulator framework

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 regulator: Add Fairchild FAN53555 driver

This driver supports Fairchild FAN53555 Digitally Programmable TinyBuck Regulator.

Supported ICs:
fan53526, fan53555, rk8600, rk8602, syr827, syr828, tcs4525, tcs4526.

The driver is written based on the fan53555.c linux kernel driver. Widely used in new developments based on Rockchip SOCs RK35xx.

---
 drivers/regulator/Kconfig    |  11 +
 drivers/regulator/Makefile   |   1 +
 drivers/regulator/fan53555.c | 481 +++++++++++++++++++++++++++++++++++
 3 files changed, 493 insertions(+)
 create mode 100644 drivers/regulator/fan53555.c
drivers/regulator/Kconfig +11 -0
index 17e217f0bb..54f27e1824 100644
@@ -17,6 +17,17 @@ config REGULATOR_BCM283X
 	depends on ARCH_BCM283X
 	default y
 
+config REGULATOR_FAN53555
+	bool "Fairchild FAN53555 Regulator"
+	depends on I2C
+	depends on OFDEVICE
+	help
+	  This driver supports Fairchild FAN53555 Digitally Programmable
+	  TinyBuck Regulator. The FAN53555 is a step-down switching voltage
+	  regulator that delivers a digitally programmable output from an
+	  input voltage supply of 2.5V to 5.5V. The output voltage is
+	  programmed through an I2C interface.
+
 config REGULATOR_PFUZE
 	bool "Freescale PFUZE100/200/3000 regulator driver"
 	depends on I2C
drivers/regulator/Makefile +1 -0
index 95e42719d1..54ab6ef650 100644
@@ -1,6 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0-only
 obj-$(CONFIG_REGULATOR) += core.o helpers.o
 obj-$(CONFIG_OFDEVICE) += of_regulator.o
+obj-$(CONFIG_REGULATOR_FAN53555) += fan53555.o
 obj-$(CONFIG_REGULATOR_FIXED) += fixed.o
 obj-$(CONFIG_REGULATOR_BCM283X) += bcm2835.o
 obj-$(CONFIG_REGULATOR_PFUZE) += pfuze.o
drivers/regulator/fan53555.c new file +481 -0

481 lines not on this page · raw message

Signature · 1 line
2.39.1
Applied
#1 lore raw
Quoted 9 lines · Alexander Shiyan

This driver supports Fairchild FAN53555 Digitally Programmable TinyBuck Regulator.

Supported ICs:
fan53526, fan53555, rk8600, rk8602, syr827, syr828, tcs4525, tcs4526.

The driver is written based on the fan53555.c linux kernel driver. Widely used in new developments based on Rockchip SOCs RK35xx.

[...]

Applied, thanks!

[1/1] regulator: Add Fairchild FAN53555 driver
https://git.pengutronix.de/cgit/barebox/commit/?id=89c910777dd5 (link may not be stable)

Best regards,

Signature · 1 line
Sascha Hauer <[email protected]>
#2 lore raw
In reply to Alexander Shiyan

drivers/regulator/fan53555.c line 418

Quoted 11 lines · Alexander Shiyan

This driver supports Fairchild FAN53555 Digitally Programmable TinyBuck Regulator.

Supported ICs:
fan53526, fan53555, rk8600, rk8602, syr827, syr828, tcs4525, tcs4526.

The driver is written based on the fan53555.c linux kernel driver. Widely used in new developments based on Rockchip SOCs RK35xx.

drivers/regulator/fan53555.c new file +3 -0
+	ret = of_property_read_u32(np, "fcs,suspend-voltage-selector", &val);
+	if (!ret) {
+		if (val >> 1) {

Although is funcionally the same you likely wanted to write val > 1 here. Replaced this with the easier to read version ;)

Sascha

Quoted 8 lines
drivers/regulator/fan53555.c new file +8 -0
+			dev_err(di->dev, "Invalid VSEL ID=%u!\n", val);
+			ret = -EINVAL;
+			goto err;
+		}
+
+		di->sleep_vsel_id = val;
+	}
+
Signature · 4 lines
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |