* [PATCH 2/2] staging:synaptics: Implement error hamdling for rmi4 touch regulator
@ 2011-01-21 10:20 Naveen Kumar G
2011-01-21 20:38 ` [PATCH 2/2] staging: synaptics: " Greg KH
0 siblings, 1 reply; 5+ messages in thread
From: Naveen Kumar G @ 2011-01-21 10:20 UTC (permalink / raw)
To: greg; +Cc: linux-kernel, STEricsson_nomadik_linux, Naveen Kumar Gaddipati
From: Naveen Kumar Gaddipati <naveen.gaddipati@stericsson.com>
Implement the error handling for regulator in synaptics
rmi4 touch screen
Signed-off-by: Naveen Kumar Gaddipati <naveen.gaddipati@stericsson.com>
---
drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c | 43 +++++++++++-------------
drivers/staging/ste_rmi4/synaptics_i2c_rmi4.h | 2 -
2 files changed, 20 insertions(+), 25 deletions(-)
diff --git a/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c b/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c
index 21c1efd..bdb0bcf 100644
--- a/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c
+++ b/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c
@@ -924,17 +924,19 @@ static int __devinit synaptics_rmi4_probe
goto err_input;
}
- if (platformdata->regulator_en) {
- rmi4_data->regulator = regulator_get(&client->dev, "vdd");
- if (IS_ERR(rmi4_data->regulator)) {
- dev_err(&client->dev, "%s:get regulator failed\n",
- __func__);
- retval = PTR_ERR(rmi4_data->regulator);
- goto err_regulator;
- }
- regulator_enable(rmi4_data->regulator);
+ rmi4_data->regulator = regulator_get(&client->dev, "vdd");
+ if (IS_ERR(rmi4_data->regulator)) {
+ dev_err(&client->dev, "%s:get regulator failed\n",
+ __func__);
+ retval = PTR_ERR(rmi4_data->regulator);
+ goto err_get_regulator;
+ }
+ retval = regulator_enable(rmi4_data->regulator);
+ if (retval < 0) {
+ dev_err(&client->dev, "%s:regulator enable failed\n",
+ __func__);
+ goto err_regulator_enable;
}
-
init_waitqueue_head(&rmi4_data->wait);
/*
* Copy i2c_client pointer into RTID's i2c_client pointer for
@@ -1011,11 +1013,10 @@ err_free_irq:
err_unset_clientdata:
i2c_set_clientdata(client, NULL);
err_query_dev:
- if (platformdata->regulator_en) {
- regulator_disable(rmi4_data->regulator);
- regulator_put(rmi4_data->regulator);
- }
-err_regulator:
+ regulator_disable(rmi4_data->regulator);
+err_regulator_enable:
+ regulator_put(rmi4_data->regulator);
+err_get_regulator:
input_free_device(rmi4_data->input_dev);
rmi4_data->input_dev = NULL;
err_input:
@@ -1039,10 +1040,8 @@ static int __devexit synaptics_rmi4_remove(struct i2c_client *client)
wake_up(&rmi4_data->wait);
free_irq(pdata->irq_number, rmi4_data);
input_unregister_device(rmi4_data->input_dev);
- if (pdata->regulator_en) {
- regulator_disable(rmi4_data->regulator);
- regulator_put(rmi4_data->regulator);
- }
+ regulator_disable(rmi4_data->regulator);
+ regulator_put(rmi4_data->regulator);
kfree(rmi4_data);
return 0;
@@ -1080,8 +1079,7 @@ static int synaptics_rmi4_suspend(struct device *dev)
if (retval < 0)
return retval;
- if (pdata->regulator_en)
- regulator_disable(rmi4_data->regulator);
+ regulator_disable(rmi4_data->regulator);
return 0;
}
@@ -1099,8 +1097,7 @@ static int synaptics_rmi4_resume(struct device *dev)
struct synaptics_rmi4_data *rmi4_data = dev_get_drvdata(dev);
const struct synaptics_rmi4_platform_data *pdata = rmi4_data->board;
- if (pdata->regulator_en)
- regulator_enable(rmi4_data->regulator);
+ regulator_enable(rmi4_data->regulator);
enable_irq(pdata->irq_number);
rmi4_data->touch_stopped = false;
diff --git a/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.h b/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.h
index 3686a2f..384436e 100644
--- a/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.h
+++ b/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.h
@@ -34,7 +34,6 @@
* @irq_type: irq type
* @x flip: x flip flag
* @y flip: y flip flag
- * @regulator_en: regulator enable flag
*
* This structure gives platform data for rmi4.
*/
@@ -43,7 +42,6 @@ struct synaptics_rmi4_platform_data {
int irq_type;
bool x_flip;
bool y_flip;
- bool regulator_en;
};
#endif
--
1.7.2.dirty
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH 2/2] staging: synaptics: Implement error hamdling for rmi4 touch regulator
2011-01-21 10:20 [PATCH 2/2] staging:synaptics: Implement error hamdling for rmi4 touch regulator Naveen Kumar G
@ 2011-01-21 20:38 ` Greg KH
2011-01-21 23:33 ` Dmitry Torokhov
0 siblings, 1 reply; 5+ messages in thread
From: Greg KH @ 2011-01-21 20:38 UTC (permalink / raw)
To: Naveen Kumar G; +Cc: linux-kernel, STEricsson_nomadik_linux
On Fri, Jan 21, 2011 at 03:50:36PM +0530, Naveen Kumar G wrote:
> From: Naveen Kumar Gaddipati <naveen.gaddipati@stericsson.com>
>
> Implement the error handling for regulator in synaptics
> rmi4 touch screen
>
> Signed-off-by: Naveen Kumar Gaddipati <naveen.gaddipati@stericsson.com>
This patch has some fuzz and doesn't apply correctly. Care to rediff it
and resend it?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] staging: synaptics: Implement error hamdling for rmi4 touch regulator
2011-01-21 20:38 ` [PATCH 2/2] staging: synaptics: " Greg KH
@ 2011-01-21 23:33 ` Dmitry Torokhov
2011-01-21 23:54 ` Greg KH
0 siblings, 1 reply; 5+ messages in thread
From: Dmitry Torokhov @ 2011-01-21 23:33 UTC (permalink / raw)
To: Greg KH; +Cc: Naveen Kumar G, linux-kernel, STEricsson_nomadik_linux
On Fri, Jan 21, 2011 at 12:38:15PM -0800, Greg KH wrote:
> On Fri, Jan 21, 2011 at 03:50:36PM +0530, Naveen Kumar G wrote:
> > From: Naveen Kumar Gaddipati <naveen.gaddipati@stericsson.com>
> >
> > Implement the error handling for regulator in synaptics
> > rmi4 touch screen
> >
> > Signed-off-by: Naveen Kumar Gaddipati <naveen.gaddipati@stericsson.com>
>
> This patch has some fuzz and doesn't apply correctly. Care to rediff it
> and resend it?
>
Given that this driver is a [hopefully] dead-end placeholder should we
even spend time cleaning this up? It would be better if effor was spent
helping Synaptics folks clean up their generic driver...
Thanks.
--
Dmitry
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] staging: synaptics: Implement error hamdling for rmi4 touch regulator
2011-01-21 23:33 ` Dmitry Torokhov
@ 2011-01-21 23:54 ` Greg KH
2011-01-22 0:14 ` Dmitry Torokhov
0 siblings, 1 reply; 5+ messages in thread
From: Greg KH @ 2011-01-21 23:54 UTC (permalink / raw)
To: Dmitry Torokhov; +Cc: Naveen Kumar G, linux-kernel, STEricsson_nomadik_linux
On Fri, Jan 21, 2011 at 03:33:30PM -0800, Dmitry Torokhov wrote:
> On Fri, Jan 21, 2011 at 12:38:15PM -0800, Greg KH wrote:
> > On Fri, Jan 21, 2011 at 03:50:36PM +0530, Naveen Kumar G wrote:
> > > From: Naveen Kumar Gaddipati <naveen.gaddipati@stericsson.com>
> > >
> > > Implement the error handling for regulator in synaptics
> > > rmi4 touch screen
> > >
> > > Signed-off-by: Naveen Kumar Gaddipati <naveen.gaddipati@stericsson.com>
> >
> > This patch has some fuzz and doesn't apply correctly. Care to rediff it
> > and resend it?
> >
>
> Given that this driver is a [hopefully] dead-end placeholder should we
> even spend time cleaning this up? It would be better if effor was spent
> helping Synaptics folks clean up their generic driver...
I agree, but this looks like a new feature being added. We also can't
keep people from sending patches in, and if Synaptics never comes
through with their new driver, hey, all the better :)
thanks,
greg k-h
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] staging: synaptics: Implement error hamdling for rmi4 touch regulator
2011-01-21 23:54 ` Greg KH
@ 2011-01-22 0:14 ` Dmitry Torokhov
0 siblings, 0 replies; 5+ messages in thread
From: Dmitry Torokhov @ 2011-01-22 0:14 UTC (permalink / raw)
To: Greg KH; +Cc: Naveen Kumar G, linux-kernel, STEricsson_nomadik_linux
On Fri, Jan 21, 2011 at 03:54:31PM -0800, Greg KH wrote:
> On Fri, Jan 21, 2011 at 03:33:30PM -0800, Dmitry Torokhov wrote:
> > On Fri, Jan 21, 2011 at 12:38:15PM -0800, Greg KH wrote:
> > > On Fri, Jan 21, 2011 at 03:50:36PM +0530, Naveen Kumar G wrote:
> > > > From: Naveen Kumar Gaddipati <naveen.gaddipati@stericsson.com>
> > > >
> > > > Implement the error handling for regulator in synaptics
> > > > rmi4 touch screen
> > > >
> > > > Signed-off-by: Naveen Kumar Gaddipati <naveen.gaddipati@stericsson.com>
> > >
> > > This patch has some fuzz and doesn't apply correctly. Care to rediff it
> > > and resend it?
> > >
> >
> > Given that this driver is a [hopefully] dead-end placeholder should we
> > even spend time cleaning this up? It would be better if effor was spent
> > helping Synaptics folks clean up their generic driver...
>
> I agree, but this looks like a new feature being added. We also can't
> keep people from sending patches in, and if Synaptics never comes
> through with their new driver, hey, all the better :)
>
They just posted an update (rework to use our driver model) a few days
ago. If they weren't working on their driver I'd agree wholeheartedly
with improving this driver.
--
Dmitry
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-01-22 0:14 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-21 10:20 [PATCH 2/2] staging:synaptics: Implement error hamdling for rmi4 touch regulator Naveen Kumar G
2011-01-21 20:38 ` [PATCH 2/2] staging: synaptics: " Greg KH
2011-01-21 23:33 ` Dmitry Torokhov
2011-01-21 23:54 ` Greg KH
2011-01-22 0:14 ` Dmitry Torokhov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox