devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/7] Menelaus cleanup for DT, phase 1
@ 2014-12-27 17:52 Aaro Koskinen
  2014-12-27 17:52 ` [PATCH 1/7] mfd: menelaus: delete omap_has_menelaus Aaro Koskinen
                   ` (6 more replies)
  0 siblings, 7 replies; 18+ messages in thread
From: Aaro Koskinen @ 2014-12-27 17:52 UTC (permalink / raw)
  To: Tony Lindgren, Samuel Ortiz, Lee Jones, devicetree, linux-omap,
	linux-arm-kernel
  Cc: Aaro Koskinen

Hi,

These patches start removal of board-specific callbacks from Menelaus:
delete platform data and a callback from the driver to the board files.

Tested on top of 3.19-rc1 on N800/N810 which are the only in-tree users
for the driver.

Aaro Koskinen (7):
  mfd: menelaus: delete omap_has_menelaus
  mfd: menelaus: drop support for SW controller VCORE
  mfd: menelaus: add initial DT support
  ARM: OMAP: N8x0: configure menelaus using DT
  mfd: menelaus: delete platform data support
  mfd: menelaus: make vcore and regulator controls internal
  mfd: menelaus: use macro for magic number

 Documentation/devicetree/bindings/mfd/menelaus.txt | 30 ++++++++
 arch/arm/boot/dts/omap2420-n8x0-common.dtsi        |  3 +
 arch/arm/mach-omap2/board-n8x0.c                   | 57 --------------
 arch/arm/mach-omap2/common-board-devices.h         |  2 -
 arch/arm/mach-omap2/pdata-quirks.c                 |  1 -
 drivers/mfd/menelaus.c                             | 86 ++++++++++++++--------
 include/linux/mfd/menelaus.h                       | 25 -------
 7 files changed, 87 insertions(+), 117 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/mfd/menelaus.txt

-- 
2.2.0


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH 1/7] mfd: menelaus: delete omap_has_menelaus
  2014-12-27 17:52 [PATCH 0/7] Menelaus cleanup for DT, phase 1 Aaro Koskinen
@ 2014-12-27 17:52 ` Aaro Koskinen
  2015-01-20 13:50   ` Lee Jones
  2014-12-27 17:52 ` [PATCH 2/7] mfd: menelaus: drop support for SW controller VCORE Aaro Koskinen
                   ` (5 subsequent siblings)
  6 siblings, 1 reply; 18+ messages in thread
From: Aaro Koskinen @ 2014-12-27 17:52 UTC (permalink / raw)
  To: Tony Lindgren, Samuel Ortiz, Lee Jones, devicetree, linux-omap,
	linux-arm-kernel
  Cc: Aaro Koskinen

Delete unused macro.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
---
 include/linux/mfd/menelaus.h | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/include/linux/mfd/menelaus.h b/include/linux/mfd/menelaus.h
index f097e89..a1e12bf3 100644
--- a/include/linux/mfd/menelaus.h
+++ b/include/linux/mfd/menelaus.h
@@ -38,10 +38,4 @@ extern int menelaus_set_vcore_hw(unsigned int roof_mV, unsigned int floor_mV);
 
 extern int menelaus_set_regulator_sleep(int enable, u32 val);
 
-#if defined(CONFIG_ARCH_OMAP2) && defined(CONFIG_MENELAUS)
-#define omap_has_menelaus()	1
-#else
-#define omap_has_menelaus()	0
-#endif
-
 #endif
-- 
2.2.0


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 2/7] mfd: menelaus: drop support for SW controller VCORE
  2014-12-27 17:52 [PATCH 0/7] Menelaus cleanup for DT, phase 1 Aaro Koskinen
  2014-12-27 17:52 ` [PATCH 1/7] mfd: menelaus: delete omap_has_menelaus Aaro Koskinen
@ 2014-12-27 17:52 ` Aaro Koskinen
  2015-01-20 13:52   ` Lee Jones
  2014-12-27 17:52 ` [PATCH 3/7] mfd: menelaus: add initial DT support Aaro Koskinen
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 18+ messages in thread
From: Aaro Koskinen @ 2014-12-27 17:52 UTC (permalink / raw)
  To: Tony Lindgren, Samuel Ortiz, Lee Jones, devicetree, linux-omap,
	linux-arm-kernel
  Cc: Aaro Koskinen

Drop support for SW controlled VCORE, nobody uses it.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
---
 drivers/mfd/menelaus.c       | 23 -----------------------
 include/linux/mfd/menelaus.h |  1 -
 2 files changed, 24 deletions(-)

diff --git a/drivers/mfd/menelaus.c b/drivers/mfd/menelaus.c
index 9f01aef..917fa86 100644
--- a/drivers/mfd/menelaus.c
+++ b/drivers/mfd/menelaus.c
@@ -532,29 +532,6 @@ static const struct menelaus_vtg_value vcore_values[] = {
 	{ 1450, 18 },
 };
 
-int menelaus_set_vcore_sw(unsigned int mV)
-{
-	int val, ret;
-	struct i2c_client *c = the_menelaus->client;
-
-	val = menelaus_get_vtg_value(mV, vcore_values,
-				     ARRAY_SIZE(vcore_values));
-	if (val < 0)
-		return -EINVAL;
-
-	dev_dbg(&c->dev, "Setting VCORE to %d mV (val 0x%02x)\n", mV, val);
-
-	/* Set SW mode and the voltage in one go. */
-	mutex_lock(&the_menelaus->lock);
-	ret = menelaus_write_reg(MENELAUS_VCORE_CTRL1, val);
-	if (ret == 0)
-		the_menelaus->vcore_hw_mode = 0;
-	mutex_unlock(&the_menelaus->lock);
-	msleep(1);
-
-	return ret;
-}
-
 int menelaus_set_vcore_hw(unsigned int roof_mV, unsigned int floor_mV)
 {
 	int fval, rval, val, ret;
diff --git a/include/linux/mfd/menelaus.h b/include/linux/mfd/menelaus.h
index a1e12bf3..9e85ac0 100644
--- a/include/linux/mfd/menelaus.h
+++ b/include/linux/mfd/menelaus.h
@@ -24,7 +24,6 @@ extern int menelaus_set_vaux(unsigned int mV);
 extern int menelaus_set_vdcdc(int dcdc, unsigned int mV);
 extern int menelaus_set_slot_sel(int enable);
 extern int menelaus_get_slot_pin_states(void);
-extern int menelaus_set_vcore_sw(unsigned int mV);
 extern int menelaus_set_vcore_hw(unsigned int roof_mV, unsigned int floor_mV);
 
 #define EN_VPLL_SLEEP	(1 << 7)
-- 
2.2.0


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 3/7] mfd: menelaus: add initial DT support
  2014-12-27 17:52 [PATCH 0/7] Menelaus cleanup for DT, phase 1 Aaro Koskinen
  2014-12-27 17:52 ` [PATCH 1/7] mfd: menelaus: delete omap_has_menelaus Aaro Koskinen
  2014-12-27 17:52 ` [PATCH 2/7] mfd: menelaus: drop support for SW controller VCORE Aaro Koskinen
