From patchwork Thu Nov 8 23:59:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benson Leung X-Patchwork-Id: 10675161 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5FA4313BF for ; Thu, 8 Nov 2018 23:59:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5022929BC7 for ; Thu, 8 Nov 2018 23:59:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 43C982E755; Thu, 8 Nov 2018 23:59:27 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 DFDFF29BC7 for ; Thu, 8 Nov 2018 23:59:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727488AbeKIJhY (ORCPT ); Fri, 9 Nov 2018 04:37:24 -0500 Received: from mail-pl1-f193.google.com ([209.85.214.193]:41230 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727269AbeKIJhY (ORCPT ); Fri, 9 Nov 2018 04:37:24 -0500 Received: by mail-pl1-f193.google.com with SMTP id p16-v6so34431plr.8 for ; Thu, 08 Nov 2018 15:59:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=4mDOmHxtHc9ah51l/1sssmVDALU79jF5UEijPBogPM8=; b=RhLOfDDohhu+PV9YUkZLW75wjxjk/JUwkqsf0zgHGgUgdU4ylKtIub6k6xcVJ3O9A3 Ubkvs+NxvBTBruJFMCZh0Q0pu4Ln6Rz6Wt1aQU/ueBxEtG8sm02xYIN/8QnLzTO0+AYM qoYgMMLjweAK+SOC9YN95sB7aD4+qlIbIbCp4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=4mDOmHxtHc9ah51l/1sssmVDALU79jF5UEijPBogPM8=; b=a2+nR8qqbg42SnDf0ToI/1JGy/naD/SGtMU1GGXFC7W5UuvfOjc/okIj2Oxqo0lVaK RPqzw2p0yPiuI3YPVEX0OQMNnuKJHyEKpggViBPpCrEBLUcdc4mbgZZEydD8EYGaeBuW psSnA8BUSwsYRhrzJtTMbIGFi4K+91tCBK1uP7V9dOqbewUpnQ84fM9pMPFNsgVQZnGB Ks6+GmOeLKFcdZZl0hHW7xhJpMGTCfUEMc/2zUVYU8LjVr/SHqMzp6H9WzlLii3OURtg yi1NeGFlWDz6KlJ6DzEOm0wOrj7B7YRMOeZwT1B7Xp8uqA1MoRsKVMJnrGFwq9e6kXKJ Pr4w== X-Gm-Message-State: AGRZ1gLyQ0yz5pT8xb0iPNoNYP20Gfa+txgcZa1YB9PU+dSBi1g6NS4/ hG2/f1c8BhcJX7sYhQMLOLY5nQ== X-Google-Smtp-Source: AJdET5cEkgOaBGAiOUZDaE2G5trom/qjisMK4qfTueSrJ6oZcsp7ZfyQk0/uypDJzJV3pq8DAAs12w== X-Received: by 2002:a17:902:f24:: with SMTP id 33-v6mr6830603ply.228.1541721565125; Thu, 08 Nov 2018 15:59:25 -0800 (PST) Received: from decatoncale.mtv.corp.google.com ([2620:15c:202:1:c562:226a:6d78:2ae4]) by smtp.gmail.com with ESMTPSA id v84-v6sm5729880pfd.182.2018.11.08.15.59.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Nov 2018 15:59:24 -0800 (PST) From: Benson Leung To: jikos@kernel.org, benjamin.tissoires@redhat.com, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Cc: dtor@chromium.org, dmitry.torokhov@gmail.com, Benson Leung Subject: [PATCH] HID: input: Ignore battery reported by Symbol DS4308 Date: Thu, 8 Nov 2018 15:59:21 -0800 Message-Id: <20181108235921.62193-1-bleung@chromium.org> X-Mailer: git-send-email 2.19.1.930.g4563a0d9d0-goog MIME-Version: 1.0 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 The Motorola/Zebra Symbol DS4308-HD is a handheld USB barcode scanner which does not have a battery, but reports one anyway that always has capacity 2. Let's apply the IGNORE quirk to prevent it from being treated like a power supply so that userspaces don't get confused that this accessory is almost out of power and warn the user that they need to charge their wired barcode scanner. Reported here: https://bugs.chromium.org/p/chromium/issues/detail?id=804720 Signed-off-by: Benson Leung Reviewed-by: Benjamin Tissoires --- drivers/hid/hid-ids.h | 1 + drivers/hid/hid-input.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h index c0d668944dbe..07f6348b9f86 100644 --- a/drivers/hid/hid-ids.h +++ b/drivers/hid/hid-ids.h @@ -1043,6 +1043,7 @@ #define USB_VENDOR_ID_SYMBOL 0x05e0 #define USB_DEVICE_ID_SYMBOL_SCANNER_1 0x0800 #define USB_DEVICE_ID_SYMBOL_SCANNER_2 0x1300 +#define USB_DEVICE_ID_SYMBOL_SCANNER_3 0x1200 #define USB_VENDOR_ID_SYNAPTICS 0x06cb #define USB_DEVICE_ID_SYNAPTICS_TP 0x0001 diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c index a2f74e6adc70..44ea8e7c71a9 100644 --- a/drivers/hid/hid-input.c +++ b/drivers/hid/hid-input.c @@ -325,6 +325,9 @@ static const struct hid_device_id hid_battery_quirks[] = { { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_BM084), HID_BATTERY_QUIRK_IGNORE }, + { HID_USB_DEVICE(USB_VENDOR_ID_SYMBOL, + USB_DEVICE_ID_SYMBOL_SCANNER_3), + HID_BATTERY_QUIRK_IGNORE }, {} };