From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Binbin Zhou <zhoubinbin@loongson.cn>
Cc: Wolfram Sang <wsa@kernel.org>,
Wolfram Sang <wsa+renesas@sang-engineering.com>,
Mika Westerberg <mika.westerberg@linux.intel.com>,
linux-i2c@vger.kernel.org, loongarch@lists.linux.dev,
linux-acpi@vger.kernel.org, WANG Xuerui <kernel@xen0n.name>,
Jianmin Lv <lvjianmin@loongson.cn>,
Huacai Chen <chenhuacai@loongson.cn>
Subject: Re: [PATCH V2 1/4] i2c: gpio: Add support on ACPI-based system
Date: Mon, 26 Sep 2022 18:39:21 +0300 [thread overview]
Message-ID: <YzHHqXUdLR5W/sw+@smile.fi.intel.com> (raw)
In-Reply-To: <f5df899e2218c0cd8cc8782b4a8f157ebb9726bc.1664193316.git.zhoubinbin@loongson.cn>
On Mon, Sep 26, 2022 at 09:00:04PM +0800, Binbin Zhou wrote:
> Add support for the ACPI-based device registration so that the driver
> can be also enabled through ACPI table.
>
> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Who is this and why this SoB in the chain?
> Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
...
> #include <linux/init.h>
> #include <linux/interrupt.h>
> #include <linux/module.h>
> +#include <linux/acpi.h>
> #include <linux/of.h>
> #include <linux/platform_data/i2c-gpio.h>
> #include <linux/platform_device.h>
Seems you misinterpret ordering.
Besides that I don't see the needs of acpi.h. The header missed the
mod_devicetable.h (even without this patch), and your code needs property.h.
...
> +static void acpi_i2c_gpio_get_props(struct device *dev,
> + struct i2c_gpio_platform_data *pdata)
> +{
> + u32 reg;
> +
> + device_property_read_u32(dev, "delay-us", &pdata->udelay);
> +
> + if (!device_property_read_u32(dev, "timeout-ms", ®))
> + pdata->timeout = msecs_to_jiffies(reg);
> +
> + pdata->sda_is_open_drain =
> + device_property_read_bool(dev, "sda-open-drain");
> + pdata->scl_is_open_drain =
> + device_property_read_bool(dev, "scl-open-drain");
> + pdata->scl_is_output_only =
> + device_property_read_bool(dev, "scl-output-only");
> +}
+1 to Mika's objection. Instead, make the common bindings and convert
the driver from OF to be agnostic.
...
> MODULE_DEVICE_TABLE(of, i2c_gpio_dt_ids);
> #endif
>
> +#ifdef CONFIG_ACPI
Please, drop these ifdefferies (including OF one), it's more harmful
than useful.
> +#endif
...
> .of_match_table = of_match_ptr(i2c_gpio_dt_ids),
> + .acpi_match_table = ACPI_PTR(i2c_gpio_acpi_match),
No ACPI_PTR(), and accordingly no of_match_ptr(). See above.
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2022-09-26 16:47 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-26 13:00 [PATCH V2 0/4] i2c: ls2x: Add support for the Loongson-2K/LS7A I2C Binbin Zhou
2022-09-26 13:00 ` [PATCH V2 1/4] i2c: gpio: Add support on ACPI-based system Binbin Zhou
2022-09-26 14:59 ` Mika Westerberg
2022-09-27 7:49 ` Arnd Bergmann
2022-09-26 15:39 ` Andy Shevchenko [this message]
2022-09-26 13:00 ` [PATCH V2 2/4] dt-bindings: i2c: add bindings for Loongson LS2X I2C Binbin Zhou
2022-09-26 13:00 ` [PATCH V2 3/4] i2c: Add driver for Loongson-2K/LS7A I2C controller Binbin Zhou
2022-09-26 16:06 ` Andy Shevchenko
2022-09-26 13:00 ` [PATCH V2 4/4] LoongArch: Enable LS2X I2C in loongson3_defconfig Binbin Zhou
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YzHHqXUdLR5W/sw+@smile.fi.intel.com \
--to=andriy.shevchenko@intel.com \
--cc=chenhuacai@loongson.cn \
--cc=kernel@xen0n.name \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-i2c@vger.kernel.org \
--cc=loongarch@lists.linux.dev \
--cc=lvjianmin@loongson.cn \
--cc=mika.westerberg@linux.intel.com \
--cc=wsa+renesas@sang-engineering.com \
--cc=wsa@kernel.org \
--cc=zhoubinbin@loongson.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox