mirror of
https://github.com/torvalds/linux.git
synced 2026-05-24 15:12:13 +02:00
thermal/drivers/qcom/tsens: Update conditions to strictly evaluate for IP v2+
TSENS v2.0+ leverage features not available to prior versions such as updated interrupts init routine, masked interrupts, and watchdog. Currently, the checks in place evaluate whether the IP version is greater than v1 which invalidates when updates to v1 or v1 minor versions are implemented. As such, update the conditional statements to strictly evaluate whether the version is greater than or equal to v2 (inclusive). Signed-off-by: George Moussalem <george.moussalem@outlook.com> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Reviewed-by: Amit Kucheria <amitk@kernel.org> Link: https://lore.kernel.org/r/DS7PR19MB8883434CAA053648E22AA8AC9DCC2@DS7PR19MB8883.namprd19.prod.outlook.com Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
This commit is contained in:
parent
77c6d28192
commit
e3f90f167a
|
|
@ -447,7 +447,7 @@ static void tsens_set_interrupt(struct tsens_priv *priv, u32 hw_id,
|
|||
dev_dbg(priv->dev, "[%u] %s: %s -> %s\n", hw_id, __func__,
|
||||
irq_type ? ((irq_type == 1) ? "UP" : "CRITICAL") : "LOW",
|
||||
enable ? "en" : "dis");
|
||||
if (tsens_version(priv) > VER_1_X)
|
||||
if (tsens_version(priv) >= VER_2_X)
|
||||
tsens_set_interrupt_v2(priv, hw_id, irq_type, enable);
|
||||
else
|
||||
tsens_set_interrupt_v1(priv, hw_id, irq_type, enable);
|
||||
|
|
@ -499,7 +499,7 @@ static int tsens_read_irq_state(struct tsens_priv *priv, u32 hw_id,
|
|||
ret = regmap_field_read(priv->rf[LOW_INT_CLEAR_0 + hw_id], &d->low_irq_clear);
|
||||
if (ret)
|
||||
return ret;
|
||||
if (tsens_version(priv) > VER_1_X) {
|
||||
if (tsens_version(priv) >= VER_2_X) {
|
||||
ret = regmap_field_read(priv->rf[UP_INT_MASK_0 + hw_id], &d->up_irq_mask);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
|
@ -543,7 +543,7 @@ static int tsens_read_irq_state(struct tsens_priv *priv, u32 hw_id,
|
|||
|
||||
static inline u32 masked_irq(u32 hw_id, u32 mask, enum tsens_ver ver)
|
||||
{
|
||||
if (ver > VER_1_X)
|
||||
if (ver >= VER_2_X)
|
||||
return mask & (1 << hw_id);
|
||||
|
||||
/* v1, v0.1 don't have a irq mask register */
|
||||
|
|
@ -733,7 +733,7 @@ static int tsens_set_trips(struct thermal_zone_device *tz, int low, int high)
|
|||
static int tsens_enable_irq(struct tsens_priv *priv)
|
||||
{
|
||||
int ret;
|
||||
int val = tsens_version(priv) > VER_1_X ? 7 : 1;
|
||||
int val = tsens_version(priv) >= VER_2_X ? 7 : 1;
|
||||
|
||||
ret = regmap_field_write(priv->rf[INT_EN], val);
|
||||
if (ret < 0)
|
||||
|
|
@ -1040,7 +1040,7 @@ int __init init_common(struct tsens_priv *priv)
|
|||
}
|
||||
}
|
||||
|
||||
if (tsens_version(priv) > VER_1_X && ver_minor > 2) {
|
||||
if (tsens_version(priv) >= VER_2_X && ver_minor > 2) {
|
||||
/* Watchdog is present only on v2.3+ */
|
||||
priv->feat->has_watchdog = 1;
|
||||
for (i = WDOG_BARK_STATUS; i <= CC_MON_MASK; i++) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user