Re: [PATCHv3 1/6] omap3: Add external VBUS power switch and overcurrent detect on IGEP v2 board.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

2010/10/5 David Cohen <david.cohen@xxxxxxxxx>:
> On Sat, Oct 02, 2010 at 12:12:32PM +0200, ext Enric Balletbà i Serra wrote:
>> 2010/10/2 David Cohen <david.cohen@xxxxxxxxx>:
>> > Hi,
>> >
>> > On Fri, Oct 01, 2010 at 11:09:04PM +0200, ext Enric Balletbo i Serra wrote:
>> >> GPIO for various devices are missing from the board initialization.
>> >> This patch adds support for the VBUS and over current gpios. ÂWithout this
>> >> patch, input/outputs from these two sources are ignored.
>> >>
>> >> Signed-off-by: Enric Balletbo i Serra <eballetbo@xxxxxxxxx>
>> >> ---
>> >> Âarch/arm/mach-omap2/board-igep0020.c | Â 16 ++++++++++++++++
>> >> Â1 files changed, 16 insertions(+), 0 deletions(-)
>> >>
>> >> diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c
>> >> index 175f043..07dbdb7 100644
>> >> --- a/arch/arm/mach-omap2/board-igep0020.c
>> >> +++ b/arch/arm/mach-omap2/board-igep0020.c
>> >> @@ -274,6 +274,22 @@ static int igep2_twl_gpio_setup(struct device *dev,
>> >> Â Â Â igep2_vmmc1_supply.dev = mmc[0].dev;
>> >> Â Â Â igep2_vmmc2_supply.dev = mmc[1].dev;
>> >>
>> >> + Â Â /*
>> >> + Â Â Â* REVISIT: need ehci-omap hooks for external VBUS
>> >> + Â Â Â* power switch and overcurrent detect
>> >> + Â Â Â*/
>> >> + Â Â if ((gpio_request(gpio + 1, "GPIO_EHCI_NOC") < 0) ||
>> >> + Â Â Â Â (gpio_direction_input(gpio + 1) < 0))
>> >> + Â Â Â Â Â Â pr_err("IGEP2: Could not obtain gpio for EHCI NOC");
>> >
>> > Shouldb't you return error if it can't request the GPIO?
>>
>> I'm not sure what happens if I return and error, I see only prints a
>> debug message. Maybe the twl4030-gpio maintainer can explain if I need
>> return and error or not.
>>
>> Other omap boards just don't check the gpio_request call and always
>> return 0. I don't consider this a critical error so maybe should be
>> better replace the pr_err with a pr_warning.
>
> I checked some board files and it seems they're not verifying gpio_request()
> results most of the times. But if you check board-omap3pandor.c, it's
> been done in a better way.
>

I think so, looks a better way. I'll introduce this in a future patch,

There are many GPIO's in board-igep* so I think should be better
introduce these changes in a new patch. Thanks for you comments.

Best regards,

  Enric
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux