From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751155AbeAVL7W (ORCPT ); Mon, 22 Jan 2018 06:59:22 -0500 Received: from mail-io0-f182.google.com ([209.85.223.182]:46518 "EHLO mail-io0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750890AbeAVL7U (ORCPT ); Mon, 22 Jan 2018 06:59:20 -0500 X-Google-Smtp-Source: AH8x226Xz6i6Kl1TgMAWJYRYq4asKPsWNimO5meEvIi6OM2Xo3ExLENRbOfrZmT+rUkwidkrYeKEdTOxe6hg+ydYF6s= MIME-Version: 1.0 In-Reply-To: <20180119172902.wgmvlehbsrjesabd@dtor-ws> References: <1516283990-3665-1-git-send-email-notmart@gmail.com> <20180118154408.eyke3dtn6zlcqphi@pali> <20180119160123.onn7w36hmhrxoaq6@pali> <20180119172902.wgmvlehbsrjesabd@dtor-ws> From: Marco Martin Date: Mon, 22 Jan 2018 12:59:19 +0100 Message-ID: Subject: Re: [PATCH] Support tablet mode switch for Dell laptops To: Dmitry Torokhov Cc: Mario.Limonciello@dell.com, pali.rohar@gmail.com, linux-kernel@vger.kernel.org, Matthew Garrett , dvhart@infradead.org, andy@infradead.org, Bhushan Shah , platform-driver-x86@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 19, 2018 at 6:29 PM, Dmitry Torokhov wrote: >> We discussed a little more on the bug he filed with attached DSDT. I think that in >> sparse keymap he can use KE_VSW for the entries and sparse keymap can handle. > > No it should be KE_SW I believe, as the "keycode" encodes the state. > See example in intel-hid.c. > > So you probably want: > > ... > { KE_SW, 0xCC, { .sw = { SW_TABLET_MODE, 1 } } }, /* Press */ > { KE_SW, 0xCD, { .sw = { SW_TABLET_MODE, 0 } } }, /* Release */ > > Thanks. If I add those lines to intel_vbtn_keymap and remove the two special cases for 0xCC and 0xCD, it does work, but only if I explicitly call input_sync(priv->input_dev) after sparse_keymap_report_event() otherwise i don't get the event (cheching for instance with evtest) until a sync gets called (i tried to put the sync only for 0xcd and in that case i get both 0xcc and 0xcd when i go out of tablet mode) -- Marco Martin