Skip to contentSkip to conversation

Add support for MAXIM MAX77620/MAX20024 PMIC

PATCH Superseded Laxman Dewangan 5 participants 27 messages Jan 30, 2016 – Feb 11, 2016

Subsystems (6)

v7 of 12 Superseded Latest is v12 →

lore
Share & tools
lore
#0 lore raw

v7 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 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.
- 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.

Laxman Dewangan (8):
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
regulator: add DT binding doc for regulator of PMIC max77620/max20024
regulator: max77620: add regulator driver for max77620/max20024

 .../devicetree/bindings/gpio/gpio-max77620.txt     |  25 +
 Documentation/devicetree/bindings/mfd/max77620.txt | 118 +++
 .../bindings/pinctrl/pinctrl-max77620.txt          |  87 +++
 .../bindings/regulator/regulator-max77620.txt      | 163 ++++
 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                             | 540 ++++++++++++++
 drivers/pinctrl/Kconfig                            |  10 +
 drivers/pinctrl/Makefile                           |   1 +
 drivers/pinctrl/pinctrl-max77620.c                 | 687 +++++++++++++++++
 drivers/regulator/Kconfig                          |   9 +
 drivers/regulator/Makefile                         |   1 +
 drivers/regulator/max77620-regulator.c             | 825 +++++++++++++++++++++
 include/dt-bindings/mfd/max77620.h                 |  35 +
 include/linux/mfd/max77620.h                       | 338 +++++++++
 18 files changed, 3128 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 Documentation/devicetree/bindings/regulator/regulator-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 drivers/regulator/max77620-regulator.c
 create mode 100644 include/dt-bindings/mfd/max77620.h
 create mode 100644 include/linux/mfd/max77620.h
Signature · 1 line
2.1.4
#1 lore raw

PATCH v7 1/8 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:

 Documentation/devicetree/bindings/mfd/max77620.txt | 118 +++++++++++++++++++++
 include/dt-bindings/mfd/max77620.h                 |  35 ++++++
 2 files changed, 153 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 +118 -0
new file mode 100644
index 0000000..f258ce4
@@ -0,0 +1,118 @@
+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 PMIC has multiple control mode:
+	Normal mode also called as active mode on which all step-down
+		regulators, all linear regulators, GPIOs, and the 32kHz
+		oscillator are in normal active mode.
+	sleep mode: Regulators/GPIOs/clock can go on OFF state based on
+		their configurations.
+	Global Low power mode (GLPM): In this mode, step-down regulators, linear
+		regulators, and the 32kHz oscillator are in low-power modes.
+
+	Different modes of regulators/clock/GPIOs are controlled by the their
+FPS configurations. There is different configuration registers for each of
+these resources. Typical configurations per resource are:
+	FPS source: 	Attach the resource to required FPS source. When
+			resources are attached to one of FPS source then
+			resournce can be enable/disable when related FPS
+			source gets the control signal for ON and OFF.
+	Power on slot: 	Slot number on which resource is ON once FPS source
+			get ON signal.
+	Power down slot Slot number on which resource is OFF once FPS source
+			get OFF signal.
+
+There is three FPS source for resources called FPS0, FPS1 and FPS2. All
+resources need to attached to one of these FPS. It can alsoi be set
+FPS source to NONE, and on this case, it is completely controlled by
+the register control rather than external input control to PMIC.
+
+The configuration parameters of FPS is provided through subnode "fps"
+and their child for FPS specific.
+The node name for FPS child are defined as "fps0", "fps1", and "fps2" for
+the FPS0, FPS1 and FPS2 respectively.
+
+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).
+
+Optinal properties:
+-------------------
+-maxim,fps-control:	u32, FPS control source like external control input
+			to PMIC i.e. EN0, EN1 or software (SW). The macros
+			are defined on dt-bindings/mfd/max77620.h for
+			different control source.
+				FPS_CONTROL_SRC_EN0 for PMIC external input EN0.
+				FPS_CONTROL_SRC_EN1 for PMIC external input EN1.
+				FPS_CONTROL_SRC_SW for software control.
+
+-maxim,shutdown-fps-time-period-us: u32, FPS time period in microseconds
+				    when system enters to shutdown state.
+-maxim,suspend-fps-time-period-us:  u32, FPS time period in microseconds
+				    when system enters to suspend state.
+
+-maxim,enable-sleep: 		    Boolean, enable sleep state of PMIC
+				    when the FPS control input become active.
+-maxim,enable-global-lpm: 	    Boolean, enable Global Low Power Mode (GLPM)
+				    of PMIC when the FPS control input become
+				    active.
+
+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 different sub modules like GPIO, pincontrol, regulator, power, please refer
+respected device-tree binding document on respective 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-control = <FPS_CONTROL_SRC_EN1>;
+		};
+
+		fps1 {
+			maxim,shutdown-fps-time-period-us = <1280>;
+			maxim,fps-control = <FPS_CONTROL_SRC_EN0>;
+		};
+
+		fps2 {
+			maxim,shutdown-fps-time-period-us = <1280>;
+			maxim,fps-control = <FPS_CONTROL_SRC_SW>;
+		};
+	};
+};
include/dt-bindings/mfd/max77620.h new file +35 -0
new file mode 100644
index 0000000..1b571d7
@@ -0,0 +1,35 @@
+/*
+ * 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 control inputs */
+#define FPS_CONTROL_SRC_EN0		0
+#define FPS_CONTROL_SRC_EN1		1
+#define FPS_CONTROL_SRC_SW		2
+
+/* FPS source */
+#define FPS_SRC_0			0
+#define FPS_SRC_1			1
+#define FPS_SRC_2			2
+#define FPS_SRC_NONE			3
+#define FPS_SRC_DEF			4
+
+#endif
Signature · 1 line
2.1.4
#8 lore raw

PATCH v7 2/8 mfd: max77620: add core driver for MAX77620/MAX20024

In reply to Laxman Dewangan

MAX77620/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
[PATCH V2] mfd: core: add macro for adding mfd cells

 drivers/mfd/Kconfig          |  15 ++
 drivers/mfd/Makefile         |   1 +
 drivers/mfd/max77620.c       | 540 +++++++++++++++++++++++++++++++++++++++++++
 include/linux/mfd/max77620.h | 338 +++++++++++++++++++++++++++
 4 files changed, 894 insertions(+)
 create mode 100644 drivers/mfd/max77620.c
 create mode 100644 include/linux/mfd/max77620.h
drivers/mfd/Kconfig +15 -0
index 9ca66de..e5ad974 100644
@@ -492,6 +492,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
 	bool "Maxim Semiconductor MAX77686/802 PMIC Support"
 	depends on I2C=y
drivers/mfd/Makefile +1 -0
index 0f230a6..97910ed 100644
@@ -123,6 +123,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 +540 -0

540 lines not on this page · raw message

include/linux/mfd/max77620.h new file +338 -0

338 lines not on this page · raw message

Signature · 1 line
2.1.4
#16 lore raw

PATCH v7 3/8 pinctrl: add DT binding doc for pincontrol of PMIC max77620/max20024

In reply to Laxman Dewangan

Maxim 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

 .../bindings/pinctrl/pinctrl-max77620.txt          | 87 ++++++++++++++++++++++
 1 file changed, 87 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/pinctrl/pinctrl-max77620.txt
Documentation/devicetree/bindings/pinctrl/pinctrl-max77620.txt new file +87 -0
new file mode 100644
index 0000000..6536786
@@ -0,0 +1,87 @@
+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 require if pin control setting is 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.
+The properties are required to configure these resource FPS parameters
+when system is in "active" state or in "suspend" state.
+Here "active" state means system is UP and working normally.
+"suspend" state means system enters into the suspend state.
+
+- maxim,active-fps-source:	     FPS source for the gpios in active state
+				     of the GPIO. Valid values are FPS_SRC_0,
+				     FPS_SRC_1, FPS_SRC_2 and FPS_SRC_NONE.
+				     Absence of this property will leave the pin
+				     on default.
+- maxim,active-fps-power-up-slot:    Power up slot on given FPS for active state.
+				     Valid values are 0 to 7.
+- maxim,active-fps-power-down-slot:  Power down slot on given FPS for active
+				     state. Valid values are 0 to 7.
+- maxim,suspend-fps-source:	     Suspend state FPS source. Valid values are
+				     same as maxim,active-fps-source.
+- maxim,suspend-fps-power-down-slot: Suspend state power down slot. Valid
+				     values are 0 to 7.
+- maxim,suspend-fps-power-up-slot: Suspend state power up slot. Valid values
+				     are 0 to 7.
+
+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,fps-source = <FPS_SRC_0>;
+		};
+
+		pin_gpio2 {
+			pins = "gpio2";
+			function = "fps-out";
+			maxim,fps-source = <FPS_SRC_1>;
+		};
+	};
+};
Signature · 1 line
2.1.4
#18 lore raw

PATCH v7 4/8 pinctrl: max77620: add pincontrol driver for MAX77620/MAX20024

In reply to Laxman Dewangan

MAXIM 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 pincontrol driver to configure these parameters through pincontrol 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.

 drivers/pinctrl/Kconfig            |  10 +
 drivers/pinctrl/Makefile           |   1 +
 drivers/pinctrl/pinctrl-max77620.c | 687 +++++++++++++++++++++++++++++++++++++
 3 files changed, 698 insertions(+)
 create mode 100644 drivers/pinctrl/pinctrl-max77620.c
drivers/pinctrl/Kconfig +10 -0
index 99a4c10..b6d2d23 100644
@@ -227,6 +227,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
index bf1b5ca..72833e3 100644
@@ -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_PISTACHIO)	+= pinctrl-pistachio.o
 obj-$(CONFIG_PINCTRL_ROCKCHIP)	+= pinctrl-rockchip.o
drivers/pinctrl/pinctrl-max77620.c new file +687 -0

687 lines not on this page · raw message

Signature · 1 line
2.1.4
#19 lore raw

PATCH v7 5/8 gpio: add DT binding doc for gpio of PMIC max77620/max20024

In reply to Laxman Dewangan

Maxim 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.

---
 .../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
new file mode 100644
index 0000000..410e716
@@ -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
#22 lore raw

PATCH v7 6/8 gpio: max77620: add gpio driver for MAX77620/MAX20024

In reply to Laxman Dewangan

MAXIM 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.

---
 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
index c88dd24..48c614e 100644
@@ -797,6 +797,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
index ece7d7c..f676a2d 100644
@@ -57,6 +57,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_MC33880)	+= gpio-mc33880.o
 obj-$(CONFIG_GPIO_MC9S08DZ60)	+= gpio-mc9s08dz60.o
drivers/gpio/gpio-max77620.c new file +263 -0

263 lines not on this page · raw message

Signature · 1 line
2.1.4
#23 lore raw

PATCH v7 7/8 regulator: add DT binding doc for regulator of PMIC max77620/max20024

In reply to Laxman Dewangan

Maxim Semiconductor's PMIC MAX77620/MAX20024 has multiple DCDCs and LDOs.

Add DT binding document to support these regulators via regulator framework.

---
Changes from V4:
- Separate out from regulator driver

Changes from V6:
- Starting patch tile with regulator instead of DT:regulator
- Move all ldo supply to device node level from regulator sub node.

 .../bindings/regulator/regulator-max77620.txt      | 163 +++++++++++++++++++++
 1 file changed, 163 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/regulator/regulator-max77620.txt
