Thread (7 messages) 7 messages, 2 authors, 2021-10-18

Re: [PATCH 3/3] thermal: mediatek: add MT8365 thermal driver support

From: Daniel Lezcano <hidden>
Date: 2021-10-18 16:03:49
Also in: linux-devicetree, linux-mediatek, linux-pm

Hi Markus,

On 18/10/2021 17:40, Markus Schneider-Pargmann wrote:

[ ... ]
quoted
quoted
 	}, {
 	},
 };
 MODULE_DEVICE_TABLE(of, mtk_thermal_of_match);
 
-static void mtk_thermal_turn_on_buffer(void __iomem *apmixed_base)
+static void mtk_thermal_turn_on_buffer(struct mtk_thermal *mt,
+				       void __iomem *apmixed_base)
 {
 	int tmp;
 
-	tmp = readl(apmixed_base + APMIXED_SYS_TS_CON1);
-	tmp &= ~(0x37);
-	tmp |= 0x1;
-	writel(tmp, apmixed_base + APMIXED_SYS_TS_CON1);
+	if (!mt->conf->apmixed_buffer_ctl_reg)
+		return;
+
+	tmp = readl(apmixed_base + mt->conf->apmixed_buffer_ctl_reg);
+	tmp &= mt->conf->apmixed_buffer_ctl_mask;
+	tmp |= mt->conf->apmixed_buffer_ctl_set;
What is the goal of these two bits operations ?
mt7622 needs to unset a few bits and set one bit in this register.
mt8365 only unsets bits. For this purpose I created a _mask field to
unset bits and a _set field to set bits.

Would you suggest a different way?
No, I understand what you wanted to do. I was just unsure if there was a
trick because of the tmp |= 0;




-- 
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help