linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Input: wm831x-ts - Default pressure measurements on
@ 2011-03-09 13:58 Mark Brown
  2011-03-09 14:11 ` Henrik Rydberg
  0 siblings, 1 reply; 5+ messages in thread
From: Mark Brown @ 2011-03-09 13:58 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input, patches, Mark Brown

tslib expects pressure measurements so enable them by default for better
compatibility.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
 drivers/input/touchscreen/wm831x-ts.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/drivers/input/touchscreen/wm831x-ts.c b/drivers/input/touchscreen/wm831x-ts.c
index 3c397c8..560200d 100644
--- a/drivers/input/touchscreen/wm831x-ts.c
+++ b/drivers/input/touchscreen/wm831x-ts.c
@@ -259,7 +259,10 @@ static __devinit int wm831x_ts_probe(struct platform_device *pdev)
 	else
 		wm831x_ts->pd_irq = platform_get_irq_byname(pdev, "TCHPD");
 
-	wm831x_ts->pressure = pdata && pdata->pressure;
+	if (pdata)
+		wm831x_ts->pressure = pdata->pressure;
+	else
+		wm831x_ts->pressure = true;
 
 	/* Five wire touchscreens can't report pressure */
 	if (pdata && pdata->fivewire) {
-- 
1.7.4.1


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

* Re: [PATCH] Input: wm831x-ts - Default pressure measurements on
  2011-03-09 13:58 [PATCH] Input: wm831x-ts - Default pressure measurements on Mark Brown
@ 2011-03-09 14:11 ` Henrik Rydberg
  2011-03-09 14:28   ` Mark Brown
  0 siblings, 1 reply; 5+ messages in thread
From: Henrik Rydberg @ 2011-03-09 14:11 UTC (permalink / raw)
  To: Mark Brown; +Cc: Dmitry Torokhov, linux-input, patches

Hi Mark,

> tslib expects pressure measurements so enable them by default for better
> compatibility.
> 
> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
> ---

I cannot speak for the rationale of this patch, but logically,

>  drivers/input/touchscreen/wm831x-ts.c |    5 ++++-
>  1 files changed, 4 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/input/touchscreen/wm831x-ts.c b/drivers/input/touchscreen/wm831x-ts.c
> index 3c397c8..560200d 100644
> --- a/drivers/input/touchscreen/wm831x-ts.c
> +++ b/drivers/input/touchscreen/wm831x-ts.c
> @@ -259,7 +259,10 @@ static __devinit int wm831x_ts_probe(struct platform_device *pdev)
>  	else
>  		wm831x_ts->pd_irq = platform_get_irq_byname(pdev, "TCHPD");
>  
> -	wm831x_ts->pressure = pdata && pdata->pressure;
> +	if (pdata)
> +		wm831x_ts->pressure = pdata->pressure;
> +	else
> +		wm831x_ts->pressure = true;

wm831x_ts->pressure = !pdata || pdata->pressure;

should suffice.

Henrik

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

* Re: [PATCH] Input: wm831x-ts - Default pressure measurements on
  2011-03-09 14:11 ` Henrik Rydberg
@ 2011-03-09 14:28   ` Mark Brown
  2011-03-09 14:40     ` Henrik Rydberg
  0 siblings, 1 reply; 5+ messages in thread
From: Mark Brown @ 2011-03-09 14:28 UTC (permalink / raw)
  To: Henrik Rydberg; +Cc: Dmitry Torokhov, linux-input, patches

On Wed, Mar 09, 2011 at 03:11:39PM +0100, Henrik Rydberg wrote:

> > -	wm831x_ts->pressure = pdata && pdata->pressure;
> > +	if (pdata)
> > +		wm831x_ts->pressure = pdata->pressure;
> > +	else
> > +		wm831x_ts->pressure = true;

> wm831x_ts->pressure = !pdata || pdata->pressure;

> should suffice.

It does have some substantial drawbacks in terms of legibility, though.

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

* Re: [PATCH] Input: wm831x-ts - Default pressure measurements on
  2011-03-09 14:28   ` Mark Brown
@ 2011-03-09 14:40     ` Henrik Rydberg
  2011-03-13  6:28       ` Dmitry Torokhov
  0 siblings, 1 reply; 5+ messages in thread
From: Henrik Rydberg @ 2011-03-09 14:40 UTC (permalink / raw)
  To: Mark Brown; +Cc: Dmitry Torokhov, linux-input, patches

On Wed, Mar 09, 2011 at 02:28:13PM +0000, Mark Brown wrote:
> On Wed, Mar 09, 2011 at 03:11:39PM +0100, Henrik Rydberg wrote:
> 
> > > -	wm831x_ts->pressure = pdata && pdata->pressure;
> > > +	if (pdata)
> > > +		wm831x_ts->pressure = pdata->pressure;
> > > +	else
> > > +		wm831x_ts->pressure = true;
> 
> > wm831x_ts->pressure = !pdata || pdata->pressure;
> 
> > should suffice.
> 
> It does have some substantial drawbacks in terms of legibility, though.

I suppose that is in the eye of the beholder.

Henrik

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

* Re: [PATCH] Input: wm831x-ts - Default pressure measurements on
  2011-03-09 14:40     ` Henrik Rydberg
@ 2011-03-13  6:28       ` Dmitry Torokhov
  0 siblings, 0 replies; 5+ messages in thread
From: Dmitry Torokhov @ 2011-03-13  6:28 UTC (permalink / raw)
  To: Henrik Rydberg; +Cc: Mark Brown, linux-input, patches

On Wed, Mar 09, 2011 at 03:40:18PM +0100, Henrik Rydberg wrote:
> On Wed, Mar 09, 2011 at 02:28:13PM +0000, Mark Brown wrote:
> > On Wed, Mar 09, 2011 at 03:11:39PM +0100, Henrik Rydberg wrote:
> > 
> > > > -	wm831x_ts->pressure = pdata && pdata->pressure;
> > > > +	if (pdata)
> > > > +		wm831x_ts->pressure = pdata->pressure;
> > > > +	else
> > > > +		wm831x_ts->pressure = true;
> > 
> > > wm831x_ts->pressure = !pdata || pdata->pressure;
> > 
> > > should suffice.
> > 
> > It does have some substantial drawbacks in terms of legibility, though.
> 
> I suppose that is in the eye of the beholder.
> 

Applied, thanks Mark (even though I also prefer more concise variants).

-- 
Dmitry

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

end of thread, other threads:[~2011-03-13  6:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-09 13:58 [PATCH] Input: wm831x-ts - Default pressure measurements on Mark Brown
2011-03-09 14:11 ` Henrik Rydberg
2011-03-09 14:28   ` Mark Brown
2011-03-09 14:40     ` Henrik Rydberg
2011-03-13  6:28       ` Dmitry Torokhov

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