Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp13016448pxu; Sat, 2 Jan 2021 22:15:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJwGRP8BfB5ew8puu8RbMOZ3MZHJ8ri4EuRpOG+fc88Lfo8Hou3RKh8lsunlcJgu789RLoSY X-Received: by 2002:a17:906:3513:: with SMTP id r19mr61458492eja.445.1609654527162; Sat, 02 Jan 2021 22:15:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609654527; cv=none; d=google.com; s=arc-20160816; b=Yl/jg0knlKuGrvcag1PP2kR20KXI/Oacud5ziGaO8WEMbrv4RplbirEHvhLaCf+qZL LZgg8ikrrguIzKwjl7akeYlWCOC0FHF0SroWKQCTPlherofQRQ0EpfCsA1PIzrcyesjH pqz4qwPNmwbnMfZjnk/t52kSt6K8KVx7sPPpgLP4Y5i+0NLGaSqslFfuJgn9BTNhNre0 syAmQMOHkXAzKCqDiOkKxV3uDnDAMy9l7Sk6fkYP/JkIcly3WryuPSndsNLuPhvIB0gZ Xkhyik1n5hrYMOhAYCzyhqa/gm3O6ThgkH+KAEz8Xqba1fd53KHL+rfvJD4FZ0Zs8SF6 nIcQ== 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=iiHJnyrL5LIBAMIKXhUssKUqnF6E26od/cVwR56xkmI=; b=JAKWckGwHtdOsW/z3wRA/u2pEuQ1kjxCGTkcvCxz2rRmYzt+WaN+Jv8wFiOOq57D+J mTj/zTSw3MxhX6Qs1OvubJnD7cy2KKY5Vk6V7MqHx3df48zlDKTdunSoeysL4tiw5CWu lRnTgmErfFgxowBFFhu51/6YxRosrpXwBegnJnkWHJro/XvPWsM5bujE9vZZcwZIy41u s0vCFCitCD61lbUmqM39D2lfg/K6oDK5dElu7WiAThDTgM9rAcbnbQxl2c8BSvNyu9Xh XEHbK0gQ40bLPeoGYQinugHMpG3up/NocLvzcdlv2htmxyxzKqGhw7GPe2PDWb0trF6A rMhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=adVrHwa6; 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 gt24si27943738ejb.248.2021.01.02.22.15.04; Sat, 02 Jan 2021 22:15:27 -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=adVrHwa6; 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 S1726236AbhACGMO (ORCPT + 99 others); Sun, 3 Jan 2021 01:12:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725981AbhACGMN (ORCPT ); Sun, 3 Jan 2021 01:12:13 -0500 Received: from mail-yb1-xb31.google.com (mail-yb1-xb31.google.com [IPv6:2607:f8b0:4864:20::b31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E809C061573 for ; Sat, 2 Jan 2021 22:11:33 -0800 (PST) Received: by mail-yb1-xb31.google.com with SMTP id v67so23028754ybi.1 for ; Sat, 02 Jan 2021 22:11:33 -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=iiHJnyrL5LIBAMIKXhUssKUqnF6E26od/cVwR56xkmI=; b=adVrHwa6nmw1oMwRWq1FMK19JXoFTxvKss4mEl8b7IRGnXqBYAKy9KvW6BXNELLwvy KqeAveILRKLXW2/cRNjYfL4G1Oc5l+F0hmNnugRbhZVFs/UKqbnKPaz4anHUUPXBVc5j FC6/JUD1/UD0Em8owZCnPYQP+EJmt3bq7grkY= 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=iiHJnyrL5LIBAMIKXhUssKUqnF6E26od/cVwR56xkmI=; b=AkY++NT7ARLGeed3QPGmFTfm+EW4W6FyOLtFn5OwrmJosXrhfHN1vCImc9XHVXfXNd euSe1N+khDZ/k8lq/cV1lScuOLksMoaacesC0Yf6/3p6ZbmWhZpty7le6F/gryvtzS+5 zWlgE2gMzaUugL43Samn2utxE0C+Ow5PAcn+WxNqqx8gnrLQTSGIcNeMs41V0N5jyILc YDdIGUFLcN7P5uBbdBSLwb8ZRlp53TUeAUGWKic7OPSLphsxKOkNIkDgCdoUaxamFEEo IFCXKxZj9EIxoVPV6QlRzBT3sCWpXcXzAlq0TGB4HOfQ87V4zb+T2vbDqH1nIopvhPd4 XNfA== X-Gm-Message-State: AOAM532D1zwfqMrBVyzaJ6CMZOOkhxkEjndAF25tcP0GbeDeIyqbelLS L2Q2SxNPUfAtA276U7x+hsycnlE6km2rgY80uQzHaw== X-Received: by 2002:a25:348a:: with SMTP id b132mr100338042yba.378.1609654292626; Sat, 02 Jan 2021 22:11:32 -0800 (PST) MIME-Version: 1.0 References: <20201221174751.1.I025fb861cd5fa0ef5286b7dce514728e9df7ae74@changeid> In-Reply-To: From: Philip Chen Date: Sat, 2 Jan 2021 22:11:21 -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, 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. > > > But this information can be derived from the length of > > > `google,custom-keyb-top-row`. > > > So we don't need a separate DT property for it. > > > > I am sorry, but I must insist. We need to have: > > > > - accurate keymap in linux,keymap property > > - a separate property describing location of top row keys in terms of > > rows and columns (whether we reuse MATRIX_KEY or define another macro > > I do not really care). > > > > Thanks. > > > > -- > > Dmitry