Skip to contentSkip to conversation

Add MFD and regulator drivers for Hi6421 PMIC SoC

PATCH Superseded Guodong Xu 3 participants 11 messages Aug 13, 2014 – Aug 14, 2014

Subsystems (4)

v5 of 6 Superseded Latest is v6 →

lore
Share & tools
lore

Guodong Xu

author
#0 lore raw

v5 cover Add MFD and regulator drivers for Hi6421 PMIC SoC

This patchset adds an MFD core driver and a regulator driver for Hi6421 PMIC SoC.

Hi6421 is a PMIC SoC designed and manufactured by HiSilicon Ltd. It includes multi-functions, such as regulators, codec, ADCs, Coulomb counter, etc. Hi6421 can be used in various Hi3620 SoC based boards. Registers in Hi6421 are memory bus mapped, so in this design they are accessed by regmap-mmio APIs.

Hi6421 has a requirement to keep a guard delay between its regulator's disable and next enable. Implement this requirement in regulator core, per Mark Brown's suggestion.

---
changes in v5:
* rename _regulator_delay to _regulator_enable_delay
* clean up hi6421_regulator_enable(), add 100us protective gap into regulator_desc's .enable_time
* code clean up, fixes for style checking
changes in v4:
* regulator: core:
- add const qualifier to ops in struct regulator_desc
- factor out _regulator_delay from _regulator_do_enable
- add guard delay between calling regulator_disable and _enable
* hi6421 regulator:
- bug fix: missing min_uV for linear regualtor BUCK0~2
- bug fix: wrong volt values in buck_3_voltages table
- add const to hi6421 regulator_ops
- use ldo_linear and ldo_linear_range in applicable LDOs.
- rename regulator-name to conform to names in board schematics.
changes in v3:
* hi6421: regulator: remove setting of constraints on board-specific capabilities
* delete unecessary compatible property "hisilicon,hi6421-regulators"
* change regulator enable/disable callback APIs to support protection
gaps, as
required by hi6421 spec
* split regulator set_mode/get_mode callback APIs to LDOs and BUCKs
* delete hi6421.dtsi, mfd and regulator nodes are now in board config .dts
changes in v2:
* use MFD APIs to manage sub-devices of Hi6421
* use regmap-mmio for register access
* use only generic regulator device tree property
* rewrite regulator driver using helper APIs from both regulator and regmap
v1: first drop

Guodong Xu (7):
regulator: core: add const qualifier to ops in struct regulator_desc
regulator: core: factor out delay function from _regulator_do_enable
regulator: core: add guard delay between calling regulator_disable and
_enable
mfd: Add hi6421 PMIC core driver
regulator: add driver for hi6421 voltage regulator
ARM: dts: hi3620-hi4511: Add HI6421 MFD and regulator nodes
ARM: hi3xxx_defconfig: Enable HI6421 MFD and Regulators

 Documentation/devicetree/bindings/mfd/hi6421.txt |  37 ++
 arch/arm/boot/dts/hi3620-hi4511.dts              | 233 ++++++++
 arch/arm/configs/hi3xxx_defconfig                |   3 +
 drivers/mfd/Kconfig                              |  13 +
 drivers/mfd/Makefile                             |   1 +
 drivers/mfd/hi6421-pmic-core.c                   | 119 ++++
 drivers/regulator/Kconfig                        |  10 +
 drivers/regulator/Makefile                       |   1 +
 drivers/regulator/core.c                         | 129 +++--
 drivers/regulator/hi6421-regulator.c             | 657 +++++++++++++++++++++++
 include/linux/mfd/hi6421-pmic.h                  |  39 ++
 include/linux/regulator/driver.h                 |   8 +-
 12 files changed, 1203 insertions(+), 47 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/mfd/hi6421.txt
 create mode 100644 drivers/mfd/hi6421-pmic-core.c
 create mode 100644 drivers/regulator/hi6421-regulator.c
 create mode 100644 include/linux/mfd/hi6421-pmic.h
Signature · 1 line
1.9.1
author
#1 lore raw

PATCH v5 1/7 regulator: core: add const qualifier to ops in struct regulator_desc

struct regulator_ops *ops is a member in struct regulator_desc, which gets its value from individual regulator driver upon regulator_register() and is used by regulator core APIs. It's not allowed for regulator core to modify any of these callbacks in *ops. Add 'const' qualifier to enforce that.

---
 drivers/regulator/core.c         | 24 ++++++++++++------------
 include/linux/regulator/driver.h |  2 +-
 2 files changed, 13 insertions(+), 13 deletions(-)
