Skip to contentSkip to conversation

mfd: rk808: Add RK805 support

PATCH RESEND Applied Heiko Stuebner 2 participants 20 messages Aug 21, 2017

Subsystems (5)
lore
Share & tools
lore

Heiko Stuebner

author maintainer
#0 lore raw

v9 cover mfd: rk808: Add RK805 support

Hi Lee,

as we talked about on IRC on friday, here are the patches enabling rk805 support in the common rk808 driver. As we agreed I've dropped the cosmetic patches for clk and rtc adding the rk805 to the Kconfig helptext and I've also dropped the input driver patch, which Dmitry already applied.

I've also checked that the patches apply to your mfd-next branch.

Thanks for considering these
Heiko

old changelog from Joseph

change in v9:
PATCH V9 1/12: (1) fix spelling issue: s/Chip/chip/
(2) apply tag: Acked-for-MFD-by: Lee Jones <[email protected]>
PATCH V9 2/12: apply tag: Acked-for-MFD-by: Lee Jones <[email protected]>
PATCH V9 3/12: None
PATCH V9 4/12: apply tag: Acked-for-MFD-by: Lee Jones <[email protected]>
PATCH V9 5/12: None
PATCH V9 6/12: None
PATCH V9 7/12: apply tag: Acked-for-MFD-by: Lee Jones <[email protected]>
PATCH V9 8/12: apply tag: Acked-by: Linus Walleij <[email protected]>
PATCH V9 9/12: None (Actually, something directly updated by Dmitry Torokhov and applied on PATCH V7.

PATCH V9 10/12: apply tag: Acked-for-MFD-by: Lee Jones <[email protected]> PATCH V9 11/12: apply tag: Acked-for-MFD-by: Lee Jones <[email protected]> PATCH V9 12/12: None

change in v8:
PATCH V8 1/12: add: Signed-off-by: Joseph Chen <[email protected]> PATCH V8 2/12: add: Signed-off-by: Joseph Chen <[email protected]> PATCH V8 3/12: add: Signed-off-by: Joseph Chen <[email protected]> PATCH V8 4/12: add: Signed-off-by: Joseph Chen <[email protected]> PATCH V8 5/12: add: Signed-off-by: Joseph Chen <[email protected]> PATCH V8 6/12: add: Signed-off-by: Joseph Chen <[email protected]> PATCH V8 7/12: add: Signed-off-by: Joseph Chen <[email protected]> PATCH V8 8/12: (1) Kconfig: update coding style

	       (2) pinctrl-rk805.c: using #include <linux/gpio/driver.h>
	       (3) pinctrl-rk805.c: inline data and open code it; remove FUNCTION_GROUP and PINGROUP macros definition 

PATCH V8 9/12: NO change in V8
PATCH V8 10/12: apply tag: Acked-by: Linus Walleij <[email protected]> PATCH V8 11/12: NO change in V8
PATCH V8 12/12: (1) using semicolon after "output-high"
(2) apply tag: Acked-by: Linus Walleij <[email protected]>

change in v7:
PATCH V7 1/12: NO change in V7
PATCH V7 2/12: NO change in V7
PATCH V7 3/12: fix missing: Acked-by: Mark Brown <[email protected]> PATCH V7 4/12: NO change in V7
PATCH V7 5/12: NO change in V7
PATCH V7 6/12: NO change in V7
PATCH V7 7/12: fix missing: Acked-by: Rob Herring <[email protected]>
PATCH V7 8/12: abandon drivers/gpio/gpio-rk805.c and add drivers/pinctrl/pinctrl-rk805.c PATCH V7 9/12: reset author and signed off with my english name
reset MODULE_AUTHOR() with my english name
replace devm_request_threaded_irq() with devm_request_any_context_irq()
PATCH V7 10/12: replace 'gpio-rk805' with 'pinctrl-rk805' in struct mfd_cell rk805s[] PATCH V7 11/12: NO change in V7
PATCH V7 12/12: dt-bindings: abandon gpio-rk805.txt and add pinctrl-rk805.txt

change in v6:
patch1~7 no changed in V6.
add patch 8~12 for gpio and powerkey func for rk805.

change in v5:
PATCH V5 1/7: NO change in V5
PATCH V5 2/7: fix the rk805 reg addr in numerical order PATCH V5 3/7: NO change in V5
PATCH V5 4/7: fix up the rk805_device_shutdown func PATCH V5 5/7: NO change in V5
PATCH V5 6/7: NO change in V5
PATCH V5 7/7: fix up the description of the rk805

change in v4:
PATCH V4 1/7: NO change in V4
PATCH V4 2/7: rename the commit message
PATCH V4 3/7: NO change in V4
PATCH V4 4/7: Split this patch up into subsystems patch 5/7 6/7 PATCH V4 5/7: new added
PATCH V4 6/7: new added
PATCH V4 7/7: NO change in V4

change in V3:
PATCH V3 1/5: NO change in V3
PATCH V3 2/5: add rk805 RTC INT MASK define
PATCH V3 3/5: RK805 set suspend enable and disable is different from rk808

              use rk805_regs_ops and rk805_switch_ops

PATCH V3 4/5: fix up the shutdown func
use pm_shutdown_prepare_fn to prepare shutdown and pm_pwroff_fn pull down gpio to shut down rk805 it will update in the future(after rk808 support gpio func)
PATCH V3 5/5: NO change in V3

change in V2:
PATCH V2 1/5: NO change in V2
PATCH V2 2/5: add rk805 BUCK ILMAX define PATCH V2 3/5: NO change in V2
PATCH V2 4/5: setting RK805 BUCK ILMAX in pre init PATCH V2 5/5: Add RK805 device tree bindings document

Elaine Zhang (5):
mfd: rk808: fix up the chip id get failed
mfd: rk808: add rk805 regs addr and ID
regulator: rk808: Add regulator driver for RK805
mfd: dt-bindings: Add RK805 device tree bindings document
mfd: rk808: Add RK805 support

Joseph Chen (4):
pinctrl: dt-bindings: add bindings for Rockchip RK805 PMIC
pinctrl: Add pinctrl driver for the RK805 PMIC
mfd: rk808: Add RK805 pinctrl support
mfd: rk808: Add RK805 power key support

 Documentation/devicetree/bindings/mfd/rk808.txt    |  22 +-
 .../devicetree/bindings/pinctrl/pinctrl-rk805.txt  |  63 +++
 drivers/mfd/Kconfig                                |   4 +-
 drivers/mfd/rk808.c                                | 147 +++++-
 drivers/pinctrl/Kconfig                            |   9 +
 drivers/pinctrl/Makefile                           |   1 +
 drivers/pinctrl/pinctrl-rk805.c                    | 493 +++++++++++++++++++++
 drivers/regulator/Kconfig                          |   4 +-
 drivers/regulator/rk808-regulator.c                | 130 ++++++
 include/linux/mfd/rk808.h                          | 121 +++++
 10 files changed, 983 insertions(+), 11 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/pinctrl/pinctrl-rk805.txt
 create mode 100644 drivers/pinctrl/pinctrl-rk805.c
Signature · 1 line
2.14.1
author maintainer
#1 lore raw

PATCH RESEND v9 1/9 mfd: rk808: fix up the chip id get failed

From: Elaine Zhang <[email protected]>

the rk8xx chip id is:
((MSB << 8) | LSB) & 0xfff0

---
 drivers/mfd/rk808.c       | 21 +++++++++++++++------
 include/linux/mfd/rk808.h |  1 +
 2 files changed, 16 insertions(+), 6 deletions(-)
drivers/mfd/rk808.c +15 -6
index fd087cbb0bde..8e60ebaeaadb 100644
@@ -325,7 +325,7 @@ static int rk808_probe(struct i2c_client *client,
 	void (*pm_pwroff_fn)(void);
 	int nr_pre_init_regs;
 	int nr_cells;
-	int pm_off = 0;
+	int pm_off = 0, msb, lsb;
 	int ret;
 	int i;
 
@@ -333,14 +333,23 @@ static int rk808_probe(struct i2c_client *client,
 	if (!rk808)
 		return -ENOMEM;
 
-	rk808->variant = i2c_smbus_read_word_data(client, RK808_ID_MSB);
-	if (rk808->variant < 0) {
-		dev_err(&client->dev, "Failed to read the chip id at 0x%02x\n",
+	/* Read chip variant */
+	msb = i2c_smbus_read_byte_data(client, RK808_ID_MSB);
+	if (msb < 0) {
+		dev_err(&client->dev, "failed to read the chip id at 0x%x\n",
 			RK808_ID_MSB);
-		return rk808->variant;
+		return msb;
 	}
 
-	dev_dbg(&client->dev, "Chip id: 0x%x\n", (unsigned int)rk808->variant);
+	lsb = i2c_smbus_read_byte_data(client, RK808_ID_LSB);
+	if (lsb < 0) {
+		dev_err(&client->dev, "failed to read the chip id at 0x%x\n",
+			RK808_ID_LSB);
+		return lsb;
+	}
+
+	rk808->variant = ((msb << 8) | lsb) & RK8XX_ID_MSK;
+	dev_info(&client->dev, "chip id: 0x%x\n", (unsigned int)rk808->variant);
 
 	switch (rk808->variant) {
 	case RK808_ID:
include/linux/mfd/rk808.h +1 -0
index 83701ef7d3c7..54feb140c210 100644
@@ -298,6 +298,7 @@ enum rk818_reg {
 #define VOUT_LO_INT	BIT(0)
 #define CLK32KOUT2_EN	BIT(0)
 
+#define RK8XX_ID_MSK			0xfff0
 enum {
 	BUCK_ILMIN_50MA,
 	BUCK_ILMIN_100MA,
Signature · 1 line
2.14.1
author maintainer
#3 lore raw

PATCH RESEND v9 2/9 mfd: rk808: add rk805 regs addr and ID

In reply to Heiko Stuebner

From: Elaine Zhang <[email protected]>

---
 include/linux/mfd/rk808.h | 120 ++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 120 insertions(+)
include/linux/mfd/rk808.h +120 -0
index 54feb140c210..d3156594674c 100644
@@ -206,6 +206,97 @@ enum rk818_reg {
 #define RK818_USB_ILMIN_2000MA		0x7
 #define RK818_USB_CHG_SD_VSEL_MASK	0x70
 
+/* RK805 */
+enum rk805_reg {
+	RK805_ID_DCDC1,
+	RK805_ID_DCDC2,
+	RK805_ID_DCDC3,
+	RK805_ID_DCDC4,
+	RK805_ID_LDO1,
+	RK805_ID_LDO2,
+	RK805_ID_LDO3,
+};
+
+/* CONFIG REGISTER */
+#define RK805_VB_MON_REG		0x21
+#define RK805_THERMAL_REG		0x22
+
+/* POWER CHANNELS ENABLE REGISTER */
+#define RK805_DCDC_EN_REG		0x23
+#define RK805_SLP_DCDC_EN_REG		0x25
+#define RK805_SLP_LDO_EN_REG		0x26
+#define RK805_LDO_EN_REG		0x27
+
+/* BUCK AND LDO CONFIG REGISTER */
+#define RK805_BUCK_LDO_SLP_LP_EN_REG	0x2A
+#define RK805_BUCK1_CONFIG_REG		0x2E
+#define RK805_BUCK1_ON_VSEL_REG		0x2F
+#define RK805_BUCK1_SLP_VSEL_REG	0x30
+#define RK805_BUCK2_CONFIG_REG		0x32
+#define RK805_BUCK2_ON_VSEL_REG		0x33
+#define RK805_BUCK2_SLP_VSEL_REG	0x34
+#define RK805_BUCK3_CONFIG_REG		0x36
+#define RK805_BUCK4_CONFIG_REG		0x37
+#define RK805_BUCK4_ON_VSEL_REG		0x38
+#define RK805_BUCK4_SLP_VSEL_REG	0x39
+#define RK805_LDO1_ON_VSEL_REG		0x3B
+#define RK805_LDO1_SLP_VSEL_REG		0x3C
+#define RK805_LDO2_ON_VSEL_REG		0x3D
+#define RK805_LDO2_SLP_VSEL_REG		0x3E
+#define RK805_LDO3_ON_VSEL_REG		0x3F
+#define RK805_LDO3_SLP_VSEL_REG		0x40
+
+/* INTERRUPT REGISTER */
+#define RK805_PWRON_LP_INT_TIME_REG	0x47
+#define RK805_PWRON_DB_REG		0x48
+#define RK805_DEV_CTRL_REG		0x4B
+#define RK805_INT_STS_REG		0x4C
+#define RK805_INT_STS_MSK_REG		0x4D
+#define RK805_GPIO_IO_POL_REG		0x50
+#define RK805_OUT_REG			0x52
+#define RK805_ON_SOURCE_REG		0xAE
+#define RK805_OFF_SOURCE_REG		0xAF
+
+#define RK805_NUM_REGULATORS		7
+
+#define RK805_PWRON_FALL_RISE_INT_EN	0x0
+#define RK805_PWRON_FALL_RISE_INT_MSK	0x81
+
+/* RK805 IRQ Definitions */
+#define RK805_IRQ_PWRON_RISE		0
+#define RK805_IRQ_VB_LOW		1
+#define RK805_IRQ_PWRON			2
+#define RK805_IRQ_PWRON_LP		3
+#define RK805_IRQ_HOTDIE		4
+#define RK805_IRQ_RTC_ALARM		5
+#define RK805_IRQ_RTC_PERIOD		6
+#define RK805_IRQ_PWRON_FALL		7
+
+#define RK805_IRQ_PWRON_RISE_MSK	BIT(0)
+#define RK805_IRQ_VB_LOW_MSK		BIT(1)
+#define RK805_IRQ_PWRON_MSK		BIT(2)
+#define RK805_IRQ_PWRON_LP_MSK		BIT(3)
+#define RK805_IRQ_HOTDIE_MSK		BIT(4)
+#define RK805_IRQ_RTC_ALARM_MSK		BIT(5)
+#define RK805_IRQ_RTC_PERIOD_MSK	BIT(6)
+#define RK805_IRQ_PWRON_FALL_MSK	BIT(7)
+
+#define RK805_PWR_RISE_INT_STATUS	BIT(0)
+#define RK805_VB_LOW_INT_STATUS		BIT(1)
+#define RK805_PWRON_INT_STATUS		BIT(2)
+#define RK805_PWRON_LP_INT_STATUS	BIT(3)
+#define RK805_HOTDIE_INT_STATUS		BIT(4)
+#define RK805_ALARM_INT_STATUS		BIT(5)
+#define RK805_PERIOD_INT_STATUS		BIT(6)
+#define RK805_PWR_FALL_INT_STATUS	BIT(7)
+
+#define RK805_BUCK1_2_ILMAX_MASK	(3 << 6)
+#define RK805_BUCK3_4_ILMAX_MASK        (3 << 3)
+#define RK805_RTC_PERIOD_INT_MASK	(1 << 6)
+#define RK805_RTC_ALARM_INT_MASK	(1 << 5)
+#define RK805_INT_ALARM_EN		(1 << 3)
+#define RK805_INT_TIMER_EN		(1 << 2)
+
 /* RK808 IRQ Definitions */
 #define RK808_IRQ_VOUT_LO	0
 #define RK808_IRQ_VB_LO		1
@@ -298,7 +389,14 @@ enum rk818_reg {
 #define VOUT_LO_INT	BIT(0)
 #define CLK32KOUT2_EN	BIT(0)
 
+#define TEMP115C			0x0c
+#define TEMP_HOTDIE_MSK			0x0c
+#define SLP_SD_MSK			(0x3 << 2)
+#define SHUTDOWN_FUN			(0x2 << 2)
+#define SLEEP_FUN			(0x1 << 2)
 #define RK8XX_ID_MSK			0xfff0
+#define FPWM_MODE			BIT(7)
+
 enum {
 	BUCK_ILMIN_50MA,
 	BUCK_ILMIN_100MA,
@@ -322,6 +420,28 @@ enum {
 };
 
 enum {
+	RK805_BUCK1_2_ILMAX_2500MA,
+	RK805_BUCK1_2_ILMAX_3000MA,
+	RK805_BUCK1_2_ILMAX_3500MA,
+	RK805_BUCK1_2_ILMAX_4000MA,
+};
+
+enum {
+	RK805_BUCK3_ILMAX_1500MA,
+	RK805_BUCK3_ILMAX_2000MA,
+	RK805_BUCK3_ILMAX_2500MA,
+	RK805_BUCK3_ILMAX_3000MA,
+};
+
+enum {
+	RK805_BUCK4_ILMAX_2000MA,
+	RK805_BUCK4_ILMAX_2500MA,
+	RK805_BUCK4_ILMAX_3000MA,
+	RK805_BUCK4_ILMAX_3500MA,
+};
+
+enum {
+	RK805_ID = 0x8050,
 	RK808_ID = 0x0000,
 	RK818_ID = 0x8181,
 };
Signature · 1 line
2.14.1
author maintainer
#5 lore raw

PATCH RESEND v9 3/9 regulator: rk808: Add regulator driver for RK805

In reply to Heiko Stuebner

From: Elaine Zhang <[email protected]>

Add support for the rk805 regulator. The regulator module consists of 4 DCDCs, 3 LDOs.

The output voltages are configurable and are meant to supply power to the main processor and other components.

---
 drivers/regulator/Kconfig           |   4 +-
 drivers/regulator/rk808-regulator.c | 130 ++++++++++++++++++++++++++++++++++++
 2 files changed, 132 insertions(+), 2 deletions(-)
drivers/regulator/Kconfig +2 -2
index 99b9362331b5..008ab58cd19b 100644
@@ -687,11 +687,11 @@ config REGULATOR_RC5T583
 	  outputs which can be controlled by i2c communication.
 
 config REGULATOR_RK808
-	tristate "Rockchip RK808/RK818 Power regulators"
+	tristate "Rockchip RK805/RK808/RK818 Power regulators"
 	depends on MFD_RK808
 	help
 	  Select this option to enable the power regulator of ROCKCHIP
-	  PMIC RK808 and RK818.
+	  PMIC RK805,RK808 and RK818.
 	  This driver supports the control of different power rails of device
 	  through regulator interface. The device supports multiple DCDC/LDO
 	  outputs which can be controlled by i2c communication.
drivers/regulator/rk808-regulator.c +130 -0

160 lines not on this page · raw message

Signature · 1 line
2.14.1
author maintainer
#7 lore raw

PATCH RESEND v9 4/9 mfd: dt-bindings: Add RK805 device tree bindings document

In reply to Heiko Stuebner

From: Elaine Zhang <[email protected]>

Add device tree bindings documentation for Rockchip's RK805 PMIC.

---
 Documentation/devicetree/bindings/mfd/rk808.txt | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/mfd/rk808.txt +21 -1
index 9636ae8d8d41..91b65227afeb 100644
@@ -1,11 +1,14 @@
 RK8XX Power Management Integrated Circuit
 
 The rk8xx family current members:
+rk805
 rk808
 rk818
 
 Required properties:
-- compatible: "rockchip,rk808", "rockchip,rk818"
+- compatible: "rockchip,rk805"
+- compatible: "rockchip,rk808"
+- compatible: "rockchip,rk818"
 - reg: I2C slave address
 - interrupt-parent: The parent interrupt controller.
 - interrupts: the interrupt outputs of the controller.
@@ -18,6 +21,14 @@ Optional properties:
 - rockchip,system-power-controller: Telling whether or not this pmic is controlling
   the system power.
 
+Optional RK805 properties:
+- vcc1-supply:  The input supply for DCDC_REG1
+- vcc2-supply:  The input supply for DCDC_REG2
+- vcc3-supply:  The input supply for DCDC_REG3
+- vcc4-supply:  The input supply for DCDC_REG4
+- vcc5-supply:  The input supply for LDO_REG1 and LDO_REG2
+- vcc6-supply:  The input supply for LDO_REG3
+
 Optional RK808 properties:
 - vcc1-supply:  The input supply for DCDC_REG1
 - vcc2-supply:  The input supply for DCDC_REG2
@@ -56,6 +67,15 @@ by a child node of the 'regulators' node.
 		/* standard regulator bindings here */
 	};
 
+Following regulators of the RK805 PMIC regulators are supported. Note that
+the 'n' in regulator name, as in DCDC_REGn or LDOn, represents the DCDC or LDO
+number as described in RK805 datasheet.
+
+	- DCDC_REGn
+		- valid values for n are 1 to 4.
+	- LDO_REGn
+		- valid values for n are 1 to 3
+
 Following regulators of the RK808 PMIC block are supported. Note that
 the 'n' in regulator name, as in DCDC_REGn or LDOn, represents the DCDC or LDO
 number as described in RK808 datasheet.
Signature · 6 lines
2.14.1

--
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
author maintainer
#9 lore raw

PATCH RESEND v9 5/9 mfd: rk808: Add RK805 support

In reply to Heiko Stuebner

From: Elaine Zhang <[email protected]>

The RK805 chip is a Power Management IC (PMIC) for multimedia and handheld devices. It contains the following components:

- Regulators
- RTC
- Clocking

Both RK808 and RK805 chips are using a similar register map, so we can reuse the RTC and Clocking functionality.

---
 drivers/mfd/Kconfig |   4 +-
 drivers/mfd/rk808.c | 108 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 110 insertions(+), 2 deletions(-)
drivers/mfd/Kconfig +2 -2
index c601ee1945c6..f247de83fa6c 100644
@@ -965,13 +965,13 @@ config MFD_RC5T583
 	  different functionality of the device.
 
 config MFD_RK808
-	tristate "Rockchip RK808/RK818 Power Management Chip"
+	tristate "Rockchip RK805/RK808/RK818 Power Management Chip"
 	depends on I2C && OF
 	select MFD_CORE
 	select REGMAP_I2C
 	select REGMAP_IRQ
 	help
-	  If you say yes here you get support for the RK808 and RK818
+	  If you say yes here you get support for the RK805, RK808 and RK818
 	  Power Management chips.
 	  This driver provides common support for accessing the device
 	  through I2C interface. The device supports multiple sub-devices
drivers/mfd/rk808.c +108 -0

162 lines not on this page · raw message

Signature · 1 line
2.14.1
author maintainer
#11 lore raw

PATCH RESEND v9 6/9 pinctrl: dt-bindings: add bindings for Rockchip RK805 PMIC

In reply to Heiko Stuebner

From: Joseph Chen <[email protected]>

---
 .../devicetree/bindings/pinctrl/pinctrl-rk805.txt  | 63 ++++++++++++++++++++++
 1 file changed, 63 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/pinctrl/pinctrl-rk805.txt
Documentation/devicetree/bindings/pinctrl/pinctrl-rk805.txt new file +63 -0
new file mode 100644
index 000000000000..eee3dc260934
@@ -0,0 +1,63 @@
+Pincontrol driver for RK805 Power management IC.
+
+RK805 has 2 pins which can be configured as GPIO output only.
+
+Please refer file <devicetree/bindings/pinctrl/pinctrl-bindings.txt>
+for details of the common pinctrl bindings used by client devices,
+including the meaning of the phrase "pin configuration node".
+
+Optional Pinmux properties:
+--------------------------
+Following properties are required if default setting of pins are required
+at boot.
+- pinctrl-names: A pinctrl state named per <pinctrl-binding.txt>.
+- pinctrl[0...n]: Properties to contain the phandle for pinctrl states per
+		<pinctrl-binding.txt>.
+
+The pin configurations are defined as child of the pinctrl states node. Each
+sub-node have following properties:
+
+Required properties:
+------------------
+- #gpio-cells: Should be two. The first cell is the pin number and the
+  second is the GPIO flags.
+
+- gpio-controller: Marks the device node as a GPIO controller.
+
+- pins: List of pins. Valid values of pins properties are: gpio0, gpio1.
+
+First 2 properties must be added in the RK805 PMIC node, documented in
+Documentation/devicetree/bindings/mfd/rk808.txt
+
+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,
+	output-low,
+	output-high.
+
+Valid values for function properties are: gpio.
+
+Theres is also not customised properties for any GPIO.
+
+Example:
+--------
+rk805: rk805@18 {
+	compatible = "rockchip,rk805";
+	...
+	gpio-controller;
+	#gpio-cells = <2>;
+
+	pinctrl-names = "default";
+	pinctrl-0 = <&pmic_int_l>, <&rk805_default>;
+
+	rk805_default: pinmux {
+		gpio01 {
+			pins = "gpio0", "gpio1";
+			function = "gpio";
+			output-high;
+		};
+	};
+};
Signature · 1 line
2.14.1
author maintainer
#13 lore raw

PATCH RESEND v9 7/9 pinctrl: Add pinctrl driver for the RK805 PMIC

In reply to Heiko Stuebner

From: Joseph Chen <[email protected]>

RK805 is one of Rockchip PMICs family, it has 2 output only GPIOs.

This driver is also designed for other Rockchip PMICs to expend. Different PMIC maybe have different pin features, for example, RK816 has one pin which can be used for TS or GPIO(input/out). The mainly difference between PMICs pins are pinmux, direction and output value, that is 'struct rk805_pin_config'.

---
 drivers/pinctrl/Kconfig         |   9 +
 drivers/pinctrl/Makefile        |   1 +
 drivers/pinctrl/pinctrl-rk805.c | 493 ++++++++++++++++++++++++++++++++++++++++
 3 files changed, 503 insertions(+)
 create mode 100644 drivers/pinctrl/pinctrl-rk805.c
drivers/pinctrl/Kconfig +9 -0
index e14b46c7b37f..124fe2c09c61 100644
@@ -331,6 +331,15 @@ config PINCTRL_INGENIC
 	select GENERIC_PINMUX_FUNCTIONS
 	select REGMAP_MMIO
 
+config PINCTRL_RK805
+	tristate "Pinctrl and GPIO driver for RK805 PMIC"
+	depends on MFD_RK808
+	select GPIOLIB
+	select PINMUX
+	select GENERIC_PINCONF
+	help
+	  This selects the pinctrl driver for RK805.
+
 source "drivers/pinctrl/aspeed/Kconfig"
 source "drivers/pinctrl/bcm/Kconfig"
 source "drivers/pinctrl/berlin/Kconfig"
drivers/pinctrl/Makefile +1 -0
index 2bc641d62400..792ffaeaf340 100644
@@ -42,6 +42,7 @@ obj-$(CONFIG_PINCTRL_TB10X)	+= pinctrl-tb10x.o
 obj-$(CONFIG_PINCTRL_ST) 	+= pinctrl-st.o
 obj-$(CONFIG_PINCTRL_ZYNQ)	+= pinctrl-zynq.o
 obj-$(CONFIG_PINCTRL_INGENIC)	+= pinctrl-ingenic.o
+obj-$(CONFIG_PINCTRL_RK805)	+= pinctrl-rk805.o
 
 obj-$(CONFIG_ARCH_ASPEED)	+= aspeed/
 obj-y				+= bcm/
drivers/pinctrl/pinctrl-rk805.c new file +493 -0

493 lines not on this page · raw message

Signature · 1 line
2.14.1
author maintainer
#15 lore raw

PATCH RESEND v9 8/9 mfd: rk808: Add RK805 pinctrl support

In reply to Heiko Stuebner

From: Joseph Chen <[email protected]>

---
 drivers/mfd/rk808.c | 1 +
 1 file changed, 1 insertion(+)
drivers/mfd/rk808.c +1 -0
index 18329c8b4fe7..c803d2d5dfb7 100644
@@ -97,6 +97,7 @@ static struct resource rtc_resources[] = {
 static const struct mfd_cell rk805s[] = {
 	{ .name = "rk808-clkout", },
 	{ .name = "rk808-regulator", },
+	{ .name = "rk805-pinctrl", },
 	{
 		.name = "rk808-rtc",
 		.num_resources = ARRAY_SIZE(rtc_resources),
Signature · 1 line
2.14.1
author maintainer
#17 lore raw

PATCH RESEND v9 9/9 mfd: rk808: Add RK805 power key support

In reply to Heiko Stuebner

From: Joseph Chen <[email protected]>

---
 drivers/mfd/rk808.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
drivers/mfd/rk808.c +17 -0
index c803d2d5dfb7..216fbf6adec9 100644
@@ -94,6 +94,19 @@ static struct resource rtc_resources[] = {
 	}
 };
 
+static struct resource rk805_key_resources[] = {
+	{
+		.start  = RK805_IRQ_PWRON_FALL,
+		.end    = RK805_IRQ_PWRON_FALL,
+		.flags  = IORESOURCE_IRQ,
+	},
+	{
+		.start  = RK805_IRQ_PWRON_RISE,
+		.end    = RK805_IRQ_PWRON_RISE,
+		.flags  = IORESOURCE_IRQ,
+	}
+};
+
 static const struct mfd_cell rk805s[] = {
 	{ .name = "rk808-clkout", },
 	{ .name = "rk808-regulator", },
@@ -103,6 +116,10 @@ static const struct mfd_cell rk805s[] = {
 		.num_resources = ARRAY_SIZE(rtc_resources),
 		.resources = &rtc_resources[0],
 	},
+	{	.name = "rk805-pwrkey",
+		.num_resources = ARRAY_SIZE(rk805_key_resources),
+		.resources = &rk805_key_resources[0],
+	},
 };
 
 static const struct mfd_cell rk808s[] = {
Signature · 1 line
2.14.1
Applied
#2 lore raw

Re: [PATCH v9 RESEND 1/9] mfd: rk808: fix up the chip id get failed

In reply to Heiko Stuebner
Quoted 5 lines · Heiko Stuebner

From: Elaine Zhang <[email protected]>

the rk8xx chip id is:
((MSB << 8) | LSB) & 0xfff0

Quoted 8 lines
---
 drivers/mfd/rk808.c       | 21 +++++++++++++++------
 include/linux/mfd/rk808.h |  1 +
 2 files changed, 16 insertions(+), 6 deletions(-)

Applied, thanks.

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

Re: [PATCH v9 RESEND 2/9] mfd: rk808: add rk805 regs addr and ID

In reply to Heiko Stuebner
Quoted 9 lines · Heiko Stuebner

From: Elaine Zhang <[email protected]>

---
 include/linux/mfd/rk808.h | 120 ++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 120 insertions(+)

Applied, thanks.

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

Re: [PATCH v9 RESEND 3/9] regulator: rk808: Add regulator driver for RK805

In reply to Heiko Stuebner
Quoted 8 lines · Heiko Stuebner

From: Elaine Zhang <[email protected]>

Add support for the rk805 regulator. The regulator module consists of 4 DCDCs, 3 LDOs.

The output voltages are configurable and are meant to supply power to the main processor and other components.

Quoted 8 lines
---
 drivers/regulator/Kconfig           |   4 +-
 drivers/regulator/rk808-regulator.c | 130 ++++++++++++++++++++++++++++++++++++
 2 files changed, 132 insertions(+), 2 deletions(-)

Applied, thanks.

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

Re: [PATCH v9 RESEND 4/9] mfd: dt-bindings: Add RK805 device tree bindings document

In reply to Heiko Stuebner
Quoted 4 lines · Heiko Stuebner

From: Elaine Zhang <[email protected]>

Add device tree bindings documentation for Rockchip's RK805 PMIC.

Quoted 8 lines
---
 Documentation/devicetree/bindings/mfd/rk808.txt | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

Applied, thanks.

Signature · 4 lines
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
Applied
#10 lore raw
In reply to Heiko Stuebner
Quoted 12 lines · Heiko Stuebner

From: Elaine Zhang <[email protected]>

The RK805 chip is a Power Management IC (PMIC) for multimedia and handheld devices. It contains the following components:

- Regulators
- RTC
- Clocking

Both RK808 and RK805 chips are using a similar register map, so we can reuse the RTC and Clocking functionality.

Quoted 8 lines
---
 drivers/mfd/Kconfig |   4 +-
 drivers/mfd/rk808.c | 108 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 110 insertions(+), 2 deletions(-)

Applied, thanks.

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

Re: [PATCH v9 RESEND 6/9] pinctrl: dt-bindings: add bindings for Rockchip RK805 PMIC

In reply to Heiko Stuebner
Quoted 10 lines · Heiko Stuebner

From: Joseph Chen <[email protected]>

---
 .../devicetree/bindings/pinctrl/pinctrl-rk805.txt  | 63 ++++++++++++++++++++++
 1 file changed, 63 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/pinctrl/pinctrl-rk805.txt

Applied, thanks.

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

Re: [PATCH v9 RESEND 7/9] pinctrl: Add pinctrl driver for the RK805 PMIC

In reply to Heiko Stuebner
Quoted 13 lines · Heiko Stuebner

From: Joseph Chen <[email protected]>

RK805 is one of Rockchip PMICs family, it has 2 output only GPIOs.

This driver is also designed for other Rockchip PMICs to expend. Different PMIC maybe have different pin features, for example, RK816 has one pin which can be used for TS or GPIO(input/out). The mainly difference between PMICs pins are pinmux, direction and output value, that is 'struct rk805_pin_config'.

Quoted 6 lines
---
 drivers/pinctrl/Kconfig         |   9 +
 drivers/pinctrl/Makefile        |   1 +
 drivers/pinctrl/pinctrl-rk805.c | 493 ++++++++++++++++++++++++++++++++++++++++
 3 files changed, 503 insertions(+)
 create mode 100644 drivers/pinctrl/pinctrl-rk805.c

Applied, thanks.

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 devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Applied
#16 lore raw

Re: [PATCH v9 RESEND 8/9] mfd: rk808: Add RK805 pinctrl support

In reply to Heiko Stuebner
Quoted 9 lines · Heiko Stuebner

From: Joseph Chen <[email protected]>

---
 drivers/mfd/rk808.c | 1 +
 1 file changed, 1 insertion(+)

Applied, thanks.

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

Re: [PATCH v9 RESEND 9/9] mfd: rk808: Add RK805 power key support

In reply to Heiko Stuebner
Quoted 8 lines · Heiko Stuebner

From: Joseph Chen <[email protected]>

---
 drivers/mfd/rk808.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

Applied, thanks.

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

[GIT PULL] Immutable branch between MFD, Pinctrl and Regulator due for the v4.14 merge window

In reply to Heiko Stuebner

Enjoy!

The following changes since commit 5771a8c08880cdca3bfb4a3fc6d309d6bba20877:

Linux v4.13-rc1 (2017-07-15 15:22:10 -0700)

are available in the git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git ib-mfd-pinctrl-regulator-v4.14

for you to fetch changes up to f7c22398f5e95c995a34d4f196d53cfc32562aed:

mfd: rk808: Add RK805 power key support (2017-08-21 08:54:56 +0100)

----------------------------------------------------------------
Immutable branch between MFD, Pinctrl and Regulator due for the v4.14 merge window

----------------------------------------------------------------
Elaine Zhang (5):
mfd: rk808: Fix up the chip id get failed
mfd: rk808: Add rk805 regs addr and ID
regulator: rk808: Add regulator driver for RK805
mfd: rk808: Add RK805 support
mfd: dt-bindings: Add RK805 device tree bindings document

Joseph Chen (4):
pinctrl: dt-bindings: Add bindings for Rockchip RK805 PMIC
pinctrl: Add pinctrl driver for the RK805 PMIC
mfd: rk808: Add RK805 pinctrl support
mfd: rk808: Add RK805 power key support

 Documentation/devicetree/bindings/mfd/rk808.txt    |  22 +-
 .../devicetree/bindings/pinctrl/pinctrl-rk805.txt  |  63 +++
 drivers/mfd/Kconfig                                |   4 +-
 drivers/mfd/rk808.c                                | 147 +++++-
 drivers/pinctrl/Kconfig                            |   9 +
 drivers/pinctrl/Makefile                           |   1 +
 drivers/pinctrl/pinctrl-rk805.c                    | 493 +++++++++++++++++++++
 drivers/regulator/Kconfig                          |   4 +-
 drivers/regulator/rk808-regulator.c                | 130 ++++++
 include/linux/mfd/rk808.h                          | 121 +++++
 10 files changed, 983 insertions(+), 11 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/pinctrl/pinctrl-rk805.txt
 create mode 100644 drivers/pinctrl/pinctrl-rk805.c
Signature · 4 lines
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog