summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRama Krishna Phani A <rphani@codeaurora.org>2017-07-19 19:04:16 +0530
committerGerrit - the friendly Code Review server <code-review@localhost>2018-03-20 06:15:41 -0700
commit88d1db63f74dc55cb614847cd225a807e75095bf (patch)
treebe981cc854179fb5702ad0c48f715fbd5b89144d
parent8e181ea4e865a2245124116afee0d9f71ccd43aa (diff)
thermal: tsens: Disable Tsens interrupts during driver initialization
TSENS upper lower interrupt for all sensors will be enabled by default. Disable interrupts during driver initialization and enable them based on client requirement. Change-Id: I7ad5d50ec9bb2a4c782787c7a1a6b8b42b1128fc Signed-off-by: Rama Krishna Phani A <rphani@codeaurora.org>
-rw-r--r--drivers/thermal/msm-tsens.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/thermal/msm-tsens.c b/drivers/thermal/msm-tsens.c
index 5f955af4671a..db49c33264d5 100644
--- a/drivers/thermal/msm-tsens.c
+++ b/drivers/thermal/msm-tsens.c
@@ -89,6 +89,7 @@
#define TSENS_TM_CRITICAL_INT_EN BIT(2)
#define TSENS_TM_UPPER_INT_EN BIT(1)
#define TSENS_TM_LOWER_INT_EN BIT(0)
+#define TSENS_TM_UPPER_LOWER_INT_DISABLE 0xffffffff
#define TSENS_TM_UPPER_INT_MASK(n) (((n) & 0xffff0000) >> 16)
#define TSENS_TM_LOWER_INT_MASK(n) ((n) & 0xffff)
@@ -269,8 +270,8 @@ struct tsens_tm_device {
uint32_t wd_bark_val;
int tsens_irq;
int tsens_critical_irq;
- void *tsens_addr;
- void *tsens_calib_addr;
+ void __iomem *tsens_addr;
+ void __iomem *tsens_calib_addr;
int tsens_len;
int calib_len;
struct resource *res_tsens_mem;
@@ -2079,6 +2080,7 @@ static int tsens_hw_init(struct tsens_tm_device *tmdev)
void __iomem *sensor_int_mask_addr;
unsigned int srot_val;
int crit_mask;
+ void __iomem *int_mask_addr;
if (!tmdev) {
pr_err("Invalid tsens device\n");
@@ -2104,6 +2106,10 @@ static int tsens_hw_init(struct tsens_tm_device *tmdev)
/*Update critical cycle monitoring*/
mb();
}
+ int_mask_addr = TSENS_TM_UPPER_LOWER_INT_MASK
+ (tmdev->tsens_addr);
+ writel_relaxed(TSENS_TM_UPPER_LOWER_INT_DISABLE,
+ int_mask_addr);
writel_relaxed(TSENS_TM_CRITICAL_INT_EN |
TSENS_TM_UPPER_INT_EN | TSENS_TM_LOWER_INT_EN,
TSENS_TM_INT_EN(tmdev->tsens_addr));