From patchwork Tue Dec 15 19:11:12 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charlie Mooney X-Patchwork-Id: 7856911 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id BFCE8BEEE1 for ; Tue, 15 Dec 2015 19:11:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1CC412037F for ; Tue, 15 Dec 2015 19:11:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 22A2C20259 for ; Tue, 15 Dec 2015 19:11:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754073AbbLOTLm (ORCPT ); Tue, 15 Dec 2015 14:11:42 -0500 Received: from mail-pa0-f50.google.com ([209.85.220.50]:34729 "EHLO mail-pa0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753445AbbLOTLl (ORCPT ); Tue, 15 Dec 2015 14:11:41 -0500 Received: by mail-pa0-f50.google.com with SMTP id wq6so9307959pac.1 for ; Tue, 15 Dec 2015 11:11:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:from:to:cc:subject:date:message-id; bh=fT1VNJwuOkPJj32B7GUQM/r9juBbTeXoubAPEZENFyE=; b=DlO93WH+ebe3dCwaLqoDfY/gk07NNEBFT9spRZIYoEx1nI34eh+iuuj0btuoHT8sBJ +iCv+rdnpSK20KAylwJ5r86DbPOxvfcHaB7Q7I4rVJ8shU7f720VlfUSwuHW634+zWea y9eULgv8bsXsyQ+nYIxlZLxNFranfSewLCxFPbAc5fsICdqEUaeQemV5E/awlCAeWJlK 30sXWRxxFnkF9je6jnmEaI5h6mb4pHN8Rp5KjBW0MWihdLyaU9ud9hSyhQgUbuYwyp8l qNZvrDvVMjZDhANhd0hJUH0D3zuJhlIe8leiITtCsOr6dJx3NsWm7saJHvZacheCegN5 W07g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=fT1VNJwuOkPJj32B7GUQM/r9juBbTeXoubAPEZENFyE=; b=b2O42cLH9kjxLQtHFd21Aj/lDvl/GL2Z3cWkhfrXjQ/1hPDrXNRMnsuGELasNTBbjU /TyiJWex++B6UlTC1MN8AAImiCozaHMmdWnQHshdjYMKy0nhlWGYnW+gkUyMCjKKPkpk 8cwqbeS78wq5os9sTeb4H1atbc0NPtehpLSsaH16BFix9oBvIh16C7XBp1E1//XEz6PM Z9NcQyGlqckAhrjkbw8ubD5fDePhOSHBMnIPW92N591e/bzjXXgxrkf5rpItEcqhWXgj gcg+Ovmbc61RslxJ0yCGHzshIBhZMYnd+F4iZ17bTfanOk5FzVzPtPyfpm1MSlg5uUzI BiWQ== X-Gm-Message-State: ALoCoQmpXN0zZsZ3SiWMcOltFKINdosM2VrlUIB09uMRomUJivC2Lrlb4BHT+6mhlmcn0LvcQfx3R+Go41ptaqJYUCpx9CYezA== X-Received: by 10.66.232.202 with SMTP id tq10mr54883495pac.156.1450206700669; Tue, 15 Dec 2015 11:11:40 -0800 (PST) Received: from cmooney.mtv.corp.google.com ([172.22.64.44]) by smtp.gmail.com with ESMTPSA id w8sm3845926pfi.41.2015.12.15.11.11.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 15 Dec 2015 11:11:39 -0800 (PST) From: Charlie Mooney To: linux-input@vger.kernel.org Cc: dmitry.torokhov@gmail.com, dusonlin@emc.com.tw, charliemooney@chromium.org, jkosina@suse.com, michele.curti@gmail.com, k.kozlowski@samsung.com, bleung@chromium.org, drake@endlessm.com, linux-kernel@vger.kernel.org Subject: [PATCH] input: Report vendor and product IDs for elan_i2c Date: Tue, 15 Dec 2015 11:11:12 -0800 Message-Id: <1450206672-9840-1-git-send-email-charliemooney@chromium.org> X-Mailer: git-send-email 2.6.0.rc2.230.g3dd15c0 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Previously the "vendor" and "product" IDs for the elan_i2c driver simply reported 0000. This patch modifies the elan_i2c driver to include the Elan vendor ID and the touchpad's product id under input/input*/{vendor,product}. Specifically, this is to allow us to apply a generic Elan gestures config that will apply to all Elan touchpads on ChromeOS. These configs match to input devices in various ways, but one major way is by matching on vendor ID. Adding this patch allows the default Elan touchpad config to be applied to Elan touchpads in this kernel by matching on devices that have vendor ID 04f3. To test this patch, I mannually built and installed the modified driver for my laptop which has an elan_i2c touchpad. Everything still functions correctly, and when I query the vendor and product ID I see what I expected: localhost i2c-ELAN0000:00 # cat \ /sys/bus/i2c/devices/i2c-ELAN0000\:00/input/input6/id/{vendor,product} 04f3 007f Before this patch it simply returned 0000 for both values. Note that 007F is the product ID that this device will return through its custom sysfs entry "product_id" as well. Signed-off-by: Charlie Mooney --- drivers/input/mouse/elan_i2c_core.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/input/mouse/elan_i2c_core.c b/drivers/input/mouse/elan_i2c_core.c index 5e1665b..2f58985 100644 --- a/drivers/input/mouse/elan_i2c_core.c +++ b/drivers/input/mouse/elan_i2c_core.c @@ -41,6 +41,7 @@ #define DRIVER_NAME "elan_i2c" #define ELAN_DRIVER_VERSION "1.6.1" +#define ELAN_VENDOR_ID 0x04f3 #define ETP_MAX_PRESSURE 255 #define ETP_FWIDTH_REDUCE 90 #define ETP_FINGER_WIDTH 15 @@ -914,6 +915,8 @@ static int elan_setup_input_device(struct elan_tp_data *data) input->name = "Elan Touchpad"; input->id.bustype = BUS_I2C; + input->id.vendor = ELAN_VENDOR_ID; + input->id.product = data->product_id; input_set_drvdata(input, data); error = input_mt_init_slots(input, ETP_MAX_FINGERS,