i2c: synquacer: fix enumeration of slave devices [Linux 5.1]

i2c: synquacer: fix enumeration of slave devices [Linux 5.1]

This Linux kernel change "i2c: synquacer: fix enumeration of slave devices" is included in the Linux 5.1 release. This change is authored by Ard Biesheuvel <ard.biesheuvel [at] linaro.org> on Tue Apr 30 11:47:34 2019 +0200. The commit for this change in Linux stable tree is 95e0cf3 (patch).

i2c: synquacer: fix enumeration of slave devices

The I2C host driver for SynQuacer fails to populate the of_node and
ACPI companion fields of the struct i2c_adapter it instantiates,
resulting in enumeration of the subordinate I2C bus to fail.

Fixes: 0d676a6c4390 ("i2c: add support for Socionext SynQuacer I2C controller")
Cc: <[email protected]> # v4.19+
Signed-off-by: Ard Biesheuvel <[email protected]>
Signed-off-by: Wolfram Sang <[email protected]>

There are 2 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 drivers/i2c/busses/i2c-synquacer.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/i2c/busses/i2c-synquacer.c b/drivers/i2c/busses/i2c-synquacer.c
index d18b094..f14d4b3 100644
--- a/drivers/i2c/busses/i2c-synquacer.c
+++ b/drivers/i2c/busses/i2c-synquacer.c
@@ -597,6 +597,8 @@ static int synquacer_i2c_probe(struct platform_device *pdev)
    i2c->adapter = synquacer_i2c_ops;
    i2c_set_adapdata(&i2c->adapter, i2c);
    i2c->adapter.dev.parent = &pdev->dev;
+   i2c->adapter.dev.of_node = pdev->dev.of_node;
+   ACPI_COMPANION_SET(&i2c->adapter.dev, ACPI_COMPANION(&pdev->dev));
    i2c->adapter.nr = pdev->id;
    init_completion(&i2c->completion);

Leave a Reply

Your email address will not be published. Required fields are marked *