Files
OpenCellular/chip/npcx/fan_chip.h
Mulin Chao a4175c650e nuc: Support rpm mode for fan control.
In order to support rpm mode, we use a TICK function (fan_tick_func) to
monitor tacho value and adjust PWM duty. In this version, fan driver always
enables clock source of MFT to make sure it can present real-time tacho value.
For better performance, the feedback value to adjust PWM duty is various.
We also change fan & pwm settings for SUNUN 4-pins pwm-type fan.

Modified drivers:
1. npcx_evb/board.h: Modified fan_t & pwm_t structures for SUNON fan spec.
2. npcx_evb_arm/board.h: Modified fan_t & pwm_t structures for SUNON fan spec.
3. fan_chip.h: Remove unnecessary default_count field of mft_t structure
4. fan.c: Add support for rpm mode

BUG=chrome-os-partner:34346
TEST=make buildall -j; test nuvoton IC specific drivers
BRANCH=none

Change-Id: I25e7bd2f3f726b40fd4e0d9a1049a4d82bbd830d
Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
Reviewed-on: https://chromium-review.googlesource.com/320510
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2016-01-06 20:43:32 -08:00

40 lines
834 B
C

/* Copyright (c) 2014 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
/* NPCX-specific MFT module for Chrome EC */
#ifndef __CROS_EC_FAN_CHIP_H
#define __CROS_EC_FAN_CHIP_H
/* MFT module select */
enum npcx_mft_module {
NPCX_MFT_MODULE_1,
NPCX_MFT_MODULE_2,
NPCX_MFT_MODULE_3,
/* Number of MFT modules */
NPCX_MFT_MODULE_COUNT
};
/* MFT clock source */
enum npcx_mft_clk_src {
TCKC_NOCLK = 0,
TCKC_PRESCALE_APB1_CLK = 1,
TCKC_LFCLK = 5,
};
/* Data structure to define MFT channels. */
struct mft_t {
/* MFT module ID */
enum npcx_mft_module module;
/* MFT clock source */
enum npcx_mft_clk_src clk_src;
/* PWM id */
int pwm_id;
};
extern const struct mft_t mft_channels[];
#endif /* __CROS_EC_FAN_CHIP_H */