Files
kernel_xiaomi_sm8250/drivers/thermal/tsens-mtc.h
Siddartha Mohanadoss 3f67fe6c0a thermal: tsens: Add TSENS driver snapshot
Temperature sensor (TSENS) driver is used by thermal
client to set temperature thresholds and send notification
once set thresholds are crossed. Clients can read from
supported TSENS sensors from the TSENS controller.
There can be multiple instances of the TSENS controllers
to support multiple sensors across the system.

This snapshot is taken as of msm-4.14
'commit <405fe31> ("Merge "ARM: dts: msm: Enable
remotefs for trinket"")'.

Change-Id: I0217c55d8462812bfa545fdadf545897da66bebb
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
2018-12-21 16:43:14 -08:00

55 lines
2.1 KiB
C

/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
*/
#define TSENS_NUM_MTC_ZONES_SUPPORT 3
#define TSENS_TM_MTC_ZONE0_SW_MASK_ADDR(n) ((n) + 0x140)
#define TSENS_TM_MTC_ZONE0_LOG(n) ((n) + 0x150)
#define TSENS_TM_MTC_ZONE0_HISTORY(n) ((n) + 0x160)
#define TSENS_TM_MTC_ZONE0_SW_MASK_ADDR_V14(n) ((n) + 0xC0)
#define TSENS_TM_MTC_ZONE0_LOG_V14(n) ((n) + 0xD0)
#define TSENS_SN_ADDR_OFFSET 0x4
#define TSENS_RESET_HISTORY_MASK 0x4
#define TSENS_ZONEMASK_PARAMS 3
#define TSENS_MTC_ZONE_LOG_SIZE 6
#define TSENS_MTC_ZONE_HISTORY_SIZE 3
#define TSENS_TH1_MTC_IN_EFFECT BIT(0)
#define TSENS_TH2_MTC_IN_EFFECT BIT(1)
#define TSENS_MTC_IN_EFFECT 0x3
#define TSENS_MTC_DISABLE 0x0
#define TSENS_LOGS_VALID_MASK 0x40000000
#define TSENS_LOGS_VALID_SHIFT 30
#define TSENS_LOGS_LATEST_MASK 0x0000001f
#define TSENS_LOGS_LOG1_MASK 0x000003e0
#define TSENS_LOGS_LOG2_MASK 0x00007c00
#define TSENS_LOGS_LOG3_MASK 0x000f8000
#define TSENS_LOGS_LOG4_MASK 0x01f00000
#define TSENS_LOGS_LOG5_MASK 0x3e000000
#define TSENS_LOGS_LOG1_SHIFT 5
#define TSENS_LOGS_LOG2_SHIFT 10
#define TSENS_LOGS_LOG3_SHIFT 15
#define TSENS_LOGS_LOG4_SHIFT 20
#define TSENS_LOGS_LOG5_SHIFT 25
#define TSENS_PS_RED_CMD_MASK 0x3ff00000
#define TSENS_PS_YELLOW_CMD_MASK 0x000ffc00
#define TSENS_PS_COOL_CMD_MASK 0x000003ff
#define TSENS_PS_YELLOW_CMD_SHIFT 0xa
#define TSENS_PS_RED_CMD_SHIFT 0x14
#define TSENS_RESET_HISTORY_SHIFT 2
#define TSENS_ZONEMASK_PARAMS 3
#define TSENS_MTC_ZONE_LOG_SIZE 6
#define TSENS_MTC_ZONE_HISTORY_SIZE 3
extern int tsens_get_mtc_zone_history(unsigned int zone, void *zone_hist);
extern struct tsens_device *tsens_controller_is_present(void);
extern int tsens_set_mtc_zone_sw_mask(unsigned int zone,
unsigned int th1_enable, unsigned int th2_enable);
extern int tsens_get_mtc_zone_log(unsigned int zone, void *zone_log);