lkml.org 
[lkml]   [2010]   [Jan]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/1] atmel uaba : Adding invert vbus_pin
Hello.

Eirik Aanonsen wrote:

> Adding vbus_pin_inverted so that the usb detect pin can be active high or low.
> This because depending on HW implementation it is better to have active low.
> Also replaced the pio_get_value(udc->vbus_pin); with a call to vbus_is_present(udc);
>
> Signed-off-by: Eirik Aanonsen <eaa@wprmedical.com>
>
[...]
> diff --git a/drivers/usb/gadget/atmel_usba_udc.c b/drivers/usb/gadget/atmel_usba_udc.c
> index 4e970cf..1c469d4 100644
> --- a/drivers/usb/gadget/atmel_usba_udc.c
> +++ b/drivers/usb/gadget/atmel_usba_udc.c
> @@ -320,8 +320,17 @@ static inline void usba_cleanup_debugfs(struct usba_udc *udc)
> static int vbus_is_present(struct usba_udc *udc)
> {
> if (gpio_is_valid(udc->vbus_pin))
> - return gpio_get_value(udc->vbus_pin);
> -
> + {
> + if(udc->vbus_pin_inverted)
>

Space missing after *if*.

> + {
> + if( gpio_get_value(udc->vbus_pin) == 1)
>

Space missing after *if* and there should be no space after (.

> + return 0;
> + else
> + return 1;
>

Why not simply:

return !gpio_get_value(udc->vbus_pin);


> + }
> + else
>

} and *else* should be on the same line.
Please run your patches thru scripts/checkpatch.pl before submitting...

WBR, Sergei




\
 
 \ /
  Last update: 2010-01-04 22:39    [W:0.065 / U:0.160 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site