0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024 #include "priv.h"
0025
0026 static int
0027 gm107_fan_pwm_ctrl(struct nvkm_therm *therm, int line, bool enable)
0028 {
0029
0030 return 0;
0031 }
0032
0033 static int
0034 gm107_fan_pwm_get(struct nvkm_therm *therm, int line, u32 *divs, u32 *duty)
0035 {
0036 struct nvkm_device *device = therm->subdev.device;
0037 *divs = nvkm_rd32(device, 0x10eb20) & 0x1fff;
0038 *duty = nvkm_rd32(device, 0x10eb24) & 0x1fff;
0039 return 0;
0040 }
0041
0042 static int
0043 gm107_fan_pwm_set(struct nvkm_therm *therm, int line, u32 divs, u32 duty)
0044 {
0045 struct nvkm_device *device = therm->subdev.device;
0046 nvkm_mask(device, 0x10eb10, 0x1fff, divs);
0047 nvkm_wr32(device, 0x10eb14, duty | 0x80000000);
0048 return 0;
0049 }
0050
0051 static int
0052 gm107_fan_pwm_clock(struct nvkm_therm *therm, int line)
0053 {
0054 return therm->subdev.device->crystal * 1000;
0055 }
0056
0057 static const struct nvkm_therm_func
0058 gm107_therm = {
0059 .init = gf119_therm_init,
0060 .fini = g84_therm_fini,
0061 .pwm_ctrl = gm107_fan_pwm_ctrl,
0062 .pwm_get = gm107_fan_pwm_get,
0063 .pwm_set = gm107_fan_pwm_set,
0064 .pwm_clock = gm107_fan_pwm_clock,
0065 .temp_get = g84_temp_get,
0066 .fan_sense = gt215_therm_fan_sense,
0067 .program_alarms = nvkm_therm_program_alarms_polling,
0068 };
0069
0070 int
0071 gm107_therm_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst,
0072 struct nvkm_therm **ptherm)
0073 {
0074 return nvkm_therm_new_(&gm107_therm, device, type, inst, ptherm);
0075 }