diff options
author | Ping Cheng <pinglinux@gmail.com> | 2012-01-31 03:07:33 -0500 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2012-01-31 03:14:17 -0500 |
commit | 31175a8348af76aea2f557857c90467d13632dc3 (patch) | |
tree | 5aaf1f431d8e798edc759c5f45a367c0672a2226 /drivers/input/tablet/wacom_wac.c | |
parent | 8b4a0c1fe3b03c0cfe829413481d69c2e6fd844c (diff) |
Input: wacom - use switch statement for wacom_tpc_irq()
And add two new data formats.
Tested-by: Chris Bagwell <chris@cnpbagwell.com>
Reviewed-by: Chris Bagwell <chris@cnpbagwell.com>
Signed-off-by: Ping Cheng <pingc@wacom.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/tablet/wacom_wac.c')
-rw-r--r-- | drivers/input/tablet/wacom_wac.c | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c index e18f36232682..9283507b13af 100644 --- a/drivers/input/tablet/wacom_wac.c +++ b/drivers/input/tablet/wacom_wac.c | |||
@@ -832,12 +832,24 @@ static int wacom_tpc_irq(struct wacom_wac *wacom, size_t len) | |||
832 | 832 | ||
833 | dbg("wacom_tpc_irq: received report #%d", data[0]); | 833 | dbg("wacom_tpc_irq: received report #%d", data[0]); |
834 | 834 | ||
835 | if (len == WACOM_PKGLEN_TPC1FG || data[0] == WACOM_REPORT_TPC1FG) | 835 | switch (len) { |
836 | return wacom_tpc_single_touch(wacom, len); | 836 | case WACOM_PKGLEN_TPC1FG: |
837 | else if (data[0] == WACOM_REPORT_TPC2FG) | 837 | return wacom_tpc_single_touch(wacom, len); |
838 | return wacom_tpc_mt_touch(wacom); | 838 | |
839 | else if (data[0] == WACOM_REPORT_PENABLED) | 839 | case WACOM_PKGLEN_TPC2FG: |
840 | return wacom_tpc_pen(wacom); | 840 | return wacom_tpc_mt_touch(wacom); |
841 | |||
842 | default: | ||
843 | switch (data[0]) { | ||
844 | case WACOM_REPORT_TPC1FG: | ||
845 | case WACOM_REPORT_TPCHID: | ||
846 | case WACOM_REPORT_TPCST: | ||
847 | return wacom_tpc_single_touch(wacom, len); | ||
848 | |||
849 | case WACOM_REPORT_PENABLED: | ||
850 | return wacom_tpc_pen(wacom); | ||
851 | } | ||
852 | } | ||
841 | 853 | ||
842 | return 0; | 854 | return 0; |
843 | } | 855 | } |