Commit 606bf4d5 authored by Tony Lindgren's avatar Tony Lindgren Committed by Felipe Balbi

usb: musb: Fix use for of_property_read_bool for disabled multipoint

The value for the multipoint dts property is ignored when parsing with
of_property_read_bool, so we currently have multipoint always set as 1
even if value 0 is specified in the dts file.

Let's fix this to read the value too instead of just the property like
the binding documentation says as otherwise MUSB will fail to work
on devices with Mentor configuration that does not support multipoint.

Cc: Brian Hutchinson <b.hutchman@gmail.com>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent 3e43a072
...@@ -687,7 +687,7 @@ static int dsps_create_musb_pdev(struct dsps_glue *glue, ...@@ -687,7 +687,7 @@ static int dsps_create_musb_pdev(struct dsps_glue *glue,
struct musb_hdrc_config *config; struct musb_hdrc_config *config;
struct platform_device *musb; struct platform_device *musb;
struct device_node *dn = parent->dev.of_node; struct device_node *dn = parent->dev.of_node;
int ret; int ret, val;
memset(resources, 0, sizeof(resources)); memset(resources, 0, sizeof(resources));
res = platform_get_resource_byname(parent, IORESOURCE_MEM, "mc"); res = platform_get_resource_byname(parent, IORESOURCE_MEM, "mc");
...@@ -739,7 +739,10 @@ static int dsps_create_musb_pdev(struct dsps_glue *glue, ...@@ -739,7 +739,10 @@ static int dsps_create_musb_pdev(struct dsps_glue *glue,
pdata.mode = get_musb_port_mode(dev); pdata.mode = get_musb_port_mode(dev);
/* DT keeps this entry in mA, musb expects it as per USB spec */ /* DT keeps this entry in mA, musb expects it as per USB spec */
pdata.power = get_int_prop(dn, "mentor,power") / 2; pdata.power = get_int_prop(dn, "mentor,power") / 2;
config->multipoint = of_property_read_bool(dn, "mentor,multipoint");
ret = of_property_read_u32(dn, "mentor,multipoint", &val);
if (!ret && val)
config->multipoint = true;
ret = platform_device_add_data(musb, &pdata, sizeof(pdata)); ret = platform_device_add_data(musb, &pdata, sizeof(pdata));
if (ret) { if (ret) {
......
...@@ -516,7 +516,7 @@ static int omap2430_probe(struct platform_device *pdev) ...@@ -516,7 +516,7 @@ static int omap2430_probe(struct platform_device *pdev)
struct omap2430_glue *glue; struct omap2430_glue *glue;
struct device_node *np = pdev->dev.of_node; struct device_node *np = pdev->dev.of_node;
struct musb_hdrc_config *config; struct musb_hdrc_config *config;
int ret = -ENOMEM; int ret = -ENOMEM, val;
glue = devm_kzalloc(&pdev->dev, sizeof(*glue), GFP_KERNEL); glue = devm_kzalloc(&pdev->dev, sizeof(*glue), GFP_KERNEL);
if (!glue) if (!glue)
...@@ -559,7 +559,10 @@ static int omap2430_probe(struct platform_device *pdev) ...@@ -559,7 +559,10 @@ static int omap2430_probe(struct platform_device *pdev)
of_property_read_u32(np, "num-eps", (u32 *)&config->num_eps); of_property_read_u32(np, "num-eps", (u32 *)&config->num_eps);
of_property_read_u32(np, "ram-bits", (u32 *)&config->ram_bits); of_property_read_u32(np, "ram-bits", (u32 *)&config->ram_bits);
of_property_read_u32(np, "power", (u32 *)&pdata->power); of_property_read_u32(np, "power", (u32 *)&pdata->power);
config->multipoint = of_property_read_bool(np, "multipoint");
ret = of_property_read_u32(np, "multipoint", &val);
if (!ret && val)
config->multipoint = true;
pdata->board_data = data; pdata->board_data = data;
pdata->config = config; pdata->config = config;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment