All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v12] Add Mediatek thermal support
@ 2015-11-30 11:42 ` Sascha Hauer
  0 siblings, 0 replies; 76+ messages in thread
From: Sascha Hauer @ 2015-11-30 11:42 UTC (permalink / raw)
  To: linux-pm, Zhang Rui, Eduardo Valentin
  Cc: linux-kernel, kernel, linux-mediatek, linux-arm-kernel, Matthias Brugger

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.

Sascha

Changes since v11:
- Fix usage of uninitialized variable gcc didn't warn about

changes since v10:
- Some style cleanup
- Add comment to make clear why we use the sensors in banks even if we
  currently only use the maximum of all banks

changes since v9:
- rebase on v4.3
- Add support for reading the calibration values from nvmem fuses
- Only register a single thermal zone instead of four as it seems
  that's everything needed

changes since v8:
- Add commit description to binding patch
- rebase on v4.3-rc2

changes since v7:
- re-add some used defines removed in v5
- Use MT8173_THERMAL_ZONE_* defines as array indices in static initializers

changes since v6:
- remove dot in Hanyi Wus name

changes since v5:
- update copyright
- remove unused defines

Changes since v4:
- give calibration constants more meaningful names (offset, slope)
- Use define instead of 0x00c for register access.

Changes since v3:
- add include/dt-bindings/thermal/mt8173.h for to be able to use sensor names
  in dts files
- fix disabling wrong clock in error path
- remove now unused reset-names property from binding document
- rename MT8173_NUM_BANKS -> MT8173_NUM_ZONES
- rename MT8173_NUM_SENSING_POINTS -> MT8173_NUM_SENSORS_PER_ZONE
- rename struct thermal_zone_device *tz -> struct thermal_zone_device *tzd

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

-------------

	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>;

			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>;
				};
			};
		};
	};


^ permalink raw reply	[flat|nested] 76+ messages in thread

end of thread, other threads:[~2016-04-20 11:24 UTC | newest]

Thread overview: 76+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-30 11:42 [PATCH v12] Add Mediatek thermal support Sascha Hauer
2015-11-30 11:42 ` Sascha Hauer
2015-11-30 11:42 ` [PATCH 1/3] dt-bindings: thermal: Add binding document for Mediatek thermal controller Sascha Hauer
2015-11-30 11:42   ` Sascha Hauer
2015-12-16 11:23   ` Daniel Kurtz
2015-12-16 11:23     ` Daniel Kurtz
2015-12-16 11:23     ` Daniel Kurtz
2015-12-17 19:23     ` Eduardo Valentin
2015-12-17 19:23       ` Eduardo Valentin
2015-12-17 19:23       ` Eduardo Valentin
2015-12-18  7:16       ` Sascha Hauer
2015-12-18  7:16         ` Sascha Hauer
2015-12-18  7:16         ` Sascha Hauer
2015-12-20  2:12         ` Eduardo Valentin
2015-12-20  2:12           ` Eduardo Valentin
2015-12-20  2:12           ` Eduardo Valentin
2015-11-30 11:42 ` [PATCH 2/3] thermal: Add Mediatek thermal controller support Sascha Hauer
2015-11-30 11:42   ` Sascha Hauer
2015-12-17 19:33   ` Eduardo Valentin
2015-12-17 19:33     ` Eduardo Valentin
2016-01-04 14:19     ` Sascha Hauer
2016-01-04 14:19       ` Sascha Hauer
2016-01-19  7:29       ` Sascha Hauer
2016-01-19  7:29         ` Sascha Hauer
2016-02-01  2:54         ` Eddie Huang
2016-02-01  2:54           ` Eddie Huang
2016-02-01  2:54           ` Eddie Huang
2016-02-15  2:11           ` Daniel Kurtz
2016-02-15  2:11             ` Daniel Kurtz
2016-02-15  2:11             ` Daniel Kurtz
2016-02-15  2:14             ` Daniel Kurtz
2016-02-15  2:14               ` Daniel Kurtz
2016-02-15  2:14               ` Daniel Kurtz
2016-02-17 17:05               ` Matthias Brugger
2016-02-17 17:05                 ` Matthias Brugger
2016-02-17 17:05                 ` Matthias Brugger
2016-02-18 10:56                 ` Sascha Hauer
2016-02-18 10:56                   ` Sascha Hauer
2016-02-18 10:56                   ` Sascha Hauer
2016-02-18 14:28                   ` Javi Merino
2016-02-18 14:28                     ` Javi Merino
2016-02-18 14:28                     ` Javi Merino
2016-02-18 15:15                   ` Eduardo Valentin
2016-02-18 15:15                     ` Eduardo Valentin
2016-02-18 15:15                     ` Eduardo Valentin
2016-02-19  7:21                     ` Sascha Hauer
2016-02-19  7:21                       ` Sascha Hauer
2016-02-19  7:21                       ` Sascha Hauer
2015-12-21  4:07   ` Daniel Kurtz
2015-12-21  4:07     ` Daniel Kurtz
2015-12-21  4:07     ` Daniel Kurtz
2016-01-04 14:31     ` Sascha Hauer
2016-01-04 14:31       ` Sascha Hauer
2016-01-04 14:31       ` Sascha Hauer
2016-01-04 15:43       ` Daniel Kurtz
2016-01-04 15:43         ` Daniel Kurtz
2016-01-04 15:43         ` Daniel Kurtz
2015-11-30 11:42 ` [PATCH 3/3] ARM64: dts: mt8173: Add thermal/auxadc device nodes Sascha Hauer
2015-11-30 11:42   ` Sascha Hauer
2016-02-18 16:18   ` Matthias Brugger
2016-02-18 16:18     ` Matthias Brugger
2016-02-19  7:20     ` Sascha Hauer
2016-02-19  7:20       ` Sascha Hauer
2016-04-20 11:23   ` Matthias Brugger
2016-04-20 11:23     ` Matthias Brugger
2015-12-14 10:37 ` [PATCH v12] Add Mediatek thermal support Sascha Hauer
2015-12-14 10:37   ` Sascha Hauer
2015-12-14 10:37   ` Sascha Hauer
2015-12-14 21:08   ` Eduardo Valentin
2015-12-14 21:08     ` Eduardo Valentin
2016-02-18 15:50 ` [PATCH 1/1] thermal: small style cleanup in mtk_thermal Eduardo Valentin
2016-02-18 15:50   ` Eduardo Valentin
2016-02-18 15:56   ` Matthias Brugger
2016-02-18 15:56     ` Matthias Brugger
2016-02-18 15:53 ` [PATCH v12] Add Mediatek thermal support Eduardo Valentin
2016-02-18 15:53   ` Eduardo Valentin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.