On Monday 04 February 2013 09:28 PM, Roger Quadros wrote:
quoted hunk
Add 2 flags, needs_vcc and needs_reset to platform data.
If the flag is set and the regulator couldn't be found
then we bail out with -EPROBE_DEFER.
For device tree boot we depend on presensce of vcc-supply/
reset-supply properties to decide if we should bail out
with -EPROBE_DEFER or just continue in case the regulator
can't be found.
This is required for proper functionality in cases where the
regulator is needed but is probed later than the PHY device.
Signed-off-by: Roger Quadros <redacted>
---
drivers/usb/otg/nop-usb-xceiv.c | 8 ++++++++
include/linux/usb/nop-usb-xceiv.h | 4 ++++
2 files changed, 12 insertions(+), 0 deletions(-)
@@ -6,6 +6,10 @@structnop_usb_xceiv_platform_data{enumusb_phy_typetype;unsignedlongclk_rate;++/* if set fails with -EPROBE_DEFER if can't get regulator */+unsignedintneeds_vcc:1;+unsignedintneeds_reset:1;
From: Roger Quadros <hidden> Date: 2013-02-05 08:44:05
On 02/05/2013 07:54 AM, kishon wrote:
On Monday 04 February 2013 09:28 PM, Roger Quadros wrote:
quoted
Add 2 flags, needs_vcc and needs_reset to platform data.
If the flag is set and the regulator couldn't be found
then we bail out with -EPROBE_DEFER.
For device tree boot we depend on presensce of vcc-supply/
reset-supply properties to decide if we should bail out
with -EPROBE_DEFER or just continue in case the regulator
can't be found.
This is required for proper functionality in cases where the
regulator is needed but is probed later than the PHY device.
Signed-off-by: Roger Quadros <redacted>
---
drivers/usb/otg/nop-usb-xceiv.c | 8 ++++++++
include/linux/usb/nop-usb-xceiv.h | 4 ++++
2 files changed, 12 insertions(+), 0 deletions(-)
@@ -6,6 +6,10 @@structnop_usb_xceiv_platform_data{enumusb_phy_typetype;unsignedlongclk_rate;++/* if set fails with -EPROBE_DEFER if can't get regulator */+unsignedintneeds_vcc:1;+unsignedintneeds_reset:1;
how about u8 here?
Not sure. Bitfields are usually defined as unsigned int.
cheers,
-roger
@@ -6,6 +6,10 @@structnop_usb_xceiv_platform_data{enumusb_phy_typetype;unsignedlongclk_rate;++/* if set fails with -EPROBE_DEFER if can't get regulator */+unsignedintneeds_vcc:1;+unsignedintneeds_reset:1;
how about u8 here?
Not sure. Bitfields are usually defined as unsigned int.
IIRC the benefit is that compiler can try to optimize those flags. I
mean, if you have 32 1-bit flags, compiler will combine those in a
single u32. Someone correct me if I'm wrong.
after you fix other comments from kishon (about of_read_bool()), you can
add my:
Acked-by: Felipe Balbi <redacted>
--
balbi
@@ -6,6 +6,10 @@structnop_usb_xceiv_platform_data{enumusb_phy_typetype;unsignedlongclk_rate;++/* if set fails with -EPROBE_DEFER if can't get regulator */+unsignedintneeds_vcc:1;+unsignedintneeds_reset:1;
how about u8 here?
Not sure. Bitfields are usually defined as unsigned int.
IIRC the benefit is that compiler can try to optimize those flags. I
mean, if you have 32 1-bit flags, compiler will combine those in a
single u32. Someone correct me if I'm wrong.
Yes you are right. Kishon was asking me to use u8 instead of unsigned int, which
I don't think is necessary. AFAIK, it is a norm to use unsigned int when defining
a bitfield. Compilers are known to behave funny with bitfields. I don't mind
using bool for each.
cheers,
-roger