devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: Al Cooper <alcooperx@gmail.com>, linux-kernel@vger.kernel.org
Cc: bcm-kernel-feedback-list@broadcom.com,
	devicetree@vger.kernel.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	linux-arm-kernel@lists.infradead.org, linux-usb@vger.kernel.org,
	Rob Herring <robh+dt@kernel.org>
Subject: Re: [PATCH v2 2/2] usb: Add driver to allow any GPIO to be used for 7211 USB signals
Date: Fri, 9 Oct 2020 16:40:08 -0700	[thread overview]
Message-ID: <134cbb66-6d46-bef5-fa4c-eeae78ec1b53@gmail.com> (raw)
In-Reply-To: <20201009190839.12612-3-alcooperx@gmail.com>



On 10/9/2020 12:08 PM, Al Cooper wrote:
> The Broadcom 7211 has new functionality that allows some USB low
> speed side band signals, that go from the XHCI host controller to
> pins on the chip, to be remapped to use any GPIO pin instead of the
> limited set selectable by hardware. This can be done without changing
> the standard driver for the host controller. There is currently
> support for three USB signals, PWRON, VBUS_PRESENT and PWRFLT. This
> driver will allow the remapping of any of these three signals based
> on settings in the Device Tree node for the driver. The driver was
> written so that it could handle additional signals added in the
> future by just adding the correct properties to the DT node.
> 
> Below is an example of a DT node that would remap all three
> signals:
> 
> usb_pinmap: usb-pinmap@22000d0 {
> 	compatible = "brcm,usb-pinmap";
> 	reg = <0x22000d0 0x4>;
> 	in-gpios = <&gpio 18 0>, <&gpio 19 0>;
> 	brcm,in-functions = "VBUS", "PWRFLT";
> 	brcm,in-masks = <0x8000 0x40000 0x10000 0x80000>;
> 	out-gpios = <&gpio 20 0>;
> 	brcm,out-functions = "PWRON";
> 	brcm,out-masks = <0x20000 0x800000 0x400000 0x200000>;
> 	interrupts = <0x0 0xb2 0x4>;
> };
> 
> Signed-off-by: Al Cooper <alcooperx@gmail.com>
> ---

[snip]

> +config BRCM_USB_PINMAP
> +	tristate "Broadcom pinmap driver support"
> +	depends on (ARCH_BRCMSTB && PHY_BRCM_USB) || COMPILE_TEST
> +	default y if (ARCH_BRCMSTB && PHY_BRCM_USB)

default ARCH_BRCMSTB && PHY_BRCM_USB should work as well.


> +static int __init brcmstb_usb_pinmap_init(void)
> +{
> +	return platform_driver_probe(&brcmstb_usb_pinmap_driver,
> +				     brcmstb_usb_pinmap_probe);
> +}
> +
> +module_init(brcmstb_usb_pinmap_init);

You would need MODULE_AUTHOR(), LICENSE and DESCRIPTION() in case you 
make this modular.

-- 
Florian

      reply	other threads:[~2020-10-09 23:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-09 19:08 [PATCH v2 0/2] usb: Add driver for USB signal re-mapper Al Cooper
2020-10-09 19:08 ` [PATCH v2 1/2] dt-bindings: Add support for Broadcom USB pin map driver Al Cooper
2020-10-09 19:08 ` [PATCH v2 2/2] usb: Add driver to allow any GPIO to be used for 7211 USB signals Al Cooper
2020-10-09 23:40   ` Florian Fainelli [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=134cbb66-6d46-bef5-fa4c-eeae78ec1b53@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=alcooperx@gmail.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=devicetree@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=krzk@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=robh+dt@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).