亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? it87.c

?? ite_8075 io source code temperature and fan speed control for linux
?? C
?? 第 1 頁 / 共 4 頁
字號:
/*    it87.c - Part of lm_sensors, Linux kernel modules for hardware             monitoring.    The IT8705F is an LPC-based Super I/O part that contains UARTs, a    parallel port, an IR port, a MIDI port, a floppy controller, etc., in    addition to an Environment Controller (Enhanced Hardware Monitor and    Fan Controller)    This driver supports only the Environment Controller in the IT8705F and    similar parts.  The other devices are supported by different drivers.    Supports: IT8705F  Super I/O chip w/LPC interface              IT8712F  Super I/O chip w/LPC interface              IT8716F  Super I/O chip w/LPC interface              IT8718F  Super I/O chip w/LPC interface              IT8720F  Super I/O chip w/LPC interface              IT8726F  Super I/O chip w/LPC interface              IT8781F  Super I/O chip w/LPC interface              IT8782F  Super I/O chip w/LPC interface              Sis950   A clone of the IT8705F    Copyright (C) 2001 Chris Gauthron    Copyright (C) 2005-2007 Jean Delvare <khali@linux-fr.org>    Copyright (C) 2008 Cark Li <cark.li@ite.com.tw>    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, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.*/#include <linux/module.h>#include <linux/init.h>#include <linux/slab.h>#include <linux/jiffies.h>#include <linux/platform_device.h>#include <linux/hwmon.h>#include <linux/hwmon-sysfs.h>#include <linux/hwmon-vid.h>#include <linux/err.h>#include <linux/mutex.h>#include <linux/sysfs.h>#include <asm/io.h>#define DRVNAME "it87"enum chips { it87, it8712, it8716, it8718 };static unsigned short force_id;module_param(force_id, ushort, 0);MODULE_PARM_DESC(force_id, "Override the detected device ID");static struct platform_device *pdev;#define	REG	0x2e	/* The register to read/write */#define	DEV	0x07	/* Register: Logical device select */#define	VAL	0x2f	/* The value to read/write */#define PME	0x04	/* The device with the fan registers in it */#define GPIO	0x07	/* The device with the IT8718F VID value in it */#define	DEVID	0x20	/* Register: Device ID */#define	DEVREV	0x22	/* Register: Device Revision */static inline intsuperio_inb(int reg){	outb(reg, REG);	return inb(VAL);}static int superio_inw(int reg){	int val;	outb(reg++, REG);	val = inb(VAL) << 8;	outb(reg, REG);	val |= inb(VAL);	return val;}static inline voidsuperio_select(int ldn){	outb(DEV, REG);	outb(ldn, VAL);}static inline voidsuperio_enter(void){	outb(0x87, REG);	outb(0x01, REG);	outb(0x55, REG);	outb(0x55, REG);}static inline voidsuperio_exit(void){	outb(0x02, REG);	outb(0x02, VAL);}/* Logical device 4 registers */#define IT8712F_DEVID 0x8712#define IT8705F_DEVID 0x8705#define IT8716F_DEVID 0x8716#define IT8718F_DEVID 0x8718#define IT8720F_DEVID 0x8720#define IT8726F_DEVID 0x8726#define IT8781F_DEVID 0x8781#define IT8782F_DEVID 0x8782#define IT87_ACT_REG  0x30#define IT87_BASE_REG 0x60/* Logical device 7 registers (IT8712F and later) */#define IT87_SIO_PINX2_REG	0x2c	/* Pin selection */#define IT87_SIO_VID_REG	0xfc	/* VID value *//* Update battery voltage after every reading if true */static int update_vbat;/* Not all BIOSes properly configure the PWM registers */static int fix_pwm_polarity;/* Many IT87 constants specified below *//* Length of ISA address segment */#define IT87_EXTENT 8/* Length of ISA address segment for Environmental Controller */#define IT87_EC_EXTENT 2/* Offset of EC registers from ISA base address */#define IT87_EC_OFFSET 5/* Where are the ISA address/data registers relative to the EC base address */#define IT87_ADDR_REG_OFFSET 0#define IT87_DATA_REG_OFFSET 1/*----- The IT87 registers -----*/#define IT87_REG_CONFIG        0x00#define IT87_REG_ALARM1        0x01#define IT87_REG_ALARM2        0x02#define IT87_REG_ALARM3        0x03/* The IT8718F has the VID value in a different register, in Super-I/O   configuration space. */#define IT87_REG_VID           0x0a/* Warning: register 0x0b is used for something completely different in   new chips/revisions. I suspect only 16-bit tachometer mode will work   for these. */#define IT87_REG_FAN_DIV       0x0b#define IT87_REG_FAN_16BIT     0x0c/* Monitors: 9 voltage (0 to 7, battery), 3 temp (1 to 3), 3 fan (1 to 3) */static const u8 IT87_REG_FAN[]		= { 0x0d, 0x0e, 0x0f, 0x80, 0x82 };static const u8 IT87_REG_FAN_MIN[]	= { 0x10, 0x11, 0x12, 0x84, 0x86 };static const u8 IT87_REG_FANX[]		= { 0x18, 0x19, 0x1a, 0x81, 0x83 };static const u8 IT87_REG_FANX_MIN[]	= { 0x1b, 0x1c, 0x1d, 0x85, 0x87 };#define IT87_REG_FAN_MAIN_CTRL 0x13#define IT87_REG_FAN_CTL       0x14#define IT87_REG_PWM(nr)       (0x15 + (nr))#define IT87_REG_VIN(nr)       (0x20 + (nr))#define IT87_REG_TEMP(nr)      (0x29 + (nr))#define IT87_REG_VIN_MAX(nr)   (0x30 + (nr) * 2)#define IT87_REG_VIN_MIN(nr)   (0x31 + (nr) * 2)#define IT87_REG_TEMP_HIGH(nr) (0x40 + (nr) * 2)#define IT87_REG_TEMP_LOW(nr)  (0x41 + (nr) * 2)#define IT87_REG_VIN_ENABLE    0x50#define IT87_REG_TEMP_ENABLE   0x51#define IT87_REG_CHIPID        0x58#define IN_TO_REG(val)  (SENSORS_LIMIT((((val) + 8)/16),0,255))#define IN_FROM_REG(val) ((val) * 16)static inline u8 FAN_TO_REG(long rpm, int div){	if (rpm == 0)		return 255;	rpm = SENSORS_LIMIT(rpm, 1, 1000000);	return SENSORS_LIMIT((1350000 + rpm * div / 2) / (rpm * div), 1,			     254);}static inline u16 FAN16_TO_REG(long rpm){	if (rpm == 0)		return 0xffff;	return SENSORS_LIMIT((1350000 + rpm) / (rpm * 2), 1, 0xfffe);}#define FAN_FROM_REG(val,div) ((val)==0?-1:(val)==255?0:1350000/((val)*(div)))/* The divider is fixed to 2 in 16-bit mode */#define FAN16_FROM_REG(val) ((val)==0?-1:(val)==0xffff?0:1350000/((val)*2))#define TEMP_TO_REG(val) (SENSORS_LIMIT(((val)<0?(((val)-500)/1000):\					((val)+500)/1000),-128,127))#define TEMP_FROM_REG(val) (((val)>0x80?(val)-0x100:(val))*1000)#define PWM_TO_REG(val)   ((val) >> 1)#define PWM_FROM_REG(val) (((val)&0x7f) << 1)static int DIV_TO_REG(int val){	int answer = 0;	while (answer < 7 && (val >>= 1))		answer++;	return answer;}#define DIV_FROM_REG(val) (1 << (val))static const unsigned int pwm_freq[8] = {	48000000 / 128,	24000000 / 128,	12000000 / 128,	8000000 / 128,	6000000 / 128,	3000000 / 128,	1500000 / 128,	750000 / 128,};struct it87_sio_data {	enum chips type;	/* Values read from Super-I/O config space */	u8 vid_value;};/* For each registered chip, we need to keep some data in memory.   The structure is dynamically allocated. */struct it87_data {	struct device *hwmon_dev;	enum chips type;	unsigned short addr;	const char *name;	struct mutex update_lock;	char valid;		/* !=0 if following fields are valid */	unsigned long last_updated;	/* In jiffies */	u8 in[9];		/* Register value */	u8 in_max[8];		/* Register value */	u8 in_min[8];		/* Register value */	u8 has_fan;		/* Bitfield, fans enabled */	u16 fan[5];		/* Register values, possibly combined */	u16 fan_min[5];		/* Register values, possibly combined */	u8 temp[3];		/* Register value */	u8 temp_high[3];	/* Register value */	u8 temp_low[3];		/* Register value */	u8 sensor;		/* Register value */	u8 fan_div[3];		/* Register encoding, shifted right */	u8 vid;			/* Register encoding, combined */	u8 vrm;	u32 alarms;		/* Register encoding, combined */	u8 fan_main_ctrl;	/* Register value */	u8 fan_ctl;		/* Register value */	u8 manual_pwm_ctl[3];   /* manual PWM value set by user */};static int it87_probe(struct platform_device *pdev);static int __devexit it87_remove(struct platform_device *pdev);static int it87_read_value(struct it87_data *data, u8 reg);static void it87_write_value(struct it87_data *data, u8 reg, u8 value);static struct it87_data *it87_update_device(struct device *dev);static int it87_check_pwm(struct device *dev);static void it87_init_device(struct platform_device *pdev);static struct platform_driver it87_driver = {	.driver = {		.owner	= THIS_MODULE,		.name	= DRVNAME,	},	.probe	= it87_probe,	.remove	= __devexit_p(it87_remove),};static ssize_t show_in(struct device *dev, struct device_attribute *attr,		char *buf){	struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);	int nr = sensor_attr->index;	struct it87_data *data = it87_update_device(dev);	return sprintf(buf, "%d\n", IN_FROM_REG(data->in[nr]));}static ssize_t show_in_min(struct device *dev, struct device_attribute *attr,		char *buf){	struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);	int nr = sensor_attr->index;	struct it87_data *data = it87_update_device(dev);	return sprintf(buf, "%d\n", IN_FROM_REG(data->in_min[nr]));}static ssize_t show_in_max(struct device *dev, struct device_attribute *attr,		char *buf){	struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);	int nr = sensor_attr->index;	struct it87_data *data = it87_update_device(dev);	return sprintf(buf, "%d\n", IN_FROM_REG(data->in_max[nr]));}static ssize_t set_in_min(struct device *dev, struct device_attribute *attr,		const char *buf, size_t count){	struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);	int nr = sensor_attr->index;	struct it87_data *data = dev_get_drvdata(dev);	unsigned long val = simple_strtoul(buf, NULL, 10);	mutex_lock(&data->update_lock);	data->in_min[nr] = IN_TO_REG(val);	it87_write_value(data, IT87_REG_VIN_MIN(nr),			data->in_min[nr]);	mutex_unlock(&data->update_lock);	return count;}static ssize_t set_in_max(struct device *dev, struct device_attribute *attr,		const char *buf, size_t count){	struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);	int nr = sensor_attr->index;	struct it87_data *data = dev_get_drvdata(dev);	unsigned long val = simple_strtoul(buf, NULL, 10);	mutex_lock(&data->update_lock);	data->in_max[nr] = IN_TO_REG(val);	it87_write_value(data, IT87_REG_VIN_MAX(nr),			data->in_max[nr]);	mutex_unlock(&data->update_lock);	return count;}#define show_in_offset(offset)					\static SENSOR_DEVICE_ATTR(in##offset##_input, S_IRUGO,		\		show_in, NULL, offset);#define limit_in_offset(offset)					\static SENSOR_DEVICE_ATTR(in##offset##_min, S_IRUGO | S_IWUSR,	\		show_in_min, set_in_min, offset);		\static SENSOR_DEVICE_ATTR(in##offset##_max, S_IRUGO | S_IWUSR,	\		show_in_max, set_in_max, offset);show_in_offset(0);limit_in_offset(0);show_in_offset(1);limit_in_offset(1);show_in_offset(2);limit_in_offset(2);show_in_offset(3);limit_in_offset(3);show_in_offset(4);limit_in_offset(4);show_in_offset(5);limit_in_offset(5);show_in_offset(6);limit_in_offset(6);show_in_offset(7);limit_in_offset(7);show_in_offset(8);/* 3 temperatures */static ssize_t show_temp(struct device *dev, struct device_attribute *attr,		char *buf){	struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);	int nr = sensor_attr->index;	struct it87_data *data = it87_update_device(dev);	return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp[nr]));

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲免费在线电影| 91视频xxxx| 色94色欧美sute亚洲线路一久| 欧美高清激情brazzers| 国产精品免费免费| 狠狠色丁香九九婷婷综合五月| 在线中文字幕不卡| 中文字幕在线不卡一区| 经典三级在线一区| 在线播放欧美女士性生活| 国产精品三级av在线播放| 久久精品二区亚洲w码| 欧美日韩一区视频| 亚洲欧美日韩国产综合| 国产iv一区二区三区| 日韩你懂的在线观看| 亚洲国产视频一区| 色8久久精品久久久久久蜜| 中文字幕的久久| 国产成人精品影院| 久久精品免费在线观看| 韩国在线一区二区| 久久免费电影网| 精品一区二区三区在线观看国产 | 91精品国产免费| 亚洲卡通动漫在线| www.日韩av| 亚洲日本免费电影| 色综合久久天天综合网| 亚洲特级片在线| 94色蜜桃网一区二区三区| 自拍偷自拍亚洲精品播放| 成人激情开心网| 国产精品久久久久久久久免费桃花| 国产福利91精品一区| 欧美国产日本韩| av在线一区二区三区| 国产精品乱码妇女bbbb| 北岛玲一区二区三区四区| 中文字幕在线不卡视频| 91官网在线免费观看| 天天综合日日夜夜精品| 日韩一区二区在线观看视频| 国内成人免费视频| 国产精品国产精品国产专区不片| av一区二区不卡| 亚洲va欧美va人人爽| 欧美一个色资源| 国产激情视频一区二区三区欧美 | 日韩欧美成人一区二区| 久久99国产精品尤物| 国产欧美日韩另类视频免费观看 | 欧美日韩一区二区三区在线| 日韩国产精品久久久| 精品国产一区二区精华| 国产成人精品亚洲777人妖 | 91久久国产最好的精华液| 亚洲成人动漫一区| 久久先锋资源网| 成人av高清在线| 亚洲a一区二区| 欧美白人最猛性xxxxx69交| 不卡一卡二卡三乱码免费网站| 亚洲一区二区三区视频在线| 欧美一卡二卡三卡| eeuss国产一区二区三区| 亚洲成人一区在线| 国产精品视频一二| 欧美老肥妇做.爰bbww| 国产成人av网站| 日本不卡在线视频| 国产精品美女视频| 日韩欧美亚洲国产另类| 成人av网站免费| 久久精品国产99久久6| 亚洲伦理在线精品| 久久青草国产手机看片福利盒子 | 国产成人精品影视| 日韩激情视频网站| 亚洲毛片av在线| 亚洲精品一区二区精华| 欧美性大战久久久久久久蜜臀| 国产自产2019最新不卡| 亚洲成av人片一区二区梦乃| 国产精品免费久久久久| 精品国免费一区二区三区| 欧美性一区二区| 成人高清在线视频| 国产老妇另类xxxxx| 日本成人中文字幕在线视频| 亚洲欧美国产毛片在线| 国产清纯美女被跳蛋高潮一区二区久久w| 欧美性受xxxx黑人xyx性爽| 成人av在线播放网站| 狠狠色综合色综合网络| 琪琪久久久久日韩精品| 亚洲欧美另类在线| 中文字幕在线不卡一区二区三区| 久久久精品日韩欧美| 欧美r级在线观看| 日韩一区二区三区在线| 欧美理论在线播放| 欧洲国内综合视频| 色呦呦日韩精品| av在线一区二区| 99re在线精品| 99久久精品免费看| 99re8在线精品视频免费播放| 久久91精品久久久久久秒播| 日本不卡123| 免费在线观看不卡| 日本在线不卡一区| 免费美女久久99| 久久精品国产第一区二区三区| 日本最新不卡在线| 亚洲一区二区三区视频在线 | 亚洲欧洲色图综合| 亚洲美女在线一区| 一区二区三区精品视频| 亚洲国产毛片aaaaa无费看| 亚洲成av人片一区二区| 日韩国产精品91| 精品在线观看免费| 国产一区二区精品在线观看| 国产在线观看一区二区| 高清在线观看日韩| www.欧美日韩| 欧美亚洲图片小说| 欧美成人一区二区三区| 久久中文字幕电影| 1区2区3区国产精品| 亚洲综合色区另类av| 日本欧美韩国一区三区| 国产一区 二区 三区一级| 成人福利电影精品一区二区在线观看| 99r精品视频| 91精品国产乱| 欧美激情一区二区三区全黄| 亚洲欧美自拍偷拍| 性久久久久久久久久久久| 久久国产欧美日韩精品| av电影在线观看一区| 欧美色欧美亚洲另类二区| 日韩欧美国产一区在线观看| 国产亚洲美州欧州综合国| 国产精品传媒在线| 欧美aaaaa成人免费观看视频| 国产成人在线视频免费播放| 色综合一个色综合亚洲| 宅男噜噜噜66一区二区66| 久久综合色播五月| 亚洲综合男人的天堂| 国产精品一区三区| 欧美三电影在线| 26uuu国产日韩综合| 一区二区三区四区不卡在线| 日本v片在线高清不卡在线观看| 成人免费视频网站在线观看| 欧美精品久久99久久在免费线| 亚洲国产电影在线观看| 日本不卡视频一二三区| 91浏览器打开| 26uuu精品一区二区在线观看| 亚洲在线视频网站| 成人免费va视频| 欧美成人激情免费网| 亚洲一区av在线| 不卡一区二区中文字幕| 精品国产污污免费网站入口 | 欧美在线综合视频| 国产欧美在线观看一区| 日本不卡一区二区| 欧美自拍丝袜亚洲| 国产精品国产自产拍高清av| 国内成人精品2018免费看| 91.com在线观看| 亚洲一区二区影院| 色婷婷久久久久swag精品| 中文字幕乱码一区二区免费| 狠狠网亚洲精品| 日韩欧美国产一区二区三区| 水蜜桃久久夜色精品一区的特点 | 99精品国产一区二区三区不卡 | 欧美一区中文字幕| 亚洲午夜精品一区二区三区他趣| av电影天堂一区二区在线观看| 26uuu精品一区二区在线观看| 麻豆精品一二三| 日韩午夜精品电影| 六月丁香综合在线视频| 制服丝袜av成人在线看| 日韩精品一卡二卡三卡四卡无卡| 色系网站成人免费| 艳妇臀荡乳欲伦亚洲一区| 91国模大尺度私拍在线视频| 亚洲婷婷综合久久一本伊一区| av电影在线不卡| 夜色激情一区二区| 欧美另类高清zo欧美| 麻豆久久一区二区|