From: Eduardo Valentin <edubezval@gmail.com>
To: s.hauer@pengutronix.de
Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-mediatek@lists.infradead.org, kernel@pengutronix.de,
rui.zhang@intel.com, linux-arm-kernel@lists.infradead.org,
matthias.bgg@gmail.com, djkurtz@chromium.org,
eddie.huang@mediatek.com, Eduardo Valentin <edubezval@gmail.com>
Subject: [PATCH 1/1] thermal: small style cleanup in mtk_thermal
Date: Thu, 18 Feb 2016 07:50:25 -0800 [thread overview]
Message-ID: <1455810625-20509-1-git-send-email-edubezval@gmail.com> (raw)
In-Reply-To: <1448883753-19068-1-git-send-email-s.hauer@pengutronix.de>
Remove all checkpatch.pl --strict errors, checks, and warnings.
Cc: Zhang Rui <rui.zhang@intel.com>
Cc: Matthias Brugger <matthias.bgg@gmail.com>
Cc: linux-pm@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-mediatek@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
---
Sascha,
Add your v12 in my forlinus branch. But also, on top of it
I cleaned the patch further with the following patch.
BR,
Eduardo
drivers/thermal/mtk_thermal.c | 56 ++++++++++++++++++++++---------------------
1 file changed, 29 insertions(+), 27 deletions(-)
diff --git a/drivers/thermal/mtk_thermal.c b/drivers/thermal/mtk_thermal.c
index 589a138..3d93b1c 100644
--- a/drivers/thermal/mtk_thermal.c
+++ b/drivers/thermal/mtk_thermal.c
@@ -78,7 +78,7 @@
#define TEMP_MONCTL1_PERIOD_UNIT(x) ((x) & 0x3ff)
-#define TEMP_MONCTL2_FILTER_INTERVAL(x) (((x) & 0x3ff)) << 16
+#define TEMP_MONCTL2_FILTER_INTERVAL(x) (((x) & 0x3ff) << 16)
#define TEMP_MONCTL2_SENSOR_INTERVAL(x) ((x) & 0x3ff)
#define TEMP_AHBPOLL_ADC_POLL_INTERVAL(x) (x)
@@ -108,15 +108,15 @@
#define MT8173_NUM_SENSORS_PER_ZONE 4
/* Layout of the fuses providing the calibration data */
-#define MT8173_CALIB_BUF0_VALID (1 << 0)
-#define MT8173_CALIB_BUF1_ADC_GE(x) (((x) >> 22 ) & 0x3ff)
-#define MT8173_CALIB_BUF0_VTS_TS1(x) (((x) >> 17 ) & 0x1ff)
-#define MT8173_CALIB_BUF0_VTS_TS2(x) (((x) >> 8 ) & 0x1ff)
-#define MT8173_CALIB_BUF1_VTS_TS3(x) (((x) >> 0 ) & 0x1ff)
-#define MT8173_CALIB_BUF2_VTS_TS4(x) (((x) >> 23 ) & 0x1ff)
-#define MT8173_CALIB_BUF2_VTS_TSABB(x) (((x) >> 14 ) & 0x1ff)
-#define MT8173_CALIB_BUF0_DEGC_CALI(x) (((x) >> 1 ) & 0x3f)
-#define MT8173_CALIB_BUF0_O_SLOPE(x) (((x) >> 26 ) & 0x3f)
+#define MT8173_CALIB_BUF0_VALID BIT(0)
+#define MT8173_CALIB_BUF1_ADC_GE(x) (((x) >> 22) & 0x3ff)
+#define MT8173_CALIB_BUF0_VTS_TS1(x) (((x) >> 17) & 0x1ff)
+#define MT8173_CALIB_BUF0_VTS_TS2(x) (((x) >> 8) & 0x1ff)
+#define MT8173_CALIB_BUF1_VTS_TS3(x) (((x) >> 0) & 0x1ff)
+#define MT8173_CALIB_BUF2_VTS_TS4(x) (((x) >> 23) & 0x1ff)
+#define MT8173_CALIB_BUF2_VTS_TSABB(x) (((x) >> 14) & 0x1ff)
+#define MT8173_CALIB_BUF0_DEGC_CALI(x) (((x) >> 1) & 0x3f)
+#define MT8173_CALIB_BUF0_O_SLOPE(x) (((x) >> 26) & 0x3f)
#define THERMAL_NAME "mtk-thermal"
@@ -136,6 +136,7 @@ struct mtk_thermal {
struct mtk_thermal_bank banks[MT8173_NUM_ZONES];
+ /* lock: for getting and putting banks */
struct mutex lock;
/* Calibration values */
@@ -271,11 +272,9 @@ static void mtk_thermal_put_bank(struct mtk_thermal_bank *bank)
static int mtk_thermal_bank_temperature(struct mtk_thermal_bank *bank)
{
struct mtk_thermal *mt = bank->mt;
- int temp, i, max;
+ int i, temp = INT_MIN, max = INT_MIN;
u32 raw;
- temp = max = INT_MIN;
-
for (i = 0; i < bank_data[bank->id].num_sensors; i++) {
raw = readl(mt->thermal_base + sensing_points[i].msr);
@@ -322,7 +321,7 @@ static const struct thermal_zone_of_device_ops mtk_thermal_ops = {
};
static void mtk_thermal_init_bank(struct mtk_thermal *mt, int num,
- u32 apmixed_phys_base, u32 auxadc_phys_base)
+ u32 apmixed_phys_base, u32 auxadc_phys_base)
{
struct mtk_thermal_bank *bank = &mt->banks[num];
const struct mtk_thermal_bank_cfg *cfg = &bank_data[num];
@@ -346,7 +345,7 @@ static void mtk_thermal_init_bank(struct mtk_thermal *mt, int num,
/* poll is set to 10u */
writel(TEMP_AHBPOLL_ADC_POLL_INTERVAL(768),
- mt->thermal_base + TEMP_AHBPOLL);
+ mt->thermal_base + TEMP_AHBPOLL);
/* temperature sampling control, 1 sample */
writel(0x0, mt->thermal_base + TEMP_MSRCTL0);
@@ -375,49 +374,50 @@ static void mtk_thermal_init_bank(struct mtk_thermal *mt, int num,
/* AHB address for auxadc mux selection */
writel(auxadc_phys_base + AUXADC_CON1_CLR_V,
- mt->thermal_base + TEMP_ADCMUXADDR);
+ mt->thermal_base + TEMP_ADCMUXADDR);
/* AHB address for pnp sensor mux selection */
writel(apmixed_phys_base + APMIXED_SYS_TS_CON1,
- mt->thermal_base + TEMP_PNPMUXADDR);
+ mt->thermal_base + TEMP_PNPMUXADDR);
/* AHB value for auxadc enable */
writel(BIT(MT8173_TEMP_AUXADC_CHANNEL), mt->thermal_base + TEMP_ADCEN);
/* AHB address for auxadc enable (channel 0 immediate mode selected) */
writel(auxadc_phys_base + AUXADC_CON1_SET_V,
- mt->thermal_base + TEMP_ADCENADDR);
+ mt->thermal_base + TEMP_ADCENADDR);
/* AHB address for auxadc valid bit */
writel(auxadc_phys_base + AUXADC_DATA(MT8173_TEMP_AUXADC_CHANNEL),
- mt->thermal_base + TEMP_ADCVALIDADDR);
+ mt->thermal_base + TEMP_ADCVALIDADDR);
/* AHB address for auxadc voltage output */
writel(auxadc_phys_base + AUXADC_DATA(MT8173_TEMP_AUXADC_CHANNEL),
- mt->thermal_base + TEMP_ADCVOLTADDR);
+ mt->thermal_base + TEMP_ADCVOLTADDR);
/* read valid & voltage are at the same register */
writel(0x0, mt->thermal_base + TEMP_RDCTRL);
/* indicate where the valid bit is */
writel(TEMP_ADCVALIDMASK_VALID_HIGH | TEMP_ADCVALIDMASK_VALID_POS(12),
- mt->thermal_base + TEMP_ADCVALIDMASK);
+ mt->thermal_base + TEMP_ADCVALIDMASK);
/* no shift */
writel(0x0, mt->thermal_base + TEMP_ADCVOLTAGESHIFT);
/* enable auxadc mux write transaction */
writel(TEMP_ADCWRITECTRL_ADC_MUX_WRITE,
- mt->thermal_base + TEMP_ADCWRITECTRL);
+ mt->thermal_base + TEMP_ADCWRITECTRL);
for (i = 0; i < cfg->num_sensors; i++)
writel(sensor_mux_values[cfg->sensors[i]],
- mt->thermal_base + sensing_points[i].adcpnp);
+ mt->thermal_base + sensing_points[i].adcpnp);
writel((1 << cfg->num_sensors) - 1, mt->thermal_base + TEMP_MONCTL0);
- writel(TEMP_ADCWRITECTRL_ADC_PNP_WRITE | TEMP_ADCWRITECTRL_ADC_MUX_WRITE,
- mt->thermal_base + TEMP_ADCWRITECTRL);
+ writel(TEMP_ADCWRITECTRL_ADC_PNP_WRITE |
+ TEMP_ADCWRITECTRL_ADC_MUX_WRITE,
+ mt->thermal_base + TEMP_ADCWRITECTRL);
mtk_thermal_put_bank(bank);
}
@@ -434,7 +434,8 @@ static u64 of_get_phys_base(struct device_node *np)
return of_translate_address(np, regaddr_p);
}
-static int mtk_thermal_get_calibration_data(struct device *dev, struct mtk_thermal *mt)
+static int mtk_thermal_get_calibration_data(struct device *dev,
+ struct mtk_thermal *mt)
{
struct nvmem_cell *cell;
u32 *buf;
@@ -567,7 +568,8 @@ static int mtk_thermal_probe(struct platform_device *pdev)
}
for (i = 0; i < MT8173_NUM_ZONES; i++)
- mtk_thermal_init_bank(mt, i, apmixed_phys_base, auxadc_phys_base);
+ mtk_thermal_init_bank(mt, i, apmixed_phys_base,
+ auxadc_phys_base);
platform_set_drvdata(pdev, mt);
--
2.1.4
next prev parent reply other threads:[~2016-02-18 15:50 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-30 11:42 [PATCH v12] Add Mediatek thermal support Sascha Hauer
2015-11-30 11:42 ` [PATCH 1/3] dt-bindings: thermal: Add binding document for Mediatek thermal controller Sascha Hauer
2015-12-16 11:23 ` Daniel Kurtz
2015-12-17 19:23 ` Eduardo Valentin
2015-12-18 7:16 ` Sascha Hauer
2015-12-20 2:12 ` Eduardo Valentin
2015-11-30 11:42 ` [PATCH 2/3] thermal: Add Mediatek thermal controller support Sascha Hauer
2015-12-17 19:33 ` Eduardo Valentin
2016-01-04 14:19 ` Sascha Hauer
2016-01-19 7:29 ` Sascha Hauer
2016-02-01 2:54 ` Eddie Huang
2016-02-15 2:11 ` Daniel Kurtz
2016-02-15 2:14 ` Daniel Kurtz
2016-02-17 17:05 ` Matthias Brugger
2016-02-18 10:56 ` Sascha Hauer
2016-02-18 14:28 ` Javi Merino
2016-02-18 15:15 ` Eduardo Valentin
2016-02-19 7:21 ` Sascha Hauer
2015-12-21 4:07 ` Daniel Kurtz
2016-01-04 14:31 ` Sascha Hauer
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
2016-02-18 16:18 ` Matthias Brugger
2016-02-19 7:20 ` Sascha Hauer
2016-04-20 11:23 ` Matthias Brugger
2015-12-14 10:37 ` [PATCH v12] Add Mediatek thermal support Sascha Hauer
2015-12-14 21:08 ` Eduardo Valentin
2016-02-18 15:50 ` Eduardo Valentin [this message]
2016-02-18 15:56 ` [PATCH 1/1] thermal: small style cleanup in mtk_thermal Matthias Brugger
2016-02-18 15:53 ` [PATCH v12] Add Mediatek thermal support Eduardo Valentin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1455810625-20509-1-git-send-email-edubezval@gmail.com \
--to=edubezval@gmail.com \
--cc=djkurtz@chromium.org \
--cc=eddie.huang@mediatek.com \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-pm@vger.kernel.org \
--cc=matthias.bgg@gmail.com \
--cc=rui.zhang@intel.com \
--cc=s.hauer@pengutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).