From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752614AbbHEMZq (ORCPT ); Wed, 5 Aug 2015 08:25:46 -0400 Received: from metis.ext.pengutronix.de ([92.198.50.35]:40340 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752498AbbHEMZo (ORCPT ); Wed, 5 Aug 2015 08:25:44 -0400 From: Sascha Hauer To: linux-pm@vger.kernel.org, Zhang Rui , Eduardo Valentin Cc: linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, Daniel Kurtz , kernel@pengutronix.de, Matthias Brugger Subject: [PATCH v3] Add Mediatek thermal support Date: Wed, 5 Aug 2015 14:25:35 +0200 Message-Id: <1438777538-1269-1-git-send-email-s.hauer@pengutronix.de> X-Mailer: git-send-email 2.4.6 X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::7 X-SA-Exim-Mail-From: sha@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This series adds support for the thermal sensors included in the MT8173 SoC. Currently only basic temperature reading is supported without any interrupt support. The cpufreq driver for MT8173 is currently under review, so there's no real cooling device available in mainline. Until this is available the thermal driver can be tested with the following dts snippet. It creates a fake gpio fan and a fake trip point which is so low that it can easily be reached with a "cat /dev/zero > /dev/null" on the command line. Please review and let me know what's missing to be included in mainline. Changes since v2: - sort #includes alphabetically - Add prefix to register defines - drop some members from struct mtk_thermal - simplify raw_to_mcelsius() - add and use more register bit defines - use device_reset() instead of devm_reset_control_get()/reset_control_reset() - misc other stuff Changes since v1: - Use "mediatek," prefix for custom properties - Drop "thermal: consistently use int for temperatures" dependency Sascha fan: gpio_fan { compatible = "gpio-fan"; gpios = <&pio 24 0>; gpio-fan,speed-map = <0 0 4500 1>; #cooling-cells = <2>; }; thermal-zones { cpu_thermal: cpu_thermal { polling-delay-passive = <1000>; /* milliseconds */ polling-delay = <1000>; /* milliseconds */ thermal-sensors = <&thermal 0>; trips { cpu_passive: cpu_passive { temperature = <47000>; /* millicelsius */ hysteresis = <2000>; /* millicelsius */ type = "passive"; }; cpu_crit { temperature = <90000>; /* millicelsius */ hysteresis = <2000>; /* millicelsius */ type = "critical"; }; }; cooling-maps { map0 { trip = <&cpu_passive>; cooling-device = <&fan THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; }; }; }; };