clk/power: add clock and power off driver for AS3722
Subsystems (4)
cover clk/power: add clock and power off driver for AS3722
Add power off and clock driver for the ams AS3722.
The mfd patches are depends on mfd subtree which can be applied independtly. The pacthes are created such that clock driver can go in clock tree and power off driver in power sub tree.
Laxman Dewangan (4):
mfd: as3722: add clock driver as mfd-sub device for the ams AS3722
clk: as3722: add clock driver for ams AS3722
mfd: AS3722: add dt node properties for system power controller
power: reset: as3722: add power-off driver
Documentation/devicetree/bindings/mfd/as3722.txt | 18 +++ drivers/clk/Kconfig | 8 + drivers/clk/Makefile | 1 + drivers/clk/clk-as3722.c | 166 ++++++++++++++++++++++ drivers/mfd/as3722.c | 3 + drivers/power/reset/Kconfig | 6 + drivers/power/reset/Makefile | 1 + drivers/power/reset/as3722-poweroff.c | 101 +++++++++++++ 8 files changed, 304 insertions(+), 0 deletions(-) create mode 100644 drivers/clk/clk-as3722.c create mode 100644 drivers/power/reset/as3722-poweroff.c
PATCH 1/4 mfd: as3722: add clock driver as mfd-sub device for the ams AS3722
Device ams AS3722 supports the one 32KHz clock output. The clock control support is provided through clock driver.
Add clock driver as mfd sub device to probe the clock driver.
--- Documentation/devicetree/bindings/mfd/as3722.txt | 9 +++++++++ drivers/mfd/as3722.c | 3 +++ 2 files changed, 12 insertions(+), 0 deletions(-)
Documentation/devicetree/bindings/mfd/as3722.txt +9 -0
@@ -112,6 +112,15 @@ Following are properties of regulator subnode. ams,enable-tracking: Enable tracking with SD1, only supported by LDO3. +Clock: +====== +AS3722 supports one 32KHz clock to output from device. The clock control is +provided through the clock driver. +This binding uses the common clock binding ./clock-bindings.txt. +The device node should have the optional properties to support the clock: +#clock-cells: from common clock binding; shall be set to 1. The clock id for + single clock output is 0. + Example: -------- #include <dt-bindings/mfd/as3722.h>
drivers/mfd/as3722.c +3 -0
@@ -72,6 +72,9 @@ static struct mfd_cell as3722_devs[] = { .resources = as3722_adc_resource, }, { + .name = "as3722-clk", + }, + { .name = "as3722-power-off", }, };
Signature · 1 line
1.7.1.1
Re: [PATCH 1/4] mfd: as3722: add clock driver as mfd-sub device for the ams AS3722
Quoted 9 lines · Laxman Dewangan
Device ams AS3722 supports the one 32KHz clock output. The clock control support is provided through clock driver.
Add clock driver as mfd sub device to probe the clock driver.
Signed-off-by Laxman Dewangan <[email protected]>--- Documentation/devicetree/bindings/mfd/as3722.txt | 9 +++++++++ drivers/mfd/as3722.c | 3 +++
You need to seperate the DT binding from the drivers/mfd changes.
The MFD changes are fine of course.
Signature · 4 lines
Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org ? Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog
PATCH 2/4 clk: as3722: add clock driver for ams AS3722
In reply to Laxman DewanganDevice ams AS3722 supports one clock 32KHz output. Add clock driver to control the clock through clock framework.
--- drivers/clk/Kconfig | 8 ++ drivers/clk/Makefile | 1 + drivers/clk/clk-as3722.c | 166 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 175 insertions(+), 0 deletions(-) create mode 100644 drivers/clk/clk-as3722.c
drivers/clk/Kconfig +8 -0
@@ -78,6 +78,14 @@ config CLK_TWL6040 McPDM. McPDM module is using the external bit clock on the McPDM bus as functional clock. +config COMMON_CLK_AS3722 + tristate "ams AS3722 clock32K driver" + depends on MFD_AS3722 + help + ---help--- + Supports the clocking subsystem of the ams AS3722 PMIC from ams. + This device supports one 32KHz clock. + config COMMON_CLK_AXI_CLKGEN tristate "AXI clkgen driver" depends on ARCH_ZYNQ || MICROBLAZE
drivers/clk/Makefile +1 -0
@@ -39,6 +39,7 @@ obj-$(CONFIG_COMMON_CLK_KEYSTONE) += keystone/ obj-$(CONFIG_X86) += x86/ # Chip specific +obj-$(CONFIG_COMMON_CLK_AS3722) += clk-as3722.o obj-$(CONFIG_COMMON_CLK_AXI_CLKGEN) += clk-axi-clkgen.o obj-$(CONFIG_COMMON_CLK_WM831X) += clk-wm831x.o obj-$(CONFIG_COMMON_CLK_MAX77686) += clk-max77686.o
drivers/clk/clk-as3722.c new file +166 -0
166 lines not on this page · raw message
Signature · 1 line
1.7.1.1
PATCH 3/4 mfd: AS3722: add dt node properties for system power controller
In reply to Laxman Dewanganams AS3722 device supports the power off by turning off its all rails.
Add dt node properties to enable this functionality on this device.
--- Documentation/devicetree/bindings/mfd/as3722.txt | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-)
Documentation/devicetree/bindings/mfd/as3722.txt +9 -0
@@ -121,6 +121,15 @@ The device node should have the optional properties to support the clock: #clock-cells: from common clock binding; shall be set to 1. The clock id for single clock output is 0. +Power-off: +========= + +AS3722 supports the system power off by turning off all its rail. The power off +is provided through pm power off. +The device node should have the following properties to enable power-off +functionality from ams AS3722: +ams,system-power-controller: To enable the power off functionality through + device. Example: -------- #include <dt-bindings/mfd/as3722.h>
Signature · 1 line
1.7.1.1
PATCH 4/4 power: reset: as3722: add power-off driver
In reply to Laxman Dewanganams AS3722 supports the power off functionality to turn off system.
Add power off driver for ams AS3722.
--- drivers/power/reset/Kconfig | 6 ++ drivers/power/reset/Makefile | 1 + drivers/power/reset/as3722-poweroff.c | 101 +++++++++++++++++++++++++++++++++ 3 files changed, 108 insertions(+), 0 deletions(-) create mode 100644 drivers/power/reset/as3722-poweroff.c
drivers/power/reset/Kconfig +6 -0
@@ -6,6 +6,12 @@ menuconfig POWER_RESET Say Y here to enable board reset and power off +config POWER_RESET_AS3722 + bool "ams AS3722 power-off driver" + depends on MFD_AS3722 && POWER_RESET + help + This driver supports turning off board via a ams AS3722 power-off. + config POWER_RESET_GPIO bool "GPIO power-off driver" depends on OF_GPIO && POWER_RESET
drivers/power/reset/Makefile +1 -0
@@ -1,3 +1,4 @@ +obj-$(CONFIG_POWER_RESET_AS3722) += as3722-poweroff.o obj-$(CONFIG_POWER_RESET_GPIO) += gpio-poweroff.o obj-$(CONFIG_POWER_RESET_MSM) += msm-poweroff.o obj-$(CONFIG_POWER_RESET_QNAP) += qnap-poweroff.o
drivers/power/reset/as3722-poweroff.c new file +101 -0
101 lines not on this page · raw message
Signature · 1 line
1.7.1.1