Re: [PATCH 01/13] media: i2c: Add ACPI support to ov8865

Daniel Scally
2021-07-22T23:09:14Z

On 22/07/2021 22:58, Andy Shevchenko wrote:
>
>
> On Thursday, July 22, 2021, Daniel Scally <djrscally@gmail.com
> <mailto:djrscally@gmail.com>> wrote:
>
> The ov8865 sensor is sometimes found on x86 platforms enumerated
> via ACPI.
> Add an ACPI match table to the driver so that it's probed on those
> platforms.
>
> Signed-off-by: Daniel Scally <djrscally@gmail.com
> <mailto:djrscally@gmail.com>>
> ---
>  drivers/media/i2c/ov8865.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
>
> diff --git a/drivers/media/i2c/ov8865.c b/drivers/media/i2c/ov8865.c
> index ce50f3ea87b8..fe60cda3dea7 100644
> --- a/drivers/media/i2c/ov8865.c
> +++ b/drivers/media/i2c/ov8865.c
> @@ -5,6 +5,7 @@
>   * Author: Paul Kocialkowski <paul.kocialkowski@bootlin.com
> <mailto:paul.kocialkowski@bootlin.com>>
>   */
>
> +#include <linux/acpi.h>
>
>
>
> No user of it. Probably you meant mod_devicetable.h

Huh, I guess I did yeah...for some reason I thought acpi_device_id was
in acpi.h. Thanks very much; I'll fix it.

>
>
>  #include <linux/clk.h>
>  #include <linux/delay.h>
>  #include <linux/device.h>
> @@ -2946,6 +2947,12 @@ static const struct dev_pm_ops
> ov8865_pm_ops = {
>         SET_RUNTIME_PM_OPS(ov8865_suspend, ov8865_resume, NULL)
>  };
>
> +static const struct acpi_device_id ov8865_acpi_match[] = {
> +       {"INT347A"},
> +       {},
> +};
> +MODULE_DEVICE_TABLE(acpi, ov8865_acpi_match);
> +
>  static const struct of_device_id ov8865_of_match[] = {
>         { .compatible = "ovti,ov8865" },
>         { }
> @@ -2956,6 +2963,7 @@ static struct i2c_driver ov8865_driver = {
>         .driver = {
>                 .name = "ov8865",
>                 .of_match_table = ov8865_of_match,
> +               .acpi_match_table = ov8865_acpi_match,
>                 .pm = &ov8865_pm_ops,
>         },
>         .probe_new = ov8865_probe,
> --
> 2.25.1
>
>
>
> --
> With Best Regards,
> Andy Shevchenko
>
>