Documentation/devicetree/bindings/regulator/regulator-max77620.txt new file +163 -0
new file mode 100644
index 0000000..caa8255
@@ -0,0 +1,163 @@
+Regulator DT binding for MAX77620 Power management IC from Maxim Semiconductor.
+
+Device has multiple DCDC(sd[0-3] and LDOs(ldo[0-8]). The input supply
+of these regulators are defined under parent device node and details
+of regulator properties are defined under the sub node "regulators"
+of parent node.
+
+Please refer file <Documentation/devicetree/bindings/regulator/regulator.txt>
+for common regulator bindings used by client.
+
+Following are properties of parent node related to regulators.
+
+Optional properties:
+-------------------
+The input supply of regulators are the optional properties on the
+parent device node. The input supply of these regulators are provided
+through following properties:
+in-sd0-supply: Input supply for SD0, INA-SD0 or INB-SD0 pins.
+in-sd1-supply: Input supply for SD1.
+in-sd2-supply: Input supply for SD2.
+in-sd3-supply: Input supply for SD3.
+in-ldo0-1-supply: Input supply for LDO0 and LDO1.
+in-ldo2-supply: Input supply for LDO2.
+in-ldo3-5-supply: Input supply for LDO3 and LDO5
+in-ldo4-6-supply: Input supply for LDO4 and LDO6.
+in-ldo7-8-supply: Input supply for LDO7 and LDO8.
+
+
+Optional sub nodes for regulators under "regulators" subnode:
+------------------------------------------------------------
+The subnodes name is the name of regulator and it must be one of:
+	sd[0-3], ldo[0-8]
+
+Each sub-node should contain the constraints and initialization
+information for that regulator. The definition for each of these
+nodes is defined using the standard binding for regulators found at
+<Documentation/devicetree/bindings/regulator/regulator.txt>.
+
+Theres is also additional properties for SD/LDOs.
+The properties are required to configure SDs/LDOs FPS parameters
+when system is in "active" state or in "suspend" state.
+Here "active" state means system is UP and working normally.
+"suspend" state means system enters into the suspend state.
+
+- maxim,active-fps-source:	     FPS source for the gpios in active state
+				     of the GPIO. Valid values are FPS_SRC_0,
+				     FPS_SRC_1, FPS_SRC_2 and FPS_SRC_NONE.
+				     Absence of this property will leave the pin
+				     on default.
+- maxim,active-fps-power-up-slot:    Power up slot on given FPS for active state.
+				     Valid values are 0 to 7.
+- maxim,active-fps-power-down-slot:  Power down slot on given FPS for active
+				     state. Valid values are 0 to 7.
+- maxim,suspend-fps-source:	     Suspend state FPS source. Valid values are
+				     same as maxim,active-fps-source.
+- maxim,suspend-fps-power-down-slot: Suspend state power down slot. Valid
+				     values are 0 to 7.
+- maxim,suspend-fps-power-up-slot:   Suspend state power up slot. Valid values
+				     are 0 to 7.
+
+Example:
+--------
+#include <dt-bindings/mfd/max77620.h>
+...
+max77620@3c {
+	in-ldo0-1-supply = <&max77620_sd2>;
+	in-ldo7-8-supply = <&max77620_sd2>;
+	regulators {
+		sd0 {
+			regulator-name = "vdd-core";
+			regulator-min-microvolt = <600000>;
+			regulator-max-microvolt = <1400000>;
+			regulator-boot-on;
+			regulator-always-on;
+			maxim,active-fps-source = <FPS_SRC_1>;
+		};
+
+		sd1 {
+			regulator-name = "vddio-ddr";
+			regulator-min-microvolt = <1200000>;
+			regulator-max-microvolt = <1200000>;
+			regulator-always-on;
+			regulator-boot-on;
+			maxim,active-fps-source = <FPS_SRC_0>;
+		};
+
+		sd2 {
+			regulator-name = "vdd-pre-reg";
+			regulator-min-microvolt = <1350000>;
+			regulator-max-microvolt = <1350000>;
+		};
+
+		sd3 {
+			regulator-name = "vdd-1v8";
+			regulator-min-microvolt = <1800000>;
+			regulator-max-microvolt = <1800000>;
+			regulator-always-on;
+			regulator-boot-on;
+		};
+
+		ldo0 {
+			regulator-name = "avdd-sys";
+			regulator-min-microvolt = <1200000>;
+			regulator-max-microvolt = <1200000>;
+			regulator-always-on;
+			regulator-boot-on;
+		};
+
+		ldo1 {
+			regulator-name = "vdd-pex";
+			regulator-min-microvolt = <1050000>;
+			regulator-max-microvolt = <1050000>;
+		};
+
+		ldo2 {
+			regulator-name = "vddio-sdmmc3";
+			regulator-min-microvolt = <1800000>;
+			regulator-max-microvolt = <3300000>;
+		};
+
+		ldo3 {
+			regulator-name = "vdd-cam-hv";
+			regulator-min-microvolt = <2800000>;
+			regulator-max-microvolt = <2800000>;
+		};
+
+		ldo4 {
+			regulator-name = "vdd-rtc";
+			regulator-min-microvolt = <1250000>;
+			regulator-max-microvolt = <1250000>;
+			regulator-always-on;
+			regulator-boot-on;
+		};
+
+		ldo5 {
+			regulator-name = "avdd-ts-hv";
+			regulator-min-microvolt = <3000000>;
+			regulator-max-microvolt = <3000000>;
+		};
+
+		ldo6 {
+			regulator-name = "vdd-ts";
+			regulator-min-microvolt = <1800000>;
+			regulator-max-microvolt = <1800000>;
+			regulator-always-on;
+			regulator-boot-on;
+		};
+
+		ldo7 {
+			regulator-name = "vdd-gen-pll-edp";
+			regulator-min-microvolt = <1050000>;
+			regulator-max-microvolt = <1050000>;
+			regulator-always-on;
+			regulator-boot-on;
+		};
+
+		ldo8 {
+			regulator-name = "vdd-hdmi-dp";
+			regulator-min-microvolt = <1050000>;
+			regulator-max-microvolt = <1050000>;
+		};
+	};
+};
Signature · 1 line
2.1.4
#24 lore raw

PATCH v7 8/8 regulator: max77620: add regulator driver for max77620/max20024

In reply to Laxman Dewangan

MAXIM Semiconductor's PMIC, MAX77620 and MAX20024 have the multiple DCDC and LDOs. This supplies the power to different components of the system.
Also these rails has configuration for ramp time, flexible power sequence, slew rate etc.

Add regulator driver to access these rails via regulator APIs.

---

- 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.
- Refactor Regulator driver to use core API for DT parsing.
- Update based on API changes.

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/regulator/regulator-max77620.txt
- Detail out properties.

Changes from V5:
- Separate out DT binding doc for regulator.

Changes from V6:
- Use direct regmap APIs.
- Drop active-discharge configuration as it wil be move to core and through callback. Follow on patches are palnned for this.

 drivers/mfd/max77620.c                 |   4 +-
 drivers/regulator/Kconfig              |   9 +
 drivers/regulator/Makefile             |   1 +
 drivers/regulator/max77620-regulator.c | 825 +++++++++++++++++++++++++++++++++
 3 files changed, 835 insertions(+)
 create mode 100644 drivers/regulator/max77620-regulator.c
drivers/regulator/Kconfig +9 -0
index 8155e80..b92214b 100644
@@ -343,6 +343,15 @@ config REGULATOR_MAX1586
 	  regulator via I2C bus. The provided regulator is suitable
 	  for PXA27x chips to control VCC_CORE and VCC_USIM voltages.
 
+config REGULATOR_MAX77620
+	tristate "Maxim 77620/MAX20024 voltage regulator"
+	depends on MFD_MAX77620
+	help
+	  This driver controls Maxim MAX77620 voltage output regulator
+	  via I2C bus. The provided regulator is suitable for Tegra
+	  chip to control Step-Down DC-DC and LDOs. Say Y here to
+	  enable the regulator driver.
+
 config REGULATOR_MAX8649
 	tristate "Maxim 8649 voltage regulator"
 	depends on I2C
drivers/regulator/Makefile +1 -0
index 980b194..2564c00 100644
@@ -46,6 +46,7 @@ obj-$(CONFIG_REGULATOR_LP8755) += lp8755.o
 obj-$(CONFIG_REGULATOR_LTC3589) += ltc3589.o
 obj-$(CONFIG_REGULATOR_MAX14577) += max14577.o
 obj-$(CONFIG_REGULATOR_MAX1586) += max1586.o
+obj-$(CONFIG_REGULATOR_MAX77620) += max77620-regulator.o
 obj-$(CONFIG_REGULATOR_MAX8649)	+= max8649.o
 obj-$(CONFIG_REGULATOR_MAX8660) += max8660.o
 obj-$(CONFIG_REGULATOR_MAX8907) += max8907-regulator.o
drivers/regulator/max77620-regulator.c new file +825 -0

825 lines not on this page · raw message

Signature · 1 line
2.1.4
#10 lore raw

Re: [PATCH V7 2/8] mfd: max77620: add core driver for MAX77620/MAX20024

In reply to kbuild test robot

This depends on patch
[PATCH V2] mfd: core: add macro for adding mfd cells

and due to absence of this patch, it reports the error.

Quoted 96 lines · kbuild test robot

Hi Laxman,

[auto build test ERROR on pinctrl/for-next]
[also build test ERROR on v4.5-rc1 next-20160129]
[if your patch is applied to the wrong git tree, please drop us a note to help improving the system]

url:    https://github.com/0day-ci/linux/commits/Laxman-Dewangan/Add-support-for-MAXIM-MAX77620-MAX20024-PMIC/20160131-005355
base:   https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git for-next
config: i386-allmodconfig (attached as .config)
reproduce:
         # save the attached .config to linux build tree
         make ARCH=i386

All errors (new ones prefixed by >>):

Quoted 1 line
Quoted 1 line

drivers/mfd/max77620.c:57:2: error: implicit declaration of function 'DEFINE_MFD_CELL_NAME' [-Werror=implicit-function-declaration]

      DEFINE_MFD_CELL_NAME("max77620-pinctrl"),
      ^
Quoted 1 line
Quoted 1 line

drivers/mfd/max77620.c:57:2: error: initializer element is not constant

    drivers/mfd/max77620.c:57:2: note: (near initialization for 'max77620_children[0].name')
Quoted 1 line
Quoted 1 line

drivers/mfd/max77620.c:58:2: error: implicit declaration of function 'DEFINE_MFD_CELL_NAME_RESOURCE' [-Werror=implicit-function-declaration]

      DEFINE_MFD_CELL_NAME_RESOURCE("max77620-gpio", gpio_resources),
      ^
    drivers/mfd/max77620.c:58:2: error: initializer element is not constant
    drivers/mfd/max77620.c:58:2: note: (near initialization for 'max77620_children[0].id')
    drivers/mfd/max77620.c:59:2: error: initializer element is not constant
      DEFINE_MFD_CELL_NAME("max77620-pmic"),
      ^
    drivers/mfd/max77620.c:59:2: note: (near initialization for 'max77620_children[0].usage_count')
    drivers/mfd/max77620.c:60:2: error: initializer element is not constant
      DEFINE_MFD_CELL_NAME_RESOURCE("max77620-rtc", rtc_resources),
      ^
    drivers/mfd/max77620.c:60:2: note: (near initialization for 'max77620_children[0].enable')
    drivers/mfd/max77620.c:61:2: error: initializer element is not constant
      DEFINE_MFD_CELL_NAME_RESOURCE("max77620-power", power_resources),
      ^
    drivers/mfd/max77620.c:61:2: note: (near initialization for 'max77620_children[0].disable')
    drivers/mfd/max77620.c:62:2: error: initializer element is not constant
      DEFINE_MFD_CELL_NAME("max77620-watchdog"),
      ^
    drivers/mfd/max77620.c:62:2: note: (near initialization for 'max77620_children[0].suspend')
    drivers/mfd/max77620.c:63:2: error: initializer element is not constant
      DEFINE_MFD_CELL_NAME("max77620-clock"),
      ^
    drivers/mfd/max77620.c:63:2: note: (near initialization for 'max77620_children[0].resume')
    drivers/mfd/max77620.c:64:2: error: initializer element is not constant
      DEFINE_MFD_CELL_NAME_RESOURCE("max77620-thermal", thermal_resources),
      ^
    drivers/mfd/max77620.c:64:2: note: (near initialization for 'max77620_children[0].platform_data')
    drivers/mfd/max77620.c:68:2: error: initializer element is not constant
      DEFINE_MFD_CELL_NAME("max20024-pinctrl"),
      ^
    drivers/mfd/max77620.c:68:2: note: (near initialization for 'max20024_children[0].name')
    drivers/mfd/max77620.c:69:2: error: initializer element is not constant
      DEFINE_MFD_CELL_NAME_RESOURCE("max20024-gpio", gpio_resources),
      ^
    drivers/mfd/max77620.c:69:2: note: (near initialization for 'max20024_children[0].id')
    drivers/mfd/max77620.c:70:2: error: initializer element is not constant
      DEFINE_MFD_CELL_NAME("max20024-pmic"),
      ^
    drivers/mfd/max77620.c:70:2: note: (near initialization for 'max20024_children[0].usage_count')
    drivers/mfd/max77620.c:71:2: error: initializer element is not constant
      DEFINE_MFD_CELL_NAME_RESOURCE("max20024-rtc", rtc_resources),
      ^
    drivers/mfd/max77620.c:71:2: note: (near initialization for 'max20024_children[0].enable')
    drivers/mfd/max77620.c:72:2: error: initializer element is not constant
      DEFINE_MFD_CELL_NAME_RESOURCE("max20024-power", power_resources),
      ^
    drivers/mfd/max77620.c:72:2: note: (near initialization for 'max20024_children[0].disable')
    drivers/mfd/max77620.c:73:2: error: initializer element is not constant
      DEFINE_MFD_CELL_NAME("max20024-watchdog"),
      ^
    drivers/mfd/max77620.c:73:2: note: (near initialization for 'max20024_children[0].suspend')
    drivers/mfd/max77620.c:74:2: error: initializer element is not constant
      DEFINE_MFD_CELL_NAME("max20024-clock"),
      ^
    drivers/mfd/max77620.c:74:2: note: (near initialization for 'max20024_children[0].resume')
    cc1: some warnings being treated as errors

vim +/DEFINE_MFD_CELL_NAME +57 drivers/mfd/max77620.c

     51		REGMAP_IRQ_REG(MAX77620_IRQ_LBT_MBATLOW, 1, MAX77620_IRQ_LBM_MASK),
     52		REGMAP_IRQ_REG(MAX77620_IRQ_LBT_TJALRM1, 1, MAX77620_IRQ_TJALRM1_MASK),
     53		REGMAP_IRQ_REG(MAX77620_IRQ_LBT_TJALRM2, 1, MAX77620_IRQ_TJALRM2_MASK),
     54	};
     55	
     56	static struct mfd_cell max77620_children[] = {
Quoted 2 lines

57 DEFINE_MFD_CELL_NAME("max77620-pinctrl"),
58 DEFINE_MFD_CELL_NAME_RESOURCE("max77620-gpio", gpio_resources),

     59		DEFINE_MFD_CELL_NAME("max77620-pmic"),
     60		DEFINE_MFD_CELL_NAME_RESOURCE("max77620-rtc", rtc_resources),
     61		DEFINE_MFD_CELL_NAME_RESOURCE("max77620-power", power_resources),

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

#9 lore raw

Re: [PATCH V7 2/8] mfd: max77620: add core driver for MAX77620/MAX20024

In reply to Laxman Dewangan
reproduce:

Hi Laxman,

[auto build test ERROR on pinctrl/for-next]
[also build test ERROR on v4.5-rc1 next-20160129]
[if your patch is applied to the wrong git tree, please drop us a note to help improving the system]

url:    https://github.com/0day-ci/linux/commits/Laxman-Dewangan/Add-support-for-MAXIM-MAX77620-MAX20024-PMIC/20160131-005355
base:   https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git for-next
config: i386-allmodconfig (attached as .config)
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All errors (new ones prefixed by >>):

>> drivers/mfd/max77620.c:57:2: error: implicit declaration of function 'DEFINE_MFD_CELL_NAME' [-Werror=implicit-function-declaration]
     DEFINE_MFD_CELL_NAME("max77620-pinctrl"),
     ^
>> drivers/mfd/max77620.c:57:2: error: initializer element is not constant
   drivers/mfd/max77620.c:57:2: note: (near initialization for 'max77620_children[0].name')
>> drivers/mfd/max77620.c:58:2: error: implicit declaration of function 'DEFINE_MFD_CELL_NAME_RESOURCE' [-Werror=implicit-function-declaration]
     DEFINE_MFD_CELL_NAME_RESOURCE("max77620-gpio", gpio_resources),
     ^
   drivers/mfd/max77620.c:58:2: error: initializer element is not constant
   drivers/mfd/max77620.c:58:2: note: (near initialization for 'max77620_children[0].id')
   drivers/mfd/max77620.c:59:2: error: initializer element is not constant
     DEFINE_MFD_CELL_NAME("max77620-pmic"),
     ^
   drivers/mfd/max77620.c:59:2: note: (near initialization for 'max77620_children[0].usage_count')
   drivers/mfd/max77620.c:60:2: error: initializer element is not constant
     DEFINE_MFD_CELL_NAME_RESOURCE("max77620-rtc", rtc_resources),
     ^
   drivers/mfd/max77620.c:60:2: note: (near initialization for 'max77620_children[0].enable')
   drivers/mfd/max77620.c:61:2: error: initializer element is not constant
     DEFINE_MFD_CELL_NAME_RESOURCE("max77620-power", power_resources),
     ^
   drivers/mfd/max77620.c:61:2: note: (near initialization for 'max77620_children[0].disable')
   drivers/mfd/max77620.c:62:2: error: initializer element is not constant
     DEFINE_MFD_CELL_NAME("max77620-watchdog"),
     ^
   drivers/mfd/max77620.c:62:2: note: (near initialization for 'max77620_children[0].suspend')
   drivers/mfd/max77620.c:63:2: error: initializer element is not constant
     DEFINE_MFD_CELL_NAME("max77620-clock"),
     ^
   drivers/mfd/max77620.c:63:2: note: (near initialization for 'max77620_children[0].resume')
   drivers/mfd/max77620.c:64:2: error: initializer element is not constant
     DEFINE_MFD_CELL_NAME_RESOURCE("max77620-thermal", thermal_resources),
     ^
   drivers/mfd/max77620.c:64:2: note: (near initialization for 'max77620_children[0].platform_data')
   drivers/mfd/max77620.c:68:2: error: initializer element is not constant
     DEFINE_MFD_CELL_NAME("max20024-pinctrl"),
     ^
   drivers/mfd/max77620.c:68:2: note: (near initialization for 'max20024_children[0].name')
   drivers/mfd/max77620.c:69:2: error: initializer element is not constant
     DEFINE_MFD_CELL_NAME_RESOURCE("max20024-gpio", gpio_resources),
     ^
   drivers/mfd/max77620.c:69:2: note: (near initialization for 'max20024_children[0].id')
   drivers/mfd/max77620.c:70:2: error: initializer element is not constant
     DEFINE_MFD_CELL_NAME("max20024-pmic"),
     ^
   drivers/mfd/max77620.c:70:2: note: (near initialization for 'max20024_children[0].usage_count')
   drivers/mfd/max77620.c:71:2: error: initializer element is not constant
     DEFINE_MFD_CELL_NAME_RESOURCE("max20024-rtc", rtc_resources),
     ^
   drivers/mfd/max77620.c:71:2: note: (near initialization for 'max20024_children[0].enable')
   drivers/mfd/max77620.c:72:2: error: initializer element is not constant
     DEFINE_MFD_CELL_NAME_RESOURCE("max20024-power", power_resources),
     ^
   drivers/mfd/max77620.c:72:2: note: (near initialization for 'max20024_children[0].disable')
   drivers/mfd/max77620.c:73:2: error: initializer element is not constant
     DEFINE_MFD_CELL_NAME("max20024-watchdog"),
     ^
   drivers/mfd/max77620.c:73:2: note: (near initialization for 'max20024_children[0].suspend')
   drivers/mfd/max77620.c:74:2: error: initializer element is not constant
     DEFINE_MFD_CELL_NAME("max20024-clock"),
     ^

drivers/mfd/max77620.c:74:2: note: (near initialization for 'max20024_children[0].resume')
cc1: some warnings being treated as errors

vim +/DEFINE_MFD_CELL_NAME +57 drivers/mfd/max77620.c

    51		REGMAP_IRQ_REG(MAX77620_IRQ_LBT_MBATLOW, 1, MAX77620_IRQ_LBM_MASK),
    52		REGMAP_IRQ_REG(MAX77620_IRQ_LBT_TJALRM1, 1, MAX77620_IRQ_TJALRM1_MASK),
    53		REGMAP_IRQ_REG(MAX77620_IRQ_LBT_TJALRM2, 1, MAX77620_IRQ_TJALRM2_MASK),
    54	};
    55	
    56	static struct mfd_cell max77620_children[] = {
  > 57		DEFINE_MFD_CELL_NAME("max77620-pinctrl"),
  > 58		DEFINE_MFD_CELL_NAME_RESOURCE("max77620-gpio", gpio_resources),
    59		DEFINE_MFD_CELL_NAME("max77620-pmic"),
    60		DEFINE_MFD_CELL_NAME_RESOURCE("max77620-rtc", rtc_resources),
    61		DEFINE_MFD_CELL_NAME_RESOURCE("max77620-power", power_resources),

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

#15 lore raw

Re: [PATCH V7 2/8] mfd: max77620: add core driver for MAX77620/MAX20024

In reply to Laxman Dewangan
reproduce: wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # save the attached .config to linux build tree…

Hi Laxman,

[auto build test WARNING on pinctrl/for-next]
[also build test WARNING on v4.5-rc1 next-20160129]
[if your patch is applied to the wrong git tree, please drop us a note to help improving the system]

url:    https://github.com/0day-ci/linux/commits/Laxman-Dewangan/Add-support-for-MAXIM-MAX77620-MAX20024-PMIC/20160131-005355
base:   https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git for-next
config: sh-allyesconfig (attached as .config)

reproduce:
wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=sh

All warnings (new ones prefixed by >>):

drivers/mfd/max77620.c:57:2: error: implicit declaration of function 'DEFINE_MFD_CELL_NAME' [-Werror=implicit-function-declaration]

>> drivers/mfd/max77620.c:57:2: warning: missing braces around initializer [-Wmissing-braces]

drivers/mfd/max77620.c:57:2: warning: (near initialization for 'max77620_children[0]') [-Wmissing-braces] drivers/mfd/max77620.c:57:2: error: initializer element is not constant
drivers/mfd/max77620.c:57:2: error: (near initialization for 'max77620_children[0].name') drivers/mfd/max77620.c:58:2: error: implicit declaration of function 'DEFINE_MFD_CELL_NAME_RESOURCE' [-Werror=implicit-function-declaration] drivers/mfd/max77620.c:58:2: error: initializer element is not constant
drivers/mfd/max77620.c:58:2: error: (near initialization for 'max77620_children[0].id')
drivers/mfd/max77620.c:59:2: error: initializer element is not constant
drivers/mfd/max77620.c:59:2: error: (near initialization for 'max77620_children[0].usage_count') drivers/mfd/max77620.c:60:2: error: initializer element is not constant
drivers/mfd/max77620.c:60:2: error: (near initialization for 'max77620_children[0].enable') drivers/mfd/max77620.c:61:2: error: initializer element is not constant
drivers/mfd/max77620.c:61:2: error: (near initialization for 'max77620_children[0].disable') drivers/mfd/max77620.c:62:2: error: initializer element is not constant
drivers/mfd/max77620.c:62:2: error: (near initialization for 'max77620_children[0].suspend') drivers/mfd/max77620.c:63:2: error: initializer element is not constant
drivers/mfd/max77620.c:63:2: error: (near initialization for 'max77620_children[0].resume') drivers/mfd/max77620.c:64:2: error: initializer element is not constant
drivers/mfd/max77620.c:64:2: error: (near initialization for 'max77620_children[0].platform_data') drivers/mfd/max77620.c:68:2: warning: missing braces around initializer [-Wmissing-braces] drivers/mfd/max77620.c:68:2: warning: (near initialization for 'max20024_children[0]') [-Wmissing-braces] drivers/mfd/max77620.c:68:2: error: initializer element is not constant
drivers/mfd/max77620.c:68:2: error: (near initialization for 'max20024_children[0].name') drivers/mfd/max77620.c:69:2: error: initializer element is not constant
drivers/mfd/max77620.c:69:2: error: (near initialization for 'max20024_children[0].id')
drivers/mfd/max77620.c:70:2: error: initializer element is not constant
drivers/mfd/max77620.c:70:2: error: (near initialization for 'max20024_children[0].usage_count') drivers/mfd/max77620.c:71:2: error: initializer element is not constant
drivers/mfd/max77620.c:71:2: error: (near initialization for 'max20024_children[0].enable') drivers/mfd/max77620.c:72:2: error: initializer element is not constant
drivers/mfd/max77620.c:72:2: error: (near initialization for 'max20024_children[0].disable') drivers/mfd/max77620.c:73:2: error: initializer element is not constant
drivers/mfd/max77620.c:73:2: error: (near initialization for 'max20024_children[0].suspend') drivers/mfd/max77620.c:74:2: error: initializer element is not constant
drivers/mfd/max77620.c:74:2: error: (near initialization for 'max20024_children[0].resume')
cc1: some warnings being treated as errors

vim +57 drivers/mfd/max77620.c

    41	};
    42	
    43	static const struct regmap_irq max77620_top_irqs[] = {
    44		REGMAP_IRQ_REG(MAX77620_IRQ_TOP_GLBL, 0, MAX77620_IRQ_TOP_GLBL_MASK),
    45		REGMAP_IRQ_REG(MAX77620_IRQ_TOP_SD, 0, MAX77620_IRQ_TOP_SD_MASK),
    46		REGMAP_IRQ_REG(MAX77620_IRQ_TOP_LDO, 0, MAX77620_IRQ_TOP_LDO_MASK),
    47		REGMAP_IRQ_REG(MAX77620_IRQ_TOP_GPIO, 0, MAX77620_IRQ_TOP_GPIO_MASK),
    48		REGMAP_IRQ_REG(MAX77620_IRQ_TOP_RTC, 0, MAX77620_IRQ_TOP_RTC_MASK),
    49		REGMAP_IRQ_REG(MAX77620_IRQ_TOP_32K, 0, MAX77620_IRQ_TOP_32K_MASK),
    50		REGMAP_IRQ_REG(MAX77620_IRQ_TOP_ONOFF, 0, MAX77620_IRQ_TOP_ONOFF_MASK),
    51		REGMAP_IRQ_REG(MAX77620_IRQ_LBT_MBATLOW, 1, MAX77620_IRQ_LBM_MASK),
    52		REGMAP_IRQ_REG(MAX77620_IRQ_LBT_TJALRM1, 1, MAX77620_IRQ_TJALRM1_MASK),
    53		REGMAP_IRQ_REG(MAX77620_IRQ_LBT_TJALRM2, 1, MAX77620_IRQ_TJALRM2_MASK),
    54	};
    55	
    56	static struct mfd_cell max77620_children[] = {
  > 57		DEFINE_MFD_CELL_NAME("max77620-pinctrl"),
    58		DEFINE_MFD_CELL_NAME_RESOURCE("max77620-gpio", gpio_resources),
    59		DEFINE_MFD_CELL_NAME("max77620-pmic"),
    60		DEFINE_MFD_CELL_NAME_RESOURCE("max77620-rtc", rtc_resources),
    61		DEFINE_MFD_CELL_NAME_RESOURCE("max77620-power", power_resources),
    62		DEFINE_MFD_CELL_NAME("max77620-watchdog"),
    63		DEFINE_MFD_CELL_NAME("max77620-clock"),
    64		DEFINE_MFD_CELL_NAME_RESOURCE("max77620-thermal", thermal_resources),
    65	};

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

#11 lore raw

Re: [PATCH V7 2/8] mfd: max77620: add core driver for MAX77620/MAX20024

In reply to Laxman Dewangan
Quoted 4 lines · Laxman Dewangan

This depends on patch
[PATCH V2] mfd: core: add macro for adding mfd cells

and due to absence of this patch, it reports the error.

If you have dependencies, why aren't they in this set?

Quoted 98 lines · kbuild test robot
Quoted 96 lines

Hi Laxman,

[auto build test ERROR on pinctrl/for-next]
[also build test ERROR on v4.5-rc1 next-20160129]
[if your patch is applied to the wrong git tree, please drop us a note to help improving the system]

url:    https://github.com/0day-ci/linux/commits/Laxman-Dewangan/Add-support-for-MAXIM-MAX77620-MAX20024-PMIC/20160131-005355
base:   https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git for-next
config: i386-allmodconfig (attached as .config)
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386

All errors (new ones prefixed by >>):

Quoted 1 line
Quoted 1 line

drivers/mfd/max77620.c:57:2: error: implicit declaration of function 'DEFINE_MFD_CELL_NAME' [-Werror=implicit-function-declaration]

     DEFINE_MFD_CELL_NAME("max77620-pinctrl"),
     ^
Quoted 1 line
Quoted 1 line

