diff mbox series

[v1,1/2] platform/x86: serial-multi-instantiate: Set fwnode for i2c

Message ID 20221124110718.3925934-2-sbinding@opensource.cirrus.com
State New
Headers show
Series Use ACPI_COMPANION macro to obtain acpi_device in cs35l41_hda | expand

Commit Message

Stefan Binding Nov. 24, 2022, 11:07 a.m. UTC
This allows the i2c driver to obtain the ACPI_COMPANION.

Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
---
 drivers/platform/x86/serial-multi-instantiate.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Hans de Goede Nov. 24, 2022, 11:51 a.m. UTC | #1
Hi,

On 11/24/22 12:35, Andy Shevchenko wrote:
> On Thu, Nov 24, 2022 at 1:07 PM Stefan Binding
> <sbinding@opensource.cirrus.com> wrote:
>>
>> This allows the i2c driver to obtain the ACPI_COMPANION.
> 
> As far as I get how it's done in the SPI case the real fix should lie
> among i2c_acpi_new_device_by_fwnode(), right?

Eventually maybe, but not for the initial change.

It is complicated, making this change has side-effects
and we want to limit those side-effects to only i2c-clients
instantiated from serial-multi-instantiate for now, see
my other reply to this patch.

I do believe that we eventually want to make this change,
to easily give drivers access to all sorts of info
(e.g. _DSM methods) from the matching ACPI fw-node,
but as I said it is complicated...

Regards,

Hans
diff mbox series

Patch

diff --git a/drivers/platform/x86/serial-multi-instantiate.c b/drivers/platform/x86/serial-multi-instantiate.c
index 5362f1a7b77c..15ef2f3c442e 100644
--- a/drivers/platform/x86/serial-multi-instantiate.c
+++ b/drivers/platform/x86/serial-multi-instantiate.c
@@ -194,6 +194,7 @@  static int smi_i2c_probe(struct platform_device *pdev, struct smi *smi,
 		strscpy(board_info.type, inst_array[i].type, I2C_NAME_SIZE);
 		snprintf(name, sizeof(name), "%s-%s.%d", dev_name(dev), inst_array[i].type, i);
 		board_info.dev_name = name;
+		board_info.fwnode = acpi_fwnode_handle(adev);
 
 		ret = smi_get_irq(pdev, adev, &inst_array[i]);
 		if (ret < 0)