linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RESEND PATCH v3 3/5] mfd: tps65090: Stop caching most registers
@ 2014-04-22 15:24 Doug Anderson
  2014-04-22 19:07 ` Mark Brown
  0 siblings, 1 reply; 7+ messages in thread
From: Doug Anderson @ 2014-04-22 15:24 UTC (permalink / raw)
  To: Anton Vorontsov
  Cc: olof, Sachin Kamat, ajaykumar.rs, linux-samsung-soc, broonie,
	Doug Anderson, sameo, lee.jones, Dmitry Eremin-Solenikov, dwmw2,
	linux-kernel

Nearly all of the registers in tps65090 combine control bits and
status bits.  Turn off caching of all registers except the select few
that can be cached.

In order to avoid adding more duplicate #defines, we also move some
register offset definitions to the mfd driver (and resolve
inconsistent names).

Signed-off-by: Doug Anderson <dianders@chromium.org>
Acked-by: Lee Jones <lee.jones@linaro.org>
---
Changes in v3: None
Changes in v2:
- Leave cache on for the registers that can be cached.
- Move register offsets to mfd header file.

 drivers/mfd/tps65090.c           | 27 ++++++++++++++-------------
 drivers/power/tps65090-charger.c | 11 -----------
 include/linux/mfd/tps65090.h     | 14 ++++++++++++++
 3 files changed, 28 insertions(+), 24 deletions(-)

diff --git a/drivers/mfd/tps65090.c b/drivers/mfd/tps65090.c
index c3cddb4..1c3e6e2 100644
--- a/drivers/mfd/tps65090.c
+++ b/drivers/mfd/tps65090.c
@@ -32,14 +32,6 @@
 #define NUM_INT_REG 2
 #define TOTAL_NUM_REG 0x18
 
-/* interrupt status registers */
-#define TPS65090_INT_STS	0x0
-#define TPS65090_INT_STS2	0x1
-
-/* interrupt mask registers */
-#define TPS65090_INT_MSK	0x2
-#define TPS65090_INT_MSK2	0x3
-
 #define TPS65090_INT1_MASK_VAC_STATUS_CHANGE		1
 #define TPS65090_INT1_MASK_VSYS_STATUS_CHANGE		2
 #define TPS65090_INT1_MASK_BAT_STATUS_CHANGE		3
@@ -144,17 +136,26 @@ static struct regmap_irq_chip tps65090_irq_chip = {
 	.irqs = tps65090_irqs,
 	.num_irqs = ARRAY_SIZE(tps65090_irqs),
 	.num_regs = NUM_INT_REG,
-	.status_base = TPS65090_INT_STS,
-	.mask_base = TPS65090_INT_MSK,
+	.status_base = TPS65090_REG_INTR_STS,
+	.mask_base = TPS65090_REG_INTR_MASK,
 	.mask_invert = true,
 };
 
 static bool is_volatile_reg(struct device *dev, unsigned int reg)
 {
-	if ((reg == TPS65090_INT_STS) || (reg == TPS65090_INT_STS2))
-		return true;
-	else
+	/* Nearly all registers have status bits mixed in, except a few */
+	switch (reg) {
+	case TPS65090_REG_INTR_MASK:
+	case TPS65090_REG_INTR_MASK2:
+	case TPS65090_REG_CG_CTRL0:
+	case TPS65090_REG_CG_CTRL1:
+	case TPS65090_REG_CG_CTRL2:
+	case TPS65090_REG_CG_CTRL3:
+	case TPS65090_REG_CG_CTRL4:
+	case TPS65090_REG_CG_CTRL5:
 		return false;
+	}
+	return true;
 }
 
 static const struct regmap_config tps65090_regmap_config = {
diff --git a/drivers/power/tps65090-charger.c b/drivers/power/tps65090-charger.c
index cc26c12..31a3ba4 100644
--- a/drivers/power/tps65090-charger.c
+++ b/drivers/power/tps65090-charger.c
@@ -30,17 +30,6 @@
 
 #include <linux/mfd/tps65090.h>
 
-#define TPS65090_REG_INTR_STS	0x00
-#define TPS65090_REG_INTR_MASK	0x02
-#define TPS65090_REG_CG_CTRL0	0x04
-#define TPS65090_REG_CG_CTRL1	0x05
-#define TPS65090_REG_CG_CTRL2	0x06
-#define TPS65090_REG_CG_CTRL3	0x07
-#define TPS65090_REG_CG_CTRL4	0x08
-#define TPS65090_REG_CG_CTRL5	0x09
-#define TPS65090_REG_CG_STATUS1	0x0a
-#define TPS65090_REG_CG_STATUS2	0x0b
-
 #define TPS65090_CHARGER_ENABLE	BIT(0)
 #define TPS65090_VACG		BIT(1)
 #define TPS65090_NOITERM	BIT(5)
diff --git a/include/linux/mfd/tps65090.h b/include/linux/mfd/tps65090.h
index 3f43069..45f0f9d 100644
--- a/include/linux/mfd/tps65090.h
+++ b/include/linux/mfd/tps65090.h
@@ -64,6 +64,20 @@ enum {
 	TPS65090_REGULATOR_MAX,
 };
 
+/* Register addresses */
+#define TPS65090_REG_INTR_STS	0x00
+#define TPS65090_REG_INTR_STS2	0x01
+#define TPS65090_REG_INTR_MASK	0x02
+#define TPS65090_REG_INTR_MASK2	0x03
+#define TPS65090_REG_CG_CTRL0	0x04
+#define TPS65090_REG_CG_CTRL1	0x05
+#define TPS65090_REG_CG_CTRL2	0x06
+#define TPS65090_REG_CG_CTRL3	0x07
+#define TPS65090_REG_CG_CTRL4	0x08
+#define TPS65090_REG_CG_CTRL5	0x09
+#define TPS65090_REG_CG_STATUS1	0x0a
+#define TPS65090_REG_CG_STATUS2	0x0b
+
 struct tps65090 {
 	struct device		*dev;
 	struct regmap		*rmap;
-- 
1.9.1.423.g4596e3a


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

* Re: [RESEND PATCH v3 3/5] mfd: tps65090: Stop caching most registers
  2014-04-22 15:24 [RESEND PATCH v3 3/5] mfd: tps65090: Stop caching most registers Doug Anderson
@ 2014-04-22 19:07 ` Mark Brown
  2014-04-23 10:55   ` Lee Jones
  0 siblings, 1 reply; 7+ messages in thread
From: Mark Brown @ 2014-04-22 19:07 UTC (permalink / raw)
  To: Doug Anderson
  Cc: Anton Vorontsov, olof, Sachin Kamat, ajaykumar.rs,
	linux-samsung-soc, sameo, lee.jones, Dmitry Eremin-Solenikov,
	dwmw2, linux-kernel

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

On Tue, Apr 22, 2014 at 08:24:56AM -0700, Doug Anderson wrote:
> Nearly all of the registers in tps65090 combine control bits and
> status bits.  Turn off caching of all registers except the select few
> that can be cached.

Lee, I don't mind if I apply this and send a pull request to you or I
pull a tag from you with this in - what's easiest for you?

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

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

* Re: [RESEND PATCH v3 3/5] mfd: tps65090: Stop caching most registers
  2014-04-22 19:07 ` Mark Brown
@ 2014-04-23 10:55   ` Lee Jones
  2014-04-23 15:58     ` Doug Anderson
  0 siblings, 1 reply; 7+ messages in thread
From: Lee Jones @ 2014-04-23 10:55 UTC (permalink / raw)
  To: Mark Brown
  Cc: Doug Anderson, Anton Vorontsov, olof, Sachin Kamat, ajaykumar.rs,
	linux-samsung-soc, sameo, Dmitry Eremin-Solenikov, dwmw2,
	linux-kernel

> > Nearly all of the registers in tps65090 combine control bits and
> > status bits.  Turn off caching of all registers except the select few
> > that can be cached.
> 
> Lee, I don't mind if I apply this and send a pull request to you or I
> pull a tag from you with this in - what's easiest for you?

I'm happy to do it.

Doug,
  Can you send the patch-set again with all of the *-bys and ensure
  I'm on TO or CC please?

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

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

* Re: [RESEND PATCH v3 3/5] mfd: tps65090: Stop caching most registers
  2014-04-23 10:55   ` Lee Jones
@ 2014-04-23 15:58     ` Doug Anderson
  2014-04-28 11:57       ` Lee Jones
  0 siblings, 1 reply; 7+ messages in thread
From: Doug Anderson @ 2014-04-23 15:58 UTC (permalink / raw)
  To: Lee Jones
  Cc: Mark Brown, Anton Vorontsov, Olof Johansson, Sachin Kamat,
	AJAY KUMAR RAMAKRISHNA SHYMALAMMA, linux-samsung-soc,
	Samuel Ortiz, Dmitry Eremin-Solenikov, David Woodhouse,
	linux-kernel

Lee,

On Wed, Apr 23, 2014 at 3:55 AM, Lee Jones <lee.jones@linaro.org> wrote:
>> > Nearly all of the registers in tps65090 combine control bits and
>> > status bits.  Turn off caching of all registers except the select few
>> > that can be cached.
>>
>> Lee, I don't mind if I apply this and send a pull request to you or I
>> pull a tag from you with this in - what's easiest for you?
>
> I'm happy to do it.
>
> Doug,
>   Can you send the patch-set again with all of the *-bys and ensure
>   I'm on TO or CC please?

It looks as if you've already applied 1, 3, and 4.  I've sent up 2 and
5 again with collected tags.

https://patchwork.kernel.org/patch/4042761/
https://patchwork.kernel.org/patch/4042751/

-Doug

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

* Re: [RESEND PATCH v3 3/5] mfd: tps65090: Stop caching most registers
  2014-04-23 15:58     ` Doug Anderson