drivers/mfd/max77620.c:57:2: error: initializer element is not constant

drivers/mfd/max77620.c:57:2: note: (near initialization for 'max77620_children[0].name')

Quoted 1 line
Quoted 1 line

drivers/mfd/max77620.c:58:2: error: implicit declaration of function 'DEFINE_MFD_CELL_NAME_RESOURCE' [-Werror=implicit-function-declaration]

     DEFINE_MFD_CELL_NAME_RESOURCE("max77620-gpio", gpio_resources),
     ^
   drivers/mfd/max77620.c:58:2: error: initializer element is not constant
   drivers/mfd/max77620.c:58:2: note: (near initialization for 'max77620_children[0].id')
   drivers/mfd/max77620.c:59:2: error: initializer element is not constant
     DEFINE_MFD_CELL_NAME("max77620-pmic"),
     ^
   drivers/mfd/max77620.c:59:2: note: (near initialization for 'max77620_children[0].usage_count')
   drivers/mfd/max77620.c:60:2: error: initializer element is not constant
     DEFINE_MFD_CELL_NAME_RESOURCE("max77620-rtc", rtc_resources),
     ^
   drivers/mfd/max77620.c:60:2: note: (near initialization for 'max77620_children[0].enable')
   drivers/mfd/max77620.c:61:2: error: initializer element is not constant
     DEFINE_MFD_CELL_NAME_RESOURCE("max77620-power", power_resources),
     ^
   drivers/mfd/max77620.c:61:2: note: (near initialization for 'max77620_children[0].disable')
   drivers/mfd/max77620.c:62:2: error: initializer element is not constant
     DEFINE_MFD_CELL_NAME("max77620-watchdog"),
     ^
   drivers/mfd/max77620.c:62:2: note: (near initialization for 'max77620_children[0].suspend')
   drivers/mfd/max77620.c:63:2: error: initializer element is not constant
     DEFINE_MFD_CELL_NAME("max77620-clock"),
     ^
   drivers/mfd/max77620.c:63:2: note: (near initialization for 'max77620_children[0].resume')
   drivers/mfd/max77620.c:64:2: error: initializer element is not constant
     DEFINE_MFD_CELL_NAME_RESOURCE("max77620-thermal", thermal_resources),
     ^
   drivers/mfd/max77620.c:64:2: note: (near initialization for 'max77620_children[0].platform_data')
   drivers/mfd/max77620.c:68:2: error: initializer element is not constant
     DEFINE_MFD_CELL_NAME("max20024-pinctrl"),
     ^
   drivers/mfd/max77620.c:68:2: note: (near initialization for 'max20024_children[0].name')
   drivers/mfd/max77620.c:69:2: error: initializer element is not constant
     DEFINE_MFD_CELL_NAME_RESOURCE("max20024-gpio", gpio_resources),
     ^
   drivers/mfd/max77620.c:69:2: note: (near initialization for 'max20024_children[0].id')
   drivers/mfd/max77620.c:70:2: error: initializer element is not constant
     DEFINE_MFD_CELL_NAME("max20024-pmic"),
     ^
   drivers/mfd/max77620.c:70:2: note: (near initialization for 'max20024_children[0].usage_count')
   drivers/mfd/max77620.c:71:2: error: initializer element is not constant
     DEFINE_MFD_CELL_NAME_RESOURCE("max20024-rtc", rtc_resources),
     ^
   drivers/mfd/max77620.c:71:2: note: (near initialization for 'max20024_children[0].enable')
   drivers/mfd/max77620.c:72:2: error: initializer element is not constant
     DEFINE_MFD_CELL_NAME_RESOURCE("max20024-power", power_resources),
     ^
   drivers/mfd/max77620.c:72:2: note: (near initialization for 'max20024_children[0].disable')
   drivers/mfd/max77620.c:73:2: error: initializer element is not constant
     DEFINE_MFD_CELL_NAME("max20024-watchdog"),
     ^
   drivers/mfd/max77620.c:73:2: note: (near initialization for 'max20024_children[0].suspend')
   drivers/mfd/max77620.c:74:2: error: initializer element is not constant
     DEFINE_MFD_CELL_NAME("max20024-clock"),
     ^

