[U-Boot] [PATCH v3 u-boot 1/3] usb: host: Add simple of glue driver for DWC3 USB Controllers integration

Neil Armstrong narmstrong at baylibre.com
Thu Apr 12 08:08:17 UTC 2018


On 12/04/2018 10:07, Ben Dooks wrote:
> On 12/04/18 09:05, Neil Armstrong wrote:
>> Hi Jean-Jacques,
>>
>> On 11/04/2018 18:17, Jean-Jacques Hiblot wrote:
>>>
>>>
>>> On 11/04/2018 17:08, Neil Armstrong wrote:
>>>> This is a port of the dwc3-of-simple driver from Linux to enable/deassert
>>>> clock and resets of a simple DWC3 Controller HW glue.
>>>>
>>>> Signed-off-by: Neil Armstrong <narmstrong at baylibre.com>
>>>> ---
>>>>    drivers/usb/host/Kconfig          |   7 +++
>>>>    drivers/usb/host/Makefile         |   1 +
>>>>    drivers/usb/host/dwc3-of-simple.c | 109 ++++++++++++++++++++++++++++++++++++++
>>>>    3 files changed, 117 insertions(+)
>>>>    create mode 100644 drivers/usb/host/dwc3-of-simple.c
>>>>
>>>> diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
>>>> index a7249b7..6caa615 100644
>>>> --- a/drivers/usb/host/Kconfig
>>>> +++ b/drivers/usb/host/Kconfig
>>>> @@ -21,6 +21,13 @@ config USB_XHCI_DWC3
>> [...]
>>
>>>> +
>>>> +static int dwc3_of_simple_clk_init(struct udevice *dev,
>>>> +                   struct dwc3_of_simple *simple)
>>>> +{
>>>> +    int ret;
>>>> +
>>>> +    ret = clk_get_bulk(dev, &simple->clks);
>>>> +    if (ret == -ENOTSUPP)
>>>
>>> Must be ENOSYS instead of ENOTSUPP, otherwise probe fails on platform not using the clk framework
>>
>> You are right, I naively used the same between reset and clock...
>>
>>>
>>> tested-by: Jean-Jacques hiblot <jjhiblot at ti.com>
>>>
>>>> +        return 0;
>>>> +    if (ret)
>>>> +        return ret;
>>>> +
>>>> +#if CONFIG_IS_ENABLED(CLK)
>>>> +    ret = clk_enable_bulk(&simple->clks);
>>>> +    if (ret) {
>>>> +        clk_release_bulk(&simple->clks);
>>>> +        return ret;
>>>> +    }
>>>> +#endif
>>>> +
>>>> +    return 0;
>>>> +}
> 
> Is the above #if CONFIG_IS_ENABLED(CLK) avoidable?

No unless some changes in clk.h

Neil

> 
>>
>> [...]
>> Thanks,
>> Neil
>>
>> _______________________________________________
>> linux-amlogic mailing list
>> linux-amlogic at lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/linux-amlogic
>>
> 
> 



More information about the U-Boot mailing list