mbox series

[v5,0/2] iio: sx9310: Support ACPI properties

Message ID 20210319165807.3639636-1-gwendal@chromium.org (mailing list archive)
Headers show
Series iio: sx9310: Support ACPI properties | expand

Message

Gwendal Grignou March 19, 2021, 4:58 p.m. UTC
Current sx9310 driver only support device tree properties.
To be able to use sensor on Intel platfrom, add support to read ACPI by
converting calls of_property_read_...() to device_property_read_...().

A bug was uncovered: if "semtech,combined-sensors" array was less than
4 entries, its content would be ignored, as of_property_read_u32_array
would return -EOVERFLOW.

Gwendal Grignou (2):
  iio: sx9310: Fix access to variable DT array
  iio: sx9310: Support ACPI properties

 drivers/iio/proximity/sx9310.c | 56 +++++++++++++++++++++-------------
 1 file changed, 34 insertions(+), 22 deletions(-)

Comments

Andy Shevchenko March 19, 2021, 5:46 p.m. UTC | #1
On Fri, Mar 19, 2021 at 6:58 PM Gwendal Grignou <gwendal@chromium.org> wrote:
>
> Current sx9310 driver only support device tree properties.
> To be able to use sensor on Intel platfrom, add support to read ACPI by

platform

It's not Intel specific, but any which is using ACPI.

Luckily it's a cover letter only :-)

> converting calls of_property_read_...() to device_property_read_...().
>
> A bug was uncovered: if "semtech,combined-sensors" array was less than
> 4 entries, its content would be ignored, as of_property_read_u32_array
> would return -EOVERFLOW.
>
> Gwendal Grignou (2):
>   iio: sx9310: Fix access to variable DT array
>   iio: sx9310: Support ACPI properties
>
>  drivers/iio/proximity/sx9310.c | 56 +++++++++++++++++++++-------------
>  1 file changed, 34 insertions(+), 22 deletions(-)
>
> --
> 2.31.0.291.g576ba9dcdaf-goog
>
Andy Shevchenko March 19, 2021, 5:49 p.m. UTC | #2
On Fri, Mar 19, 2021 at 6:58 PM Gwendal Grignou <gwendal@chromium.org> wrote:
>
> Current sx9310 driver only support device tree properties.
> To be able to use sensor on Intel platfrom, add support to read ACPI by
> converting calls of_property_read_...() to device_property_read_...().
>
> A bug was uncovered: if "semtech,combined-sensors" array was less than
> 4 entries, its content would be ignored, as of_property_read_u32_array
> would return -EOVERFLOW.

After addressing comments, feel free to add
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

> Gwendal Grignou (2):
>   iio: sx9310: Fix access to variable DT array
>   iio: sx9310: Support ACPI properties
>
>  drivers/iio/proximity/sx9310.c | 56 +++++++++++++++++++++-------------
>  1 file changed, 34 insertions(+), 22 deletions(-)
>
> --
> 2.31.0.291.g576ba9dcdaf-goog
>