struct sprd_board_sensor_config *pconfig = NULL;
int ret = 0;
int temp_inteval;
+#ifdef CONFIG_OF
+ struct device_node *np = pdev->dev.of_node;
+#endif
+
pconfig = devm_kzalloc(&pdev->dev,
sizeof(struct sprd_board_sensor_config),
GFP_KERNEL);
printk("sprd_thermal_probe---------start\n");
-
-#ifdef CONFIG_OF
- struct device_node *np = pdev->dev.of_node;
-#endif
#ifdef CONFIG_OF
if (!np) {
limit_freq = c_info->pdata->cpu_state[state].max_freq;
max_core = c_info->pdata->cpu_state[state].max_core;
c_info->enable = 1;
- pr_info("%s %s: %d limit_freq: %d kHz max_core: %d\n",
+ pr_info("%s %s: %lu limit_freq: %d kHz max_core: %d\n",
cdev->type, __func__, state, limit_freq, max_core);
cpufreq_thermal_limit(c_info->cluster, limit_freq);
cpu_core_thermal_limit(c_info->cluster, max_core);
if (!np) {
dev_err(dev, "device node not found\n");
- return -EINVAL;
+ return NULL;
}
pdata = kzalloc(sizeof(*pdata), GFP_KERNEL);
if (!pdata) {
dev_err(dev, "could not allocate memory for platform data\n");
- return -1;
+ return NULL;
}
ret = of_property_read_u32(np, "cluster", &info->cluster);
if(ret){
return 0;
}
#endif
-static int sprd_thm_temp_read(struct sprd_thermal_zone *pzone)
+static unsigned long sprd_thm_temp_read(struct sprd_thermal_zone *pzone)
{
u32 rawdata = 0;
int cal_offset = 0;
(BIT_THM_RTC_EB | BIT_GPU_THMA_RTC_EB |
BIT_GPU_THMA_RTC_AUTO_EN | BIT_ARM_THMA_RTC_EB | BIT_ARM_THMA_RTC_AUTO_EN));
#endif
- __thm_reg_write((pzone->reg_base + SENSOR_CTRL + LOCAL_SENSOR_ADDR_OFF), 0x030, 0x0);
- __thm_reg_write((pzone->reg_base + SENSOR_CTRL), 0x31, 0x0);
+ __thm_reg_write((uintptr_t)(pzone->reg_base + SENSOR_CTRL + LOCAL_SENSOR_ADDR_OFF), 0x030, 0x0);
+ __thm_reg_write((uintptr_t)(pzone->reg_base + SENSOR_CTRL), 0x31, 0x0);
} else if (SPRD_GPU_SENSOR == pzone->sensor_id) {
/*sci_glb_set(REG_AON_APB_APB_RTC_EB,
(BIT_THM_RTC_EB | BIT_GPU_THMA_RTC_EB |
BIT_GPU_THMA_RTC_AUTO_EN | BIT_ARM_THMA_RTC_EB |BIT_ARM_THMA_RTC_AUTO_EN ) );*/
- __thm_reg_write((pzone->reg_base + SENSOR_CTRL+LOCAL_SENSOR_ADDR_OFF), 0x31, 0x0);
+ __thm_reg_write((uintptr_t)(pzone->reg_base + SENSOR_CTRL+LOCAL_SENSOR_ADDR_OFF), 0x31, 0x0);
} else {
THM_DEBUG("the sensor id is error \n");
}
u16 int_ctrl_reg[SPRD_MAX_SENSOR];
int sprd_thm_hw_suspend(struct sprd_thermal_zone *pzone)
{
- u32 local_sen_id = 0;
unsigned long local_sensor_addr;
int ret = 0;
}
int sprd_thm_hw_resume(struct sprd_thermal_zone *pzone)
{
- u32 local_sen_id = 0;
unsigned long local_sensor_addr;
int ret = 0;
//struct thermal_zone_device *tz = to_thermal_zone(dev);
struct thermal_zone_device *tz = container_of(dev, struct thermal_zone_device, device);
int result;
- unsigned long logtime;
- if (kstrtoul(buf, 10, &logtime))
+ unsigned long logtime;
+ if (kstrtoul(buf, 10, &logtime))
return -EINVAL;
- result = sprd_sys_set_logtime(tz, logtime);
+ result = sprd_sys_set_logtime(tz, logtime);
if (result)
return result;
{
struct sprd_thermal_zone *pzone;
int temp;
- unsigned long volt = 0;
pzone = container_of(work, struct sprd_thermal_zone, thm_logtime_work.work);
temp = pzone->ops->read_temp(pzone);
printk(" thm sensor id:%d, logtime:%ld, temp:%d\n", pzone->sensor_id,pzone->logtime,temp);