[PATCH] Input: wm831x-ts - Default pressure measurements on
Subsystems:
input (keyboard, mouse, joystick, touchscreen) drivers , the rest , wolfson microelectronics drivers
STALE5693d
5 messages,
3 authors,
2011-03-13 · open the first message on its own page
tslib expects pressure measurements so enable them by default for better
compatibility.
Signed-off-by: Mark Brown <redacted>
---
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
Hi Mark,
tslib expects pressure measurements so enable them by default for better
compatibility.
Signed-off-by: Mark Brown <redacted>
---
I cannot speak for the rationale of this patch, but logically,
quoted hunk 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
On Wed, Mar 09, 2011 at 03:11:39PM +0100, Henrik Rydberg wrote:
quoted - 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.
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:
quoted quoted - wm831x_ts->pressure = pdata && pdata->pressure;
+ if (pdata)
+ wm831x_ts->pressure = pdata->pressure;
+ else
+ wm831x_ts->pressure = true;quoted wm831x_ts->pressure = !pdata || pdata->pressure; quoted should suffice.
It does have some substantial drawbacks in terms of legibility, though.
I suppose that is in the eye of the beholder.
Henrik
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: quoted On Wed, Mar 09, 2011 at 03:11:39PM +0100, Henrik Rydberg wrote:
quoted quoted - wm831x_ts->pressure = pdata && pdata->pressure;
+ if (pdata)
+ wm831x_ts->pressure = pdata->pressure;
+ else
+ wm831x_ts->pressure = true;quoted wm831x_ts->pressure = !pdata || pdata->pressure; quoted 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