コード例 #1
0
static int mtktscpu_bind(struct thermal_zone_device *thermal,
						struct thermal_cooling_device *cdev)
{
	int table_val=0;
    table_val = mtkts_match(cdev,g_bind);
	if(table_val > 9 ) 
	{
		return 0;
	}
	else
	{
		if(table_val == 0)
		{
			set_thermal_ctrl_trigger_SPM(trip_temp[0]);
		}
		mtktscpu_dprintk("[mtktscpu_bind] %s\n", cdev->type);	
		if (mtk_thermal_zone_bind_cooling_device(thermal, table_val, cdev)) {
			mtktscpu_dprintk("[mtktscpu_bind] error binding cooling dev\n");
			return -EINVAL;
		} else {
			mtktscpu_dprintk("[mtktscpu_bind] binding OK, %d\n", table_val);
		}	
	}
	return 0;  
}
コード例 #2
0
static int mtkts6311_bind(struct thermal_zone_device *thermal,
			struct thermal_cooling_device *cdev)
{
	int table_val=0;

	if(!strcmp(cdev->type, g_bind0))
	{
		table_val = 0;
	}
	else if(!strcmp(cdev->type, g_bind1))
	{
		table_val = 1;
	}
	else if(!strcmp(cdev->type, g_bind2))
	{
		table_val = 2;
	}
	else if(!strcmp(cdev->type, g_bind3))
	{
		table_val = 3;
	}
	else if(!strcmp(cdev->type, g_bind4))
	{
		table_val = 4;
	}
	else if(!strcmp(cdev->type, g_bind5))
	{
		table_val = 5;
	}
	else if(!strcmp(cdev->type, g_bind6))
	{
		table_val = 6;
	}
	else if(!strcmp(cdev->type, g_bind7))
	{
		table_val = 7;
	}
	else if(!strcmp(cdev->type, g_bind8))
	{
		table_val = 8;
	}
	else if(!strcmp(cdev->type, g_bind9))
	{
		table_val = 9;
	}
	else
	{
		return 0;
	}

	if (mtk_thermal_zone_bind_cooling_device(thermal, table_val, cdev)) {
		mtkts6311_dprintk("[mtkts6311_bind] error binding cooling dev\n");
		return -EINVAL;
	} else {
		mtkts6311_dprintk("[mtkts6311_bind] binding OK, %d\n", table_val);
	}

