lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZzNBpkwDLgutPJq8@ux-UP-WHL01>
Date: Tue, 12 Nov 2024 19:53:10 +0800
From: Charles Wang <charles.goodix@...il.com>
To: Doug Anderson <dianders@...omium.org>
Cc: robh@...nel.org, krzk@...nel.org, hbarnor@...omium.org,
	conor.dooley@...rochip.com, dmitry.torokhov@...il.com,
	jikos@...nel.org, bentiss@...nel.org, linux-input@...r.kernel.org,
	devicetree@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4 2/2] HID: hid-goodix: Add OF supports

Hi Doug,

On Mon, Nov 11, 2024 at 09:24:39AM -0800, Doug Anderson wrote:
> Hi,
> 
> On Sun, Nov 10, 2024 at 11:50 PM Charles Wang <charles.goodix@...il.com> wrote:
> >
> > This patch introduces the following changes:
> > - Adds OF match table.
> > - Hardcodes hid-report-addr in the driver rather than fetching it
> >   from the device property.
> >
> > Signed-off-by: Charles Wang <charles.goodix@...il.com>
> > ---
> >  drivers/hid/hid-goodix-spi.c | 17 +++++++++++------
> >  1 file changed, 11 insertions(+), 6 deletions(-)
> >
> > diff --git a/drivers/hid/hid-goodix-spi.c b/drivers/hid/hid-goodix-spi.c
> > index 6ae2300a6..80c0288a3 100644
> > --- a/drivers/hid/hid-goodix-spi.c
> > +++ b/drivers/hid/hid-goodix-spi.c
> > @@ -20,6 +20,7 @@
> >  #define GOODIX_HID_REPORT_DESC_ADDR    0x105AA
> >  #define GOODIX_HID_SIGN_ADDR           0x10D32
> >  #define GOODIX_HID_CMD_ADDR            0x10364
> > +#define GOODIX_HID_REPORT_ADDR         0x22C8C
> >
> >  #define GOODIX_HID_GET_REPORT_CMD      0x02
> >  #define GOODIX_HID_SET_REPORT_CMD      0x03
> > @@ -701,12 +702,7 @@ static int goodix_spi_probe(struct spi_device *spi)
> >                 return dev_err_probe(dev, PTR_ERR(ts->reset_gpio),
> >                                      "failed to request reset gpio\n");
> >
> > -       error = device_property_read_u32(dev, "goodix,hid-report-addr",
> > -                                        &ts->hid_report_addr);
> > -       if (error)
> > -               return dev_err_probe(dev, error,
> > -                                    "failed get hid report addr\n");
> > -
> > +       ts->hid_report_addr = GOODIX_HID_REPORT_ADDR;
> >         error = goodix_dev_confirm(ts);
> >         if (error)
> >                 return error;
> > @@ -790,6 +786,14 @@ static const struct acpi_device_id goodix_spi_acpi_match[] = {
> >  MODULE_DEVICE_TABLE(acpi, goodix_spi_acpi_match);
> >  #endif
> >
> > +#ifdef CONFIG_OF
> > +static const struct of_device_id goodix_spi_of_match[] = {
> > +       { .compatible = "goodix,gt7986u-spifw", },
> > +       { }
> > +};
> > +MODULE_DEVICE_TABLE(of, goodix_spi_of_match);
> > +#endif
> > +
> >  static const struct spi_device_id goodix_spi_ids[] = {
> >         { "gt7986u" },
> >         { },
> > @@ -800,6 +804,7 @@ static struct spi_driver goodix_spi_driver = {
> >         .driver = {
> >                 .name = "goodix-spi-hid",
> >                 .acpi_match_table = ACPI_PTR(goodix_spi_acpi_match),
> > +               .of_match_table = of_match_ptr(goodix_spi_of_match),
> 
> I can never quite remember what the current preference is in regards
> to "OF" tables (whether to use #ifdef like you've done or mark them
> `__maybe_unused`), so maybe someone will request you change it. ...but
> IMO what you have is fine and looks to be properly guarded with
> of_match_ptr(). As far as I'm concerned, this patch looks OK.
> 
> Oh, I guess the one "nit" is that I would have put "spi" in the
> subject, making it "HID: hid-goodix-spi: Add OF supports". It might be
> worth sending a v5 for that (after waiting a day or two) unless a
> maintainer tells you not to.
>

Ack,

> In any case:
> 
> Reviewed-by: Douglas Anderson <dianders@...omium.org>

Thanks,
Charles

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