mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] phy: rockchip-inno-usb2: add support for older rockchip SoC bindings
@ 2021-12-02  7:42 Ahmad Fatoum
  2021-12-07  9:10 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Ahmad Fatoum @ 2021-12-02  7:42 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

Anything earlier than the rv1108, has no rockchip,usbgrf regmap and
instead access the parent device's regmap. Add support for this binding,
so the driver is usable on the rk3399.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
index 6b9d54f34460..459ad9b35534 100644
--- a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
+++ b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
@@ -392,7 +392,12 @@ static int rockchip_usb2phy_probe(struct device_d *dev)
 
 	rphy->dev = dev;
 
-	rphy->grf_base = syscon_regmap_lookup_by_phandle(np, "rockchip,usbgrf");
+	if (of_device_is_compatible(np, "rockchip,rv1108-usb2phy") ||
+	    of_device_is_compatible(np, "rockchip,rk3568-usb2phy"))
+		rphy->grf_base = syscon_regmap_lookup_by_phandle(np, "rockchip,usbgrf");
+	else
+		rphy->grf_base = syscon_node_to_regmap(dev->parent->device_node);
+
 	if (IS_ERR(rphy->grf_base))
 		return PTR_ERR(rphy->grf_base);
 
-- 
2.30.2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] phy: rockchip-inno-usb2: add support for older rockchip SoC bindings
  2021-12-02  7:42 [PATCH] phy: rockchip-inno-usb2: add support for older rockchip SoC bindings Ahmad Fatoum
@ 2021-12-07  9:10 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2021-12-07  9:10 UTC (permalink / raw)
  To: Ahmad Fatoum; +Cc: barebox

On Thu, Dec 02, 2021 at 08:42:36AM +0100, Ahmad Fatoum wrote:
> Anything earlier than the rv1108, has no rockchip,usbgrf regmap and
> instead access the parent device's regmap. Add support for this binding,
> so the driver is usable on the rk3399.
> 
> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> ---
>  drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)

Applied, thanks

Sascha

> 
> diff --git a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
> index 6b9d54f34460..459ad9b35534 100644
> --- a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
> +++ b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
> @@ -392,7 +392,12 @@ static int rockchip_usb2phy_probe(struct device_d *dev)
>  
>  	rphy->dev = dev;
>  
> -	rphy->grf_base = syscon_regmap_lookup_by_phandle(np, "rockchip,usbgrf");
> +	if (of_device_is_compatible(np, "rockchip,rv1108-usb2phy") ||
> +	    of_device_is_compatible(np, "rockchip,rk3568-usb2phy"))
> +		rphy->grf_base = syscon_regmap_lookup_by_phandle(np, "rockchip,usbgrf");
> +	else
> +		rphy->grf_base = syscon_node_to_regmap(dev->parent->device_node);
> +
>  	if (IS_ERR(rphy->grf_base))
>  		return PTR_ERR(rphy->grf_base);
>  
> -- 
> 2.30.2
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-12-07  9:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-02  7:42 [PATCH] phy: rockchip-inno-usb2: add support for older rockchip SoC bindings Ahmad Fatoum
2021-12-07  9:10 ` Sascha Hauer

mail archive of the barebox mailing list

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://lore.barebox.org/barebox/0 barebox/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 barebox barebox/ https://lore.barebox.org/barebox \
		barebox@lists.infradead.org barebox@lists.infradead.org
	public-inbox-index barebox

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git