linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] mfd: twl6040: Small clean-ups
@ 2014-02-25 13:28 Florian Vaussard
  2014-02-25 13:28 ` [PATCH 1/2] mfd: twl6040: Check for error when reading revision register Florian Vaussard
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Florian Vaussard @ 2014-02-25 13:28 UTC (permalink / raw)
  To: Samuel Ortiz, Lee Jones
  Cc: Peter Ujfalusi, linux-omap, linux-kernel, Florian Vaussard

Hi,

Here is two cleanups patches for the TWL6040 audio codec. The first
one checks for an error when reading the revision register (first read
in the probe path). The second removes a duplicate I2C writes.

Regards,
Florian

Florian Vaussard (2):
  mfd: twl6040: Check for error when reading revision register
  mfd: twl6040: Remove duplicate register write

 drivers/mfd/twl6040.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

-- 
1.8.1.2

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

* [PATCH 1/2] mfd: twl6040: Check for error when reading revision register
  2014-02-25 13:28 [PATCH 0/2] mfd: twl6040: Small clean-ups Florian Vaussard
@ 2014-02-25 13:28 ` Florian Vaussard
  2014-02-25 14:22   ` Lee Jones
  2014-02-25 13:28 ` [PATCH 2/2] mfd: twl6040: Remove duplicate register write Florian Vaussard
  2014-02-25 14:20 ` [PATCH 0/2] mfd: twl6040: Small clean-ups Peter Ujfalusi
  2 siblings, 1 reply; 8+ messages in thread
From: Florian Vaussard @ 2014-02-25 13:28 UTC (permalink / raw)
  To: Samuel Ortiz, Lee Jones
  Cc: Peter Ujfalusi, linux-omap, linux-kernel, Florian Vaussard

We may have an error when reading the revision register, so check for
the returned value.

Signed-off-by: Florian Vaussard <florian.vaussard@epfl.ch>
---
 drivers/mfd/twl6040.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/mfd/twl6040.c b/drivers/mfd/twl6040.c
index 32ce1ae..67e524e 100644
--- a/drivers/mfd/twl6040.c
+++ b/drivers/mfd/twl6040.c
@@ -661,6 +661,11 @@ static int twl6040_probe(struct i2c_client *client,
 	init_completion(&twl6040->ready);
 
 	twl6040->rev = twl6040_reg_read(twl6040, TWL6040_REG_ASICREV);
+	if (twl6040->rev < 0) {
+		dev_err(&client->dev, "Failed to read revision register: %d\n",
+			twl6040->rev);
+		goto gpio_err;
+	}
 
 	/* ERRATA: Automatic power-up is not possible in ES1.0 */
 	if (twl6040_get_revid(twl6040) > TWL6040_REV_ES1_0)
-- 
1.8.1.2

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

* [PATCH 2/2] mfd: twl6040: Remove duplicate register write
  2014-02-25 13:28 [PATCH 0/2] mfd: twl6040: Small clean-ups Florian Vaussard
  2014-02-25 13:28 ` [PATCH 1/2] mfd: twl6040: Check for error when reading revision register Florian Vaussard
@ 2014-02-25 13:28 ` Florian Vaussard
  2014-02-25 14:22   ` Lee Jones
  2014-02-25 14:20 ` [PATCH 0/2] mfd: twl6040: Small clean-ups Peter Ujfalusi
  2 siblings, 1 reply; 8+ messages in thread
From: Florian Vaussard @ 2014-02-25 13:28 UTC (permalink / raw)
  To: Samuel Ortiz, Lee Jones
  Cc: Peter Ujfalusi, linux-omap, linux-kernel, Florian Vaussard

When probing, regmap_register_patch() will bypass the cache and perform
i2c writes for the given patches. It is thus unnecessary to manually set
the TWL6040_REG_ACCCTL register just before, as it will be done when
registering the twl6040_patch.

Signed-off-by: Florian Vaussard <florian.vaussard@epfl.ch>
---
 drivers/mfd/twl6040.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/mfd/twl6040.c b/drivers/mfd/twl6040.c
index 67e524e..0bd5a18 100644
--- a/drivers/mfd/twl6040.c
+++ b/drivers/mfd/twl6040.c
@@ -710,7 +710,6 @@ static int twl6040_probe(struct i2c_client *client,
 	}
 
 	/* dual-access registers controlled by I2C only */
-	twl6040_set_bits(twl6040, TWL6040_REG_ACCCTL, TWL6040_I2CSEL);
 	regmap_register_patch(twl6040->regmap, twl6040_patch,
 			      ARRAY_SIZE(twl6040_patch));
 
-- 
1.8.1.2

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

* Re: [PATCH 0/2] mfd: twl6040: Small clean-ups
  2014-02-25 13:28 [PATCH 0/2] mfd: twl6040: Small clean-ups Florian Vaussard
  2014-02-25 13:28 ` [PATCH 1/2] mfd: twl6040: Check for error when reading revision register Florian Vaussard
  2014-02-25 13:28 ` [PATCH 2/2] mfd: twl6040: Remove duplicate register write Florian Vaussard
@ 2014-02-25 14:20 ` Peter Ujfalusi
  2014-02-25 14:27   ` Lee Jones
  2 siblings, 1 reply; 8+ messages in thread
From: Peter Ujfalusi @ 2014-02-25 14:20 UTC (permalink / raw)
  To: Florian Vaussard, Samuel Ortiz, Lee Jones; +Cc: linux-omap, linux-kernel

On 02/25/2014 03:28 PM, Florian Vaussard wrote:
> Hi,
> 
> Here is two cleanups patches for the TWL6040 audio codec. The first
> one checks for an error when reading the revision register (first read
> in the probe path). The second removes a duplicate I2C writes.
> 
> Regards,
> Florian

To both:
Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>

> 
> Florian Vaussard (2):
>   mfd: twl6040: Check for error when reading revision register
>   mfd: twl6040: Remove duplicate register write
> 
>  drivers/mfd/twl6040.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 


-- 
Péter
--
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] 8+ messages in thread

* Re: [PATCH 1/2] mfd: twl6040: Check for error when reading revision register
  2014-02-25 13:28 ` [PATCH 1/2] mfd: twl6040: Check for error when reading revision register Florian Vaussard