drivers/mfd/max77620.c:74:2: note: (near initialization for 'max20024_children[0].resume')
cc1: some warnings being treated as errors

vim +/DEFINE_MFD_CELL_NAME +57 drivers/mfd/max77620.c

    51		REGMAP_IRQ_REG(MAX77620_IRQ_LBT_MBATLOW, 1, MAX77620_IRQ_LBM_MASK),
    52		REGMAP_IRQ_REG(MAX77620_IRQ_LBT_TJALRM1, 1, MAX77620_IRQ_TJALRM1_MASK),
    53		REGMAP_IRQ_REG(MAX77620_IRQ_LBT_TJALRM2, 1, MAX77620_IRQ_TJALRM2_MASK),
    54	};
    55	
    56	static struct mfd_cell max77620_children[] = {
Quoted 2 lines

57 DEFINE_MFD_CELL_NAME("max77620-pinctrl"),
58 DEFINE_MFD_CELL_NAME_RESOURCE("max77620-gpio", gpio_resources),

    59		DEFINE_MFD_CELL_NAME("max77620-pmic"),
    60		DEFINE_MFD_CELL_NAME_RESOURCE("max77620-rtc", rtc_resources),
    61		DEFINE_MFD_CELL_NAME_RESOURCE("max77620-power", power_resources),

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

Signature · 8 lines
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#12 lore raw

Re: [PATCH V7 2/8] mfd: max77620: add core driver for MAX77620/MAX20024

Quoted 8 lines · Lee Jones
Quoted 4 lines · Laxman Dewangan

This depends on patch
[PATCH V2] mfd: core: add macro for adding mfd cells

and due to absence of this patch, it reports the error.

If you have dependencies, why aren't they in this set?

This change is not related to the series as such and so independent.
I just thought that mentioning on commit log will be fine here. May be I missed some points here.

Let me know if I need to add this to back on series.

Thanks,
Laxman

#13 lore raw

Re: [PATCH V7 2/8] mfd: max77620: add core driver for MAX77620/MAX20024

Quoted 7 lines · Laxman Dewangan
Quoted 5 lines · Lee Jones
Quoted 3 lines · Laxman Dewangan

This depends on patch
[PATCH V2] mfd: core: add macro for adding mfd cells

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

and due to absence of this patch, it reports the error.

If you have dependencies, why aren't they in this set?

This change is not related to the series as such and so independent. I just thought that mentioning on commit log will be fine here. May be I missed some points here.

If you have patches which use/depend on it, then it's not so independent, right?

Quoted 1 line

Let me know if I need to add this to back on series.

In order to avoid any mishaps, that would be preferable, yes.

Signature · 4 lines
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
#14 lore raw

Re: [PATCH V7 2/8] mfd: max77620: add core driver for MAX77620/MAX20024

Quoted 8 lines · Lee Jones
Quoted 6 lines · Laxman Dewangan
Quoted 5 lines · Lee Jones
Quoted 3 lines · Laxman Dewangan

This depends on patch
[PATCH V2] mfd: core: add macro for adding mfd cells

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
Quoted 1 line

and due to absence of this patch, it reports the error.

If you have dependencies, why aren't they in this set?

This change is not related to the series as such and so independent. I just thought that mentioning on commit log will be fine here. May be I missed some points here.

If you have patches which use/depend on it, then it's not so independent, right?

Hmm.. true. I had different thought that the core header is independent as it does not depends on other but this series dependent which depends on core header. Seems something I missed. Idea was to review md header independently and used on this series.

Quoted 4 lines
Quoted 1 line

Let me know if I need to add this to back on series.

In order to avoid any mishaps, that would be preferable, yes.

I will respin this series to V8 once I will have change from you per discussion on other email.

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

Acked-by on v7 3/8
#17 lore raw

Re: [PATCH V7 3/8] pinctrl: add DT binding doc for pincontrol of PMIC max77620/max20024

In reply to Laxman Dewangan
Quoted 11 lines · Laxman Dewangan

Maxim 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

Lee can merge this with the rest of the patches.

Yours,
Linus Walleij

Acked-by on v7 5/8
#20 lore raw

Re: [rtc-linux] [PATCH V7 5/8] gpio: add DT binding doc for gpio of PMIC max77620/max20024

In reply to Laxman Dewangan
Quoted 8 lines · Laxman Dewangan

Maxim 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.

Lee can merge this too.

Yours,
Linus Walleij

#21 lore raw

Re: [rtc-linux] [PATCH V7 5/8] gpio: add DT binding doc for gpio of PMIC max77620/max20024

Quoted 8 lines · Linus Walleij
Quoted 6 lines · Laxman Dewangan

Maxim 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.

Quoted 6 lines
Quoted 2 lines

Lee can merge this too.

Ths set needs a re-work anyway.

Laxman, just apply your collected Acks and re-submit when you're ready.

Signature · 8 lines
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#25 lore raw

Re: [PATCH V7 8/8] regulator: max77620: add regulator driver for max77620/max20024

In reply to Laxman Dewangan

Hi Mark,

I have taken care of all your previous comment on this patch.

Can you please review?

I got the macro from Lee's and spinning the V8 of this series so if there is any thing, I can take care on my next version.

Thanks,
Laxman

Quoted 37 lines · Laxman Dewangan

MAXIM Semiconductor's PMIC, MAX77620 and MAX20024 have the multiple DCDC and LDOs. This supplies the power to different components of the system.
Also these rails has configuration for ramp time, flexible power sequence, slew rate etc.

Add regulator driver to access these rails via regulator APIs.

---

- 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.
- Refactor Regulator driver to use core API for DT parsing.
- Update based on API changes.

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/regulator/regulator-max77620.txt
- Detail out properties.

Changes from V5:
- Separate out DT binding doc for regulator.

Changes from V6:
- Use direct regmap APIs.
- Drop active-discharge configuration as it wil be move to core and through callback. Follow on patches are palnned for this.

maintainer
#26 lore raw

Re: [PATCH V7 8/8] regulator: max77620: add regulator driver for max77620/max20024

Quoted 3 lines · Laxman Dewangan

I have taken care of all your previous comment on this patch.

Can you please review?

I don't have this patch. Possibly I deleted it since it was obvious that the series was going to get yet another resend anyway, I really don't know.

Please don't top post, reply in line with needed context. This allows readers to readily follow the flow of conversation and understand what you are talking about and also helps ensure that everything in the discussion is being addressed.

#2 lore raw

Re: [PATCH V7 1/8] mfd: add device-tree binding doc for PMIC max77620/max20024

In reply to Laxman Dewangan
Quoted 49 lines · Laxman Dewangan

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:

(quoted diff) +0 -1
-start the patch title with mfd instead of DT: mfd:
 
 Documentation/devicetree/bindings/mfd/max77620.txt | 118 +++++++++++++++++++++
 include/dt-bindings/mfd/max77620.h                 |  35 ++++++
 2 files changed, 153 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 +3 -0
new file mode 100644
index 0000000..f258ce4
@@ -0,0 +1,118 @@
+MAX77620 Power management IC from Maxim Semiconductor.
+
+Required properties:

Documentation/devicetree/bindings/mfd/max77620.txt line 13

Quoted 10 lines
Documentation/devicetree/bindings/mfd/max77620.txt new file +10 -0
+-------------------
+- 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

Nit: Sometimes you use full-stops and sometimes you don't.

Documentation/devicetree/bindings/mfd/max77620.txt line 25

Quoted 12 lines
Documentation/devicetree/bindings/mfd/max77620.txt new file +12 -0
+- 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 PMIC has multiple control mode:

s/mode/modes/

Documentation/devicetree/bindings/mfd/max77620.txt line 29

Quoted 4 lines
Documentation/devicetree/bindings/mfd/max77620.txt new file +4 -0
+	Normal mode also called as active mode on which all step-down
+		regulators, all linear regulators, GPIOs, and the 32kHz
+		oscillator are in normal active mode.
+	sleep mode: Regulators/GPIOs/clock can go on OFF state based on

"can go on OFF state"?

Documentation/devicetree/bindings/mfd/max77620.txt line 32

Quoted 3 lines
Documentation/devicetree/bindings/mfd/max77620.txt new file +3 -0
+		their configurations.
+	Global Low power mode (GLPM): In this mode, step-down regulators, linear
+		regulators, and the 32kHz oscillator are in low-power modes.

Again, please standardise your formatting. Sometimes you use uppercase characters, sometimes you don't. Sometimes you use ':' after the mode, sometimes you don't. Etc.

I suggest the following format would read better:

Normal mode: Also called as active mode on which all step-down
regulators, all linear regulators, GPIOs, and the 32kHz oscillator are in normal active mode.
Sleep mode: Regulators/GPIOs/clock can go on OFF state based on
their configurations.
Global Low Power mode: In GLPM, step-down regulators, linear
regulators, and the 32kHz oscillator are in low-power modes.

Documentation/devicetree/bindings/mfd/max77620.txt line 39

Quoted 6 lines
Documentation/devicetree/bindings/mfd/max77620.txt new file +6 -0
+	Different modes of regulators/clock/GPIOs are controlled by the their
+FPS configurations. There is different configuration registers for each of
+these resources. Typical configurations per resource are:
+	FPS source: 	Attach the resource to required FPS source. When
+			resources are attached to one of FPS source then
+			resournce can be enable/disable when related FPS

Have you used spell check? I suggest you do.

Documentation/devicetree/bindings/mfd/max77620.txt line 42

Quoted 3 lines
Documentation/devicetree/bindings/mfd/max77620.txt new file +3 -0
+			source gets the control signal for ON and OFF.
+	Power on slot: 	Slot number on which resource is ON once FPS source
+			get ON signal.

Can you find another way of explaining this please?

Documentation/devicetree/bindings/mfd/max77620.txt line 43

Quoted 1 line
Documentation/devicetree/bindings/mfd/max77620.txt new file +1 -0
+	Power down slot Slot number on which resource is OFF once FPS source

Please read what you wrote to see if it makes sense before submitting.

Documentation/devicetree/bindings/mfd/max77620.txt line 46

Quoted 3 lines
Documentation/devicetree/bindings/mfd/max77620.txt new file +3 -0
+			get OFF signal.
+
+There is three FPS source for resources called FPS0, FPS1 and FPS2. All

s/is/are/
s/source/sources/

Documentation/devicetree/bindings/mfd/max77620.txt line 47

Quoted 1 line
Documentation/devicetree/bindings/mfd/max77620.txt new file +1 -0
+resources need to attached to one of these FPS. It can alsoi be set

Please spell check the entire document.

Documentation/devicetree/bindings/mfd/max77620.txt line 48

Quoted 1 line
Documentation/devicetree/bindings/mfd/max77620.txt new file +1 -0
+FPS source to NONE, and on this case, it is completely controlled by

s/on/in/

Quoted 17 lines
Documentation/devicetree/bindings/mfd/max77620.txt new file +17 -0
+the register control rather than external input control to PMIC.
+
+The configuration parameters of FPS is provided through subnode "fps"
+and their child for FPS specific.
+The node name for FPS child are defined as "fps0", "fps1", and "fps2" for
+the FPS0, FPS1 and FPS2 respectively.
+
+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).
+
+Optinal properties:
+-------------------
+-maxim,fps-control:	u32, FPS control source like external control input
+			to PMIC i.e. EN0, EN1 or software (SW). The macros
+			are defined on dt-bindings/mfd/max77620.h for
+			different control source.

