From ead6b86906f568da17117836e44677ccccc804d2 Mon Sep 17 00:00:00 2001 From: Minghao Zhang Date: Wed, 22 May 2024 15:05:35 +0800 Subject: [PATCH] drivers: thermal: MAX31760: add to distinguish fan quantity in resume This change adds to distinguish fan quantity in resume callback because there are different configurations for different fan quantity. Change-Id: Ibff0bd73f9fe60230af26521da8abccedd7b5643 Signed-off-by: Minghao Zhang --- drivers/thermal/qcom/max31760_fan.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/thermal/qcom/max31760_fan.c b/drivers/thermal/qcom/max31760_fan.c index ee1973f871be..2dbbf6053f4c 100644 --- a/drivers/thermal/qcom/max31760_fan.c +++ b/drivers/thermal/qcom/max31760_fan.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-only /* - * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2022-2024 Qualcomm Innovation Center, Inc. All rights reserved. */ #include @@ -530,7 +530,10 @@ static int max31760_resume(struct device *dev) max31760_write_byte(pdata, MAX31760_CTRL_REG1, 0x19); max31760_write_byte(pdata, MAX31760_CTRL_REG2, 0x11); - max31760_write_byte(pdata, MAX31760_CTRL_REG3, 0x31); + if (pdata->fan_num == 1) + max31760_write_byte(pdata, MAX31760_CTRL_REG3, 0x31); + else if (pdata->fan_num == 2) + max31760_write_byte(pdata, MAX31760_CTRL_REG3, 0x33); max31760_set_cur_state_common(pdata, pdata->cur_state); mutex_unlock(&pdata->update_lock); }