Skip to contentSkip to conversation

Add Maxim 77802 PMIC support

PATCH Superseded Javier Martinez Canillas 3 participants 19 messages Jul 14, 2014 – Jul 28, 2014

Subsystems (8)

v8 of 10 Superseded Latest is v10 →

lore
Share & tools
lore
#0 lore raw

v8 cover Add Maxim 77802 PMIC support

This series are based on drivers added by Simon Glass to the Chrome OS kernel and adds support for the Maxim 77802 Power Management IC, their regulators, clocks, RTC and i2c interface.

This is a v8 of the patch-set that addresses issues pointed out in v7. Individual changes are added on each patch but the biggest changes are:

* Patches 1-7 from v7 are not included since those were improvements to the max77686 mfd driver and can be applied independently. Lee Jones said that he is going to pick them from the posted v7 series.

I've created a patchwork bundle with 1-7 from v7 to make it easy to apply:

https://patchwork.kernel.org/bundle/javier/max77686-improvements/

* The Dynamic Voltage Scaling support has been removed since that can be added in a follow up series and shouldn't block the minimum PMIC support.

The patch-set has been tested on both Daisy/Snow (max77686) and Peach Pit (max77802) Chromebooks and it's composed of the following patches:

[PATCH v8 01/13] mfd: max77686: Add Maxim 77802 PMIC support
[PATCH v8 02/13] mfd: max77802: Add DT binding documentation
[PATCH v8 03/13] regulator: Add driver for Maxim 77802 PMIC regulators [PATCH v8 04/13] clk: max77686: Add DT include for MAX77686 PMIC clock [PATCH v8 05/13] clk: Add generic driver for Maxim PMIC clocks
[PATCH v8 06/13] clk: max77686: Convert to the generic max clock driver [PATCH v8 07/13] clk: max77686: Improve Maxim 77686 PMIC clocks binding [PATCH v8 08/13] clk: Add driver for Maxim 77802 PMIC clocks
[PATCH v8 09/13] clk: max77802: Add DT binding documentation
[PATCH v8 10/13] rtc: max77686: Allow the max77686 rtc to wakeup the system [PATCH v8 11/13] rtc: max77686: Remove dead code for SMPL and WTSR
[PATCH v8 12/13] rtc: Add driver for Maxim 77802 PMIC Real-Time-Clock [PATCH v8 13/13] ARM: dts: Add max77802 to exynos5420-peach-pit and exynos5800-peach-pi

Patch 01/13 extend the max77686 mfd driver to also support the max77802 PMIC and patch 02/13 adds the DT binding documentation for this PMIC.

Patch 03/13 adds support for the regulators found in the PMIC.

Patch 04/13 to 07/13 are improvements and refactoring to the max77686 clock driver to avoid code duplication when adding max77802 clocks support in patch 08/13. Patch 09/13 adds the DT binding document for the max77802 clock driver.

Patches 10/13 and 11/13 are improvements to max77686 RTC driver and patch 12/13 adds support for the RTC found in the max77802 PMIC.

Finally patch 13/13 adds the required device node to the Peach Pit and Pi exynos5 based boards.

Since there are cross-subsystems dependencies, I think that the best way to sort this out is if relevant maintainers ack the patches so 01/13 to 012/13 can be merged through the mfd tree. The patches and the relevant acks are:

Patch 03/13 (regulator - Mark Brown)
Patches 04/13 to 09/13 (clk - Mike Turquette)
Patches 10/13 to 12/13 (rtc - Alessandro Zummo)

Patch 13/13 is only a DTS change so it can be picked by Kukjin Kim once the other patches are picked by Lee Jones.

Since we are in 3.16-rc5 already, it would be great if I can get your acks or feedback since I was hoping this series to make it to 3.17. This is due other series that were already posted depend on this one.

Also, the series have been reviewed and tested by Samsung folks and most of the patches already collected Reviewed-by and Tested-by tags.

Thanks a lot and best regards,
Javier

#1 lore raw

PATCH v8 1/13 mfd: max77686: Add Maxim 77802 PMIC support

Maxim MAX77802 is a power management chip that contains 10 high efficiency Buck regulators, 32 Low-dropout (LDO) regulators used to power up application processors and peripherals, a 2-channel 32kHz clock outputs, a Real-Time-Clock (RTC) and a I2C interface to program the individual regulators, clocks outputs and the RTC.

This patch adds support for MAX77802 to the MAX77686 driver and is based on a driver added to the Chrome OS kernel 3.8 by Simon Glass.

---

Changes since v7:
- Don't add an entry in the i2c_device_id table. Suggested by Lee Jones.
- Use of_device_id match table instead of i2c_device_id to know the PMIC type.

Changes since v6:
- Fix comments grammar. Suggested by Krzysztof Kozlowski.
- Only unregister the RTC i2c device if the type is MAX77686. Suggested by Krzysztof Kozlowski.

Changes since v5:
- Extend the 77686 driver to support 77802 instead of adding a new driver. Suggested by Lee Jones.

Changes since v4:
- Use consistent expressions when checking for NULL values. Suggested by Krzysztof Kozlowski.
- Remove unused defines. Suggested by Krzysztof Kozlowski.
- Explain why IRQ is disabled on suspend. Suggested by Krzysztof Kozlowski.

Changes since v3:
- Remove unnecessary OOM error message since the mm subsystem already logs it.

Changes since v2:
- Split the DT binding docs in a separate patch and improve the documentation. Suggested by Mark Brown.
- Add all the devices in the MFD driver instead of doing in separate patches. Suggested by Mark Brown.

Changes since v1:
- Convert max77{686,802} to regmap irq API and get rid of max77{686,802}-irq.c Suggested by Krzysztof Kozlowski.
- Don't protect max77802 mfd_cells using Kconfig options since mfd core omits devices that don't match. Suggested by Lee Jones.
- Change mfd driver to be tristate instead of boolean. Suggested by Mark Brown.
- Change binding "voltage-regulators" property to "regulators" to be consistent with other PMIC drivers. Suggested by Mark Brown.
- Use regulators node names instead of the deprecated "regulator-compatible" property. Suggested by Mark Brown.
- Use the new descriptor-based GPIO interface instead of the deprecated

---
 drivers/mfd/Kconfig                  |   6 +-
 drivers/mfd/max77686.c               | 201 ++++++++++++++++++++++++++++-----
 include/linux/mfd/max77686-private.h | 208 ++++++++++++++++++++++++++++++++++-
 include/linux/mfd/max77686.h         |  57 +++++++++-
 4 files changed, 438 insertions(+), 34 deletions(-)
drivers/mfd/Kconfig +3 -3
index 3010204..de5abf2 100644
@@ -380,15 +380,15 @@ config MFD_MAX14577
 	  of the device.
 
 config MFD_MAX77686
-	bool "Maxim Semiconductor MAX77686 PMIC Support"
+	bool "Maxim Semiconductor MAX77686/802 PMIC Support"
 	depends on I2C=y
 	select MFD_CORE
 	select REGMAP_I2C
 	select REGMAP_IRQ
 	select IRQ_DOMAIN
 	help
-	  Say yes here to add support for Maxim Semiconductor MAX77686.
-	  This is a Power Management IC with RTC on chip.
+	  Say yes here to add support for Maxim Semiconductor MAX77686 and
+	  MAX77802 which are Power Management IC with an RTC on chip.
 	  This driver provides common support for accessing the device;
 	  additional drivers must be enabled in order to use the functionality
 	  of the device.
drivers/mfd/max77686.c +172 -29

290 lines not on this page · raw message

include/linux/mfd/max77686-private.h +207 -1

230 lines not on this page · raw message

include/linux/mfd/max77686.h +56 -1

73 lines not on this page · raw message

Signature · 1 line
2.0.0.rc2
#2 lore raw

PATCH v8 2/13 mfd: max77802: Add DT binding documentation

In reply to Javier Martinez Canillas

Add Device Tree binding documentation for Maxim 77802 PMIC.

---

Changes since v7:
- Remove information about DVS since that will be added as a follow up.

Changes since v6: None

Changes since v5:
- Use max77686,* properties instead of max77802,* since the support is now in the max77686 driver and that IP defined the properties first.
- Fix issues in DT binding documentation. Suggested by Andreas Farber.