Documentation/devicetree/bindings/mfd/max77620.txt line 75

Quoted 10 lines
Documentation/devicetree/bindings/mfd/max77620.txt new file +10 -0
+				FPS_CONTROL_SRC_EN0 for PMIC external input EN0.
+				FPS_CONTROL_SRC_EN1 for PMIC external input EN1.
+				FPS_CONTROL_SRC_SW for software control.
+
+-maxim,shutdown-fps-time-period-us: u32, FPS time period in microseconds
+				    when system enters to shutdown state.
+-maxim,suspend-fps-time-period-us:  u32, FPS time period in microseconds
+				    when system enters to suspend state.
+
+-maxim,enable-sleep: 		    Boolean, enable sleep state of PMIC

We already have bindings for sleeping. Please use a generic one.

Quoted 84 lines
Documentation/devicetree/bindings/mfd/max77620.txt new file +43 -0
+				    when the FPS control input become active.
+-maxim,enable-global-lpm: 	    Boolean, enable Global Low Power Mode (GLPM)
+				    of PMIC when the FPS control input become
+				    active.
+
+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 different sub modules like GPIO, pincontrol, regulator, power, please refer
+respected device-tree binding document on respective 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-control = <FPS_CONTROL_SRC_EN1>;
+		};
+
+		fps1 {
+			maxim,shutdown-fps-time-period-us = <1280>;
+			maxim,fps-control = <FPS_CONTROL_SRC_EN0>;
+		};
+
+		fps2 {
+			maxim,shutdown-fps-time-period-us = <1280>;
+			maxim,fps-control = <FPS_CONTROL_SRC_SW>;
+		};
+	};
+};
include/dt-bindings/mfd/max77620.h new file +35 -0
new file mode 100644
index 0000000..1b571d7
@@ -0,0 +1,35 @@
+/*
+ * 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 control inputs */
+#define FPS_CONTROL_SRC_EN0		0
+#define FPS_CONTROL_SRC_EN1		1
+#define FPS_CONTROL_SRC_SW		2
+
+/* FPS source */
+#define FPS_SRC_0			0
+#define FPS_SRC_1			1
+#define FPS_SRC_2			2
+#define FPS_SRC_NONE			3
+#define FPS_SRC_DEF			4
+
+#endif
Signature · 8 lines
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#3 lore raw

Re: [PATCH V7 1/8] mfd: add device-tree binding doc for PMIC max77620/max20024

Quoted 7 lines · Lee Jones

On Sat, 30 Jan 2016, Laxman Dewangan wrote:

Documentation/devicetree/bindings/mfd/max77620.txt new file +4 -0
+	Normal mode also called as active mode on which all step-down
+		regulators, all linear regulators, GPIOs, and the 32kHz
+		oscillator are in normal active mode.
+	sleep mode: Regulators/GPIOs/clock can go on OFF state based on

"can go on OFF state"?

Regulator/GPIO has two states, enable and disable. If sleep mode is configured for these resource and external signal triggers to sleep then this get disabled.

Quoted 7 lines

Documentation/devicetree/bindings/mfd/max77620.txt line 39

Quoted 6 lines
Documentation/devicetree/bindings/mfd/max77620.txt new file +6 -0
+	Different modes of regulators/clock/GPIOs are controlled by the their
+FPS configurations. There is different configuration registers for each of
+these resources. Typical configurations per resource are:
+	FPS source: 	Attach the resource to required FPS source. When
+			resources are attached to one of FPS source then
+			resournce can be enable/disable when related FPS

Have you used spell check? I suggest you do.

My bad, I did but mixed with technical ignorance. Will try best.

Quoted 5 lines

Documentation/devicetree/bindings/mfd/max77620.txt line 42

Quoted 4 lines
Documentation/devicetree/bindings/mfd/max77620.txt new file +3 -0
+			source gets the control signal for ON and OFF.
+	Power on slot: 	Slot number on which resource is ON once FPS source
+			get ON signal.

Can you find another way of explaining this please?

Hmm..
Does it look fine:
There is 8 slots for each FPS on which resource can get enabled. This property provides the slot number on which resource gets enabled after FPS sequence started.

Quoted 5 lines

+

+-maxim,enable-sleep: 		    Boolean, enable sleep state of PMIC
We already have bindings for sleeping.  Please use a generic one.

Which property? Saw sleep property with vendor prefix.

#4 lore raw

Re: [PATCH V7 1/8] mfd: add device-tree binding doc for PMIC max77620/max20024

Quoted 4 lines · Laxman Dewangan
Quoted 2 lines · Lee Jones

On Sat, 30 Jan 2016, Laxman Dewangan wrote:

Quoted 9 lines
Quoted 5 lines
Documentation/devicetree/bindings/mfd/max77620.txt new file +4 -0
+	Normal mode also called as active mode on which all step-down
+		regulators, all linear regulators, GPIOs, and the 32kHz
+		oscillator are in normal active mode.
+	sleep mode: Regulators/GPIOs/clock can go on OFF state based on

"can go on OFF state"?

Regulator/GPIO has two states, enable and disable. If sleep mode is configured for these resource and external signal triggers to sleep then this get disabled.

It's the English that I'm unhappy with.

"can go on OFF state" doesn't sound right.

Quoted 10 lines
Quoted 4 lines

Documentation/devicetree/bindings/mfd/max77620.txt line 42

Quoted 3 lines
Documentation/devicetree/bindings/mfd/max77620.txt new file +3 -0
+			source gets the control signal for ON and OFF.
+	Power on slot: 	Slot number on which resource is ON once FPS source
+			get ON signal.

Can you find another way of explaining this please?

Hmm..
Does it look fine:
There is 8 slots for each FPS on which resource can get enabled. This property provides the slot number on which resource gets enabled after FPS sequence started.

It's a bit better, yes. Although it's still a little difficult to read. In fact, I can't even recommend a suitable alternative, since I still do not understand exactly what it is you're trying to say.

Quoted 5 lines
Quoted 3 lines

+

+-maxim,enable-sleep: 		    Boolean, enable sleep state of PMIC
We already have bindings for sleeping.  Please use a generic one.

Which property? Saw sleep property with vendor prefix.

I guess there are too many '.*sleep.*' properties now, each with slightly different syntax and meaning. The situation is exacerbated by one of the key examples is using the property with cells expected i.e. non-bool.

Signature · 4 lines
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
#5 lore raw

Re: [PATCH V7 1/8] mfd: add device-tree binding doc for PMIC max77620/max20024

Quoted 21 lines · Lee Jones
Quoted 11 lines · Laxman Dewangan
Quoted 7 lines · Lee Jones

On Sat, 30 Jan 2016, Laxman Dewangan wrote:

Documentation/devicetree/bindings/mfd/max77620.txt new file +4 -0
+	Normal mode also called as active mode on which all step-down
+		regulators, all linear regulators, GPIOs, and the 32kHz
+		oscillator are in normal active mode.
+	sleep mode: Regulators/GPIOs/clock can go on OFF state based on

"can go on OFF state"?

Regulator/GPIO has two states, enable and disable. If sleep mode is configured for these resource and external signal triggers to sleep then this get disabled.

It's the English that I'm unhappy with.

"can go on OFF state" doesn't sound right.

Quoted 4 lines
Quoted 4 lines

Documentation/devicetree/bindings/mfd/max77620.txt line 42

Quoted 3 lines
Documentation/devicetree/bindings/mfd/max77620.txt new file +3 -0
+			source gets the control signal for ON and OFF.
+	Power on slot: 	Slot number on which resource is ON once FPS source
+			get ON signal.

Can you find another way of explaining this please?

Quoted 8 lines
Quoted 5 lines

Hmm..
Does it look fine:
There is 8 slots for each FPS on which resource can get enabled. This property provides the slot number on which resource gets enabled after FPS sequence started.

It's a bit better, yes. Although it's still a little difficult to read. In fact, I can't even recommend a suitable alternative, since I still do not understand exactly what it is you're trying to say.

I am sorry if I am not able to make it clear. Better I post the datasheet content so that it is easy to understand and then we can have better text here.

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. nRST_IO 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. Each master sequencing timer is programmable through its configuration register to have a hardware enable source or a software enable source (CNFGFPSx). When enabled/disabled the master sequencing timer generates eight sequencing events. The time period between each event is programmable within the configuration register.

Each regulator, GPIO1, GPIO2, GPIO3, and nRST_IO has a flexible power sequence slave register (FPS_x) which allows its enable source to be specified as a flexible power sequencer timer or a software bit. When a FPSSRCx specifies the enable source to be a flexible power sequencer, the power up and power down delays are configured by FPSPUx[2:0] and FPSPDx[2:0].can be specified in that regulators flexible power sequencer configuration register.

Quoted 8 lines
Quoted 4 lines
Quoted 3 lines

+

+-maxim,enable-sleep: 		    Boolean, enable sleep state of PMIC
We already have bindings for sleeping.  Please use a generic one.

Which property? Saw sleep property with vendor prefix.

I guess there are too many '.*sleep.*' properties now, each with slightly different syntax and meaning. The situation is exacerbated by one of the key examples is using the property with cells expected i.e. non-bool.

My grep shows some sleep property and followig are near to which I am looking.

st,supports-sleepmode

pinctrl/ste,nomadik.txt:- ste,sleep: <0/1>
0: sleep mode disable, 1: sleep mode enable.

Should I made this as generic like

sleep: <0/1>
0: sleep mode disable,
1: sleep mode enable.

#6 lore raw

Re: [PATCH V7 1/8] mfd: add device-tree binding doc for PMIC max77620/max20024

Quoted 53 lines · Laxman Dewangan
Quoted 21 lines · Lee Jones
Quoted 11 lines · Laxman Dewangan
Quoted 7 lines · Lee Jones

On Sat, 30 Jan 2016, Laxman Dewangan wrote:

Documentation/devicetree/bindings/mfd/max77620.txt new file +4 -0
+	Normal mode also called as active mode on which all step-down
+		regulators, all linear regulators, GPIOs, and the 32kHz
+		oscillator are in normal active mode.
+	sleep mode: Regulators/GPIOs/clock can go on OFF state based on

"can go on OFF state"?

Regulator/GPIO has two states, enable and disable. If sleep mode is configured for these resource and external signal triggers to sleep then this get disabled.

It's the English that I'm unhappy with.

"can go on OFF state" doesn't sound right.

Quoted 4 lines
Quoted 4 lines

Documentation/devicetree/bindings/mfd/max77620.txt line 42

Quoted 3 lines
Documentation/devicetree/bindings/mfd/max77620.txt new file +3 -0
+			source gets the control signal for ON and OFF.
+	Power on slot: 	Slot number on which resource is ON once FPS source
+			get ON signal.

Can you find another way of explaining this please?

Quoted 8 lines
Quoted 5 lines

Hmm..
Does it look fine:
There is 8 slots for each FPS on which resource can get enabled. This property provides the slot number on which resource gets enabled after FPS sequence started.

It's a bit better, yes. Although it's still a little difficult to read. In fact, I can't even recommend a suitable alternative, since I still do not understand exactly what it is you're trying to say.

I am sorry if I am not able to make it clear. Better I post the datasheet content so that it is easy to understand and then we can have better text here.

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. nRST_IO 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. Each master sequencing timer is programmable through its configuration register to have a hardware enable source or a software enable source (CNFGFPSx). When enabled/disabled the master sequencing timer generates eight sequencing events. The time period between each event is programmable within the configuration register.

Quoted 7 lines

Each regulator, GPIO1, GPIO2, GPIO3, and nRST_IO has a flexible power sequence slave register (FPS_x) which allows its enable source to be specified as a flexible power sequencer timer or a software bit. When a FPSSRCx specifies the enable source to be a flexible power sequencer, the power up and power down delays are configured by FPSPUx[2:0] and FPSPDx[2:0].can be specified in that regulators flexible power sequencer configuration register.

Perfect, let's go with that.

Quoted 19 lines
Quoted 7 lines
Quoted 3 lines
Quoted 2 lines
+-maxim,enable-sleep: 		    Boolean, enable sleep state of PMIC
We already have bindings for sleeping.  Please use a generic one.

Which property? Saw sleep property with vendor prefix.

I guess there are too many '.*sleep.*' properties now, each with slightly different syntax and meaning. The situation is exacerbated by one of the key examples is using the property with cells expected i.e. non-bool.

My grep shows some sleep property and followig are near to which I am looking.

st,supports-sleepmode

pinctrl/ste,nomadik.txt:- ste,sleep: <0/1>
0: sleep mode disable, 1: sleep mode enable.

Quoted 5 lines

Should I made this as generic like

sleep: <0/1>
0: sleep mode disable,
1: sleep mode enable.

Ideally yes. This is obviously going to be used again.

However;
- My fear is that it will get confused with the 'sleep' property in Documentation/devicetree/booting-without-of.txt.
- Secondly, you would need to get Rob to Ack it.

Signature · 4 lines
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
#7 lore raw

Re: [PATCH V7 1/8] mfd: add device-tree binding doc for PMIC max77620/max20024

Quoted 6 lines · Lee Jones
Quoted 4 lines · Laxman Dewangan

sleep: <0/1>
0: sleep mode disable,
1: sleep mode enable.

Quoted 7 lines

Ideally yes. This is obviously going to be used again.

However;
- My fear is that it will get confused with the 'sleep' property in Documentation/devicetree/booting-without-of.txt.
- Secondly, you would need to get Rob to Ack it.

Another thought, becasue this is just for enable/disable, why not we add property as "enable-sleep" of boolean type instead of u32 value type?

It is easy to describe the behavior with enable-sleep and enable-low-power-mode.

-enable-sleep: Boolean, when FPS event cleared
(set to LOW), resources get
disabled
at the sequencing event
corresponding
to its FPS configuration register.

-enable-low-power-mode: Boolean, when FPS event cleared
(set to LOW), resources sets into low power mode at the
sequencing event
corresponding to its FPS
configuration
register.

Both property can not be together.

Other approach is to club together 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.

                                                                1 = 
Device state is set to sleep
                                                                2 = 

Device state is set to low power mode.
Absence of this property or other value will not change device state when FPS event
cleared.