Linux on ARM based TI OMAP SoCs
 help / color / mirror / Atom feed
* Re: [PATCH 0/4] musb fixes for v4.9-rc cycle
From: Tomi Valkeinen @ 2016-11-23 10:14 UTC (permalink / raw)
  To: Laurent Pinchart, Tony Lindgren
  Cc: Bin Liu, Boris Brezillon, Greg Kroah-Hartman, Andreas Kemnade,
	Felipe Balbi, Kishon Vijay Abraham I, Ivaylo Dimitrov,
	Johan Hovold, Ladislav Michl, Sergei Shtylyov,
	linux-usb-u79uwXL29TY76Z2rM5mHXA,
	linux-omap-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1557347.d3YjqqaO81@avalon>


[-- Attachment #1.1: Type: text/plain, Size: 637 bytes --]

On 10/11/16 23:25, Laurent Pinchart wrote:

>>>> [    2.766174] musb_bus_suspend 2586: trying to suspend as a_idle while
>>>> active
>>>>
>>>> printed in a loop at boot time. I've traced musb->is_active being set to
>>>> 1 in musb_start() with

> Actually disabling CONFIG_USB_MUSB_HDRC gets rid of the problem, quite 
> understandably. It's not a fix though, just a workaround. Are you interested 
> in investigating this ?

I'm seeing this too. Did you manage to boot your Panda? If I disable
CONFIG_USB_MUSB_HDRC, I don't see that error print, but the ethernet
doesn't work, and so my nfsroot doesn't mount.

 Tomi


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

^ permalink raw reply

* Re: [PATCH] Input: twl4030-vibra: remove legacy pdata support
From: Nicolae Rosia @ 2016-11-23  9:59 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Peter Ujfalusi, Nicolae Rosia, Marek Belisko, Baruch Siach,
	linux-input, linux-omap, Tony Lindgren
In-Reply-To: <20161123013348.GB21078@dtor-ws>

Hi Dmitry,

On Wed, Nov 23, 2016 at 3:33 AM, Dmitry Torokhov
<dmitry.torokhov@gmail.com> wrote:
>> > -static bool twl4030_vibra_check_coexist(struct twl4030_vibra_data *pdata,
>> > -                         struct device_node *node)
>> > +static bool twl4030_vibra_check_coexist(struct device_node *node)
>> >  {
>> > -   if (pdata && pdata->coexist)
>> > -           return true;
>> > -
>> >     node = of_find_node_by_name(node, "codec");
>> >     if (node) {
>> >             of_node_put(node);
>
> Do we need this wrapper anymore?
>
I kept the original logic.
It seems that when there's also a "codec" DT entry, the logic is different.

>> > @@ -194,13 +190,12 @@ static bool twl4030_vibra_check_coexist(struct twl4030_vibra_data *pdata,
>> >
>> >  static int twl4030_vibra_probe(struct platform_device *pdev)
>> >  {
>> > -   struct twl4030_vibra_data *pdata = dev_get_platdata(&pdev->dev);
>
> Should we also remove twl4030_vibra_data definition?
>
Yes, but that is defined in include/linux/i2c/twl.h. Since I've sent
multiple cleanup patches regarding twl, I thought it would be wise to
wait until the next cycle to remove them all to avoid merge conflicts.
I don't know how I should go with this, since I could:
a) make another commit removing the pdata definition
b) include the pdata definition removal in this commit
c) wait until the next cycle

>> >     struct device_node *twl4030_core_node = pdev->dev.parent->of_node;
>> >     struct vibra_info *info;
>> >     int ret;
>> >
>> > -   if (!pdata && !twl4030_core_node) {
>> > -           dev_dbg(&pdev->dev, "platform_data not available\n");
>> > +   if (!twl4030_core_node) {
>> > +           dev_err(&pdev->dev, "no DT info\n\n");
>
> Why double newline?
This is a typo. Should I send v2 or you can modify it while applying?

Thanks,
Nicolae

^ permalink raw reply

* [PATCH] ARM: dts: am335x-baltos: use phy-phandle declarations
From: yegorslists @ 2016-11-23  9:52 UTC (permalink / raw)
  To: linux-omap; +Cc: tony, bcousson, linux-arm-kernel, Yegor Yefremov

From: Yegor Yefremov <yegorslists@googlemail.com>

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
---
 arch/arm/boot/dts/am335x-baltos-ir2110.dts | 10 ++++++++--
 arch/arm/boot/dts/am335x-baltos-ir3220.dts |  2 +-
 arch/arm/boot/dts/am335x-baltos-ir5221.dts |  2 +-
 arch/arm/boot/dts/am335x-baltos.dtsi       |  5 ++++-
 4 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/arch/arm/boot/dts/am335x-baltos-ir2110.dts b/arch/arm/boot/dts/am335x-baltos-ir2110.dts
index a9a9730..501c752 100644
--- a/arch/arm/boot/dts/am335x-baltos-ir2110.dts
+++ b/arch/arm/boot/dts/am335x-baltos-ir2110.dts
@@ -54,16 +54,22 @@
 	dr_mode = "host";
 };
 
+&davinci_mdio {
+	phy0: ethernet-phy@0 {
+		reg = <1>;
+	};
+};
+
 &cpsw_emac0 {
-	phy_id = <&davinci_mdio>, <1>;
 	phy-mode = "rmii";
 	dual_emac_res_vlan = <1>;
+	phy-handle = <&phy0>;
 };
 
 &cpsw_emac1 {
-	phy_id = <&davinci_mdio>, <7>;
 	phy-mode = "rgmii-txid";
 	dual_emac_res_vlan = <2>;
+	phy-handle = <&phy1>;
 };
 
 &phy_sel {
diff --git a/arch/arm/boot/dts/am335x-baltos-ir3220.dts b/arch/arm/boot/dts/am335x-baltos-ir3220.dts
index fe002a1..19f53b8 100644
--- a/arch/arm/boot/dts/am335x-baltos-ir3220.dts
+++ b/arch/arm/boot/dts/am335x-baltos-ir3220.dts
@@ -109,9 +109,9 @@
 };
 
 &cpsw_emac1 {
-	phy_id = <&davinci_mdio>, <7>;
 	phy-mode = "rgmii-txid";
 	dual_emac_res_vlan = <2>;
+	phy-handle = <&phy1>;
 };
 
 &phy_sel {
diff --git a/arch/arm/boot/dts/am335x-baltos-ir5221.dts b/arch/arm/boot/dts/am335x-baltos-ir5221.dts
index f599350..2b9d7f4 100644
--- a/arch/arm/boot/dts/am335x-baltos-ir5221.dts
+++ b/arch/arm/boot/dts/am335x-baltos-ir5221.dts
@@ -127,9 +127,9 @@
 };
 
 &cpsw_emac1 {
-	phy_id = <&davinci_mdio>, <7>;
 	phy-mode = "rgmii-txid";
 	dual_emac_res_vlan = <2>;
+	phy-handle = <&phy1>;
 };
 
 &phy_sel {
diff --git a/arch/arm/boot/dts/am335x-baltos.dtsi b/arch/arm/boot/dts/am335x-baltos.dtsi
index 09b9541..efb5eae 100644
--- a/arch/arm/boot/dts/am335x-baltos.dtsi
+++ b/arch/arm/boot/dts/am335x-baltos.dtsi
@@ -364,11 +364,14 @@
 };
 
 &davinci_mdio {
+	status = "okay";
 	pinctrl-names = "default", "sleep";
 	pinctrl-0 = <&davinci_mdio_default>;
 	pinctrl-1 = <&davinci_mdio_sleep>;
 
-	status = "okay";
+	phy1: ethernet-phy@1 {
+		reg = <7>;
+	};
 };
 
 &mmc1 {
-- 
2.1.4

^ permalink raw reply related

* [PATCH] dmaengine: edma: re-initialize dummy slot during system resume
From: Vignesh R @ 2016-11-23  9:27 UTC (permalink / raw)
  To: Vinod Koul
  Cc: dmaengine, linux-kernel, Vignesh R, Peter Ujfalusi, linux-omap,
	Sekhar Nori

The last param set in a transfer should always be pointing to dummy
param set in non-cyclic mode. When system wakes from low power state
EDMA PARAM slots may be reset to random values. Hence, re-initialize
dummy slot to dummy param set on system resume.

Signed-off-by: Vignesh R <vigneshr@ti.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
 drivers/dma/edma.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/dma/edma.c b/drivers/dma/edma.c
index 77242b37ef87..3879f80a4815 100644
--- a/drivers/dma/edma.c
+++ b/drivers/dma/edma.c
@@ -2451,6 +2451,9 @@ static int edma_pm_resume(struct device *dev)
 	int i;
 	s8 (*queue_priority_mapping)[2];
 
+	/* re initialize dummy slot to dummy param set */
+	edma_write_slot(ecc, ecc->dummy_slot, &dummy_paramset);
+
 	queue_priority_mapping = ecc->info->queue_priority_mapping;
 
 	/* Event queue priority mapping */
-- 
2.10.2

^ permalink raw reply related

* Re: [PATCH 1/3] rtc: rtc-twl: kill static variables
From: Nicolae Rosia @ 2016-11-23  8:57 UTC (permalink / raw)
  To: Alexandre Belloni
  Cc: Nicolae Rosia, Alessandro Zummo, rtc-linux-/JYPxA39Uh5TLH3MbocFFw,
	linux-omap-u79uwXL29TY76Z2rM5mHXA, Tony Lindgren
In-Reply-To: <20161123084657.or53k7tlyjxcmrr2-m++hUPXGwpdeoWH0uzbU5w@public.gmane.org>

Hi,

On Wed, Nov 23, 2016 at 10:46 AM, Alexandre Belloni
<alexandre.belloni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org> wrote:
>> Ok, could you please indicate which lines so I can fix them instead of
>> wasting your time?
>>
>
> checkpatch.pl --strict will find them for you
Thanks, I had the wrong tab setting.

-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply

* [PATCH v2 2/2] rtc: rtc-twl: make driver DT only
From: Nicolae Rosia @ 2016-11-23  8:55 UTC (permalink / raw)
  To: Alexandre Belloni
  Cc: Alessandro Zummo, rtc-linux-/JYPxA39Uh5TLH3MbocFFw,
	linux-omap-u79uwXL29TY76Z2rM5mHXA, Tony Lindgren, Nicolae Rosia
In-Reply-To: <20161123085557.5656-1-Nicolae_Rosia-nmGgyN9QBj3QT0dZR+AlfA@public.gmane.org>

Since there are no platform based users and all users
of this code are TI OMAP-based which is DT only, it makes
sense to remove unused code.

Signed-off-by: Nicolae Rosia <Nicolae_Rosia-nmGgyN9QBj3QT0dZR+AlfA@public.gmane.org>
---
 drivers/rtc/Kconfig   |  1 +
 drivers/rtc/rtc-twl.c | 12 +++++++-----
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig
index e859d14..2189216 100644
--- a/drivers/rtc/Kconfig
+++ b/drivers/rtc/Kconfig
@@ -481,6 +481,7 @@ config RTC_DRV_TWL92330
 config RTC_DRV_TWL4030
 	tristate "TI TWL4030/TWL5030/TWL6030/TPS659x0"
 	depends on TWL4030_CORE
+	depends on OF
 	help
 	  If you say yes here you get support for the RTC on the
 	  TWL4030/TWL5030/TWL6030 family chips, used mostly with OMAP3 platforms.
diff --git a/drivers/rtc/rtc-twl.c b/drivers/rtc/rtc-twl.c
index 1e41526..c18c392 100644
--- a/drivers/rtc/rtc-twl.c
+++ b/drivers/rtc/rtc-twl.c
@@ -496,10 +496,16 @@ static const struct rtc_class_ops twl_rtc_ops = {
 static int twl_rtc_probe(struct platform_device *pdev)
 {
 	struct twl_rtc *twl_rtc;
+	struct device_node *np = pdev->dev.of_node;
 	int ret = -EINVAL;
 	int irq = platform_get_irq(pdev, 0);
 	u8 rd_reg;
 
+	if (!np) {
+		dev_err(&pdev->dev, "no DT info\n");
+		return -EINVAL;
+	}
+
 	if (irq <= 0)
 		return ret;
 
@@ -632,15 +638,11 @@ static int twl_rtc_resume(struct device *dev)
 
 static SIMPLE_DEV_PM_OPS(twl_rtc_pm_ops, twl_rtc_suspend, twl_rtc_resume);
 
-#ifdef CONFIG_OF
 static const struct of_device_id twl_rtc_of_match[] = {
 	{.compatible = "ti,twl4030-rtc", },
 	{ },
 };
 MODULE_DEVICE_TABLE(of, twl_rtc_of_match);
-#endif
-
-MODULE_ALIAS("platform:twl_rtc");
 
 static struct platform_driver twl4030rtc_driver = {
 	.probe		= twl_rtc_probe,
@@ -649,7 +651,7 @@ static struct platform_driver twl4030rtc_driver = {
 	.driver		= {
 		.name		= "twl_rtc",
 		.pm		= &twl_rtc_pm_ops,
-		.of_match_table = of_match_ptr(twl_rtc_of_match),
+		.of_match_table = twl_rtc_of_match,
 	},
 };
 
-- 
2.9.3

-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply related

* [PATCH v2 1/2] rtc: rtc-twl: kill static variables
From: Nicolae Rosia @ 2016-11-23  8:55 UTC (permalink / raw)
  To: Alexandre Belloni
  Cc: Alessandro Zummo, rtc-linux-/JYPxA39Uh5TLH3MbocFFw,
	linux-omap-u79uwXL29TY76Z2rM5mHXA, Tony Lindgren, Nicolae Rosia
In-Reply-To: <20161123085557.5656-1-Nicolae_Rosia-nmGgyN9QBj3QT0dZR+AlfA@public.gmane.org>

The current code uses static variables which prevent
the use of multiple rtc twl instances.
We also make it clear that this driver supports only
TWL4030 and TWL6030 classes.

Signed-off-by: Nicolae Rosia <Nicolae_Rosia-nmGgyN9QBj3QT0dZR+AlfA@public.gmane.org>
---
 drivers/rtc/rtc-twl.c | 190 ++++++++++++++++++++++++++++++--------------------
 1 file changed, 114 insertions(+), 76 deletions(-)

diff --git a/drivers/rtc/rtc-twl.c b/drivers/rtc/rtc-twl.c
index 176720b..1e41526 100644
--- a/drivers/rtc/rtc-twl.c
+++ b/drivers/rtc/rtc-twl.c
@@ -33,6 +33,10 @@
 
 #include <linux/i2c/twl.h>
 
+enum twl_class {
+	TWL_4030 = 0,
+	TWL_6030,
+};
 
 /*
  * RTC block register offsets (use TWL_MODULE_RTC)
@@ -136,16 +140,30 @@ static const u8 twl6030_rtc_reg_map[] = {
 #define ALL_TIME_REGS		6
 
 /*----------------------------------------------------------------------*/
-static u8  *rtc_reg_map;
+struct twl_rtc {
+	struct device *dev;
+	struct rtc_device *rtc;
+	u8 *reg_map;
+	/*
+	 * Cache the value for timer/alarm interrupts register; this is
+	 * only changed by callers holding rtc ops lock (or resume).
+	 */
+	unsigned char rtc_irq_bits;
+	bool wake_enabled;
+#ifdef CONFIG_PM_SLEEP
+	unsigned char irqstat;
+#endif
+	enum twl_class class;
+};
 
 /*
  * Supports 1 byte read from TWL RTC register.
  */
-static int twl_rtc_read_u8(u8 *data, u8 reg)
+static int twl_rtc_read_u8(struct twl_rtc *twl_rtc, u8 *data, u8 reg)
 {
 	int ret;
 
-	ret = twl_i2c_read_u8(TWL_MODULE_RTC, data, (rtc_reg_map[reg]));
+	ret = twl_i2c_read_u8(TWL_MODULE_RTC, data, (twl_rtc->reg_map[reg]));
 	if (ret < 0)
 		pr_err("Could not read TWL register %X - error %d\n", reg, ret);
 	return ret;
@@ -154,11 +172,11 @@ static int twl_rtc_read_u8(u8 *data, u8 reg)
 /*
  * Supports 1 byte write to TWL RTC registers.
  */
-static int twl_rtc_write_u8(u8 data, u8 reg)
+static int twl_rtc_write_u8(struct twl_rtc *twl_rtc, u8 data, u8 reg)
 {
 	int ret;
 
-	ret = twl_i2c_write_u8(TWL_MODULE_RTC, data, (rtc_reg_map[reg]));
+	ret = twl_i2c_write_u8(TWL_MODULE_RTC, data, (twl_rtc->reg_map[reg]));
 	if (ret < 0)
 		pr_err("Could not write TWL register %X - error %d\n",
 		       reg, ret);
@@ -166,28 +184,22 @@ static int twl_rtc_write_u8(u8 data, u8 reg)
 }
 
 /*
- * Cache the value for timer/alarm interrupts register; this is
- * only changed by callers holding rtc ops lock (or resume).
- */
-static unsigned char rtc_irq_bits;
-
-/*
  * Enable 1/second update and/or alarm interrupts.
  */
-static int set_rtc_irq_bit(unsigned char bit)
+static int set_rtc_irq_bit(struct twl_rtc *twl_rtc, unsigned char bit)
 {
 	unsigned char val;
 	int ret;
 
 	/* if the bit is set, return from here */
-	if (rtc_irq_bits & bit)
+	if (twl_rtc->rtc_irq_bits & bit)
 		return 0;
 
-	val = rtc_irq_bits | bit;
+	val = twl_rtc->rtc_irq_bits | bit;
 	val &= ~BIT_RTC_INTERRUPTS_REG_EVERY_M;
-	ret = twl_rtc_write_u8(val, REG_RTC_INTERRUPTS_REG);
+	ret = twl_rtc_write_u8(twl_rtc, val, REG_RTC_INTERRUPTS_REG);
 	if (ret == 0)
-		rtc_irq_bits = val;
+		twl_rtc->rtc_irq_bits = val;
 
 	return ret;
 }
@@ -195,19 +207,19 @@ static int set_rtc_irq_bit(unsigned char bit)
 /*
  * Disable update and/or alarm interrupts.
  */
-static int mask_rtc_irq_bit(unsigned char bit)
+static int mask_rtc_irq_bit(struct twl_rtc *twl_rtc, unsigned char bit)
 {
 	unsigned char val;
 	int ret;
 
 	/* if the bit is clear, return from here */
-	if (!(rtc_irq_bits & bit))
+	if (!(twl_rtc->rtc_irq_bits & bit))
 		return 0;
 
-	val = rtc_irq_bits & ~bit;
-	ret = twl_rtc_write_u8(val, REG_RTC_INTERRUPTS_REG);
+	val = twl_rtc->rtc_irq_bits & ~bit;
+	ret = twl_rtc_write_u8(twl_rtc, val, REG_RTC_INTERRUPTS_REG);
 	if (ret == 0)
-		rtc_irq_bits = val;
+		twl_rtc->rtc_irq_bits = val;
 
 	return ret;
 }
@@ -215,21 +227,23 @@ static int mask_rtc_irq_bit(unsigned char bit)
 static int twl_rtc_alarm_irq_enable(struct device *dev, unsigned enabled)
 {
 	struct platform_device *pdev = to_platform_device(dev);
+	struct twl_rtc *twl_rtc = dev_get_drvdata(dev);
 	int irq = platform_get_irq(pdev, 0);
-	static bool twl_rtc_wake_enabled;
 	int ret;
 
 	if (enabled) {
-		ret = set_rtc_irq_bit(BIT_RTC_INTERRUPTS_REG_IT_ALARM_M);
-		if (device_can_wakeup(dev) && !twl_rtc_wake_enabled) {
+		ret = set_rtc_irq_bit(twl_rtc,
+				      BIT_RTC_INTERRUPTS_REG_IT_ALARM_M);
+		if (device_can_wakeup(dev) && !twl_rtc->wake_enabled) {
 			enable_irq_wake(irq);
-			twl_rtc_wake_enabled = true;
+			twl_rtc->wake_enabled = true;
 		}
 	} else {
-		ret = mask_rtc_irq_bit(BIT_RTC_INTERRUPTS_REG_IT_ALARM_M);
-		if (twl_rtc_wake_enabled) {
+		ret = mask_rtc_irq_bit(twl_rtc,
+				       BIT_RTC_INTERRUPTS_REG_IT_ALARM_M);
+		if (twl_rtc->wake_enabled) {
 			disable_irq_wake(irq);
-			twl_rtc_wake_enabled = false;
+			twl_rtc->wake_enabled = false;
 		}
 	}
 
@@ -247,21 +261,23 @@ static int twl_rtc_alarm_irq_enable(struct device *dev, unsigned enabled)
  */
 static int twl_rtc_read_time(struct device *dev, struct rtc_time *tm)
 {
+	struct twl_rtc *twl_rtc = dev_get_drvdata(dev);
 	unsigned char rtc_data[ALL_TIME_REGS];
 	int ret;
 	u8 save_control;
 	u8 rtc_control;
 
-	ret = twl_rtc_read_u8(&save_control, REG_RTC_CTRL_REG);
+	ret = twl_rtc_read_u8(twl_rtc, &save_control, REG_RTC_CTRL_REG);
 	if (ret < 0) {
 		dev_err(dev, "%s: reading CTRL_REG, error %d\n", __func__, ret);
 		return ret;
 	}
 	/* for twl6030/32 make sure BIT_RTC_CTRL_REG_GET_TIME_M is clear */
-	if (twl_class_is_6030()) {
+	if (twl_rtc->class == TWL_6030) {
 		if (save_control & BIT_RTC_CTRL_REG_GET_TIME_M) {
 			save_control &= ~BIT_RTC_CTRL_REG_GET_TIME_M;
-			ret = twl_rtc_write_u8(save_control, REG_RTC_CTRL_REG);
+			ret = twl_rtc_write_u8(twl_rtc, save_control,
+					       REG_RTC_CTRL_REG);
 			if (ret < 0) {
 				dev_err(dev, "%s clr GET_TIME, error %d\n",
 					__func__, ret);
@@ -274,17 +290,17 @@ static int twl_rtc_read_time(struct device *dev, struct rtc_time *tm)
 	rtc_control = save_control | BIT_RTC_CTRL_REG_GET_TIME_M;
 
 	/* for twl6030/32 enable read access to static shadowed registers */
-	if (twl_class_is_6030())
+	if (twl_rtc->class == TWL_6030)
 		rtc_control |= BIT_RTC_CTRL_REG_RTC_V_OPT;
 
-	ret = twl_rtc_write_u8(rtc_control, REG_RTC_CTRL_REG);
+	ret = twl_rtc_write_u8(twl_rtc, rtc_control, REG_RTC_CTRL_REG);
 	if (ret < 0) {
 		dev_err(dev, "%s: writing CTRL_REG, error %d\n", __func__, ret);
 		return ret;
 	}
 
 	ret = twl_i2c_read(TWL_MODULE_RTC, rtc_data,
-			(rtc_reg_map[REG_SECONDS_REG]), ALL_TIME_REGS);
+			(twl_rtc->reg_map[REG_SECONDS_REG]), ALL_TIME_REGS);
 
 	if (ret < 0) {
 		dev_err(dev, "%s: reading data, error %d\n", __func__, ret);
@@ -292,8 +308,8 @@ static int twl_rtc_read_time(struct device *dev, struct rtc_time *tm)
 	}
 
 	/* for twl6030 restore original state of rtc control register */
-	if (twl_class_is_6030()) {
-		ret = twl_rtc_write_u8(save_control, REG_RTC_CTRL_REG);
+	if (twl_rtc->class == TWL_6030) {
+		ret = twl_rtc_write_u8(twl_rtc, save_control, REG_RTC_CTRL_REG);
 		if (ret < 0) {
 			dev_err(dev, "%s: restore CTRL_REG, error %d\n",
 				__func__, ret);
@@ -313,6 +329,7 @@ static int twl_rtc_read_time(struct device *dev, struct rtc_time *tm)
 
 static int twl_rtc_set_time(struct device *dev, struct rtc_time *tm)
 {
+	struct twl_rtc *twl_rtc = dev_get_drvdata(dev);
 	unsigned char save_control;
 	unsigned char rtc_data[ALL_TIME_REGS];
 	int ret;
@@ -325,18 +342,18 @@ static int twl_rtc_set_time(struct device *dev, struct rtc_time *tm)
 	rtc_data[5] = bin2bcd(tm->tm_year - 100);
 
 	/* Stop RTC while updating the TC registers */
-	ret = twl_rtc_read_u8(&save_control, REG_RTC_CTRL_REG);
+	ret = twl_rtc_read_u8(twl_rtc, &save_control, REG_RTC_CTRL_REG);
 	if (ret < 0)
 		goto out;
 
 	save_control &= ~BIT_RTC_CTRL_REG_STOP_RTC_M;
-	ret = twl_rtc_write_u8(save_control, REG_RTC_CTRL_REG);
+	ret = twl_rtc_write_u8(twl_rtc, save_control, REG_RTC_CTRL_REG);
 	if (ret < 0)
 		goto out;
 
 	/* update all the time registers in one shot */
 	ret = twl_i2c_write(TWL_MODULE_RTC, rtc_data,
-		(rtc_reg_map[REG_SECONDS_REG]), ALL_TIME_REGS);
+		(twl_rtc->reg_map[REG_SECONDS_REG]), ALL_TIME_REGS);
 	if (ret < 0) {
 		dev_err(dev, "rtc_set_time error %d\n", ret);
 		goto out;
@@ -344,7 +361,7 @@ static int twl_rtc_set_time(struct device *dev, struct rtc_time *tm)
 
 	/* Start back RTC */
 	save_control |= BIT_RTC_CTRL_REG_STOP_RTC_M;
-	ret = twl_rtc_write_u8(save_control, REG_RTC_CTRL_REG);
+	ret = twl_rtc_write_u8(twl_rtc, save_control, REG_RTC_CTRL_REG);
 
 out:
 	return ret;
@@ -355,11 +372,12 @@ static int twl_rtc_set_time(struct device *dev, struct rtc_time *tm)
  */
 static int twl_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alm)
 {
+	struct twl_rtc *twl_rtc = dev_get_drvdata(dev);
 	unsigned char rtc_data[ALL_TIME_REGS];
 	int ret;
 
 	ret = twl_i2c_read(TWL_MODULE_RTC, rtc_data,
-			(rtc_reg_map[REG_ALARM_SECONDS_REG]), ALL_TIME_REGS);
+			twl_rtc->reg_map[REG_ALARM_SECONDS_REG], ALL_TIME_REGS);
 	if (ret < 0) {
 		dev_err(dev, "rtc_read_alarm error %d\n", ret);
 		return ret;
@@ -374,7 +392,7 @@ static int twl_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alm)
 	alm->time.tm_year = bcd2bin(rtc_data[5]) + 100;
 
 	/* report cached alarm enable state */
-	if (rtc_irq_bits & BIT_RTC_INTERRUPTS_REG_IT_ALARM_M)
+	if (twl_rtc->rtc_irq_bits & BIT_RTC_INTERRUPTS_REG_IT_ALARM_M)
 		alm->enabled = 1;
 
 	return ret;
@@ -382,6 +400,8 @@ static int twl_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alm)
 
 static int twl_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alm)
 {
+	struct twl_rtc *twl_rtc = dev_get_drvdata(dev);
+
 	unsigned char alarm_data[ALL_TIME_REGS];
 	int ret;
 
@@ -398,7 +418,7 @@ static int twl_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alm)
 
 	/* update all the alarm registers in one shot */
 	ret = twl_i2c_write(TWL_MODULE_RTC, alarm_data,
-		(rtc_reg_map[REG_ALARM_SECONDS_REG]), ALL_TIME_REGS);
+			twl_rtc->reg_map[REG_ALARM_SECONDS_REG], ALL_TIME_REGS);
 	if (ret) {
 		dev_err(dev, "rtc_set_alarm error %d\n", ret);
 		goto out;
@@ -410,14 +430,15 @@ static int twl_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alm)
 	return ret;
 }
 
-static irqreturn_t twl_rtc_interrupt(int irq, void *rtc)
+static irqreturn_t twl_rtc_interrupt(int irq, void *data)
 {
+	struct twl_rtc *twl_rtc = data;
 	unsigned long events;
 	int ret = IRQ_NONE;
 	int res;
 	u8 rd_reg;
 
-	res = twl_rtc_read_u8(&rd_reg, REG_RTC_STATUS_REG);
+	res = twl_rtc_read_u8(twl_rtc, &rd_reg, REG_RTC_STATUS_REG);
 	if (res)
 		goto out;
 	/*
@@ -431,12 +452,12 @@ static irqreturn_t twl_rtc_interrupt(int irq, void *rtc)
 	else
 		events = RTC_IRQF | RTC_PF;
 
-	res = twl_rtc_write_u8(BIT_RTC_STATUS_REG_ALARM_M,
-				   REG_RTC_STATUS_REG);
+	res = twl_rtc_write_u8(twl_rtc, BIT_RTC_STATUS_REG_ALARM_M,
+			       REG_RTC_STATUS_REG);
 	if (res)
 		goto out;
 
-	if (twl_class_is_4030()) {
+	if (twl_rtc->class == TWL_4030) {
 		/* Clear on Read enabled. RTC_IT bit of TWL4030_INT_PWR_ISR1
 		 * needs 2 reads to clear the interrupt. One read is done in
 		 * do_twl_pwrirq(). Doing the second read, to clear
@@ -455,7 +476,7 @@ static irqreturn_t twl_rtc_interrupt(int irq, void *rtc)
 	}
 
 	/* Notify RTC core on event */
-	rtc_update_irq(rtc, 1, events);
+	rtc_update_irq(twl_rtc->rtc, 1, events);
 
 	ret = IRQ_HANDLED;
 out:
@@ -474,7 +495,7 @@ static const struct rtc_class_ops twl_rtc_ops = {
 
 static int twl_rtc_probe(struct platform_device *pdev)
 {
-	struct rtc_device *rtc;
+	struct twl_rtc *twl_rtc;
 	int ret = -EINVAL;
 	int irq = platform_get_irq(pdev, 0);
 	u8 rd_reg;
@@ -482,13 +503,22 @@ static int twl_rtc_probe(struct platform_device *pdev)
 	if (irq <= 0)
 		return ret;
 
-	/* Initialize the register map */
-	if (twl_class_is_4030())
-		rtc_reg_map = (u8 *)twl4030_rtc_reg_map;
-	else
-		rtc_reg_map = (u8 *)twl6030_rtc_reg_map;
+	twl_rtc = devm_kzalloc(&pdev->dev, sizeof(*twl_rtc), GFP_KERNEL);
+	if (!twl_rtc)
+		return -ENOMEM;
+
+	if (twl_class_is_4030()) {
+		twl_rtc->class = TWL_4030;
+		twl_rtc->reg_map = (u8 *)twl4030_rtc_reg_map;
+	} else if (twl_class_is_6030()) {
+		twl_rtc->class = TWL_6030;
+		twl_rtc->reg_map = (u8 *)twl6030_rtc_reg_map;
+	} else {
+		dev_err(&pdev->dev, "TWL Class not supported.\n");
+		return -EINVAL;
+	}
 
-	ret = twl_rtc_read_u8(&rd_reg, REG_RTC_STATUS_REG);
+	ret = twl_rtc_read_u8(twl_rtc, &rd_reg, REG_RTC_STATUS_REG);
 	if (ret < 0)
 		return ret;
 
@@ -499,11 +529,11 @@ static int twl_rtc_probe(struct platform_device *pdev)
 		dev_warn(&pdev->dev, "Pending Alarm interrupt detected.\n");
 
 	/* Clear RTC Power up reset and pending alarm interrupts */
-	ret = twl_rtc_write_u8(rd_reg, REG_RTC_STATUS_REG);
+	ret = twl_rtc_write_u8(twl_rtc, rd_reg, REG_RTC_STATUS_REG);
 	if (ret < 0)
 		return ret;
 
-	if (twl_class_is_6030()) {
+	if (twl_rtc->class == TWL_6030) {
 		twl6030_interrupt_unmask(TWL6030_RTC_INT_MASK,
 			REG_INT_MSK_LINE_A);
 		twl6030_interrupt_unmask(TWL6030_RTC_INT_MASK,
@@ -511,40 +541,42 @@ static int twl_rtc_probe(struct platform_device *pdev)
 	}
 
 	dev_info(&pdev->dev, "Enabling TWL-RTC\n");
-	ret = twl_rtc_write_u8(BIT_RTC_CTRL_REG_STOP_RTC_M, REG_RTC_CTRL_REG);
+	ret = twl_rtc_write_u8(twl_rtc, BIT_RTC_CTRL_REG_STOP_RTC_M,
+			       REG_RTC_CTRL_REG);
 	if (ret < 0)
 		return ret;
 
 	/* ensure interrupts are disabled, bootloaders can be strange */
-	ret = twl_rtc_write_u8(0, REG_RTC_INTERRUPTS_REG);
+	ret = twl_rtc_write_u8(twl_rtc, 0, REG_RTC_INTERRUPTS_REG);
 	if (ret < 0)
 		dev_warn(&pdev->dev, "unable to disable interrupt\n");
 
 	/* init cached IRQ enable bits */
-	ret = twl_rtc_read_u8(&rtc_irq_bits, REG_RTC_INTERRUPTS_REG);
+	ret = twl_rtc_read_u8(twl_rtc, &twl_rtc->rtc_irq_bits,
+			      REG_RTC_INTERRUPTS_REG);
 	if (ret < 0)
 		return ret;
 
+	platform_set_drvdata(pdev, twl_rtc);
 	device_init_wakeup(&pdev->dev, 1);
 
-	rtc = devm_rtc_device_register(&pdev->dev, pdev->name,
+	twl_rtc->rtc = devm_rtc_device_register(&pdev->dev, pdev->name,
 					&twl_rtc_ops, THIS_MODULE);
-	if (IS_ERR(rtc)) {
+	if (IS_ERR(twl_rtc->rtc)) {
 		dev_err(&pdev->dev, "can't register RTC device, err %ld\n",
-			PTR_ERR(rtc));
-		return PTR_ERR(rtc);
+			PTR_ERR(twl_rtc->rtc));
+		return PTR_ERR(twl_rtc->rtc);
 	}
 
 	ret = devm_request_threaded_irq(&pdev->dev, irq, NULL,
 					twl_rtc_interrupt,
 					IRQF_TRIGGER_RISING | IRQF_ONESHOT,
-					dev_name(&rtc->dev), rtc);
+					dev_name(&twl_rtc->rtc->dev), twl_rtc);
 	if (ret < 0) {
 		dev_err(&pdev->dev, "IRQ is not free.\n");
 		return ret;
 	}
 
-	platform_set_drvdata(pdev, rtc);
 	return 0;
 }
 
@@ -554,10 +586,12 @@ static int twl_rtc_probe(struct platform_device *pdev)
  */
 static int twl_rtc_remove(struct platform_device *pdev)
 {
+	struct twl_rtc *twl_rtc = platform_get_drvdata(pdev);
+
 	/* leave rtc running, but disable irqs */
-	mask_rtc_irq_bit(BIT_RTC_INTERRUPTS_REG_IT_ALARM_M);
-	mask_rtc_irq_bit(BIT_RTC_INTERRUPTS_REG_IT_TIMER_M);
-	if (twl_class_is_6030()) {
+	mask_rtc_irq_bit(twl_rtc, BIT_RTC_INTERRUPTS_REG_IT_ALARM_M);
+	mask_rtc_irq_bit(twl_rtc, BIT_RTC_INTERRUPTS_REG_IT_TIMER_M);
+	if (twl_rtc->class == TWL_6030) {
 		twl6030_interrupt_mask(TWL6030_RTC_INT_MASK,
 			REG_INT_MSK_LINE_A);
 		twl6030_interrupt_mask(TWL6030_RTC_INT_MASK,
@@ -569,25 +603,29 @@ static int twl_rtc_remove(struct platform_device *pdev)
 
 static void twl_rtc_shutdown(struct platform_device *pdev)
 {
+	struct twl_rtc *twl_rtc = platform_get_drvdata(pdev);
+
 	/* mask timer interrupts, but leave alarm interrupts on to enable
 	   power-on when alarm is triggered */
-	mask_rtc_irq_bit(BIT_RTC_INTERRUPTS_REG_IT_TIMER_M);
+	mask_rtc_irq_bit(twl_rtc, BIT_RTC_INTERRUPTS_REG_IT_TIMER_M);
 }
 
 #ifdef CONFIG_PM_SLEEP
-static unsigned char irqstat;
-
 static int twl_rtc_suspend(struct device *dev)
 {
-	irqstat = rtc_irq_bits;
+	struct twl_rtc *twl_rtc = dev_get_drvdata(dev);
 
-	mask_rtc_irq_bit(BIT_RTC_INTERRUPTS_REG_IT_TIMER_M);
+	twl_rtc->irqstat = twl_rtc->rtc_irq_bits;
+
+	mask_rtc_irq_bit(twl_rtc, BIT_RTC_INTERRUPTS_REG_IT_TIMER_M);
 	return 0;
 }
 
 static int twl_rtc_resume(struct device *dev)
 {
-	set_rtc_irq_bit(irqstat);
+	struct twl_rtc *twl_rtc = dev_get_drvdata(dev);
+
+	set_rtc_irq_bit(twl_rtc, twl_rtc->irqstat);
 	return 0;
 }
 #endif
-- 
2.9.3

-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply related

* [PATCH v2 0/2] rtc: rtc-twl: cleanup
From: Nicolae Rosia @ 2016-11-23  8:55 UTC (permalink / raw)
  To: Alexandre Belloni
  Cc: Alessandro Zummo, rtc-linux-/JYPxA39Uh5TLH3MbocFFw,
	linux-omap-u79uwXL29TY76Z2rM5mHXA, Tony Lindgren, Nicolae Rosia

This is a cleanup and preparation of rtc-twl to reduce the usage of
twl-core exported functions.
The next patch series will further reduce the usage of exported functions
but first it requires some changes in mfd/twl-core.c

v2:
- dropped patch "rtc: rtc-twl: use irq_of_parse_and_map helper"
- fixed style problems
- retained old logic of checking TWL class by introducing an enum
- dropped of_match_ptr since we depend on OF

v1 was Tested-by: Tony Lindgren <tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
I did not add it in new version of patches because of the changes.
If you consider that the changes are not big, you could add Tony's Tested-by.

Nicolae Rosia (2):
  rtc: rtc-twl: kill static variables
  rtc: rtc-twl: make driver DT only

 drivers/rtc/Kconfig   |   1 +
 drivers/rtc/rtc-twl.c | 202 ++++++++++++++++++++++++++++++--------------------
 2 files changed, 122 insertions(+), 81 deletions(-)

-- 
2.9.3

-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply

* Re: [PATCH 1/3] rtc: rtc-twl: kill static variables
From: Alexandre Belloni @ 2016-11-23  8:46 UTC (permalink / raw)
  To: Nicolae Rosia
  Cc: Nicolae Rosia, Alessandro Zummo, rtc-linux-/JYPxA39Uh5TLH3MbocFFw,
	linux-omap-u79uwXL29TY76Z2rM5mHXA, Tony Lindgren
In-Reply-To: <CAKP5S=0vLb+7az4aaFyPjGSEE5cG+epM2qpGP=zpzhvt6x69qA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On 23/11/2016 at 10:39:12 +0200, Nicolae Rosia wrote :
> Hi,
> Thanks for the review.
> 
> On Wed, Nov 23, 2016 at 12:31 AM, Alexandre Belloni
> <alexandre.belloni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org> wrote:
> > Hi,
> >
> > A few alignments are off but I can fix that provided you answer the
> > question below:
> >
> Ok, could you please indicate which lines so I can fix them instead of
> wasting your time?
> 

checkpatch.pl --strict will find them for you

> > On 12/11/2016 at 12:07:24 +0200, Nicolae Rosia wrote :
> >>       /* for twl6030/32 make sure BIT_RTC_CTRL_REG_GET_TIME_M is clear */
> >> -     if (twl_class_is_6030()) {
> >> +     if (!twl_rtc->is_4030) {
> >
> > This changes the meaning of it. What if at some point there is a new
> > part that is neither a 4030 nor an 6030?
> > That will probably mean going over ths part of code again but maybe the
> > odds are low and nobody cares.
> Since there are only two classes, 4030 and 6030, it will work.
> But you're right, it's better to retain the old logic so the changes
> are minimal.
> 
> Will send V2 in a bit.

Thanks

> 
> Thanks,
> Nicolae

-- 
Alexandre Belloni, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply

* Re: [PATCH 2/3] rtc: rtc-twl: make driver DT only
From: Nicolae Rosia @ 2016-11-23  8:40 UTC (permalink / raw)
  To: Alexandre Belloni
  Cc: Nicolae Rosia, Alessandro Zummo, rtc-linux-/JYPxA39Uh5TLH3MbocFFw,
	linux-omap-u79uwXL29TY76Z2rM5mHXA, Tony Lindgren
In-Reply-To: <20161122223300.3mgdlvrkhwcasthe-m++hUPXGwpdeoWH0uzbU5w@public.gmane.org>

Hi,

On Wed, Nov 23, 2016 at 12:33 AM, Alexandre Belloni
<alexandre.belloni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org> wrote:
>>  static struct platform_driver twl4030rtc_driver = {
>>       .probe          = twl_rtc_probe,
>
>
> You can then get rid of of_match_ptr()
>
Sure, doing it in v2.

-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply

* Re: [PATCH 1/3] rtc: rtc-twl: kill static variables
From: Nicolae Rosia @ 2016-11-23  8:39 UTC (permalink / raw)
  To: Alexandre Belloni
  Cc: Nicolae Rosia, Alessandro Zummo, rtc-linux-/JYPxA39Uh5TLH3MbocFFw,
	linux-omap-u79uwXL29TY76Z2rM5mHXA, Tony Lindgren
In-Reply-To: <20161122223103.qd44b3z5aj4ahroi-m++hUPXGwpdeoWH0uzbU5w@public.gmane.org>

Hi,
Thanks for the review.

On Wed, Nov 23, 2016 at 12:31 AM, Alexandre Belloni
<alexandre.belloni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org> wrote:
> Hi,
>
> A few alignments are off but I can fix that provided you answer the
> question below:
>
Ok, could you please indicate which lines so I can fix them instead of
wasting your time?

> On 12/11/2016 at 12:07:24 +0200, Nicolae Rosia wrote :
>>       /* for twl6030/32 make sure BIT_RTC_CTRL_REG_GET_TIME_M is clear */
>> -     if (twl_class_is_6030()) {
>> +     if (!twl_rtc->is_4030) {
>
> This changes the meaning of it. What if at some point there is a new
> part that is neither a 4030 nor an 6030?
> That will probably mean going over ths part of code again but maybe the
> odds are low and nobody cares.
Since there are only two classes, 4030 and 6030, it will work.
But you're right, it's better to retain the old logic so the changes
are minimal.

Will send V2 in a bit.

Thanks,
Nicolae

-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply

* Re: [PATCH v2 4/5] arm: dts: am57xx-beagle-x15-common: Add overide powerhold property
From: Lee Jones @ 2016-11-23  8:33 UTC (permalink / raw)
  To: Keerthy
  Cc: Tony Lindgren, robh+dt, linux-omap, linux-kernel, devicetree,
	linux-gpio, nm, t-kristo
In-Reply-To: <6ac3b28e-4891-83bc-a2f7-c903541acc18@ti.com>

On Wed, 23 Nov 2016, Keerthy wrote:

> 
> 
> On Tuesday 15 November 2016 05:38 AM, Tony Lindgren wrote:
> > * Keerthy <j-keerthy@ti.com> [161109 21:10]:
> > > The PMICs have POWERHOLD set by default which prevents PMIC shutdown
> > > even on DEV_CTRL On bit set to 0 as the Powerhold has higher priority.
> > > So to enable pmic power off this property lets one over ride the default
> > > value and enable pmic power off.
> > 
> > This should not cause merge conflicts so probably best to merge along
> > with the driver changes:
> > 
> > Acked-by: Tony Lindgren <tony@atomide.com>
> > 
> > If you guys want me to pick up this separately let me know.
> 
> Hi Lee Jones,
> 
> Are you planning to pull DT and Documentation patches as well?

No need.  They can be safely applied to their own subsystems.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply

* Re: [PATCH v2 4/5] arm: dts: am57xx-beagle-x15-common: Add overide powerhold property
From: Keerthy @ 2016-11-23  8:32 UTC (permalink / raw)
  To: Lee Jones, Tony Lindgren
  Cc: robh+dt, linux-omap, linux-kernel, devicetree, linux-gpio, nm,
	t-kristo
In-Reply-To: <20161123083327.GM10134@dell.home>



On Wednesday 23 November 2016 02:03 PM, Lee Jones wrote:
> On Wed, 23 Nov 2016, Keerthy wrote:
>
>>
>>
>> On Tuesday 15 November 2016 05:38 AM, Tony Lindgren wrote:
>>> * Keerthy <j-keerthy@ti.com> [161109 21:10]:
>>>> The PMICs have POWERHOLD set by default which prevents PMIC shutdown
>>>> even on DEV_CTRL On bit set to 0 as the Powerhold has higher priority.
>>>> So to enable pmic power off this property lets one over ride the default
>>>> value and enable pmic power off.
>>>
>>> This should not cause merge conflicts so probably best to merge along
>>> with the driver changes:
>>>
>>> Acked-by: Tony Lindgren <tony@atomide.com>
>>>
>>> If you guys want me to pick up this separately let me know.
>>
>> Hi Lee Jones,
>>
>> Are you planning to pull DT and Documentation patches as well?
>
> No need.  They can be safely applied to their own subsystems.

Okay. Thanks for the response.

Tony,

Hope you can pull the DT patches.

>

^ permalink raw reply

* Re: [PATCH v2 4/5] arm: dts: am57xx-beagle-x15-common: Add overide powerhold property
From: Keerthy @ 2016-11-23  3:35 UTC (permalink / raw)
  To: Tony Lindgren, lee.jones-QSEj5FYQhm4dnm+yROfE0A
  Cc: robh+dt-DgEjT+Ai2ygdnm+yROfE0A, linux-omap-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-gpio-u79uwXL29TY76Z2rM5mHXA, nm-l0cyMroinI0,
	t-kristo-l0cyMroinI0
In-Reply-To: <20161115000849.GD4082-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>



On Tuesday 15 November 2016 05:38 AM, Tony Lindgren wrote:
> * Keerthy <j-keerthy-l0cyMroinI0@public.gmane.org> [161109 21:10]:
>> The PMICs have POWERHOLD set by default which prevents PMIC shutdown
>> even on DEV_CTRL On bit set to 0 as the Powerhold has higher priority.
>> So to enable pmic power off this property lets one over ride the default
>> value and enable pmic power off.
>
> This should not cause merge conflicts so probably best to merge along
> with the driver changes:
>
> Acked-by: Tony Lindgren <tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
>
> If you guys want me to pick up this separately let me know.

Hi Lee Jones,

Are you planning to pull DT and Documentation patches as well?

Regards,
Keerthy
>
> Regards,
>
> Tony
>
--
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

* Re: [PATCH] Input: twl4030-vibra: remove legacy pdata support
From: Dmitry Torokhov @ 2016-11-23  1:33 UTC (permalink / raw)
  To: Peter Ujfalusi
  Cc: Nicolae Rosia, Marek Belisko, Baruch Siach, linux-input,
	linux-omap, Tony Lindgren
In-Reply-To: <d30d4cca-9fcf-befa-0389-1aafaef99ce8@ti.com>

On Tue, Nov 22, 2016 at 01:19:36PM +0200, Peter Ujfalusi wrote:
> 
> 
> On 11/22/2016 12:59 PM, Nicolae Rosia wrote:
> > Remove dead code since all users are device tree enabled.
> 
> Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
> 
> > Signed-off-by: Nicolae Rosia <Nicolae_Rosia@mentor.com>
> > ---
> >  drivers/input/misc/twl4030-vibra.c | 13 ++++---------
> >  1 file changed, 4 insertions(+), 9 deletions(-)
> > 
> > diff --git a/drivers/input/misc/twl4030-vibra.c b/drivers/input/misc/twl4030-vibra.c
> > index caa5a62..5acc241 100644
> > --- a/drivers/input/misc/twl4030-vibra.c
> > +++ b/drivers/input/misc/twl4030-vibra.c
> > @@ -177,12 +177,8 @@ static int __maybe_unused twl4030_vibra_resume(struct device *dev)
> >  static SIMPLE_DEV_PM_OPS(twl4030_vibra_pm_ops,
> >  			 twl4030_vibra_suspend, twl4030_vibra_resume);
> >  
> > -static bool twl4030_vibra_check_coexist(struct twl4030_vibra_data *pdata,
> > -			      struct device_node *node)
> > +static bool twl4030_vibra_check_coexist(struct device_node *node)
> >  {
> > -	if (pdata && pdata->coexist)
> > -		return true;
> > -
> >  	node = of_find_node_by_name(node, "codec");
> >  	if (node) {
> >  		of_node_put(node);

Do we need this wrapper anymore?

> > @@ -194,13 +190,12 @@ static bool twl4030_vibra_check_coexist(struct twl4030_vibra_data *pdata,
> >  
> >  static int twl4030_vibra_probe(struct platform_device *pdev)
> >  {
> > -	struct twl4030_vibra_data *pdata = dev_get_platdata(&pdev->dev);

Should we also remove twl4030_vibra_data definition?

> >  	struct device_node *twl4030_core_node = pdev->dev.parent->of_node;
> >  	struct vibra_info *info;
> >  	int ret;
> >  
> > -	if (!pdata && !twl4030_core_node) {
> > -		dev_dbg(&pdev->dev, "platform_data not available\n");
> > +	if (!twl4030_core_node) {
> > +		dev_err(&pdev->dev, "no DT info\n\n");

Why double newline?

> >  		return -EINVAL;
> >  	}
> >  
> > @@ -209,7 +204,7 @@ static int twl4030_vibra_probe(struct platform_device *pdev)
> >  		return -ENOMEM;
> >  
> >  	info->dev = &pdev->dev;
> > -	info->coexist = twl4030_vibra_check_coexist(pdata, twl4030_core_node);
> > +	info->coexist = twl4030_vibra_check_coexist(twl4030_core_node);
> >  	INIT_WORK(&info->play_work, vibra_play_work);
> >  
> >  	info->input_dev = devm_input_allocate_device(&pdev->dev);
> >

Thanks.

-- 
Dmitry

^ permalink raw reply

* Re: [PATCH 2/3] rtc: rtc-twl: make driver DT only
From: Alexandre Belloni @ 2016-11-22 22:33 UTC (permalink / raw)
  To: Nicolae Rosia
  Cc: Alessandro Zummo, rtc-linux-/JYPxA39Uh5TLH3MbocFFw,
	linux-omap-u79uwXL29TY76Z2rM5mHXA, Tony Lindgren
In-Reply-To: <1478945246-32056-3-git-send-email-Nicolae_Rosia-nmGgyN9QBj3QT0dZR+AlfA@public.gmane.org>

On 12/11/2016 at 12:07:25 +0200, Nicolae Rosia wrote :
> @@ -625,15 +631,11 @@ static int twl_rtc_resume(struct device *dev)
>  
>  static SIMPLE_DEV_PM_OPS(twl_rtc_pm_ops, twl_rtc_suspend, twl_rtc_resume);
>  
> -#ifdef CONFIG_OF
>  static const struct of_device_id twl_rtc_of_match[] = {
>  	{.compatible = "ti,twl4030-rtc", },
>  	{ },
>  };
>  MODULE_DEVICE_TABLE(of, twl_rtc_of_match);
> -#endif
> -
> -MODULE_ALIAS("platform:twl_rtc");
>  
>  static struct platform_driver twl4030rtc_driver = {
>  	.probe		= twl_rtc_probe,


You can then get rid of of_match_ptr()


-- 
Alexandre Belloni, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply

* Re: [PATCH 1/3] rtc: rtc-twl: kill static variables
From: Alexandre Belloni @ 2016-11-22 22:31 UTC (permalink / raw)
  To: Nicolae Rosia
  Cc: Alessandro Zummo, rtc-linux-/JYPxA39Uh5TLH3MbocFFw,
	linux-omap-u79uwXL29TY76Z2rM5mHXA, Tony Lindgren
In-Reply-To: <1478945246-32056-2-git-send-email-Nicolae_Rosia-nmGgyN9QBj3QT0dZR+AlfA@public.gmane.org>

Hi,

A few alignments are off but I can fix that provided you answer the
question below:

On 12/11/2016 at 12:07:24 +0200, Nicolae Rosia wrote :
>  	/* for twl6030/32 make sure BIT_RTC_CTRL_REG_GET_TIME_M is clear */
> -	if (twl_class_is_6030()) {
> +	if (!twl_rtc->is_4030) {

This changes the meaning of it. What if at some point there is a new
part that is neither a 4030 nor an 6030?
That will probably mean going over ths part of code again but maybe the
odds are low and nobody cares.


-- 
Alexandre Belloni, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply

* Re: [PATCH] dt-bindings: mfd: Improve readability for TPS65217 interrupt sources
From: Arnd Bergmann @ 2016-11-22 21:08 UTC (permalink / raw)
  To: Lee Jones
  Cc: Milo Kim, bcousson-rdvid1DuHRBWk0Htik3J/w, Tony Lindgren,
	linux-omap-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, Robert Nelson
In-Reply-To: <20161122160013.GH10134-Re9dqnLqz4GzQB+pC5nmwQ@public.gmane.org>

On Tuesday, November 22, 2016 4:00:13 PM CET Lee Jones wrote:
> > > diff --git a/include/dt-bindings/mfd/tps65217.h b/include/dt-bindings/mfd/tps65217.h
> > > index cafb9e6..0293fdd 100644
> > > --- a/include/dt-bindings/mfd/tps65217.h
> > > +++ b/include/dt-bindings/mfd/tps65217.h
> > > @@ -19,8 +19,8 @@
> > >  #ifndef __DT_BINDINGS_TPS65217_H__
> > >  #define __DT_BINDINGS_TPS65217_H__
> > >  
> > > -#define TPS65217_IRQ_USB   0
> > > -#define TPS65217_IRQ_AC            1
> > > -#define TPS65217_IRQ_PB            2
> > > +#define TPS65217_IRQ_USB_POWER             0       /* USB power state change */
> > > +#define TPS65217_IRQ_AC_POWER              1       /* AC power state change */
> > > +#define TPS65217_IRQ_PUSHBUTTON            2       /* Push button state change */
> > 
> > This changes the ABI.
> > 
> > It will require a DT Ack.
> 
> Tell a lie.  Sorry, I was getting false positives from my grep.  It
> looks like you use the same scheme from within include/linux.  I
> suggest that you probable don't want to do that.

Doing this change however would cause a bisection problem: you
can't rename just the constants in the header or just the driver
using those constants.

	Arnd
--
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

* Re: [PATCH] dt-bindings: mfd: Improve readability for TPS65217 interrupt sources
From: Lee Jones @ 2016-11-22 16:00 UTC (permalink / raw)
  To: Milo Kim
  Cc: bcousson-rdvid1DuHRBWk0Htik3J/w, Tony Lindgren,
	linux-omap-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, Robert Nelson
In-Reply-To: <20161122155759.GG10134-Re9dqnLqz4GzQB+pC5nmwQ@public.gmane.org>

On Tue, 22 Nov 2016, Lee Jones wrote:

> On Mon, 21 Nov 2016, Milo Kim wrote:
> 
> > AC and USB interrupts are related with external power input.
> > PB interrupt means push button pressed or released event.
> > Use better human readable definitions.
> > 
> > Signed-off-by: Milo Kim <woogyom.kim-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> > ---
> >  arch/arm/boot/dts/am335x-bone-common.dtsi | 4 ++--
> >  include/dt-bindings/mfd/tps65217.h        | 6 +++---
> >  2 files changed, 5 insertions(+), 5 deletions(-)
> > 
> > diff --git a/arch/arm/boot/dts/am335x-bone-common.dtsi b/arch/arm/boot/dts/am335x-bone-common.dtsi
> > index dc561d5..1848d58 100644
> > --- a/arch/arm/boot/dts/am335x-bone-common.dtsi
> > +++ b/arch/arm/boot/dts/am335x-bone-common.dtsi
> > @@ -319,13 +319,13 @@
> >  	ti,pmic-shutdown-controller;
> >  
> >  	charger {
> > -		interrupts = <TPS65217_IRQ_AC>, <TPS65217_IRQ_USB>;
> > +		interrupts = <TPS65217_IRQ_AC_POWER>, <TPS65217_IRQ_USB_POWER>;
> >  		interrupts-names = "AC", "USB";
> >  		status = "okay";
> >  	};
> >  
> >  	pwrbutton {
> > -		interrupts = <TPS65217_IRQ_PB>;
> > +		interrupts = <TPS65217_IRQ_PUSHBUTTON>;
> 
> Push button or power button?
> 
> >  		status = "okay";
> >  	};
> >  
> > diff --git a/include/dt-bindings/mfd/tps65217.h b/include/dt-bindings/mfd/tps65217.h
> > index cafb9e6..0293fdd 100644
> > --- a/include/dt-bindings/mfd/tps65217.h
> > +++ b/include/dt-bindings/mfd/tps65217.h
> > @@ -19,8 +19,8 @@
> >  #ifndef __DT_BINDINGS_TPS65217_H__
> >  #define __DT_BINDINGS_TPS65217_H__
> >  
> > -#define TPS65217_IRQ_USB	0
> > -#define TPS65217_IRQ_AC		1
> > -#define TPS65217_IRQ_PB		2
> > +#define TPS65217_IRQ_USB_POWER		0	/* USB power state change */
> > +#define TPS65217_IRQ_AC_POWER		1	/* AC power state change */
> > +#define TPS65217_IRQ_PUSHBUTTON		2	/* Push button state change */
> 
> This changes the ABI.
> 
> It will require a DT Ack.

Tell a lie.  Sorry, I was getting false positives from my grep.  It
looks like you use the same scheme from within include/linux.  I
suggest that you probable don't want to do that.

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

* Re: [PATCH] dt-bindings: mfd: Improve readability for TPS65217 interrupt sources
From: Lee Jones @ 2016-11-22 15:57 UTC (permalink / raw)
  To: Milo Kim
  Cc: bcousson, Tony Lindgren, linux-omap, devicetree, linux-arm-kernel,
	linux-kernel, Robert Nelson
In-Reply-To: <20161121131515.8040-1-woogyom.kim@gmail.com>

On Mon, 21 Nov 2016, Milo Kim wrote:

> AC and USB interrupts are related with external power input.
> PB interrupt means push button pressed or released event.
> Use better human readable definitions.
> 
> Signed-off-by: Milo Kim <woogyom.kim@gmail.com>
> ---
>  arch/arm/boot/dts/am335x-bone-common.dtsi | 4 ++--
>  include/dt-bindings/mfd/tps65217.h        | 6 +++---
>  2 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/am335x-bone-common.dtsi b/arch/arm/boot/dts/am335x-bone-common.dtsi
> index dc561d5..1848d58 100644
> --- a/arch/arm/boot/dts/am335x-bone-common.dtsi
> +++ b/arch/arm/boot/dts/am335x-bone-common.dtsi
> @@ -319,13 +319,13 @@
>  	ti,pmic-shutdown-controller;
>  
>  	charger {
> -		interrupts = <TPS65217_IRQ_AC>, <TPS65217_IRQ_USB>;
> +		interrupts = <TPS65217_IRQ_AC_POWER>, <TPS65217_IRQ_USB_POWER>;
>  		interrupts-names = "AC", "USB";
>  		status = "okay";
>  	};
>  
>  	pwrbutton {
> -		interrupts = <TPS65217_IRQ_PB>;
> +		interrupts = <TPS65217_IRQ_PUSHBUTTON>;

Push button or power button?

>  		status = "okay";
>  	};
>  
> diff --git a/include/dt-bindings/mfd/tps65217.h b/include/dt-bindings/mfd/tps65217.h
> index cafb9e6..0293fdd 100644
> --- a/include/dt-bindings/mfd/tps65217.h
> +++ b/include/dt-bindings/mfd/tps65217.h
> @@ -19,8 +19,8 @@
>  #ifndef __DT_BINDINGS_TPS65217_H__
>  #define __DT_BINDINGS_TPS65217_H__
>  
> -#define TPS65217_IRQ_USB	0
> -#define TPS65217_IRQ_AC		1
> -#define TPS65217_IRQ_PB		2
> +#define TPS65217_IRQ_USB_POWER		0	/* USB power state change */
> +#define TPS65217_IRQ_AC_POWER		1	/* AC power state change */
> +#define TPS65217_IRQ_PUSHBUTTON		2	/* Push button state change */

This changes the ABI.

It will require a DT Ack.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply

* Re: [PATCH 5/5] mfd: tps65217: Support an interrupt pin as the system wakeup
From: Lee Jones @ 2016-11-22 15:49 UTC (permalink / raw)
  To: Milo Kim; +Cc: Tony Lindgren, linux-omap, linux-kernel
In-Reply-To: <20161115130215.3301-6-woogyom.kim@gmail.com>

On Tue, 15 Nov 2016, Milo Kim wrote:

> TPS65217 INT pin is used for the system wakeup from suspend mode.
> This patch enables push button or charger input event as a wakeup source.
> 
> Signed-off-by: Milo Kim <woogyom.kim@gmail.com>
> ---
>  drivers/mfd/tps65217.c | 2 ++
>  1 file changed, 2 insertions(+)

Applied, thanks.

> diff --git a/drivers/mfd/tps65217.c b/drivers/mfd/tps65217.c
> index 7376090..f769c7d 100644
> --- a/drivers/mfd/tps65217.c
> +++ b/drivers/mfd/tps65217.c
> @@ -183,6 +183,8 @@ static int tps65217_irq_init(struct tps65217 *tps, int irq)
>  		return ret;
>  	}
>  
> +	enable_irq_wake(irq);
> +
>  	return 0;
>  }
>  

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply

* Re: [PATCH 4/5] mfd: tps65217: Make an interrupt handler simpler
From: Lee Jones @ 2016-11-22 15:48 UTC (permalink / raw)
  To: Milo Kim; +Cc: Tony Lindgren, linux-omap, linux-kernel
In-Reply-To: <20161115130215.3301-5-woogyom.kim@gmail.com>

On Tue, 15 Nov 2016, Milo Kim wrote:

> Rework the IRQ handler by using HW IRQ number and status bit.
> 
> Each HW IRQ number is matched with TPS65217 register layout[*].
> (USB IRQ number is 0, AC is 1, Push button is 2)
> 
> When an interrupt is enabled, mask bit should be cleared (unmasked).
> If an interrupt is disabled, then mask bit should be set (masked).
> This mask value is updated into the TPS65217 register in irq_sync_unlock().
> 
> Mask bit and interrupt status bit can be handled with HW IRQ number.
> Eventually, additional IRQ data, 'tps65217_irqs[]' and the function,
> 'irq_to_tps65217_irq()' are not necessary.
> 
> [*] TPS65217 interrupt register layout
> 
>  Bit7  6     5     4     3    2     1     0
> ----------------------------------------------
> | x | PBM | ACM | USBM | x | PBI | ACI | USBI
> 
> PBM:  Push button status change interrupt mask
> ACM:  AC interrupt mask
> USBM: USB power status change interrupt mask
> PBI:  Push button status change interrupt
> ACI:  AC power status change interrupt
> USBI: USB power status change interrupt
> x:    Not used
> 
> Signed-off-by: Milo Kim <woogyom.kim@gmail.com>
> ---
>  drivers/mfd/tps65217.c       | 44 +++++++++-----------------------------------
>  include/linux/mfd/tps65217.h |  1 +
>  2 files changed, 10 insertions(+), 35 deletions(-)

Applied, thanks.

> diff --git a/drivers/mfd/tps65217.c b/drivers/mfd/tps65217.c
> index 9d76de9..7376090 100644
> --- a/drivers/mfd/tps65217.c
> +++ b/drivers/mfd/tps65217.c
> @@ -42,26 +42,6 @@ static struct resource pb_resources[] = {
>  	DEFINE_RES_IRQ_NAMED(TPS65217_IRQ_PB, "PB"),
>  };
>  
> -struct tps65217_irq {
> -	int mask;
> -	int interrupt;
> -};
> -
> -static const struct tps65217_irq tps65217_irqs[] = {
> -	[TPS65217_IRQ_PB] = {
> -		.mask = TPS65217_INT_PBM,
> -		.interrupt = TPS65217_INT_PBI,
> -	},
> -	[TPS65217_IRQ_AC] = {
> -		.mask = TPS65217_INT_ACM,
> -		.interrupt = TPS65217_INT_ACI,
> -	},
> -	[TPS65217_IRQ_USB] = {
> -		.mask = TPS65217_INT_USBM,
> -		.interrupt = TPS65217_INT_USBI,
> -	},
> -};
> -
>  static void tps65217_irq_lock(struct irq_data *data)
>  {
>  	struct tps65217 *tps = irq_data_get_irq_chip_data(data);
> @@ -74,34 +54,28 @@ static void tps65217_irq_sync_unlock(struct irq_data *data)
>  	struct tps65217 *tps = irq_data_get_irq_chip_data(data);
>  	int ret;
>  
> -	ret = tps65217_reg_write(tps, TPS65217_REG_INT, tps->irq_mask,
> -				TPS65217_PROTECT_NONE);
> +	ret = tps65217_set_bits(tps, TPS65217_REG_INT, TPS65217_INT_MASK,
> +				tps->irq_mask, TPS65217_PROTECT_NONE);
>  	if (ret != 0)
>  		dev_err(tps->dev, "Failed to sync IRQ masks\n");
>  
>  	mutex_unlock(&tps->irq_lock);
>  }
>  
> -static inline const struct tps65217_irq *
> -irq_to_tps65217_irq(struct tps65217 *tps, struct irq_data *data)
> -{
> -	return &tps65217_irqs[data->hwirq];
> -}
> -
>  static void tps65217_irq_enable(struct irq_data *data)
>  {
>  	struct tps65217 *tps = irq_data_get_irq_chip_data(data);
> -	const struct tps65217_irq *irq_data = irq_to_tps65217_irq(tps, data);
> +	u8 mask = BIT(data->hwirq) << TPS65217_INT_SHIFT;
>  
> -	tps->irq_mask &= ~irq_data->mask;
> +	tps->irq_mask &= ~mask;
>  }
>  
>  static void tps65217_irq_disable(struct irq_data *data)
>  {
>  	struct tps65217 *tps = irq_data_get_irq_chip_data(data);
> -	const struct tps65217_irq *irq_data = irq_to_tps65217_irq(tps, data);
> +	u8 mask = BIT(data->hwirq) << TPS65217_INT_SHIFT;
>  
> -	tps->irq_mask |= irq_data->mask;
> +	tps->irq_mask |= mask;
>  }
>  
>  static struct irq_chip tps65217_irq_chip = {
> @@ -150,8 +124,8 @@ static irqreturn_t tps65217_irq_thread(int irq, void *data)
>  		return IRQ_NONE;
>  	}
>  
> -	for (i = 0; i < ARRAY_SIZE(tps65217_irqs); i++) {
> -		if (status & tps65217_irqs[i].interrupt) {
> +	for (i = 0; i < TPS65217_NUM_IRQ; i++) {
> +		if (status & BIT(i)) {
>  			handle_nested_irq(irq_find_mapping(tps->irq_domain, i));
>  			handled = true;
>  		}
> @@ -430,7 +404,7 @@ static int tps65217_remove(struct i2c_client *client)
>  	unsigned int virq;
>  	int i;
>  
> -	for (i = 0; i < ARRAY_SIZE(tps65217_irqs); i++) {
> +	for (i = 0; i < TPS65217_NUM_IRQ; i++) {
>  		virq = irq_find_mapping(tps->irq_domain, i);
>  		if (virq)
>  			irq_dispose_mapping(virq);
> diff --git a/include/linux/mfd/tps65217.h b/include/linux/mfd/tps65217.h
> index 35d8d64..eac2857 100644
> --- a/include/linux/mfd/tps65217.h
> +++ b/include/linux/mfd/tps65217.h
> @@ -79,6 +79,7 @@
>  #define TPS65217_INT_PBI		BIT(2)
>  #define TPS65217_INT_ACI		BIT(1)
>  #define TPS65217_INT_USBI		BIT(0)
> +#define TPS65217_INT_SHIFT		4
>  #define TPS65217_INT_MASK		(TPS65217_INT_PBM | TPS65217_INT_ACM | \
>  					TPS65217_INT_USBM)
>  

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply

* Re: [PATCH 3/5] mfd: tps65217: Update register interrupt mask bits instead of writing operation
From: Lee Jones @ 2016-11-22 15:46 UTC (permalink / raw)
  To: Milo Kim; +Cc: Tony Lindgren, linux-omap, linux-kernel
In-Reply-To: <20161115130215.3301-4-woogyom.kim@gmail.com>

On Tue, 15 Nov 2016, Milo Kim wrote:

> TPS65217 interrupt register includes read/writeable mask bits with
> read-only status bits. (bit 4, 5, 6 are R/W, bit 0, 1, 2 are RO)
> And reserved bit is not required.
> 
> Register update operation is preferred for disabling all interrupts during
> the device initialisation.
> 
> Signed-off-by: Milo Kim <woogyom.kim@gmail.com>
> ---
>  drivers/mfd/tps65217.c       | 7 +++----
>  include/linux/mfd/tps65217.h | 3 ++-
>  2 files changed, 5 insertions(+), 5 deletions(-)

Applied, thanks.

> diff --git a/drivers/mfd/tps65217.c b/drivers/mfd/tps65217.c
> index 77fb812..9d76de9 100644
> --- a/drivers/mfd/tps65217.c
> +++ b/drivers/mfd/tps65217.c
> @@ -189,10 +189,9 @@ static int tps65217_irq_init(struct tps65217 *tps, int irq)
>  	tps->irq = irq;
>  
>  	/* Mask all interrupt sources */
> -	tps->irq_mask = (TPS65217_INT_RESERVEDM | TPS65217_INT_PBM
> -			| TPS65217_INT_ACM | TPS65217_INT_USBM);
> -	tps65217_reg_write(tps, TPS65217_REG_INT, tps->irq_mask,
> -			TPS65217_PROTECT_NONE);
> +	tps->irq_mask = TPS65217_INT_MASK;
> +	tps65217_set_bits(tps, TPS65217_REG_INT, TPS65217_INT_MASK,
> +			  TPS65217_INT_MASK, TPS65217_PROTECT_NONE);
>  
>  	tps->irq_domain = irq_domain_add_linear(tps->dev->of_node,
>  		TPS65217_NUM_IRQ, &tps65217_irq_domain_ops, tps);
> diff --git a/include/linux/mfd/tps65217.h b/include/linux/mfd/tps65217.h
> index 3cbec4b..35d8d64 100644
> --- a/include/linux/mfd/tps65217.h
> +++ b/include/linux/mfd/tps65217.h
> @@ -73,13 +73,14 @@
>  #define TPS65217_PPATH_AC_CURRENT_MASK	0x0C
>  #define TPS65217_PPATH_USB_CURRENT_MASK	0x03
>  
> -#define TPS65217_INT_RESERVEDM		BIT(7)
>  #define TPS65217_INT_PBM		BIT(6)
>  #define TPS65217_INT_ACM		BIT(5)
>  #define TPS65217_INT_USBM		BIT(4)
>  #define TPS65217_INT_PBI		BIT(2)
>  #define TPS65217_INT_ACI		BIT(1)
>  #define TPS65217_INT_USBI		BIT(0)
> +#define TPS65217_INT_MASK		(TPS65217_INT_PBM | TPS65217_INT_ACM | \
> +					TPS65217_INT_USBM)
>  
>  #define TPS65217_CHGCONFIG0_TREG	BIT(7)
>  #define TPS65217_CHGCONFIG0_DPPM	BIT(6)

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply

* Re: [PATCH 2/5] mfd: tps65217: Specify the IRQ name
From: Lee Jones @ 2016-11-22 15:45 UTC (permalink / raw)
  To: Milo Kim; +Cc: Tony Lindgren, linux-omap, linux-kernel
In-Reply-To: <20161115130215.3301-3-woogyom.kim@gmail.com>

On Tue, 15 Nov 2016, Milo Kim wrote:

> TPS65217 MFD is an interrupt controller and MFD slave devices like
> tps65217-charger and tps65217-pwrbutton request an interrupt to handle
> each HW event.
> 
> Currently, TPS65217 IRQ name is not defined, so the result is as below.
> 
> root@arm:~# cat /proc/interrupts
> ...
> 182:          0      INTC   7 Level     tps65217-irq
> 183:          0         -   1 Edge      tps65217-charger
> 185:          0         -   2 Edge      tps65217_pwrbutton
> 
> This patch specifies the name of the interrupt controller.
> 
> 182:          0      INTC   7 Level     tps65217-irq
> 183:          0  tps65217   1 Edge      tps65217-charger
> 185:          0  tps65217   2 Edge      tps65217_pwrbutton
> 
> Signed-off-by: Milo Kim <woogyom.kim@gmail.com>
> ---
>  drivers/mfd/tps65217.c | 1 +
>  1 file changed, 1 insertion(+)

Applied, thanks.

> diff --git a/drivers/mfd/tps65217.c b/drivers/mfd/tps65217.c
> index df2e775..77fb812 100644
> --- a/drivers/mfd/tps65217.c
> +++ b/drivers/mfd/tps65217.c
> @@ -105,6 +105,7 @@ static void tps65217_irq_disable(struct irq_data *data)
>  }
>  
>  static struct irq_chip tps65217_irq_chip = {
> +	.name			= "tps65217",
>  	.irq_bus_lock		= tps65217_irq_lock,
>  	.irq_bus_sync_unlock	= tps65217_irq_sync_unlock,
>  	.irq_enable		= tps65217_irq_enable,

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply

* Re: [PATCH v2] ARM: dts: AM571x-IDK Initial Support
From: Rob Herring @ 2016-11-22 15:43 UTC (permalink / raw)
  To: Lokesh Vutla
  Cc: Linux OMAP Mailing List, Tony Lindgren, Tero Kristo, Sekhar Nori,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Linux ARM Mailing List, spatton-l0cyMroinI0, Dave Gerlach,
	Nishanth Menon
In-Reply-To: <20161122041732.8385-1-lokeshvutla-l0cyMroinI0@public.gmane.org>

On Mon, Nov 21, 2016 at 10:17 PM, Lokesh Vutla <lokeshvutla-l0cyMroinI0@public.gmane.org> wrote:
> From: Schuyler Patton <spatton-l0cyMroinI0@public.gmane.org>
>
> The AM571x-IDK board is a board based on TI's AM5718 SOC
> which has a single core 1.5GHz A15 processor. This board is a
> development platform for the Industrial market with:
> - 1GB of DDR3L
> - Dual 1Gbps Ethernet
> - HDMI,
> - PRU-ICSS
> - uSD
> - 16GB eMMC
> - CAN
> - RS-485
> - PCIe
> - USB3.0
> - Video Input Port
> - Industrial IO port and expansion connector
>
> The link to the data sheet and TRM can be found here:
>
> http://www.ti.com/product/AM5718
>
> Initial support is only for basic peripherals.
>
> Signed-off-by: Schuyler Patton <spatton-l0cyMroinI0@public.gmane.org>
> Signed-off-by: Nishanth Menon <nm-l0cyMroinI0@public.gmane.org>
> Signed-off-by: Dave Gerlach <d-gerlach-l0cyMroinI0@public.gmane.org>
> Signed-off-by: Lokesh Vutla <lokeshvutla-l0cyMroinI0@public.gmane.org>
> ---
> Cahnges since v1:
> - Dropped "ti,dra722", and "ti,dra72" from compatibles
> - Fixes few node names as suggested by Rob.
> Logs: http://pastebin.ubuntu.com/23515001/

Please add acks when posting new versions.

Rob
--
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


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox