Patchwork [U-Boot] USB: fix USB keyboard polling parameter

login
register
mail settings
Submitter Vincent Palatin
Date Jan. 9, 2012, 6:35 p.m.
Message ID <1326134109-26190-1-git-send-email-vpalatin@chromium.org>
Download mbox | patch
Permalink /patch/135087/
State Accepted
Commit 3d17308e405e6a3eb4de869b36218d2f95c0e546
Delegated to: Marek Vasut
Headers show

Comments

Vincent Palatin - Jan. 9, 2012, 6:35 p.m.
When doing a "GET_REPORT" request on the keyboard control endpoint,
the report ID should 0 (ie report ID not used) rather than 1
as reports are not used in boot mode.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
---
 common/usb_kbd.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Marek Vasut - Jan. 9, 2012, 8:46 p.m.
> When doing a "GET_REPORT" request on the keyboard control endpoint,
> the report ID should 0 (ie report ID not used) rather than 1
> as reports are not used in boot mode.
> 
> Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
> ---
>  common/usb_kbd.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/common/usb_kbd.c b/common/usb_kbd.c
> index 75107c9..aaf7d6f 100644
> --- a/common/usb_kbd.c
> +++ b/common/usb_kbd.c
> @@ -320,7 +320,7 @@ static inline void usb_kbd_poll_for_event(struct
> usb_device *dev) struct usb_kbd_pdata *data = dev->privptr;
>  	iface = &dev->config.if_desc[0];
>  	usb_get_report(dev, iface->desc.bInterfaceNumber,
> -			1, 1, data->new, sizeof(data->new));
> +			1, 0, data->new, sizeof(data->new));
>  	if (memcmp(data->old, data->new, sizeof(data->new)))
>  		usb_kbd_irq_worker(dev);
>  #endif

Good, did you test this?

M
Vincent Palatin - Jan. 9, 2012, 8:50 p.m.
On Mon, Jan 9, 2012 at 12:46, Marek Vasut <marek.vasut@gmail.com> wrote:
>> When doing a "GET_REPORT" request on the keyboard control endpoint,
>> the report ID should 0 (ie report ID not used) rather than 1
>> as reports are not used in boot mode.
>>
>> Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
>> ---
>>  common/usb_kbd.c |    2 +-
>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/common/usb_kbd.c b/common/usb_kbd.c
>> index 75107c9..aaf7d6f 100644
>> --- a/common/usb_kbd.c
>> +++ b/common/usb_kbd.c
>> @@ -320,7 +320,7 @@ static inline void usb_kbd_poll_for_event(struct
>> usb_device *dev) struct usb_kbd_pdata *data = dev->privptr;
>>       iface = &dev->config.if_desc[0];
>>       usb_get_report(dev, iface->desc.bInterfaceNumber,
>> -                     1, 1, data->new, sizeof(data->new));
>> +                     1, 0, data->new, sizeof(data->new));
>>       if (memcmp(data->old, data->new, sizeof(data->new)))
>>               usb_kbd_irq_worker(dev);
>>  #endif
>
> Good, did you test this?

Yes, on about a dozen different keyboards :
  most don't care, a couple used to be confused and are now working.
Marek Vasut - Jan. 9, 2012, 8:53 p.m.
> On Mon, Jan 9, 2012 at 12:46, Marek Vasut <marek.vasut@gmail.com> wrote:
> >> When doing a "GET_REPORT" request on the keyboard control endpoint,
> >> the report ID should 0 (ie report ID not used) rather than 1
> >> as reports are not used in boot mode.
> >> 
> >> Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
> >> ---
> >>  common/usb_kbd.c |    2 +-
> >>  1 files changed, 1 insertions(+), 1 deletions(-)
> >> 
> >> diff --git a/common/usb_kbd.c b/common/usb_kbd.c
> >> index 75107c9..aaf7d6f 100644
> >> --- a/common/usb_kbd.c
> >> +++ b/common/usb_kbd.c
> >> @@ -320,7 +320,7 @@ static inline void usb_kbd_poll_for_event(struct
> >> usb_device *dev) struct usb_kbd_pdata *data = dev->privptr;
> >>       iface = &dev->config.if_desc[0];
> >>       usb_get_report(dev, iface->desc.bInterfaceNumber,
> >> -                     1, 1, data->new, sizeof(data->new));
> >> +                     1, 0, data->new, sizeof(data->new));
> >>       if (memcmp(data->old, data->new, sizeof(data->new)))
> >>               usb_kbd_irq_worker(dev);
> >>  #endif
> > 
> > Good, did you test this?
> 
> Yes, on about a dozen different keyboards :
>   most don't care, a couple used to be confused and are now working.

Awesome :-) I'll test this on mine and Ack it then.

btw. why do you even need this? Do you have some weird hardware ?

M
Remy Bohmer - Jan. 15, 2012, 7:49 p.m.
Hi,

2012/1/9 Vincent Palatin <vpalatin@chromium.org>:
> When doing a "GET_REPORT" request on the keyboard control endpoint,
> the report ID should 0 (ie report ID not used) rather than 1
> as reports are not used in boot mode.
>
> Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
> ---

Applied to u-boot-usb. Thanks.

Kind regards,

Remy
Marek Vasut - Feb. 26, 2012, 11:10 p.m.
> When doing a "GET_REPORT" request on the keyboard control endpoint,
> the report ID should 0 (ie report ID not used) rather than 1
> as reports are not used in boot mode.
> 
> Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
> ---
>  common/usb_kbd.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/common/usb_kbd.c b/common/usb_kbd.c
> index 75107c9..aaf7d6f 100644
> --- a/common/usb_kbd.c
> +++ b/common/usb_kbd.c
> @@ -320,7 +320,7 @@ static inline void usb_kbd_poll_for_event(struct
> usb_device *dev) struct usb_kbd_pdata *data = dev->privptr;
>  	iface = &dev->config.if_desc[0];
>  	usb_get_report(dev, iface->desc.bInterfaceNumber,
> -			1, 1, data->new, sizeof(data->new));
> +			1, 0, data->new, sizeof(data->new));
>  	if (memcmp(data->old, data->new, sizeof(data->new)))
>  		usb_kbd_irq_worker(dev);
>  #endif

Hi,

what's the status of this patch/patchset?

Thanks
M

Patch

diff --git a/common/usb_kbd.c b/common/usb_kbd.c
index 75107c9..aaf7d6f 100644
--- a/common/usb_kbd.c
+++ b/common/usb_kbd.c
@@ -320,7 +320,7 @@  static inline void usb_kbd_poll_for_event(struct usb_device *dev)
 	struct usb_kbd_pdata *data = dev->privptr;
 	iface = &dev->config.if_desc[0];
 	usb_get_report(dev, iface->desc.bInterfaceNumber,
-			1, 1, data->new, sizeof(data->new));
+			1, 0, data->new, sizeof(data->new));
 	if (memcmp(data->old, data->new, sizeof(data->new)))
 		usb_kbd_irq_worker(dev);
 #endif