@ 2014-02-25 14:22   ` Lee Jones
  0 siblings, 0 replies; 8+ messages in thread
From: Lee Jones @ 2014-02-25 14:22 UTC (permalink / raw)
  To: Florian Vaussard; +Cc: Samuel Ortiz, Peter Ujfalusi, linux-omap, linux-kernel

> We may have an error when reading the revision register, so check for
> the returned value.
> 
> Signed-off-by: Florian Vaussard <florian.vaussard@epfl.ch>
> ---
>  drivers/mfd/twl6040.c | 5 +++++
>  1 file changed, 5 insertions(+)

Applied, thanks.

-- 
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] 8+ messages in thread

* Re: [PATCH 2/2] mfd: twl6040: Remove duplicate register write
  2014-02-25 13:28 ` [PATCH 2/2] mfd: twl6040: Remove duplicate register write Florian Vaussard
@ 2014-02-25 14:22   ` Lee Jones
  0 siblings, 0 replies; 8+ messages in thread
From: Lee Jones @ 2014-02-25 14:22 UTC (permalink / raw)
  To: Florian Vaussard; +Cc: Samuel Ortiz, Peter Ujfalusi, linux-omap, linux-kernel

> When probing, regmap_register_patch() will bypass the cache and perform
> i2c writes for the given patches. It is thus unnecessary to manually set
> the TWL6040_REG_ACCCTL register just before, as it will be done when
> registering the twl6040_patch.
> 
> Signed-off-by: Florian Vaussard <florian.vaussard@epfl.ch>
> ---
>  drivers/mfd/twl6040.c | 1 -
>  1 file changed, 1 deletion(-)

Applied, thanks.

-- 
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] 8+ messages in thread

* Re: [PATCH 0/2] mfd: twl6040: Small clean-ups
  2014-02-25 14:20 ` [PATCH 0/2] mfd: twl6040: Small clean-ups Peter Ujfalusi
@ 2014-02-25 14:27   ` Lee Jones
  2014-02-25 14:31     ` Florian Vaussard
  0 siblings, 1 reply; 8+ messages in thread
From: Lee Jones @ 2014-02-25 14:27 UTC (permalink / raw)
  To: Peter Ujfalusi; +Cc: Florian Vaussard, Samuel Ortiz, linux-omap, linux-kernel

> > Here is two cleanups patches for the TWL6040 audio codec. The first
> > one checks for an error when reading the revision register (first read
> > in the probe path). The second removes a duplicate I2C writes.
> > 
> > Regards,
> > Florian
> 
> To both:
> Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>

Applied both with Peter's Ack.

> > Florian Vaussard (2):
> >   mfd: twl6040: Check for error when reading revision register
> >   mfd: twl6040: Remove duplicate register write
> > 
> >  drivers/mfd/twl6040.c | 6 +++++-
> >  1 file changed, 5 insertions(+), 1 deletion(-)
> > 
> 
> 

-- 
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] 8+ messages in thread

* Re: [PATCH 0/2] mfd: twl6040: Small clean-ups
  2014-02-25 14:27   ` Lee Jones
@ 2014-02-25 14:31     ` Florian Vaussard
  0 siblings, 0 replies; 8+ messages in thread
From: Florian Vaussard @ 2014-02-25 14:31 UTC (permalink / raw)
  To: Lee Jones, Peter Ujfalusi; +Cc: Samuel Ortiz, linux-omap, linux-kernel


On 02/25/2014 03:27 PM, Lee Jones wrote:
>>> Here is two cleanups patches for the TWL6040 audio codec. The first
>>> one checks for an error when reading the revision register (first read
>>> in the probe path). The second removes a duplicate I2C writes.
>>>
>>> Regards,
>>> Florian
>>
>> To both:
>> Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
> 
> Applied both with Peter's Ack.
> 

Thanks!

Florian

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

end of thread, other threads:[~2014-02-25 14:31 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-25 13:28 [PATCH 0/2] mfd: twl6040: Small clean-ups Florian Vaussard
2014-02-25 13:28 ` [PATCH 1/2] mfd: twl6040: Check for error when reading revision register Florian Vaussard
2014-02-25 14:22   ` Lee Jones
2014-02-25 13:28 ` [PATCH 2/2] mfd: twl6040: Remove duplicate register write Florian Vaussard
2014-02-25 14:22   ` Lee Jones
2014-02-25 14:20 ` [PATCH 0/2] mfd: twl6040: Small clean-ups Peter Ujfalusi
2014-02-25 14:27   ` Lee Jones
2014-02-25 14:31     ` Florian Vaussard

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