@ 2014-12-27 17:52 ` Aaro Koskinen
  2014-12-27 21:25   ` Felipe Balbi
  2014-12-27 17:52 ` [PATCH 5/7] mfd: menelaus: delete platform data support Aaro Koskinen
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 18+ messages in thread
From: Aaro Koskinen @ 2014-12-27 17:52 UTC (permalink / raw)
  To: Tony Lindgren, Samuel Ortiz, Lee Jones, devicetree, linux-omap,
	linux-arm-kernel
  Cc: Aaro Koskinen

Add initial DT support.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
---
 Documentation/devicetree/bindings/mfd/menelaus.txt | 30 +++++++++++++
 drivers/mfd/menelaus.c                             | 52 ++++++++++++++++++++--
 2 files changed, 78 insertions(+), 4 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/mfd/menelaus.txt

diff --git a/Documentation/devicetree/bindings/mfd/menelaus.txt b/Documentation/devicetree/bindings/mfd/menelaus.txt
new file mode 100644
index 0000000..5f69f23
--- /dev/null
+++ b/Documentation/devicetree/bindings/mfd/menelaus.txt
@@ -0,0 +1,30 @@
+Menelaus (Texas Instruments TWL92330) Power Management chip
+
+Menelaus provides facilities to control the power resources.
+
+Required properties:
+- compatible: must be "menelaus"
+- reg: I2C address of the chip
+
+Optional properties:
+- interrupts: the interrupt
+- ti,autosleep: All regulators are put to sleep by default.
+- ti,vcore-min-microvolt: Range floor for the HW controlled VCORE
+- ti,vcore-max-microvolt: Range roof for the HW controlled VCORE
+
+The use of ti,autosleep is recommended at least on Nokia N800/N810.
+
+Example:
+
+&i2c1 {
+	clock-frequency = <400000>;
+
+	pmic@72 {
+		compatible = "menelaus";
+		reg = <0x72>;
+		interrupts = <7 IRQ_TYPE_EDGE_RISING>;
+		ti,autosleep;
+		ti,vcore-min-microvolt = <1050000>;
+		ti,vcore-max-microvolt = <1400000>;
+	};
+};
diff --git a/drivers/mfd/menelaus.c b/drivers/mfd/menelaus.c
index 917fa86..3e04c64 100644
--- a/drivers/mfd/menelaus.c
+++ b/drivers/mfd/menelaus.c
@@ -16,6 +16,8 @@
  * Amit Kucheria <amit.kucheria@nokia.com>
  * Copyright (C) 2005, 2006 Nokia Corporation
  *
+ * Cleanups and DT modifications by Aaro Koskinen <aaro.koskinen@iki.fi>.
+ *
  * 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
@@ -767,6 +769,22 @@ out:
 	return ret;
 }
 
+static int menelaus_auto_sleep_regulators(void)
+{
+	u32 val;
+	int ret;
+
+	val = EN_VPLL_SLEEP | EN_VMMC_SLEEP | EN_VAUX_SLEEP | EN_VIO_SLEEP | \
+	      EN_VMEM_SLEEP | EN_DC3_SLEEP  | EN_VC_SLEEP   | EN_DC2_SLEEP;
+	ret = menelaus_set_regulator_sleep(1, val);
+	if (ret < 0) {
+		dev_err(&the_menelaus->client->dev,
+			"could not set regulators to sleep: %d\n", ret);
+		return ret;
+	}
+	return 0;
+}
+
 /*-----------------------------------------------------------------------*/
 
 /* Handles Menelaus interrupts. Does not run in interrupt context */
@@ -1162,6 +1180,7 @@ static int menelaus_probe(struct i2c_client *client,
 	struct menelaus_chip	*menelaus;
 	int			rev = 0;
 	int			err = 0;
+	struct device_node	*np = client->dev.of_node;
 	struct menelaus_platform_data *menelaus_pdata =
 					dev_get_platdata(&client->dev);
 
@@ -1221,10 +1240,35 @@ static int menelaus_probe(struct i2c_client *client,
 	else
 		menelaus->vcore_hw_mode = 0;
 
-	if (menelaus_pdata != NULL && menelaus_pdata->late_init != NULL) {
-		err = menelaus_pdata->late_init(&client->dev);
-		if (err < 0)
-			goto fail;
+	if (menelaus_pdata != NULL) {
+		if (menelaus_pdata->late_init != NULL) {
+			err = menelaus_pdata->late_init(&client->dev);
+			if (err < 0)
+				goto fail;
+		}
+	} else if (np) {
+		u32 vcore_min;
+		u32 vcore_max;
+
+		if (!of_property_read_u32(np, "ti,vcore-min-microvolt",
+					  &vcore_min) &&
+		    !of_property_read_u32(np, "ti,vcore-max-microvolt",
+					  &vcore_max)) {
+			err = menelaus_set_vcore_hw(vcore_max / 1000,
+						    vcore_min / 1000);
+			if (err < 0) {
+				dev_err(&client->dev,
+					"could not set VCORE voltage: %d\n",
+					err);
+				goto fail;
+			}
+		}
+
+		if (of_property_read_bool(np, "ti,autosleep")) {
+			err = menelaus_auto_sleep_regulators();
+			if (err < 0)
+				goto fail;
+		}
 	}
 
 	menelaus_rtc_init(menelaus);
-- 
2.2.0


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 4/7] ARM: OMAP: N8x0: configure menelaus using DT
       [not found] ` <1419702779-16001-1-git-send-email-aaro.koskinen-X3B1VOXEql0@public.gmane.org>
@ 2014-12-27 17:52   ` Aaro Koskinen
  2015-01-20 17:13   ` [PATCH 0/7] Menelaus cleanup for DT, phase 1 Lee Jones
  1 sibling, 0 replies; 18+ messages in thread
From: Aaro Koskinen @ 2014-12-27 17:52 UTC (permalink / raw)
  To: Tony Lindgren, Samuel Ortiz, Lee Jones,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-omap-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
  Cc: Aaro Koskinen

Configure Menelaus using DT.

Signed-off-by: Aaro Koskinen <aaro.koskinen-X3B1VOXEql0@public.gmane.org>
---
 arch/arm/boot/dts/omap2420-n8x0-common.dtsi |  3 ++
 arch/arm/mach-omap2/board-n8x0.c            | 57 -----------------------------
 arch/arm/mach-omap2/pdata-quirks.c          |  1 -
 3 files changed, 3 insertions(+), 58 deletions(-)

