Add initial support for ATC260x PMICs
Subsystems (7)
Cristian Ciocaltea
maintainerv4 cover Add initial support for ATC260x PMICs
The ATC260x family of PMICs integrates Audio Codec, Power management, Clock generation and GPIO controller blocks. There are currently 3
variants: ATC2603A, ATC2603C and ATC2609A.
This is re-spin of the v1 patch series submitted some time ago by Mani, who provided the MFD and regulator drivers for ATC2609A:
https://lore.kernel.org/lkml/[email protected]/
Since v2, I added support for ATC2603C, together with some new functionalities for both chips: power controller and onkey input. The ATC2603A chip type remains unsupported for the moment.
This has been tested on RoseapplePi, a SBC based on the Actions Semi S500 SoC, which integrates the ATC2603C variant of the PMIC.
Note that enabling the ATC260x PMICs on compatible Actions Semi Owl SoC based boards depends on:
* the Actions Semi SIRQ driver (for PMIC DTS setup), merged in v5.10:
https://lore.kernel.org/lkml/[email protected]/
* the atomic transfers in Owl I2C driver (for power controller), merged in v5.11:
https://lore.kernel.org/lkml/[email protected]/
Additionally, please note that I have taken the authorship for the MFD and regulator drivers patches, considering the original code has been modified to a large extent.
Thanks,
Cristi
Changes in v4:
- Updated MFD driver according to Lee's review
- Handled ATC2603C's LDO12 fixed regulator per Mark's suggestion
- Rebased patchset on v5.11-rc1
Changes in v3:
- Integrated feedback from Mani, Rob, Mark, Sebastian, Dmitry
- Fixed issues reported by Lee's kernel test robot
- Added new patch for 'reset-time-sec' DT binding property
- Rebased patchset on v5.10-rc6
Changes in v2:
- Reworked MFD core & I2C driver
* Integrated Lee's feedback
* Added support for using the regmap within atomic contexts
* Added support for ATC2603C chip variant
* Reorganized KConfig entries
- Improved regulator driver
* Added support for ATC2603C variant
* Used helper macros for more compact specification of regulator_desc items
* Added more regulator capabilities
- Added power controller driver
* Provides system poweroff/reboot functionalities
* Depends on atomic transfers in the Owl I2C driver
- Added onkey driver: exposes the power button as an input device
- Added yaml binding doc
- Rebased patchset on kernel v5.9-rc1
Cristian Ciocaltea (6):
dt-bindings: input: Add reset-time-sec common property
dt-bindings: mfd: Add Actions Semi ATC260x PMIC binding
mfd: Add MFD driver for ATC260x PMICs
regulator: Add regulator driver for ATC260x PMICs
power: reset: Add poweroff driver for ATC260x PMICs
input: atc260x: Add onkey driver for ATC260x PMICs
Manivannan Sadhasivam (1):
MAINTAINERS: Add entry for ATC260x PMIC
.../devicetree/bindings/input/input.yaml | 7 + .../bindings/mfd/actions,atc260x.yaml | 183 ++++++ MAINTAINERS | 12 + drivers/input/misc/Kconfig | 11 + drivers/input/misc/Makefile | 2 +- drivers/input/misc/atc260x-onkey.c | 305 ++++++++++ drivers/mfd/Kconfig | 18 + drivers/mfd/Makefile | 3 + drivers/mfd/atc260x-core.c | 293 ++++++++++ drivers/mfd/atc260x-i2c.c | 64 +++ drivers/power/reset/Kconfig | 8 +- drivers/power/reset/Makefile | 1 + drivers/power/reset/atc260x-poweroff.c | 263 +++++++++ drivers/regulator/Kconfig | 8 + drivers/regulator/Makefile | 1 + drivers/regulator/atc260x-regulator.c | 539 ++++++++++++++++++ include/linux/mfd/atc260x/atc2603c.h | 281 +++++++++ include/linux/mfd/atc260x/atc2609a.h | 308 ++++++++++ include/linux/mfd/atc260x/core.h | 58 ++ 19 files changed, 2363 insertions(+), 2 deletions(-) create mode 100644 Documentation/devicetree/bindings/mfd/actions,atc260x.yaml create mode 100644 drivers/input/misc/atc260x-onkey.c create mode 100644 drivers/mfd/atc260x-core.c create mode 100644 drivers/mfd/atc260x-i2c.c create mode 100644 drivers/power/reset/atc260x-poweroff.c create mode 100644 drivers/regulator/atc260x-regulator.c create mode 100644 include/linux/mfd/atc260x/atc2603c.h create mode 100644 include/linux/mfd/atc260x/atc2609a.h create mode 100644 include/linux/mfd/atc260x/core.h
Signature · 1 line
2.30.0
Cristian Ciocaltea
maintainerPATCH v4 1/7 dt-bindings: input: Add reset-time-sec common property
Add a new common property 'reset-time-sec' to be used in conjunction with the devices supporting the key pressed reset feature.
---
Changes in v4:
- Added Reviewed-by from Rob
Changes in v3:
- This patch was not present in v2
Documentation/devicetree/bindings/input/input.yaml | 7 +++++++ 1 file changed, 7 insertions(+)
Documentation/devicetree/bindings/input/input.yaml +7 -0
@@ -34,4 +34,11 @@ properties: specify this property. $ref: /schemas/types.yaml#/definitions/uint32 + reset-time-sec: + description: + Duration in seconds which the key should be kept pressed for device to + reset automatically. Device with key pressed reset feature can specify + this property. + $ref: /schemas/types.yaml#/definitions/uint32 + additionalProperties: true
Signature · 1 line
2.30.0
Cristian Ciocaltea
maintainerPATCH v4 2/7 dt-bindings: mfd: Add Actions Semi ATC260x PMIC binding
In reply to Cristian CiocalteaAdd devicetree binding for Actions Semi ATC260x PMICs.
---
Changes in v4
- Added Reviewed-by from Rob
- Added support for ATC2603C LDO12 fixed regulator per Mark's suggestion
Changes in v3 (according to Rob's review):
- Dropped the 'pwrc' and 'onkey' nodes
- Used a common 'reset-time-sec' property
.../bindings/mfd/actions,atc260x.yaml | 183 ++++++++++++++++++ 1 file changed, 183 insertions(+) create mode 100644 Documentation/devicetree/bindings/mfd/actions,atc260x.yaml
Documentation/devicetree/bindings/mfd/actions,atc260x.yaml new file +183 -0
@@ -0,0 +1,183 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/mfd/actions,atc260x.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Actions Semi ATC260x Power Management IC bindings + +maintainers: + - Manivannan Sadhasivam <[email protected]> + - Cristian Ciocaltea <[email protected]> + +description: | + ATC260x series PMICs integrates Audio Codec, Power Management, RTC, IR + and GPIO controller blocks. Currently only the PM related functionalities + (i.e. regulators and system power-off/reboot) for the ATC2603C and ATC2609A + chip variants are supported. + ATC2603C includes 3 programmable DC-DC converters, 9 programmable LDO + regulators and 1 fixed LDO regulator. + ATC2609A includes 5 programmable DC-DC converters and 10 programmable LDO + regulators. + +allOf: + - $ref: ../input/input.yaml + +properties: + compatible: + enum: + - actions,atc2603c + - actions,atc2609a + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + reset-time-sec: + description: | + Duration in seconds which the key should be kept pressed for device + to reset automatically. The hardware default is 8. Use 0 to disable + this functionality. + enum: [0, 6, 8, 10, 12] + + regulators: + type: object + description: | + List of child nodes specifying the regulators, depending on chip variant: + * ATC2603C: dcdc[1-3], ldo[1-3,5-8,11,12], switchldo1 + * ATC2609A: dcdc[0-4], ldo[0-9] + + properties: + compatible: + enum: + - actions,atc2603c-regulator + - actions,atc2609a-regulator + + switchldo1: + type: object + $ref: ../regulator/regulator.yaml + + properties: + regulator-name: true + regulator-boot-on: true + regulator-always-on: true + regulator-min-microvolt: true + regulator-max-microvolt: true + regulator-allow-bypass: true + regulator-active-discharge: true + + additionalProperties: false + + patternProperties: + "^(dcdc[0-4]|ldo[0-9]|ldo1[1-2]|switchldo1)-supply$": + description: ATC260x voltage regulators supplies + + "^(dcdc[0-4]|ldo[0-9]|ldo1[1-2])$": + type: object + $ref: ../regulator/regulator.yaml + + properties: + regulator-name: true + regulator-boot-on: true + regulator-always-on: true + regulator-min-microvolt: true + regulator-max-microvolt: true + regulator-allow-bypass: true + + additionalProperties: false + + allOf: + - if: + properties: + compatible: + contains: + const: actions,atc2603c-regulator + then: + patternProperties: + "^(dcdc[0,4]|ldo[0,4,9])(-supply)?$": false + + "^(ldo|dcdc)": + properties: + regulator-allow-bypass: false + - if: + properties: + compatible: + contains: + const: actions,atc2609a-regulator + then: + patternProperties: + "^(ldo1[1-2]|switchldo1)(-supply)?$": false + + "^(dcdc|ldo[3-9])": + properties: + regulator-allow-bypass: false + + required: + - compatible + + additionalProperties: false + +additionalProperties: false + +required: + - compatible + - reg + - interrupts + +examples: + - | + #include <dt-bindings/interrupt-controller/arm-gic.h> + i2c0 { + #address-cells = <1>; + #size-cells = <0>; + + pmic@65 { + compatible = "actions,atc2603c"; + reg = <0x65>; + interrupt-parent = <&sirq>; + interrupts = <2 IRQ_TYPE_LEVEL_HIGH>; + + reset-time-sec = <6>; + + regulators { + compatible = "actions,atc2603c-regulator"; + + dcdc1-supply = <®_5v0>; + dcdc3-supply = <®_5v0>; + ldo5-supply = <®_5v0>; + switchldo1-supply = <&vcc>; + + vdd_cpu: dcdc1 { + regulator-name = "VDD_CPU"; + regulator-min-microvolt = <700000>; + regulator-max-microvolt = <1400000>; + regulator-always-on; + }; + + vcc: dcdc3 { + regulator-name = "VCC"; + regulator-min-microvolt = <2600000>; + regulator-max-microvolt = <3300000>; + regulator-always-on; + }; + + vcc_3v1: ldo5 { + regulator-name = "VCC_3V1"; + regulator-min-microvolt = <2600000>; + regulator-max-microvolt = <3300000>; + }; + + sd_vcc: switchldo1 { + regulator-name = "SD_VCC"; + regulator-min-microvolt = <3000000>; + regulator-max-microvolt = <3300000>; + regulator-always-on; + regulator-boot-on; + }; + }; + }; + }; + +...
Signature · 1 line
2.30.0
Cristian Ciocaltea
maintainerPATCH v4 3/7 mfd: Add MFD driver for ATC260x PMICs
In reply to Cristian CiocalteaAdd initial support for the Actions Semi ATC260x PMICs which integrates Audio Codec, Power management, Clock generation and GPIO controller blocks.
For the moment this driver only supports Regulator, Poweroff and Onkey functionalities for the ATC2603C and ATC2609A chip variants.
Since the PMICs can be accessed using both I2C and SPI buses, the following driver structure has been adopted:
-----> atc260x-core.c (Implements core functionalities)
/
ATC260x --------> atc260x-i2c.c (Implements I2C interface)
\
-----> atc260x-spi.c (Implements SPI interface - TODO)---
Changes in v4 - according to Lee's review:
- Replaced 'regmap_add_irq_chip()' with 'devm' counterpart and dropped 'atc260x_device_remove()' and 'atc260x_i2c_remove()' functions
- Moved kerneldoc sections from prototypes to real functions
- Placed single line entries on one line for mfd_cells[]
- Several other minor changes
Changes in v3:
- Fixed the issues reported by Lee's kernel test robot:
WARNING: modpost: missing MODULE_LICENSE() in drivers/mfd/atc260x-core.o
Quoted 1 line
Quoted 1 line
FATAL: modpost:
drivers/mfd/atc260x-i2c:sizeof(struct i2c_device_id)=24 is
not a modulo of the size of section __mod_i2c__<identifier>_device_table=588.
Quoted 1 line
Quoted 1 line
Fix definition of struct
i2c_device_idinmod_devicetable.h
- Dropped the usage of '.of_compatible' fields in {atc2603c,atc2609a}_mfd_cells[]
- Added 'Co-developed-by' tag in commit message and dropped [cristian: ...] line
drivers/mfd/Kconfig | 18 ++ drivers/mfd/Makefile | 3 + drivers/mfd/atc260x-core.c | 293 +++++++++++++++++++++++++ drivers/mfd/atc260x-i2c.c | 64 ++++++ include/linux/mfd/atc260x/atc2603c.h | 281 ++++++++++++++++++++++++ include/linux/mfd/atc260x/atc2609a.h | 308 +++++++++++++++++++++++++++ include/linux/mfd/atc260x/core.h | 58 +++++ 7 files changed, 1025 insertions(+) create mode 100644 drivers/mfd/atc260x-core.c create mode 100644 drivers/mfd/atc260x-i2c.c create mode 100644 include/linux/mfd/atc260x/atc2603c.h create mode 100644 include/linux/mfd/atc260x/atc2609a.h create mode 100644 include/linux/mfd/atc260x/core.h
drivers/mfd/Kconfig +18 -0
@@ -2064,6 +2064,24 @@ config MFD_WCD934X This driver provides common support WCD934x audio codec and its associated Pin Controller, Soundwire Controller and Audio codec. +config MFD_ATC260X + tristate + select MFD_CORE + select REGMAP + select REGMAP_IRQ + +config MFD_ATC260X_I2C + tristate "Actions Semi ATC260x PMICs with I2C" + select MFD_ATC260X + select REGMAP_I2C + depends on I2C + help + Support for the Actions Semi ATC260x PMICs controlled via I2C. + + This driver provides common support for accessing the ATC2603C + and ATC2609A chip variants, additional drivers must be enabled + in order to use the functionality of the device. + config MFD_KHADAS_MCU tristate "Support for Khadas System control Microcontroller" depends on I2C
drivers/mfd/Makefile +3 -0
@@ -268,3 +268,6 @@ obj-$(CONFIG_MFD_KHADAS_MCU) += khadas-mcu.o obj-$(CONFIG_SGI_MFD_IOC3) += ioc3.o obj-$(CONFIG_MFD_SIMPLE_MFD_I2C) += simple-mfd-i2c.o obj-$(CONFIG_MFD_INTEL_M10_BMC) += intel-m10-bmc.o + +obj-$(CONFIG_MFD_ATC260X) += atc260x-core.o +obj-$(CONFIG_MFD_ATC260X_I2C) += atc260x-i2c.o
drivers/mfd/atc260x-core.c new file +293 -0
293 lines not on this page · raw message
drivers/mfd/atc260x-i2c.c new file +64 -0
64 lines not on this page · raw message
include/linux/mfd/atc260x/atc2603c.h new file +281 -0
281 lines not on this page · raw message
include/linux/mfd/atc260x/atc2609a.h new file +308 -0
308 lines not on this page · raw message
include/linux/mfd/atc260x/core.h new file +58 -0
58 lines not on this page · raw message
Signature · 1 line
2.30.0
Cristian Ciocaltea
maintainerPATCH v4 4/7 regulator: Add regulator driver for ATC260x PMICs
In reply to Cristian CiocalteaAdd support for the DC-DC converters and LDO regulators found in the ATC2603C and ATC2609A chip variants of the Actions Semi ATC260x family of PMICs.
---
Changes in v4
- Included the ATC2603C's LDO12 fixed regulator per Mark's suggestion
Changes in v3:
- Dropped 'last_dcdc_reg_id' from 'atc260x_regulator_data' and, instead, provided separate ops for DCDCs and LDOs, as recommended by Mark
- Removed the unnecessary compatibles, per Mark's review
- Added 'Co-developed-by' tag in commit message and dropped [cristian: ...] line
drivers/regulator/Kconfig | 8 + drivers/regulator/Makefile | 1 + drivers/regulator/atc260x-regulator.c | 539 ++++++++++++++++++++++++++ 3 files changed, 548 insertions(+) create mode 100644 drivers/regulator/atc260x-regulator.c
drivers/regulator/Kconfig +8 -0
@@ -179,6 +179,14 @@ config REGULATOR_AS3722 AS3722 PMIC. This will enable support for all the software controllable DCDC/LDO regulators. +config REGULATOR_ATC260X + tristate "Actions Semi ATC260x PMIC Regulators" + depends on MFD_ATC260X + help + This driver provides support for the voltage regulators on the + ATC260x PMICs. This will enable support for all the software + controllable DCDC/LDO regulators. + config REGULATOR_AXP20X tristate "X-POWERS AXP20X PMIC Regulators" depends on MFD_AXP20X
drivers/regulator/Makefile +1 -0
@@ -27,6 +27,7 @@ obj-$(CONFIG_REGULATOR_ARIZONA_MICSUPP) += arizona-micsupp.o obj-$(CONFIG_REGULATOR_ARM_SCMI) += scmi-regulator.o obj-$(CONFIG_REGULATOR_AS3711) += as3711-regulator.o obj-$(CONFIG_REGULATOR_AS3722) += as3722-regulator.o +obj-$(CONFIG_REGULATOR_ATC260X) += atc260x-regulator.o obj-$(CONFIG_REGULATOR_AXP20X) += axp20x-regulator.o obj-$(CONFIG_REGULATOR_BCM590XX) += bcm590xx-regulator.o obj-$(CONFIG_REGULATOR_BD70528) += bd70528-regulator.o
drivers/regulator/atc260x-regulator.c new file +539 -0
539 lines not on this page · raw message
Signature · 1 line
2.30.0
Cristian Ciocaltea
maintainerPATCH v4 5/7 power: reset: Add poweroff driver for ATC260x PMICs
In reply to Cristian CiocalteaThis driver provides poweroff and reboot support for a system through the ATC2603C and ATC2609A chip variants of the Actions Semi ATC260x family of PMICs.
---
Changes in v4:
- None
Changes in v3:
- Removed the unnecessary driver compatibles
drivers/power/reset/Kconfig | 8 +- drivers/power/reset/Makefile | 1 + drivers/power/reset/atc260x-poweroff.c | 263 +++++++++++++++++++++++++ 3 files changed, 271 insertions(+), 1 deletion(-) create mode 100644 drivers/power/reset/atc260x-poweroff.c
drivers/power/reset/Kconfig +7 -1
@@ -39,6 +39,13 @@ config POWER_RESET_AT91_SAMA5D2_SHDWC This driver supports the alternate shutdown controller for some Atmel SAMA5 SoCs. It is present for example on SAMA5D2 SoC. +config POWER_RESET_ATC260X + tristate "Actions Semi ATC260x PMIC power-off driver" + depends on MFD_ATC260X + help + This driver provides power-off and restart support for a system + through Actions Semi ATC260x series PMICs. + config POWER_RESET_AXXIA bool "LSI Axxia reset driver" depends on ARCH_AXXIA
@@ -292,4 +299,3 @@ config NVMEM_REBOOT_MODE action according to the mode. endif -
drivers/power/reset/Makefile +1 -0
@@ -3,6 +3,7 @@ obj-$(CONFIG_POWER_RESET_AS3722) += as3722-poweroff.o obj-$(CONFIG_POWER_RESET_AT91_POWEROFF) += at91-poweroff.o obj-$(CONFIG_POWER_RESET_AT91_RESET) += at91-reset.o obj-$(CONFIG_POWER_RESET_AT91_SAMA5D2_SHDWC) += at91-sama5d2_shdwc.o +obj-$(CONFIG_POWER_RESET_ATC260X) += atc260x-poweroff.o obj-$(CONFIG_POWER_RESET_AXXIA) += axxia-reset.o obj-$(CONFIG_POWER_RESET_BRCMKONA) += brcm-kona-reset.o obj-$(CONFIG_POWER_RESET_BRCMSTB) += brcmstb-reboot.o
drivers/power/reset/atc260x-poweroff.c new file +263 -0
263 lines not on this page · raw message
Signature · 1 line
2.30.0
Re: [PATCH v4 5/7] power: reset: Add poweroff driver for ATC260x PMICs
Hi,
Quoted 60 lines · Cristian Ciocaltea
This driver provides poweroff and reboot support for a system through the ATC2603C and ATC2609A chip variants of the Actions Semi ATC260x family of PMICs.
Signed-off-by Cristian Ciocaltea <[email protected]>---
Changes in v4:
- NoneChanges in v3:
- Removed the unnecessary driver compatiblesdrivers/power/reset/Kconfig | 8 +- drivers/power/reset/Makefile | 1 + drivers/power/reset/atc260x-poweroff.c | 263 +++++++++++++++++++++++++ 3 files changed, 271 insertions(+), 1 deletion(-) create mode 100644 drivers/power/reset/atc260x-poweroff.cdrivers/power/reset/Kconfig +7
-1@@ -39,6 +39,13 @@ config POWER_RESET_AT91_SAMA5D2_SHDWC This driver supports the alternate shutdown controller for some Atmel SAMA5 SoCs. It is present for example on SAMA5D2 SoC. +config POWER_RESET_ATC260X + tristate "Actions Semi ATC260x PMIC power-off driver" + depends on MFD_ATC260X + help + This driver provides power-off and restart support for a system + through Actions Semi ATC260x series PMICs. + config POWER_RESET_AXXIA bool "LSI Axxia reset driver" depends on ARCH_AXXIA@@ -292,4 +299,3 @@ config NVMEM_REBOOT_MODE action according to the mode. endif -drivers/power/reset/Makefile +1
-0@@ -3,6 +3,7 @@ obj-$(CONFIG_POWER_RESET_AS3722) += as3722-poweroff.o obj-$(CONFIG_POWER_RESET_AT91_POWEROFF) += at91-poweroff.o obj-$(CONFIG_POWER_RESET_AT91_RESET) += at91-reset.o obj-$(CONFIG_POWER_RESET_AT91_SAMA5D2_SHDWC) += at91-sama5d2_shdwc.o +obj-$(CONFIG_POWER_RESET_ATC260X) += atc260x-poweroff.o obj-$(CONFIG_POWER_RESET_AXXIA) += axxia-reset.o obj-$(CONFIG_POWER_RESET_BRCMKONA) += brcm-kona-reset.o obj-$(CONFIG_POWER_RESET_BRCMSTB) += brcmstb-reboot.odrivers/power/reset/atc260x-poweroff.c new file +1
-0@@ -0,0 +1,263 @@ +// SPDX-License-Identifier: GPL-2.0+
drivers/power/reset/atc260x-poweroff.c line 11
Quoted 10 lines
drivers/power/reset/atc260x-poweroff.c new file +10
-0+/* +* Poweroff & reset driver for Actions Semi ATC260x PMICs +* +* Copyright (c) 2020 Cristian Ciocaltea <[email protected]> +*/ + +#include <linux/delay.h> +#include <linux/mfd/atc260x/core.h> +#include <linux/module.h> +#include <linux/of.h>
There is no DT code in this driver?
drivers/power/reset/atc260x-poweroff.c line 13
Quoted 2 lines
drivers/power/reset/atc260x-poweroff.c new file +2
-0+#include <linux/platform_device.h> +#include <linux/power_supply.h>
power_supply.h? That's for chargers and battery fuel gauges.
drivers/power/reset/atc260x-poweroff.c
Quoted 4 lines
drivers/power/reset/atc260x-poweroff.c new file +2
-0+#include <linux/reboot.h> +#include <linux/regmap.h>
Otherwise LGTM. I suppose I can cherry-pick this patch into my tree, or did I miss some dependencies?
-- Sebastian
Cristian Ciocaltea
maintainerRe: [PATCH v4 5/7] power: reset: Add poweroff driver for ATC260x PMICs
Hi Sebastian,
Quoted 15 lines · Sebastian Reichel
Hi,
Quoted 12 lines · Cristian Ciocaltea
This driver provides poweroff and reboot support for a system through the ATC2603C and ATC2609A chip variants of the Actions Semi ATC260x family of PMICs.
Signed-off-by Cristian Ciocaltea <[email protected]>---
Changes in v4:
- NoneChanges in v3:
- Removed the unnecessary driver compatibles
Quoted 7 lines
drivers/power/reset/atc260x-poweroff.c line 11
Quoted 5 lines
[...]
drivers/power/reset/atc260x-poweroff.c new file +4
-0+#include <linux/delay.h> +#include <linux/mfd/atc260x/core.h> +#include <linux/module.h> +#include <linux/of.h> There is no DT code in this driver?
Right, this line is not needed anymore, I will drop it and submit a new patch revision.
Quoted 4 lines
drivers/power/reset/atc260x-poweroff.c line 13
Quoted 2 lines
drivers/power/reset/atc260x-poweroff.c new file +2
-0+#include <linux/platform_device.h> +#include <linux/power_supply.h>
power_supply.h? That's for chargers and battery fuel gauges.
That is only used for checking if the S4 mode is available - which involves calling 'power_supply_is_system_supplied()'.
Quoted 7 lines
drivers/power/reset/atc260x-poweroff.c
Quoted 4 lines
drivers/power/reset/atc260x-poweroff.c new file +2
-0+#include <linux/reboot.h> +#include <linux/regmap.h> Otherwise LGTM. I suppose I can cherry-pick this patch into my tree, or did I miss some dependencies?
I'm not really sure what is the recommended approach (if any) for merging MFD drivers.
The only dependency is the PMIC core driver in patch 3/7, which is handled in Kconfig through 'depends on MFD_ATC260X'.
So far, Mark applied the regulator driver patch to his tree, while Dmitry suggested to merge the onkey driver through MFD. So I think both approaches are fine.
@Lee: Do you have any preference or recommendation for handling this?
Quoted 1 line
-- Sebastian
Thanks for the review,
Cristi
Cristian Ciocaltea
maintainerPATCH v4 6/7 input: atc260x: Add onkey driver for ATC260x PMICs
In reply to Cristian CiocalteaThe Actions Semi ATC260x PMICs are able to manage an onkey button. This driver exposes the ATC260x onkey as an input device. It can also be configured to force a system reset on a long key-press with an adjustable duration.
The currently supported chip variants are ATC2603C and ATC2609A.
---
Changes in v4:
- Added Acked-by from Dmitry
Changes in v3:
- Integrated Dmitry's review:
* Dropped the logic around the check for 'pdev->dev.of_node'
* Renamed 'ret' variable in 'atc260x_onkey_probe()' to 'error'
* Used 'dev_dbg' instead of 'dev_info' on status KEY_RESET_DISABLED
* Dropped 'input_dev->evbit[0] = BIT_MASK(EV_KEY);'
* Removed IRQF_TRIGGER_HIGH flag on 'devm_request_threaded_irq()'
* Implemented open/close to mitigate the racing issue in
'atc260x_onkey_remove()' which has been dropped now
- Removed the unnecessary driver compatibles
- Used 'reset-time-sec' property of the parent device instead of 'actions,reset-time-sec' of now obsolete and removed 'onkey' DT node
drivers/input/misc/Kconfig | 11 ++ drivers/input/misc/Makefile | 2 +- drivers/input/misc/atc260x-onkey.c | 305 +++++++++++++++++++++++++++++ 3 files changed, 317 insertions(+), 1 deletion(-) create mode 100644 drivers/input/misc/atc260x-onkey.c
drivers/input/misc/Kconfig +11 -0
@@ -94,6 +94,17 @@ config INPUT_ARIZONA_HAPTICS To compile this driver as a module, choose M here: the module will be called arizona-haptics. +config INPUT_ATC260X_ONKEY + tristate "Actions Semi ATC260x PMIC ONKEY" + depends on MFD_ATC260X + help + Support the ONKEY of ATC260x PMICs as an input device reporting + power button status. ONKEY can be used to wakeup from low power + modes and force a reset on long press. + + To compile this driver as a module, choose M here: the + module will be called atc260x-onkey. + config INPUT_ATMEL_CAPTOUCH tristate "Atmel Capacitive Touch Button Driver" depends on OF || COMPILE_TEST
drivers/input/misc/Makefile +1 -1
@@ -17,6 +17,7 @@ obj-$(CONFIG_INPUT_ADXL34X_SPI) += adxl34x-spi.o obj-$(CONFIG_INPUT_APANEL) += apanel.o obj-$(CONFIG_INPUT_ARIEL_PWRBUTTON) += ariel-pwrbutton.o obj-$(CONFIG_INPUT_ARIZONA_HAPTICS) += arizona-haptics.o +obj-$(CONFIG_INPUT_ATC260X_ONKEY) += atc260x-onkey.o obj-$(CONFIG_INPUT_ATI_REMOTE2) += ati_remote2.o obj-$(CONFIG_INPUT_ATLAS_BTNS) += atlas_btns.o obj-$(CONFIG_INPUT_ATMEL_CAPTOUCH) += atmel_captouch.o
@@ -86,4 +87,3 @@ obj-$(CONFIG_INPUT_WM831X_ON) += wm831x-on.o obj-$(CONFIG_INPUT_XEN_KBDDEV_FRONTEND) += xen-kbdfront.o obj-$(CONFIG_INPUT_YEALINK) += yealink.o obj-$(CONFIG_INPUT_IDEAPAD_SLIDEBAR) += ideapad_slidebar.o -
drivers/input/misc/atc260x-onkey.c new file +305 -0
305 lines not on this page · raw message
Signature · 1 line
2.30.0
Cristian Ciocaltea
maintainerPATCH v4 7/7 MAINTAINERS: Add entry for ATC260x PMIC
In reply to Cristian CiocalteaFrom: Manivannan Sadhasivam <[email protected]>
Add MAINTAINERS entry for ATC260x PMIC.
[cristian: change binding doc file path, add file patterns for onkey and
poweroff drivers, fix ordering, add myself as co-maintainer]
---
Changes in v4:
- None
Changes in v3:
- Restored the authorship of the patch to Mani
MAINTAINERS | 12 ++++++++++++ 1 file changed, 12 insertions(+)
MAINTAINERS +12 -0
@@ -2892,6 +2892,18 @@ W: http://www.openaoe.org/ F: Documentation/admin-guide/aoe/ F: drivers/block/aoe/ +ATC260X PMIC MFD DRIVER +M: Manivannan Sadhasivam <[email protected]> +M: Cristian Ciocaltea <[email protected]> +L: [email protected] +S: Maintained +F: Documentation/devicetree/bindings/mfd/actions,atc260x.yaml +F: drivers/input/misc/atc260x-onkey.c +F: drivers/mfd/atc260* +F: drivers/power/reset/atc260x-poweroff.c +F: drivers/regulator/atc260x-regulator.c +F: include/linux/mfd/atc260x/* + ATHEROS 71XX/9XXX GPIO DRIVER M: Alban Bedel <[email protected]> S: Maintained
Signature · 1 line
2.30.0