drivers/regulator/core.c +12 -12
index 4c1f999..eb6f172 100644
@@ -838,7 +838,7 @@ static void print_constraints(struct regulator_dev *rdev)
 static int machine_constraints_voltage(struct regulator_dev *rdev,
 	struct regulation_constraints *constraints)
 {
-	struct regulator_ops *ops = rdev->desc->ops;
+	const struct regulator_ops *ops = rdev->desc->ops;
 	int ret;
 
 	/* do we need to apply the constraint voltage */
@@ -935,7 +935,7 @@ static int machine_constraints_voltage(struct regulator_dev *rdev,
 static int machine_constraints_current(struct regulator_dev *rdev,
 	struct regulation_constraints *constraints)
 {
-	struct regulator_ops *ops = rdev->desc->ops;
+	const struct regulator_ops *ops = rdev->desc->ops;
 	int ret;
 
 	if (!constraints->min_uA && !constraints->max_uA)
@@ -979,7 +979,7 @@ static int set_machine_constraints(struct regulator_dev *rdev,
 	const struct regulation_constraints *constraints)
 {
 	int ret = 0;
-	struct regulator_ops *ops = rdev->desc->ops;
+	const struct regulator_ops *ops = rdev->desc->ops;
 
 	if (constraints)
 		rdev->constraints = kmemdup(constraints, sizeof(*constraints),
@@ -2196,9 +2196,9 @@ EXPORT_SYMBOL_GPL(regulator_count_voltages);
  */
 int regulator_list_voltage(struct regulator *regulator, unsigned selector)
 {
-	struct regulator_dev	*rdev = regulator->rdev;
-	struct regulator_ops	*ops = rdev->desc->ops;
-	int			ret;
+	struct regulator_dev *rdev = regulator->rdev;
+	const struct regulator_ops *ops = rdev->desc->ops;
+	int ret;
 
 	if (rdev->desc->fixed_uV && rdev->desc->n_voltages == 1 && !selector)
 		return rdev->desc->fixed_uV;
@@ -2484,8 +2484,8 @@ EXPORT_SYMBOL_GPL(regulator_set_voltage);
 int regulator_set_voltage_time(struct regulator *regulator,
 			       int old_uV, int new_uV)
 {
-	struct regulator_dev	*rdev = regulator->rdev;
-	struct regulator_ops	*ops = rdev->desc->ops;
+	struct regulator_dev *rdev = regulator->rdev;
+	const struct regulator_ops *ops = rdev->desc->ops;
 	int old_sel = -1;
 	int new_sel = -1;
 	int voltage;
@@ -3246,9 +3246,9 @@ EXPORT_SYMBOL_GPL(regulator_mode_to_status);
  */
 static int add_regulator_attributes(struct regulator_dev *rdev)
 {
-	struct device		*dev = &rdev->dev;
-	struct regulator_ops	*ops = rdev->desc->ops;
-	int			status = 0;
+	struct device *dev = &rdev->dev;
+	const struct regulator_ops *ops = rdev->desc->ops;
+	int status = 0;
 
 	/* some attributes need specific methods to be displayed */
 	if ((ops->get_voltage && ops->get_voltage(rdev) >= 0) ||
@@ -3815,7 +3815,7 @@ core_initcall(regulator_init);
 static int __init regulator_init_complete(void)
 {
 	struct regulator_dev *rdev;
-	struct regulator_ops *ops;
+	const struct regulator_ops *ops;
 	struct regulation_constraints *c;
 	int enabled, ret;
 
include/linux/regulator/driver.h +1 -1
index bbe03a1..4b62813 100644
@@ -245,7 +245,7 @@ struct regulator_desc {
 	int id;
 	bool continuous_voltage_range;
 	unsigned n_voltages;
-	struct regulator_ops *ops;
+	const struct regulator_ops *ops;
 	int irq;
 	enum regulator_type type;
 	struct module *owner;
Signature · 1 line
1.9.1
author
#2 lore raw

PATCH v5 2/7 regulator: core: factor out delay function from _regulator_do_enable

In reply to Guodong Xu

A common delay function can be helpful when implementing new features. Factor it out to maximize code reusability.

---
 drivers/regulator/core.c | 74 ++++++++++++++++++++++++++----------------------
 1 file changed, 40 insertions(+), 34 deletions(-)
drivers/regulator/core.c +40 -34
index eb6f172..67d4246 100644
@@ -1753,6 +1753,45 @@ static int regulator_ena_gpio_ctrl(struct regulator_dev *rdev, bool enable)
 	return 0;
 }
 
+/**
+ * _regulator_enable_delay - a delay helper function
+ * @delay: time to delay in microseconds
+ *
+ * Delay for the requested amount of time as per the guidelines in:
+ *
+ *     Documentation/timers/timers-howto.txt
+ *
+ * The assumption here is that regulators will never be enabled in
+ * atomic context and therefore sleeping functions can be used.
+ */
+static void _regulator_enable_delay(unsigned int delay)
+{
+	unsigned int ms = delay / 1000;
+	unsigned int us = delay % 1000;
+
+	if (ms > 0) {
+		/*
+		 * For small enough values, handle super-millisecond
+		 * delays in the usleep_range() call below.
+		 */
+		if (ms < 20)
+			us += ms * 1000;
+		else
+			msleep(ms);
+	}
+
+	/*
+	 * Give the scheduler some room to coalesce with any other
+	 * wakeup sources. For delays shorter than 10 us, don't even
+	 * bother setting up high-resolution timers and just busy-
+	 * loop.
+	 */
+	if (us >= 10)
+		usleep_range(us, us + 100);
+	else
+		udelay(us);
+}
+
 static int _regulator_do_enable(struct regulator_dev *rdev)
 {
 	int ret, delay;
@@ -1786,40 +1825,7 @@ static int _regulator_do_enable(struct regulator_dev *rdev)
 	 * together.  */
 	trace_regulator_enable_delay(rdev_get_name(rdev));
 
-	/*
-	 * Delay for the requested amount of time as per the guidelines in:
-	 *
-	 *     Documentation/timers/timers-howto.txt
-	 *
-	 * The assumption here is that regulators will never be enabled in
-	 * atomic context and therefore sleeping functions can be used.
-	 */
-	if (delay) {
-		unsigned int ms = delay / 1000;
-		unsigned int us = delay % 1000;
-
-		if (ms > 0) {
-			/*
-			 * For small enough values, handle super-millisecond
-			 * delays in the usleep_range() call below.
-			 */
-			if (ms < 20)
-				us += ms * 1000;
-			else
-				msleep(ms);
-		}
-
-		/*
-		 * Give the scheduler some room to coalesce with any other
-		 * wakeup sources. For delays shorter than 10 us, don't even
-		 * bother setting up high-resolution timers and just busy-
-		 * loop.
-		 */
-		if (us >= 10)
-			usleep_range(us, us + 100);
-		else
-			udelay(us);
-	}
+	_regulator_enable_delay(delay);
 
 	trace_regulator_enable_complete(rdev_get_name(rdev));
 
Signature · 1 line
1.9.1
author
#3 lore raw

PATCH v5 3/7 regulator: core: add guard delay between calling regulator_disable and _enable

In reply to Guodong Xu

Some regulator require a minimum delay between its disable and next enable. This is to avoid damages when out-of-range frequent disable/enable of a single regulator can bring to the regulator chip.

Add @off_on_delay to struct regulator_desc. Device drivers' can use this field to set this guard time.

Add @last_off_jiffy to struct regulator_dev. When @off_on_delay is set by driver, regulator core can store its last off (disable) time into this field.

---
 drivers/regulator/core.c         | 31 +++++++++++++++++++++++++++++++
 include/linux/regulator/driver.h |  6 ++++++
 2 files changed, 37 insertions(+)
drivers/regulator/core.c +31 -0
index 67d4246..c218c62 100644
@@ -1807,6 +1807,31 @@ static int _regulator_do_enable(struct regulator_dev *rdev)
 
 	trace_regulator_enable(rdev_get_name(rdev));
 
+	if (rdev->desc->off_on_delay) {
+		/* if needed, keep a distance of off_on_delay from last time
+		 * this regulator was disabled.
+		 */
+		unsigned long start_jiffy = jiffies;
+		unsigned long intended, max_delay, remaining;
+
+		max_delay = usecs_to_jiffies(rdev->desc->off_on_delay);
+		intended = rdev->last_off_jiffy + max_delay;
+
+		if (time_before(start_jiffy, intended)) {
+			/* calc remaining jiffies to deal with one-time
+			 * timer wrapping.
+			 * in case of multiple timer wrapping, either it can be
+			 * detected by out-of-range remaining, or it cannot be
+			 * detected and we gets a panelty of
+			 * _regulator_enable_delay().
+			 */
+			remaining = intended - start_jiffy;
+			if (remaining <= max_delay)
+				_regulator_enable_delay(
+						jiffies_to_usecs(remaining));
+		}
+	}
+
 	if (rdev->ena_pin) {
 		ret = regulator_ena_gpio_ctrl(rdev, true);
 		if (ret < 0)
@@ -1919,6 +1944,12 @@ static int _regulator_do_disable(struct regulator_dev *rdev)
 			return ret;
 	}
 
+	/* cares about last_off_jiffy only if off_on_delay is required by
+	 * device.
+	 */
+	if (rdev->desc->off_on_delay)
+		rdev->last_off_jiffy = jiffies;
+
 	trace_regulator_disable_complete(rdev_get_name(rdev));
 
 	return 0;
include/linux/regulator/driver.h +6 -0
index 4b62813..efe058f 100644
@@ -238,6 +238,7 @@ enum regulator_type {
  * @bypass_val_off: Disabling value for control when using regmap set_bypass
  *
  * @enable_time: Time taken for initial enable of regulator (in uS).
+ * @off_on_delay: guard time (in uS), before re-enabling a regulator
  */
 struct regulator_desc {
 	const char *name;
@@ -276,6 +277,8 @@ struct regulator_desc {
 	unsigned int bypass_val_off;
 
 	unsigned int enable_time;
+
+	unsigned int off_on_delay;
 };
 
 /**
@@ -348,6 +351,9 @@ struct regulator_dev {
 
 	struct regulator_enable_gpio *ena_pin;
 	unsigned int ena_gpio_state:1;
+
+	/* time when this regulator was disabled last time */
+	unsigned long last_off_jiffy;
 };
 
 struct regulator_dev *
Signature · 1 line
1.9.1
author
#4 lore raw

PATCH v5 4/7 mfd: Add hi6421 PMIC core driver

In reply to Guodong Xu

This adds driver to support HiSilicon Hi6421 PMIC. Hi6421 includes multi- functions, such as regulators, codec, ADCs, Coulomb counter, etc. This driver includes core APIs _only_.

Drivers for individul components, like voltage regulators, are implemented in corresponding driver directories and files.

Registers in Hi6421 are memory mapped, so using regmap-mmio API.

---
 Documentation/devicetree/bindings/mfd/hi6421.txt |  37 +++++++
 drivers/mfd/Kconfig                              |  13 +++
 drivers/mfd/Makefile                             |   1 +
 drivers/mfd/hi6421-pmic-core.c                   | 119 +++++++++++++++++++++++
 include/linux/mfd/hi6421-pmic.h                  |  39 ++++++++
 5 files changed, 209 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mfd/hi6421.txt
 create mode 100644 drivers/mfd/hi6421-pmic-core.c
 create mode 100644 include/linux/mfd/hi6421-pmic.h
Documentation/devicetree/bindings/mfd/hi6421.txt new file +37 -0
new file mode 100644
index 0000000..1512123
@@ -0,0 +1,37 @@
+* HI6421 Multi-Functional Device (MFD), by HiSilicon Ltd.
+
+Required parent device properties:
+- reg		: register range space of hi6421;
+
+Supported Hi6421 sub-devices include:
+
+Device                     IRQ Names              Supply Names   Description
+------                     ---------              ------------   -----------
+regulators               :                      :              : Regulators
+
+Required child device properties:
+None.
+
+Example:
+	pmic: pmic at c00000 {
+		compatible = "hisilicon,hi6421-pmic";
+		reg = <0xc00000 0x0180>; /* 0x60 << 2 */
+
+		regulators {
+			// supply for MLC NAND/ eMMC
+			hi6421_vout0_reg: hi6421_vout0 {
+				regulator-name = "VOUT0";
+				regulator-min-microvolt = <2850000>;
+				regulator-max-microvolt = <2850000>;
+			};
+
+			// supply for 26M Oscillator
+			hi6421_vout1_reg: hi6421_vout1 {
+				regulator-name = "VOUT1";
+				regulator-min-microvolt = <1700000>;
+				regulator-max-microvolt = <2000000>;
+				regulator-boot-on;
+				regulator-always-on;
+			};
+		};
+       	};
drivers/mfd/Kconfig +13 -0
index 6cc4b6a..f25ae4e 100644
@@ -209,6 +209,19 @@ config MFD_MC13XXX_I2C
 	help
 	  Select this if your MC13xxx is connected via an I2C bus.
 
+config MFD_HI6421_PMIC
+	tristate "HiSilicon Hi6421 PMU/Codec IC"
+	depends on OF
+	select MFD_CORE
+	select REGMAP_MMIO
+	help
+	  This driver supports HiSilicon Hi6421 PMIC. Hi6421 includes multi-
+	  functions, such as regulators, codec, ADCs, Coulomb counter, etc.
+	  This driver includes core APIs _only_. You have to select
+	  individul components like voltage regulators under corresponding
+	  menus in order to enable them.
+	  Memory-mapped I/O is the way to communicate with Hi6421.
+
 config HTC_EGPIO
 	bool "HTC EGPIO support"
 	depends on GPIOLIB && ARM
drivers/mfd/Makefile +1 -0
index 8afedba..4c52a6a6 100644
@@ -169,3 +169,4 @@ obj-$(CONFIG_MFD_AS3711)	+= as3711.o
 obj-$(CONFIG_MFD_AS3722)	+= as3722.o
 obj-$(CONFIG_MFD_STW481X)	+= stw481x.o
 obj-$(CONFIG_MFD_IPAQ_MICRO)	+= ipaq-micro.o
+obj-$(CONFIG_MFD_HI6421_PMIC)	+= hi6421-pmic-core.o
drivers/mfd/hi6421-pmic-core.c new file +119 -0

119 lines not on this page · raw message

include/linux/mfd/hi6421-pmic.h new file +39 -0
new file mode 100644
index 0000000..36bcb34
@@ -0,0 +1,39 @@
+/*
+ * Header file for device driver Hi6421 PMIC
+ *
+ * Copyright (c) <2011-2014> HiSilicon Technologies Co., Ltd.
+ *              http://www.hisilicon.com
+ * Copyright (c) <2013-2014> Linaro Ltd.
+ *              http://www.linaro.org
+ *
+ * Author: Guodong Xu <[email protected]>
+ *
+ * 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.
+ */
+
+#ifndef	__HI6421_PMIC_H
+#define	__HI6421_PMIC_H
+
+/* Hi6421 registers are mapped to memory bus in 4 bytes stride */
+#define HI6421_REG_TO_BUS_ADDR(x)	(x << 2)
+
+/* Hi6421 OCP (over current protection) and DEB (debounce) control register */
+#define	HI6421_OCP_DEB_CTRL_REG		HI6421_REG_TO_BUS_ADDR(0x51)
+#define	HI6421_OCP_DEB_SEL_MASK		(0x0C)
+#define HI6421_OCP_DEB_SEL_8MS		(0x00)
+#define HI6421_OCP_DEB_SEL_16MS		(0x04)
+#define HI6421_OCP_DEB_SEL_32MS		(0x08)
+#define HI6421_OCP_DEB_SEL_64MS		(0x0C)
+#define HI6421_OCP_EN_DEBOUNCE_MASK	(0x02)
+#define HI6421_OCP_EN_DEBOUNCE_ENABLE	(0x02)
+#define HI6421_OCP_AUTO_STOP_MASK	(0x01)
+#define HI6421_OCP_AUTO_STOP_ENABLE	(0x01)
+
+struct hi6421_pmic {
+	struct device		*dev;
+	struct regmap		*regmap;
+};
+
+#endif		/* __HI6421_PMIC_H */
Signature · 1 line
1.9.1
author
#5 lore raw

PATCH v5 5/7 regulator: add driver for hi6421 voltage regulator

In reply to Guodong Xu

Add driver support for HiSilicon Hi6421 voltage regulators.

Two rules for regulator enabling are defined in hi6421 spec:
1) Between disable and enable of each regulator (LDOs or BUCKs), there must be a protection gap. Use @off_on_delay of regulator core to implement this.
2) No two regulators can be enabled at the same time. Use mutex in hi6421_regulator_pdata to ensure this. A protection gap of 100us is added into each LDO/BUCK's .enable_time.

---
 drivers/regulator/Kconfig            |  10 +
 drivers/regulator/Makefile           |   1 +
 drivers/regulator/hi6421-regulator.c | 657 +++++++++++++++++++++++++++++++++++
 3 files changed, 668 insertions(+)
 create mode 100644 drivers/regulator/hi6421-regulator.c
drivers/regulator/Kconfig +10 -0
index 789eb46..7b75b2d 100644
@@ -230,6 +230,16 @@ config REGULATOR_GPIO
 	  and the platform has to provide a mapping of GPIO-states
 	  to target volts/amps.
 
+config REGULATOR_HI6421
+	tristate "HiSilicon Hi6421 PMIC voltage regulator support"
+	depends on MFD_HI6421_PMIC && OF
+	help
+	  This driver provides support for the voltage regulators on the
+	  HiSilicon Hi6421 PMU / Codec IC.
+	  Hi6421 is a multi-function device which, on regulator part, provides
+	  21 general purpose LDOs, 3 dedicated LDOs, and 5 BUCKs. All
+	  of them come with support to either ECO (idle) or sleep mode.
+
 config REGULATOR_ISL6271A
 	tristate "Intersil ISL6271A Power regulator"
 	depends on I2C
drivers/regulator/Makefile +1 -0
index d461110..7524ea6 100644
@@ -31,6 +31,7 @@ obj-$(CONFIG_REGULATOR_DBX500_PRCMU) += dbx500-prcmu.o
 obj-$(CONFIG_REGULATOR_DB8500_PRCMU) += db8500-prcmu.o
 obj-$(CONFIG_REGULATOR_FAN53555) += fan53555.o
 obj-$(CONFIG_REGULATOR_GPIO) += gpio-regulator.o
+obj-$(CONFIG_REGULATOR_HI6421) += hi6421-regulator.o
 obj-$(CONFIG_REGULATOR_ISL6271A) += isl6271a-regulator.o
 obj-$(CONFIG_REGULATOR_LP3971) += lp3971.o
 obj-$(CONFIG_REGULATOR_LP3972) += lp3972.o
drivers/regulator/hi6421-regulator.c new file +657 -0

657 lines not on this page · raw message

Signature · 1 line
1.9.1
author
#6 lore raw

PATCH v5 6/7 ARM: dts: hi3620-hi4511: Add HI6421 MFD and regulator nodes

In reply to Guodong Xu

Add Hi6421 MFD dts node and regulator nodes into hi3620-hi4511 board config dts file.

---
 arch/arm/boot/dts/hi3620-hi4511.dts | 233 ++++++++++++++++++++++++++++++++++++
 1 file changed, 233 insertions(+)
arch/arm/boot/dts/hi3620-hi4511.dts +233 -0
index fe62392..312c3f9 100644
@@ -635,6 +635,239 @@
 				pinctrl-single,bias-pullup = <0 1 0 1>;
 			};
 		};
+
+		pmic: pmic at c00000 {
+			compatible = "hisilicon,hi6421-pmic";
+			reg = <0xc00000 0x0180>; /* 0x60 << 2 */
+
+			regulators {
+				// supply for MLC NAND/ eMMC
+				hi6421_vout0_reg: hi6421_vout0 {
+					regulator-name = "VOUT0";
+					regulator-min-microvolt = <2850000>;
+					regulator-max-microvolt = <2850000>;
+				};
+
+				// supply for 26M Oscillator
+				hi6421_vout1_reg: hi6421_vout1 {
+					regulator-name = "VOUT1";
+					regulator-min-microvolt = <1700000>;
+					regulator-max-microvolt = <2000000>;
+					regulator-boot-on;
+					regulator-always-on;
+				};
+
+				// supply for AP system
+				hi6421_vout2_reg: hi6421_vout2 {
+					regulator-name = "VOUT2";
+					regulator-min-microvolt = <1050000>;
+					regulator-max-microvolt = <1400000>;
+					regulator-boot-on;
+					regulator-always-on;
+				};
+
+				// supply for DDR PHY I/O
+				hi6421_vout3_reg: hi6421_vout3 {
+					regulator-name = "VOUT3";
+					regulator-min-microvolt = <1050000>;
+					regulator-max-microvolt = <1400000>;
+					regulator-boot-on;
+					regulator-always-on;
+				};
+
+				// supply for MIPI, USB2.0, PCIe, PLL Analog
+				hi6421_vout4_reg: hi6421_vout4 {
+					regulator-name = "VOUT4";
+					regulator-min-microvolt = <1500000>;
+					regulator-max-microvolt = <3000000>;
+					regulator-boot-on;
+					regulator-always-on;
+				};
+
+				// supply for I/O 1.8V
+				hi6421_vout5_reg: hi6421_vout5 {
+					regulator-name = "VOUT5";
+					regulator-min-microvolt = <1500000>;
+					regulator-max-microvolt = <3000000>;
+					regulator-boot-on;
+					regulator-always-on;
+				};
+
+				// supply for I/O 2.6V
+				hi6421_vout6_reg: hi6421_vout6 {
+					regulator-name = "VOUT6";
+					regulator-min-microvolt = <1500000>;
+					regulator-max-microvolt = <3000000>;
+					regulator-boot-on;
+					regulator-always-on;
+				};
+
+				// supply for SD I/O
+				hi6421_vout7_reg: hi6421_vout7 {
+					regulator-name = "VOUT7";
+					regulator-min-microvolt = <1500000>;
+					regulator-max-microvolt = <3000000>;
+					regulator-boot-on;
+					regulator-always-on;
+				};
+
+				// supply for USB PHY
+				hi6421_vout8_reg: hi6421_vout8 {
+					regulator-name = "VOUT8";
+					regulator-min-microvolt = <1500000>;
+					regulator-max-microvolt = <3300000>;
+					regulator-boot-on;
+					regulator-always-on;
+				};
+
+				// supply for Efuse power
+				hi6421_vout9_reg: hi6421_vout9 {
+					regulator-name = "VOUT9";
+					regulator-min-microvolt = <1500000>;
+					regulator-max-microvolt = <3000000>;
+				};
+
+				// supply for BT RF&PA
+				hi6421_vout10_reg: hi6421_vout10 {
+					regulator-name = "VOUT10";
+					regulator-min-microvolt = <1500000>;
+					regulator-max-microvolt = <3000000>;
+				};
+
+				// supply for GPS RF&PA
+				hi6421_vout11_reg: hi6421_vout11 {
+					regulator-name = "VOUT11";
+					regulator-min-microvolt = <1500000>;
+					regulator-max-microvolt = <3000000>;
+				};
+
+				// supply for SD card
+				hi6421_vout12_reg: hi6421_vout12 {
+					regulator-name = "VOUT12";
+					regulator-min-microvolt = <2850000>;
+					regulator-max-microvolt = <2850000>;
+				};
+
+				// supply for CMMB
+				hi6421_vout13_reg: hi6421_vout13 {
+					regulator-name = "VOUT13";
+					regulator-min-microvolt = <1500000>;
+					regulator-max-microvolt = <3000000>;
+				};
+
+				// supply for WIFI I/O
+				hi6421_vout14_reg: hi6421_vout14 {
+					regulator-name = "VOUT14";
+					regulator-min-microvolt = <1500000>;
+					regulator-max-microvolt = <3000000>;
+				};
+
+				// supply for WIFI core & PA
+				hi6421_vout15_reg: hi6421_vout15 {
+					regulator-name = "VOUT15";
+					regulator-min-microvolt = <1500000>;
+					regulator-max-microvolt = <3300000>;
+				};
+
+				// supply for LCD I/O
+				hi6421_vout16_reg: hi6421_vout16 {
+					regulator-name = "VOUT16";
+					regulator-min-microvolt = <1500000>;
+					regulator-max-microvolt = <3000000>;
+					regulator-always-on;
+				};
+
+				// supply for LCD Ananlog
+				hi6421_vout17_reg: hi6421_vout17 {
+					regulator-name = "VOUT17";
+					regulator-min-microvolt = <1500000>;
+					regulator-max-microvolt = <3000000>;
+					regulator-always-on;
+				};
+
+				// supply for Camera I/O
+				hi6421_vout18_reg: hi6421_vout18 {
+					regulator-name = "VOUT18";
+					regulator-min-microvolt = <1500000>;
+					regulator-max-microvolt = <3000000>;
+				};
+
+				// supply for Camera Analog
+				hi6421_vout19_reg: hi6421_vout19 {
+					regulator-name = "VOUT19";
+					regulator-min-microvolt = <1500000>;
+					regulator-max-microvolt = <3000000>;
+				};
+
+				// supply for Camera VCM
+				hi6421_vout20_reg: hi6421_vout20 {
+					regulator-name = "VOUT20";
+					regulator-min-microvolt = <1500000>;
+					regulator-max-microvolt = <3000000>;
+				};
+
+				// supply for Audio, incl. HKADC
+				hi6421_vout_audio_reg: hi6421_vout_audio {
+					regulator-name = "AVDD2";
+					regulator-min-microvolt = <2800000>;
+					regulator-max-microvolt = <3300000>;
+				};
+
+				// supply for Cortex-A9 CPU core
+				hi6421_buck0_reg: hi6421_buck0 {
+					regulator-name = "VBUCK0";
+					regulator-min-microvolt = <700000>;
+					regulator-max-microvolt = <1600000>;
+					regulator-boot-on;
+					regulator-always-on;
+				};
+
+				// supply for Cortex-A9 CPU core
+				hi6421_buck1_reg: hi6421_buck1 {
+					regulator-name = "VBUCK1";
+					regulator-min-microvolt = <700000>;
+					regulator-max-microvolt = <1600000>;
+					regulator-boot-on;
+					regulator-always-on;
+				};
+
+				// supply for GPU
+				hi6421_buck2_reg: hi6421_buck2 {
+					regulator-name = "VBUCK2";
+					regulator-min-microvolt = <700000>;
+					regulator-max-microvolt = <1600000>;
+					regulator-boot-on;
+				};
+
+				// supply for Peripheral
+				hi6421_buck3_reg: hi6421_buck3 {
+					regulator-name = "VBUCK3";
+					regulator-min-microvolt = <950000>;
+					regulator-max-microvolt = <1200000>;
+					regulator-boot-on;
+					regulator-always-on;
+				};
+
+				// supply for LPDDR2 and AP I/O
+				hi6421_buck4_reg: hi6421_buck4 {
+					regulator-name = "VBUCK4";
+					regulator-min-microvolt = <1150000>;
+					regulator-max-microvolt = <2000000>;
+					regulator-boot-on;
+					regulator-always-on;
+				};
+
+				// supply for Low voltage
+				hi6421_buck5_reg: hi6421_buck5 {
+					regulator-name = "VBUCK5";
+					regulator-min-microvolt = <1150000>;
+					regulator-max-microvolt = <1900000>;
+					regulator-boot-on;
+					regulator-always-on;
+				};
+			};
+		};
+
 	};
 
 	gpio-keys {
Signature · 1 line
1.9.1
author
#7 lore raw

PATCH v5 7/7 ARM: hi3xxx_defconfig: Enable HI6421 MFD and Regulators

In reply to Guodong Xu

Enable HiSilicon Hi6421 MFD and regulator drivers in hi3xxx_defconfig

---
 arch/arm/configs/hi3xxx_defconfig | 3 +++
 1 file changed, 3 insertions(+)
arch/arm/configs/hi3xxx_defconfig +3 -0
index f186bdf..6cf9187 100644
@@ -54,3 +54,6 @@ CONFIG_PRINTK_TIME=y
 CONFIG_DEBUG_FS=y
 CONFIG_DEBUG_KERNEL=y
 CONFIG_LOCKUP_DETECTOR=y
+CONFIG_MFD_HI6421_PMIC=y
+CONFIG_REGULATOR=y
+CONFIG_REGULATOR_HI6421=y
Signature · 1 line
1.9.1
maintainer
#8 lore raw
In reply to Guodong Xu
Quoted 2 lines · Guodong Xu

This patchset adds an MFD core driver and a regulator driver for Hi6421 PMIC SoC.

The regulator patches here all look good but I'll apply them on multiple
topic branches so I'll wait until after -rc1 is out so I don't need to
rebase.
-------------- 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/20140813/ac6275e1/attachment.sig>

#9 lore raw

v5 cover Add MFD and regulator drivers for Hi6421 PMIC SoC

Quoted 7 lines · Mark Brown
Quoted 2 lines · Guodong Xu

This patchset adds an MFD core driver and a regulator driver for Hi6421 PMIC SoC.

The regulator patches here all look good but I'll apply them on multiple topic branches so I'll wait until after -rc1 is out so I don't need to rebase.

Hi Mark,

Thanks a lot on taking these patches. Please left the patch of hi3xxx_defconfig. We plan to go through armsoc tree by ourselves since some following patches will rename it to hisi_defconfig. The reason is that we need to support HiP04 SoC in the same defconfig. So three Hisilicon SoC will be supported by hi3xxx_defconfig, but only Hi3620 belongs to hi3xxx.

Best Regards
Haojian

maintainer
#10 lore raw

v5 cover Add MFD and regulator drivers for Hi6421 PMIC SoC

Quoted 6 lines · Haojian Zhuang

Thanks a lot on taking these patches. Please left the patch of hi3xxx_defconfig. We plan to go through armsoc tree by ourselves since some following patches will rename it to hisi_defconfig. The reason is that we need to support HiP04 SoC in the same defconfig. So three Hisilicon SoC will be supported by hi3xxx_defconfig, but only Hi3620 belongs to hi3xxx.

Like I said I'm only going to take the regulator patches - I also won't
be taking the MFD patch.
-------------- 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/20140814/e4929559/attachment.sig>