Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp388793ybl; Thu, 12 Dec 2019 20:43:57 -0800 (PST) X-Google-Smtp-Source: APXvYqxmmNkyj9WKYE6mAfQ4QhxJYqj5sMfdq9eXj7vRGnXMorpeTneDeqptBsqfCMXkSx+OlXYh X-Received: by 2002:a9d:3f06:: with SMTP id m6mr12563260otc.268.1576212237043; 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=AXtWAEAvVQalN5GicvNchKCuWENO2XV7iQ/VHkWG2DsXg+MDx7wekUoiSBZaKaKQCw 5JH8oZI0vsSc0v+9/2K1Rjz6rFGmr1Rlw0iVwSbw4szTzNbyjnaA5iKrji9JdUiTzRcF xmA0yYpvwyaTyl47bNgNKkN67gsfNz7D614dfqQGOBXDcaV1CTHxLtThbCmSlLbaO+Rp U1ivIYT3dicjBgpS0lkIqI+KUsFQj5sUO2HzrPPaNH5mEOKUg9L+tJmuLsTqdhU+NTJk lEZGViKSUSpdiP6ZeD0AvtAQt3cpXeNZdNswbnG/Pj+rY6eJZD7wmqFNlh7RQf0BZPXr 1N6g== 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=End3OvBpc+ygNGyVRW83GCf3Bo6cZwj7YlQ/woj7ERg=; b=MfbZRSlRBqtHv5Wwnj5dCj8yGiF32r0GZydo9lcJkVgR5NS+sp1wlc4INu/7EcdJGJ Wjvmw+8AlY6IYJlHjYLQMu/XQ6xNAm1trUWETkkUl2XbitlflxlPnf7gSNTMDZpfupF2 h1o6JBSsLfh5ZlPFdCJw8R3Z0lzu2wcwu3/wbiW1Hj+jjfFBwIdb+gmEFNQuJuorVAy9 rZmhDHEz0rF3HNWXqAbXuKmrjyo3N1MJTphR/qfeXufa+C9Z9XNVcTAMxj3+JssZkikJ DC1fCxdBmTv0CjvlLGbfrsNfhgnTsiB1bhOYV4UiWKMNiaRLB5pq2Ir+zWBRxZgF8xnK k7kw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@verdurent-com.20150623.gappssmtp.com header.s=20150623 header.b=NgCbOcIf; 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 d62si4864718oib.144.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=NgCbOcIf; 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 S1731839AbfLMEio (ORCPT + 99 others); Thu, 12 Dec 2019 23:38:44 -0500 Received: from mail-ua1-f68.google.com ([209.85.222.68]:43197 "EHLO mail-ua1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731720AbfLMEio (ORCPT ); Thu, 12 Dec 2019 23:38:44 -0500 Received: by mail-ua1-f68.google.com with SMTP id o42so327177uad.10 for ; Thu, 12 Dec 2019 20:38:43 -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=End3OvBpc+ygNGyVRW83GCf3Bo6cZwj7YlQ/woj7ERg=; b=NgCbOcIfEosgK7rGmNe2T5lGSJOb8IDeMriMbHtrhCum7NjFGyqAhn7K8CbTiJyEdO 6+W75tOyldD9w2Tm//wqoeF2XB8XiWag8787WGwLJTpcluK6VO0s0jj1Fga83B/uPImD P/e4bBZVi6LadafPV00uBmigNWzl28j1FnWsB4PVjPnvdw9viP7bRInczKdFcH4HOTJZ 6TJWuiwcl+Q10A/NsbU+dV4K8W3Pl6KTGw8WMl+2YmUqvjz73KwgajaaSn1Ump9Lisgo aFtFhdFGUPvQWGfFhgNpGrRAOkZeOzf//86XUGfxshiyjyTXh5VIdTmSZG3dSNQ+KmBu 2Nog== 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=End3OvBpc+ygNGyVRW83GCf3Bo6cZwj7YlQ/woj7ERg=; b=uVfYgy55sNEZTurH9NSjQDjYZMuAwhh46ZfWjlCJON0HHOB06kECp7hL5IcTqODTyh CdYX4Cd6bmvCojlUOrOwgNQ/9E0YNgyPZmU9GBHIF/AwFZeEQ+FzIp5PsuqLhn07S3n/ FFzgInsSDnY15wK4PatESizks4o7T6lPD781hNvX6XddK3WMLIq6FNBKHnffbMkJcmVf YWTYzC/VvZhqUrEGCC0Ec+I/DZOfHpF9eaigmMdiWPU0mf2MxyipptCHWH+Ki8nZc9Qi anFiaCT4bvAAQrzUqLxN5pDyFNLySRAxH/YQR3dpn4ZMny0Y0wNsprHJXmmNZEVig3+o tzcA== X-Gm-Message-State: APjAAAVFidc8kNBcnoV/e/+INLgmCdFYvsW5aRUXktPQPMs0eXQ0fvjV 5aXecFA/tseKFZoSFdQqn8Gxuyyt9AzwfxW7wMfP6Q== X-Received: by 2002:ab0:30eb:: with SMTP id d11mr11521987uam.67.1576211922735; Thu, 12 Dec 2019 20:38:42 -0800 (PST) MIME-Version: 1.0 References: <20191212061702.BFE2D6E85603@corona.crabdance.com> <20191212232859.E09FC6E85603@corona.crabdance.com> In-Reply-To: <20191212232859.E09FC6E85603@corona.crabdance.com> From: Amit Kucheria Date: Fri, 13 Dec 2019 10:08:31 +0530 Message-ID: Subject: Re: [RESEND PATCH] thermal: rockchip: enable hwmon To: schaecsn@gmx.net, jdelvare@suse.com, linux@roeck-us.ne 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 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