Changes since v4: None

Changes since v3: None

Changes since v2:
- Explain better the Dynamic Voltage Scaling (DVS) support in some Buck regulators and the max77802,pmic-buck-{dvs,selb}-gpios properties. Suggested by Mark Brown.

---
 Documentation/devicetree/bindings/mfd/max77802.txt | 59 ++++++++++++++++++++++
 1 file changed, 59 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mfd/max77802.txt
Documentation/devicetree/bindings/mfd/max77802.txt new file +59 -0
new file mode 100644
index 0000000..9f72b8f
@@ -0,0 +1,59 @@
+Maxim MAX77802 multi-function device
+
+MAX77802 is a Multifunction device with PMIC, RTC and Charger on chip. It is
+interfaced to host controller using i2c interface. PMIC, Charger and RTC
+submodules are addressed using same i2c slave address.
+
+This document describes the binding for mfd device and PMIC submodule.
+
+Binding for the built-in 32k clock generator block is defined separately
+in bindings/clk/maxim,max77802.txt file.
+
+Required properties:
+- compatible : Must be "maxim,max77802";
+- reg : Specifies the i2c slave address of PMIC block.
+- interrupts : This i2c device has an IRQ line connected to the main SoC.
+- interrupt-parent : The parent interrupt controller.
+
+Optional node:
+- regulators : The regulators of max77802 have to be instantiated
+  under subnode named "regulators" using the following format.
+
+	regulator-name {
+		standard regulator constraints....
+	};
+	refer Documentation/devicetree/bindings/regulator/regulator.txt
+
+  The regulator node name should be initialized with a string
+to get matched with their hardware counterparts as follow. The valid names are:
+
+	-LDOn 	:	for LDOs, where n can lie in range 1 to 35.
+			example: LDO1, LDO2, LDO35.
+	-BUCKn 	:	for BUCKs, where n can lie in range 1 to 10.
+			example: BUCK1, BUCK5, BUCK10.
+Example:
+
+	max77802 at 09 {
+		compatible = "maxim,max77802";
+		interrupt-parent = <&wakeup_eint>;
+		interrupts = <26 0>;
+		reg = <0x09>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		regulators {
+			ldo11_reg: LDO11 {
+				regulator-name = "vdd_ldo11";
+				regulator-min-microvolt = <1900000>;
+				regulator-max-microvolt = <1900000>;
+				regulator-always-on;
+			};
+
+			buck1_reg: BUCK1 {
+				regulator-name = "vdd_mif";
+				regulator-min-microvolt = <950000>;
+				regulator-max-microvolt = <1300000>;
+				regulator-always-on;
+				regulator-boot-on;
+			};
+	};
Signature · 1 line
2.0.0.rc2
#3 lore raw

PATCH v8 3/13 regulator: Add driver for Maxim 77802 PMIC regulators

In reply to Javier Martinez Canillas

The MAX77802 PMIC has 10 high-efficiency Buck and 32 Low-dropout (LDO) regulators. This patch adds support for all these regulators found on the MAX77802 PMIC and is based on a driver added by Simon Glass to the Chrome OS kernel 3.8 tree.

---

Changes since v7:
- Remove DVS support since that can be added as a follow up.

Changes since v6: None

Changes since v5:
- Take out the mfd changes from v4 that were squashed by mistake. Suggested by Lee Jones.

Changes since v4: None

Changes since v3:
- Set the supply_name for regulators to lookup their parent supply node. Suggested by Mark Brown.
- Change Exyno5 for Exynos5420/Exynos5800 in regulator driver Kconfig. Suggested by Doug Anderson.

---
 drivers/regulator/Kconfig    |   9 +
 drivers/regulator/Makefile   |   1 +
 drivers/regulator/max77802.c | 578 +++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 588 insertions(+)
 create mode 100644 drivers/regulator/max77802.c
drivers/regulator/Kconfig +9 -0
index 789eb46..96d1c68 100644
@@ -377,6 +377,15 @@ config REGULATOR_MAX77693
 	  and one current regulator 'CHARGER'. This is suitable for
 	  Exynos-4x12 chips.
 
+config REGULATOR_MAX77802
+	tristate "Maxim 77802 regulator"
+	depends on MFD_MAX77686
+	help
+	  This driver controls a Maxim 77802 regulator
+	  via I2C bus. The provided regulator is suitable for
+	  Exynos5420/Exynos5800 SoCs to control various voltages.
+	  It includes support for control of voltage and ramp speed.
+
 config REGULATOR_MC13XXX_CORE
 	tristate
 
drivers/regulator/Makefile +1 -0
index d461110..2aea4b6 100644
@@ -51,6 +51,7 @@ obj-$(CONFIG_REGULATOR_MAX8997) += max8997.o
 obj-$(CONFIG_REGULATOR_MAX8998) += max8998.o
 obj-$(CONFIG_REGULATOR_MAX77686) += max77686.o
 obj-$(CONFIG_REGULATOR_MAX77693) += max77693.o
+obj-$(CONFIG_REGULATOR_MAX77802) += max77802.o
 obj-$(CONFIG_REGULATOR_MC13783) += mc13783-regulator.o
 obj-$(CONFIG_REGULATOR_MC13892) += mc13892-regulator.o
 obj-$(CONFIG_REGULATOR_MC13XXX_CORE) +=  mc13xxx-regulator-core.o
drivers/regulator/max77802.c new file +578 -0

578 lines not on this page · raw message

Signature · 1 line
2.0.0.rc2
#4 lore raw

PATCH v8 4/13 clk: max77686: Add DT include for MAX77686 PMIC clock

In reply to Javier Martinez Canillas

This patch adds a dt-binding include for Maxim 77686 PMIC clock IDs that can be used by both the max77686 clock driver and Device Tree source files.

---

Changes since v6: None

Changes since v5:
- Improve wording in commit message. Suggested by Andreas Farber.

Changes since v4: None

Changes since v3:
- Keep the note that this patch needs another change due wakeup ordering problems.

---
 drivers/clk/clk-max77686.c                 |  7 +------
 include/dt-bindings/clock/maxim,max77686.h | 23 +++++++++++++++++++++++
 2 files changed, 24 insertions(+), 6 deletions(-)
 create mode 100644 include/dt-bindings/clock/maxim,max77686.h
drivers/clk/clk-max77686.c +1 -6
index 3d7e8dd..185b611 100644
@@ -30,12 +30,7 @@
 #include <linux/mutex.h>
 #include <linux/clkdev.h>
 
-enum {
-	MAX77686_CLK_AP = 0,
-	MAX77686_CLK_CP,
-	MAX77686_CLK_PMIC,
-	MAX77686_CLKS_NUM,
-};
+#include <dt-bindings/clock/maxim,max77686.h>
 
 struct max77686_clk {
 	struct max77686_dev *iodev;
include/dt-bindings/clock/maxim,max77686.h new file +23 -0
new file mode 100644
index 0000000..7b28b09
@@ -0,0 +1,23 @@
+/*
+ * Copyright (C) 2014 Google, Inc
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Device Tree binding constants clocks for the Maxim 77686 PMIC.
+ */
+
+#ifndef _DT_BINDINGS_CLOCK_MAXIM_MAX77686_CLOCK_H
+#define _DT_BINDINGS_CLOCK_MAXIM_MAX77686_CLOCK_H
+
+/* Fixed rate clocks. */
+
+#define MAX77686_CLK_AP		0
+#define MAX77686_CLK_CP		1
+#define MAX77686_CLK_PMIC	2
+
+/* Total number of clocks. */
+#define MAX77686_CLKS_NUM		(MAX77686_CLK_PMIC + 1)
+
+#endif /* _DT_BINDINGS_CLOCK_MAXIM_MAX77686_CLOCK_H */
Signature · 1 line
2.0.0.rc2
#5 lore raw

PATCH v8 5/13 clk: Add generic driver for Maxim PMIC clocks

In reply to Javier Martinez Canillas

Maxim Integrated Power Management ICs are very similar with regard to their clock outputs. Most of the clock drivers for these chips are duplicating code and are simpler enough that can be converted to use a generic driver to consolidate code and avoid duplication.

---

Changes since v6: None

Changes since v5:
- Fix generic driver changes merged into max77802 clock patch by mistake. Suggested by Yadwinder Singh Brar.
- Register clock lookups using clk_register_clkdev() instead of doing manually.
- Use the managed devm_clk_register() function and remove clk un-registration.
- Add "clock-output-names" property support. Suggested by Yadwinder Singh Brar.
- Return the rate unconditionally in recalc_rate. Suggested by Mike Turquette.

Changes since v4: None

Changes since v3:
- Don't change clock-names property to make clear that it's the consumer clock name and should not match the producer clock. Suggested by Doug Anderson.

---
 drivers/clk/Kconfig       |   3 +
 drivers/clk/Makefile      |   1 +
 drivers/clk/clk-max-gen.c | 192 ++++++++++++++++++++++++++++++++++++++++++++++
 drivers/clk/clk-max-gen.h |  32 ++++++++
 4 files changed, 228 insertions(+)
 create mode 100644 drivers/clk/clk-max-gen.c
 create mode 100644 drivers/clk/clk-max-gen.h
drivers/clk/Kconfig +3 -0
index 9f9c5ae..73f78e8 100644
@@ -32,6 +32,9 @@ config COMMON_CLK_WM831X
 
 source "drivers/clk/versatile/Kconfig"
 
+config COMMON_CLK_MAX_GEN
+        bool
+
 config COMMON_CLK_MAX77686
 	tristate "Clock driver for Maxim 77686 MFD"
 	depends on MFD_MAX77686
drivers/clk/Makefile +1 -0
index 567f102..6c1aff6 100644
@@ -18,6 +18,7 @@ obj-$(CONFIG_ARCH_BCM2835)		+= clk-bcm2835.o
 obj-$(CONFIG_ARCH_EFM32)		+= clk-efm32gg.o
 obj-$(CONFIG_ARCH_HIGHBANK)		+= clk-highbank.o
 obj-$(CONFIG_MACH_LOONGSON1)		+= clk-ls1x.o
+obj-$(CONFIG_COMMON_CLK_MAX_GEN)	+= clk-max-gen.o
 obj-$(CONFIG_COMMON_CLK_MAX77686)	+= clk-max77686.o
 obj-$(CONFIG_ARCH_MOXART)		+= clk-moxart.o
 obj-$(CONFIG_ARCH_NOMADIK)		+= clk-nomadik.o
drivers/clk/clk-max-gen.c new file +192 -0

192 lines not on this page · raw message

drivers/clk/clk-max-gen.h new file +32 -0
new file mode 100644
index 0000000..997e86f
@@ -0,0 +1,32 @@
+/*
+ * clk-max-gen.h - Generic clock driver for Maxim PMICs clocks
+ *
+ * Copyright (C) 2014 Google, Inc
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ */
+
+#ifndef __CLK_MAX_GEN_H__
+#define __CLK_MAX_GEN_H__
+
+#include <linux/types.h>
+#include <linux/device.h>
+#include <linux/clkdev.h>
+#include <linux/regmap.h>
+#include <linux/platform_device.h>
+
+int max_gen_clk_probe(struct platform_device *pdev, struct regmap *regmap,
+		      u32 reg, struct clk_init_data *clks_init, int num_init);
+int max_gen_clk_remove(struct platform_device *pdev, int num_init);
+extern struct clk_ops max_gen_clk_ops;
+
+#endif /* __CLK_MAX_GEN_H__ */
Signature · 1 line
2.0.0.rc2
#6 lore raw

PATCH v8 6/13 clk: max77686: Convert to the generic max clock driver

In reply to Javier Martinez Canillas

Clocks drivers for Maxim PMIC are very similar so they can be converted to use the generic Maxim clock driver.

Also, while being there use module_platform_driver() helper macro to eliminate more boilerplate code.

---
 drivers/clk/Kconfig        |   1 +
 drivers/clk/clk-max77686.c | 176 +++------------------------------------------
 2 files changed, 9 insertions(+), 168 deletions(-)
drivers/clk/Kconfig +1 -0
index 73f78e8..3fd4270 100644
@@ -38,6 +38,7 @@ config COMMON_CLK_MAX_GEN
 config COMMON_CLK_MAX77686
 	tristate "Clock driver for Maxim 77686 MFD"
 	depends on MFD_MAX77686
+	select COMMON_CLK_MAX_GEN
 	---help---
 	  This driver supports Maxim 77686 crystal oscillator clock. 
 
drivers/clk/clk-max77686.c +8 -168

212 lines not on this page · raw message

Signature · 1 line
2.0.0.rc2
#7 lore raw

PATCH v8 7/13 clk: max77686: Improve Maxim 77686 PMIC clocks binding

In reply to Javier Martinez Canillas

Like most clock drivers, the Maxim 77686 PMIC clock binding follows the convention that the "#clock-cells" property is used to specify the number of cells in a clock provider.

But the binding document is not clear enough that it shall be set to 1 since the PMIC support multiple clocks outputs.

Also, explain that the clocks identifiers are defined in a header file that can be included by Device Tree source with client nodes to avoid using magic numbers.

Finally, add "clock-output-names" as an optional property since now is supported by the clock driver.

---

Changes since v6: None

Changes since v5:
- Fix generic driver changes merged into max77802 clock patch by mistake. Suggested by Yadwinder Singh Brar.
- Register clock lookups using clk_register_clkdev() instead of doing manually.
- Use the managed devm_clk_register() function and remove clk un-registration.
- Add "clock-output-names" property support. Suggested by Yadwinder Singh Brar.
- Return the rate unconditionally in recalc_rate. Suggested by Mike Turquette.

Changes since v4: None

Changes since v3:
- Don't change clock-names property to make clear that it's the consumer clock name and should not match the producer clock. Suggested by Doug Anderson.

---
 .../devicetree/bindings/clock/maxim,max77686.txt         | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)
Documentation/devicetree/bindings/clock/maxim,max77686.txt +12 -4
index 96ce71b..9c40739 100644
@@ -9,13 +9,21 @@ The MAX77686 contains three 32.768khz clock outputs that can be controlled
 Following properties should be presend in main device node of the MFD chip.
 
 Required properties:
-- #clock-cells: simple one-cell clock specifier format is used, where the
-  only cell is used as an index of the clock inside the provider. Following
-  indices are allowed:
+
+- #clock-cells: from common clock binding; shall be set to 1.
+
+Optional properties:
+- clock-output-names: From common clock binding.
+
+Each clock is assigned an identifier and client nodes can use this identifier
+to specify the clock which they consume. Following indices are allowed:
     - 0: 32khz_ap clock,
     - 1: 32khz_cp clock,
     - 2: 32khz_pmic clock.
 
+Clocks are defined as preprocessor macros in dt-bindings/clock/maxim,max77686.h
+header and can be used in device tree sources.
+
 Example: Node of the MFD chip
 
 	max77686: max77686 at 09 {
@@ -34,5 +42,5 @@ Example: Clock consumer node
 		compatible = "bar,foo";
 		/* ... */
 		clock-names = "my-clock";
-		clocks = <&max77686 2>;
+		clocks = <&max77686 MAX77686_CLK_PMIC>;
 	};
Signature · 1 line
2.0.0.rc2
#8 lore raw

PATCH v8 8/13 clk: Add driver for Maxim 77802 PMIC clocks

In reply to Javier Martinez Canillas

The MAX77802 PMIC has two 32.768kHz Buffered Clock Outputs with Low Jitter Mode. This patch adds support for these two clocks.

---

Changes since v6: None

Changes since v5: None

Changes since v4: None

Changes since v3: None

Changes since v2: None

Changes since v1:
- Use module_platform_driver() instead of having init/exit functions. Suggested by Mark Brown.
- Use the generic maxim clock driver to reduce code duplication with clk-max77686.c driver.

---
 drivers/clk/Kconfig                        |  7 +++
 drivers/clk/Makefile                       |  1 +
 drivers/clk/clk-max77802.c                 | 98 ++++++++++++++++++++++++++++++
 include/dt-bindings/clock/maxim,max77802.h | 22 +++++++
 4 files changed, 128 insertions(+)
 create mode 100644 drivers/clk/clk-max77802.c
 create mode 100644 include/dt-bindings/clock/maxim,max77802.h
drivers/clk/Kconfig +7 -0
index 3fd4270..8808f2a 100644
@@ -42,6 +42,13 @@ config COMMON_CLK_MAX77686
 	---help---
 	  This driver supports Maxim 77686 crystal oscillator clock. 
 
+config COMMON_CLK_MAX77802
+	tristate "Clock driver for Maxim 77802 PMIC"
+	depends on MFD_MAX77686
+	select COMMON_CLK_MAX_GEN
+	---help---
+	  This driver supports Maxim 77802 crystal oscillator clock.
+
 config COMMON_CLK_SI5351
 	tristate "Clock driver for SiLabs 5351A/B/C"
 	depends on I2C
drivers/clk/Makefile +1 -0
index 6c1aff6..520ff76 100644
@@ -20,6 +20,7 @@ obj-$(CONFIG_ARCH_HIGHBANK)		+= clk-highbank.o
 obj-$(CONFIG_MACH_LOONGSON1)		+= clk-ls1x.o
 obj-$(CONFIG_COMMON_CLK_MAX_GEN)	+= clk-max-gen.o
 obj-$(CONFIG_COMMON_CLK_MAX77686)	+= clk-max77686.o
+obj-$(CONFIG_COMMON_CLK_MAX77802)	+= clk-max77802.o
 obj-$(CONFIG_ARCH_MOXART)		+= clk-moxart.o
 obj-$(CONFIG_ARCH_NOMADIK)		+= clk-nomadik.o
 obj-$(CONFIG_ARCH_NSPIRE)		+= clk-nspire.o
drivers/clk/clk-max77802.c new file +98 -0

98 lines not on this page · raw message

include/dt-bindings/clock/maxim,max77802.h new file +22 -0
new file mode 100644
index 0000000..997312e
@@ -0,0 +1,22 @@
+/*
+ * Copyright (C) 2014 Google, Inc
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Device Tree binding constants clocks for the Maxim 77802 PMIC.
+ */
+
+#ifndef _DT_BINDINGS_CLOCK_MAXIM_MAX77802_CLOCK_H
+#define _DT_BINDINGS_CLOCK_MAXIM_MAX77802_CLOCK_H
+
+/* Fixed rate clocks. */
+
+#define MAX77802_CLK_32K_AP		0
+#define MAX77802_CLK_32K_CP		1
+
+/* Total number of clocks. */
+#define MAX77802_CLKS_NUM		(MAX77802_CLK_32K_CP + 1)
+
+#endif /* _DT_BINDINGS_CLOCK_MAXIM_MAX77802_CLOCK_H */
Signature · 1 line
2.0.0.rc2
#9 lore raw

PATCH v8 9/13 clk: max77802: Add DT binding documentation

In reply to Javier Martinez Canillas

Add Device Tree binding documentation for the clocks outputs in the Maxim 77802 Power Management IC.

---

Changes since v6: None

Changes since v5:
- Fix typo error in DT binding. Suggested by Andreas Farber.
- Add "clock-output-names" as an optional property since now is supported.

Changes since v4: None

Changes since v3:
- Don't use the same clock driver name in clock-names since it's a consumer concept and most probably will be different. Suggested by Doug Anderson.

Changes since v2:
- Split the DT binding documentation in a separate patch.

---
 .../devicetree/bindings/clock/maxim,max77802.txt   | 44 ++++++++++++++++++++++
 1 file changed, 44 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/clock/maxim,max77802.txt
Documentation/devicetree/bindings/clock/maxim,max77802.txt new file +44 -0
new file mode 100644
index 0000000..c6dc783
@@ -0,0 +1,44 @@
+Binding for Maxim MAX77802 32k clock generator block
+
+This is a part of device tree bindings of MAX77802 multi-function device.
+More information can be found in bindings/mfd/max77802.txt file.
+
+The MAX77802 contains two 32.768khz clock outputs that can be controlled
+(gated/ungated) over I2C.
+
+Following properties should be present in main device node of the MFD chip.
+
+Required properties:
+- #clock-cells: From common clock binding; shall be set to 1.
+
+Optional properties:
+- clock-output-names: From common clock binding.
+
+Each clock is assigned an identifier and client nodes can use this identifier
+to specify the clock which they consume. Following indices are allowed:
+     - 0: 32khz_ap clock,
+     - 1: 32khz_cp clock.
+
+Clocks are defined as preprocessor macros in dt-bindings/clock/maxim,max77802.h
+header and can be used in device tree sources.
+
+Example: Node of the MFD chip
+
+	max77802: max77802 at 09 {
+		compatible = "maxim,max77802";
+		interrupt-parent = <&wakeup_eint>;
+		interrupts = <26 0>;
+		reg = <0x09>;
+		#clock-cells = <1>;
+
+		/* ... */
+	};
+
+Example: Clock consumer node
+
+	foo at 0 {
+		compatible = "bar,foo";
+		/* ... */
+		clock-names = "my-clock";
+		clocks = <&max77802 MAX77802_CLK_32K_AP>;
+	};
Signature · 1 line
2.0.0.rc2
#10 lore raw

PATCH v8 10/13 rtc: max77686: Allow the max77686 rtc to wakeup the system

In reply to Javier Martinez Canillas

From: Doug Anderson <[email protected]>

The max77686 includes an RTC that keeps power during suspend. It's convenient to be able to use it as a wakeup source.

NOTE: due to wakeup ordering problems this patch alone doesn't work so well on exynos5250-snow. You also need something that brings the i2c bus up before the max77686 wakeup runs.

---

Changes since v6: None

Changes since v5:
- Fix $SUBJECT since the patch does not actually touch the mfd subsys. Suggested by Lee Jones.

Changes since v4: None

Changes since v3:
- Keep the note that this patch needs another change due wakeup ordering problems.

---
 drivers/rtc/rtc-max77686.c | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)
