lkml.org 
[lkml]   [2009]   [Mar]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 2/5] Input: add BTN_TOUCH event
    Date
    From: Mike Rapoport <mike@compulab.co.il>

    Add BTN_TOUCH event reporting to ucb1400_ts and accelerated mainstone-wm97xx
    touchscreen drivers. Together with previously posted similar patch for
    wm97xx-core this will make all touchscreen drivers behave consistently wrt.
    BTN_TOUCH.

    Signed-off-by: Mike Rapoport <mike@compulab.co.il>
    Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
    ---
    drivers/input/touchscreen/mainstone-wm97xx.c | 1 +
    drivers/input/touchscreen/ucb1400_ts.c | 5 ++++-
    2 files changed, 5 insertions(+), 1 deletions(-)

    diff --git a/drivers/input/touchscreen/mainstone-wm97xx.c b/drivers/input/touchscreen/mainstone-wm97xx.c
    index 1d11e2b..4d49690 100644
    --- a/drivers/input/touchscreen/mainstone-wm97xx.c
    +++ b/drivers/input/touchscreen/mainstone-wm97xx.c
    @@ -162,6 +162,7 @@ static int wm97xx_acc_pen_down(struct wm97xx *wm)
    input_report_abs(wm->input_dev, ABS_X, x & 0xfff);
    input_report_abs(wm->input_dev, ABS_Y, y & 0xfff);
    input_report_abs(wm->input_dev, ABS_PRESSURE, p & 0xfff);
    + input_report_key(wm->input_dev, BTN_TOUCH, (p != 0));
    input_sync(wm->input_dev);
    reads++;
    } while (reads < cinfo[sp_idx].reads);
    diff --git a/drivers/input/touchscreen/ucb1400_ts.c b/drivers/input/touchscreen/ucb1400_ts.c
    index 5498662..e868264 100644
    --- a/drivers/input/touchscreen/ucb1400_ts.c
    +++ b/drivers/input/touchscreen/ucb1400_ts.c
    @@ -151,12 +151,14 @@ static void ucb1400_ts_evt_add(struct input_dev *idev, u16 pressure, u16 x, u16
    input_report_abs(idev, ABS_X, x);
    input_report_abs(idev, ABS_Y, y);
    input_report_abs(idev, ABS_PRESSURE, pressure);
    + input_report_key(idev, BTN_TOUCH, 1);
    input_sync(idev);
    }

    static void ucb1400_ts_event_release(struct input_dev *idev)
    {
    input_report_abs(idev, ABS_PRESSURE, 0);
    + input_report_key(idev, BTN_TOUCH, 0);
    input_sync(idev);
    }

    @@ -377,7 +379,8 @@ static int ucb1400_ts_probe(struct platform_device *dev)
    ucb->ts_idev->id.product = ucb->id;
    ucb->ts_idev->open = ucb1400_ts_open;
    ucb->ts_idev->close = ucb1400_ts_close;
    - ucb->ts_idev->evbit[0] = BIT_MASK(EV_ABS);
    + ucb->ts_idev->evbit[0] = BIT_MASK(EV_ABS) | BIT_MASK(EV_KEY);
    + ucb->ts_idev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH);

    ucb1400_adc_enable(ucb->ac97);
    x_res = ucb1400_ts_read_xres(ucb);
    --
    1.6.1.3


    \
     
     \ /
      Last update: 2009-03-03 19:29    [W:0.023 / U:178.344 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site