From: Tony Lindgren <tony@atomide.com>
To: Felipe Balbi <balbi@ti.com>
Cc: linux-usb@vger.kernel.org, linux-omap@vger.kernel.org,
Brian Hutchinson <b.hutchman@gmail.com>
Subject: Re: [PATCH 1/2] usb: musb: Fix use for of_property_read_bool for disabled multipoint
Date: Thu, 5 Feb 2015 11:13:01 -0800 [thread overview]
Message-ID: <20150205191300.GD25235@atomide.com> (raw)
In-Reply-To: <20150205180905.GE22782@saruman.tx.rr.com>
* Felipe Balbi <balbi@ti.com> [150205 10:12]:
> On Thu, Feb 05, 2015 at 08:35:12AM -0800, Tony Lindgren wrote:
> > 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>
>
> do you mind waiting a little bit to see if my boolean properties with
> value patch is accepted ?
This can wait for v3.20-rc1 for sure but cc stable would be nice to
avoid more pointless debugging by somebody else.
> http://marc.info/?l=linux-omap&m=142315930232743&w=2
>
> At least let's see where the discussion moves.
Cool yeah at least a warning should be printed, sounds like it may
not be usable for fixing $subject though.
I also noticed that a last minute change I did from read_u32 to
read_u8 in $subject patch broke things and introduced new build
warnings. Here's a fixed version back to using read_u32 instead
of read_u8 so we don't need to specify the storage size with
/bits/ 8 values in the dts files.
Regards,
Tony
8< ------------------------
From: Tony Lindgren <tony@atomide.com>
Date: Wed, 4 Feb 2015 06:28:49 -0800
Subject: [PATCH] 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>
--- 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,
struct musb_hdrc_config *config;
struct platform_device *musb;
struct device_node *dn = parent->dev.of_node;
- int ret;
+ int ret, val;
memset(resources, 0, sizeof(resources));
res = platform_get_resource_byname(parent, IORESOURCE_MEM, "mc");
@@ -739,7 +739,10 @@ static int dsps_create_musb_pdev(struct dsps_glue *glue,
pdata.mode = get_musb_port_mode(dev);
/* DT keeps this entry in mA, musb expects it as per USB spec */
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));
if (ret) {
--- a/drivers/usb/musb/omap2430.c
+++ b/drivers/usb/musb/omap2430.c
@@ -516,7 +516,7 @@ static int omap2430_probe(struct platform_device *pdev)
struct omap2430_glue *glue;
struct device_node *np = pdev->dev.of_node;
struct musb_hdrc_config *config;
- int ret = -ENOMEM;
+ int ret = -ENOMEM, val;
glue = devm_kzalloc(&pdev->dev, sizeof(*glue), GFP_KERNEL);
if (!glue)
@@ -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, "ram-bits", (u32 *)&config->ram_bits);
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->config = config;
next prev parent reply other threads:[~2015-02-05 19:15 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-05 16:35 [PATCH 0/2] MUSB fix for disabled multipoint and generic phy Tony Lindgren
2015-02-05 16:35 ` [PATCH 1/2] usb: musb: Fix use for of_property_read_bool for disabled multipoint Tony Lindgren
2015-02-05 18:09 ` Felipe Balbi
2015-02-05 19:13 ` Tony Lindgren [this message]
2015-02-05 16:35 ` [PATCH 2/2] usb: musb: Fix getting a generic phy for musb_dsps Tony Lindgren
[not found] ` <1423154113-23463-3-git-send-email-tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2015-02-06 12:58 ` George Cherian
2015-02-06 17:23 ` Tony Lindgren
2015-02-06 18:18 ` Bin Liu
[not found] ` <CADYTM3brwenr4706Xqp91Vg7OVxT0CENy8aHhyzJ+vOGxxvRVw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-02-09 18:39 ` Tony Lindgren
2015-02-09 19:02 ` Bin Liu
[not found] ` <20150206172313.GF25235-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2015-02-09 5:56 ` George Cherian
[not found] ` <54D84BF3.7060801-l0cyMroinI0@public.gmane.org>
2015-02-09 18:40 ` Tony Lindgren
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150205191300.GD25235@atomide.com \
--to=tony@atomide.com \
--cc=b.hutchman@gmail.com \
--cc=balbi@ti.com \
--cc=linux-omap@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).