From patchwork Sat Mar 25 22:49:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 9644895 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1B40E601E9 for ; Sat, 25 Mar 2017 22:49:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F40DE27165 for ; Sat, 25 Mar 2017 22:49:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E55F827FA8; Sat, 25 Mar 2017 22:49:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 60F7927165 for ; Sat, 25 Mar 2017 22:49:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751395AbdCYWt4 (ORCPT ); Sat, 25 Mar 2017 18:49:56 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:46068 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751313AbdCYWtz (ORCPT ); Sat, 25 Mar 2017 18:49:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Sender:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=jZlnDUlI/wOezGdpnZ6gIJslhsSY31Czf7CYcpNbSXM=; b=nKNKtAUE9UeW/YhMxTr/Rgnyb JKfeRidZIF+qMg5f7/ETKvdJSrAXeY/iIjga91FliVV9idgvn2/v8GO41EazozjqUkIsCkGve7uAf dTBFelQPJjf9T26ykl/QX7QMlYK7x09KYiRkHVq2VFuEW1xHxEi1wj1nKmO/UuDx/yaWS0AjFXdKN qsA5dcOb7yEB5CsKlCSkGyvHcjKb6yHfpXyOtFll9qF7wULe8oQECNyyhpYbHfCx8YbJVl7UG1QGm 6MJcwLzM56/1oHma/LDs9ZGvNxkkxBlKfQ0/7ABac/o0uCzlICfcnuMtQgsdOeEN9p0onODDpKpqP SjZsZdJ9g==; Received: from 177.205.100.127.dynamic.adsl.gvt.net.br ([177.205.100.127] helo=smtp.w2.samsung.com) by bombadil.infradead.org with esmtpsa (Exim 4.87 #1 (Red Hat Linux)) id 1cruVG-0007Jo-Q9; Sat, 25 Mar 2017 22:49:47 +0000 Received: from mchehab by smtp.w2.samsung.com with local (Exim 4.87) (envelope-from ) id 1cruVD-0000le-BA; Sat, 25 Mar 2017 19:49:43 -0300 From: Mauro Carvalho Chehab To: linux-input@vger.kernel.org Cc: Mauro Carvalho Chehab , Dmitry Torokhov , Peter Hutterer , Benjamin Tissoires , Greg Kroah-Hartman , Martin Schwidefsky , Mauro Carvalho Chehab , Ingo Tuchscherer , Stuart Yoder , Hans Verkuil , Douglas Anderson , Ping Cheng , Kamil Debski Subject: [PATCH RFC 3/4] input: add a EV_SW event for ratchet switch Date: Sat, 25 Mar 2017 19:49:41 -0300 Message-Id: X-Mailer: git-send-email 2.9.3 In-Reply-To: <2529a55b0477cc638f1104a423cb67de1628a96d.1490481944.git.mchehab@s-opensource.com> References: <2529a55b0477cc638f1104a423cb67de1628a96d.1490481944.git.mchehab@s-opensource.com> In-Reply-To: References: Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Some mouses have a switch on their wheel, allowing to switch between ratchet or free wheel mode. Add support for it. Signed-off-by: Mauro Carvalho Chehab --- include/linux/mod_devicetable.h | 2 +- include/uapi/linux/input-event-codes.h | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h index 8a57f0b1242d..73534c591b40 100644 --- a/include/linux/mod_devicetable.h +++ b/include/linux/mod_devicetable.h @@ -292,7 +292,7 @@ struct pcmcia_device_id { #define INPUT_DEVICE_ID_LED_MAX 0x0f #define INPUT_DEVICE_ID_SND_MAX 0x07 #define INPUT_DEVICE_ID_FF_MAX 0x7f -#define INPUT_DEVICE_ID_SW_MAX 0x0f +#define INPUT_DEVICE_ID_SW_MAX 0x1f #define INPUT_DEVICE_ID_MATCH_BUS 1 #define INPUT_DEVICE_ID_MATCH_VENDOR 2 diff --git a/include/uapi/linux/input-event-codes.h b/include/uapi/linux/input-event-codes.h index 23b2d377af59..a3eafd0527f1 100644 --- a/include/uapi/linux/input-event-codes.h +++ b/include/uapi/linux/input-event-codes.h @@ -782,7 +782,9 @@ #define SW_LINEIN_INSERT 0x0d /* set = inserted */ #define SW_MUTE_DEVICE 0x0e /* set = device disabled */ #define SW_PEN_INSERTED 0x0f /* set = pen inserted */ -#define SW_MAX 0x0f +#define SW_RATCHET 0x10 /* set = ratchet mode, + unset: free wheel */ +#define SW_MAX 0x1f #define SW_CNT (SW_MAX+1) /*