Add support for MAXIM MAX77620/MAX20024 PMIC
Subsystems (4)
v9 cover Add support for MAXIM MAX77620/MAX20024 PMIC
Add SW support for MAXIM Semiconductor's Power Management IC (PMIC) MAX77620/MAX20024. This PMIC supports DC-DC/LDOS, GPIOs, RTC, watchdog, clocks etc.
This series add respective driver for each of sub-modules.
---
Changes from V1:
DT DOC:
- Added units in some of properties.
- Change the boolean property to tristate type and detail some of properties.
RTC:
- Rename the file to rtc-max77xxx.c and make the generic implementation.
- Direct regmap apis are used for the register access.
- Decouped from max77620 driver.
- Taken care of cleanup comments form V1 version.
MFD:
- Code cleanups per review from V1.
- Move register access APIs from header to c file.
- Remove some of non required variable, remove duplication in error message and simplify some of function implementation.
GPIO:
- Use the gpiochip_add_data and get the chip data from core APIs.
- Cleanups based on comment received on mfd/rtc.
- Avoid duplication on error message.
Pinctrl:
- Cleanup code based on comment received on mfd/rtc.
- Avoid duplication on error message.
Regulators:
- Cleanup code based on comment received on mfd/rtc.
- Avoid duplication on error message.
- Taken care of review comment from Mark.
Changes from V2:
- Run coccicheck and checkpatch in strict mode for the alignment.
- Drop RTC driver and its i2c client registartion.
- Refactor Regulator driver to use core API for DT parsing.
Changes from V3:
- Change all sys initcall to module driver.
- change the max77620_read argument to unisgned int from u8.
Changes from V4:
- Provide more details in the dt binding doc.
- Take care of fps nodes.
- Split the submodule's DT binding doc on respective folder.
- Drop the battery charger and low battery binding and related code as it need to go on power driver.
Changes from V5:
- None
Changes from V6:
- Taken care of Lee's comment like used defines for irqs, remove max77620 register access abstractions, remove DTof module and use ID table only, reduce the copyright lines.
- Drop configuration for hard power off time change as it will be in power driver.
- Taken care of Mark's comment about the active discharge. Currently drop this configuration and follow up patches to move this to core and add callback apis are planned.
- Use direct regmap from all drivers instead of using abstractions.
- move regulator supply to device node instead of regulators sub node.
Changes from V7:
- Used mfd defines, better describe the FPS sequence properties.
Changes from V8:
- Used local defines as the MFD defines need to be fix for size calculations.
- Regulator patches are already applied and hence droping it.
- Run checkpatch --strict in final patches and fix error/warning.
Laxman Dewangan (6):
mfd: add device-tree binding doc for PMIC max77620/max20024
mfd: max77620: add core driver for MAX77620/MAX20024
pinctrl: add DT binding doc for pincontrol of PMIC max77620/max20024
pinctrl: max77620: add pincontrol driver for MAX77620/MAX20024
gpio: add DT binding doc for gpio of PMIC max77620/max20024
gpio: max77620: add gpio driver for MAX77620/MAX20024
.../devicetree/bindings/gpio/gpio-max77620.txt | 25 + Documentation/devicetree/bindings/mfd/max77620.txt | 143 +++++ .../bindings/pinctrl/pinctrl-max77620.txt | 127 ++++ drivers/gpio/Kconfig | 9 + drivers/gpio/Makefile | 1 + drivers/gpio/gpio-max77620.c | 263 ++++++++ drivers/mfd/Kconfig | 15 + drivers/mfd/Makefile | 1 + drivers/mfd/max77620.c | 550 ++++++++++++++++ drivers/pinctrl/Kconfig | 10 + drivers/pinctrl/Makefile | 1 + drivers/pinctrl/pinctrl-max77620.c | 688 +++++++++++++++++++++ include/dt-bindings/mfd/max77620.h | 39 ++ include/linux/mfd/max77620.h | 337 ++++++++++ 14 files changed, 2209 insertions(+) create mode 100644 Documentation/devicetree/bindings/gpio/gpio-max77620.txt create mode 100644 Documentation/devicetree/bindings/mfd/max77620.txt create mode 100644 Documentation/devicetree/bindings/pinctrl/pinctrl-max77620.txt create mode 100644 drivers/gpio/gpio-max77620.c create mode 100644 drivers/mfd/max77620.c create mode 100644 drivers/pinctrl/pinctrl-max77620.c create mode 100644 include/dt-bindings/mfd/max77620.h create mode 100644 include/linux/mfd/max77620.h
Signature · 1 line
2.1.4
PATCH v9 1/6 mfd: add device-tree binding doc for PMIC max77620/max20024
The MAXIM PMIC MAX77620 and MAX20024 are power management IC which supports RTC, GPIO, DCDC/LDO regulators, interrupt, watchdog etc.
Add DT binding document for the different functionality of this device.
---
Changes from V1:
- Added units in some of properties.
- Change the boolean property to tristate type and detail some of properties.
Change from V2:
- added unit in period related dt property.
Change from V3: None
- Added Rob's ack.
Changes from V4:
- A- Provide more details in the dt binding doc.
- Take care of fps nodes.
- Split the submodule's DT binding doc on respective folder.
- Drop the battery charger and low battery binding and related code as it need to go on power driver.
Change from V5:
- None
Change from V6:
-start the patch title with mfd instead of DT: mfd:
Change from V7:
- Better describe the FPS to make more clear.
Changes from V8:
None
Documentation/devicetree/bindings/mfd/max77620.txt | 143 +++++++++++++++++++++ include/dt-bindings/mfd/max77620.h | 39 ++++++ 2 files changed, 182 insertions(+) create mode 100644 Documentation/devicetree/bindings/mfd/max77620.txt create mode 100644 include/dt-bindings/mfd/max77620.h
Documentation/devicetree/bindings/mfd/max77620.txt new file +143 -0
@@ -0,0 +1,143 @@ +MAX77620 Power management IC from Maxim Semiconductor. + +Required properties: +------------------- +- compatible: Must be one of + "maxim,max77620" + "maxim,max20024". +- reg: I2C device address. + +Optional properties: +------------------- +- interrupts: The interrupt on the parent the controller is + connected to. +- interrupt-controller: Marks the device node as an interrupt controller. +- #interrupt-cells: is <2> and their usage is compliant to the 2 cells + variant of <../interrupt-controller/interrupts.txt> + IRQ numbers for different interrupt source of MAX77620 + are defined at dt-bindings/mfd/max77620.h. + +Optional subnodes and their properties: +======================================= + +Flexible power sequence configurations: +-------------------------------------- +The Flexible Power Sequencer (FPS) allows each regulator to power up under +hardware or software control. Additionally, each regulator can power on +independently or among a group of other regulators with an adjustable power-up +and power-down delays (sequencing). GPIO1, GPIO2, and GPIO3 can be programmed +to be part of a sequence allowing external regulators to be sequenced along +with internal regulators. 32KHz clock can be programmed to be part of a +sequence. + +The flexible sequencing structure consists of two hardware enable inputs +(EN0, EN1), and 3 master sequencing timers called FPS0, FPS1 and FPS2. +Each master sequencing timer is programmable through its configuration +register to have a hardware enable source (EN1 or EN2) or a software enable +source (SW). When enabled/disabled, the master sequencing timer generates +eight sequencing events on different time periods called slots. The time +period between each event is programmable within the configuration register. +Each regulator, GPIO1, GPIO2, GPIO3, and 32KHz clock has a flexible power +sequence slave register which allows its enable source to be specified as +a flexible power sequencer timer or a software bit. When a FPS source of +regulators, GPIOs and clocks specifies the enable source to be a flexible +power sequencer, the power up and power down delays can be specified in +the regulators, GPIOs and clocks flexible power sequencer configuration +registers. + +When FPS event cleared (set to LOW), regulators, GPIOs and 32KHz +clock are set into following state at the sequencing event that +corresponds to its flexible sequencer configuration register. + Sleep state: In this state, regulators, GPIOs + and 32KHz clock get disabled at + the sequencing event. + Global Low Power Mode (GLPM): In this state, regulators are set in + low power mode at the sequencing event. + +The configuration parameters of FPS is provided through sub-node "fps" +and their child for FPS specific. The child node name for FPS are "fps0", +"fps1", and "fps2" for FPS0, FPS1 and FPS2 respectively. + +The FPS configurations like FPS source, power up and power down slots for +regulators, GPIOs and 32kHz clocks are provided in their respective +configuration nodes which is explained in respective sub-system DT +binding document. + +There is need for different FPS configuration parameters based on system +state like when system state changed from active to suspend or active to +power off (shutdown). + +Optional properties: +------------------- +-maxim,fps-event-source: u32, FPS event source like external + hardware input to PMIC i.e. EN0, EN1 or + software (SW). + The macros are defined on + dt-bindings/mfd/max77620.h + for different control source. + - MAX77620_FPS_EVENT_SRC_EN0 + for hardware input pin EN0. + - MAX77620_FPS_EVENT_SRC_EN1 + for hardware input pin EN1. + - MAX77620_FPS_EVENT_SRC_SW + for software control. + +-maxim,shutdown-fps-time-period-us: u32, FPS time period in microseconds + when system enters in to shutdown + state. + +-maxim,suspend-fps-time-period-us: u32, FPS time period in microseconds + when system enters in to suspend state. + +-maxim,device-state-on-disabled-event: u32, describe the PMIC state when FPS + event cleared (set to LOW) whether it + should go to sleep state or low-power + state. Following are valid values: + - MAX77620_FPS_INACTIVE_STATE_SLEEP + to set the PMIC state to sleep. + - MAX77620_FPS_INACTIVE_STATE_LOW_POWER + to set the PMIC state to low + power. + Absence of this property or other value + will not change device state when FPS + event get cleared. + +Here supported time periods by device in microseconds are as follows: +MAX77620 supports 40, 80, 160, 320, 640, 1280, 2560 and 5120 microseconds. +MAX20024 supports 20, 40, 80, 160, 320, 640, 1280 and 2540 microseconds. + +For DT binding details of different sub modules like GPIO, pincontrol, +regulator, power, please refer respective device-tree binding document +under their respective sub-system directories. + +Example: +-------- +#include <dt-bindings/mfd/max77620.h> + +max77620@3c { + compatible = "maxim,max77620"; + reg = <0x3c>; + + interrupt-parent = <&intc>; + interrupts = <0 86 IRQ_TYPE_NONE>; + + interrupt-controller; + #interrupt-cells = <2>; + + fps { + fps0 { + maxim,shutdown-fps-time-period-us = <1280>; + maxim,fps-event-source = <MAX77620_FPS_EVENT_SRC_EN1>; + }; + + fps1 { + maxim,shutdown-fps-time-period-us = <1280>; + maxim,fps-event-source = <MAX77620_FPS_EVENT_SRC_EN0>; + }; + + fps2 { + maxim,shutdown-fps-time-period-us = <1280>; + maxim,fps-event-source = <MAX77620_FPS_EVENT_SRC_SW>; + }; + }; +};
include/dt-bindings/mfd/max77620.h new file +39 -0
@@ -0,0 +1,39 @@ +/* +* This header provides macros for MAXIM MAX77620 device bindings. +* +* Copyright (c) 2016, NVIDIA Corporation. +* Author: Laxman Dewangan <[email protected]> +*/ + +#ifndef _DT_BINDINGS_MFD_MAX77620_H +#define _DT_BINDINGS_MFD_MAX77620_H + +/* MAX77620 interrupts */ +#define MAX77620_IRQ_TOP_GLBL 0/* Low-Battery */ +#define MAX77620_IRQ_TOP_SD 1/* SD power fail */ +#define MAX77620_IRQ_TOP_LDO 2/* LDO power fail */ +#define MAX77620_IRQ_TOP_GPIO 3/* GPIO internal int to MAX77620 */ +#define MAX77620_IRQ_TOP_RTC 4/* RTC */ +#define MAX77620_IRQ_TOP_32K 5/* 32kHz oscillator */ +#define MAX77620_IRQ_TOP_ONOFF 6/* ON/OFF oscillator */ +#define MAX77620_IRQ_LBT_MBATLOW 7/* Thermal alarm status, > 120C */ +#define MAX77620_IRQ_LBT_TJALRM1 8/* Thermal alarm status, > 120C */ +#define MAX77620_IRQ_LBT_TJALRM2 9/* Thermal alarm status, > 140C */ + +/* FPS event source */ +#define MAX77620_FPS_EVENT_SRC_EN0 0 +#define MAX77620_FPS_EVENT_SRC_EN1 1 +#define MAX77620_FPS_EVENT_SRC_SW 2 + +/* Device state when FPS event LOW */ +#define MAX77620_FPS_INACTIVE_STATE_SLEEP 0 +#define MAX77620_FPS_INACTIVE_STATE_LOW_POWER 1 + +/* FPS source */ +#define MAX77620_FPS_SRC_0 0 +#define MAX77620_FPS_SRC_1 1 +#define MAX77620_FPS_SRC_2 2 +#define MAX77620_FPS_SRC_NONE 3 +#define MAX77620_FPS_SRC_DEF 4 + +#endif
Signature · 1 line
2.1.4
PATCH v9 2/6 mfd: max77620: add core driver for MAX77620/MAX20024
In reply to Laxman DewanganMAX77620/MAX20024 are Power Management IC from the MAXIM. It supports RTC, multiple GPIOs, multiple DCDC and LDOs, watchdog, clock etc.
Add MFD drier to provides common support for accessing the device; additional drivers is developed on respected subsystem in order to use the functionality of the device.
---
Changes from V1:
- Code cleanups per review from V1.
- Move register acccess APIs from header to c file.
- Remove some of non required variable, remove duplication in error message and simplify some of function implementation.
- Register RTC driver such that it can get the regmap handle form parent device
Changes from V2:
- Run coccicheck and checkpatch in strict mode for the alignment.
- Drop RTC driver and its i2c client registration.
Changes from V3:
- Change all sys initcall to module driver.
- change the max77620_read argument to unisgned int from u8.
Changes from V4:
- Take care of fps nodes.
- Drop the battery charger and low battery binding and related code as it need to go on power driver.
Changes from V5:
-None
Changes from V6:
- Taken care of Lee's comment like used defines for irqs, remove max77620 register accesss abstractions, remove DTof module and use ID table only, reduce the copyright lines.
- Drop configuration for hard power off time chnage as it will be in power driver.
- Use direct regmap from all drivers instead of using abstractions.
- This depends on patch
Change from V7:
- Use MFD defines for making mfd cells.
- Use new property name.
Changes from V8:
- Remove the usage of MFD defines. Remove mutex_config as not needed.
drivers/mfd/Kconfig | 15 ++ drivers/mfd/Makefile | 1 + drivers/mfd/max77620.c | 550 +++++++++++++++++++++++++++++++++++++++++++ include/linux/mfd/max77620.h | 337 ++++++++++++++++++++++++++ 4 files changed, 903 insertions(+) create mode 100644 drivers/mfd/max77620.c create mode 100644 include/linux/mfd/max77620.h
drivers/mfd/Kconfig +15 -0
@@ -527,6 +527,21 @@ config MFD_MAX14577 additional drivers must be enabled in order to use the functionality of the device. +config MFD_MAX77620 + bool "Maxim Semiconductor MAX77620 and MAX20024 PMIC Support" + depends on I2C=y + depends on OF + select MFD_CORE + select REGMAP_I2C + select REGMAP_IRQ + select IRQ_DOMAIN + help + Say yes here to add support for Maxim Semiconductor MAX77620 and + MAX20024 which are Power Management IC with General purpose pins, + RTC, regulators, clock generator, watchdog etc. This driver + provides common support for accessing the device; additional drivers + must be enabled in order to use the functionality of the device. + config MFD_MAX77686 tristate "Maxim Semiconductor MAX77686/802 PMIC Support" depends on I2C
drivers/mfd/Makefile +1 -0
@@ -128,6 +128,7 @@ obj-$(CONFIG_MFD_DA9063) += da9063.o obj-$(CONFIG_MFD_DA9150) += da9150-core.o obj-$(CONFIG_MFD_MAX14577) += max14577.o +obj-$(CONFIG_MFD_MAX77620) += max77620.o obj-$(CONFIG_MFD_MAX77686) += max77686.o obj-$(CONFIG_MFD_MAX77693) += max77693.o obj-$(CONFIG_MFD_MAX77843) += max77843.o
drivers/mfd/max77620.c new file +550 -0
550 lines not on this page · raw message
include/linux/mfd/max77620.h new file +337 -0
337 lines not on this page · raw message
Signature · 1 line
2.1.4
PATCH v9 3/6 pinctrl: add DT binding doc for pincontrol of PMIC max77620/max20024
In reply to Laxman DewanganMaxim Semiconductor's PMIC MAX77620/MAX20024 has 8 GPIO pins which act as GPIO as well as special function mode.
Add DT binding document to configure pins in function mode as well as pin configuration parameters.
---
Changes from V4:
- Separate out from pincontrol driver
Changes from V5:
- Starting patch title with pinctrl instead of DT:pinctrl
Changes from V6/V7:
- None
Changes on V8:
- Collected Ack from Linus.
.../bindings/pinctrl/pinctrl-max77620.txt | 127 +++++++++++++++++++++ 1 file changed, 127 insertions(+) create mode 100644 Documentation/devicetree/bindings/pinctrl/pinctrl-max77620.txt
Documentation/devicetree/bindings/pinctrl/pinctrl-max77620.txt new file +127 -0
@@ -0,0 +1,127 @@ +Pincontrol driver for MAX77620 Power management IC from Maxim Semiconductor. + +Device has 8 GPIO pins which can be configured as GPIO as well as the +special IO functions. + +Please refer file <devicetree/bindings/pinctrl/pinctrl-bindings.txt> +for details of the common pinctrl bindings used by client devices, +including the meaning of the phrase "pin configuration node". + +Optional Pinmux properties: +-------------------------- +Following properties are required if default setting of pins are required +at boot. +- pinctrl-names: A pinctrl state named per <pinctrl-binding.txt>. +- pinctrl[0...n]: Properties to contain the phandle for pinctrl states per + <pinctrl-binding.txt>. + +The pin configurations are defined as child of the pinctrl states node. Each +sub-node have following properties: + +Required properties: +------------------ +- pins: List of pins. Valid values of pins properties are: + gpio0, gpio1, gpio2, gpio3, gpio4, gpio5, gpio6, gpio7. + +Optional properties: +------------------- +Following are optional properties defined as pinmux DT binding document +<pinctrl-bindings.txt>. Absence of properties will leave the configuration +on default. + function, + drive-push-pull, + drive-open-drain, + bias-pull-up, + bias-pull-down. + +Valid values for function properties are: + gpio, lpm-control-in, fps-out, 32k-out, sd0-dvs-in, sd1-dvs-in, + reference-out + +Theres is also customised properties for the GPIO1, GPIO2 and GPIO3. These +customised properties are required to configure FPS configuration parameters +of these GPIOs. Please refer <devicetree/bindings/mfd/max77620.txt> for more +detail of Flexible Power Sequence (FPS). + +- maxim,active-fps-source: FPS source for the GPIOs to get + enabled/disabled when system is in + active state. Valid values are: + - MAX77620_FPS_SRC_0, + FPS source is FPS0. + - MAX77620_FPS_SRC_1, + FPS source is FPS1 + - MAX77620_FPS_SRC_2 and + FPS source is FPS2 + - MAX77620_FPS_SRC_NONE. + GPIO is not controlled + by FPS events and it gets + enabled/disabled by register + access. + Absence of this property will leave + the FPS configuration register for that + GPIO to default configuration. + +- maxim,active-fps-power-up-slot: Sequencing event slot number on which + the GPIO get enabled when + master FPS input event set to HIGH. + Valid values are 0 to 7. + This is applicable if FPS source is + selected as FPS0, FPS1 or FPS2. + +- maxim,active-fps-power-down-slot: Sequencing event slot number on which + the GPIO get disabled when master + FPS input event set to LOW. + Valid values are 0 to 7. + This is applicable if FPS source is + selected as FPS0, FPS1 or FPS2. + +- maxim,suspend-fps-source: This is same as property + "maxim,active-fps-source" but value + get configured when system enters in + to suspend state. + +- maxim,suspend-fps-power-up-slot: This is same as property + "maxim,active-fps-power-up-slot" but + this value get configured into FPS + configuration register when system + enters into suspend. + This is applicable if suspend state + FPS source is selected as FPS0, FPS1 or + +- maxim,suspend-fps-power-down-slot: This is same as property + "maxim,active-fps-power-down-slot" but + this value get configured into FPS + configuration register when system + enters into suspend. + This is applicable if suspend state + FPS source is selected as FPS0, FPS1 or + FPS2. + +Example: +-------- +#include <dt-bindings/mfd/max77620.h> +... +max77620@3c { + + pinctrl-names = "default"; + pinctrl-0 = <&spmic_default>; + + spmic_default: pinmux@0 { + pin_gpio0 { + pins = "gpio0"; + function = "gpio"; + }; + + pin_gpio1 { + pins = "gpio1"; + function = "fps-out"; + maxim,active-fps-source = <MAX77620_FPS_SRC_0>; + }; + + pin_gpio2 { + pins = "gpio2"; + function = "fps-out"; + maxim,active-fps-source = <MAX77620_FPS_SRC_1>; + }; + }; +};
Signature · 1 line
2.1.4
PATCH v9 4/6 pinctrl: max77620: add pincontrol driver for MAX77620/MAX20024
In reply to Laxman DewanganMAXIM Semiconductor's PMIC, MAX77620/MAX20024 has 8 GPIO pins which also act as the special function in alternate mode. Also there is configuration like push-pull, open drain, FPS timing etc for these pins.
Add pin control driver to configure these parameters through pin control APIs.
---
Changes from V1:
- Cleanup code based on comment received on mfd/rtc.
- Avoid duplication on error message.
Changes form V2:
- Run coccicheck and checkpatch in strict mode for the alignment.
- update based on api changes from core.
Changes from V3:
- Change all sys initcall to module driver.
- change the max77620_read argument to unisgned int from u8.
Changes from V4:
- Added DT binding document as devicetree/bindings/pinctrl/pinctrl-max77620.txt
- Detail out properties as per review comment.
Changes from V5:
- Separate out DT binding doc for pincontrol.
- Added reviewed by for Linus W
Changes from V6:
- Use regmap APIs direct instead of max77620 abstraction APIs.
Changes from V7:
- None
Changes from V8:
- Run checkpatch --strict on final patch and fixes issue and changed unsigned to unsigned int.
drivers/pinctrl/Kconfig | 10 + drivers/pinctrl/Makefile | 1 + drivers/pinctrl/pinctrl-max77620.c | 688 +++++++++++++++++++++++++++++++++++++ 3 files changed, 699 insertions(+) create mode 100644 drivers/pinctrl/pinctrl-max77620.c
drivers/pinctrl/Kconfig +10 -0
@@ -196,6 +196,16 @@ config PINCTRL_COH901 COH 901 335 and COH 901 571/3. They contain 3, 5 or 7 ports of 8 GPIO pins each. +config PINCTRL_MAX77620 + bool "MAX77620/MAX20024 Pincontrol support" + depends on MFD_MAX77620 + select GENERIC_PINCONF + help + Say Yes here to enable Pin control support for Maxim PMIC MAX77620. + This PMIC has 8 GPIO pins that work as GPIO as well as special + function in alternate mode. This driver also configure push-pull, + open drain, FPS slots etc. + config PINCTRL_PALMAS bool "Pinctrl driver for the PALMAS Series MFD devices" depends on OF && MFD_PALMAS
drivers/pinctrl/Makefile +1 -0
@@ -17,6 +17,7 @@ obj-$(CONFIG_PINCTRL_AMD) += pinctrl-amd.o obj-$(CONFIG_PINCTRL_DIGICOLOR) += pinctrl-digicolor.o obj-$(CONFIG_PINCTRL_FALCON) += pinctrl-falcon.o obj-$(CONFIG_PINCTRL_MESON) += meson/ +obj-$(CONFIG_PINCTRL_MAX77620) += pinctrl-max77620.o obj-$(CONFIG_PINCTRL_PALMAS) += pinctrl-palmas.o obj-$(CONFIG_PINCTRL_PIC32) += pinctrl-pic32.o obj-$(CONFIG_PINCTRL_PISTACHIO) += pinctrl-pistachio.o
drivers/pinctrl/pinctrl-max77620.c new file +688 -0
688 lines not on this page · raw message
Signature · 1 line
2.1.4
PATCH v9 5/6 gpio: add DT binding doc for gpio of PMIC max77620/max20024
In reply to Laxman DewanganMaxim Semiconductor's PMIC MAX77620/MAX20024 has 8 GPIO pins which act as GPIO as well as special function mode.
Add DT binding document to support these pins in GPIO mode via GPIO framework.
---
Changes from V4:
- Separate out from gpio driver
Changes from V5/V6/V7:
- None
Changes from V8:
- Collected Linus ack.
.../devicetree/bindings/gpio/gpio-max77620.txt | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 Documentation/devicetree/bindings/gpio/gpio-max77620.txt
Documentation/devicetree/bindings/gpio/gpio-max77620.txt new file +25 -0
@@ -0,0 +1,25 @@ +GPIO driver for MAX77620 Power management IC from Maxim Semiconductor. + +Device has 8 GPIO pins which can be configured as GPIO as well as the +special IO functions. + +Required properties: +------------------- +- gpio-controller : Marks the device node as a gpio controller. +- #gpio-cells : Should be two. The first cell is the pin number and + the second cell is used to specify the gpio polarity: + 0 = active high + 1 = active low +For more details, please refer generic GPIO DT binding document +<devicetree/bindings/gpio/gpio.txt>. + +Example: +-------- +#include <dt-bindings/mfd/max77620.h> +... +max77620@3c { + compatible = "maxim,max77620"; + + gpio-controller; + #gpio-cells = <2>; +};
Signature · 1 line
2.1.4
PATCH v9 6/6 gpio: max77620: add gpio driver for MAX77620/MAX20024
In reply to Laxman DewanganMAXIM Semiconductor's PMIC, MAX77620/MAX20024 has 8 GPIO pins. It also supports interrupts from these pins.
Add GPIO driver for these pins to control via GPIO APIs.
---
Changes from V1:
- Use the gpiochip_add_data and get the chip data from core APIs.
- Cleanups based on comment received on mfd/rtc.
- Avoid duplication on error message.
Changes form V2:
- Run coccicheck and checkpatch in strict mode for the alignment.
- update based on api changes from core.
Changes from V3:
- Change all sys initcall to module driver.
- change the max77620_read argument to unisgned int from u8.
Changes from V4:
- Added DT binding document as devicetree/bindings/gpio/gpio-max77620.txt
Changes from V5:
- Separate out DT binding doc for gpio.
- Added reviewed by for Linus W
Changes from V6/V7:
- None
Changes from V8:
- Run checkpatch --strict and fix error. Mostly to use unsigned int instead of unsigned.
- Use linux/gpio/driver.h
--- drivers/gpio/Kconfig | 9 ++ drivers/gpio/Makefile | 1 + drivers/gpio/gpio-max77620.c | 263 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 273 insertions(+) create mode 100644 drivers/gpio/gpio-max77620.c
drivers/gpio/Kconfig +9 -0
@@ -850,6 +850,15 @@ config GPIO_LP3943 LP3943 can be used as a GPIO expander which provides up to 16 GPIOs. Open drain outputs are required for this usage. +config GPIO_MAX77620 + bool "GPIO support for PMIC MAX77620 and MAX20024" + depends on MFD_MAX77620 + help + GPIO driver for MAX77620 and MAX20024 PMIC from Maxim Semiconductor. + MAX77620 PMIC has 8 pins that can be configured as GPIOs. The + driver also provides interrupt support for each of the gpios. + Say yes here to enable the max77620 to be used as gpio controller. + config GPIO_MSIC bool "Intel MSIC mixed signal gpio support" depends on MFD_INTEL_MSIC
drivers/gpio/Makefile +1 -0
@@ -58,6 +58,7 @@ obj-$(CONFIG_GPIO_MAX730X) += gpio-max730x.o obj-$(CONFIG_GPIO_MAX7300) += gpio-max7300.o obj-$(CONFIG_GPIO_MAX7301) += gpio-max7301.o obj-$(CONFIG_GPIO_MAX732X) += gpio-max732x.o +obj-$(CONFIG_GPIO_MAX77620) += gpio-max77620.o obj-$(CONFIG_GPIO_MB86S7X) += gpio-mb86s7x.o obj-$(CONFIG_GPIO_MENZ127) += gpio-menz127.o obj-$(CONFIG_GPIO_MC33880) += gpio-mc33880.o
drivers/gpio/gpio-max77620.c new file +263 -0
263 lines not on this page · raw message
Signature · 1 line
2.1.4