i2c: tegra: Set ACPI node as primary fwnode
authorAkhil R <akhilrajeev@nvidia.com>
Thu, 17 Nov 2022 10:04:15 +0000 (15:34 +0530)
committerWolfram Sang <wsa@kernel.org>
Thu, 1 Dec 2022 23:02:13 +0000 (00:02 +0100)
Set ACPI node as the primary fwnode of I2C adapter to allow
enumeration of child devices from the ACPI table

Signed-off-by: Zubair Waheed <zwaheed@nvidia.com>
Signed-off-by: Akhil R <akhilrajeev@nvidia.com>
Reviewed-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
drivers/i2c/busses/i2c-tegra.c

index 954022c04cc422dbc03569a9770adc7bee054818..69c9ae161bbecd923fe61c5187230c2267ddf835 100644 (file)
@@ -1826,6 +1826,7 @@ static int tegra_i2c_probe(struct platform_device *pdev)
        i2c_dev->adapter.class = I2C_CLASS_DEPRECATED;
        i2c_dev->adapter.algo = &tegra_i2c_algo;
        i2c_dev->adapter.nr = pdev->id;
+       ACPI_COMPANION_SET(&i2c_dev->adapter.dev, ACPI_COMPANION(&pdev->dev));
 
        if (i2c_dev->hw->supports_bus_clear)
                i2c_dev->adapter.bus_recovery_info = &tegra_i2c_recovery_info;