[U-Boot] [PATCH 4/8] usb: host: xhci-rockchip: add support for rk3328

rock-chips(daniel.meng) daniel.meng at rock-chips.com
Sat May 27 07:44:38 UTC 2017



On 2017/5/18 1:07, Marek Vasut wrote:
> On 05/17/2017 12:21 PM, Meng Dongyang wrote:
>> Add the compatible "rockchip,rk3328-xhci" in match table
>> for rk3328 to probe xhci controller. Turn off vbus when
>> usb stop.
>>
>> Signed-off-by: Meng Dongyang <daniel.meng at rock-chips.com>
>> ---
>>   drivers/usb/host/xhci-rockchip.c | 6 ++++++
>>   1 file changed, 6 insertions(+)
>>
>> diff --git a/drivers/usb/host/xhci-rockchip.c b/drivers/usb/host/xhci-rockchip.c
>> index f559830..8db92cb 100644
>> --- a/drivers/usb/host/xhci-rockchip.c
>> +++ b/drivers/usb/host/xhci-rockchip.c
>> @@ -168,6 +168,7 @@ static int xhci_usb_probe(struct udevice *dev)
>>   
>>   static int xhci_usb_remove(struct udevice *dev)
>>   {
>> +	struct rockchip_xhci_platdata *plat = dev_get_platdata(dev);
>>   	struct rockchip_xhci *ctx = dev_get_priv(dev);
>>   	int ret;
>>   
>> @@ -178,11 +179,15 @@ static int xhci_usb_remove(struct udevice *dev)
>>   	if (ret)
>>   		return ret;
>>   
>> +	if (dm_gpio_is_valid(&plat->vbus_gpio))
>> +		dm_gpio_set_value(&plat->vbus_gpio, 0);
> This should be a fixed regulator, then you don't have to mess with GPIOs
> directly.
Indeed, this is better to be a fixed regulator. Yet other platforms 
still use GPIOs directly.
So I must change the dts of the other platforms if change like this. 
Maybe it's better to change
by another commit. This patch is only for turning off vbus when usb stop.
>
>> +
>>   	return 0;
>>   }
>>   
>>   static const struct udevice_id xhci_usb_ids[] = {
>>   	{ .compatible = "rockchip,rk3399-xhci" },
>> +	{ .compatible = "rockchip,rk3328-xhci" },
>>   	{ }
>>   };
>>   
>> @@ -202,6 +207,7 @@ U_BOOT_DRIVER(usb_xhci) = {
>>   
>>   static const struct udevice_id usb_phy_ids[] = {
>>   	{ .compatible = "rockchip,rk3399-usb3-phy" },
>> +	{ .compatible = "rockchip,rk3328-usb3-phy" },
>>   	{ }
>>   };
>>   
>>
>




More information about the U-Boot mailing list