46 nv_error(therm,
"unknown pwm ctrl for gpio %d\n", *line);
56 int ctrl,
id,
ret = pwm_info(therm, &line, &ctrl, &
id);
60 if (nv_rd32(therm, ctrl) & (1 << line)) {
61 *divs = nv_rd32(therm, 0x00e114 + (
id * 8));
62 *duty = nv_rd32(therm, 0x00e118 + (
id * 8));
72 int ctrl,
id,
ret = pwm_info(therm, &line, &ctrl, &
id);
76 nv_mask(therm, ctrl, 0x00010001 << line, 0x00000001 << line);
77 nv_wr32(therm, 0x00e114 + (
id * 8), divs);
78 nv_wr32(therm, 0x00e118 + (
id * 8), duty | 0x80000000);
85 int chipset = nv_device(therm)->chipset;
86 int crystal = nv_device(therm)->crystal;
90 if (chipset > 0x50 && chipset < 0x94) {
91 u8 pwm_div = nv_rd32(therm, 0x410c);
92 if (nv_rd32(therm, 0xc040) & 0x800000) {
95 pwm_clock = (100000000 >> pwm_div) * 10 / 24;
98 pwm_clock = (crystal * 1000) >> pwm_div;
102 pwm_clock = (crystal * 1000) / 20;
111 return nv_rd32(therm, 0x20400);
125 *pobject = nv_object(priv);
126 therm = (
void *) priv;
152 .ctor = nv50_therm_ctor,