LKML Archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] twl4030: Do not dereference null pointer in error path
@ 2009-09-30 15:11 Ilkka Koskinen
  2009-09-30 15:11 ` [PATCH 2/2] twl4030: Enable low-power mode to 32KHz oscillator Ilkka Koskinen
  2009-10-16 14:21 ` [PATCH 1/2] twl4030: Do not dereference null pointer in error path ilkka.koskinen
  0 siblings, 2 replies; 5+ messages in thread
From: Ilkka Koskinen @ 2009-09-30 15:11 UTC (permalink / raw
  To: linux-kernel, sameo; +Cc: linux-omap, ilkka.koskinen

Signed-off-by: Ilkka Koskinen <ilkka.koskinen@nokia.com>
---
 drivers/mfd/twl4030-core.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/mfd/twl4030-core.c b/drivers/mfd/twl4030-core.c
index e424cf6..8cf0a02 100644
--- a/drivers/mfd/twl4030-core.c
+++ b/drivers/mfd/twl4030-core.c
@@ -792,7 +792,7 @@ twl4030_probe(struct i2c_client *client, const struct i2c_device_id *id)
 			twl->client = i2c_new_dummy(client->adapter,
 					twl->address);
 			if (!twl->client) {
-				dev_err(&twl->client->dev,
+				dev_err(&client->dev,
 					"can't attach client %d\n", i);
 				status = -ENOMEM;
 				goto fail;
-- 
1.6.0.4


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

* [PATCH 2/2] twl4030: Enable low-power mode to 32KHz oscillator
  2009-09-30 15:11 [PATCH 1/2] twl4030: Do not dereference null pointer in error path Ilkka Koskinen
@ 2009-09-30 15:11 ` Ilkka Koskinen
  2009-10-16 14:21 ` [PATCH 1/2] twl4030: Do not dereference null pointer in error path ilkka.koskinen
  1 sibling, 0 replies; 5+ messages in thread
From: Ilkka Koskinen @ 2009-09-30 15:11 UTC (permalink / raw
  To: linux-kernel, sameo; +Cc: linux-omap, ilkka.koskinen

Allows TWL's 32KHz oscillator to go in low-power mode when
main battery voltage is running low.

Signed-off-by: Ilkka Koskinen <ilkka.koskinen@nokia.com>
---
 drivers/mfd/twl4030-core.c  |    9 +++++++--
 include/linux/i2c/twl4030.h |    5 +++++
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/drivers/mfd/twl4030-core.c b/drivers/mfd/twl4030-core.c
index 8cf0a02..5596bb4 100644
--- a/drivers/mfd/twl4030-core.c
+++ b/drivers/mfd/twl4030-core.c
@@ -177,6 +177,7 @@
 #define HFCLK_FREQ_26_MHZ		(2 << 0)
 #define HFCLK_FREQ_38p4_MHZ		(3 << 0)
 #define HIGH_PERF_SQ			(1 << 3)
+#define CK32K_LOWPWR_EN			(1 << 7)
 
 
 /* chip-specific feature flags, for i2c_device_id.driver_data */
@@ -678,7 +679,8 @@ static inline int __init unprotect_pm_master(void)
 	return e;
 }
 
-static void clocks_init(struct device *dev)
+static void clocks_init(struct device *dev,
+			struct twl4030_clock_init_data *clock)
 {
 	int e = 0;
 	struct clk *osc;
@@ -725,6 +727,9 @@ static void clocks_init(struct device *dev)
 	}
 
 	ctrl |= HIGH_PERF_SQ;
+	if (clock && clock->ck32k_lowpwr_enable)
+		ctrl |= CK32K_LOWPWR_EN;
+
 	e |= unprotect_pm_master();
 	/* effect->MADC+USB ck en */
 	e |= twl4030_i2c_write_u8(TWL4030_MODULE_PM_MASTER, ctrl, R_CFG_BOOT);
@@ -805,7 +810,7 @@ twl4030_probe(struct i2c_client *client, const struct i2c_device_id *id)
 	inuse = true;
 
 	/* setup clock framework */
-	clocks_init(&client->dev);
+	clocks_init(&client->dev, pdata->clock);
 
 	/* load power event scripts */
 	if (twl_has_power() && pdata->power)
diff --git a/include/linux/i2c/twl4030.h b/include/linux/i2c/twl4030.h
index 2d02dfd..612d0b7 100644
--- a/include/linux/i2c/twl4030.h
+++ b/include/linux/i2c/twl4030.h
@@ -312,6 +312,10 @@ int twl4030_i2c_read(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes);
 
 /*----------------------------------------------------------------------*/
 
+struct twl4030_clock_init_data {
+	int ck32k_lowpwr_enable;
+};
+
 struct twl4030_bci_platform_data {
 	int *battery_tmp_tbl;
 	unsigned int tblsize;
@@ -403,6 +407,7 @@ extern void twl4030_power_init(struct twl4030_power_data *triton2_scripts);
 
 struct twl4030_platform_data {
 	unsigned				irq_base, irq_end;
+	struct twl4030_clock_init_data		*clock;
 	struct twl4030_bci_platform_data	*bci;
 	struct twl4030_gpio_platform_data	*gpio;
 	struct twl4030_madc_platform_data	*madc;
-- 
1.6.0.4


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

* RE: [PATCH 1/2] twl4030: Do not dereference null pointer in error path
  2009-09-30 15:11 [PATCH 1/2] twl4030: Do not dereference null pointer in error path Ilkka Koskinen
  2009-09-30 15:11 ` [PATCH 2/2] twl4030: Enable low-power mode to 32KHz oscillator Ilkka Koskinen
@ 2009-10-16 14:21 ` ilkka.koskinen
  2009-10-19 15:52   ` Samuel Ortiz
  1 sibling, 1 reply; 5+ messages in thread
From: ilkka.koskinen @ 2009-10-16 14:21 UTC (permalink / raw
  To: sameo; +Cc: linux-omap, linux-kernel


Hi Samuel,

What is the status of this patch and the other one:
[PATCH 2/2] twl4030: Enable low-power mode to 32KHz oscillator

Cheers, Ilkka

>-----Original Message-----
>From: Koskinen Ilkka (Nokia-D/Tampere) 
>Sent: 30 September, 2009 18:12
>To: linux-kernel@vger.kernel.org; sameo@linux.intel.com
>Cc: linux-omap@vger.kernel.org; Koskinen Ilkka (Nokia-D/Tampere)
>Subject: [PATCH 1/2] twl4030: Do not dereference null pointer 
>in error path
>
>Signed-off-by: Ilkka Koskinen <ilkka.koskinen@nokia.com>
>---
> drivers/mfd/twl4030-core.c |    2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
>diff --git a/drivers/mfd/twl4030-core.c b/drivers/mfd/twl4030-core.c
>index e424cf6..8cf0a02 100644
>--- a/drivers/mfd/twl4030-core.c
>+++ b/drivers/mfd/twl4030-core.c
>@@ -792,7 +792,7 @@ twl4030_probe(struct i2c_client *client, 
>const struct i2c_device_id *id)
> 			twl->client = i2c_new_dummy(client->adapter,
> 					twl->address);
> 			if (!twl->client) {
>-				dev_err(&twl->client->dev,
>+				dev_err(&client->dev,
> 					"can't attach client %d\n", i);
> 				status = -ENOMEM;
> 				goto fail;
>-- 
>1.6.0.4
>
>

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

* Re: [PATCH 1/2] twl4030: Do not dereference null pointer in error path
  2009-10-16 14:21 ` [PATCH 1/2] twl4030: Do not dereference null pointer in error path ilkka.koskinen
@ 2009-10-19 15:52   ` Samuel Ortiz
  2009-10-20 13:19     ` ilkka.koskinen
  0 siblings, 1 reply; 5+ messages in thread
From: Samuel Ortiz @ 2009-10-19 15:52 UTC (permalink / raw
  To: ilkka.koskinen; +Cc: linux-omap, linux-kernel

Hi Ilkka,

On Fri, Oct 16, 2009 at 04:21:41PM +0200, ilkka.koskinen@nokia.com wrote:
> 
> Hi Samuel,
> 
> What is the status of this patch and the other one:
> [PATCH 2/2] twl4030: Enable low-power mode to 32KHz oscillator
I'm sorry but it seems I havent received those 2 patches. Could you please
re-send them ?

Cheers,
Samuel.


> Cheers, Ilkka
> 
> >-----Original Message-----
> >From: Koskinen Ilkka (Nokia-D/Tampere) 
> >Sent: 30 September, 2009 18:12
> >To: linux-kernel@vger.kernel.org; sameo@linux.intel.com
> >Cc: linux-omap@vger.kernel.org; Koskinen Ilkka (Nokia-D/Tampere)
> >Subject: [PATCH 1/2] twl4030: Do not dereference null pointer 
> >in error path
> >
> >Signed-off-by: Ilkka Koskinen <ilkka.koskinen@nokia.com>
> >---
> > drivers/mfd/twl4030-core.c |    2 +-
> > 1 files changed, 1 insertions(+), 1 deletions(-)
> >
> >diff --git a/drivers/mfd/twl4030-core.c b/drivers/mfd/twl4030-core.c
> >index e424cf6..8cf0a02 100644
> >--- a/drivers/mfd/twl4030-core.c
> >+++ b/drivers/mfd/twl4030-core.c
> >@@ -792,7 +792,7 @@ twl4030_probe(struct i2c_client *client, 
> >const struct i2c_device_id *id)
> > 			twl->client = i2c_new_dummy(client->adapter,
> > 					twl->address);
> > 			if (!twl->client) {
> >-				dev_err(&twl->client->dev,
> >+				dev_err(&client->dev,
> > 					"can't attach client %d\n", i);
> > 				status = -ENOMEM;
> > 				goto fail;
> >-- 
> >1.6.0.4
> >
> >

-- 
Intel Open Source Technology Centre
http://oss.intel.com/

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

* RE: [PATCH 1/2] twl4030: Do not dereference null pointer in error path
  2009-10-19 15:52   ` Samuel Ortiz
@ 2009-10-20 13:19     ` ilkka.koskinen
  0 siblings, 0 replies; 5+ messages in thread
From: ilkka.koskinen @ 2009-10-20 13:19 UTC (permalink / raw
  To: sameo; +Cc: linux-omap, linux-kernel

 
Hi Samuel,

>From: ext Samuel Ortiz [mailto:sameo@linux.intel.com] 
>Sent: 19 October, 2009 18:53
>On Fri, Oct 16, 2009 at 04:21:41PM +0200, 
>ilkka.koskinen@nokia.com wrote:
>> 
>> Hi Samuel,
>> 
>> What is the status of this patch and the other one:
>> [PATCH 2/2] twl4030: Enable low-power mode to 32KHz oscillator
>I'm sorry but it seems I havent received those 2 patches. 
>Could you please
>re-send them ?

Sorry, my mistake. I already forgot that the patches never
reached you. I'll resend them right away.

Cheers, Ilkka

>> >-----Original Message-----
>> >From: Koskinen Ilkka (Nokia-D/Tampere) 
>> >Sent: 30 September, 2009 18:12
>> >To: linux-kernel@vger.kernel.org; sameo@linux.intel.com
>> >Cc: linux-omap@vger.kernel.org; Koskinen Ilkka (Nokia-D/Tampere)
>> >Subject: [PATCH 1/2] twl4030: Do not dereference null pointer 
>> >in error path
>> >
>> >Signed-off-by: Ilkka Koskinen <ilkka.koskinen@nokia.com>
>> >---
>> > drivers/mfd/twl4030-core.c |    2 +-
>> > 1 files changed, 1 insertions(+), 1 deletions(-)
>> >
>> >diff --git a/drivers/mfd/twl4030-core.c b/drivers/mfd/twl4030-core.c
>> >index e424cf6..8cf0a02 100644
>> >--- a/drivers/mfd/twl4030-core.c
>> >+++ b/drivers/mfd/twl4030-core.c
>> >@@ -792,7 +792,7 @@ twl4030_probe(struct i2c_client *client, 
>> >const struct i2c_device_id *id)
>> > 			twl->client = i2c_new_dummy(client->adapter,
>> > 					twl->address);
>> > 			if (!twl->client) {
>> >-				dev_err(&twl->client->dev,
>> >+				dev_err(&client->dev,
>> > 					"can't attach client %d\n", i);
>> > 				status = -ENOMEM;
>> > 				goto fail;
>> >-- 
>> >1.6.0.4
>> >
>> >
>
>-- 
>Intel Open Source Technology Centre
>http://oss.intel.com/
>

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

end of thread, other threads:[~2009-10-20 13:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-30 15:11 [PATCH 1/2] twl4030: Do not dereference null pointer in error path Ilkka Koskinen
2009-09-30 15:11 ` [PATCH 2/2] twl4030: Enable low-power mode to 32KHz oscillator Ilkka Koskinen
2009-10-16 14:21 ` [PATCH 1/2] twl4030: Do not dereference null pointer in error path ilkka.koskinen
2009-10-19 15:52   ` Samuel Ortiz
2009-10-20 13:19     ` ilkka.koskinen

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 read-only IMAP folder(s) and NNTP newsgroup(s).