diff --git a/arch/arm/boot/dts/omap2420-n8x0-common.dtsi b/arch/arm/boot/dts/omap2420-n8x0-common.dtsi
index c9f1e93..c19718c 100644
--- a/arch/arm/boot/dts/omap2420-n8x0-common.dtsi
+++ b/arch/arm/boot/dts/omap2420-n8x0-common.dtsi
@@ -32,6 +32,9 @@
 		compatible = "menelaus";
 		reg = <0x72>;
 		interrupts = <7 IRQ_TYPE_EDGE_RISING>;
+		ti,autosleep;
+		ti,vcore-min-microvolt = <1050000>;
+		ti,vcore-max-microvolt = <1400000>;
 	};
 };
 
diff --git a/arch/arm/mach-omap2/board-n8x0.c b/arch/arm/mach-omap2/board-n8x0.c
index b6443a4..0b511c0 100644
--- a/arch/arm/mach-omap2/board-n8x0.c
+++ b/arch/arm/mach-omap2/board-n8x0.c
@@ -516,63 +516,6 @@ void __init n8x0_mmc_init(void)
 }
 #endif	/* CONFIG_MMC_OMAP */
 
-#ifdef CONFIG_MENELAUS
-
-static int n8x0_auto_sleep_regulators(void)
-{
-	u32 val;
-	int ret;
-
-	val = EN_VPLL_SLEEP | EN_VMMC_SLEEP    \
-		| EN_VAUX_SLEEP | EN_VIO_SLEEP \
-		| EN_VMEM_SLEEP | EN_DC3_SLEEP \
-		| EN_VC_SLEEP | EN_DC2_SLEEP;
-
-	ret = menelaus_set_regulator_sleep(1, val);
-	if (ret < 0) {
-		pr_err("Could not set regulators to sleep on menelaus: %u\n",
-		       ret);
-		return ret;
-	}
-	return 0;
-}
-
-static int n8x0_auto_voltage_scale(void)
-{
-	int ret;
-
-	ret = menelaus_set_vcore_hw(1400, 1050);
-	if (ret < 0) {
-		pr_err("Could not set VCORE voltage on menelaus: %u\n", ret);
-		return ret;
-	}
-	return 0;
-}
-
-static int n8x0_menelaus_late_init(struct device *dev)
-{
-	int ret;
-
-	ret = n8x0_auto_voltage_scale();
-	if (ret < 0)
-		return ret;
-	ret = n8x0_auto_sleep_regulators();
-	if (ret < 0)
-		return ret;
-	return 0;
-}
-
-#else
-static int n8x0_menelaus_late_init(struct device *dev)
-{
-	return 0;
-}
-#endif
-
-struct menelaus_platform_data n8x0_menelaus_platform_data __initdata = {
-	.late_init = n8x0_menelaus_late_init,
-};
-
 struct aic3x_pdata n810_aic33_data __initdata = {
 	.gpio_reset = 118,
 };
