Re: usb hid: reset NumLock

From: Jiri Kosina
Date: Mon Apr 02 2007 - 12:21:37 EST


On Sun, 1 Apr 2007, Pete Zaitcev wrote:

> diff --git a/drivers/usb/input/hid-core.c b/drivers/usb/input/hid-core.c
> index ef09952..7338e81 100644
> --- a/drivers/usb/input/hid-core.c
> +++ b/drivers/usb/input/hid-core.c
> @@ -548,6 +548,28 @@ void usbhid_init_reports(struct hid_device *hid)
> warn("timeout initializing reports");
> }
>
> +/*
> + * Reset LEDs which BIOS might have left on.
> + */
> +static int hid_find_field_early(struct hid_device *hid, unsigned int page,
> + unsigned int hid_code, struct hid_field **field);

Hi Pete,

could you please change the order of the two functions, so that you
don't have to put the forward declaration here?

> + /*
> + * Just reset Num Lock for now.
> + * This is called for non-keyboard devices too, so no printk if field
> + * is not found.
> + */

I'd say this is a little bit overcommented.

> The main reason is, I have a USB-to-PS/2 adapter where early acces to
> LEDs does not work. Apparently, it is still initializing the PS/2 part
> when it reports to USB that it's ready, and needs a delay. So, I figured
> that I may be breaking some odd devices. Some may crash or whatnot. This
> is why I asked Stuart to get me VID/PID for involved keyboards.

Fair enough, thanks.

Besides the trivial nitpicks above, I think that this fixed version is
fine. So as soon as you have the VIDs and PIDs of the hardware which
requires this, could you please update the patch and send it to me again?

Thanks,

--
Jiri Kosina
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/