From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DB083E95A61 for ; Sat, 7 Oct 2023 14:52:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233614AbjJGOwc (ORCPT ); Sat, 7 Oct 2023 10:52:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46534 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229824AbjJGOwb (ORCPT ); Sat, 7 Oct 2023 10:52:31 -0400 Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 20F04BA for ; Sat, 7 Oct 2023 07:52:30 -0700 (PDT) Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-3248aa5cf4eso3036310f8f.1 for ; Sat, 07 Oct 2023 07:52:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696690348; x=1697295148; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=Rr4KS+RdHXPaOwUEhGq6eyCLiCWzkyfb2ZUzhpz1DEU=; b=Hq6qiJSWOntUSDbd34GuxaaxFlkzQjLtBVAB8ahOTbRNAOQxdbBFUiOYm6gylH/0Vv WpNAmJEfcUte4XQ1j7uzT9AEGIn/ZTPOjNNWaULl7+LzL00SNwHS0QrKsMWM1YP3ZOuz cSpxL5ZYHwCDmvZGMUtXFE9Q8EJiPey8hmLuRR2h9ImikfaasW2ZxKCEYn257SF7T86D spj2n2MyZblN/I1RQHxaLrhwUQi2OS96hjwTms1CDs0VbOlokcNk3addKpBUekEW7waI sFufNxaH3qdn+RdP9Ch7P10Lx85L4IpeHTZhPJN23N1mjlRoXhhldFYA1yZMs0sVbAIc uF8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696690348; x=1697295148; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Rr4KS+RdHXPaOwUEhGq6eyCLiCWzkyfb2ZUzhpz1DEU=; b=WTEuctJ5jfwRGaSJa28uaR1EyXqc3o1J2vclb0syY3/4W/w8lRZ/w9kAJhGwcbcQJO E+csPW0Lk1bEyVdTwLr2rZd9qZIs4cMEjManKCpEbgZdeNoTJAUMYb0c+4/t+IBapraj d3cWMw/dhyvn5LA3Uhrh0WDai/o58fH7Qh4EooaAsSTmdnTv5qRmFGniq80fwGNpG949 3qZlh0/YAku9F+1G2/h3dxJXlwNpygJ+S8f/zxbggTgwYJX/A/oVuRuqarskUsAs9CoY QRUqWjVUzm42vSQsDbTF661tRHmpAiuywLiZqxAj/unWP0JhA5XVSGSxJi73oJIN1Bkk nCNQ== X-Gm-Message-State: AOJu0YykubptF6BHXkSwEQVkoeYAeJwbM3BdaIQz8eq0gkzVgmGz4HPK xmWY1xFgimEZZpy8T+Iy0ekgHA== X-Google-Smtp-Source: AGHT+IGpxqpdeRFi0ygvuw0BeQessI8LTB38Hfohl4c6vDz4e4I/ahf4vqHBvHUebSJR1/VVlmWPLQ== X-Received: by 2002:a5d:6909:0:b0:314:dc0:2fca with SMTP id t9-20020a5d6909000000b003140dc02fcamr10005226wru.29.1696690348277; Sat, 07 Oct 2023 07:52:28 -0700 (PDT) Received: from [192.168.1.197] (5-157-101-10.dyn.eolo.it. [5.157.101.10]) by smtp.gmail.com with ESMTPSA id i10-20020adff30a000000b0031f8a59dbeasm4414768wro.62.2023.10.07.07.52.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 07 Oct 2023 07:52:27 -0700 (PDT) Message-ID: Date: Sat, 7 Oct 2023 16:52:25 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/2] dt-bindings: Add bindings for Adafruit Seesaw Gamepad Content-Language: en-US To: Anshul Dalal , linux-input@vger.kernel.org, devicetree@vger.kernel.org Cc: Dmitry Torokhov , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Shuah Khan , linux-kernel-mentees@lists.linuxfoundation.org References: <20231007144052.1535417-1-anshulusr@gmail.com> From: Krzysztof Kozlowski Autocrypt: addr=krzysztof.kozlowski@linaro.org; keydata= xsFNBFVDQq4BEAC6KeLOfFsAvFMBsrCrJ2bCalhPv5+KQF2PS2+iwZI8BpRZoV+Bd5kWvN79 cFgcqTTuNHjAvxtUG8pQgGTHAObYs6xeYJtjUH0ZX6ndJ33FJYf5V3yXqqjcZ30FgHzJCFUu JMp7PSyMPzpUXfU12yfcRYVEMQrmplNZssmYhiTeVicuOOypWugZKVLGNm0IweVCaZ/DJDIH gNbpvVwjcKYrx85m9cBVEBUGaQP6AT7qlVCkrf50v8bofSIyVa2xmubbAwwFA1oxoOusjPIE J3iadrwpFvsZjF5uHAKS+7wHLoW9hVzOnLbX6ajk5Hf8Pb1m+VH/E8bPBNNYKkfTtypTDUCj NYcd27tjnXfG+SDs/EXNUAIRefCyvaRG7oRYF3Ec+2RgQDRnmmjCjoQNbFrJvJkFHlPeHaeS BosGY+XWKydnmsfY7SSnjAzLUGAFhLd/XDVpb1Een2XucPpKvt9ORF+48gy12FA5GduRLhQU vK4tU7ojoem/G23PcowM1CwPurC8sAVsQb9KmwTGh7rVz3ks3w/zfGBy3+WmLg++C2Wct6nM Pd8/6CBVjEWqD06/RjI2AnjIq5fSEH/BIfXXfC68nMp9BZoy3So4ZsbOlBmtAPvMYX6U8VwD TNeBxJu5Ex0Izf1NV9CzC3n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XtHtYfPAO5nAkIvKSNp3jmGxZw4aTc5xoAZBLo0OV+Ezo71pg3AYvq0a3/oGRG KQ06ztUMRrj8eVtpImjsWCd0bDWRaaR4vqhCHvAG9iWXZu4qh3ipie2Y0oSJygcZT7H3UZxq fyYKiqEmRuqsvv6dcbblD8ZLkz1EVZL6djImH5zc5x8qpVxlA0A0i23v5QvN00m6G9NFF0Le D2GYIS41Kv4Isx2dEFh+/Q== In-Reply-To: <20231007144052.1535417-1-anshulusr@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org On 07/10/2023 16:40, Anshul Dalal wrote: > A simple driver for a mini gamepad that communicates over i2c, the gamepad > has bidirectional thumb stick input and six buttons. Thank you for your patch. There is something to discuss/improve. Please use subject prefixes matching the subsystem. You can get them for example with `git log --oneline -- DIRECTORY_OR_FILE` on the directory your patch is touching. > > The gamepad chip utilizes the open framework from Adafruit called 'Seesaw' > to transmit the ADC data for the joystick and digital pin state for the > buttons. I have only implemented the functionality required to receive the > thumb stick and button state. > > Steps in reading the gamepad state over i2c: > 1. Reset the registers > 2. Set the pin mode of the pins specified by the `BUTTON_MASK` to input > `BUTTON_MASK`: A bit-map for the six digital pins internally > connected to the joystick buttons. > 3. Enable internal pullup resistors for the `BUTTON_MASK` > 4. Bulk set the pin state HIGH for `BUTTON_MASK` > 5. Poll the device for button and joystick state done by: > `seesaw_read_data(struct i2c_client *client, struct seesaw_data *data)` This describes driver, not bindings or hardware Please instead describe hardware. > > Product page: > https://www.adafruit.com/product/5743 > Arduino driver: > https://github.com/adafruit/Adafruit_Seesaw > > Tested on RPi Zero 2W How can you test bindings on RPi Zero 2W? Somehow I don't believe you, see below. > > Signed-off-by: Anshul Dalal > --- > .../bindings/input/adafruit_seesaw.yaml | 45 +++++++++++++++++++ > 1 file changed, 45 insertions(+) > create mode 100644 Documentation/devicetree/bindings/input/adafruit_seesaw.yaml > > diff --git a/Documentation/devicetree/bindings/input/adafruit_seesaw.yaml b/Documentation/devicetree/bindings/input/adafruit_seesaw.yaml > new file mode 100644 > index 000000000000..1d00d9da637a > --- /dev/null > +++ b/Documentation/devicetree/bindings/input/adafruit_seesaw.yaml Use compatible syntax, so vendor-prefix,device-name.yaml > @@ -0,0 +1,45 @@ > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > +%YAML 1.2 > +--- > +$id: "http://devicetree.org/schemas/input/adafruit_seesaw.yaml#" > +$schema: "http://devicetree.org/meta-schemas/core.yaml#" Drop quotes. It does not look like you tested the bindings, at least after quick look. Please run `make dt_binding_check` (see Documentation/devicetree/bindings/writing-schema.rst for instructions). Maybe you need to update your dtschema and yamllint. > + > +title: Adafruit Mini I2C Gamepad with seesaw > + > +maintainers: > + - Anshul Dalal > + > +description: | > + Bindings for Adafruit Mini I2C Gamepad Drop "Bindings for" > + > + +-----------------------------+ > + | ___ | > + | / \ (X) | > + | | S | __ __ (Y) (A) | > + | \___/ |ST| |SE| (B) | > + | | > + +-----------------------------+ > + > + S -> 10-bit percision bidirectional analog joystick > + ST -> Start > + SE -> Select > + X, A, B, Y -> Digital action buttons > + > + Product page: https://www.adafruit.com/product/5743 > + Arduino Driver: https://github.com/adafruit/Adafruit_Seesaw > + > +properties: > + compatible: > + const: adafruit,seesaw_gamepad > + > +required: > + - compatible > + > +additionalProperties: false > + > +examples: > + - | > + seesaw_gamepad@50 { No underscores, generic node names. Node names should be generic. See also an explanation and list of examples (not exhaustive) in DT specification: https://devicetree-specification.readthedocs.io/en/latest/chapter2-devicetree-basics.html#generic-names-recommendation > + compatible = "adafruit,seesaw_gamepad"; > + reg = <0x50>; Second hint that you did not test it... > + }; Best regards, Krzysztof