aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/musb/musb_dsps.c
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2015-02-04 09:28:49 -0500
committerFelipe Balbi <balbi@ti.com>2015-02-23 10:14:30 -0500
commit606bf4d5d630781c0e626b6811ac3aabb57fdf1b (patch)
tree2f382151a9060526bc59925ee8e86c69ac940939 /drivers/usb/musb/musb_dsps.c
parent3e43a0725637299a14369e3ef109c25a8ec5c008 (diff)
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: Tony Lindgren <tony@atomide.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/musb/musb_dsps.c')
-rw-r--r--drivers/usb/musb/musb_dsps.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/usb/musb/musb_dsps.c b/drivers/usb/musb/musb_dsps.c
index 53bd0e71d19f..5872accb0fd3 100644
--- a/drivers/usb/musb/musb_dsps.c
+++ b/drivers/usb/musb/musb_dsps.c
@@ -687,7 +687,7 @@ static int dsps_create_musb_pdev(struct dsps_glue *glue,
687 struct musb_hdrc_config *config; 687 struct musb_hdrc_config *config;
688 struct platform_device *musb; 688 struct platform_device *musb;
689 struct device_node *dn = parent->dev.of_node; 689 struct device_node *dn = parent->dev.of_node;
690 int ret; 690 int ret, val;
691 691
692 memset(resources, 0, sizeof(resources)); 692 memset(resources, 0, sizeof(resources));
693 res = platform_get_resource_byname(parent, IORESOURCE_MEM, "mc"); 693 res = platform_get_resource_byname(parent, IORESOURCE_MEM, "mc");
@@ -739,7 +739,10 @@ static int dsps_create_musb_pdev(struct dsps_glue *glue,
739 pdata.mode = get_musb_port_mode(dev); 739 pdata.mode = get_musb_port_mode(dev);
740 /* DT keeps this entry in mA, musb expects it as per USB spec */ 740 /* DT keeps this entry in mA, musb expects it as per USB spec */
741 pdata.power = get_int_prop(dn, "mentor,power") / 2; 741 pdata.power = get_int_prop(dn, "mentor,power") / 2;
742 config->multipoint = of_property_read_bool(dn, "mentor,multipoint"); 742
743 ret = of_property_read_u32(dn, "mentor,multipoint", &val);
744 if (!ret && val)
745 config->multipoint = true;
743 746
744 ret = platform_device_add_data(musb, &pdata, sizeof(pdata)); 747 ret = platform_device_add_data(musb, &pdata, sizeof(pdata));
745 if (ret) { 748 if (ret) {