Add support for MediaTek regulator vibrator driver
Subsystems (3)
PATCH 1/1 Add support for MediaTek regulator vibrator driver
This patchset add regulator vibrator driver for MTK Soc. The driver controls vibrator through regulator's enable and disable.
Xing Zhang (3):
dt-bindings: add regulator vibrator documentation
arm64: mediatek: Add regulator vibrator support
Vibrator: Add regulator vibrator driver
.../bindings/leds/regulator-vibrator.txt | 39 ++ arch/arm64/configs/defconfig | 1 + drivers/leds/Kconfig | 10 + drivers/leds/Makefile | 1 + drivers/leds/regulator-vibrator.c | 450 ++++++++++++++++++ 5 files changed, 501 insertions(+) create mode 100644 Documentation/devicetree/bindings/leds/regulator-vibrator.txt create mode 100644 drivers/leds/regulator-vibrator.c
PATCH 1/3 dt-bindings: add regulator vibrator documentation
From: Xing Zhang <[email protected]>
Add the DT binding documentation for regulator vibrator
--- .../bindings/leds/regulator-vibrator.txt | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 Documentation/devicetree/bindings/leds/regulator-vibrator.txt
Documentation/devicetree/bindings/leds/regulator-vibrator.txt new file +39 -0
@@ -0,0 +1,39 @@ +* Regulator vibrator device tree bindings + +Required Properties: + - compatible : Should be "regulator-vibrator" + - vibr-supply : Power supply to the vibrator. + [*] refer Documentation/devicetree/bindings/regulator/regulator.txt + + - max-volt : The maximum voltage value supplied to the vibrator regulator. + [The unit of the voltage is a micro] + + - min-volt : The minimum voltage value supplied to the vibrator regulator. + [The unit of the voltage is a micro] + +Optional properties: + - min-limit : Set the minimum time in ms for vibrator , default is 15ms, + if user request duration is smaller, this value will be used instead. + the default value comes from the smallest unit that can be sensed. + + - max-limit : Set the maximum time in ms for vibrator. + if not set, it means no max limitation. + +Example: + + mt6359_vibr_ldo_reg: ldo_vibr { + regulator-name = "vibr"; + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <3300000>; + regulator-enable-ramp-delay = <240>; + }; + + regulator_vibrator { + compatible = "regulator-vibrator"; + min-volt = <2300000>; + max-volt = <3200000>; + max-limit = <15000>; + min-limit = <15>; + vib-supply = <&mt6359_vibr_ldo_reg>; + }; +
Signature · 1 line
2.18.0
PATCH 2/3 arm64: mediatek: Add regulator vibrator support
In reply to Xing ZhangFrom: Xing Zhang <[email protected]>
Add CONFIG_LEDS_REGULATOR_VIBRATOR=y in defconfig
--- arch/arm64/configs/defconfig | 1 + 1 file changed, 1 insertion(+)
arch/arm64/configs/defconfig +1 -0
@@ -723,6 +723,7 @@ CONFIG_LEDS_CLASS=y CONFIG_LEDS_GPIO=y CONFIG_LEDS_PWM=y CONFIG_LEDS_SYSCON=y +CONFIG_LEDS_REGULATOR_VIBRATOR=y CONFIG_LEDS_TRIGGER_DISK=y CONFIG_LEDS_TRIGGER_HEARTBEAT=y CONFIG_LEDS_TRIGGER_CPU=y
Signature · 1 line
2.18.0
PATCH 3/3 Vibrator: Add regulator vibrator driver
In reply to Xing ZhangFrom: Xing Zhang <[email protected]>
This adds support for trgulator vibrator
The vibration time is controlled by a timer,
just like other led devices
--- drivers/leds/Kconfig | 10 + drivers/leds/Makefile | 1 + drivers/leds/regulator-vibrator.c | 450 ++++++++++++++++++++++++++++++ 3 files changed, 461 insertions(+) create mode 100644 drivers/leds/regulator-vibrator.c
drivers/leds/Kconfig +10 -0
@@ -846,6 +846,16 @@ config LEDS_TPS6105X It is a single boost converter primarily for white LEDs and audio amplifiers. +config LEDS_REGULATOR_VIBRATOR + tristate "LED regulator vibrator support" + depends on LEDS_CLASS + help + This option enables support for LED regulator vibrator. + say 'y' to enable this + + To compile this driver as a module, choose 'M' here: the module + will be called regulator-vibrator. + config LEDS_IP30 tristate "LED support for SGI Octane machines" depends on LEDS_CLASS
drivers/leds/Makefile +1 -0
@@ -39,6 +39,7 @@ obj-$(CONFIG_LEDS_LM3532) += leds-lm3532.o obj-$(CONFIG_LEDS_LM3533) += leds-lm3533.o obj-$(CONFIG_LEDS_LM355x) += leds-lm355x.o obj-$(CONFIG_LEDS_LM3601X) += leds-lm3601x.o +obj-$(CONFIG_LEDS_LM3697) += leds-lm3697.o obj-$(CONFIG_LEDS_LM36274) += leds-lm36274.o obj-$(CONFIG_LEDS_LM3642) += leds-lm3642.o obj-$(CONFIG_LEDS_LM3692X) += leds-lm3692x.o
drivers/leds/regulator-vibrator.c new file +450 -0
450 lines not on this page · raw message
Signature · 1 line
2.18.0
Hi!
Quoted 2 lines
This patchset add regulator vibrator driver for MTK Soc. The driver controls vibrator through regulator's enable and disable.
We'd prefer not to have vibrators in led subsystem.
Quoted 11 lines
Xing Zhang (3):
dt-bindings: add regulator vibrator documentation
arm64: mediatek: Add regulator vibrator support
Vibrator: Add regulator vibrator driver.../bindings/leds/regulator-vibrator.txt | 39 ++ arch/arm64/configs/defconfig | 1 + drivers/leds/Kconfig | 10 + drivers/leds/Makefile | 1 + drivers/leds/regulator-vibrator.c | 450 ++++++++++++++++++
OTOH, connecting LED to regulator might make some sense. I can take the driver with vibrator functionality stripped, provided it is named the usual way...
Best regards,
Pavel
Hi Pavel,
Quoted 13 lines · Pavel Machek
Hi!
Quoted 2 lines
This patchset add regulator vibrator driver for MTK Soc. The driver controls vibrator through regulator's enable and disable.
We'd prefer not to have vibrators in led subsystem.
Quoted 6 lines
Xing Zhang (3):
dt-bindings: add regulator vibrator documentation
arm64: mediatek: Add regulator vibrator support
Vibrator: Add regulator vibrator driver
Quoted 8 lines
Quoted 5 lines
.../bindings/leds/regulator-vibrator.txt | 39 ++ arch/arm64/configs/defconfig | 1 + drivers/leds/Kconfig | 10 + drivers/leds/Makefile | 1 + drivers/leds/regulator-vibrator.c | 450 ++++++++++++++++++OTOH, connecting LED to regulator might make some sense. I can take the driver with vibrator functionality stripped, provided it is named the usual way...
We already had an attempt of solving this in more generic way [0], but you opposed then [1]. Just for the record.
[0] https://lore.kernel.org/linux-leds/[email protected]/
[1] https://lore.kernel.org/linux-leds/20170914205804.GA24339@amd/
Signature · 2 lines
Best regards, Jacek Anaszewski
Quoted 22 lines · Jacek Anaszewski
Hi Pavel,
Quoted 19 lines · Pavel Machek
Hi!
Quoted 2 lines
This patchset add regulator vibrator driver for MTK Soc. The driver controls vibrator through regulator's enable and disable.
We'd prefer not to have vibrators in led subsystem.
Quoted 11 lines
Xing Zhang (3):
dt-bindings: add regulator vibrator documentation
arm64: mediatek: Add regulator vibrator support
Vibrator: Add regulator vibrator driver.../bindings/leds/regulator-vibrator.txt | 39 ++ arch/arm64/configs/defconfig | 1 + drivers/leds/Kconfig | 10 + drivers/leds/Makefile | 1 + drivers/leds/regulator-vibrator.c | 450 ++++++++++++++++++
Quoted 5 lines
Quoted 2 lines
OTOH, connecting LED to regulator might make some sense. I can take the driver with vibrator functionality stripped, provided it is named the usual way...
We already had an attempt of solving this in more generic way [0], but you opposed then [1]. Just for the record.
That's something different. led-regulator.c might be acceptable. Special code to support vibrator quirks... not so much.
Best regards,
Pavel
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html