Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp14176069pxu; Mon, 4 Jan 2021 15:13:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJzhMCJ73JgOOZP4ASrrIUV6f92iKtCSr285Lfpue1TChsMbhvud4wEpni4ZFvPuxbMn7TrH X-Received: by 2002:a17:906:440e:: with SMTP id x14mr29357999ejo.77.1609802025881; Mon, 04 Jan 2021 15:13:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609802025; cv=none; d=google.com; s=arc-20160816; b=zexybbA0oiHGOue5Z+AmOsR9NlNQLrc/nA5Yar7MToYeX2YtRHJEnw/o+kPlQ/rWXU f9dWueLKcBmt7TRTMW0+m7mzVMA9otJjGm/3elIPVRjB+sjcYsaPMfDCbabCZlxIYLxH 4tj+eCuLFessGBeOY3R0dKsPpTp0gF4MCjZNXvnpNrgXPQTeFR8yiqHXsKLbQ2mpyikW vWtS27WbaE2+bflNd4nXSrZSZ8kTp8jo1AfD/szd3NQGmR2mXFf732yNDHvddX5bHKra gq472qElqjizsSHpSZhQP2DArViPxTeL+wNBpEVhTCcShETEZFwnkV3XriY2dk6Htua/ OHKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=LEWGfdV8Yj5a/4AFisJXqWYzLURVQ8ThVGoTlvlWYCM=; b=F0IuTQIL3tBmpRS7S6GfQ7rZGr4d8Wua4MWoTeToFgaN7UhI91id6OBMfwP8rt6UKx e6ZRoVMeOl5bbvgH1eaAmtSMoF6RbXqui6oek/JzAlToK2ixVBPoTmOYZ5pEqXvfxPVz iOQCFnxB8Jd+2ut3o1liiRYge4NTJSfIXf1GBdcaGTHOdR2Z1i5AOIEOJAUojT5e03gr ANfx72qAMWISSnr/KzFLXhC4xBnWCQC0o9phxJXy0Rmn2BWg2xtXmNOENmtqBgkibbra 0yPhR1Fy+DYKIsqHy5mu7G9vwOpTtkUkayy1MgQI9Xa0U5DAhVEhI8oUTDn6ktKWPZLk IfAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=BJY4huj1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e8si31988706edq.377.2021.01.04.15.13.22; Mon, 04 Jan 2021 15:13:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=BJY4huj1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727559AbhADXL3 (ORCPT + 99 others); Mon, 4 Jan 2021 18:11:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55558 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727410AbhADXL3 (ORCPT ); Mon, 4 Jan 2021 18:11:29 -0500 Received: from mail-ot1-x330.google.com (mail-ot1-x330.google.com [IPv6:2607:f8b0:4864:20::330]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E76E8C061794 for ; Mon, 4 Jan 2021 15:10:48 -0800 (PST) Received: by mail-ot1-x330.google.com with SMTP id j12so27628131ota.7 for ; Mon, 04 Jan 2021 15:10:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=LEWGfdV8Yj5a/4AFisJXqWYzLURVQ8ThVGoTlvlWYCM=; b=BJY4huj1LdwJ5sWUg9sXExNo9KfO6MpSVjQOHGNyROMlWv5ZVEF9cIP/OjwEyBUVTm OaLzCfktucm1gfZCIAhwi9Shv3etzneUnK5ue3ShHLMSgQ2UiMSgGb/HAsdTUep3xnpc DXnuJq5TN15dYMHAFQw4XWhm4T6nBQeAz497g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=LEWGfdV8Yj5a/4AFisJXqWYzLURVQ8ThVGoTlvlWYCM=; b=PGjpZBDXNtyT8sYb0LnJ8b86uaTgGLEry83Tl/3WMQr0ux/EZ57oHhtW8h1It1laN+ 6daI3c06zBHrBiimdy1RoeoiTJ5HAJGKAP2iPq6E8JL802ZppbfwI+ZhpBp2S3Bx65SN 3UgkPV/RYYLD8jUV/mOADSsMwTkHYhRHcyTHMwKo7aIKrzy+xYuA4UqdkyqQni7yFfCH eSpzxZXRkPLQX18FHNh3WDWvvQMd50Kz6bLxe6QELiynSYhuoA8aWB8PsAgp8h8hBuCK 3UOM9rjaoujtiFm0gvnadEQK5EdhGnVn77yr1bnok/1Z9aY47os/y5tCn+vafEDONqjs pdlQ== X-Gm-Message-State: AOAM531oUAVNiccZj5vOatf0M1KTWe6xHnAWKaCx6kMXRKMeShP0SurS oHXWDTbMmdPGZks4YwiNDQNQocLncaKJvQsJPEaiyIRHKuk= X-Received: by 2002:a25:1104:: with SMTP id 4mr87231388ybr.476.1609801397150; Mon, 04 Jan 2021 15:03:17 -0800 (PST) MIME-Version: 1.0 References: <20201221174751.1.I025fb861cd5fa0ef5286b7dce514728e9df7ae74@changeid> In-Reply-To: From: Philip Chen Date: Mon, 4 Jan 2021 15:03:06 -0800 Message-ID: Subject: Re: [PATCH 1/3] dt-bindings: input: cros-ec-keyb: Add a new property To: Dmitry Torokhov Cc: LKML , Dmitry Torokhov , Stephen Boyd , Douglas Anderson , Rajat Jain , Benson Leung , Enric Balletbo i Serra , Guenter Roeck , Rob Herring , Simon Glass , devicetree@vger.kernel.org, linux-input@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Dmitry, On Sun, Jan 3, 2021 at 2:48 PM Dmitry Torokhov wrote: > > Hi Philip, > > On Sat, Jan 02, 2021 at 10:11:21PM -0800, Philip Chen wrote: > > Hi Dmitry, > > > > I have one more question below. > > Could you take a look? > > > > On Sat, Jan 2, 2021 at 8:53 PM Philip Chen wrote: > > > > > > Hi Dmitry, > > > > > > I see. > > > I'll update these patch sets shortly based on your suggestion. > > > Thanks. > > > > > > On Sat, Jan 2, 2021 at 1:04 PM Dmitry Torokhov > > > wrote: > > > > > > > > On Sat, Jan 02, 2021 at 11:39:34AM -0800, Philip Chen wrote: > > > > > Hi Dmitry, > > > > > > > > > > Thanks for reviewing my patch over the holiday season. > > > > > Please check my CIL. > > > > > > > > > > On Mon, Dec 28, 2020 at 10:18 PM Dmitry Torokhov > > > > > wrote: > > > > > > > > > > > > Hi Philip, > > > > > > > > > > > > On Mon, Dec 21, 2020 at 05:47:57PM -0800, Philip Chen wrote: > > > > > > > This patch adds a new property `google,custom-keyb-top-row` to the > > > > > > > device tree for the custom keyboard top row design. > > > > > > > > > > > > Why don't we use the property we have for the same purpose in atkbd.c? > > > > > > I.e. function-row-physmap? > > > > > > > > > > > Because this property serves a different purpose than function-row-physmap. > > > > > `function-row-physmap` basically links the scancode to the physical > > > > > position in the top row. > > > > > `google,custom-keyb-top-row` aims at specifying the board-specific > > > > > keyboard top row design associated with the action codes. > > > > > > > > > > In x86 path, the board-specific keyboard top row design associated > > > > > with the action codes is exposed from coreboot to kernel through > > > > > "linux,keymap" acpi table. > > > > > When coreboot generates this acpi table, it asks EC to provide this > > > > > information, since we add the board-specific top-row-design in EC > > > > > codebase. > > > > > (E.g. https://chromium.googlesource.com/chromiumos/platform/ec/+/refs/heads/main/board/jinlon/board.c#396) > > > > > > > > > > In ARM, we don't plan to involve EC in the vivaldi support stack. > > > > > So `google,custom-keyb-top-row` DT property is our replacement for the > > > > > board-specific top-row-design in x86 EC codebase. > > > > > > > > I disagree with this decision. We already have "linux,keymap" property > > > > that is supposed to hold accurate keymap for the device in question, > > > > there should be no need to introduce yet another property to adjust the > > > > keymap to reflect the reality. If a device uses "non classic" ChromeOS > > > > top row it should not be using the default keymap from > > > > arch/arm/boot/dts/cros-ec-keyboard.dtsi but supply its own. You can > > > > consider splitting the keymap into generic lower portion and the top row > > > > and moving them into an .h file so they can be easily reused. > > > > > > > > > > > > > > > Also, instead of specifying keycodes in this array we should use > > > > > > combination of row and column identifying keys, like this: > > > > > > > > > > > > function-row-physmap = < > > > > > > MATRIX_KEY(0x00, 0x02, KEY_F1), > > > > > > MATRIX_KEY(0x03, 0x02, KEY_F2), > > > > > > ... > > > > > > >; > > > > > > > > > > This mapping between row/column to function keycode is fixed for all > > > > > Chrome OS devices. > > > > > > > > *for now* The mapping for the rest of the keyboard has also stayed > > > > static, but we still did not hardcode this information in the driver but > > > > rather used DT property to pass it into the kernel. > > > > > > > > > So we don't really need to host this information in DT. > > > > > Instead, I plan to hardcode this information in cros_ec_keyb.c. > > > > > (Please see the array "top_row_key_pos[]" in my next patch: "[2/3] > > > > > Input: cros_ec_keyb - Support custom top-row keys".) > > > > > > > > > > The only thing that could make the function-row-physmap file different > > > > > among boards is the number of top row keys. > > Given the reason above, can we just add `num-top-row-keys` property > > instead of the whole `function-row-physmap`? > > I think this is the only thing cros_ec_keyb needs to know to generate > > the board-specific function-row-physmap file for the userspace. > > This would mean that we need to hard-code the knowledge of the scan > matrix in the driver and will not allow us to "skip" any keys in the top > row. Given that we did not hard-code the keymap I do not see why we > would want to do it differently with the top row. function-row-physmap > provides greatest flexibility and I do not see any downsides. OK. I updated in v2. PTAL. Thanks. > > Thanks. > > -- > Dmitry