From patchwork Sat Dec 29 13:01:57 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alexandre Lissy X-Patchwork-Id: 16030 Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1TowCU-0005es-PW; Sat, 29 Dec 2012 14:11:54 +0100 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.75/mailfrontend-2) with esmtp id 1TowCS-00065p-JA; Sat, 29 Dec 2012 14:11:41 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752748Ab2L2NLi (ORCPT + 1 other); Sat, 29 Dec 2012 08:11:38 -0500 Received: from hermes.univ-tours.fr ([193.52.209.50]:29599 "EHLO hermes.univ-tours.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752290Ab2L2NLh (ORCPT ); Sat, 29 Dec 2012 08:11:37 -0500 X-Greylist: delayed 577 seconds by postgrey-1.27 at vger.kernel.org; Sat, 29 Dec 2012 08:11:37 EST X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ap4BAE7o3lBOfi+U/2dsb2JhbAANOIwYrV6EBIMRAQEBBHgBEAsRAwECAQkWDwkDAgECAT0IBgEMAQUCAQGHfAEDBqVOiF0GRAyIQYxXhEMDjGSCJIcEkz0 Received: from 148.47.126.78.rev.sfr.net (HELO [192.168.2.75]) ([78.126.47.148]) by hermes2.univ-tours.fr with ESMTP/TLS/DHE-RSA-CAMELLIA256-SHA; 29 Dec 2012 13:39:40 +0100 Message-ID: <50DEE9C5.7020407@lissyx.dyndns.org> Date: Sat, 29 Dec 2012 14:01:57 +0100 From: Alexandre Lissy Organization: Mozfr User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:19.0) Gecko/20121215 Thunderbird/19.0a2 MIME-Version: 1.0 To: Alexey Klimov , Alexandre LISSY CC: linux-media@vger.kernel.org Subject: Re: iMon Knob driver issue References: <5081109E.7060809@free.fr> <50DEDD43.3080300@free.fr> In-Reply-To: Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2012.12.29.130037 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' HTML_00_01 0.05, HTML_00_10 0.05, MIME_TEXT_ONLY_MP_MIXED 0.05, MSGID_ADDED_BY_MTA 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_2000_2999 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, RATWARE_LC_DIGITS_MSGID 0, URI_ENDS_IN_HTML 0, __ANY_URI 0, __BAT_BOUNDARY 0, __BOUNCE_CHALLENGE_SUBJ 0, __BOUNCE_NDR_SUBJ_EXEMPT 0, __CP_URI_IN_BODY 0, __CT 0, __CTYPE_HAS_BOUNDARY 0, __CTYPE_MULTIPART 0, __CTYPE_MULTIPART_MIXED 0, __HAS_FROM 0, __HAS_MSGID 0, __HAS_X_MAILING_LIST 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __MOZILLA_MSGID 0, __MOZILLA_USER_AGENT 0, __SANE_MSGID 0, __SUBJ_ALPHA_END 0, __TO_MALFORMED_2 0, __URI_NO_WWW 0, __URI_NS , __USER_AGENT 0' Le 29/12/2012 13:31, Alexey Klimov a écrit : > Hello Alexandre, > > On Sat, Dec 29, 2012 at 4:08 PM, Alexandre LISSY wrote: >> Hello, >> >> Please find attached a small patch for the iMon Knob driver. I've been > > Could you please also add your Signed-off-by to the patch? It looks > like it's missed. > Sure, sorry for forgetting this, here it is ! From cca7718a9902a4d5cffbf158b5853980a08ef930 Mon Sep 17 00:00:00 2001 From: Alexandre Lissy Date: Sun, 2 Sep 2012 20:35:20 +0200 Subject: [PATCH] fix: iMon Knob event interpretation issues Events for the iMon Knob pad where not correctly interpreted, resulting in buggy mouse movements (cursor going straight out of the screen), key pad only generating KEY_RIGHT and KEY_DOWN events. A reproducer is: int main(int argc, char ** argv) { char rel_x = 0x00; printf("rel_x:%d @%s:%d\n", rel_x, __FILE__, __LINE__); rel_x = 0x0f; printf("rel_x:%d @%s:%d\n", rel_x, __FILE__, __LINE__); rel_x |= ~0x0f; printf("rel_x:%d @%s:%d\n", rel_x, __FILE__, __LINE__); return 0; } (running on x86 or amd64) $ ./test rel_x:0 @test.c:6 rel_x:15 @test.c:7 rel_x:-1 @test.c:8 (running on armv6) rel_x:0 @test.c:6 rel_x:15 @test.c:7 rel_x:255 @test.c:8 Forcing the rel_x and rel_y variables as signed char fixes the issue. Signed-off-by: Alexandre Lissy --- drivers/media/rc/imon.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/rc/imon.c b/drivers/media/rc/imon.c index 5dd0386..9d30ca9 100644 --- a/drivers/media/rc/imon.c +++ b/drivers/media/rc/imon.c @@ -1225,7 +1225,7 @@ static u32 imon_panel_key_lookup(u64 code) static bool imon_mouse_event(struct imon_context *ictx, unsigned char *buf, int len) { - char rel_x = 0x00, rel_y = 0x00; + signed char rel_x = 0x00, rel_y = 0x00; u8 right_shift = 1; bool mouse_input = true; int dir = 0; @@ -1301,7 +1301,7 @@ static void imon_touch_event(struct imon_context *ictx, unsigned char *buf) static void imon_pad_to_keys(struct imon_context *ictx, unsigned char *buf) { int dir = 0; - char rel_x = 0x00, rel_y = 0x00; + signed char rel_x = 0x00, rel_y = 0x00; u16 timeout, threshold; u32 scancode = KEY_RESERVED; unsigned long flags; -- 1.7.10.4