Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp469366ybt; Wed, 24 Jun 2020 03:50:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxsbQnQrarhrcYo7cChZy385bgiMHLm20vPRJ1dNF68Ay3bpBI64g5TfhjQ4phJLKSaPODA X-Received: by 2002:a05:6402:cbc:: with SMTP id cn28mr26803892edb.220.1592995821635; Wed, 24 Jun 2020 03:50:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592995821; cv=none; d=google.com; s=arc-20160816; b=vT+TaEi3RWNSBFXtFbm1Qv1xD5phFHkw1k/lKkQLBW1yPZ+vDdsKrziZhefEwWWPyn 1BCZHA0AQp+2ESpccIcil67Fg7OquPp86Z/ZMcrnQY4uoWA4GYEdkEuVaFXBwPzRk4F7 iOz++mZM46Y1pivVq7Xnm6+X8iDfubYNGAi+SXNPNDE3PEm0LhwXcmgYYmGFzm4Cg+tn Kw9RLHMB6XsoHVxsh5eNg6kjg1UJYPZV8kuLy8FZcS7T7fT7ZT2yHulkqVTbyO+4XO9l 0hM5a8rMvbCh/fo3I9LyeIsPeN+rKl/UwhXYmfb/WCNB/9oCVN93G6Cp6xbW/l71IGbd J8fQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:ironport-sdr:ironport-sdr; bh=7drLPfaLQS+v/YoEsF3yDEdwTh3TpqgX7nrF944Ne8E=; b=uFrv+tjBug0/bgIJ6dEK5eQWrWtSAUYw/vR4wjyc6ZxLfy8oG9IU6woE8C/zxSRM4b GGsmRStq5aWoG1rj4/2GzHL+CNi+qCjUqQC+qjIPQ+KnFhHHXfG7xQvU9F1a2D9VObvC l4bm6LRNy42td17MK8L8sVMDaUwf4Tn4IuvhS00v48sqHuRmt3xmSfWHsy9QhjDq7oOT 09IMqgHiF4S5LdRQq1a1knaW7FwAc7qovOnGmxl7s7SEitQGT+FKJ5Ylb6EdYLUIytrb D+NSamkoFPKcvkDpjlFZ0YbqLIHi9nU1UM08OB8jK+LdVtQitDg8oR2b0uoDSUORk+lo LkAA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u17si750505edd.139.2020.06.24.03.49.58; Wed, 24 Jun 2020 03:50:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390533AbgFXKq4 (ORCPT + 99 others); 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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