clk/power: add clock and power off driver for AS3722
Subsystems (4)
v2 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.
Changes from V1:
- Split the DT doc and driver change in two changes.
- Keeping all other code same as V1.
Laxman Dewangan (5):
mfd: as3722: add clock driver as mfd-sub device
mfd: as3722: add DT details for clock support of 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 v2 1/5 mfd: as3722: add clock driver as mfd-sub device
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.
---
Changes from V1:
- Move the DT doc change to separate change.
drivers/mfd/as3722.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
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 V2 1/5] mfd: as3722: add clock driver as mfd-sub device
Quoted 18 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]>---
Changes from V1:
- Move the DT doc change to separate change.drivers/mfd/as3722.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)drivers/mfd/as3722.c +0
-0
drivers/mfd/as3722.c static struct mfd_cell as3722_devs[] = { · line 80
Quoted 9 lines
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 · 4 lines
Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org ? Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog
PATCH v2 2/5 mfd: as3722: add DT details for clock support of ams AS3722
In reply to Laxman DewanganAdd DT details for using the clocks from ams AS3722.
---
Changes from V1:
- This is new patch of series which was part of code change, splitting it on different change.
Documentation/devicetree/bindings/mfd/as3722.txt | 9 +++++++++ 1 files changed, 9 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>
Signature · 1 line
1.7.1.1
PATCH v2 3/5 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.
---
Changes from V1:
- None.
drivers/clk/Kconfig | 8 ++ drivers/clk/Makefile | 1 + drivers/clk/clk-as3722.c | 161 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 170 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 +161 -0
161 lines not on this page · raw message
Signature · 1 line
1.7.1.1
PATCH v2 4/5 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.
---
Changes from V1:
- None
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 v2 5/5 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.
---
Changes from V1:
- None
drivers/power/reset/Kconfig | 6 ++ drivers/power/reset/Makefile | 1 + drivers/power/reset/as3722-poweroff.c | 96 +++++++++++++++++++++++++++++++++ 3 files changed, 103 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 +96 -0
96 lines not on this page · raw message
Signature · 1 line
1.7.1.1