Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp3840978pxb; Fri, 11 Feb 2022 08:54:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJzDRGNXj7utm+BclMGNaK+Vr8pUTy7hh87dOhdUi9yGR5BN1WXZQ3+1d5vb2Y49G7o6/a4z X-Received: by 2002:a05:6a00:2386:: with SMTP id f6mr2529370pfc.37.1644598459658; Fri, 11 Feb 2022 08:54:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644598459; cv=none; d=google.com; s=arc-20160816; b=h0RUwxNm004TT+SWvPHbcVzrv0iL0Ru2Be/lFeRcvPf6N3veX0vHRpeiSsZ/6KLfZ+ tzz9dCDSccQDauqKSeBLhR7e419oz21gh8lQ/Sgbdq8+Pmbd6vCc/2Iszw04IQ36E2va oXRyG8soUFhjlPkNZfXnztSPnWB5LXtPh5RYtxcEsl2eIrNVn/RmMZMnmszuTN0T4qCv pbqpUpq1keRuqxpNORFL2UoL4jojGSYrhMmVZU7MCdnZK4W1zPZkGdPpWwbgeM1JtUsU KeaNW0Z0OIWI4I0c26MCebSjp8OmwMmYN5bmrlb3FeJr8xyTF7L8eMxfqNNPyCy7mmSs JYJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=MM9ApSYTqG0qCaN/6ztjyk0y0g35LdmJiBEhnwEn+Vs=; b=bFSPPIWmnzLWNS45GsAt+jnMqQtQfL0bjhTXr0Y11JT77o5E1QuU/UicZBvkxcuhv4 5cn+c///ArkYFxBdPBFyS5ATYPug78v3gHNESCFS5JEnxzscnjnz14rF4+z7IVYcKPZW 7BB5BOo4BVwmSJKHLySNFMe4tPs27tJgAG1IxrwClmKwgeVYd9MgGdMAIiRjz38wykMx lRJxIibu1lL6H/B0UHN2553fjJYr0wgBkpAwQxpVPIuBDBduHwLcY6RmWjYJzPaIHchA a8m+ryiY5z8kOnPqz93thUsbT1GHuBuHgsaqb4mHwyXeKTz9POuPjJGnteoC1WFOWE0g vS2g== ARC-Authentication-Results: i=1; mx.google.com; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n9si5102984plk.379.2022.02.11.08.54.05; Fri, 11 Feb 2022 08:54:19 -0800 (PST) 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; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350496AbiBKNXs (ORCPT + 99 others); Fri, 11 Feb 2022 08:23:48 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:49614 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235417AbiBKNXr (ORCPT ); Fri, 11 Feb 2022 08:23:47 -0500 Received: from mail-io1-f44.google.com (mail-io1-f44.google.com [209.85.166.44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B2D8ECCF; Fri, 11 Feb 2022 05:23:43 -0800 (PST) Received: by mail-io1-f44.google.com with SMTP id i62so11338715ioa.1; Fri, 11 Feb 2022 05:23:43 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=MM9ApSYTqG0qCaN/6ztjyk0y0g35LdmJiBEhnwEn+Vs=; b=G3jYmly2nC8jwaK5Odo834nFXDY+6SXtX4buCdZZMLTHr+sK349Ji4SGQOHr62lfnM GagNajcYW+REuDmWXG0y3tUXG4pY0YhKfsHLyTFgTtaKcMEhYMPowjo1wLlq+TMsZLNv nDoT+CJAsYYupkEbgccpVklssBDNILggwNdctk9nUxdWpNAOS1Iz0sHq5xy+FI3O19RO FKkU2gVueGgtaTubb6LYPYidd4/erQJeZ0Gk/yoaZddW6gq6Ph4HLEDdKoY0JzisClf+ Nt4PAGzJsUTVk16I+gkpFAX0WWk9igqqskFOOsskUVZ/yxbyaDyaJNEuWefrgk273x9q 56lw== X-Gm-Message-State: AOAM5328V9tfDo/Z9U5i04F+g4lb3QqtP4dkFwUaYiQOQsYo4YmAV75F gXvkVa+/4nKgVWX1TnaW8EFlUGmQBA== X-Received: by 2002:a05:6638:3003:: with SMTP id r3mr812384jak.239.1644585822896; Fri, 11 Feb 2022 05:23:42 -0800 (PST) Received: from robh.at.kernel.org ([172.58.139.71]) by smtp.gmail.com with ESMTPSA id k1sm13382645iov.6.2022.02.11.05.23.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Feb 2022 05:23:42 -0800 (PST) Received: (nullmailer pid 249238 invoked by uid 1000); Fri, 11 Feb 2022 13:23:38 -0000 Date: Fri, 11 Feb 2022 07:23:38 -0600 From: Rob Herring To: Samuel Holland Cc: Dmitry Torokhov , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-i2c@vger.kernel.org, Wolfram Sang , Ondrej Jirman Subject: Re: [PATCH 1/5] dt-bindings: input: Add the PinePhone keyboard binding Message-ID: References: <20220129230043.12422-1-samuel@sholland.org> <20220129230043.12422-2-samuel@sholland.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220129230043.12422-2-samuel@sholland.org> X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no 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 On Sat, Jan 29, 2022 at 05:00:38PM -0600, Samuel Holland wrote: > Add devicetree support for the PinePhone keyboard case, which provides a > matrix keyboard interface and a proxied I2C bus. > > Signed-off-by: Samuel Holland > --- > > .../input/pine64,pinephone-keyboard.yaml | 90 +++++++++++++++++++ > 1 file changed, 90 insertions(+) > create mode 100644 Documentation/devicetree/bindings/input/pine64,pinephone-keyboard.yaml > > diff --git a/Documentation/devicetree/bindings/input/pine64,pinephone-keyboard.yaml b/Documentation/devicetree/bindings/input/pine64,pinephone-keyboard.yaml > new file mode 100644 > index 000000000000..00f084b263f0 > --- /dev/null > +++ b/Documentation/devicetree/bindings/input/pine64,pinephone-keyboard.yaml > @@ -0,0 +1,90 @@ > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/input/pine64,pinephone-keyboard.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: Pine64 PinePhone keyboard device tree bindings > + > +maintainers: > + - Samuel Holland > + > +description: > + A keyboard accessory is available for the Pine64 PinePhone and PinePhone Pro. > + It connects via I2C, providing a raw scan matrix, a flashing interface, and a > + subordinate I2C bus for communication with a battery charger IC. > + > +allOf: > + - $ref: /schemas/input/matrix-keymap.yaml# > + > +properties: > + compatible: > + const: pine64,pinephone-keyboard > + > + reg: > + const: 0x15 > + > + interrupts: > + maxItems: 1 > + > + linux,fn-keymap: This should be handled in a common way. Not sure if there's anything existing for alternate key maps. Child nodes of alternate maps would scale better than new property name for every alternate map. Or you could make linux,keymap contain multiple maps (e.g. 2x XxY entries) Or if the map doesn't change, just put it in the driver. > + $ref: /schemas/input/matrix-keymap.yaml#/properties/linux,keymap Referencing individual properties should be avoided. > + description: keymap used when the Fn key is pressed > + > + wakeup-source: true > + > + i2c-bus: > + $ref: /schemas/i2c/i2c-controller.yaml# > + > +dependencies: > + linux,fn-keymap: [ 'keypad,num-columns', 'keypad,num-rows' ] > + linux,keymap: [ 'keypad,num-columns', 'keypad,num-rows' ] > + > +required: > + - compatible > + - reg > + - interrupts > + > +unevaluatedProperties: false > + > +examples: > + - | > + #include > + #include > + > + i2c { > + #address-cells = <1>; > + #size-cells = <0>; > + > + keyboard@15 { > + compatible = "pine64,pinephone-keyboard"; > + reg = <0x15>; > + interrupt-parent = <&r_pio>; > + interrupts = <0 12 IRQ_TYPE_EDGE_FALLING>; /* PL12 */ > + keypad,num-rows = <6>; > + keypad,num-columns = <12>; > + linux,fn-keymap = + MATRIX_KEY(0, 1, KEY_F1) > + MATRIX_KEY(0, 2, KEY_F2) > + /* ... */ > + MATRIX_KEY(5, 2, KEY_FN) > + MATRIX_KEY(5, 3, KEY_LEFTALT) > + MATRIX_KEY(5, 5, KEY_RIGHTALT)>; > + linux,keymap = + MATRIX_KEY(0, 1, KEY_1) > + MATRIX_KEY(0, 2, KEY_2) > + /* ... */ > + MATRIX_KEY(5, 2, KEY_FN) > + MATRIX_KEY(5, 3, KEY_LEFTALT) > + MATRIX_KEY(5, 5, KEY_RIGHTALT)>; > + > + i2c-bus { > + #address-cells = <1>; > + #size-cells = <0>; > + > + charger@75 { > + reg = <0x75>; > + }; > + }; > + }; > + }; > -- > 2.33.1 > >