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

Commit 412fd36a authored by Rama Krishna Phani A's avatar Rama Krishna Phani A
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: I7ad5d50ec9bb2a4c782787c7a1a6b8b42b1128fc
Signed-off-by: default avatarRama Krishna Phani A <rphani@codeaurora.org>
parent f67a2861
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -87,6 +87,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)
@@ -840,8 +841,8 @@ struct tsens_tm_device {
	uint32_t			tsens_num_sensor;
	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;
@@ -2710,6 +2711,7 @@ static int tsens_hw_init(struct tsens_tm_device *tmdev)
{
	void __iomem *srot_addr;
	unsigned int srot_val;
	void __iomem *int_mask_addr;

	if (!tmdev) {
		pr_err("Invalid tsens device\n");
@@ -2723,6 +2725,10 @@ static int tsens_hw_init(struct tsens_tm_device *tmdev)
			pr_err("TSENS device is not enabled\n");
			return -ENODEV;
		}
		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));