On 6/13/22 17:39, Stefan Herbrechtsmeier wrote:
Hi Marek,

Hi,

sorry for the late comments but I think the driver doesn't work as expected.

How come ? It works on my board.

[...]

+
+    if (IS_ENABLED(CONFIG_DM_REGULATOR)) {
+        err = device_get_supply_regulator(dev, "vdd-supply",
+                          &hub->vdd);
+        if (err && err != -ENOENT) {
+            dev_err(dev, "Warning: cannot get power supply\n");
+            return err;
+        }
+    }

Shouldn't the gpio and regulator request be part of the probe?

What makes you think that ?

+    if (dev_read_u32(dev, "vendor-id", &hub->vendor_id))
+        hub->vendor_id = USB251XB_DEF_VENDOR_ID;
+
+    if (dev_read_u32(dev, "product-id", &hub->product_id))
+        hub->product_id = data->product_id;
+
+    if (dev_read_u32(dev, "device-id", &hub->device_id))
+        hub->device_id = USB251XB_DEF_DEVICE_ID;
+

[snip]

+    if (dev_read_u32(dev, "language-id", &hub->lang_id))
+        hub->lang_id = USB251XB_DEF_LANGUAGE_ID;
+

This doesn't work because the ids are 16 bit [1,2] and the dev_read_u32 function checks the size.

+    if (!dev_read_u32(dev, "boost-up", &hub->boost_up))
+        hub->boost_up = USB251XB_DEF_BOOST_UP;

This looks like a 8 bit value [1].

The dev_read_u32() is also capable of reading 0xNNNN 16bit value from DT.

What kind of problem are you running into exactly ?

Reply via email to