drivers/rtc/rtc-max77686.c +28 -0
index d20a7f0..c1c6055 100644
@@ -583,6 +583,33 @@ static void max77686_rtc_shutdown(struct platform_device *pdev)
 #endif /* MAX77686_RTC_WTSR_SMPL */
 }
 
+#ifdef CONFIG_PM_SLEEP
+static int max77686_rtc_suspend(struct device *dev)
+{
+	if (device_may_wakeup(dev)) {
+		struct max77686_rtc_info *info = dev_get_drvdata(dev);
+
+		return enable_irq_wake(info->virq);
+	}
+
+	return 0;
+}
+
+static int max77686_rtc_resume(struct device *dev)
+{
+	if (device_may_wakeup(dev)) {
+		struct max77686_rtc_info *info = dev_get_drvdata(dev);
+
+		return disable_irq_wake(info->virq);
+	}
+
+	return 0;
+}
+#endif
+
+static SIMPLE_DEV_PM_OPS(max77686_rtc_pm_ops,
+			 max77686_rtc_suspend, max77686_rtc_resume);
+
 static const struct platform_device_id rtc_id[] = {
 	{ "max77686-rtc", 0 },
 	{},
@@ -592,6 +619,7 @@ static struct platform_driver max77686_rtc_driver = {
 	.driver		= {
 		.name	= "max77686-rtc",
 		.owner	= THIS_MODULE,
+		.pm	= &max77686_rtc_pm_ops,
 	},
 	.probe		= max77686_rtc_probe,
 	.shutdown	= max77686_rtc_shutdown,
Signature · 1 line
2.0.0.rc2
#11 lore raw

PATCH v8 11/13 rtc: max77686: Remove dead code for SMPL and WTSR.

In reply to Javier Martinez Canillas

The MAX77686 RTC chip has two features called SMPL (Sudden Momentary Power Loss) and WTSR (Watchdog Timeout and Software Resets). Support for these features seems to be implemented in the driver but compilation is disabled using a C pre-processor conditional.

This code has been disabled since the driver was original merged in commit fca1dd03 ("rtc: max77686: add Maxim 77686 driver").

So, since this code has never been built, let's just remove it.

---
 drivers/rtc/rtc-max77686.c | 101 ---------------------------------------------
 1 file changed, 101 deletions(-)
drivers/rtc/rtc-max77686.c +0 -101
index c1c6055..7bb5433 100644
@@ -32,15 +32,6 @@
 #define RTC_UDR_MASK			(1 << RTC_UDR_SHIFT)
 #define RTC_RBUDR_SHIFT			4
 #define RTC_RBUDR_MASK			(1 << RTC_RBUDR_SHIFT)
-/* WTSR and SMPL Register */
-#define WTSRT_SHIFT			0
-#define SMPLT_SHIFT			2
-#define WTSR_EN_SHIFT			6
-#define SMPL_EN_SHIFT			7
-#define WTSRT_MASK			(3 << WTSRT_SHIFT)
-#define SMPLT_MASK			(3 << SMPLT_SHIFT)
-#define WTSR_EN_MASK			(1 << WTSR_EN_SHIFT)
-#define SMPL_EN_MASK			(1 << SMPL_EN_SHIFT)
 /* RTC Hour register */
 #define HOUR_PM_SHIFT			6
 #define HOUR_PM_MASK			(1 << HOUR_PM_SHIFT)
@@ -49,7 +40,6 @@
 #define ALARM_ENABLE_MASK		(1 << ALARM_ENABLE_SHIFT)
 
 #define MAX77686_RTC_UPDATE_DELAY	16
-#undef MAX77686_RTC_WTSR_SMPL
 
 enum {
 	RTC_SEC = 0,
@@ -412,64 +402,6 @@ static const struct rtc_class_ops max77686_rtc_ops = {
 	.alarm_irq_enable = max77686_rtc_alarm_irq_enable,
 };
 
-#ifdef MAX77686_RTC_WTSR_SMPL
-static void max77686_rtc_enable_wtsr(struct max77686_rtc_info *info, bool enable)
-{
-	int ret;
-	unsigned int val, mask;
-
-	if (enable)
-		val = (1 << WTSR_EN_SHIFT) | (3 << WTSRT_SHIFT);
-	else
-		val = 0;
-
-	mask = WTSR_EN_MASK | WTSRT_MASK;
-
-	dev_info(info->dev, "%s: %s WTSR\n", __func__,
-			enable ? "enable" : "disable");
-
-	ret = regmap_update_bits(info->max77686->rtc_regmap,
-				 MAX77686_WTSR_SMPL_CNTL, mask, val);
-	if (ret < 0) {
-		dev_err(info->dev, "%s: fail to update WTSR reg(%d)\n",
-				__func__, ret);
-		return;
-	}
-
-	max77686_rtc_update(info, MAX77686_RTC_WRITE);
-}
-
-static void max77686_rtc_enable_smpl(struct max77686_rtc_info *info, bool enable)
-{
-	int ret;
-	unsigned int val, mask;
-
-	if (enable)
-		val = (1 << SMPL_EN_SHIFT) | (0 << SMPLT_SHIFT);
-	else
-		val = 0;
-
-	mask = SMPL_EN_MASK | SMPLT_MASK;
-
-	dev_info(info->dev, "%s: %s SMPL\n", __func__,
-			enable ? "enable" : "disable");
-
-	ret = regmap_update_bits(info->max77686->rtc_regmap,
-				 MAX77686_WTSR_SMPL_CNTL, mask, val);
-	if (ret < 0) {
-		dev_err(info->dev, "%s: fail to update SMPL reg(%d)\n",
-				__func__, ret);
-		return;
-	}
-
-	max77686_rtc_update(info, MAX77686_RTC_WRITE);
-
-	val = 0;
-	regmap_read(info->max77686->rtc_regmap, MAX77686_WTSR_SMPL_CNTL, &val);
-	dev_info(info->dev, "%s: WTSR_SMPL(0x%02x)\n", __func__, val);
-}
-#endif /* MAX77686_RTC_WTSR_SMPL */
-
 static int max77686_rtc_init_reg(struct max77686_rtc_info *info)
 {
 	u8 data[2];
@@ -519,11 +451,6 @@ static int max77686_rtc_probe(struct platform_device *pdev)
 		goto err_rtc;
 	}
 
-#ifdef MAX77686_RTC_WTSR_SMPL
-	max77686_rtc_enable_wtsr(info, true);
-	max77686_rtc_enable_smpl(info, true);
-#endif
-
 	device_init_wakeup(&pdev->dev, 1);
 
 	info->rtc_dev = devm_rtc_device_register(&pdev->dev, "max77686-rtc",
@@ -556,33 +483,6 @@ err_rtc:
 	return ret;
 }
 
-static void max77686_rtc_shutdown(struct platform_device *pdev)
-{
-#ifdef MAX77686_RTC_WTSR_SMPL
-	struct max77686_rtc_info *info = platform_get_drvdata(pdev);
-	int i;
-	u8 val = 0;
-
-	for (i = 0; i < 3; i++) {
-		max77686_rtc_enable_wtsr(info, false);
-		regmap_read(info->max77686->rtc_regmap, MAX77686_WTSR_SMPL_CNTL, &val);
-		dev_info(info->dev, "%s: WTSR_SMPL reg(0x%02x)\n", __func__,
-				val);
-		if (val & WTSR_EN_MASK) {
-			dev_emerg(info->dev, "%s: fail to disable WTSR\n",
-					__func__);
-		} else {
-			dev_info(info->dev, "%s: success to disable WTSR\n",
-					__func__);
-			break;
-		}
-	}
-
-	/* Disable SMPL when power off */
-	max77686_rtc_enable_smpl(info, false);
-#endif /* MAX77686_RTC_WTSR_SMPL */
-}
-
 #ifdef CONFIG_PM_SLEEP
 static int max77686_rtc_suspend(struct device *dev)
 {
@@ -622,7 +522,6 @@ static struct platform_driver max77686_rtc_driver = {
 		.pm	= &max77686_rtc_pm_ops,
 	},
 	.probe		= max77686_rtc_probe,
-	.shutdown	= max77686_rtc_shutdown,
 	.id_table	= rtc_id,
 };
 
Signature · 1 line
2.0.0.rc2
#12 lore raw

PATCH v8 12/13 rtc: Add driver for Maxim 77802 PMIC Real-Time-Clock

In reply to Javier Martinez Canillas

The MAX7802 PMIC has a Real-Time-Clock (RTC) with two alarms. This patch adds support for the RTC and is based on a driver added by Simon Glass to the Chrome OS kernel 3.8 tree.

---

Changes since v6:
- Remove unused code for SMPL and WTSR. Suggested by Krzysztof Kozlowski.
- Don't spam the kernel log with unnecessarily info and just print for debug. Suggested by Krzysztof Kozlowski.
- Use ARRAY_SIZE() instead of constant value. Suggested by Krzysztof Kozlowski.
- Remove duplicated register setup. Suggested by Krzysztof Kozlowski.
- Don't free/unregister managed allocated resources.
Suggested by Krzysztof Kozlowski.

---
 drivers/rtc/Kconfig        |  10 +
 drivers/rtc/Makefile       |   1 +
 drivers/rtc/rtc-max77802.c | 508 +++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 519 insertions(+)
 create mode 100644 drivers/rtc/rtc-max77802.c
drivers/rtc/Kconfig +10 -0
index a672dd1..243ac72 100644
@@ -288,6 +288,16 @@ config RTC_DRV_MAX77686
 	  This driver can also be built as a module. If so, the module
 	  will be called rtc-max77686.
 
+config RTC_DRV_MAX77802
+	tristate "Maxim 77802 RTC"
+	depends on MFD_MAX77686
+	help
+	  If you say yes here you will get support for the
+	  RTC of Maxim MAX77802 PMIC.
+
+	  This driver can also be built as a module. If so, the module
+	  will be called rtc-max77802.
+
 config RTC_DRV_RS5C372
 	tristate "Ricoh R2025S/D, RS5C372A/B, RV5C386, RV5C387A"
 	help
drivers/rtc/Makefile +1 -0
index 70347d0..247de78 100644
@@ -81,6 +81,7 @@ obj-$(CONFIG_RTC_DRV_MAX8998)	+= rtc-max8998.o
 obj-$(CONFIG_RTC_DRV_MAX8997)	+= rtc-max8997.o
 obj-$(CONFIG_RTC_DRV_MAX6902)	+= rtc-max6902.o
 obj-$(CONFIG_RTC_DRV_MAX77686)	+= rtc-max77686.o
+obj-$(CONFIG_RTC_DRV_MAX77802)  += rtc-max77802.o
 obj-$(CONFIG_RTC_DRV_MC13XXX)	+= rtc-mc13xxx.o
 obj-$(CONFIG_RTC_DRV_MCP795)	+= rtc-mcp795.o
 obj-$(CONFIG_RTC_DRV_MSM6242)	+= rtc-msm6242.o
drivers/rtc/rtc-max77802.c new file +508 -0

508 lines not on this page · raw message

Signature · 1 line
2.0.0.rc2
#13 lore raw

PATCH v8 13/13 ARM: dts: Add max77802 to exynos5420-peach-pit and exynos5800-peach-pi

In reply to Javier Martinez Canillas

Peach pit and pi boards uses a Maxim 77802 power management IC to drive regulators and its Real Time Clock. This patch adds support for this chip.

These are the device nodes and pinctrl configuration that are present on the Peach pit DeviceTree source file in the the Chrome OS kernel 3.8 tree.

---

Changes since v7:
- Change Buck2 and 3 regulator name to "vdd_arm" and "vdd_int". Suggested by Naveen Krishna Chatradhi.
- Remove DVS properties since this is going to be added as a follow up.

Changes since v6: None

Changes since v5:
- Fix style issues and a typo on peach pit and pi DTS. Suggested by Tushar Behera.

Changes since v4: None

Changes since v3:
- Add support for Exynos5800 based Peach pi board. Suggested by Doug Anderson.
- Model the actual regulators relationship instead of a simplistic model. Suggested by Mark Brown.

Changes since v2: None

Changes since v1:
- Use "regulators" for child node instead of "voltage-regulators" to be consistent with other PMIC. Suggested by Mark Brown.
- Use regulators node names instead of the deprecated "regulator-compatible" property. Suggested by Mark Brown.

---
 arch/arm/boot/dts/exynos5420-peach-pit.dts | 371 +++++++++++++++++++++++++++++
 arch/arm/boot/dts/exynos5800-peach-pi.dts  | 371 +++++++++++++++++++++++++++++
 2 files changed, 742 insertions(+)
arch/arm/boot/dts/exynos5420-peach-pit.dts +371 -0
index b2f1237..e5d450a 100644
@@ -143,6 +143,339 @@
 	ddc = <&i2c_2>;
 };
 
+&hsi2c_4 {
+	status = "okay";
+	clock-frequency = <400000>;
+
+	max77802-pmic at 9 {
+		compatible = "maxim,max77802";
+		interrupt-parent = <&gpx3>;
+		interrupts = <1 0>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&max77802_irq>, <&pmic_selb>,
+			    <&pmic_dvs_1>, <&pmic_dvs_2>, <&pmic_dvs_3>;
+		wakeup-source;
+		reg = <0x9>;
+		#clock-cells = <1>;
+
+		inb1-supply = <&tps65090_dcdc2>;
+		inb2-supply = <&tps65090_dcdc1>;
+		inb3-supply = <&tps65090_dcdc2>;
+		inb4-supply = <&tps65090_dcdc2>;
+		inb5-supply = <&tps65090_dcdc1>;
+		inb6-supply = <&tps65090_dcdc2>;
+		inb7-supply = <&tps65090_dcdc1>;
+		inb8-supply = <&tps65090_dcdc1>;
+		inb9-supply = <&tps65090_dcdc1>;
+		inb10-supply = <&tps65090_dcdc1>;
+
+		inl1-supply = <&buck5_reg>;
+		inl2-supply = <&buck7_reg>;
+		inl3-supply = <&buck9_reg>;
+		inl4-supply = <&buck9_reg>;
+		inl5-supply = <&buck9_reg>;
+		inl6-supply = <&tps65090_dcdc2>;
+		inl7-supply = <&buck9_reg>;
+		inl9-supply = <&tps65090_dcdc2>;
+		inl10-supply = <&buck7_reg>;
+
+		regulators {
+			buck1_reg: BUCK1 {
+				regulator-name = "vdd_mif";
+				regulator-min-microvolt = <800000>;
+				regulator-max-microvolt = <1300000>;
+				regulator-always-on;
+				regulator-boot-on;
+				regulator-ramp-delay = <12500>;
+			};
+
+			buck2_reg: BUCK2 {
+				regulator-name = "vdd_arm";
+				regulator-min-microvolt = <800000>;
+				regulator-max-microvolt = <1500000>;
+				regulator-always-on;
+				regulator-boot-on;
+				regulator-ramp-delay = <12500>;
+			};
+
+			buck3_reg: BUCK3 {
+				regulator-name = "vdd_int";
+				regulator-min-microvolt = <800000>;
+				regulator-max-microvolt = <1400000>;
+				regulator-always-on;
+				regulator-boot-on;
+				regulator-ramp-delay = <12500>;
+			};
+
+			buck4_reg: BUCK4 {
+				regulator-name = "vdd_g3d";
+				regulator-min-microvolt = <700000>;
+				regulator-max-microvolt = <1400000>;
+				regulator-always-on;
+				regulator-boot-on;
+				regulator-ramp-delay = <12500>;
+			};
+
+			buck5_reg: BUCK5 {
+				regulator-name = "vdd_1v2";
+				regulator-min-microvolt = <1200000>;
+				regulator-max-microvolt = <1200000>;
+				regulator-always-on;
+				regulator-boot-on;
+			};
+
+			buck6_reg: BUCK6 {
+				regulator-name = "vdd_kfc";
+				regulator-min-microvolt = <800000>;
+				regulator-max-microvolt = <1500000>;
+				regulator-always-on;
+				regulator-boot-on;
+				regulator-ramp-delay = <12500>;
+			};
+
+			buck7_reg: BUCK7 {
+				regulator-name = "vdd_1v35";
+				regulator-min-microvolt = <1350000>;
+				regulator-max-microvolt = <1350000>;
+				regulator-always-on;
+				regulator-boot-on;
+			};
+
+			buck8_reg: BUCK8 {
+				regulator-name = "vdd_emmc";
+				regulator-min-microvolt = <2850000>;
+				regulator-max-microvolt = <2850000>;
+				regulator-always-on;
+				regulator-boot-on;
+			};
+
+			buck9_reg: BUCK9 {
+				regulator-name = "vdd_2v";
+				regulator-min-microvolt = <2000000>;
+				regulator-max-microvolt = <2000000>;
+				regulator-always-on;
+				regulator-boot-on;
+			};
+
+			buck10_reg: BUCK10 {
+				regulator-name = "vdd_1v8";
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <1800000>;
+				regulator-always-on;
+				regulator-boot-on;
+			};
+
+			ldo1_reg: LDO1 {
+				regulator-name = "vdd_1v0";
+				regulator-min-microvolt = <1000000>;
+				regulator-max-microvolt = <1000000>;
+				regulator-always-on;
+			};
+
+			ldo2_reg: LDO2 {
+				regulator-name = "vdd_1v2_2";
+				regulator-min-microvolt = <1200000>;
+				regulator-max-microvolt = <1200000>;
+			};
+
+			ldo3_reg: LDO3 {
+				regulator-name = "vdd_1v8_3";
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <1800000>;
+				regulator-always-on;
+			};
+
+			vqmmc_sdcard: ldo4_reg: LDO4 {
+				regulator-name = "vdd_sd";
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <2800000>;
+				regulator-always-on;
+			};
+
+			ldo5_reg: LDO5 {
+				regulator-name = "vdd_1v8_5";
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <1800000>;
+				regulator-always-on;
+			};
+
+			ldo6_reg: LDO6 {
+				regulator-name = "vdd_1v8_6";
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <1800000>;
+				regulator-always-on;
+			};
+
+			ldo7_reg: LDO7 {
+				regulator-name = "vdd_1v8_7";
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <1800000>;
+			};
+
+			ldo8_reg: LDO8 {
+				regulator-name = "vdd_ldo8";
+				regulator-min-microvolt = <1000000>;
+				regulator-max-microvolt = <1000000>;
+				regulator-always-on;
+			};
+
+			ldo9_reg: LDO9 {
+				regulator-name = "vdd_ldo9";
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <1800000>;
+				regulator-always-on;
+			};
+
+			ldo10_reg: LDO10 {
+				regulator-name = "vdd_ldo10";
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <1800000>;
+				regulator-always-on;
+			};
+
+			ldo11_reg: LDO11 {
+				regulator-name = "vdd_ldo11";
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <1800000>;
+				regulator-always-on;
+			};
+
+			ldo12_reg: LDO12 {
+				regulator-name = "vdd_ldo12";
+				regulator-min-microvolt = <3000000>;
+				regulator-max-microvolt = <3000000>;
+				regulator-always-on;
+			};
+
+			ldo13_reg: LDO13 {
+				regulator-name = "vdd_ldo13";
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <1800000>;
+				regulator-always-on;
+			};
+
+			ldo14_reg: LDO14 {
+				regulator-name = "vdd_ldo14";
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <1800000>;
+				regulator-always-on;
+			};
+
+			ldo15_reg: LDO15 {
+				regulator-name = "vdd_ldo15";
+				regulator-min-microvolt = <1000000>;
+				regulator-max-microvolt = <1000000>;
+				regulator-always-on;
+			};
+
+			ldo17_reg: LDO17 {
+				regulator-name = "vdd_g3ds";
+				regulator-min-microvolt = <900000>;
+				regulator-max-microvolt = <1400000>;
+				regulator-always-on;
+			};
+
+			ldo18_reg: LDO18 {
+				regulator-name = "ldo_18";
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <1800000>;
+			};
+
+			ldo19_reg: LDO19 {
+				regulator-name = "ldo_19";
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <1800000>;
+			};
+
+			ldo20_reg: LDO20 {
+				regulator-name = "ldo_20";
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <1800000>;
+				regulator-always-on;
+			};
+
+			ldo21_reg: LDO21 {
+				regulator-name = "ldo_21";
+				regulator-min-microvolt = <2800000>;
+				regulator-max-microvolt = <2800000>;
+			};
+
+			ldo23_reg: LDO23 {
+				regulator-name = "ldo_23";
+				regulator-min-microvolt = <3300000>;
+				regulator-max-microvolt = <3300000>;
+			};
+			ldo24_reg: LDO24 {
+				regulator-name = "ldo_24";
+				regulator-min-microvolt = <2800000>;
+				regulator-max-microvolt = <2800000>;
+			};
+
+			ldo25_reg: LDO25 {
+				regulator-name = "ldo_25";
+				regulator-min-microvolt = <3300000>;
+				regulator-max-microvolt = <3300000>;
+			};
+
+			ldo26_reg: LDO26 {
+				regulator-name = "ldo_26";
+				regulator-min-microvolt = <1200000>;
+				regulator-max-microvolt = <1200000>;
+			};
+
+			ldo27_reg: LDO27 {
+				regulator-name = "ldo_27";
+				regulator-min-microvolt = <1200000>;
+				regulator-max-microvolt = <1200000>;
+			};
+
+			ldo28_reg: LDO28 {
+				regulator-name = "ldo_28";
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <1800000>;
+			};
+
+			ldo29_reg: LDO29 {
+				regulator-name = "ldo_29";
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <1800000>;
+			};
+
+			ldo30_reg: LDO30 {
+				regulator-name = "vdd_mifs";
+				regulator-min-microvolt = <1000000>;
+				regulator-max-microvolt = <1000000>;
+				regulator-always-on;
+			};
+
+			ldo32_reg: LDO32 {
+				regulator-name = "ldo_32";
+				regulator-min-microvolt = <3000000>;
+				regulator-max-microvolt = <3000000>;
+			};
+
+			ldo33_reg: LDO33 {
+				regulator-name = "ldo_33";
+				regulator-min-microvolt = <2800000>;
+				regulator-max-microvolt = <2800000>;
+			};
+
+			ldo34_reg: LDO34 {
+				regulator-name = "ldo_34";
+				regulator-min-microvolt = <3000000>;
+				regulator-max-microvolt = <3000000>;
+			};
+
+			ldo35_reg: LDO35 {
+				regulator-name = "ldo_35";
+				regulator-min-microvolt = <1200000>;
+				regulator-max-microvolt = <1200000>;
+				inl2-supply = <&buck7_reg>;
+			};
+		};
+	};
+};
+
 &hsi2c_7 {
 	status = "okay";
 
@@ -264,12 +597,42 @@
 		samsung,pin-drv = <0>;
 	};
 
+	max77802_irq: max77802-irq {
+		samsung,pins = "gpx3-1";
+		samsung,pin-function = <0>;
+		samsung,pin-pud = <0>;
+		samsung,pin-drv = <0>;
+	};
+
 	hdmi_hpd_irq: hdmi-hpd-irq {
 		samsung,pins = "gpx3-7";
 		samsung,pin-function = <0>;
 		samsung,pin-pud = <1>;
 		samsung,pin-drv = <0>;
 	};
+
+	pmic_dvs_1: pmic-dvs-1 {
+		samsung,pins = "gpy7-6";
+		samsung,pin-function = <1>;
+		samsung,pin-pud = <0>;
+		samsung,pin-drv = <0>;
+	};
+};
+
+&pinctrl_2 {
+	pmic_dvs_2: pmic-dvs-2 {
+		samsung,pins = "gpj4-2";
+		samsung,pin-function = <1>;
+		samsung,pin-pud = <0>;
+		samsung,pin-drv = <0>;
+	};
+
+	pmic_dvs_3: pmic-dvs-3 {
+		samsung,pins = "gpj4-3";
+		samsung,pin-function = <1>;
+		samsung,pin-pud = <0>;
+		samsung,pin-drv = <0>;
+	};
 };
 
 &pinctrl_3 {
@@ -299,6 +662,14 @@
 		samsung,pin-pud = <0>;
 		samsung,pin-drv = <0>;
 	};
+
+	pmic_selb: pmic-selb {
+		samsung,pins = "gph0-2", "gph0-3", "gph0-4", "gph0-5",
+			       "gph0-6";
+		samsung,pin-function = <1>;
+		samsung,pin-pud = <0>;
+		samsung,pin-drv = <0>;
+	};
 };
 
 &rtc {
arch/arm/boot/dts/exynos5800-peach-pi.dts +371 -0

395 lines not on this page · raw message

Signature · 1 line
2.0.0.rc2
#14 lore raw
In reply to Javier Martinez Canillas

Hello Lee,

Quoted 5 lines · Javier Martinez Canillas

* Patches 1-7 from v7 are not included since those were improvements to the max77686 mfd driver and can be applied independently. Lee Jones said that he is going to pick them from the posted v7 series.

Thanks a lot for picking the max77686 preparatory patches.

Quoted 9 lines

Since there are cross-subsystems dependencies, I think that the best way to sort this out is if relevant maintainers ack the patches so 01/13 to 012/13 can be merged through the mfd tree. The patches and the relevant acks are:

Patch 03/13 (regulator - Mark Brown)
Patches 04/13 to 09/13 (clk - Mike Turquette)
Patches 10/13 to 12/13 (rtc - Alessandro Zummo)

Mark, Mike and Alessandro,

This is a gentle reminder to look at the patches that touches your subsystems and provide acks if possible so Lee can merge the remainder set through the mfd tree.

There were only trivial changes for the regulator, clock and rtc drivers since v5 (posted almost a month ago in Jun 26) and this series is blocking a lot of other patch-sets so is hurting forward progress on the chromebook2 platform as a whole.

Lee,

Since I may not be able to get the acks before the merge window opens, do you think that is possible to merge patch 01/13 "mfd: max77686: Add Maxim 77802 PMIC support" which already has your ack?

So at least we can get the dependency for the other drivers in 3.17 and avoid this cross subsystem churn for 3.18 since the rest of the drivers will be able to go through the relevant trees.

Thanks a lot and best regards,
Javier

maintainer
#15 lore raw
Quoted 7 lines · Javier Martinez Canillas

On 07/14/2014 01:35 PM, Javier Martinez Canillas wrote:

Mark, Mike and Alessandro,

This is a gentle reminder to look at the patches that touches your subsystems and provide acks if possible so Lee can merge the remainder set through the mfd tree.

Please stop nagging, you are chasing after only one week which is excessive for something that isn't an urgent bugfix (especially with a series like this that has had many rapid repins). Several weeks to a month would be more appropriate, and then resending the patches rather than sending contentless pings is more useful. Sending mails like this just means that people have more mail to read that isn't your patch, it is more likely to get you negative attention than positive - for example, I will tend to deprioritise things where I'm being chased too urgently as I do not wish to encourage such behaviour by being seen to reward it.

In general I would recommend taking a step back, slowing down, and if
you are not getting a response either thinking of something else to do
in parallel or trying to do things that make it easier to accept your
change if there are any (sometimes it's just a case of waiting). Look
at how frequently the relevant maintainers tend to respond, at what the
previous review comments have been and also consider the possibility
that people might take holidays or just be busy.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20140722/d23818bb/attachment-0001.sig>

#16 lore raw
Quoted 9 lines · Mark Brown
Quoted 7 lines · Javier Martinez Canillas

On 07/14/2014 01:35 PM, Javier Martinez Canillas wrote:

Mark, Mike and Alessandro,

This is a gentle reminder to look at the patches that touches your subsystems and provide acks if possible so Lee can merge the remainder set through the mfd tree.

Quoted 11 lines

Please stop nagging, you are chasing after only one week which is excessive for something that isn't an urgent bugfix (especially with a series like this that has had many rapid repins). Several weeks to a month would be more appropriate, and then resending the patches rather than sending contentless pings is more useful. Sending mails like this just means that people have more mail to read that isn't your patch, it is more likely to get you negative attention than positive - for example, I will tend to deprioritise things where I'm being chased too urgently as I do not wish to encourage such behaviour by being seen to reward it.

I didn't mean to bother you. It's true that it has been only a week since I posted v8 of this series but I didn't have feedback for the clock, rtc and regulator drivers since v5 which was posted on June, 26 so I thought that a ping just to be sure it was not forgotten was not that bad. But sorry I won't do it again and will just wait.

About the many re-spins, as most mfd drivers this PMIC support touches different subsystems and the series had many patches so each time I had feedback for some patches I prepared a new version and reposted the whole series. This doesn't mean that all the patches changed from version to version though, some patches have not changed for several revisions.

Quoted 8 lines

In general I would recommend taking a step back, slowing down, and if you are not getting a response either thinking of something else to do in parallel or trying to do things that make it easier to accept your change if there are any (sometimes it's just a case of waiting). Look at how frequently the relevant maintainers tend to respond, at what the previous review comments have been and also consider the possibility that people might take holidays or just be busy.

Sorry, I didn't mean to imply that you are not busy or might be on holidays. I guess I just got anxious due the merge window being close...

Best regards,
Javier

Acked-by on the v8 series
#17 lore raw
In reply to Javier Martinez Canillas

Quoting Javier Martinez Canillas (2014-07-14 04:35:56)

Quoted 21 lines

This series are based on drivers added by Simon Glass to the Chrome OS kernel and adds support for the Maxim 77802 Power Management IC, their regulators, clocks, RTC and i2c interface.

This is a v8 of the patch-set that addresses issues pointed out in v7. Individual changes are added on each patch but the biggest changes are:

* Patches 1-7 from v7 are not included since those were improvements to the max77686 mfd driver and can be applied independently. Lee Jones said that he is going to pick them from the posted v7 series.

I've created a patchwork bundle with 1-7 from v7 to make it easy to apply:

https://patchwork.kernel.org/bundle/javier/max77686-improvements/

* The Dynamic Voltage Scaling support has been removed since that can be added in a follow up series and shouldn't block the minimum PMIC support.

The patch-set has been tested on both Daisy/Snow (max77686) and Peach Pit (max77802) Chromebooks and it's composed of the following patches:

Quoted 9 lines

[PATCH v8 01/13] mfd: max77686: Add Maxim 77802 PMIC support [PATCH v8 02/13] mfd: max77802: Add DT binding documentation [PATCH v8 03/13] regulator: Add driver for Maxim 77802 PMIC regulators [PATCH v8 04/13] clk: max77686: Add DT include for MAX77686 PMIC clock [PATCH v8 05/13] clk: Add generic driver for Maxim PMIC clocks [PATCH v8 06/13] clk: max77686: Convert to the generic max clock driver [PATCH v8 07/13] clk: max77686: Improve Maxim 77686 PMIC clocks binding [PATCH v8 08/13] clk: Add driver for Maxim 77802 PMIC clocks [PATCH v8 09/13] clk: max77802: Add DT binding documentation

For patches 4-9:

Regards,
Mike

Quoted 41 lines

[PATCH v8 10/13] rtc: max77686: Allow the max77686 rtc to wakeup the system [PATCH v8 11/13] rtc: max77686: Remove dead code for SMPL and WTSR
[PATCH v8 12/13] rtc: Add driver for Maxim 77802 PMIC Real-Time-Clock [PATCH v8 13/13] ARM: dts: Add max77802 to exynos5420-peach-pit and exynos5800-peach-pi

Patch 01/13 extend the max77686 mfd driver to also support the max77802 PMIC and patch 02/13 adds the DT binding documentation for this PMIC.

Patch 03/13 adds support for the regulators found in the PMIC.

Patch 04/13 to 07/13 are improvements and refactoring to the max77686 clock driver to avoid code duplication when adding max77802 clocks support in patch 08/13. Patch 09/13 adds the DT binding document for the max77802 clock driver.

Patches 10/13 and 11/13 are improvements to max77686 RTC driver and patch 12/13 adds support for the RTC found in the max77802 PMIC.

Finally patch 13/13 adds the required device node to the Peach Pit and Pi exynos5 based boards.

Since there are cross-subsystems dependencies, I think that the best way to sort this out is if relevant maintainers ack the patches so 01/13 to 012/13 can be merged through the mfd tree. The patches and the relevant acks are:

Patch 03/13 (regulator - Mark Brown)
Patches 04/13 to 09/13 (clk - Mike Turquette)
Patches 10/13 to 12/13 (rtc - Alessandro Zummo)

Patch 13/13 is only a DTS change so it can be picked by Kukjin Kim once the other patches are picked by Lee Jones.

Since we are in 3.16-rc5 already, it would be great if I can get your acks or feedback since I was hoping this series to make it to 3.17. This is due other series that were already posted depend on this one.

Also, the series have been reviewed and tested by Samsung folks and most of the patches already collected Reviewed-by and Tested-by tags.

Thanks a lot and best regards,
Javier

#18 lore raw

Hello Mike,

Quoted 32 lines · Mike Turquette

Quoting Javier Martinez Canillas (2014-07-14 04:35:56)

Quoted 21 lines

This series are based on drivers added by Simon Glass to the Chrome OS kernel and adds support for the Maxim 77802 Power Management IC, their regulators, clocks, RTC and i2c interface.

This is a v8 of the patch-set that addresses issues pointed out in v7. Individual changes are added on each patch but the biggest changes are:

* Patches 1-7 from v7 are not included since those were improvements to the max77686 mfd driver and can be applied independently. Lee Jones said that he is going to pick them from the posted v7 series.

I've created a patchwork bundle with 1-7 from v7 to make it easy to apply:

https://patchwork.kernel.org/bundle/javier/max77686-improvements/

* The Dynamic Voltage Scaling support has been removed since that can be added in a follow up series and shouldn't block the minimum PMIC support.

The patch-set has been tested on both Daisy/Snow (max77686) and Peach Pit (max77802) Chromebooks and it's composed of the following patches:

Quoted 9 lines

[PATCH v8 01/13] mfd: max77686: Add Maxim 77802 PMIC support [PATCH v8 02/13] mfd: max77802: Add DT binding documentation [PATCH v8 03/13] regulator: Add driver for Maxim 77802 PMIC regulators [PATCH v8 04/13] clk: max77686: Add DT include for MAX77686 PMIC clock [PATCH v8 05/13] clk: Add generic driver for Maxim PMIC clocks [PATCH v8 06/13] clk: max77686: Convert to the generic max clock driver [PATCH v8 07/13] clk: max77686: Improve Maxim 77686 PMIC clocks binding [PATCH v8 08/13] clk: Add driver for Maxim 77802 PMIC clocks [PATCH v8 09/13] clk: max77802: Add DT binding documentation

Quoted 4 lines

For patches 4-9:

Thanks a lot for your ack!

Since the merge window is just around the corner, Lee merged the mfd max77686 headers changes to split the dependencies around kernel releases.

So after the merge windows, I'll resend the clock driver (and the other drivers fwiw) as a separate series so you can merge it through your tree for 3.18.

Quoted 3 lines

Regards,
Mike

Best regards,
Javier