public inbox for linux-i2c@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
Subject: Re: [PATCH] i2c: designware: platdrv: Set class based on dmi
Date: Wed, 24 Jun 2020 13:46:55 +0300	[thread overview]
Message-ID: <20200624104655.GD3703480@smile.fi.intel.com> (raw)
In-Reply-To: <20200624091239.802218-1-ribalda@kernel.org>

On Wed, Jun 24, 2020 at 11:12:39AM +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.

Hmm... Do we really need to have DMI? I mean wouldn't be safe just always
provide this to be compatible with HWMON class?

...

> +static bool dw_i2c_hwmon_bus(void)
> +{
> +	if (strstr(dmi_get_system_info(DMI_PRODUCT_NAME), "QT5222"))
> +		return true;
> +	return false;
> +}

I don't like this. Perhaps for now you may simple use dmi_get_system_info()
directly below.

...

> +	adap->class = dw_i2c_hwmon_bus() ? I2C_CLASS_HWMON
> +					 : I2C_CLASS_DEPRECATED;

It's one line.

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2020-06-24 10:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-24  9:12 [PATCH] i2c: designware: platdrv: Set class based on dmi Ricardo Ribalda
2020-06-24 10:46 ` Andy Shevchenko [this message]
2020-06-24 11:23   ` Wolfram Sang
2020-06-24 11:31   ` Ricardo Ribalda Delgado
2020-06-24 13:18     ` Andy Shevchenko
2020-06-24 10:53 ` kernel test robot

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=20200624104655.GD3703480@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 \
    /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