Skip to contentSkip to conversation

ARM: dts: omap2420-n810: Add Tahvo/Betty LEDPWM and Vcore bindings

PATCH In review [email protected] 2 participants 5 messages Dec 24, 2021 – Feb 3, 2022

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 3/6 ARM: dts: omap2420-n810: Add Tahvo/Betty LEDPWM and Vcore bindings

From: Peter Vasil <[email protected]>

Nokia Tahvo/Betty ASIC provides PWM output for LED control and voltage regulator for adjustable Vcore output.
These are both used on N8x0 devices for display control; LEDPWM for backlight and Vcore for framebuffer IC power.

---
 arch/arm/boot/dts/omap2420-n810.dts         | 13 +++++++++++++
 arch/arm/boot/dts/omap2420-n8x0-common.dtsi |  8 +++++++-
 2 files changed, 20 insertions(+), 1 deletion(-)
arch/arm/boot/dts/omap2420-n810.dts +13 -0
index 09c1dbc0bb69..30f9f9e1a377 100644
@@ -22,6 +22,19 @@ v28_aic: v28_aic {
 	};
 };
 
+&tahvo {
+	tahvo_ledpwm: tahvo_ledpwm {
+		compatible = "nokia,tahvo-ledpwm";
+	};
+	tahvo_vcore: tahvo_vcore {
+		compatible = "nokia,tahvo-vcore-regulator";
+		regulator-name = "tornado_vcore";
+		regulator-min-microvolt = <1005000>;
+		regulator-max-microvolt = <1475000>;
+		regulator-always-on;
+	};
+};
+
 &omap2420_pmx {
 	mcbsp2_pins: mcbsp2_pins {
 		pinctrl-single,pins = <
arch/arm/boot/dts/omap2420-n8x0-common.dtsi +7 -1
index 63b0b4921e4e..88d44f5a5f63 100644
@@ -22,9 +22,15 @@ &gpio3 0 GPIO_ACTIVE_HIGH /* gpio64 sel */
 			#size-cells = <0>;
 			retu: retu@1 {
 				compatible = "nokia,retu";
+				reg = <0x1>;
 				interrupt-parent = <&gpio4>;
 				interrupts = <12 IRQ_TYPE_EDGE_RISING>;
-				reg = <0x1>;
+			};
+			tahvo: tahvo@2 {
+				compatible = "nokia,tahvo";
+				reg = <0x2>;
+				interrupt-parent = <&gpio4>;
+				interrupts = <15 IRQ_TYPE_EDGE_RISING>;
 			};
 		};
 	};
Signature · 1 line
2.25.1
#1 lore raw

PATCH 4/6 leds: tahvo: Driver for Tahvo/Betty ASIC LEDPWM output

From: Peter Vasil <[email protected]>

Nokia Tahvo/Betty ASIC is a companion chip for mobile devices. One of its outputs is a 127-levels PWM, usually used for LED or backlight control.
Register control code has been written based on original Nokia kernel sources for N810 display driver.
Driver expects a regmap device as parent, usually retu-mfd driver bound to the Tahvo ASIC.

---
 drivers/leds/Kconfig      | 12 ++++++
 drivers/leds/Makefile     |  1 +
 drivers/leds/leds-tahvo.c | 85 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 98 insertions(+)
 create mode 100644 drivers/leds/leds-tahvo.c
drivers/leds/Kconfig +12 -0
index ed800f5da7d8..010d455a2151 100644
@@ -871,6 +871,18 @@ config LEDS_ACER_A500
 	  This option enables support for the Power Button LED of
 	  Acer Iconia Tab A500.
 
+config LEDS_TAHVO
+	tristate "Tahvo PWM led support"
+	depends on LEDS_CLASS && MFD_RETU
+	help
+	  Tahvo PWM LED driver for Nokia Internet Tablets (770, N800,
+	  N810). At least on N810 the LCD backlight is controlled by
+	  Tahvo/Betty MFD.
+
+	  To compile this driver as a module, choose M here: the
+	  module will be called leds-tahvo.
+
+
 source "drivers/leds/blink/Kconfig"
 
 comment "Flash and Torch LED drivers"
drivers/leds/Makefile +1 -0
index c636ec069612..30832d3bc947 100644
@@ -87,6 +87,7 @@ obj-$(CONFIG_LEDS_TURRIS_OMNIA)		+= leds-turris-omnia.o
 obj-$(CONFIG_LEDS_WM831X_STATUS)	+= leds-wm831x-status.o
 obj-$(CONFIG_LEDS_WM8350)		+= leds-wm8350.o
 obj-$(CONFIG_LEDS_WRAP)			+= leds-wrap.o
+obj-$(CONFIG_LEDS_TAHVO)		+= leds-tahvo.o
 
 # LED SPI Drivers
 obj-$(CONFIG_LEDS_CR0014114)		+= leds-cr0014114.o
drivers/leds/leds-tahvo.c new file +85 -0

85 lines not on this page · raw message

Signature · 1 line
2.25.1
#2 lore raw

Re: [PATCH 4/6] leds: tahvo: Driver for Tahvo/Betty ASIC LEDPWM output

Quoted 9 lines · * [email protected] <[email protected]> [211224 21:58]:

From: Peter Vasil <[email protected]>

Nokia Tahvo/Betty ASIC is a companion chip for mobile devices. One of its outputs is a 127-levels PWM, usually used for LED or backlight control.
Register control code has been written based on original Nokia kernel sources for N810 display driver.
Driver expects a regmap device as parent, usually retu-mfd driver bound to the Tahvo ASIC.

The drivers should be sent to the driver maintainers as separate patches as listed in the MAINTAINERS file. Seems once you have the bindings can be merged separately to the subsystem trees. And at that point I can also pick up the dts patch.

Regards,

Tony

#3 lore raw

PATCH 5/6 regulator: tahvo-vcore: Add basic Tahvo/Betty ASIC Vcore output support

In reply to [email protected]

From: Peter Vasil <[email protected]>

Nokia Tahvo/Betty ASIC is a companion chip for mobile devices. One of its outputs is a Vcore adjustable voltage regulator. Register control code has been written based on original Nokia kernel sources for N810 display driver.
Driver expects a regmap device as parent, usually retu-mfd driver bound to the Tahvo ASIC.

---
 drivers/regulator/Kconfig                 |   8 ++
 drivers/regulator/Makefile                |   1 +
 drivers/regulator/tahvo-vcore-regulator.c | 104 ++++++++++++++++++++++
 3 files changed, 113 insertions(+)
 create mode 100644 drivers/regulator/tahvo-vcore-regulator.c
drivers/regulator/Kconfig +8 -0
index 6be9b1c8a615..16c684c742cf 100644
@@ -1404,6 +1404,14 @@ config REGULATOR_WM8994
 	  This driver provides support for the voltage regulators on the
 	  WM8994 CODEC.
 
+config REGULATOR_TAHVO_VCORE
+	tristate "Tahvo/Betty Vcore regulator support"
+	depends on MFD_RETU
+	help
+	  This driver supports Vcore voltage control on Nokia's Tahvo/Betty
+	  ASIC chip. The regulator controls framebuffer supply voltage in
+	  Nokia internet tablets (for sure at least N810).
+
 config REGULATOR_QCOM_LABIBB
 	tristate "QCOM LAB/IBB regulator support"
 	depends on SPMI || COMPILE_TEST
drivers/regulator/Makefile +1 -0
index b07d2a22df0b..ed64d2cf8a42 100644
@@ -170,5 +170,6 @@ obj-$(CONFIG_REGULATOR_WM831X) += wm831x-ldo.o
 obj-$(CONFIG_REGULATOR_WM8350) += wm8350-regulator.o
 obj-$(CONFIG_REGULATOR_WM8400) += wm8400-regulator.o
 obj-$(CONFIG_REGULATOR_WM8994) += wm8994-regulator.o
+obj-$(CONFIG_REGULATOR_TAHVO_VCORE) += tahvo-vcore-regulator.o
 
 ccflags-$(CONFIG_REGULATOR_DEBUG) += -DDEBUG
drivers/regulator/tahvo-vcore-regulator.c new file +104 -0

104 lines not on this page · raw message

Signature · 1 line
2.25.1
#4 lore raw

PATCH 6/6 mfd: retu: Add support for LEDPWM and Vcore regulator MFD cells

In reply to [email protected]

From: Peter Vasil <[email protected]>

Add MFD cells for new Tahvo ASIC LEDPWM and Vcore regulator drivers.

---
 drivers/mfd/retu-mfd.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/mfd/retu-mfd.c +8 -0
index c748fd29a220..3a4f3c64ae72 100644
@@ -99,6 +99,14 @@ static const struct mfd_cell tahvo_devs[] = {
 		.resources	= tahvo_usb_res,
 		.num_resources	= ARRAY_SIZE(tahvo_usb_res),
 	},
+	{
+		.name		= "tahvo-ledpwm",
+		.of_compatible	= "nokia,tahvo-ledpwm"
+	},
+	{
+		.name		= "tahvo-vcore-regulator",
+		.of_compatible	= "nokia,tahvo-vcore-regulator"
+	},
 };
 
 static struct regmap_irq tahvo_irqs[] = {
Signature · 1 line
2.25.1