Thread (9 messages) 9 messages, 7 authors, 2019-09-03

Re: [PATCH] ACPI: support for NXP i2c controller

From: Andy Shevchenko <hidden>
Date: 2019-09-02 21:16:26
Also in: linux-acpi, linux-i2c, lkml

On Mon, Sep 2, 2019 at 11:58 PM Rafael J. Wysocki [off-list ref] wrote:
On Thu, Jul 11, 2019 at 12:35 PM Chuanhua Han [off-list ref] wrote:
quoted
Enable NXP i2c controller to boot with ACPI

Signed-off-by: Meenakshi Aggarwal <redacted>
Signed-off-by: Udit Kumar <redacted>
Signed-off-by: Chuanhua Han <redacted>
Wolfram, any objections to this from the i2c side?
May I propose amendment(s)?
quoted
@@ -44,6 +44,7 @@
 #include <linux/pm_runtime.h>
 #include <linux/sched.h>
 #include <linux/slab.h>
quoted
+#include <linux/acpi.h>
If it's kept in order, better to go with it. (Yes, it is as I have checked)
However, property.h should be included instead, see below.
quoted
        const struct of_device_id *of_id = of_match_device(i2c_imx_dt_ids,
                                                           &pdev->dev);
+       const struct acpi_device_id *acpi_id =
+                       acpi_match_device(i2c_imx_acpi_ids,
+                                         &pdev->dev);
quoted
        if (of_id)
                i2c_imx->hwdata = of_id->data;
+       else if (acpi_id)
+               i2c_imx->hwdata = (struct imx_i2c_hwdata *)
+                               acpi_id->driver_data;

The above altogher may be replaced with

const struct imx_i2c_hwdata *match;
...
match = device_get_match_data(&pdev->dev);
if (match)
 i2c_imx->hwdata = match;
else
...
quoted
+               .acpi_match_table = ACPI_PTR(i2c_imx_acpi_ids),
Since there is no #ifdef guard no need to use ACPI_PTR().

-- 
With Best Regards,
Andy Shevchenko

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help