aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/thermal/armada_thermal.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/thermal/armada_thermal.c')
-rw-r--r--drivers/thermal/armada_thermal.c20
1 files changed, 0 insertions, 20 deletions
diff --git a/drivers/thermal/armada_thermal.c b/drivers/thermal/armada_thermal.c
index eaaf59c98ba2..c2556cf5186b 100644
--- a/drivers/thermal/armada_thermal.c
+++ b/drivers/thermal/armada_thermal.c
@@ -35,10 +35,6 @@
35#define PMU_TDC0_OTF_CAL_MASK (0x1 << 30) 35#define PMU_TDC0_OTF_CAL_MASK (0x1 << 30)
36#define PMU_TDC0_START_CAL_MASK (0x1 << 25) 36#define PMU_TDC0_START_CAL_MASK (0x1 << 25)
37 37
38#define A375_Z1_CAL_RESET_LSB 0x8011e214
39#define A375_Z1_CAL_RESET_MSB 0x30a88019
40#define A375_Z1_WORKAROUND_BIT BIT(9)
41
42#define A375_UNIT_CONTROL_SHIFT 27 38#define A375_UNIT_CONTROL_SHIFT 27
43#define A375_UNIT_CONTROL_MASK 0x7 39#define A375_UNIT_CONTROL_MASK 0x7
44#define A375_READOUT_INVERT BIT(15) 40#define A375_READOUT_INVERT BIT(15)
@@ -124,24 +120,12 @@ static void armada375_init_sensor(struct platform_device *pdev,
124 struct armada_thermal_priv *priv) 120 struct armada_thermal_priv *priv)
125{ 121{
126 unsigned long reg; 122 unsigned long reg;
127 bool quirk_needed =
128 !!of_device_is_compatible(pdev->dev.of_node,
129 "marvell,armada375-z1-thermal");
130
131 if (quirk_needed) {
132 /* Ensure these registers have the default (reset) values */
133 writel(A375_Z1_CAL_RESET_LSB, priv->control);
134 writel(A375_Z1_CAL_RESET_MSB, priv->control + 0x4);
135 }
136 123
137 reg = readl(priv->control + 4); 124 reg = readl(priv->control + 4);
138 reg &= ~(A375_UNIT_CONTROL_MASK << A375_UNIT_CONTROL_SHIFT); 125 reg &= ~(A375_UNIT_CONTROL_MASK << A375_UNIT_CONTROL_SHIFT);
139 reg &= ~A375_READOUT_INVERT; 126 reg &= ~A375_READOUT_INVERT;
140 reg &= ~A375_HW_RESETn; 127 reg &= ~A375_HW_RESETn;
141 128
142 if (quirk_needed)
143 reg |= A375_Z1_WORKAROUND_BIT;
144
145 writel(reg, priv->control + 4); 129 writel(reg, priv->control + 4);
146 mdelay(20); 130 mdelay(20);
147 131
@@ -260,10 +244,6 @@ static const struct of_device_id armada_thermal_id_table[] = {
260 .data = &armada375_data, 244 .data = &armada375_data,
261 }, 245 },
262 { 246 {
263 .compatible = "marvell,armada375-z1-thermal",
264 .data = &armada375_data,
265 },
266 {
267 .compatible = "marvell,armada380-thermal", 247 .compatible = "marvell,armada380-thermal",
268 .data = &armada380_data, 248 .data = &armada380_data,
269 }, 249 },