Lines Matching full:fan

79 /* NPCM7XX FAN Tacho registers */
140 /* FAN General Definition */
141 /* Define the maximum FAN channel number */
147 * Get Fan Tach Timeout (base on clock 214843.75Hz, 1 cnt = 4.654us)
149 * (The minimum FAN speed could to support ~640RPM/pulse 1,
165 /* Obtain the fan number */
166 #define NPCM7XX_FAN_INPUT(fan, cmp) (((fan) << 1) + (cmp)) argument
168 /* fan sample status */
265 u8 fan, u8 cmp) in npcm7xx_fan_start_capture() argument
272 fan_id = NPCM7XX_FAN_INPUT(fan, cmp); in npcm7xx_fan_start_capture()
274 /* to check whether any fan tach is enable */ in npcm7xx_fan_start_capture()
277 spin_lock_irqsave(&data->fan_lock[fan], flags); in npcm7xx_fan_start_capture()
280 reg_int = ioread8(NPCM7XX_FAN_REG_TIEN(data->fan_base, fan)); in npcm7xx_fan_start_capture()
292 NPCM7XX_FAN_REG_TIEN(data->fan_base, fan)); in npcm7xx_fan_start_capture()
296 fan)); in npcm7xx_fan_start_capture()
300 fan)); in npcm7xx_fan_start_capture()
305 NPCM7XX_FAN_REG_TIEN(data->fan_base, fan)); in npcm7xx_fan_start_capture()
310 fan)); in npcm7xx_fan_start_capture()
314 NPCM7XX_FAN_REG_TCKC(data->fan_base, fan)); in npcm7xx_fan_start_capture()
317 spin_unlock_irqrestore(&data->fan_lock[fan], flags); in npcm7xx_fan_start_capture()
322 * Enable a background timer to poll fan tach value, (200ms * 4)
323 * to polling all fan
364 u8 fan, u8 cmp, u8 fan_id, u8 flag_int, in npcm7xx_fan_compute() argument
372 fan_cap = ioread16(NPCM7XX_FAN_REG_TCRA(data->fan_base, fan)); in npcm7xx_fan_compute()
374 fan_cap = ioread16(NPCM7XX_FAN_REG_TCRB(data->fan_base, fan)); in npcm7xx_fan_compute()
377 iowrite8(flag_clear, NPCM7XX_FAN_REG_TICLR(data->fan_base, fan)); in npcm7xx_fan_compute()
389 * (ex: 2 pulse fan need to get 2 sample) in npcm7xx_fan_compute()
396 /* get enough sample or fan disable */ in npcm7xx_fan_compute()
409 reg_int = ioread8(NPCM7XX_FAN_REG_TIEN(data->fan_base, fan)); in npcm7xx_fan_compute()
413 NPCM7XX_FAN_REG_TIEN(data->fan_base, fan)); in npcm7xx_fan_compute()
414 reg_mode = ioread8(NPCM7XX_FAN_REG_TCKC(data->fan_base, fan)); in npcm7xx_fan_compute()
418 NPCM7XX_FAN_REG_TCKC(data->fan_base, fan)); in npcm7xx_fan_compute()
423 u8 fan, u8 cmp, u8 flag) in npcm7xx_check_cmp() argument
434 fan_id = NPCM7XX_FAN_INPUT(fan, cmp); in npcm7xx_check_cmp()
451 reg_int = ioread8(NPCM7XX_FAN_REG_TIEN(data->fan_base, fan)); in npcm7xx_check_cmp()
455 NPCM7XX_FAN_REG_TIEN(data->fan_base, fan)); in npcm7xx_check_cmp()
459 NPCM7XX_FAN_REG_TICLR(data->fan_base, fan)); in npcm7xx_check_cmp()
461 reg_mode = ioread8(NPCM7XX_FAN_REG_TCKC(data->fan_base, fan)); in npcm7xx_check_cmp()
465 NPCM7XX_FAN_REG_TCKC(data->fan_base, fan)); in npcm7xx_check_cmp()
468 * If timeout occurs (NPCM7XX_FAN_TIMEOUT), the fan doesn't in npcm7xx_check_cmp()
476 npcm7xx_fan_compute(data, fan, cmp, fan_id, flag_int, in npcm7xx_check_cmp()
642 HWMON_CHANNEL_INFO(fan,
756 /* set FAN0~7 fan input FANIN 0~15 */ in npcm7xx_fan_init()
773 /* Fan tach input clock = APB clock / prescalar, default is 255. */ in npcm7xx_fan_init()
887 fan_cnt = of_property_count_u8_elems(child, "fan-tach-ch"); in npcm7xx_en_pwm_fan()
895 ret = of_property_read_u8_array(child, "fan-tach-ch", fan_ch, fan_cnt); in npcm7xx_en_pwm_fan()
943 res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "fan"); in npcm7xx_pwm_fan_probe()
945 dev_err(dev, "fan resource not found\n"); in npcm7xx_pwm_fan_probe()
950 dev_dbg(dev, "fan base resource is %pR\n", res); in npcm7xx_pwm_fan_probe()
954 data->fan_clk = devm_clk_get(dev, "fan"); in npcm7xx_pwm_fan_probe()
956 dev_err(dev, "couldn't get fan clock\n"); in npcm7xx_pwm_fan_probe()
973 sprintf(name, "NPCM7XX-FAN-MD%d", i); in npcm7xx_pwm_fan_probe()
977 dev_err(dev, "register IRQ fan%d failed\n", i); in npcm7xx_pwm_fan_probe()
985 dev_err(dev, "enable pwm and fan failed\n"); in npcm7xx_pwm_fan_probe()
1001 /* fan timer initialization */ in npcm7xx_pwm_fan_probe()
1011 pr_info("NPCM7XX PWM-FAN Driver probed, output Freq %dHz[PWM], input Freq %dHz[FAN]\n", in npcm7xx_pwm_fan_probe()
1018 { .compatible = "nuvoton,npcm750-pwm-fan", },
1033 MODULE_DESCRIPTION("Nuvoton NPCM7XX PWM and Fan Tacho driver");