@ 2014-04-28 11:57       ` Lee Jones
  2014-04-28 16:36         ` Doug Anderson
  0 siblings, 1 reply; 7+ messages in thread
From: Lee Jones @ 2014-04-28 11:57 UTC (permalink / raw)
  To: Doug Anderson
  Cc: Mark Brown, Anton Vorontsov, Olof Johansson, Sachin Kamat,
	AJAY KUMAR RAMAKRISHNA SHYMALAMMA, linux-samsung-soc,
	Samuel Ortiz, Dmitry Eremin-Solenikov, David Woodhouse,
	linux-kernel

> >> > Nearly all of the registers in tps65090 combine control bits and
> >> > status bits.  Turn off caching of all registers except the select few
> >> > that can be cached.
> >>
> >> Lee, I don't mind if I apply this and send a pull request to you or I
> >> pull a tag from you with this in - what's easiest for you?
> >
> > I'm happy to do it.
> >
> > Doug,
> >   Can you send the patch-set again with all of the *-bys and ensure
> >   I'm on TO or CC please?
> 
> It looks as if you've already applied 1, 3, and 4.  I've sent up 2 and
> 5 again with collected tags.
> 
> https://patchwork.kernel.org/patch/4042761/
> https://patchwork.kernel.org/patch/4042751/

I think we have this sorted now. I sent a pull-request to Mark this
morning.

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

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

* Re: [RESEND PATCH v3 3/5] mfd: tps65090: Stop caching most registers
  2014-04-28 11:57       ` Lee Jones
@ 2014-04-28 16:36         ` Doug Anderson
  2014-04-29  8:26           ` Lee Jones
  0 siblings, 1 reply; 7+ messages in thread
From: Doug Anderson @ 2014-04-28 16:36 UTC (permalink / raw)
  To: Lee Jones
  Cc: Mark Brown, Anton Vorontsov, Olof Johansson, Sachin Kamat,
	AJAY KUMAR RAMAKRISHNA SHYMALAMMA, linux-samsung-soc,
	Samuel Ortiz, Dmitry Eremin-Solenikov, David Woodhouse,
	linux-kernel

Lee,

On Mon, Apr 28, 2014 at 4:57 AM, Lee Jones <lee.jones@linaro.org> wrote:
>> >> > Nearly all of the registers in tps65090 combine control bits and
>> >> > status bits.  Turn off caching of all registers except the select few
>> >> > that can be cached.
>> >>
>> >> Lee, I don't mind if I apply this and send a pull request to you or I
>> >> pull a tag from you with this in - what's easiest for you?
>> >
>> > I'm happy to do it.
>> >
>> > Doug,
>> >   Can you send the patch-set again with all of the *-bys and ensure
>> >   I'm on TO or CC please?
>>
>> It looks as if you've already applied 1, 3, and 4.  I've sent up 2 and
>> 5 again with collected tags.
>>
>> https://patchwork.kernel.org/patch/4042761/
>> https://patchwork.kernel.org/patch/4042751/
>
> I think we have this sorted now. I sent a pull-request to Mark this
> morning.

Thanks!  I'll keep an eye on linux-next to make sure everything is
there.  It sounds like the charger patch
<https://patchwork.kernel.org/patch/4042751/> wasn't picked up by
anyone.  I'll see if I can find someone to take that.  Luckily that
can be applied independently of everything else (it just won't fix
everything till all the patches are together).

-Doug

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

* Re: [RESEND PATCH v3 3/5] mfd: tps65090: Stop caching most registers
  2014-04-28 16:36         ` Doug Anderson
@ 2014-04-29  8:26           ` Lee Jones
  0 siblings, 0 replies; 7+ messages in thread
From: Lee Jones @ 2014-04-29  8:26 UTC (permalink / raw)
  To: Doug Anderson
  Cc: Mark Brown, Anton Vorontsov, Olof Johansson, Sachin Kamat,
	AJAY KUMAR RAMAKRISHNA SHYMALAMMA, linux-samsung-soc,
	Samuel Ortiz, Dmitry Eremin-Solenikov, David Woodhouse,
	linux-kernel

On Mon, 28 Apr 2014, Doug Anderson wrote:

> Lee,
> 
> On Mon, Apr 28, 2014 at 4:57 AM, Lee Jones <lee.jones@linaro.org> wrote:
> >> >> > Nearly all of the registers in tps65090 combine control bits and
> >> >> > status bits.  Turn off caching of all registers except the select few
> >> >> > that can be cached.
> >> >>
> >> >> Lee, I don't mind if I apply this and send a pull request to you or I
> >> >> pull a tag from you with this in - what's easiest for you?
> >> >
> >> > I'm happy to do it.
> >> >
> >> > Doug,
> >> >   Can you send the patch-set again with all of the *-bys and ensure
> >> >   I'm on TO or CC please?
> >>
> >> It looks as if you've already applied 1, 3, and 4.  I've sent up 2 and
> >> 5 again with collected tags.
> >>
> >> https://patchwork.kernel.org/patch/4042761/
> >> https://patchwork.kernel.org/patch/4042751/
> >
> > I think we have this sorted now. I sent a pull-request to Mark this
> > morning.
> 
> Thanks!  I'll keep an eye on linux-next to make sure everything is
> there.  It sounds like the charger patch
> <https://patchwork.kernel.org/patch/4042751/> wasn't picked up by
> anyone.  I'll see if I can find someone to take that.  Luckily that
> can be applied independently of everything else (it just won't fix
> everything till all the patches are together).

You still need an Ack from Anton before I can apply that.

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

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

end of thread, other threads:[~2014-04-29  8:27 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-22 15:24 [RESEND PATCH v3 3/5] mfd: tps65090: Stop caching most registers Doug Anderson
2014-04-22 19:07 ` Mark Brown
2014-04-23 10:55   ` Lee Jones
2014-04-23 15:58     ` Doug Anderson
2014-04-28 11:57       ` Lee Jones
2014-04-28 16:36         ` Doug Anderson
2014-04-29  8:26           ` 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).