public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Matthias Kaehlcke <mka@chromium.org>
To: Michal Simek <michal.simek@amd.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	"Mehta, Piyush" <piyush.mehta@amd.com>,
	Marek Vasut <marex@denx.de>,
	Linux USB List <linux-usb@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	"git (AMD-Xilinx)" <git@amd.com>,
	"Paladugu,
	Siva Durga Prasad" <siva.durga.prasad.paladugu@amd.com>
Subject: Re: USB companion HUB for usb5744
Date: Fri, 23 Sep 2022 17:13:03 +0000	[thread overview]
Message-ID: <Yy3pH7pHQ8H364OE@google.com> (raw)
In-Reply-To: <479b13a3-08f6-c7c9-dce3-13831d69da3e@amd.com>

Hi Michal,

On Fri, Sep 23, 2022 at 03:08:54PM +0200, Michal Simek wrote:
> Hi Matthias,
> 
> I want to follow up with you on discussion we had couple of months ago
> around usb companion HUB series which is finally merged to the tree.
> We are using USB5744 hub(4 ports), it supports USB3.0 functionality backward
> compatible with USB2.0.
> 
> To generic driver support for regulator and gpio reset was added.
> In our case usb hub has i2c interface connected and hub expects
> initialization via i2c to start to operate.
> 
> In past you mentioned to create new file just for handling hubs itself.

Yes, code that is specific for certain hub models should be separate from
the core driver. As long as the hub specific code isn't too large it
could be an option to host it in a single file for multiple models.

The core driver could invoke an ->init callback if it exists to perform
the hub specific initialization.

> Anyway from DT perspective I discussed description with Rob some time ago
> https://lore.kernel.org/all/CAL_JsqJZBbu+UXqUNdZwg-uv0PAsNg55026PTwhKr5wQtxCjVQ@mail.gmail.com/
> where he wanted to use i2c-bus link.
> 
> It will end up with description like this.
> 
> 	usbhub0_2_0: hub@1 { /* u43 */
> 		compatible = "usb424,2744";
> 		reg = <1>;
> 		i2c-bus = <&usbhub_i2c0>;
> 		reset-gpios = <&slg7xl45106 3 GPIO_ACTIVE_LOW>;
> 		peer-hub = <&usbhub0_3_0>;
> 	};
> 
> 	usbhub0_3_0: hub@2 { /* u43 */
> 		compatible = "usb424,5744";
> 		reg = <2>;
> 		i2c-bus = <&usbhub_i2c0>;
> 		reset-gpios = <&slg7xl45106 3 GPIO_ACTIVE_LOW>;
> 		peer-hub = <&usbhub0_2_0>;
> 	};
> 
> In probe onboard_hub_power_on is called to toggle gpio line which we need
> and then we need to write 16 bits to basic initialization (or more for
> different one).
> Marek also mentioned that he has another chip from Microchip where i2c
> address can be setup. I think it would be good to get any guidance how this
> should be integrated.
> 
> From my perspective i2c address should be described in DT.
> 
> Can we use any description like?
> i2c-bus = <&usbhub_i2c0 0x2d>;

I don't have objections as long as the DT folks are happy with that.

> And initialization sequence via any property with
> uint32-array/uint16-array/uint8-array types.

I very much doubt that you could convince DT maintainers to approve such a
binding. The device tree is supposed to describe the hardware, an
initialization sequence does not do that. Also a sequence of bytes is very
opaque, in source code comments can be added if something is not evident.
IMO the initialization should be done in an ->init callback that is specific
to the USB5744 hub.

      reply	other threads:[~2022-09-23 17:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-23 13:08 USB companion HUB for usb5744 Michal Simek
2022-09-23 17:13 ` Matthias Kaehlcke [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=Yy3pH7pHQ8H364OE@google.com \
    --to=mka@chromium.org \
    --cc=git@amd.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=krzk@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=marex@denx.de \
    --cc=michal.simek@amd.com \
    --cc=piyush.mehta@amd.com \
    --cc=siva.durga.prasad.paladugu@amd.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox