24 const u8 clear_mask,
const u8 set_mask)
32 static const unsigned int ref_mv[] = { 2500, 2250, 3300, 5000, 12000 };
36 const unsigned int reg =
37 (
unsigned int)limit * 0xc0 /
ref_mv[ref];
38 return reg < 0xff ? reg : 0xff;
43 const unsigned int reg =
45 return reg < 0xff ? reg : 0xff;
82 return rpm ? (60 * 90000 / rpm) & 0xfffc : 0xfffc;
99 return duty_cycle * 255 / 100;
103 const unsigned int fan,
139 const unsigned int zone,
142 static const u8 temp_range[] =
143 { 2, 3, 3, 4, 5, 7, 8, 10, 13, 16, 20, 27, 32, 40, 53, 80 };
147 for (i =
ARRAY_SIZE(temp_range) - 1; i > 0; --i) {
148 if (
config->low_temp + temp_range[i] <=
config->target_temp)
155 config->target_temp >= temp_range[i]
156 ?
config->target_temp - temp_range[i]
183 while ((lm_config < 0 || !((
unsigned int)lm_config &
LM96000_READY))) {
189 if (lm_config < 0 || !((
unsigned int)lm_config &
LM96000_READY)) {
#define DIV_ROUND_UP(x, y)
#define printk(level,...)
void mdelay(unsigned int msecs)
#define LM96000_FAN_IN_CNT
#define LM96000_PWM_CTL_CNT
@ LM96000_FAN_ZONE_1_AUTO
@ LM96000_FAN_ZONE_3_AUTO
@ LM96000_FAN_HOTTEST_123
@ LM96000_FAN_ZONE_2_AUTO
#define LM96000_TEMP_IN_CNT
#define LM96000_TEMP_ZONE_CNT
int i2c_dev_writeb_at(struct device *const dev, const uint8_t off, const uint8_t val)
int i2c_dev_readb_at(struct device *const dev, uint8_t off)
static void noop_read_resources(struct device *dev)
Standard device operations function pointers shims.
static void noop_set_resources(struct device *dev)
static int stopwatch_expired(struct stopwatch *sw)
static void stopwatch_init_msecs_expire(struct stopwatch *sw, long ms)
static u8 lm96000_to_duty(const u8 duty_cycle)
static void lm96000_set_vin_limits(struct device *const dev, const struct drivers_i2c_lm96000_config *const config)
static void lm96000_init(struct device *const dev)
static u16 lm96000_rpm_to_tach(const u16 rpm)
static const unsigned int ref_mv[]
static void lm96000_enable(struct device *const dev)
static u8 lm96000_to_high_limit(const enum lm96000_vin ref, const u16 limit)
static void lm96000_set_fan_limits(struct device *const dev, const struct drivers_i2c_lm96000_config *const config)
static void lm96000_configure_pwm(struct device *const dev, const unsigned int fan, const struct lm96000_fan_config *const config)
static int lm96000_update(struct device *const dev, const u8 reg, const u8 clear_mask, const u8 set_mask)
static struct device_operations lm96000_ops
static int lm96000_write(struct device *const dev, const u8 reg, const u8 value)
static int lm96000_read(struct device *const dev, const u8 reg)
static void lm96000_set_temp_limits(struct device *const dev, const struct drivers_i2c_lm96000_config *const config)
static u8 lm96000_to_low_limit(const enum lm96000_vin ref, const u16 limit)
static void lm96000_configure_temp_zone(struct device *const dev, const unsigned int zone, const struct lm96000_temp_zone *const config)
struct chip_operations drivers_i2c_lm96000_ops
#define LM96000_FAN_FREQ_MASK
#define LM96000_TEMP_LOW_LIMIT(temp)
#define LM96000_FAN_MIN(fan)
#define LM96000_FAN_FREQ(fan)
#define LM96000_ZONE_RANGE_SHIFT
#define LM96000_ZONE_RANGE_MASK
#define LM96000_FAN_LOW_LIMIT(fan)
#define LM96000_ZONE_HYST_MASK(zone)
#define LM96000_FAN_CFG_MODE_SHIFT
#define LM96000_TACH_MODE_FAN_MASK(f)
#define LM96000_FAN_CFG(fan)
#define LM96000_TACH_MODE_FAN_SHIFT(f)
#define LM96000_FAN_MIN_OFF
#define LM96000_TEMP_HIGH_LIMIT(temp)
#define LM96000_ZONE_SMOOTH(zone)
#define LM96000_FAN_CFG_SPINUP_MASK
#define LM96000_VIN_HIGH_LIMIT(v)
#define LM96000_ZONE_HYSTERESIS(zone)
#define LM96000_TACH_MONITOR_MODE
#define LM96000_FAN_MIN_PWM(fan)
#define LM96000_ZONE_TEMP_LOW(zone)
#define LM96000_FAN_CFG_MODE_MASK
#define LM96000_VIN_LOW_LIMIT(v)
#define LM96000_ZONE_RANGE(zone)
#define LM96000_ZONE_HYST_SHIFT(zone)
#define LM96000_ZONE_SMOOTH_EN(zone)
#define LM96000_FAN_CFG_PWM_INVERT
#define LM96000_ZONE_TEMP_PANIC(zone)
#define LM96000_ZONE_SMOOTH_MASK(zone)
#define LM96000_FAN_DUTY(fan)
#define BIOS_INFO
BIOS_INFO - Expected events.
#define BIOS_DEBUG
BIOS_DEBUG - Verbose output.
void(* read_resources)(struct device *dev)
struct device_operations * ops
DEVTREE_CONST void * chip_info