Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp579998ybt; Wed, 24 Jun 2020 06:26:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyp3CP70hjzUmxrOiuFxfHVHZytV/VzHzZlghn91mWuQrfsi5IIzXy7k0zYPYuwT3iE151z X-Received: by 2002:a50:9306:: with SMTP id m6mr26905596eda.216.1593005190963; Wed, 24 Jun 2020 06:26:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593005190; cv=none; d=google.com; s=arc-20160816; b=hzhHOj/oGWqPsP7pW41l3Coj1/za/899nkzximVm3r76pMKw+AhOn4nV0PoZrDD/qp JBZxgFgSZG1YjjEEM918cbrbq3doi5om6ZCCVpWPgjJr8loE55cFJSBkNz0wDBcbZeCG QfSUskcsI3a2wzmT/mBWvnP5vl/fPta35N8qINNqIdETsOla/AHPvq8nJ3256+RagYrc 09rWpGOyAdC5YKn/e7HlipMii4JImONy7mO32w9RMoSpTqHWFl8B/dPskHrem+zXhWX4 qZBlgFWsoPhH5jQmFkuEU0sbVw6JLDiTVSWk//XChqpHjUFwzr4mlL34t59CBlLbqNul J3+A== 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=VPq7Z41hnBNW40h+zMdTEAor7vd6FW1wI0PW45EL8Sw=; b=DvdQ33zOlj/tQBQE7Li7cDFEDoUtv/HF3l8hf9FL2BUE+I7umsUzNIGgSVEy1GTHos nfJ2IW8vQEy9ZhuPqdHLqF5pvY1bXv186YO798wT+CQoDcBtZ6UVKAJ3oaMqMs54P7bM 4QQYQy5qI/bWXT85nWtJ/xSgaYnJouF8qckhZzvk3yME+vyE5Lr9dGl9L/QKScN8ZHk4 2fBUFbzNNb8ptbSg9MzvKXrNydOaWZJInI1Yrvg0dxx0PcfXhYoNhVqINv/D49yATH9C cDEz+ebrEYBfr73JePLyP9iphxEtHoR5u2XTOcI9Iy5yQCuevthqv3RxAKkmg0Zh7Xzh N6yA== 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 c11si6971694edr.502.2020.06.24.06.26.06; Wed, 24 Jun 2020 06:26:30 -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 S2389513AbgFXNZd (ORCPT + 99 others); Wed, 24 Jun 2020 09:25:33 -0400 Received: from mga02.intel.com ([134.134.136.20]:41090 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387687AbgFXNZb (ORCPT ); Wed, 24 Jun 2020 09:25:31 -0400 IronPort-SDR: FgLiXFSXoG6YiE7NZ8SDQFuL9bTJzMeO9T6CpGYGH90mR7ShyCvihAlcptF2sn7b8VMgZlmyfC 6PusuWA8OIOw== X-IronPort-AV: E=McAfee;i="6000,8403,9661"; a="132897614" X-IronPort-AV: E=Sophos;i="5.75,275,1589266800"; d="scan'208";a="132897614" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Jun 2020 06:25:30 -0700 IronPort-SDR: 2nTST7gedUufpuTnjYDFePSxCKCUtUJl17C99hVsLDtUgrmX1bRtTUUzGd43nz1RKWEORxivRo 1aaHvoNY5LrA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,275,1589266800"; d="scan'208";a="452634485" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by orsmga005.jf.intel.com with ESMTP; 24 Jun 2020 06:25:28 -0700 Received: from andy by smile with local (Exim 4.94) (envelope-from ) id 1jo5MF-00FaVg-SZ; Wed, 24 Jun 2020 16:22:31 +0300 Date: Wed, 24 Jun 2020 16:22:31 +0300 From: Andy Shevchenko To: Ricardo Ribalda Cc: Jarkko Nikula , Mika Westerberg , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Wolfram Sang Subject: Re: [PATCH v2] i2c: designware: platdrv: Set class based on dmi Message-ID: <20200624132231.GF3703480@smile.fi.intel.com> References: <20200624112530.852254-1-ribalda@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200624112530.852254-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 01:25:30PM +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. I think it misses Fixes tag. And... ... > +static bool dw_i2c_hwmon_bus(void) > +{ > + const char *product_name = dmi_get_system_info(DMI_PRODUCT_NAME); Split this, so the assignment will be attached to the check below. > + if (!product_name) > + return false; > + > + if (strstr(product_name, "QT5222")) > + return true; I don't like this part at all. Why do you need strstr()? Can you provide in the commit message relevant fields from dmidecode (or sysfs)? > + return false; > +} In general it's not how we do DMI based quirks, rather using table and call match function. In that case you can take class as a driver_data. Much more flexible in case we need to extend. ... > - adap->class = I2C_CLASS_DEPRECATED; > + adap->class = dw_i2c_hwmon_bus() ? I2C_CLASS_HWMON : I2C_CLASS_DEPRECATED; ...since the patch has it unconditionally, I would go unconditionally. But if Wolfram insists, then see above. -- With Best Regards, Andy Shevchenko