Re: [PATCH v6 8/8] misc: hisi_hikey_usb: Driver to support usb functionality of Hikey960

From: Greg Kroah-Hartman
Date: Tue Dec 10 2019 - 05:26:05 EST


On Thu, Nov 28, 2019 at 05:10:01AM +0000, John Stultz wrote:
> From: Yu Chen <chenyu56@xxxxxxxxxx>
>
> The HiKey960 has a fairly complex USB configuration due to it
> needing to support a USB-C port for host/device mode and multiple
> USB-A ports in host mode using a single USB controller.
>
> See schematics here:
> https://github.com/96boards/documentation/raw/master/consumer/hikey/hikey960/hardware-docs/HiKey960_Schematics.pdf
>
> This driver acts as a usb-role-switch intermediary, intercepting
> the role switch notifications from the tcpm code, and passing
> them on to the dwc3 core.
>
> In doing so, it also controls the onboard hub and power gpios in
> order to properly route the data lines between the USB-C port
> and the onboard hub to the USB-A ports.
>
> NOTE: It was noted that controlling the TYPEC_VBUS_POWER_OFF and
> TYPEC_VBUS_POWER_ON values here is not reccomended. I'm looking
> for a way to remove that bit from the logic here, but wanted to
> still get feedback on this approach.
>
> Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
> Cc: Rob Herring <robh+dt@xxxxxxxxxx>
> Cc: Mark Rutland <mark.rutland@xxxxxxx>
> CC: ShuFan Lee <shufan_lee@xxxxxxxxxxx>
> Cc: Heikki Krogerus <heikki.krogerus@xxxxxxxxxxxxxxx>
> Cc: Suzuki K Poulose <suzuki.poulose@xxxxxxx>
> Cc: Chunfeng Yun <chunfeng.yun@xxxxxxxxxxxx>
> Cc: Yu Chen <chenyu56@xxxxxxxxxx>
> Cc: Felipe Balbi <balbi@xxxxxxxxxx>
> Cc: Hans de Goede <hdegoede@xxxxxxxxxx>
> Cc: Andy Shevchenko <andy.shevchenko@xxxxxxxxx>
> Cc: Jun Li <lijun.kernel@xxxxxxxxx>
> Cc: Valentin Schneider <valentin.schneider@xxxxxxx>
> Cc: Jack Pham <jackp@xxxxxxxxxxxxxx>
> Cc: linux-usb@xxxxxxxxxxxxxxx
> Cc: devicetree@xxxxxxxxxxxxxxx
> Signed-off-by: Yu Chen <chenyu56@xxxxxxxxxx>
> [jstultz: Major rework to make the driver a usb-role-switch
> intermediary]
> Signed-off-by: John Stultz <john.stultz@xxxxxxxxxx>
> Change-Id: Icf381520abd46d083750d01f91e478321560fbf9

Checkpatch is your friend :)