public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Ricardo Ribalda <ribalda@kernel.org>
Cc: Jarkko Nikula <jarkko.nikula@linux.intel.com>,
	Mika Westerberg <mika.westerberg@linux.intel.com>,
	linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org,
	Wolfram Sang <wsa@kernel.org>
Subject: Re: [PATCH v4] i2c: designware: platdrv: Set class based on DMI
Date: Thu, 2 Jul 2020 13:22:37 +0300	[thread overview]
Message-ID: <20200702102237.GS3703480@smile.fi.intel.com> (raw)
In-Reply-To: <20200702101028.2088666-1-ribalda@kernel.org>

On Thu, Jul 02, 2020 at 12:10:28PM +0200, Ricardo Ribalda wrote:
> Current AMD's zen-based APUs use this core for some of its i2c-buses.
> 
> With this patch we re-enable autodetection of hwmon-alike devices, so
> lm-sensors will be able to work automatically.
> 
> It does not affect the boot-time of embedded devices, as the class is
> set based on the DMI information.

Thanks for an update, my comments below. Either Wolfram (if he is okay with
that), or you can address them.

After addressing,
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

> DMI is probed only on Qtechnology QT5222 Industrial Camera Platform

Still missed period at the end.

> DocLink: https://qtec.com/camera-technology-camera-platforms/
> Fixes: 3eddad96c439 ("i2c: designware: reverts "i2c: designware: Add support for AMD I2C controller"")
> Signed-off-by: Ricardo Ribalda <ribalda@kernel.org>
> ---
> v2: Comments by Andy Shevchenko <andriy.shevchenko@linux.intel.com>
>   - dmi -> DMI
>   - Doclink
>   - CodeStyle
>   (I do not know what you meant by redundant in the dmi match list ...)
> 
> 
>  drivers/i2c/busses/i2c-designware-platdrv.c | 16 +++++++++++++++-
>  1 file changed, 15 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c
> index c2efaaaac252..630e28ef2412 100644
> --- a/drivers/i2c/busses/i2c-designware-platdrv.c
> +++ b/drivers/i2c/busses/i2c-designware-platdrv.c
> @@ -12,6 +12,7 @@
>  #include <linux/clk-provider.h>
>  #include <linux/clk.h>
>  #include <linux/delay.h>
> +#include <linux/dmi.h>
>  #include <linux/err.h>
>  #include <linux/errno.h>
>  #include <linux/i2c.h>
> @@ -191,6 +192,18 @@ static int dw_i2c_plat_request_regs(struct dw_i2c_dev *dev)
>  	return ret;
>  }
>  
> +static const struct dmi_system_id dw_i2c_hwmon_class_dmi[] = {
> +	{
> +		.ident = "Qtechnology QT5222",
> +		.matches = {
> +			DMI_MATCH(DMI_SYS_VENDOR, "Qtechnology"),
> +			DMI_MATCH(DMI_PRODUCT_NAME, "QT5222"),
> +		},
> +	},

> +

Still not needed blank line.

> +	{ } /* terminate list */
> +};
> +
>  static int dw_i2c_plat_probe(struct platform_device *pdev)
>  {
>  	struct dw_i2c_platform_data *pdata = dev_get_platdata(&pdev->dev);
> @@ -267,7 +280,8 @@ static int dw_i2c_plat_probe(struct platform_device *pdev)
>  
>  	adap = &dev->adapter;
>  	adap->owner = THIS_MODULE;
> -	adap->class = I2C_CLASS_DEPRECATED;
> +	adap->class = dmi_check_system(dw_i2c_hwmon_class_dmi) ?
> +					I2C_CLASS_HWMON : I2C_CLASS_DEPRECATED;
>  	ACPI_COMPANION_SET(&adap->dev, ACPI_COMPANION(&pdev->dev));
>  	adap->dev.of_node = pdev->dev.of_node;
>  	adap->nr = -1;
> -- 
> 2.27.0
> 

-- 
With Best Regards,
Andy Shevchenko



      reply	other threads:[~2020-07-02 10:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-02 10:10 [PATCH v4] i2c: designware: platdrv: Set class based on DMI Ricardo Ribalda
2020-07-02 10:22 ` Andy Shevchenko [this message]

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=20200702102237.GS3703480@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=jarkko.nikula@linux.intel.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.com \
    --cc=ribalda@kernel.org \
    --cc=wsa@kernel.org \
    /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