Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit be312f8c authored by Jishnu Prakash's avatar Jishnu Prakash Committed by Gerrit - the friendly Code Review server
Browse files

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: Ie54b12dae27a33303a27ea8938d4e1cde7b04a83
Signed-off-by: default avatarJishnu Prakash <jprakash@codeaurora.org>
parent 10ee42c3
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -31,6 +31,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_SN_UPPER_LOWER_THRESHOLD(n)	((n) + 0x20)
#define TSENS_TM_SN_ADDR_OFFSET			0x4
#define TSENS_TM_UPPER_THRESHOLD_SET(n)		((n) << 12)
@@ -525,6 +526,7 @@ static int tsens2xxx_hw_init(struct tsens_device *tmdev)
	void __iomem *srot_addr;
	void __iomem *sensor_int_mask_addr;
	unsigned int srot_val, crit_mask, crit_val;
	void __iomem *int_mask_addr;

	srot_addr = TSENS_CTRL_ADDR(tmdev->tsens_srot_addr + 0x4);
	srot_val = readl_relaxed(srot_addr);
@@ -567,6 +569,9 @@ static int tsens2xxx_hw_init(struct tsens_device *tmdev)
		mb();
	}

	int_mask_addr = TSENS_TM_UPPER_LOWER_INT_MASK(tmdev->tsens_tm_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_tm_addr));