Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp726945pxb; Fri, 14 Jan 2022 15:07:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJyD7iZxReBcbEQAFoPECUVRkKbVaLTinLDP4mtXUWtsgQUx0rRZ4STp6eHxM4KyIlRNPCKi X-Received: by 2002:aa7:8889:0:b0:4c2:287d:2f88 with SMTP id z9-20020aa78889000000b004c2287d2f88mr7791079pfe.12.1642201648164; Fri, 14 Jan 2022 15:07:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642201648; cv=none; d=google.com; s=arc-20160816; b=vdHw1oTxWU344hBOE/pc7v/SnBrd+6qyQTrcmofiTaBd9dpBGfR/lL7qbEoc6KjvEp vQuFHSlx5m51oZpPxz61AzvQzTo3Clg+3qfu19Ix9bHx5EFxISpTMN8QuGI6HZbFVCj8 ewGSiF4SadIXwpETuUeh7L0jkDaJ0bBOL/yrzRFEtjs8OyaycA9koIYlkEoc1Ew30OPD vX6RF6E+V/iR+AldIrj36dDThXDFHkLzfgRfXp5j8bTNMk/oVM+JxVSU9YZ3mx+S29uu dJbTk9W06WeLiEHNJj4Efkwhdto1lONYoXD2eexGmz30Vxy4NjzUem1M9RemlocypXJt lF2g== 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:user-agent:from :references:in-reply-to:mime-version:dkim-signature; bh=kZlcK6bzk2i8yDVBkb61iS5h5fQfrdP5oTJGQdHluU8=; b=VEuCIYGKDTUJiCeQ68HDkwnGw0mXoB2uzRPRldzZlz4HGM+r1hHJX5YrDf/Ih75HMm lHNLdVyW/EIXOUuybFg7yGnmYTGB6vzxRi6yxRS0J8DkFMWRgVpHdnJuDIQCiHwYZwyL sEWAtgVbDfqZ3MulCqVZ6ErH2iMr+L4qcOsdWZDrGJXqMIAQ+z8AKj9eJEhs2Te3XSe0 GC/coD8FFVmc6K50Mi8WrUb6np4xd23GLqDkYfRtqgB6Rce5iMXa+uAHj/1kxEJLH9js Ps9usfnmwp8b3Olaf7edk0KqZ/txeTu8Lfz8ZoN8LoKwdn59UZRJsnwqJGQD2PY5cd9c weRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=TsQm+oAz; 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 y15si6707099plp.88.2022.01.14.15.07.15; Fri, 14 Jan 2022 15:07:28 -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=TsQm+oAz; 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 S229507AbiANUzv (ORCPT + 99 others); Fri, 14 Jan 2022 15:55:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55046 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229452AbiANUzu (ORCPT ); Fri, 14 Jan 2022 15:55:50 -0500 Received: from mail-ot1-x332.google.com (mail-ot1-x332.google.com [IPv6:2607:f8b0:4864:20::332]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6467CC061574 for ; Fri, 14 Jan 2022 12:55:50 -0800 (PST) Received: by mail-ot1-x332.google.com with SMTP id c3-20020a9d6c83000000b00590b9c8819aso11506983otr.6 for ; Fri, 14 Jan 2022 12:55:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:in-reply-to:references:from:user-agent:date:message-id :subject:to:cc; bh=kZlcK6bzk2i8yDVBkb61iS5h5fQfrdP5oTJGQdHluU8=; b=TsQm+oAzKNnCJ4v024+FpUVdSx0j6IuMd+HlMYnTIuQfYA4xMIFvWyEkWD7qgiPmqk WYwR7hi3YJ2qM5lSGaQRvov0csEpAdxMoJk85UB5SOeAqACTVZQPYhi/AJuwY5kXHXI/ Q5hJgwUHVrXBKac+U2t6XQ3I0l0SIvlxe8wVA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:in-reply-to:references:from :user-agent:date:message-id:subject:to:cc; bh=kZlcK6bzk2i8yDVBkb61iS5h5fQfrdP5oTJGQdHluU8=; b=CrweXgZk+O5RAp9U+Hm1cT5nDxBMj7b1k11ZTn4xB5nzfx9Pm2t+D14LY/jG9UaxrX ooc/7CKZoOnCKY7ZiwL7jNqvtF/JgBb3/M72c+0XhxxLpegsIWqhAPu6aEOmK+oc9tjn QwEV1C7NhrJQgbNWpglBJ6zwhPQnlgzMqud6iS2t8c8f0vcWDlVqrDIofCKNmkG8shEF Kg3eMvoxXei7DF6zj+rSM0BxzP1LDOumNPr9clbbWITvTSbjx4/JVCRhqtQ+YckEFpj0 8KoPxbj6fSbMvbMxlSKgYRgHwk03gMEt+J+p6mQKMX8jsgoT1rxyZkDGokf/CISgFk3l OHJw== X-Gm-Message-State: AOAM532LEaLP0rpxb0ZMOlbnvaeme7SiTARKkIjaktrZebRhZmrSDuG5 nKy13DwWF5zC33H/eCTitNX3sILCnqmO3Nw/7nLh9A== X-Received: by 2002:a9d:2243:: with SMTP id o61mr8151551ota.126.1642193749461; Fri, 14 Jan 2022 12:55:49 -0800 (PST) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Fri, 14 Jan 2022 14:55:49 -0600 MIME-Version: 1.0 In-Reply-To: References: <20220107091357.28960-1-xiazhengqiao@huaqin.corp-partner.google.com> From: Stephen Boyd User-Agent: alot/0.10 Date: Fri, 14 Jan 2022 14:55:49 -0600 Message-ID: Subject: Re: [PATCH v2] HID: google: modify HID device groups of eel To: Dmitry Torokhov Cc: Jiri Kosina , Zhengqiao Xia , benjamin.tissoires@redhat.com, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, dianders@chromium.org, Wei-Ning Huang , Nicolas Boichat , "Sean O'Brien" , phoenixshen@chromium.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Dmitry Torokhov (2022-01-14 11:59:50) > On Fri, Jan 14, 2022 at 01:25:12PM -0600, Stephen Boyd wrote: > > > > My understanding is that 'vivaldi' is mostly a keyboard layout and > > 'hammer' is a detachable keyboard. We want to prevent the hid-vivaldi > > driver from probing this particular device because the hid-vivaldi > > driver doesn't know about detachable keyboards. Hammer devices also > > support 360 degree wraparound so we know that the keyboard has been put > > behind the screen or that it's being used to stand up the device on a > > table. > > > > Given all that, I'm still confused. If we make the hid-google-hammer > > driver probe this device and the keyboard layout is vivaldi then we'd > > want the part of the vivaldi driver that exposes the > > function_row_physmap through sysfs. Otherwise userspace won't know how > > to handle the function row properly. I think we need the device to stack > > two drivers here. Does that happen with HID? > > As far as I know HID does not easily allow "stacking" drivers like that. Ok. > > Probably the easiest way would be to export vivaldi_feature_mapping() > and the show method for the physical row map and call them from the > hammer driver. > I worry about builtin vs. modular drivers so probably ought to make some hid-vivaldi-common.c file that has the physmap code and then have both drivers call that mini-library. The 'vivaldi_data' structure would need to be figured out too. The hammer driver stores 'hammer_kbd_leds' in the hid_get_drvdata() whereas the vivaldi driver stores 'vivalid_data' so we can't simply call the show method for the sysfs attribute without some minor surgery.