示例#1
0
文件: nv50.c 项目: 24hours/linux
int
nv50_fan_pwm_ctrl(struct nouveau_therm *therm, int line, bool enable)
{
	u32 data = enable ? 0x00000001 : 0x00000000;
	int ctrl, id, ret = pwm_info(therm, &line, &ctrl, &id);
	if (ret == 0)
		nv_mask(therm, ctrl, 0x00010001 << line, data << line);
	return ret;
}
示例#2
0
文件: nv50.c 项目: 24hours/linux
int
nv50_fan_pwm_set(struct nouveau_therm *therm, int line, u32 divs, u32 duty)
{
	int ctrl, id, ret = pwm_info(therm, &line, &ctrl, &id);
	if (ret)
		return ret;

	nv_wr32(therm, 0x00e114 + (id * 8), divs);
	nv_wr32(therm, 0x00e118 + (id * 8), duty | 0x80000000);
	return 0;
}
示例#3
0
文件: nvd0.c 项目: 03199618/linux
static int
nvd0_fan_pwm_set(struct nouveau_therm *therm, int line, u32 divs, u32 duty)
{
	int indx = pwm_info(therm, line);
	if (indx < 0)
		return indx;

	nv_wr32(therm, 0x00e114 + (indx * 8), divs);
	nv_wr32(therm, 0x00e118 + (indx * 8), duty | 0x80000000);
	return 0;
}
示例#4
0
文件: nvd0.c 项目: 03199618/linux
static int
nvd0_fan_pwm_ctrl(struct nouveau_therm *therm, int line, bool enable)
{
	u32 data = enable ? 0x00000040 : 0x00000000;
	int indx = pwm_info(therm, line);
	if (indx < 0)
		return indx;

	nv_mask(therm, 0x00d610 + (line * 0x04), 0x000000c0, data);
	return 0;
}
示例#5
0
int nvd0_fan_pwm_get(struct nouveau_device *device, int line, u32 *divs, u32 *duty)
{
	int indx = pwm_info(device, line);
	if (indx < 0)
		return indx;
    
	if (nv_rd32(device, 0x00d610 + (line * 0x04)) & 0x00000040) {
		*divs = nv_rd32(device, 0x00e114 + (indx * 8));
		*duty = nv_rd32(device, 0x00e118 + (indx * 8));
		return 0;
	}
    
	return -EINVAL;
}
示例#6
0
文件: nv50.c 项目: 24hours/linux
int
nv50_fan_pwm_get(struct nouveau_therm *therm, int line, u32 *divs, u32 *duty)
{
	int ctrl, id, ret = pwm_info(therm, &line, &ctrl, &id);
	if (ret)
		return ret;

	if (nv_rd32(therm, ctrl) & (1 << line)) {
		*divs = nv_rd32(therm, 0x00e114 + (id * 8));
		*duty = nv_rd32(therm, 0x00e118 + (id * 8));
		return 0;
	}

	return -EINVAL;
}