diff --git a/arch/arm/mach-omap2/pdata-quirks.c b/arch/arm/mach-omap2/pdata-quirks.c
index 3d7eee1..fca4650 100644
--- a/arch/arm/mach-omap2/pdata-quirks.c
+++ b/arch/arm/mach-omap2/pdata-quirks.c
@@ -369,7 +369,6 @@ static struct pdata_init auxdata_quirks[] __initdata = {
 struct of_dev_auxdata omap_auxdata_lookup[] __initdata = {
 #ifdef CONFIG_MACH_NOKIA_N8X0
 	OF_DEV_AUXDATA("ti,omap2420-mmc", 0x4809c000, "mmci-omap.0", NULL),
-	OF_DEV_AUXDATA("menelaus", 0x72, "1-0072", &n8x0_menelaus_platform_data),
 	OF_DEV_AUXDATA("tlv320aic3x", 0x18, "2-0018", &n810_aic33_data),
 #endif
 #ifdef CONFIG_ARCH_OMAP3
-- 
2.2.0

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 5/7] mfd: menelaus: delete platform data support
  2014-12-27 17:52 [PATCH 0/7] Menelaus cleanup for DT, phase 1 Aaro Koskinen
                   ` (2 preceding siblings ...)
  2014-12-27 17:52 ` [PATCH 3/7] mfd: menelaus: add initial DT support Aaro Koskinen
@ 2014-12-27 17:52 ` Aaro Koskinen
  2015-01-20 13:54   ` Lee Jones
  2014-12-27 17:52 ` [PATCH 6/7] mfd: menelaus: make vcore and regulator controls internal Aaro Koskinen
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 18+ messages in thread
From: Aaro Koskinen @ 2014-12-27 17:52 UTC (permalink / raw)
  To: Tony Lindgren, Samuel Ortiz, Lee Jones, devicetree, linux-omap,
	linux-arm-kernel
  Cc: Aaro Koskinen

Delete platform data support.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
---
 arch/arm/mach-omap2/common-board-devices.h |  2 --
 drivers/mfd/menelaus.c                     | 10 +---------
 include/linux/mfd/menelaus.h               |  6 ------
 3 files changed, 1 insertion(+), 17 deletions(-)

diff --git a/arch/arm/mach-omap2/common-board-devices.h b/arch/arm/mach-omap2/common-board-devices.h
index 07c88ae..7a30228 100644
--- a/arch/arm/mach-omap2/common-board-devices.h
+++ b/arch/arm/mach-omap2/common-board-devices.h
@@ -2,7 +2,6 @@
 #define __OMAP_COMMON_BOARD_DEVICES__
 
 #include <sound/tlv320aic3x.h>
-#include <linux/mfd/menelaus.h>
 #include "twl-common.h"
 
 #define NAND_BLOCK_SIZE	SZ_128K
@@ -14,7 +13,6 @@ void omap_ads7846_init(int bus_num, int gpio_pendown, int gpio_debounce,
 		       struct ads7846_platform_data *board_pdata);
 void *n8x0_legacy_init(void);
 
-extern struct menelaus_platform_data n8x0_menelaus_platform_data;
 extern struct aic3x_pdata n810_aic33_data;
 
 #endif /* __OMAP_COMMON_BOARD_DEVICES__ */
diff --git a/drivers/mfd/menelaus.c b/drivers/mfd/menelaus.c
index 3e04c64..4a900cc 100644
--- a/drivers/mfd/menelaus.c
+++ b/drivers/mfd/menelaus.c
@@ -1181,8 +1181,6 @@ static int menelaus_probe(struct i2c_client *client,
 	int			rev = 0;
 	int			err = 0;
 	struct device_node	*np = client->dev.of_node;
-	struct menelaus_platform_data *menelaus_pdata =
-					dev_get_platdata(&client->dev);
 
 	if (the_menelaus) {
 		dev_dbg(&client->dev, "only one %s for now\n",
@@ -1240,13 +1238,7 @@ static int menelaus_probe(struct i2c_client *client,
 	else
 		menelaus->vcore_hw_mode = 0;
 
-	if (menelaus_pdata != NULL) {
-		if (menelaus_pdata->late_init != NULL) {
-			err = menelaus_pdata->late_init(&client->dev);
-			if (err < 0)
-				goto fail;
-		}
-	} else if (np) {
+	if (np) {
 		u32 vcore_min;
 		u32 vcore_max;
 
diff --git a/include/linux/mfd/menelaus.h b/include/linux/mfd/menelaus.h
index 9e85ac0..21eeff5 100644
--- a/include/linux/mfd/menelaus.h
+++ b/include/linux/mfd/menelaus.h
@@ -5,12 +5,6 @@
 #ifndef __ASM_ARCH_MENELAUS_H
 #define __ASM_ARCH_MENELAUS_H
 
-struct device;
-
-struct menelaus_platform_data {
-	int (* late_init)(struct device *dev);
-};
-
 extern int menelaus_register_mmc_callback(void (*callback)(void *data, u8 card_mask),
 					  void *data);
 extern void menelaus_unregister_mmc_callback(void);
-- 
2.2.0


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 6/7] mfd: menelaus: make vcore and regulator controls internal
  2014-12-27 17:52 [PATCH 0/7] Menelaus cleanup for DT, phase 1 Aaro Koskinen
                   ` (3 preceding siblings ...)
  2014-12-27 17:52 ` [PATCH 5/7] mfd: menelaus: delete platform data support Aaro Koskinen
@ 2014-12-27 17:52 ` Aaro Koskinen
  2015-01-20 13:58   ` Lee Jones
  2014-12-27 17:52 ` [PATCH 7/7] mfd: menelaus: use macro for magic number Aaro Koskinen
       [not found] ` <1419702779-16001-1-git-send-email-aaro.koskinen-X3B1VOXEql0@public.gmane.org>
  6 siblings, 1 reply; 18+ messages in thread
From: Aaro Koskinen @ 2014-12-27 17:52 UTC (permalink / raw)
  To: Tony Lindgren, Samuel Ortiz, Lee Jones, devicetree, linux-omap,
	linux-arm-kernel
  Cc: Aaro Koskinen

Make vcore and regulator control functions internal to the driver.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
---
 drivers/mfd/menelaus.c       | 13 +++++++++++--
 include/linux/mfd/menelaus.h | 12 ------------
 2 files changed, 11 insertions(+), 14 deletions(-)

diff --git a/drivers/mfd/menelaus.c b/drivers/mfd/menelaus.c
index 4a900cc..8660adf 100644
--- a/drivers/mfd/menelaus.c
+++ b/drivers/mfd/menelaus.c
@@ -163,6 +163,15 @@
 #define MCT_PIN_ST_S1_CD_ST		(1 << 0)
 #define MCT_PIN_ST_S2_CD_ST		(1 << 1)
 
+#define EN_VPLL_SLEEP			(1 << 7)
+#define EN_VMMC_SLEEP			(1 << 6)
+#define EN_VAUX_SLEEP			(1 << 5)
+#define EN_VIO_SLEEP			(1 << 4)
+#define EN_VMEM_SLEEP			(1 << 3)
+#define EN_DC3_SLEEP			(1 << 2)
+#define EN_DC2_SLEEP			(1 << 1)
+#define EN_VC_SLEEP			(1 << 0)
+
 static void menelaus_work(struct work_struct *_menelaus);
 
 struct menelaus_chip {
@@ -534,7 +543,7 @@ static const struct menelaus_vtg_value vcore_values[] = {
 	{ 1450, 18 },
 };
 
-int menelaus_set_vcore_hw(unsigned int roof_mV, unsigned int floor_mV)
+static int menelaus_set_vcore_hw(unsigned int roof_mV, unsigned int floor_mV)
 {
 	int fval, rval, val, ret;
 	struct i2c_client *c = the_menelaus->client;
@@ -743,7 +752,7 @@ int menelaus_get_slot_pin_states(void)
 }
 EXPORT_SYMBOL(menelaus_get_slot_pin_states);
 
-int menelaus_set_regulator_sleep(int enable, u32 val)
+static int menelaus_set_regulator_sleep(int enable, u32 val)
 {
 	int t, ret;
 	struct i2c_client *c = the_menelaus->client;
diff --git a/include/linux/mfd/menelaus.h b/include/linux/mfd/menelaus.h
index 21eeff5..bcabc03 100644
--- a/include/linux/mfd/menelaus.h
+++ b/include/linux/mfd/menelaus.h
@@ -18,17 +18,5 @@ extern int menelaus_set_vaux(unsigned int mV);
 extern int menelaus_set_vdcdc(int dcdc, unsigned int mV);
 extern int menelaus_set_slot_sel(int enable);
 extern int menelaus_get_slot_pin_states(void);
-extern int menelaus_set_vcore_hw(unsigned int roof_mV, unsigned int floor_mV);
-
-#define EN_VPLL_SLEEP	(1 << 7)
-#define EN_VMMC_SLEEP	(1 << 6)
-#define EN_VAUX_SLEEP	(1 << 5)
-#define EN_VIO_SLEEP	(1 << 4)
-#define EN_VMEM_SLEEP	(1 << 3)
-#define EN_DC3_SLEEP	(1 << 2)
-#define EN_DC2_SLEEP	(1 << 1)
-#define EN_VC_SLEEP	(1 << 0)
-
-extern int menelaus_set_regulator_sleep(int enable, u32 val);
 
 #endif
-- 
2.2.0


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 7/7] mfd: menelaus: use macro for magic number
  2014-12-27 17:52 [PATCH 0/7] Menelaus cleanup for DT, phase 1 Aaro Koskinen
                   ` (4 preceding siblings ...)
  2014-12-27 17:52 ` [PATCH 6/7] mfd: menelaus: make vcore and regulator controls internal Aaro Koskinen
@ 2014-12-27 17:52 ` Aaro Koskinen
       [not found]   ` <1419702779-16001-8-git-send-email-aaro.koskinen-X3B1VOXEql0@public.gmane.org>
       [not found] ` <1419702779-16001-1-git-send-email-aaro.koskinen-X3B1VOXEql0@public.gmane.org>
  6 siblings, 1 reply; 18+ messages in thread
From: Aaro Koskinen @ 2014-12-27 17:52 UTC (permalink / raw)
  To: Tony Lindgren, Samuel Ortiz, Lee Jones, devicetree, linux-omap,
	linux-arm-kernel
  Cc: Aaro Koskinen

Use macro to check a register bit.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
---
 drivers/mfd/menelaus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mfd/menelaus.c b/drivers/mfd/menelaus.c
index 8660adf..05bae40 100644
--- a/drivers/mfd/menelaus.c
+++ b/drivers/mfd/menelaus.c
@@ -1242,7 +1242,7 @@ static int menelaus_probe(struct i2c_client *client,
 	err = menelaus_read_reg(MENELAUS_VCORE_CTRL1);
 	if (err < 0)
 		goto fail;
-	if (err & BIT(7))
+	if (err & VCORE_CTRL1_HW_NSW)
 		menelaus->vcore_hw_mode = 1;
 	else
 		menelaus->vcore_hw_mode = 0;
-- 
2.2.0


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* Re: [PATCH 3/7] mfd: menelaus: add initial DT support
  2014-12-27 17:52 ` [PATCH 3/7] mfd: menelaus: add initial DT support Aaro Koskinen
@ 2014-12-27 21:25   ` Felipe Balbi
  2014-12-28 23:34     ` Aaro Koskinen
  0 siblings, 1 reply; 18+ messages in thread
From: Felipe Balbi @ 2014-12-27 21:25 UTC (permalink / raw)
  To: Aaro Koskinen
  Cc: Tony Lindgren, Samuel Ortiz, Lee Jones, devicetree, linux-omap,
	linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 2183 bytes --]

On Sat, Dec 27, 2014 at 07:52:55PM +0200, Aaro Koskinen wrote:
> Add initial DT support.
> 
> Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
> ---
>  Documentation/devicetree/bindings/mfd/menelaus.txt | 30 +++++++++++++
>  drivers/mfd/menelaus.c                             | 52 ++++++++++++++++++++--
>  2 files changed, 78 insertions(+), 4 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/mfd/menelaus.txt
> 
> diff --git a/Documentation/devicetree/bindings/mfd/menelaus.txt b/Documentation/devicetree/bindings/mfd/menelaus.txt
> new file mode 100644
> index 0000000..5f69f23
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/mfd/menelaus.txt
> @@ -0,0 +1,30 @@
> +Menelaus (Texas Instruments TWL92330) Power Management chip
> +
> +Menelaus provides facilities to control the power resources.
> +
> +Required properties:
> +- compatible: must be "menelaus"
> +- reg: I2C address of the chip
> +
> +Optional properties:
> +- interrupts: the interrupt
> +- ti,autosleep: All regulators are put to sleep by default.
> +- ti,vcore-min-microvolt: Range floor for the HW controlled VCORE
> +- ti,vcore-max-microvolt: Range roof for the HW controlled VCORE
> +
> +The use of ti,autosleep is recommended at least on Nokia N800/N810.
> +
> +Example:
> +
> +&i2c1 {
> +	clock-frequency = <400000>;
> +
> +	pmic@72 {
> +		compatible = "menelaus";
> +		reg = <0x72>;
> +		interrupts = <7 IRQ_TYPE_EDGE_RISING>;
> +		ti,autosleep;
> +		ti,vcore-min-microvolt = <1050000>;
> +		ti,vcore-max-microvolt = <1400000>;

looks like these should be first converted to actual regulators
otherwise we will have to maintain this binding forever which means that
any effort of adding regulator fwk support for menelaus will become a
lot more difficult because it'll have to cope with the legacy/bogus
binding.

I started doing irqchip/irqdomain conversion but I don't have where to
test and got side-tracked by other stuff. I'll see if I can restart that
work early next year.

Then, if you change your series so that first you add proper regulator
fwk support, we should be pretty good with menelaus.

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 3/7] mfd: menelaus: add initial DT support
  2014-12-27 21:25   ` Felipe Balbi
@ 2014-12-28 23:34     ` Aaro Koskinen
  2014-12-29 18:12       ` Felipe Balbi
  0 siblings, 1 reply; 18+ messages in thread
From: Aaro Koskinen @ 2014-12-28 23:34 UTC (permalink / raw)
  To: Felipe Balbi
  Cc: Tony Lindgren, Samuel Ortiz, Lee Jones, devicetree, linux-omap,
	linux-arm-kernel

Hi,

On Sat, Dec 27, 2014 at 03:25:53PM -0600, Felipe Balbi wrote:
> On Sat, Dec 27, 2014 at 07:52:55PM +0200, Aaro Koskinen wrote:
> > Add initial DT support.
> > 
> > Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
> > ---
> >  Documentation/devicetree/bindings/mfd/menelaus.txt | 30 +++++++++++++
> >  drivers/mfd/menelaus.c                             | 52 ++++++++++++++++++++--
> >  2 files changed, 78 insertions(+), 4 deletions(-)
> >  create mode 100644 Documentation/devicetree/bindings/mfd/menelaus.txt
> > 
> > diff --git a/Documentation/devicetree/bindings/mfd/menelaus.txt b/Documentation/devicetree/bindings/mfd/menelaus.txt
> > new file mode 100644
> > index 0000000..5f69f23
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/mfd/menelaus.txt
> > @@ -0,0 +1,30 @@
> > +Menelaus (Texas Instruments TWL92330) Power Management chip
> > +
> > +Menelaus provides facilities to control the power resources.
> > +
> > +Required properties:
> > +- compatible: must be "menelaus"
> > +- reg: I2C address of the chip
> > +
> > +Optional properties:
> > +- interrupts: the interrupt
> > +- ti,autosleep: All regulators are put to sleep by default.
> > +- ti,vcore-min-microvolt: Range floor for the HW controlled VCORE
> > +- ti,vcore-max-microvolt: Range roof for the HW controlled VCORE
> > +
> > +The use of ti,autosleep is recommended at least on Nokia N800/N810.
> > +
> > +Example:
> > +
> > +&i2c1 {
> > +	clock-frequency = <400000>;
> > +
> > +	pmic@72 {
> > +		compatible = "menelaus";
> > +		reg = <0x72>;
> > +		interrupts = <7 IRQ_TYPE_EDGE_RISING>;
> > +		ti,autosleep;
> > +		ti,vcore-min-microvolt = <1050000>;
> > +		ti,vcore-max-microvolt = <1400000>;
> 
> looks like these should be first converted to actual regulators
> otherwise we will have to maintain this binding forever which means that
> any effort of adding regulator fwk support for menelaus will become a
> lot more difficult because it'll have to cope with the legacy/bogus
> binding.

I was thinking such conversion could be done with incremental patches...
There's basically only one board (n8x0) that uses this and not likely
to be any others. Is there a way to declare bindings unstable?

> I started doing irqchip/irqdomain conversion but I don't have where to
> test and got side-tracked by other stuff. I'll see if I can restart that
> work early next year.
> 
> Then, if you change your series so that first you add proper regulator
> fwk support, we should be pretty good with menelaus.

Ok, let's see.

A.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 3/7] mfd: menelaus: add initial DT support
  2014-12-28 23:34     ` Aaro Koskinen
@ 2014-12-29 18:12       ` Felipe Balbi
  0 siblings, 0 replies; 18+ messages in thread
From: Felipe Balbi @ 2014-12-29 18:12 UTC (permalink / raw)
  To: Aaro Koskinen
  Cc: Felipe Balbi, Tony Lindgren, Samuel Ortiz, Lee Jones, devicetree,
	linux-omap, linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 2376 bytes --]

Hi,

On Mon, Dec 29, 2014 at 01:34:45AM +0200, Aaro Koskinen wrote:
> > > Add initial DT support.
> > > 
> > > Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
> > > ---
> > >  Documentation/devicetree/bindings/mfd/menelaus.txt | 30 +++++++++++++
> > >  drivers/mfd/menelaus.c                             | 52 ++++++++++++++++++++--
> > >  2 files changed, 78 insertions(+), 4 deletions(-)
> > >  create mode 100644 Documentation/devicetree/bindings/mfd/menelaus.txt
> > > 
> > > diff --git a/Documentation/devicetree/bindings/mfd/menelaus.txt b/Documentation/devicetree/bindings/mfd/menelaus.txt
> > > new file mode 100644
> > > index 0000000..5f69f23
> > > --- /dev/null
> > > +++ b/Documentation/devicetree/bindings/mfd/menelaus.txt
> > > @@ -0,0 +1,30 @@
> > > +Menelaus (Texas Instruments TWL92330) Power Management chip
> > > +
> > > +Menelaus provides facilities to control the power resources.
> > > +
> > > +Required properties:
> > > +- compatible: must be "menelaus"
> > > +- reg: I2C address of the chip
> > > +
> > > +Optional properties:
> > > +- interrupts: the interrupt
> > > +- ti,autosleep: All regulators are put to sleep by default.
> > > +- ti,vcore-min-microvolt: Range floor for the HW controlled VCORE
> > > +- ti,vcore-max-microvolt: Range roof for the HW controlled VCORE
> > > +
> > > +The use of ti,autosleep is recommended at least on Nokia N800/N810.
> > > +
> > > +Example:
> > > +
> > > +&i2c1 {
> > > +	clock-frequency = <400000>;
> > > +
> > > +	pmic@72 {
> > > +		compatible = "menelaus";
> > > +		reg = <0x72>;
> > > +		interrupts = <7 IRQ_TYPE_EDGE_RISING>;
> > > +		ti,autosleep;
> > > +		ti,vcore-min-microvolt = <1050000>;
> > > +		ti,vcore-max-microvolt = <1400000>;
> > 
> > looks like these should be first converted to actual regulators
> > otherwise we will have to maintain this binding forever which means that
> > any effort of adding regulator fwk support for menelaus will become a
> > lot more difficult because it'll have to cope with the legacy/bogus
> > binding.
> 
> I was thinking such conversion could be done with incremental patches...
> There's basically only one board (n8x0) that uses this and not likely
> to be any others. Is there a way to declare bindings unstable?

AFAICT, once they hit a major release, they're stable for life :-)

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 1/7] mfd: menelaus: delete omap_has_menelaus
  2014-12-27 17:52 ` [PATCH 1/7] mfd: menelaus: delete omap_has_menelaus Aaro Koskinen
@ 2015-01-20 13:50   ` Lee Jones
  0 siblings, 0 replies; 18+ messages in thread
From: Lee Jones @ 2015-01-20 13:50 UTC (permalink / raw)
  To: Aaro Koskinen
  Cc: Tony Lindgren, Samuel Ortiz, devicetree, linux-omap, linux-arm-kernel

On Sat, 27 Dec 2014, Aaro Koskinen wrote:

> Delete unused macro.
> 
> Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
> ---
>  include/linux/mfd/menelaus.h | 6 ------
>  1 file changed, 6 deletions(-)

Applied, thanks.

> diff --git a/include/linux/mfd/menelaus.h b/include/linux/mfd/menelaus.h
> index f097e89..a1e12bf3 100644
> --- a/include/linux/mfd/menelaus.h
> +++ b/include/linux/mfd/menelaus.h
> @@ -38,10 +38,4 @@ extern int menelaus_set_vcore_hw(unsigned int roof_mV, unsigned int floor_mV);
>  
>  extern int menelaus_set_regulator_sleep(int enable, u32 val);
>  
> -#if defined(CONFIG_ARCH_OMAP2) && defined(CONFIG_MENELAUS)
> -#define omap_has_menelaus()	1
> -#else
> -#define omap_has_menelaus()	0
> -#endif
> -
>  #endif

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 2/7] mfd: menelaus: drop support for SW controller VCORE
  2014-12-27 17:52 ` [PATCH 2/7] mfd: menelaus: drop support for SW controller VCORE Aaro Koskinen
@ 2015-01-20 13:52   ` Lee Jones
  0 siblings, 0 replies; 18+ messages in thread
From: Lee Jones @ 2015-01-20 13:52 UTC (permalink / raw)
  To: Aaro Koskinen
  Cc: Tony Lindgren, Samuel Ortiz, devicetree, linux-omap, linux-arm-kernel

On Sat, 27 Dec 2014, Aaro Koskinen wrote:

> Drop support for SW controlled VCORE, nobody uses it.
> 
> Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
> ---
>  drivers/mfd/menelaus.c       | 23 -----------------------
>  include/linux/mfd/menelaus.h |  1 -
>  2 files changed, 24 deletions(-)

Applied, thanks.

> diff --git a/drivers/mfd/menelaus.c b/drivers/mfd/menelaus.c
> index 9f01aef..917fa86 100644
> --- a/drivers/mfd/menelaus.c
> +++ b/drivers/mfd/menelaus.c
> @@ -532,29 +532,6 @@ static const struct menelaus_vtg_value vcore_values[] = {
>  	{ 1450, 18 },
>  };
>  
> -int menelaus_set_vcore_sw(unsigned int mV)
> -{
> -	int val, ret;
> -	struct i2c_client *c = the_menelaus->client;
> -
> -	val = menelaus_get_vtg_value(mV, vcore_values,
> -				     ARRAY_SIZE(vcore_values));
> -	if (val < 0)
> -		return -EINVAL;
> -
> -	dev_dbg(&c->dev, "Setting VCORE to %d mV (val 0x%02x)\n", mV, val);
> -
> -	/* Set SW mode and the voltage in one go. */
> -	mutex_lock(&the_menelaus->lock);
> -	ret = menelaus_write_reg(MENELAUS_VCORE_CTRL1, val);
> -	if (ret == 0)
> -		the_menelaus->vcore_hw_mode = 0;
> -	mutex_unlock(&the_menelaus->lock);
> -	msleep(1);
> -
> -	return ret;
> -}
> -
>  int menelaus_set_vcore_hw(unsigned int roof_mV, unsigned int floor_mV)
>  {
>  	int fval, rval, val, ret;
> diff --git a/include/linux/mfd/menelaus.h b/include/linux/mfd/menelaus.h
> index a1e12bf3..9e85ac0 100644
> --- a/include/linux/mfd/menelaus.h
> +++ b/include/linux/mfd/menelaus.h
> @@ -24,7 +24,6 @@ extern int menelaus_set_vaux(unsigned int mV);
>  extern int menelaus_set_vdcdc(int dcdc, unsigned int mV);
>  extern int menelaus_set_slot_sel(int enable);
>  extern int menelaus_get_slot_pin_states(void);
> -extern int menelaus_set_vcore_sw(unsigned int mV);
>  extern int menelaus_set_vcore_hw(unsigned int roof_mV, unsigned int floor_mV);
>  
>  #define EN_VPLL_SLEEP	(1 << 7)

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 5/7] mfd: menelaus: delete platform data support
  2014-12-27 17:52 ` [PATCH 5/7] mfd: menelaus: delete platform data support Aaro Koskinen
@ 2015-01-20 13:54   ` Lee Jones
  0 siblings, 0 replies; 18+ messages in thread
From: Lee Jones @ 2015-01-20 13:54 UTC (permalink / raw)
  To: Aaro Koskinen
  Cc: Tony Lindgren, Samuel Ortiz, devicetree, linux-omap, linux-arm-kernel

On Sat, 27 Dec 2014, Aaro Koskinen wrote:

> Delete platform data support.
> 
> Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
> ---
>  arch/arm/mach-omap2/common-board-devices.h |  2 --
>  drivers/mfd/menelaus.c                     | 10 +---------
>  include/linux/mfd/menelaus.h               |  6 ------
>  3 files changed, 1 insertion(+), 17 deletions(-)

Applied, thanks.

> diff --git a/arch/arm/mach-omap2/common-board-devices.h b/arch/arm/mach-omap2/common-board-devices.h
> index 07c88ae..7a30228 100644
> --- a/arch/arm/mach-omap2/common-board-devices.h
> +++ b/arch/arm/mach-omap2/common-board-devices.h
> @@ -2,7 +2,6 @@
>  #define __OMAP_COMMON_BOARD_DEVICES__
>  
>  #include <sound/tlv320aic3x.h>
> -#include <linux/mfd/menelaus.h>
>  #include "twl-common.h"
>  
>  #define NAND_BLOCK_SIZE	SZ_128K
> @@ -14,7 +13,6 @@ void omap_ads7846_init(int bus_num, int gpio_pendown, int gpio_debounce,
>  		       struct ads7846_platform_data *board_pdata);
>  void *n8x0_legacy_init(void);
>  
> -extern struct menelaus_platform_data n8x0_menelaus_platform_data;
>  extern struct aic3x_pdata n810_aic33_data;
>  
>  #endif /* __OMAP_COMMON_BOARD_DEVICES__ */
> diff --git a/drivers/mfd/menelaus.c b/drivers/mfd/menelaus.c
> index 3e04c64..4a900cc 100644
> --- a/drivers/mfd/menelaus.c
> +++ b/drivers/mfd/menelaus.c
> @@ -1181,8 +1181,6 @@ static int menelaus_probe(struct i2c_client *client,
>  	int			rev = 0;
>  	int			err = 0;
>  	struct device_node	*np = client->dev.of_node;
> -	struct menelaus_platform_data *menelaus_pdata =
> -					dev_get_platdata(&client->dev);
>  
>  	if (the_menelaus) {
>  		dev_dbg(&client->dev, "only one %s for now\n",
> @@ -1240,13 +1238,7 @@ static int menelaus_probe(struct i2c_client *client,
>  	else
>  		menelaus->vcore_hw_mode = 0;
>  
> -	if (menelaus_pdata != NULL) {
> -		if (menelaus_pdata->late_init != NULL) {
> -			err = menelaus_pdata->late_init(&client->dev);
> -			if (err < 0)
> -				goto fail;
> -		}
> -	} else if (np) {
> +	if (np) {
>  		u32 vcore_min;
>  		u32 vcore_max;
>  
> diff --git a/include/linux/mfd/menelaus.h b/include/linux/mfd/menelaus.h
> index 9e85ac0..21eeff5 100644
> --- a/include/linux/mfd/menelaus.h
> +++ b/include/linux/mfd/menelaus.h
> @@ -5,12 +5,6 @@
>  #ifndef __ASM_ARCH_MENELAUS_H
>  #define __ASM_ARCH_MENELAUS_H
>  
> -struct device;
> -
> -struct menelaus_platform_data {
> -	int (* late_init)(struct device *dev);
> -};
> -
>  extern int menelaus_register_mmc_callback(void (*callback)(void *data, u8 card_mask),
>  					  void *data);
>  extern void menelaus_unregister_mmc_callback(void);

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 6/7] mfd: menelaus: make vcore and regulator controls internal
  2014-12-27 17:52 ` [PATCH 6/7] mfd: menelaus: make vcore and regulator controls internal Aaro Koskinen
@ 2015-01-20 13:58   ` Lee Jones
  2015-01-20 14:01     ` Lee Jones
  0 siblings, 1 reply; 18+ messages in thread
From: Lee Jones @ 2015-01-20 13:58 UTC (permalink / raw)
  To: Aaro Koskinen
  Cc: Tony Lindgren, Samuel Ortiz, devicetree, linux-omap, linux-arm-kernel

On Sat, 27 Dec 2014, Aaro Koskinen wrote:

> Make vcore and regulator control functions internal to the driver.
> 
> Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
> ---
>  drivers/mfd/menelaus.c       | 13 +++++++++++--
>  include/linux/mfd/menelaus.h | 12 ------------
>  2 files changed, 11 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/mfd/menelaus.c b/drivers/mfd/menelaus.c
> index 4a900cc..8660adf 100644
> --- a/drivers/mfd/menelaus.c
> +++ b/drivers/mfd/menelaus.c
> @@ -163,6 +163,15 @@
>  #define MCT_PIN_ST_S1_CD_ST		(1 << 0)
>  #define MCT_PIN_ST_S2_CD_ST		(1 << 1)
>  
> +#define EN_VPLL_SLEEP			(1 << 7)
> +#define EN_VMMC_SLEEP			(1 << 6)
> +#define EN_VAUX_SLEEP			(1 << 5)
> +#define EN_VIO_SLEEP			(1 << 4)
> +#define EN_VMEM_SLEEP			(1 << 3)
> +#define EN_DC3_SLEEP			(1 << 2)
> +#define EN_DC2_SLEEP			(1 << 1)
> +#define EN_VC_SLEEP			(1 << 0)

Better to use the BIT() macro for this kind of stuff.

Please take this opportunity to use it.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 7/7] mfd: menelaus: use macro for magic number
       [not found]   ` <1419702779-16001-8-git-send-email-aaro.koskinen-X3B1VOXEql0@public.gmane.org>
@ 2015-01-20 14:01     ` Lee Jones
  0 siblings, 0 replies; 18+ messages in thread
From: Lee Jones @ 2015-01-20 14:01 UTC (permalink / raw)
  To: Aaro Koskinen
  Cc: Tony Lindgren, Samuel Ortiz, devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-omap-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Sat, 27 Dec 2014, Aaro Koskinen wrote:

> Use macro to check a register bit.
> 
> Signed-off-by: Aaro Koskinen <aaro.koskinen-X3B1VOXEql0@public.gmane.org>
> ---
>  drivers/mfd/menelaus.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks.

> diff --git a/drivers/mfd/menelaus.c b/drivers/mfd/menelaus.c
> index 8660adf..05bae40 100644
> --- a/drivers/mfd/menelaus.c
> +++ b/drivers/mfd/menelaus.c
> @@ -1242,7 +1242,7 @@ static int menelaus_probe(struct i2c_client *client,
>  	err = menelaus_read_reg(MENELAUS_VCORE_CTRL1);
>  	if (err < 0)
>  		goto fail;
> -	if (err & BIT(7))
> +	if (err & VCORE_CTRL1_HW_NSW)
>  		menelaus->vcore_hw_mode = 1;
>  	else
>  		menelaus->vcore_hw_mode = 0;

-- 
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 majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 6/7] mfd: menelaus: make vcore and regulator controls internal
  2015-01-20 13:58   ` Lee Jones
@ 2015-01-20 14:01     ` Lee Jones
  0 siblings, 0 replies; 18+ messages in thread
From: Lee Jones @ 2015-01-20 14:01 UTC (permalink / raw)
  To: Aaro Koskinen
  Cc: Tony Lindgren, Samuel Ortiz, devicetree, linux-omap, linux-arm-kernel

On Tue, 20 Jan 2015, Lee Jones wrote:

> On Sat, 27 Dec 2014, Aaro Koskinen wrote:
> 
> > Make vcore and regulator control functions internal to the driver.
> > 
> > Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
> > ---
> >  drivers/mfd/menelaus.c       | 13 +++++++++++--
> >  include/linux/mfd/menelaus.h | 12 ------------
> >  2 files changed, 11 insertions(+), 14 deletions(-)
> > 
> > diff --git a/drivers/mfd/menelaus.c b/drivers/mfd/menelaus.c
> > index 4a900cc..8660adf 100644
> > --- a/drivers/mfd/menelaus.c
> > +++ b/drivers/mfd/menelaus.c
> > @@ -163,6 +163,15 @@
> >  #define MCT_PIN_ST_S1_CD_ST		(1 << 0)
> >  #define MCT_PIN_ST_S2_CD_ST		(1 << 1)
> >  
> > +#define EN_VPLL_SLEEP			(1 << 7)
> > +#define EN_VMMC_SLEEP			(1 << 6)
> > +#define EN_VAUX_SLEEP			(1 << 5)
> > +#define EN_VIO_SLEEP			(1 << 4)
> > +#define EN_VMEM_SLEEP			(1 << 3)
> > +#define EN_DC3_SLEEP			(1 << 2)
> > +#define EN_DC2_SLEEP			(1 << 1)
> > +#define EN_VC_SLEEP			(1 << 0)
> 
> Better to use the BIT() macro for this kind of stuff.
> 
> Please take this opportunity to use it.

In fact, nevermind.  I'll do it from here.

Applied, thanks.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 0/7] Menelaus cleanup for DT, phase 1
       [not found] ` <1419702779-16001-1-git-send-email-aaro.koskinen-X3B1VOXEql0@public.gmane.org>
  2014-12-27 17:52   ` [PATCH 4/7] ARM: OMAP: N8x0: configure menelaus using DT Aaro Koskinen
@ 2015-01-20 17:13   ` Lee Jones
  1 sibling, 0 replies; 18+ messages in thread
From: Lee Jones @ 2015-01-20 17:13 UTC (permalink / raw)
  To: Aaro Koskinen
  Cc: Tony Lindgren, Samuel Ortiz, devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-omap-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Sat, 27 Dec 2014, Aaro Koskinen wrote:
> These patches start removal of board-specific callbacks from Menelaus:
> delete platform data and a callback from the driver to the board files.
> 
> Tested on top of 3.19-rc1 on N800/N810 which are the only in-tree users
> for the driver.
> 
> Aaro Koskinen (7):
>   mfd: menelaus: delete omap_has_menelaus
>   mfd: menelaus: drop support for SW controller VCORE
>   mfd: menelaus: add initial DT support
>   ARM: OMAP: N8x0: configure menelaus using DT
>   mfd: menelaus: delete platform data support
>   mfd: menelaus: make vcore and regulator controls internal
>   mfd: menelaus: use macro for magic number
> 
>  Documentation/devicetree/bindings/mfd/menelaus.txt | 30 ++++++++
>  arch/arm/boot/dts/omap2420-n8x0-common.dtsi        |  3 +
>  arch/arm/mach-omap2/board-n8x0.c                   | 57 --------------
>  arch/arm/mach-omap2/common-board-devices.h         |  2 -
>  arch/arm/mach-omap2/pdata-quirks.c                 |  1 -
>  drivers/mfd/menelaus.c                             | 86 ++++++++++++++--------
>  include/linux/mfd/menelaus.h                       | 25 -------
>  7 files changed, 87 insertions(+), 117 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/mfd/menelaus.txt

Scrap that.  Looks like I can't apply the other patches without
03/07.  Please sort this out with Felipe and re-submit.  Don't forget
to apply my Ack to the patches I said I "applied".

-- 
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 majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2015-01-20 17:13 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-27 17:52 [PATCH 0/7] Menelaus cleanup for DT, phase 1 Aaro Koskinen
2014-12-27 17:52 ` [PATCH 1/7] mfd: menelaus: delete omap_has_menelaus Aaro Koskinen
2015-01-20 13:50   ` Lee Jones
2014-12-27 17:52 ` [PATCH 2/7] mfd: menelaus: drop support for SW controller VCORE Aaro Koskinen
2015-01-20 13:52   ` Lee Jones
2014-12-27 17:52 ` [PATCH 3/7] mfd: menelaus: add initial DT support Aaro Koskinen
2014-12-27 21:25   ` Felipe Balbi
2014-12-28 23:34     ` Aaro Koskinen
2014-12-29 18:12       ` Felipe Balbi
2014-12-27 17:52 ` [PATCH 5/7] mfd: menelaus: delete platform data support Aaro Koskinen
2015-01-20 13:54   ` Lee Jones
2014-12-27 17:52 ` [PATCH 6/7] mfd: menelaus: make vcore and regulator controls internal Aaro Koskinen
2015-01-20 13:58   ` Lee Jones
2015-01-20 14:01     ` Lee Jones
2014-12-27 17:52 ` [PATCH 7/7] mfd: menelaus: use macro for magic number Aaro Koskinen
     [not found]   ` <1419702779-16001-8-git-send-email-aaro.koskinen-X3B1VOXEql0@public.gmane.org>
2015-01-20 14:01     ` Lee Jones
     [not found] ` <1419702779-16001-1-git-send-email-aaro.koskinen-X3B1VOXEql0@public.gmane.org>
2014-12-27 17:52   ` [PATCH 4/7] ARM: OMAP: N8x0: configure menelaus using DT Aaro Koskinen
2015-01-20 17:13   ` [PATCH 0/7] Menelaus cleanup for DT, phase 1 Lee Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).