Patchwork [2/4] kbd leds: ps/2 kbd

login
register
mail settings
Submitter Gerd Hoffmann
Date Feb. 25, 2010, 8:39 a.m.
Message ID <1267087161-15204-3-git-send-email-kraxel@redhat.com>
Download mbox | patch
Permalink /patch/46224/
State New
Headers show

Comments

Gerd Hoffmann - Feb. 25, 2010, 8:39 a.m.
Add led status notification support to the ps/2 kbd driver.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/ps2.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
Juan Quintela - Feb. 25, 2010, 10:59 a.m.
Gerd Hoffmann <kraxel@redhat.com> wrote:
> Add led status notification support to the ps/2 kbd driver.
>
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> ---
>  hw/ps2.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/hw/ps2.c b/hw/ps2.c
> index 15a6650..3dc3b15 100644
> --- a/hw/ps2.c
> +++ b/hw/ps2.c
> @@ -185,6 +185,7 @@ static void ps2_reset_keyboard(PS2KbdState *s)
>  {
>      s->scan_enabled = 1;
>      s->scancode_set = 2;
> +    kbd_put_ledstate(0);
>  }
>  
>  void ps2_write_keyboard(void *opaque, int val)
> @@ -259,6 +260,7 @@ void ps2_write_keyboard(void *opaque, int val)
>          s->common.write_cmd = -1;
>          break;
>      case KBD_CMD_SET_LEDS:
> +        kbd_put_ledstate(val);

You need a comment here, stating that the new QEMU_*_LOCK_LED values are the same
than the ps2 ones.

>          ps2_queue(&s->common, KBD_REPLY_ACK);
>          s->common.write_cmd = -1;
>          break;

Agreed with the rest of the changes.

Patch

diff --git a/hw/ps2.c b/hw/ps2.c
index 15a6650..3dc3b15 100644
--- a/hw/ps2.c
+++ b/hw/ps2.c
@@ -185,6 +185,7 @@  static void ps2_reset_keyboard(PS2KbdState *s)
 {
     s->scan_enabled = 1;
     s->scancode_set = 2;
+    kbd_put_ledstate(0);
 }
 
 void ps2_write_keyboard(void *opaque, int val)
@@ -259,6 +260,7 @@  void ps2_write_keyboard(void *opaque, int val)
         s->common.write_cmd = -1;
         break;
     case KBD_CMD_SET_LEDS:
+        kbd_put_ledstate(val);
         ps2_queue(&s->common, KBD_REPLY_ACK);
         s->common.write_cmd = -1;
         break;