linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: Alan Cooper <alcooperx@gmail.com>,
	Linus Walleij <linus.walleij@linaro.org>
Cc: ": Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
	BCM Kernel Feedback <bcm-kernel-feedback-list@broadcom.com>,
	DTML <devicetree@vger.kernel.org>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"moderated list:BROADCOM BCM7XXX ARM ARCHITECTURE" 
	<linux-arm-kernel@lists.infradead.org>,
	USB list <linux-usb@vger.kernel.org>
Subject: Re: [PATCH 1/3] dt-bindings: Add support for Broadcom USB pin map driver
Date: Tue, 25 Aug 2020 09:46:08 -0600	[thread overview]
Message-ID: <CAL_JsqLvDq1L1BZKfgobfhe7UEqbkGtXXfHzUwfo36m4MCARhw@mail.gmail.com> (raw)
In-Reply-To: <CAOGqxeXWXkRD=agGL45D0sGe64TUBBq=OtibkX8AkiC5g0sWww@mail.gmail.com>

+Linus W

On Tue, Aug 25, 2020 at 6:26 AM Alan Cooper <alcooperx@gmail.com> wrote:
>
> On Mon, Aug 24, 2020 at 7:30 PM Rob Herring <robh@kernel.org> wrote:
> >
> > On Wed, Aug 12, 2020 at 04:20:16PM -0400, Al Cooper wrote:
> > > Add DT bindings for the Broadcom USB pin map driver. This driver allows
> > > some USB input and output signals to be mapped to any GPIO instead
> > > of the normal dedicated pins to/from the XHCI controller.
> >
> > Is this a driver or h/w block because bindings are for h/w blocks?
>
> This is a hardware block. I'll remove "driver" from the description.

Another question, this kind of looks like a pin mux controller. Is
that not a fit for this? If not, why?

> > > Signed-off-by: Al Cooper <alcooperx@gmail.com>
> > > ---
> > >  .../bindings/usb/brcm,usb-pinmap.yaml         | 63 +++++++++++++++++++
> > >  1 file changed, 63 insertions(+)
> > >  create mode 100644 Documentation/devicetree/bindings/usb/brcm,usb-pinmap.yaml
> > >
> > > diff --git a/Documentation/devicetree/bindings/usb/brcm,usb-pinmap.yaml b/Documentation/devicetree/bindings/usb/brcm,usb-pinmap.yaml
> > > new file mode 100644
> > > index 000000000000..19cf6ad36373
> > > --- /dev/null
> > > +++ b/Documentation/devicetree/bindings/usb/brcm,usb-pinmap.yaml
> > > @@ -0,0 +1,63 @@
> > > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > > +%YAML 1.2
> > > +---
> > > +$id: http://devicetree.org/schemas/usb/brcm,usb-pinmap.yaml#
> > > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > > +
> > > +title: Broadcom USB pin map Controller Device Tree Bindings
> > > +
> > > +maintainers:
> > > +  - Al Cooper <alcooperx@gmail.com>
> > > +
> > > +properties:
> > > +  compatible:
> > > +      items:
> > > +          - const: brcm,usb-pinmap
> >
> > 2 space indentation please.
>
> Fixed.
>
> >
> > > +
> > > +  reg:
> > > +    maxItems: 1
> > > +
> > > +  interrupts:
> > > +    maxItems: 1
> > > +    description: Must be defined if any out-gpios are specified.
> >
> > 'dependencies' can express this in schema.
>
> Okay.
>
> >
> > > +
> > > +  in-gpios:
> > > +    description: Array of one or more GPIO pins used for input signals.
> >
> > You need to define how many GPIOs are valid.
>
> I tried to avoid doing this because there is a possibility that future
> chips will have a few more signals added and the driver was written so
> new signals can be added entirely in device tree without any changes
> to the driver. If this is unacceptable, I can add the current max in
> and out valid gpios.

A 'should be enough for a while' value is fine. The driver doesn't
have to have a max. I'd expect the binding to be updated for new SoCs
anyways.

> >
> > > +
> > > +  in-names:
> > > +    description: Array of input signal names, one per gpio in in-gpios.
> >
> > No, this isn't how we name GPIOs. The part before '-gpios' is how.
>
> This is the meant to be a description of how each gpio is being used
> to help with error messages in the driver.
> What if I use "brcmstb,in-functions" instead?

'brcmstb' is not a vendor. But brcm,in-functions is fine.

> > > +
> > > +  in-masks:
> > > +    description: Array of enable and mask pairs, one per gpio in-gpios.
> >
> > Needs a vendor prefix.
>
> I'll change it to "brcmstb,in-masks"
>
> >
> > > +
> > > +  out-gpios:
> > > +    description: Array of one or more GPIO pins used for output signals.
> > > +
> > > +  out-names:
> > > +    description: Array of output signal names, one per gpio in out-gpios.
> > > +
> > > +  out-masks:
> > > +    description: Array of enable, value, changed and clear masks, one
> > > +      per gpio in out-gpios.
> > > +
> > > +required:
> > > +  - compatible
> > > +  - reg
> > > +
> > > +additionalProperties: false
> > > +
> > > +examples:
> > > +  - |
> > > +    usb_pinmap: usb-pinmap@22000d0 {
> > > +        compatible = "brcm,usb-pinmap";
> > > +        reg = <0x22000d0 0x4>;
> > > +        in-gpios = <&gpio 18 0>, <&gpio 19 0>;
> > > +        in-names = "VBUS", "PWRFLT";
> > > +        in-masks = <0x8000 0x40000 0x10000 0x80000>;
> > > +        out-gpios = <&gpio 20 0>;
> > > +        out-names = "PWRON";
> > > +        out-masks = <0x20000 0x800000 0x400000 0x200000>;
> > > +        interrupts = <0x0 0xb2 0x4>;
> > > +    };
> > > +
> > > +...
> > > --
> > > 2.17.1
> > >

  reply	other threads:[~2020-08-25 15:46 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-12 20:20 [PATCH 0/3] usb: Add driver for USB signal re-mapper Al Cooper
2020-08-12 20:20 ` [PATCH 1/3] dt-bindings: Add support for Broadcom USB pin map driver Al Cooper
2020-08-24 23:30   ` Rob Herring
2020-08-25 12:26     ` Alan Cooper
2020-08-25 15:46       ` Rob Herring [this message]
2020-08-26 16:00         ` Alan Cooper
2020-08-28 14:00   ` Linus Walleij
2020-08-28 14:18     ` Geert Uytterhoeven
2020-08-12 20:20 ` [PATCH 2/3] usb: Add driver to allow any GPIO to be used for 7211 USB signals Al Cooper
2020-08-12 20:20 ` [PATCH 3/3] usb: Add Kconfig and Makefile changes to build brcmstb-usb-pinmap Al Cooper
2020-08-12 21:59   ` kernel test robot
2020-08-13  5:40   ` Greg Kroah-Hartman
2020-08-13 15:01     ` Alan Cooper
2020-08-24 15:48   ` kernel test robot
2020-08-24 15:48   ` [RFC PATCH] usb: sync_all_pins() can be static kernel test robot

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=CAL_JsqLvDq1L1BZKfgobfhe7UEqbkGtXXfHzUwfo36m4MCARhw@mail.gmail.com \
    --to=robh@kernel.org \
    --cc=alcooperx@gmail.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=devicetree@vger.kernel.org \
    --cc=f.fainelli@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).