diff mbox series

hw: input: set category of the i8042 device

Message ID 20190125151440.13794-1-sourav.jb1988@gmail.com
State New
Headers show
Series hw: input: set category of the i8042 device | expand

Commit Message

kumar sourav Jan. 25, 2019, 3:14 p.m. UTC
Sets the category of i8042 device as DEVICE_CATEGORY_INPUT
Devices should be assigned to one of DEVICE_CATEGORY_XXXX.

Signed-off-by: kumar sourav <sourav.jb1988@gmail.com>
---
 hw/input/pckbd.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Thomas Huth Jan. 25, 2019, 3:24 p.m. UTC | #1
On 2019-01-25 16:14, kumar sourav wrote:
> Sets the category of i8042 device as DEVICE_CATEGORY_INPUT
> Devices should be assigned to one of DEVICE_CATEGORY_XXXX.
> 
> Signed-off-by: kumar sourav <sourav.jb1988@gmail.com>
> ---
>  hw/input/pckbd.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/hw/input/pckbd.c b/hw/input/pckbd.c
> index 3e66713b47..72e7d5f6cc 100644
> --- a/hw/input/pckbd.c
> +++ b/hw/input/pckbd.c
> @@ -574,6 +574,7 @@ static void i8042_class_initfn(ObjectClass *klass, void *data)
>  
>      dc->realize = i8042_realizefn;
>      dc->vmsd = &vmstate_kbd_isa;
> +    set_bit(DEVICE_CATEGORY_INPUT, dc->categories);
>  }
>  
>  static const TypeInfo i8042_info = {
> 

Reviewed-by: Thomas Huth <thuth@redhat.com>
Philippe Mathieu-Daudé Jan. 25, 2019, 4:44 p.m. UTC | #2
On 1/25/19 4:24 PM, Thomas Huth wrote:
> On 2019-01-25 16:14, kumar sourav wrote:
>> Sets the category of i8042 device as DEVICE_CATEGORY_INPUT
>> Devices should be assigned to one of DEVICE_CATEGORY_XXXX.
>>
>> Signed-off-by: kumar sourav <sourav.jb1988@gmail.com>
>> ---
>>  hw/input/pckbd.c | 1 +

It seems we have other potential cases:

$ git grep -L 'set_bit(DEVICE_CATEGORY_INPUT' hw/input/*c
hw/input/adb.c
hw/input/hid.c
hw/input/lm832x.c
hw/input/milkymist-softusb.c
hw/input/pckbd.c
hw/input/pl050.c
hw/input/ps2.c
hw/input/pxa2xx_keypad.c
hw/input/stellaris_input.c
hw/input/tsc2005.c
hw/input/tsc210x.c
hw/input/virtio-input-hid.c
hw/input/virtio-input-host.c

>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/hw/input/pckbd.c b/hw/input/pckbd.c
>> index 3e66713b47..72e7d5f6cc 100644
>> --- a/hw/input/pckbd.c
>> +++ b/hw/input/pckbd.c
>> @@ -574,6 +574,7 @@ static void i8042_class_initfn(ObjectClass *klass, void *data)
>>  
>>      dc->realize = i8042_realizefn;
>>      dc->vmsd = &vmstate_kbd_isa;
>> +    set_bit(DEVICE_CATEGORY_INPUT, dc->categories);
>>  }
>>  
>>  static const TypeInfo i8042_info = {
>>
> 
> Reviewed-by: Thomas Huth <thuth@redhat.com>

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
kumar sourav Jan. 25, 2019, 6 p.m. UTC | #3
On Fri, Jan 25, 2019 at 10:14 PM Philippe Mathieu-Daudé
<philmd@redhat.com> wrote:
>
> On 1/25/19 4:24 PM, Thomas Huth wrote:
> > On 2019-01-25 16:14, kumar sourav wrote:
> >> Sets the category of i8042 device as DEVICE_CATEGORY_INPUT
> >> Devices should be assigned to one of DEVICE_CATEGORY_XXXX.
> >>
> >> Signed-off-by: kumar sourav <sourav.jb1988@gmail.com>
> >> ---
> >>  hw/input/pckbd.c | 1 +
>
> It seems we have other potential cases:
>
> $ git grep -L 'set_bit(DEVICE_CATEGORY_INPUT' hw/input/*c
> hw/input/adb.c
> hw/input/hid.c
> hw/input/lm832x.c
> hw/input/milkymist-softusb.c
> hw/input/pckbd.c
> hw/input/pl050.c
> hw/input/ps2.c
> hw/input/pxa2xx_keypad.c
> hw/input/stellaris_input.c
> hw/input/tsc2005.c
> hw/input/tsc210x.c
> hw/input/virtio-input-hid.c
> hw/input/virtio-input-host.c
>
> >>  1 file changed, 1 insertion(+)
> >>
> >> diff --git a/hw/input/pckbd.c b/hw/input/pckbd.c
> >> index 3e66713b47..72e7d5f6cc 100644
> >> --- a/hw/input/pckbd.c
> >> +++ b/hw/input/pckbd.c
> >> @@ -574,6 +574,7 @@ static void i8042_class_initfn(ObjectClass *klass, void *data)
> >>
> >>      dc->realize = i8042_realizefn;
> >>      dc->vmsd = &vmstate_kbd_isa;
> >> +    set_bit(DEVICE_CATEGORY_INPUT, dc->categories);
> >>  }
> >>
> >>  static const TypeInfo i8042_info = {
> >>
> >
> > Reviewed-by: Thomas Huth <thuth@redhat.com>
>
> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>
Ok I will add device categories for these devices too. Should I send
the changes in one patch for all these devices/files ?
Or should I send it separately - one patch per device/file ?

Thanks & Regards
Michael S. Tsirkin Jan. 25, 2019, 7:46 p.m. UTC | #4
On Fri, Jan 25, 2019 at 08:44:40PM +0530, kumar sourav wrote:
> Sets the category of i8042 device as DEVICE_CATEGORY_INPUT
> Devices should be assigned to one of DEVICE_CATEGORY_XXXX.
> 
> Signed-off-by: kumar sourav <sourav.jb1988@gmail.com>

Reviewed-by: Michael S. Tsirkin <mst@redhat.com>

who's merging this? Paolo?

> ---
>  hw/input/pckbd.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/hw/input/pckbd.c b/hw/input/pckbd.c
> index 3e66713b47..72e7d5f6cc 100644
> --- a/hw/input/pckbd.c
> +++ b/hw/input/pckbd.c
> @@ -574,6 +574,7 @@ static void i8042_class_initfn(ObjectClass *klass, void *data)
>  
>      dc->realize = i8042_realizefn;
>      dc->vmsd = &vmstate_kbd_isa;
> +    set_bit(DEVICE_CATEGORY_INPUT, dc->categories);
>  }
>  
>  static const TypeInfo i8042_info = {
> -- 
> 2.17.1
Michael S. Tsirkin Jan. 25, 2019, 7:47 p.m. UTC | #5
On Fri, Jan 25, 2019 at 11:30:10PM +0530, ksourav wrote:
> On Fri, Jan 25, 2019 at 10:14 PM Philippe Mathieu-Daudé
> <philmd@redhat.com> wrote:
> >
> > On 1/25/19 4:24 PM, Thomas Huth wrote:
> > > On 2019-01-25 16:14, kumar sourav wrote:
> > >> Sets the category of i8042 device as DEVICE_CATEGORY_INPUT
> > >> Devices should be assigned to one of DEVICE_CATEGORY_XXXX.
> > >>
> > >> Signed-off-by: kumar sourav <sourav.jb1988@gmail.com>
> > >> ---
> > >>  hw/input/pckbd.c | 1 +
> >
> > It seems we have other potential cases:
> >
> > $ git grep -L 'set_bit(DEVICE_CATEGORY_INPUT' hw/input/*c
> > hw/input/adb.c
> > hw/input/hid.c
> > hw/input/lm832x.c
> > hw/input/milkymist-softusb.c
> > hw/input/pckbd.c
> > hw/input/pl050.c
> > hw/input/ps2.c
> > hw/input/pxa2xx_keypad.c
> > hw/input/stellaris_input.c
> > hw/input/tsc2005.c
> > hw/input/tsc210x.c
> > hw/input/virtio-input-hid.c
> > hw/input/virtio-input-host.c
> >
> > >>  1 file changed, 1 insertion(+)
> > >>
> > >> diff --git a/hw/input/pckbd.c b/hw/input/pckbd.c
> > >> index 3e66713b47..72e7d5f6cc 100644
> > >> --- a/hw/input/pckbd.c
> > >> +++ b/hw/input/pckbd.c
> > >> @@ -574,6 +574,7 @@ static void i8042_class_initfn(ObjectClass *klass, void *data)
> > >>
> > >>      dc->realize = i8042_realizefn;
> > >>      dc->vmsd = &vmstate_kbd_isa;
> > >> +    set_bit(DEVICE_CATEGORY_INPUT, dc->categories);
> > >>  }
> > >>
> > >>  static const TypeInfo i8042_info = {
> > >>
> > >
> > > Reviewed-by: Thomas Huth <thuth@redhat.com>
> >
> > Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> >
> Ok I will add device categories for these devices too. Should I send
> the changes in one patch for all these devices/files ?
> Or should I send it separately - one patch per device/file ?
> 
> Thanks & Regards

Either is fine. One patch will be merged faster :)
Thomas Huth Jan. 28, 2019, 8:14 a.m. UTC | #6
On 2019-01-25 17:44, Philippe Mathieu-Daudé wrote:
> On 1/25/19 4:24 PM, Thomas Huth wrote:
>> On 2019-01-25 16:14, kumar sourav wrote:
>>> Sets the category of i8042 device as DEVICE_CATEGORY_INPUT
>>> Devices should be assigned to one of DEVICE_CATEGORY_XXXX.
>>>
>>> Signed-off-by: kumar sourav <sourav.jb1988@gmail.com>
>>> ---
>>>  hw/input/pckbd.c | 1 +
> 
> It seems we have other potential cases:
> 
> $ git grep -L 'set_bit(DEVICE_CATEGORY_INPUT' hw/input/*c
> hw/input/adb.c
> hw/input/hid.c
> hw/input/lm832x.c
> hw/input/milkymist-softusb.c
> hw/input/pckbd.c
> hw/input/pl050.c
> hw/input/ps2.c
> hw/input/pxa2xx_keypad.c
> hw/input/stellaris_input.c
> hw/input/tsc2005.c
> hw/input/tsc210x.c
> hw/input/virtio-input-hid.c
> hw/input/virtio-input-host.c

Note that some of these are not even "qomified" yet (e.g. tsc2005),
others are not creatable by the user (pl050) as far as I can see, so it
does not make much sense to set a category for these devices yet.

 Thomas
Laurent Vivier Jan. 30, 2019, 9:19 a.m. UTC | #7
On 25/01/2019 16:14, kumar sourav wrote:
> Sets the category of i8042 device as DEVICE_CATEGORY_INPUT
> Devices should be assigned to one of DEVICE_CATEGORY_XXXX.
> 
> Signed-off-by: kumar sourav <sourav.jb1988@gmail.com>
> ---
>  hw/input/pckbd.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/hw/input/pckbd.c b/hw/input/pckbd.c
> index 3e66713b47..72e7d5f6cc 100644
> --- a/hw/input/pckbd.c
> +++ b/hw/input/pckbd.c
> @@ -574,6 +574,7 @@ static void i8042_class_initfn(ObjectClass *klass, void *data)
>  
>      dc->realize = i8042_realizefn;
>      dc->vmsd = &vmstate_kbd_isa;
> +    set_bit(DEVICE_CATEGORY_INPUT, dc->categories);
>  }
>  
>  static const TypeInfo i8042_info = {
> 

Applied to my trivial-patches branch.

Thanks,
Laurent
diff mbox series

Patch

diff --git a/hw/input/pckbd.c b/hw/input/pckbd.c
index 3e66713b47..72e7d5f6cc 100644
--- a/hw/input/pckbd.c
+++ b/hw/input/pckbd.c
@@ -574,6 +574,7 @@  static void i8042_class_initfn(ObjectClass *klass, void *data)
 
     dc->realize = i8042_realizefn;
     dc->vmsd = &vmstate_kbd_isa;
+    set_bit(DEVICE_CATEGORY_INPUT, dc->categories);
 }
 
 static const TypeInfo i8042_info = {