diff mbox series

[v2,08/11] usb: dwc3: add rk3568 dwc3 support

Message ID 20220226184147.769964-9-pgwipeout@gmail.com
State New
Headers show
Series enable usb support on rk356x | expand

Commit Message

Peter Geis Feb. 26, 2022, 6:41 p.m. UTC
The rk3568 dwc3 controller is backwards compatible with the rk3399 dwc3
controller.
Add support for it to the dwc3-of-simple driver.

Signed-off-by: Peter Geis <pgwipeout@gmail.com>
---
 drivers/usb/dwc3/dwc3-of-simple.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Johan Jonker Feb. 26, 2022, 9:43 p.m. UTC | #1
Hi Peter,

See comments by rob+dt:

https://lore.kernel.org/linux-rockchip/CAL_JsqJwNdUfoYM8SZmOgMG9iAyZkJ4-kzjjiDDm_mdmghTEOA@mail.gmail.com/

> Presumably you are getting lucky here (with link order). The kernel
> has no logic to decide which driver to bind to if there are 2 matching
> drivers.

Due to the fall back string you make a mess with two drivers.
Don't use dwc3-of-simple.c
(only for rk3399 and legacy support. Not for new SoCs),
because core.c has now reset support.
You are creating a race which driver get probed first.
Handle your quirks in core.

Johan

On 2/26/22 19:41, Peter Geis wrote:
> The rk3568 dwc3 controller is backwards compatible with the rk3399 dwc3
> controller.
> Add support for it to the dwc3-of-simple driver.
> 
> Signed-off-by: Peter Geis <pgwipeout@gmail.com>
> ---
>  drivers/usb/dwc3/dwc3-of-simple.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/usb/dwc3/dwc3-of-simple.c b/drivers/usb/dwc3/dwc3-of-simple.c
> index 57ba9427ad74..d9d1c5bfac3f 100644
> --- a/drivers/usb/dwc3/dwc3-of-simple.c
> +++ b/drivers/usb/dwc3/dwc3-of-simple.c
> @@ -195,6 +195,10 @@ static const struct of_device_id of_dwc3_simple_match[] = {
>  		.compatible = "rockchip,rk3399-dwc3",
>  		.data = &dwc3_of_simple_data_rk3399,
>  	},
> +	{
> +		.compatible = "rockchip,rk3568-dwc3",
> +		.data = &dwc3_of_simple_data_rk3399,
> +	},
>  	{
>  		.compatible = "sprd,sc9860-dwc3",
>  	},
diff mbox series

Patch

diff --git a/drivers/usb/dwc3/dwc3-of-simple.c b/drivers/usb/dwc3/dwc3-of-simple.c
index 57ba9427ad74..d9d1c5bfac3f 100644
--- a/drivers/usb/dwc3/dwc3-of-simple.c
+++ b/drivers/usb/dwc3/dwc3-of-simple.c
@@ -195,6 +195,10 @@  static const struct of_device_id of_dwc3_simple_match[] = {
 		.compatible = "rockchip,rk3399-dwc3",
 		.data = &dwc3_of_simple_data_rk3399,
 	},
+	{
+		.compatible = "rockchip,rk3568-dwc3",
+		.data = &dwc3_of_simple_data_rk3399,
+	},
 	{
 		.compatible = "sprd,sc9860-dwc3",
 	},