Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp592989iob; Thu, 28 Apr 2022 08:22:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxBvFj5S8paWMvXQUGknbQ1W+FvFByeP0+AeCRWueKol9LMj9IniGL081r8NDiJMA+s9gSk X-Received: by 2002:ac2:5192:0:b0:471:fcc4:b3ff with SMTP id u18-20020ac25192000000b00471fcc4b3ffmr18595987lfi.488.1651159328315; Thu, 28 Apr 2022 08:22:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651159328; cv=none; d=google.com; s=arc-20160816; b=rMhdIPGnXbZQGJ0nfYaDo5fBpdRHVjOeeOJEJxSZWKM7yVK+w+883/4xZ+DCqROkPb RgDXUHIdXgD5fGCy7+jIA0FhJxA4ZMEsgaUuGlzfS40SeLYeesDpwD4qaGTp7aA3Pr8K GBGAOS2xVdRzggOc8VwAbUDCfqQKzCeXclrKpaPKkwZD1SnarMoxioB4D9rSQQVRCvUk Egeki1ElNhnREnfpLcXlyk1x6SF2LBsc93DMyEYXYk1WRhOIwdRGcwq3MP/16aWkNx5w co8sc4ud4C99hNciVtRZQghoJUomEIVJQociG5dHmo630WVZp6OHAhw2u8eQBZWdtzdt gpHw== 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=AOUBjawPmRnN8evNXoYGp+/SwIc2Lx8wXlLCMbXCewc=; b=BUuVjVmkybuqLzV3IIxhN7Z9dpibFzh3ob7BL57RnEeZ+K/GYgB31dSs29NU1z4bux iLC0tcjXipXFeFYB5YA6KU7Bn0hWNuf6iKW23nwaPPJcDNrtDt3OMpjx2X5liV8ZF4IK r9ol91MzBSFnhJXgMh9VBdTOjH/rQRJVmZ8FYHod4lXOhpjsLIHrk6SCjhnyEqsBw+fL 53RwiDYBXgHhuUC6D1kH8I29fF/KsUzthGM636abhNFbtJjtOk7WHZ8fkVv4H6kU8BCS GSzR24dzacEA1RGp92GoJtXnjnnCWROhkvOfv2QBeJPL/8tH/gR5WPlCY33DxGblFVng K6lA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=eFFoq6Cz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p2-20020a056512234200b0046d0545f03csi4912885lfu.58.2022.04.28.08.21.39; Thu, 28 Apr 2022 08:22:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=eFFoq6Cz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S243844AbiD1G1l (ORCPT + 99 others); Thu, 28 Apr 2022 02:27:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39292 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243792AbiD1G1e (ORCPT ); Thu, 28 Apr 2022 02:27:34 -0400 Received: from mail-oi1-x22d.google.com (mail-oi1-x22d.google.com [IPv6:2607:f8b0:4864:20::22d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A67E6972FC for ; Wed, 27 Apr 2022 23:24:20 -0700 (PDT) Received: by mail-oi1-x22d.google.com with SMTP id s131so4410126oie.1 for ; Wed, 27 Apr 2022 23:24:20 -0700 (PDT) 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=AOUBjawPmRnN8evNXoYGp+/SwIc2Lx8wXlLCMbXCewc=; b=eFFoq6CzQtllJEhFXdGNNINBsySKH5Zogv5JnVRsgWjDI/7/fCM0iXGbg8y44gNgYE CVtURwJlXlwY2byoC7a7YrZDuayY5qI04K0A0/BYFxuA1Bx1/JQEs7610miyQQZ86ZTl dc/ZUERs0AX151PR25GDPOP78Pmgug2/iGiK4= 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=AOUBjawPmRnN8evNXoYGp+/SwIc2Lx8wXlLCMbXCewc=; b=5AnykhMwqZH4n405dQO+8N2zBIJm4hDp5YjLyNl5xArj+o4fEShSHzNWI4oTMW4Sah 2KbCCmWFylOQLWJvhJchDFb3QmVJZKQcWpbF+uWrGlXT5DpZPnw3i2pmN9ZizjYeVbDL h9Om4IrJitfqbwbKbsRb9JSOJrtYPq9FGoRANCDSze+wIEZuOE6g7efVPp9dkyzm0cua dq68+vkXxxsxV2nAEhyS7uhozcj9QQ29g1Meq1EaRPoPPISdsitqRlileBS26Y/CuJMO ey+CS/nQEfWxRLA/0dBS0h4up7Ft1ePTE2rNSUN5HqFeu5q8tz2YEQxfVQUrYm6xr0MN xuLg== X-Gm-Message-State: AOAM5335bjzNEr6g1SoUfhO8NHZv0L1jfpnFUPBEWY8O2jggc2Tuchb9 uZjHOwhRQHcrUkCB7hifZe3Bm07vmy5mvEDICXHuZQ== X-Received: by 2002:a05:6808:1296:b0:325:8fb:68f3 with SMTP id a22-20020a056808129600b0032508fb68f3mr10950982oiw.193.1651127060059; Wed, 27 Apr 2022 23:24:20 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Wed, 27 Apr 2022 23:24:19 -0700 MIME-Version: 1.0 In-Reply-To: <9248da4f-ca04-82f0-2840-a20797c25d2a@linaro.org> References: <20220427203026.828183-1-swboyd@chromium.org> <20220427203026.828183-2-swboyd@chromium.org> <9248da4f-ca04-82f0-2840-a20797c25d2a@linaro.org> From: Stephen Boyd User-Agent: alot/0.10 Date: Wed, 27 Apr 2022 23:24:19 -0700 Message-ID: Subject: Re: [PATCH 1/2] dt-bindings: google,cros-ec-keyb: Introduce switches only compatible To: Dmitry Torokhov , Krzysztof Kozlowski Cc: linux-kernel@vger.kernel.org, patches@lists.linux.dev, Rob Herring , devicetree@vger.kernel.org, Benson Leung , Guenter Roeck , Douglas Anderson , Hsin-Yi Wang , "Joseph S. Barrera III" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Krzysztof Kozlowski (2022-04-27 23:12:47) > On 27/04/2022 22:30, Stephen Boyd wrote: > > If the device is a detachable, this device won't have a matrix keyboard > > but it may have some button switches, e.g. volume buttons and power > > buttons. Let's add a more specific compatible for this type of device > > that indicates to the OS that there are only switches and no matrix > > keyboard present. > > > > Cc: Krzysztof Kozlowski > > Cc: Rob Herring > > Cc: > > Cc: Benson Leung > > Cc: Guenter Roeck > > Cc: Douglas Anderson > > Cc: Hsin-Yi Wang > > Cc: "Joseph S. Barrera III" > > Signed-off-by: Stephen Boyd > > --- > > .../bindings/input/google,cros-ec-keyb.yaml | 12 +++++++++--- > > 1 file changed, 9 insertions(+), 3 deletions(-) > > > > diff --git a/Documentation/devicetree/bindings/input/google,cros-ec-keyb.yaml b/Documentation/devicetree/bindings/input/google,cros-ec-keyb.yaml > > index e8f137abb03c..edc1194d558d 100644 > > --- a/Documentation/devicetree/bindings/input/google,cros-ec-keyb.yaml > > +++ b/Documentation/devicetree/bindings/input/google,cros-ec-keyb.yaml > > @@ -15,14 +15,20 @@ description: | > > Google's ChromeOS EC Keyboard is a simple matrix keyboard > > implemented on a separate EC (Embedded Controller) device. It provides > > a message for reading key scans from the EC. These are then converted > > - into keycodes for processing by the kernel. > > + into keycodes for processing by the kernel. This device also supports > > + switches/buttons like power and volume buttons. > > > > allOf: > > - $ref: "/schemas/input/matrix-keymap.yaml#" > > > > properties: > > compatible: > > - const: google,cros-ec-keyb > > + oneOf: > > + - items: > > + - const: google,cros-ec-keyb-switches > > + - const: google,cros-ec-keyb > > + - items: > > + - const: google,cros-ec-keyb > > > > In such case matrix-keymap properties are not valid, right? The > matrix-keymap should not be referenced, IOW, you need to move allOf > below "required" and add: > if:not:...then: $ref: "/schemas/input/matrix-keymap.yaml > Eventually that sounds doable, but for the time being I want to merely add this new compatible in front of the original compatible so that updated DTBs still work with older kernels, i.e. the switches still get registered because the driver works with the original google,cros-ec-keyb compatible. Given that none of the properties are required for google,cros-ec-keyb it didn't seem necessary to make having the google,cros-ec-keyb-switches compatible deny the existence of the matrix-keymap properties.