	return 0;
}
コード例 #3
0
static int tsallts_bind(struct thermal_zone_device *thermal, struct thermal_cooling_device *cdev)
{
	int table_val = 0;

	tsallts_dprintk("[tsallts_bind]\n");
	if (!strcmp(cdev->type, g_bind0)) {
		table_val = 0;
		tsallts_dprintk("[tsallts_bind] %s\n", cdev->type);
	} else if (!strcmp(cdev->type, g_bind1)) {
		table_val = 1;
		tsallts_dprintk("[tsallts_bind] %s\n", cdev->type);
	} else if (!strcmp(cdev->type, g_bind2)) {
		table_val = 2;
		tsallts_dprintk("[tsallts_bind] %s\n", cdev->type);
	} else if (!strcmp(cdev->type, g_bind3)) {
		table_val = 3;
		tsallts_dprintk("[tsallts_bind] %s\n", cdev->type);
	} else if (!strcmp(cdev->type, g_bind4)) {
		table_val = 4;
		tsallts_dprintk("[tsallts_bind] %s\n", cdev->type);
	} else if (!strcmp(cdev->type, g_bind5)) {
		table_val = 5;
		tsallts_dprintk("[tsallts_bind] %s\n", cdev->type);
	} else if (!strcmp(cdev->type, g_bind6)) {
		table_val = 6;
		tsallts_dprintk("[tsallts_bind] %s\n", cdev->type);
	} else if (!strcmp(cdev->type, g_bind7)) {
		table_val = 7;
		tsallts_dprintk("[tsallts_bind] %s\n", cdev->type);
	} else if (!strcmp(cdev->type, g_bind8)) {
		table_val = 8;
		tsallts_dprintk("[tsallts_bind] %s\n", cdev->type);
	} else if (!strcmp(cdev->type, g_bind9)) {
		table_val = 9;
		tsallts_dprintk("[tsallts_bind] %s\n", cdev->type);
	} else {
		return 0;
	}

	if (mtk_thermal_zone_bind_cooling_device(thermal, table_val, cdev)) {
		tsallts_dprintk("[tsallts_bind_ts2] error binding cooling dev\n");
		return -EINVAL;
	}

	tsallts_dprintk("[tsallts_bind_ts2] binding OK, %d\n", table_val);
	return 0;
}
コード例 #4
0
static int mtktsbattery2_bind(struct thermal_zone_device *thermal,
			struct thermal_cooling_device *cdev)
{
	int table_val=0;
	table_val = mtkts_match(cdev,g_bind);
	if(table_val >= MTK_TZ_COOLER_MAX)
	{
		return 0;
	}
	else
	{
		mtktsbattery2_dprintk("[mtktsbattery2_bind] %s\n", cdev->type);
		if (mtk_thermal_zone_bind_cooling_device(thermal, table_val, cdev)) {
			mtktsbattery2_dprintk("[mtktsbattery2_bind] error binding cooling dev\n");
			return -EINVAL;
		} else {
			mtktsbattery2_dprintk("[mtktsbattery2_bind] binding OK, %d\n", table_val);
		}
	}
	return 0;
}
コード例 #5
0
static int ntc6290_bind(struct thermal_zone_device *thermal,
                        struct thermal_cooling_device *cdev)
{
	int table_val=0;

	if(!strcmp(cdev->type, ntc6290_bind0))
	{
		table_val = 0;
		mtktspa_dprintk("[%s] %s\n", __func__, cdev->type);
	}
	else if(!strcmp(cdev->type, ntc6290_bind1))
	{
		table_val = 1;
		mtktspa_dprintk("[%s] %s\n", __func__, cdev->type);
	}
	else if(!strcmp(cdev->type, ntc6290_bind2))
	{
		table_val = 2;
		mtktspa_dprintk("[%s] %s\n", __func__, cdev->type);
	}
	else if(!strcmp(cdev->type, ntc6290_bind3))
	{
		table_val = 3;
		mtktspa_dprintk("[%s] %s\n", __func__, cdev->type);
	}
	else if(!strcmp(cdev->type, ntc6290_bind4))
	{
		table_val = 4;
		mtktspa_dprintk("[%s] %s\n", __func__, cdev->type);
	}
	else if(!strcmp(cdev->type, ntc6290_bind5))
	{
		table_val = 5;
		mtktspa_dprintk("[%s] %s\n", __func__, cdev->type);
	}
	else if(!strcmp(cdev->type, ntc6290_bind6))
	{
		table_val = 6;
		mtktspa_dprintk("[%s] %s\n", __func__, cdev->type);
	}
	else if(!strcmp(cdev->type, ntc6290_bind7))
	{
		table_val = 7;
		mtktspa_dprintk("[%s] %s\n", __func__, cdev->type);
	}
	else if(!strcmp(cdev->type, ntc6290_bind8))
	{
		table_val = 8;
		mtktspa_dprintk("[%s] %s\n", __func__, cdev->type);
	}
	else if(!strcmp(cdev->type, ntc6290_bind9))
	{
		table_val = 9;
		mtktspa_dprintk("[%s] %s\n", __func__, cdev->type);
	}
	else
		return 0;


	if (mtk_thermal_zone_bind_cooling_device(thermal, table_val, cdev)) 
	{
		mtktspa_dprintk("[%s] error binding cooling dev\n", __func__);
		return -EINVAL;
	} 
	else 
	{
		mtktspa_dprintk("[%s] binding OK\n", __func__);
	}

	return 0;
}