fix for lantiq (danube) usb

Luca Olivetti luca at ventoso.org
Fri Jul 3 15:31:06 EDT 2020


El 3/7/20 a les 21:10, John Crispin ha escrit:
> 
> On 03.07.20 21:07, Luca Olivetti wrote:
>> El 3/7/20 a les 20:07, Luca Olivetti ha escrit:
>>> El 3/7/20 a les 20:06, John Crispin ha escrit:
>>>>
>>>> On 03.07.20 19:57, Luca Olivetti wrote:
>>>>> El 3/7/20 a les 19:49, John Crispin ha escrit:
>>>>>>
>>>>>> On 03.07.20 19:47, Luca Olivetti wrote:
>>>>>>> El 3/7/20 a les 19:37, John Crispin ha escrit:
>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Why not use the gpio regulator ?
>>>>>>>>>
>>>>>>>>> Because I don't know how :-(
>>>>>>>>>
>>>>>>>> https://www.kernel.org/doc/Documentation/devicetree/bindings/regulator/fixed-regulator.yaml 
>>>>>>>>
>>>>>>>
>>>>>>> Oh, I see, but that's the one I had to *remove* because it didn't 
>>>>>>> work.
>>>>>>>
>>>>>>> Bye
>>>>>>
>>>>>>
>>>>>> CONFIG_REGULATOR_GPIO is not enabled in the kernel config
>>>>>>
>>>>>
>>>>>
>>>>> So it's just a matter of adding it to 
>>>>> target/linux/lantiq/xway/config-4.14 after
>>>>>
>>>>>
>>>>> CONFIG_REGULATOR=y
>>>>> CONFIG_REGULATOR_FIXED_VOLTAGE=y
>>>>>
>>>>>
>>>>> ?
>>>>>
>>>>>
>>>>> (and put back the entry I removed in the dts)
>>>>>
>>>>> Bye
>>>>
>>>>
>>>> correct
>>>>
>>>
>>>
>>> Thank you, I'm building it now (but my system is slow). I'll report 
>>> back if it works.
>>
>> Nope, it doesn't
>>
> 
> printk the driver with a salt shaker and see if it loads and if so where 
> it breaks

I'm not sure I understand, but I visually checked the code and the only 
part where it could return -EPROBE_DEFER is here in dwc/hcd.c

static int dwc2_vbus_supply_init(struct dwc2_hsotg *hsotg)
{
         int ret;

         hsotg->vbus_supply = devm_regulator_get_optional(hsotg->dev, 
"vbus");
         if (IS_ERR(hsotg->vbus_supply)) {
                 ret = PTR_ERR(hsotg->vbus_supply);
                 hsotg->vbus_supply = NULL;
                 return ret == -ENODEV ? 0 : ret;
         }

         return regulator_enable(hsotg->vbus_supply);
}


I suppose it's the call to devm_regulator_get_optional, which should 
lead to regulator/core.c

static struct regulator_dev *regulator_dev_lookup(struct device *dev,
                                                   const char *supply)
{
         struct regulator_dev *r = NULL;
         struct device_node *node;
         struct regulator_map *map;
         const char *devname = NULL;

         regulator_supply_alias(&dev, &supply);

         /* first do a dt based lookup */
         if (dev && dev->of_node) {
                 node = of_get_regulator(dev, supply);
                 if (node) {
                         r = of_find_regulator_by_node(node);
                         if (r)
                                 return r;

                         /*
                          * We have a node, but there is no device.
                          * assume it has not registered yet.
                          */
                         return ERR_PTR(-EPROBE_DEFER);
                 }
         }



But since I don't really understand what's happening here, I don't know 
how to fix it.
I only know that if I remove the regulator from the dts the function 
completes (since "node" is not found) and I can then enable the gpio 
manually.


Bye
-- 
Luca



More information about the openwrt-devel mailing list