Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp388794ybl; Thu, 12 Dec 2019 20:43:57 -0800 (PST) X-Google-Smtp-Source: APXvYqwTr09ayk/OkQZHsmXNUoQ6JWU8clSy41HBXOm9dtHNwp9f/b34Yiob3v8UW5uTwvdCvDHH X-Received: by 2002:a05:6830:50:: with SMTP id d16mr13204978otp.155.1576212237040; Thu, 12 Dec 2019 20:43:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576212237; cv=none; d=google.com; s=arc-20160816; b=n2ONaTJXMVK81wsOthIfp8cx3+bg8fBCuxukQtFrpKGiuNwqVB1E4C6Xd0HeWwUIFY rzS1u1qo5m7B0Ky2pVByst0lu7VSVIM7oZvdcg5nV6pqGykU+cxp12hOd6eWqptjSYLU ZFJs7FZ9o1eY6cu/XzqSx1PXtYOiifKjwJc41zRcX6/jT/X7QH+gmG7Ty/h7ZgKfnVxR P5AQjj/S4MtpqbpCw1cgs/RKVseJPo6x7Pmnp7aI8UO72/KwrAnwSv+aHWu4MZvpdA9l 0lD279qUrncbBHftDs48mD4DsbSDHy4N075hvz4uuC/9v+Nhlaa/t1KQ7ZposRL8UwO5 Li0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=CxeVqN7WWZohGfBayl/KWuS+nYYVkIE8W26755ehKCA=; b=tS8bA/VWhsAR4a2/hLcU8rz1pPikX2Norr0nY6WcJf0ofUwZJfoagFSLFXCXJ5iKqm 0RT1M7MFm3NzlTNfhUcamnnVjsq2FzgpkBabHVX8Myn/xG6Ed6HlbMZzD9eGW2wALW3W TyBoYcgS+Qt9BHrBWBvk6Yh93YUMCdiLckpfHKRlVVwV3gxKF3BzZQ7BjOgUkISScivc EKc2ndDHVDWZ45uXNF7hfviQ3c+WahDUuBF/taV8TXZKQHBbWxdVNAgvhqEMjcv1w7Kn /Pg7an+Hmm6cDWRHnU1n8QoU+E13KuO8tsvWN56kRhaORjqCNjNoq61qP13paqDY6scG 4R8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@verdurent-com.20150623.gappssmtp.com header.s=20150623 header.b=Xd8DQt15; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v202si4099450oie.79.2019.12.12.20.43.10; Thu, 12 Dec 2019 20:43:57 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@verdurent-com.20150623.gappssmtp.com header.s=20150623 header.b=Xd8DQt15; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731900AbfLMEkC (ORCPT + 99 others); Thu, 12 Dec 2019 23:40:02 -0500 Received: from mail-vs1-f67.google.com ([209.85.217.67]:33880 "EHLO mail-vs1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731720AbfLMEkB (ORCPT ); Thu, 12 Dec 2019 23:40:01 -0500 Received: by mail-vs1-f67.google.com with SMTP id g15so714501vsf.1 for ; Thu, 12 Dec 2019 20:40:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=verdurent-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=CxeVqN7WWZohGfBayl/KWuS+nYYVkIE8W26755ehKCA=; b=Xd8DQt15TEBmxWpqEeFCaZoe21s55+mSfnHvGFbeg9bLiJ4j2h7SwH/XTEnp71SZ73 ZycLWokcoyu6sa1FpY+Cp/3bpEv6zhBoxym148EovHuBbxuNKgMQ3HWQ4/pGAW/uLys1 EjlFXNvx268C+i6hj8eUxzu6EhiaZpm2FXPGeQisLNs1x9n9fA+S4tIy/K9NHr8HqDul i+xP23j6KawDG6n3PHOzmU5XCvlvLmK+bI73YmqPxIqiqX2mHYKcgr5vWMpd4/8+P5kD QBDviVVz2Bm3DBv/4SWXC7IX0nsU58spJx/zGps/ni5b++qgOVZ8QyJDKph5jCvl/hXk VqiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=CxeVqN7WWZohGfBayl/KWuS+nYYVkIE8W26755ehKCA=; b=OSvZm5dHeSgBcdmmlp8Dl/C0L6FmQjfWao2Jm3o3nVcVhdjn+NSHiJGN54P0GCUtAC Qx+xGrjTrDNZRdYuVa+kYlgk1OB0m/oUFsR94PU+0cQYfK7fyTS/ZLsniBjC9hSX6PiK qnV5G+rE4BRkl5UO7A75dUZLWnhyn61Be/Zh619wMjdOdIzOQeV6UhcC7nXy+7TGRfbl O8XzrwCDCqMTxnu1rYf4lBO9/4ptDwZ5+V9H7pIdnr63f/t7G7PDr8BAsprbx4KgbTyo sUd64asV9ZqWqDcyNc0++t/t8kxKZgdBHsLJP2ZruDUN/YitILCvObFc6iE5wL18UTEA tztw== X-Gm-Message-State: APjAAAWbUUUTuM+T9MuAfhY9+KYodUmg6s2aNqG/G9fh3AYr++3rTXJ4 TtHv8f8NKcefcVx/v3Qt7SxfU+uKehrXw6Ogzbwgbg== X-Received: by 2002:a67:fb41:: with SMTP id e1mr9415848vsr.159.1576212000836; Thu, 12 Dec 2019 20:40:00 -0800 (PST) MIME-Version: 1.0 References: <20191212061702.BFE2D6E85603@corona.crabdance.com> <20191212232859.E09FC6E85603@corona.crabdance.com> In-Reply-To: From: Amit Kucheria Date: Fri, 13 Dec 2019 10:09:49 +0530 Message-ID: Subject: Re: [RESEND PATCH] thermal: rockchip: enable hwmon To: schaecsn@gmx.net, jdelvare@suse.com, linux@roeck-us.net Cc: Heiko Stuebner , Linux PM list , Daniel Lezcano , LKML , Eduardo Valentin , linux-rockchip@lists.infradead.org, Zhang Rui , lakml Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix Guenter's email. On Fri, Dec 13, 2019 at 10:08 AM Amit Kucheria wrote: > > Hi Stefan, > > On Fri, Dec 13, 2019 at 4:59 AM Stefan Schaeckeler wrote: > > > > Hello Amit, > > > > > On Thu, Dec 12, 2019 at 11:47 AM Stefan Schaeckeler wrote: > > > > > > > > By default, of-based thermal drivers do not enable hwmon. > > > > Explicitly enable hwmon for both, the soc and gpu temperature > > > > sensor. > > > > > > Is there any reason you need to expose this in hwmon? > > > > Why hwmon: > > > > The soc embedds temperature sensors and hwmon is the standard way to expose > > sensors. > > Let me rephrase - is there something in the hwmon subsystem that is > needed that isn't provided by the thermal subsystem inside > /sys/class/thermal? > > > Sensors exposed by hwmon are automagically found by userland clients. Users > > want to run sensors(1) and expect them to show up. > > > > That is a good point. In which case, I wonder if we should just fix > this in of-thermal.c instead of requiring individual drivers to do > write boilerplate code. I'm thinking of a flag that the driver could > set to enable the thermal_hwmon interface for of-thermal drivers. > > > Why in rockchip_thermal.c: > > > > drivers/thermal/ provides a high-level hwmon api in thermal_hwmon.[hc] which is > > used by at least these thermal drivers: rcar_gen3_thermal.c, rcar_thermal.c, > > st/stm_thermal.c, and broadcom/bcm2835_thermal.c. I want to hook up > > rockchip_thermal.c exactly the same way. > > > > Apparently, other architectures hook up the cpu temperature sensors to hwmon > > elsewhere. Most seem to do this in hwmon/, e.g. hwmon/coretemp.c. These drivers > > are written from scratch. Utilizing thermal_hwmon.[ch] for chips which have > > already drivers in drivers/thermal/ seems to be more elegant. > > > > Stefan