From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 46358C433E0 for ; Wed, 24 Jun 2020 10:46:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1FA4A20781 for ; Wed, 24 Jun 2020 10:46:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388516AbgFXKq4 (ORCPT ); Wed, 24 Jun 2020 06:46:56 -0400 Received: from mga09.intel.com ([134.134.136.24]:1078 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388421AbgFXKq4 (ORCPT ); Wed, 24 Jun 2020 06:46:56 -0400 IronPort-SDR: v+/mzFRInUJW9/XhRGVNxWEKBbt16zrXQFcgUk+rJ5rtnfZU/g+qfiO6zmprYB020voZpQzLbV Sf0w3x5jprAQ== X-IronPort-AV: E=McAfee;i="6000,8403,9661"; a="145923314" X-IronPort-AV: E=Sophos;i="5.75,275,1589266800"; d="scan'208";a="145923314" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Jun 2020 03:46:55 -0700 IronPort-SDR: ZchnAPrf6QB9CaYav3uX/mqqkYIaY+CaxF1hDTEi3IPLz1kVejZUDK1TXTF8byLjsgijRfhVLK 8LLPtJm1J08Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,275,1589266800"; d="scan'208";a="423325885" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by orsmga004.jf.intel.com with ESMTP; 24 Jun 2020 03:46:54 -0700 Received: from andy by smile with local (Exim 4.94) (envelope-from ) id 1jo2vg-00FZ4a-0N; Wed, 24 Jun 2020 13:46:56 +0300 Date: Wed, 24 Jun 2020 13:46:55 +0300 From: Andy Shevchenko To: Ricardo Ribalda Cc: Jarkko Nikula , Mika Westerberg , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] i2c: designware: platdrv: Set class based on dmi Message-ID: <20200624104655.GD3703480@smile.fi.intel.com> References: <20200624091239.802218-1-ribalda@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200624091239.802218-1-ribalda@kernel.org> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Sender: linux-i2c-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.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