Source
x
static inline unsigned char cnt_from_rpm(unsigned long rpm, u32 clk_freq, u16 p,
/*
* g762 - Driver for the Global Mixed-mode Technology Inc. fan speed
* PWM controller chips from G762 family, i.e. G762 and G763
*
* Copyright (C) 2013, Arnaud EBALARD <arno@natisbad.org>
*
* This work is based on a basic version for 2.6.31 kernel developed
* by Olivier Mouchet for LaCie. Updates and correction have been
* performed to run on recent kernels. Additional features, like the
* ability to configure various characteristics via .dts file or
* board init file have been added. Detailed datasheet on which this
* development is based is available here:
*
* http://natisbad.org/NAS/refs/GMT_EDS-762_763-080710-0.2.pdf
*
* Headers from previous developments have been kept below:
*
* Copyright (c) 2009 LaCie
*
* Author: Olivier Mouchet <olivier.mouchet@gmail.com>
*
* based on g760a code written by Herbert Valerio Riedel <hvr@gnu.org>
* Copyright (C) 2007 Herbert Valerio Riedel <hvr@gnu.org>
*
* g762: minimal datasheet available at:
* http://www.gmt.com.tw/product/datasheet/EDS-762_3.pdf
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation.
*/
static const struct i2c_device_id g762_id[] = {
{ "g762", 0 },
{ "g763", 0 },
{ }
};
MODULE_DEVICE_TABLE(i2c, g762_id);
enum g762_regs {
G762_REG_SET_CNT = 0x00,
G762_REG_ACT_CNT = 0x01,
G762_REG_FAN_STA = 0x02,
G762_REG_SET_OUT = 0x03,
G762_REG_FAN_CMD1 = 0x04,
G762_REG_FAN_CMD2 = 0x05,
};
/* Config register bits */
/* enable fan_fail signal */
/* enable fan_out_of_control */
/* out mode: PWM or DC */
/* fan mode: closed/open-loop */
/* clock divisor value */
/* PWM polarity */
/* pulse per fan revolution */
/* fan gear mode */
/* fan startup voltage */
/* fan fail */
/* fan out of control */