Re: [PATCH RESEND 5.10.y-cip 03/13] thermal/drivers: Add TSU driver for RZ/G2L


Biju Das
 

Hi Pavel,

Thanks for the feedback.

Subject: Re: [cip-dev] [PATCH RESEND 5.10.y-cip 03/13] thermal/drivers:
Add TSU driver for RZ/G2L

Hi!

commit 673c68bd48390dad01f7d17670de3e33b60860ac upstream.

The RZ/G2L SoC incorporates a thermal sensor unit (TSU) that measures
the temperature inside the LSI.

The thermal sensor in this unit measures temperatures in the range
from
−40 degree Celsius to 125 degree Celsius with an accuracy of ±3°C. The
TSU repeats measurement at 20 microseconds intervals and automatically
updates the results of measurement.

The TSU has no interrupts as well as no external pins.

This patch adds Thermal Sensor Unit(TSU) driver for RZ/G2L SoC.
+#define TSU_SS_CONV_RUNNING BIT(0)
+
+#define TS_CODE_AVE_SCALE(x) ((x) * 1000000)
+#define MCELSIUS(temp) ((temp) * MILLIDEGREE_PER_DEGREE)
+#define TS_CODE_CAP_TIMES 8 /* Capture times */
Two spaces, plus "capture times" does not really explain much.
OK, will fix the 2 spaces. For " capture times" Basically we need to read
TSU_SAD register eight times consecutively at 20 microseconds interval.

I will try to drop the comment /* Capture times */ from mainline, if it does
not really explain the intention.


+static int rzg2l_thermal_get_temp(void *devdata, int *temp) {
+ struct rzg2l_thermal_priv *priv = devdata;
+ u32 result = 0, dsensor, ts_code_ave;
+ int val, i;
+
+ for (i = 0; i < TS_CODE_CAP_TIMES ; i++) {
+ /* TSU repeats measurement at 20 microseconds intervals and
+ * automatically updates the results of
According to CodingStyle, /* should be on separate line.
My bad, will fix this.


+ dev_dbg(dev, "TSU probed with %s caliberation values",
+ rzg2l_thermal_read(priv, OTPTSUTRIM_REG(0)) ? "hw" : "sw");
Typo, should be "calibration" I guess.
OK, will fix this.

Cheers,
Biju

Join cip-dev@lists.cip-project.org to automatically receive all group messages.