diff mbox series

[v2,2/4] ads7846: put it into the 'display' category

Message ID 20201111164710.644863-3-ganqixin@huawei.com
State New
Headers show
Series Categorize some uncategorized devices | expand

Commit Message

Gan Qixin Nov. 11, 2020, 4:47 p.m. UTC
The category of the ads7846 device is not set, put it into the 'display'
category.

Signed-off-by: Gan Qixin <ganqixin@huawei.com>
---
 hw/display/ads7846.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Thomas Huth Nov. 12, 2020, 7:36 a.m. UTC | #1
On 11/11/2020 17.47, Gan Qixin wrote:
> The category of the ads7846 device is not set, put it into the 'display'
> category.
> 
> Signed-off-by: Gan Qixin <ganqixin@huawei.com>
> ---
>  hw/display/ads7846.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/hw/display/ads7846.c b/hw/display/ads7846.c
> index 023165b2a3..b455cb5acd 100644
> --- a/hw/display/ads7846.c
> +++ b/hw/display/ads7846.c
> @@ -163,10 +163,12 @@ static void ads7846_realize(SSISlave *d, Error **errp)
>  
>  static void ads7846_class_init(ObjectClass *klass, void *data)
>  {
> +    DeviceClass *dc = DEVICE_CLASS(klass);
>      SSISlaveClass *k = SSI_SLAVE_CLASS(klass);
>  
>      k->realize = ads7846_realize;
>      k->transfer = ads7846_transfer;
> +    set_bit(DEVICE_CATEGORY_DISPLAY, dc->categories);
>  }
>  
>  static const TypeInfo ads7846_info = {
> 

Reviewed-by: Thomas Huth <thuth@redhat.com>
Peter Maydell Nov. 12, 2020, 11:19 a.m. UTC | #2
On Thu, 12 Nov 2020 at 07:25, Gan Qixin <ganqixin@huawei.com> wrote:
>
> The category of the ads7846 device is not set, put it into the 'display'
> category.
>
> Signed-off-by: Gan Qixin <ganqixin@huawei.com>
> ---
>  hw/display/ads7846.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/hw/display/ads7846.c b/hw/display/ads7846.c
> index 023165b2a3..b455cb5acd 100644
> --- a/hw/display/ads7846.c
> +++ b/hw/display/ads7846.c
> @@ -163,10 +163,12 @@ static void ads7846_realize(SSISlave *d, Error **errp)
>
>  static void ads7846_class_init(ObjectClass *klass, void *data)
>  {
> +    DeviceClass *dc = DEVICE_CLASS(klass);
>      SSISlaveClass *k = SSI_SLAVE_CLASS(klass);
>
>      k->realize = ads7846_realize;
>      k->transfer = ads7846_transfer;
> +    set_bit(DEVICE_CATEGORY_DISPLAY, dc->categories);
>  }

This isn't a display, despite being in hw/display. It's a
touch-screen controller, so it ought to be in hw/input
and be DEVICE_CATEGORY_INPUT.

thanks
-- PMM
Gan Qixin Nov. 12, 2020, 11:53 a.m. UTC | #3
> -----Original Message-----
> From: Peter Maydell [mailto:peter.maydell@linaro.org]
> Sent: Thursday, November 12, 2020 7:20 PM
> To: ganqixin <ganqixin@huawei.com>
> Cc: QEMU Developers <qemu-devel@nongnu.org>; QEMU Trivial
> <qemu-trivial@nongnu.org>; Thomas Huth <thuth@redhat.com>;
> Zhanghailiang <zhang.zhanghailiang@huawei.com>; Michael S. Tsirkin
> <mst@redhat.com>; Laurent Vivier <laurent@vivier.eu>; Markus Armbruster
> <armbru@redhat.com>; Chenqun (kuhn) <kuhn.chenqun@huawei.com>;
> Philippe Mathieu-Daudé <philmd@redhat.com>
> Subject: Re: [PATCH v2 2/4] ads7846: put it into the 'display' category
> 
> On Thu, 12 Nov 2020 at 07:25, Gan Qixin <ganqixin@huawei.com> wrote:
> >
> > The category of the ads7846 device is not set, put it into the 'display'
> > category.
> >
> > Signed-off-by: Gan Qixin <ganqixin@huawei.com>
> > ---
> >  hw/display/ads7846.c | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/hw/display/ads7846.c b/hw/display/ads7846.c index
> > 023165b2a3..b455cb5acd 100644
> > --- a/hw/display/ads7846.c
> > +++ b/hw/display/ads7846.c
> > @@ -163,10 +163,12 @@ static void ads7846_realize(SSISlave *d, Error
> > **errp)
> >
> >  static void ads7846_class_init(ObjectClass *klass, void *data)  {
> > +    DeviceClass *dc = DEVICE_CLASS(klass);
> >      SSISlaveClass *k = SSI_SLAVE_CLASS(klass);
> >
> >      k->realize = ads7846_realize;
> >      k->transfer = ads7846_transfer;
> > +    set_bit(DEVICE_CATEGORY_DISPLAY, dc->categories);
> >  }
> 
> This isn't a display, despite being in hw/display. It's a touch-screen controller,
> so it ought to be in hw/input and be DEVICE_CATEGORY_INPUT.
> 
Thanks for your reply, I will recategorize ads7846.

Gan Qixin
diff mbox series

Patch

diff --git a/hw/display/ads7846.c b/hw/display/ads7846.c
index 023165b2a3..b455cb5acd 100644
--- a/hw/display/ads7846.c
+++ b/hw/display/ads7846.c
@@ -163,10 +163,12 @@  static void ads7846_realize(SSISlave *d, Error **errp)
 
 static void ads7846_class_init(ObjectClass *klass, void *data)
 {
+    DeviceClass *dc = DEVICE_CLASS(klass);
     SSISlaveClass *k = SSI_SLAVE_CLASS(klass);
 
     k->realize = ads7846_realize;
     k->transfer = ads7846_transfer;
+    set_bit(DEVICE_CATEGORY_DISPLAY, dc->categories);
 }
 
 static const TypeInfo ads7846_info = {