diff mbox series

[RFC,1/6] i2c: acpi: set slave mode flag

Message ID 20230525152203.32190-2-Jonathan.Cameron@huawei.com
State Superseded
Headers show
Series i2c: Enabling use of aspeed-i2c with ACPI | expand

Commit Message

Jonathan Cameron May 25, 2023, 3:21 p.m. UTC
If the GenericSerialBusConnection includes the General Flag
for slave mode set it during parsing.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
 drivers/i2c/i2c-core-acpi.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Andy Shevchenko May 26, 2023, 7:43 p.m. UTC | #1
On Thu, May 25, 2023 at 6:22 PM Jonathan Cameron
<Jonathan.Cameron@huawei.com> wrote:
>
> If the GenericSerialBusConnection includes the General Flag
> for slave mode set it during parsing.

Since it's obvious that you are using the existing ACPI specification
bits, it's a nice patch!
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

Nevertheless the remark is that most likely this feature was never
tested on the ACPI implementations other than ACPICA (evidently by
you). Would it be interesting to know Microsoft's point of view on
this.

> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> ---
>  drivers/i2c/i2c-core-acpi.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/drivers/i2c/i2c-core-acpi.c b/drivers/i2c/i2c-core-acpi.c
> index d6037a328669..7dda5eab9645 100644
> --- a/drivers/i2c/i2c-core-acpi.c
> +++ b/drivers/i2c/i2c-core-acpi.c
> @@ -125,6 +125,9 @@ static int i2c_acpi_fill_info(struct acpi_resource *ares, void *data)
>         if (sb->access_mode == ACPI_I2C_10BIT_MODE)
>                 info->flags |= I2C_CLIENT_TEN;
>
> +       if (sb->slave_mode)
> +               info->flags |= I2C_CLIENT_SLAVE;
> +
>         return 1;
>  }
>
> --
> 2.39.2
>
diff mbox series

Patch

diff --git a/drivers/i2c/i2c-core-acpi.c b/drivers/i2c/i2c-core-acpi.c
index d6037a328669..7dda5eab9645 100644
--- a/drivers/i2c/i2c-core-acpi.c
+++ b/drivers/i2c/i2c-core-acpi.c
@@ -125,6 +125,9 @@  static int i2c_acpi_fill_info(struct acpi_resource *ares, void *data)
 	if (sb->access_mode == ACPI_I2C_10BIT_MODE)
 		info->flags |= I2C_CLIENT_TEN;
 
+	if (sb->slave_mode)
+		info->flags |= I2C_CLIENT_SLAVE;
+
 	return 1;
 }