From patchwork Thu Apr 24 05:25:23 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 4045721 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 1153BBFF02 for ; Thu, 24 Apr 2014 05:29:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 297532022D for ; Thu, 24 Apr 2014 05:29:42 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4EB6320219 for ; Thu, 24 Apr 2014 05:29:41 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WdCAS-00055Z-53; Thu, 24 Apr 2014 05:25:52 +0000 Received: from mail-pa0-x235.google.com ([2607:f8b0:400e:c03::235]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WdCAP-00054i-Pj for linux-arm-kernel@lists.infradead.org; Thu, 24 Apr 2014 05:25:50 +0000 Received: by mail-pa0-f53.google.com with SMTP id ld10so1537702pab.40 for ; Wed, 23 Apr 2014 22:25:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=tvnhyldHqx18uL3aLqfrbYbqnRIr5m1/RN3/WyFqwAg=; b=y81k+4SZu422f7lb6Rw+wkCUNe64jkaDHjD7fKaPyb4T739GA3xwRuCI+t/m2DpIwS 0ckd2nqcqQ7Byyfhr3v2brtEveGh/BUePKMSjnWz/LHxlLULzELMa6RzB6a3Q5SI584h ER4eUJvpaHLdRwQZmG23FdBIYwJS6l/v2TnuY2W8OhsgtijScVKZg8SA/Ee/JDOxvwxG SMQF1rXa8Ac0h062i3THMZQ6+fz1VwjCuca3EDyFVWJP1dDdJqqxYDKawiYlJZMwgrJs 1JWUP9MR/vE23spA+qGj143Uk3sf0bJlLIzz0pYcjdpy+O6c+fux9iJNpSojdMzKCHj+ qOHQ== X-Received: by 10.68.194.229 with SMTP id hz5mr61497250pbc.91.1398317126720; Wed, 23 Apr 2014 22:25:26 -0700 (PDT) Received: from mailhub.coreip.homeip.net (c-67-188-112-76.hsd1.ca.comcast.net. [67.188.112.76]) by mx.google.com with ESMTPSA id hb10sm6391916pbd.75.2014.04.23.22.25.24 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 23 Apr 2014 22:25:25 -0700 (PDT) Date: Wed, 23 Apr 2014 22:25:23 -0700 From: Dmitry Torokhov To: Sheng-Liang Song Subject: Re: [PATCH] Input: atkbd - fix keyboard LG Electronics Message-ID: <20140424052523.GA29675@core.coreip.homeip.net> References: <1398217882-29778-1-git-send-email-ssl@chromium.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1398217882-29778-1-git-send-email-ssl@chromium.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140423_222549_892835_CB751BE9 X-CRM114-Status: GOOD ( 21.54 ) X-Spam-Score: -0.1 (/) Cc: Shawn Nematbakhsh , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-input@vger.kernel.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable 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 On Tue, Apr 22, 2014 at 06:51:22PM -0700, Sheng-Liang Song wrote: > After issuing ATKBD_CMD_RESET_DIS, LG Keyboard stop working. > The workaround is to remove ATKBD_CMD_RESET_DIS for LG Keyboards. > > In order to keep the minimum changes to the current atkbd driver, > I add logic to apply the patch if and only if the device is LG LW25-B7HV or P1-J273B. How about if we rework this just a little bit... Does the version of the patch below work for you? Also, I do need your "signed-off-by". Thanks! diff --git a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c index 2626773..06a4b0d 100644 --- a/drivers/input/keyboard/atkbd.c +++ b/drivers/input/keyboard/atkbd.c @@ -243,6 +243,12 @@ static void (*atkbd_platform_fixup)(struct atkbd *, const void *data); static void *atkbd_platform_fixup_data; static unsigned int (*atkbd_platform_scancode_fixup)(struct atkbd *, unsigned int); +/* + * Certain keyboards to not like ATKBD_CMD_RESET_DIS and stop responding + * to many commands until full reset (ATKBD_CMD_RESET_BAT) is performed. + */ +static bool atkbd_skip_deactivate; + static ssize_t atkbd_attr_show_helper(struct device *dev, char *buf, ssize_t (*handler)(struct atkbd *, char *)); static ssize_t atkbd_attr_set_helper(struct device *dev, const char *buf, size_t count, @@ -698,7 +704,6 @@ static int atkbd_activate(struct atkbd *atkbd) * atkbd_deactivate() resets and disables the keyboard from sending * keystrokes. */ - static void atkbd_deactivate(struct atkbd *atkbd) { struct ps2dev *ps2dev = &atkbd->ps2dev; @@ -768,7 +773,8 @@ static int atkbd_probe(struct atkbd *atkbd) * Make sure nothing is coming from the keyboard and disturbs our * internal state. */ - atkbd_deactivate(atkbd); + if (!atkbd_skip_deactivate) + atkbd_deactivate(atkbd); return 0; } @@ -1638,6 +1644,12 @@ static int __init atkbd_setup_scancode_fixup(const struct dmi_system_id *id) return 1; } +static int __init atkbd_deactivate_fixup(const struct dmi_system_id *id) +{ + atkbd_skip_deactivate = true; + return 1; +} + static const struct dmi_system_id atkbd_dmi_quirk_table[] __initconst = { { .matches = { @@ -1775,6 +1787,20 @@ static const struct dmi_system_id atkbd_dmi_quirk_table[] __initconst = { .callback = atkbd_setup_scancode_fixup, .driver_data = atkbd_oqo_01plus_scancode_fixup, }, + { + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "LG Electronics"), + DMI_MATCH(DMI_PRODUCT_NAME, "LW25-B7HV"), + }, + .callback = atkbd_deactivate_fixup, + }, + { + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "LG Electronics"), + DMI_MATCH(DMI_PRODUCT_NAME, "P1-J273B"), + }, + .callback = atkbd_deactivate_fixup, + }, { } };