All of lore.kernel.org
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
To: Gireesh.Hiremath@in.bosch.com, linux-omap@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-input@vger.kernel.org, bcousson@baylibre.com,
	tony@atomide.com, robh+dt@kernel.org,
	krzysztof.kozlowski+dt@linaro.org, dmitry.torokhov@gmail.com,
	mkorpershoek@baylibre.com, davidgow@google.com,
	m.felsch@pengutronix.de, swboyd@chromium.org,
	fengping.yu@mediatek.com, y.oudjana@protonmail.com,
	rdunlap@infradead.org, colin.king@intel.com
Cc: sjoerd.simons@collabora.co.uk, VinayKumar.Shettar@in.bosch.com,
	Govindaraji.Sivanantham@in.bosch.com,
	anaclaudia.dias@de.bosch.com
Subject: Re: [PATCH v2 4/4] dt-bindings: input: mt-matrix-keypad: add guardian mt matrix keypad bindings definition
Date: Sat, 7 May 2022 17:44:34 +0200	[thread overview]
Message-ID: <93f402d8-d548-c097-c95c-47f8be48b26e@linaro.org> (raw)
In-Reply-To: <20220506072737.1590-4-Gireesh.Hiremath@in.bosch.com>

On 06/05/2022 09:27, Gireesh.Hiremath@in.bosch.com wrote:
> From: Gireesh Hiremath <Gireesh.Hiremath@in.bosch.com>
> 
> Add binding definition for the support of the Guardian
> mt matrix keypad driver.
> 
> Signed-off-by: Gireesh Hiremath <Gireesh.Hiremath@in.bosch.com>
> ---
> Hi Krzysztof
> 
> Changes since v1: addressed review comments
> 
>>> Add binding definition for the support of the Guardian
>>> mt matrix keypad driver.
>>>
>>> Signed-off-by: Gireesh Hiremath <Gireesh.Hiremath@in.bosch.com>
>>> ---
>>>  .../bindings/input/mt-matrix-keypad.yaml      | 134 ++++++++++++++++++
>>>  1 file changed, 134 insertions(+)
>>>  create mode 100644 Documentation/devicetree/bindings/input/mt-matrix-keypad.yaml
>>>
>>> diff --git a/Documentation/devicetree/bindings/input/mt-matrix-keypad.yaml b/Documentation/devicetree/bindings/input/mt-matrix-keypad.yaml
>>> new file mode 100644
>>> index 000000000000..b52cd478f638
>>> --- /dev/null
>>> +++ b/Documentation/devicetree/bindings/input/mt-matrix-keypad.yaml
>>> @@ -0,0 +1,134 @@
>>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
>>> +%YAML 1.2
>>> +---
>>> +$id: http://devicetree.org/schemas/input/mt-matrix-keypad.yaml#
>>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>>> +
>>> +title: GPIO driven mt matrix keypad device tree bindings
>>> +
>>> +maintainers:
>>> +  - vinay <VinayKumar.Shettar@in.bosch.com>
>>> +
>>> +description: |
>>> +  GPIO driven mt matrix keypad is used to interface a SoC with a mt matrix
>>> +  keypad. The mt matrix keypad supports multiple gpio line, all gpio line act
>>
>> s/line/lines/
> 
> modified
> 
>>> +  as row as wel as column lines, a key can be placed at each intersection
>>
>> s/wel/well/
> 
> modified
> 
>>> +  of a unique row number not equal to a unique column and they are diagonally
>>> +  symmetric.
>>> +
>>
>> What is "mt" in the "mt matrix"?
>>
> 
> mt is bosch measuring tools matrix keypad

Then it is a specific Bosch device, isn't it? If it is, you should have
vendor prefixes - to the file name and compatible. If it is not, then
"mt" is irrelevant here because it is Bosch product name.

> 
>>> +  Example- For 5 gpio lines, possible matrix is 5x5 and maximum possible
>>> +        keys are 10.
>>> +
>>> +        Sample matrix table for 7 button and 5 gpio line
>>> +
>>> +        ------------------------------------------------------
>>> +        |Row\Col |GPIO 0 | GPIO 1 | GPIO 2 | GPIO 3 | GPIO 4 |
>>> +        ------------------------------------------------------
>>> +        | GPIO 0 |  X    | KEY_9  | KEY_2  |   X    | KEY_1  |
>>> +        ------------------------------------------------------
>>> +        | GPIO 1 | KEY_9 |  X     | KEY_6  |   X    |  X     |
>>> +        ------------------------------------------------------
>>> +        | GPIO 2 | KEY_2 | KEY_6  |  X     | KEY_4  | KEY_7  |
>>> +        ------------------------------------------------------
>>> +        | GPIO 3 |  X    |  X     | KEY_4  |  X     | KEY_8  |
>>> +        ------------------------------------------------------
>>> +        | GPIO 4 | KEY_1 |  X     | KEY_7  | KEY_8  |  X     |
>>> +        ------------------------------------------------------
>>> +        X - invalid key
>>> +        KEY_x - preferred key code
>>> +
>>> +  The mt matrix keypad can sense a key-press and key-release by means of GPIO
>>> +  lines and report the event using GPIO interrupts to the cpu.
>>> +
>>> +properties:
>>> +  compatible:
>>> +    oneOf:
>>> +      - const: gpio-mt-matrix-keypad
>>> +      - items:
>>> +          - enum:
>>> +              - gpio-mt-matrix-keypad
>>> +          - const: gpio-mt-matrix-keypad
>>
>> Aren't all these compatibles the same?
> 
> modified
> 
>>> +
>>> +  debounce-delay-ms:
>>> +    description: Delay after the first bounce of button.
>>> +    default: 0
>>> +
>>> +  col-scan-delay-us:
>>> +    description: Delay before scanning next active line.
>>> +    default: 0
>>> +
>>> +  number-of-button:
>>> +    $ref: /schemas/types.yaml#/definitions/uint32
>>> +    description: Number of button connected to the keypad controller.
>>
>> s/button/buttons/ I presume.
> 
> modified
> 
>>> +
>>> +  linux,no-autorepeat:
>>> +    description: |
>>> +      Disable the Linux input system's autorepeat feature on the input device.
>>> +
>>> +  gpio-activelow:
>>> +    description: Gpio line are active low.
>>
>> No, GPIOs should instead use common flags.
> 
> this flag is used to compare with the gpio read value

Which is not an answer to my concerns and still a no. Just use the
flags. What's the point to code it like:
	line-gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
	gpio-activelow;
?

Or even worse:
	line-gpios = <&gpio 1 GPIO_ACTIVE_HIGH>;
	gpio-activelow;

With such coding, enabled is 0 or 1? Which flag is correct?

No, just use existing flags, don't duplicate standard Linux stuff.

> 
>>> +
>>> +  line-gpios:
>>> +    description: |
>>> +      Gpio lines connected to keypad controller.
>>> +      all gpio line act as row as wel as column lines.
>>> +
>>> +  linux,keymap:
>>> +    $ref: '/schemas/types.yaml#/definitions/uint32-array'
>>> +    description: |
>>> +      An array of packed 1-cell entries containing the equivalent of row,
>>> +      column and linux key-code. The 32-bit big endian cell is packed as:
>>> +          row << 24 | column << 16 | key-code
>>
>> But anyway this should be just merged into matrix-keypad. It's a simpler
>> set of that binding.
> 
> we have special keypad for Bosch measuring tools, which is not completely
> matric keypad so we have derived from matrix_kepad.c to make our keypad
> to work.

Just customize the original keypad, don't duplicate features. Again it's
not the answer to my concerns. You implement a driver for device with a
smaller set of features, so there should be no problem in merging it
into original driver (which supports more features).

Best regards,
Krzysztof

      reply	other threads:[~2022-05-07 15:44 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-06  7:27 [PATCH v2 1/4] ARM: dts: am335x: Guardian: switch to AM33XX_PADCONF pinmux macro Gireesh.Hiremath
2022-05-06  7:27 ` [PATCH v2 2/4] Input: mt-matrix-keypad: Add Bosch mt matrix keypad driver Gireesh.Hiremath
2022-05-07 15:46   ` Krzysztof Kozlowski
2022-05-10 14:13   ` Gireesh.Hiremath
2022-05-11 16:46     ` Krzysztof Kozlowski
2022-05-12  4:43   ` kernel test robot
2022-06-13  8:06   ` [v2,2/4] " Gireesh.Hiremath
2022-06-15  8:28     ` Marco Felsch
2022-06-15 20:58     ` Krzysztof Kozlowski
2022-08-19  6:56   ` Gireesh.Hiremath
2022-05-06  7:27 ` [PATCH v2 3/4] ARM: dts: am335x: Guardian: add keymap to mt matrix keypad Gireesh.Hiremath
2022-05-06  7:27 ` [PATCH v2 4/4] dt-bindings: input: mt-matrix-keypad: add guardian mt matrix keypad bindings definition Gireesh.Hiremath
2022-05-07 15:44   ` Krzysztof Kozlowski [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=93f402d8-d548-c097-c95c-47f8be48b26e@linaro.org \
    --to=krzysztof.kozlowski@linaro.org \
    --cc=Gireesh.Hiremath@in.bosch.com \
    --cc=Govindaraji.Sivanantham@in.bosch.com \
    --cc=VinayKumar.Shettar@in.bosch.com \
    --cc=anaclaudia.dias@de.bosch.com \
    --cc=bcousson@baylibre.com \
    --cc=colin.king@intel.com \
    --cc=davidgow@google.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=fengping.yu@mediatek.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=m.felsch@pengutronix.de \
    --cc=mkorpershoek@baylibre.com \
    --cc=rdunlap@infradead.org \
    --cc=robh+dt@kernel.org \
    --cc=sjoerd.simons@collabora.co.uk \
    --cc=swboyd@chromium.org \
    --cc=tony@atomide.com \
    --cc=y.oudjana@protonmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.