···83 more efficient. You should really be using libraw1394 for raw139484 access anyway.85Who: Jody McIntyre <scjody@steamballoon.com>0000000000
···83 more efficient. You should really be using libraw1394 for raw139484 access anyway.85Who: Jody McIntyre <scjody@steamballoon.com>86+87+---------------------------88+89+What: i2c sysfs name change: in1_ref, vid deprecated in favour of cpu0_vid90+When: November 200591+Files: drivers/i2c/chips/adm1025.c, drivers/i2c/chips/adm1026.c92+Why: Match the other drivers' name for the same function, duplicate names93+ will be available until removal of old names.94+Who: Grant Coady <gcoady@gmail.com>95+
+1-1
Documentation/i2c/busses/i2c-sis69x
···42chipsets as well: 635, and 635T. If anyone owns a board with those chips43AND is willing to risk crashing & burning an otherwise well-behaved kernel44in the name of progress... please contact me at <mhoffman@lightlink.com> or45-via the project's mailing list: <sensors@stimpy.netroedge.com>. Please46send bug reports and/or success stories as well.4748
···42chipsets as well: 635, and 635T. If anyone owns a board with those chips43AND is willing to risk crashing & burning an otherwise well-behaved kernel44in the name of progress... please contact me at <mhoffman@lightlink.com> or45+via the project's mailing list: <lm-sensors@lm-sensors.org>. Please46send bug reports and/or success stories as well.4748
···1+Kernel driver adm10212+=====================3+4+Supported chips:5+ * Analog Devices ADM10216+ Prefix: 'adm1021'7+ Addresses scanned: I2C 0x18 - 0x1a, 0x29 - 0x2b, 0x4c - 0x4e8+ Datasheet: Publicly available at the Analog Devices website9+ * Analog Devices ADM1021A/ADM102310+ Prefix: 'adm1023'11+ Addresses scanned: I2C 0x18 - 0x1a, 0x29 - 0x2b, 0x4c - 0x4e12+ Datasheet: Publicly available at the Analog Devices website13+ * Genesys Logic GL523SM14+ Prefix: 'gl523sm'15+ Addresses scanned: I2C 0x18 - 0x1a, 0x29 - 0x2b, 0x4c - 0x4e16+ Datasheet:17+ * Intel Xeon Processor18+ Prefix: - any other - may require 'force_adm1021' parameter19+ Addresses scanned: none20+ Datasheet: Publicly available at Intel website21+ * Maxim MAX161722+ Prefix: 'max1617'23+ Addresses scanned: I2C 0x18 - 0x1a, 0x29 - 0x2b, 0x4c - 0x4e24+ Datasheet: Publicly available at the Maxim website25+ * Maxim MAX1617A26+ Prefix: 'max1617a'27+ Addresses scanned: I2C 0x18 - 0x1a, 0x29 - 0x2b, 0x4c - 0x4e28+ Datasheet: Publicly available at the Maxim website29+ * National Semiconductor LM8430+ Prefix: 'lm84'31+ Addresses scanned: I2C 0x18 - 0x1a, 0x29 - 0x2b, 0x4c - 0x4e32+ Datasheet: Publicly available at the National Semiconductor website33+ * Philips NE161734+ Prefix: 'max1617' (probably detected as a max1617)35+ Addresses scanned: I2C 0x18 - 0x1a, 0x29 - 0x2b, 0x4c - 0x4e36+ Datasheet: Publicly available at the Philips website37+ * Philips NE1617A38+ Prefix: 'max1617' (probably detected as a max1617)39+ Addresses scanned: I2C 0x18 - 0x1a, 0x29 - 0x2b, 0x4c - 0x4e40+ Datasheet: Publicly available at the Philips website41+ * TI THMC1042+ Prefix: 'thmc10'43+ Addresses scanned: I2C 0x18 - 0x1a, 0x29 - 0x2b, 0x4c - 0x4e44+ Datasheet: Publicly available at the TI website45+ * Onsemi MC106646+ Prefix: 'mc1066'47+ Addresses scanned: I2C 0x18 - 0x1a, 0x29 - 0x2b, 0x4c - 0x4e48+ Datasheet: Publicly available at the Onsemi website49+50+51+Authors:52+ Frodo Looijaard <frodol@dds.nl>,53+ Philip Edelbrock <phil@netroedge.com>54+55+Module Parameters56+-----------------57+58+* read_only: int59+ Don't set any values, read only mode60+61+62+Description63+-----------64+65+The chips supported by this driver are very similar. The Maxim MAX1617 is66+the oldest; it has the problem that it is not very well detectable. The67+MAX1617A solves that. The ADM1021 is a straight clone of the MAX1617A.68+Ditto for the THMC10. From here on, we will refer to all these chips as69+ADM1021-clones.70+71+The ADM1021 and MAX1617A reports a die code, which is a sort of revision72+code. This can help us pinpoint problems; it is not very useful73+otherwise.74+75+ADM1021-clones implement two temperature sensors. One of them is internal,76+and measures the temperature of the chip itself; the other is external and77+is realised in the form of a transistor-like device. A special alarm78+indicates whether the remote sensor is connected.79+80+Each sensor has its own low and high limits. When they are crossed, the81+corresponding alarm is set and remains on as long as the temperature stays82+out of range. Temperatures are measured in degrees Celsius. Measurements83+are possible between -65 and +127 degrees, with a resolution of one degree.84+85+If an alarm triggers, it will remain triggered until the hardware register86+is read at least once. This means that the cause for the alarm may already87+have disappeared!88+89+This driver only updates its values each 1.5 seconds; reading it more often90+will do no harm, but will return 'old' values. It is possible to make91+ADM1021-clones do faster measurements, but there is really no good reason92+for that.93+94+Xeon support95+------------96+97+Some Xeon processors have real max1617, adm1021, or compatible chips98+within them, with two temperature sensors.99+100+Other Xeons have chips with only one sensor.101+102+If you have a Xeon, and the adm1021 module loads, and both temperatures103+appear valid, then things are good.104+105+If the adm1021 module doesn't load, you should try this:106+ modprobe adm1021 force_adm1021=BUS,ADDRESS107+ ADDRESS can only be 0x18, 0x1a, 0x29, 0x2b, 0x4c, or 0x4e.108+109+If you have dual Xeons you may have appear to have two separate110+adm1021-compatible chips, or two single-temperature sensors, at distinct111+addresses.
···1+Kernel driver adm10252+=====================3+4+Supported chips:5+ * Analog Devices ADM1025, ADM1025A6+ Prefix: 'adm1025'7+ Addresses scanned: I2C 0x2c - 0x2e8+ Datasheet: Publicly available at the Analog Devices website9+ * Philips NE161910+ Prefix: 'ne1619'11+ Addresses scanned: I2C 0x2c - 0x2d12+ Datasheet: Publicly available at the Philips website13+14+The NE1619 presents some differences with the original ADM1025:15+ * Only two possible addresses (0x2c - 0x2d).16+ * No temperature offset register, but we don't use it anyway.17+ * No INT mode for pin 16. We don't play with it anyway.18+19+Authors:20+ Chen-Yuan Wu <gwu@esoft.com>,21+ Jean Delvare <khali@linux-fr.org>22+23+Description24+-----------25+26+(This is from Analog Devices.) The ADM1025 is a complete system hardware27+monitor for microprocessor-based systems, providing measurement and limit28+comparison of various system parameters. Five voltage measurement inputs29+are provided, for monitoring +2.5V, +3.3V, +5V and +12V power supplies and30+the processor core voltage. The ADM1025 can monitor a sixth power-supply31+voltage by measuring its own VCC. One input (two pins) is dedicated to a32+remote temperature-sensing diode and an on-chip temperature sensor allows33+ambient temperature to be monitored.34+35+One specificity of this chip is that the pin 11 can be hardwired in two36+different manners. It can act as the +12V power-supply voltage analog37+input, or as the a fifth digital entry for the VID reading (bit 4). It's38+kind of strange since both are useful, and the reason for designing the39+chip that way is obscure at least to me. The bit 5 of the configuration40+register can be used to define how the chip is hardwired. Please note that41+it is not a choice you have to make as the user. The choice was already42+made by your motherboard's maker. If the configuration bit isn't set43+properly, you'll have a wrong +12V reading or a wrong VID reading. The way44+the driver handles that is to preserve this bit through the initialization45+process, assuming that the BIOS set it up properly beforehand. If it turns46+out not to be true in some cases, we'll provide a module parameter to force47+modes.48+49+This driver also supports the ADM1025A, which differs from the ADM102550+only in that it has "open-drain VID inputs while the ADM1025 has on-chip51+100k pull-ups on the VID inputs". It doesn't make any difference for us.
···1+Kernel driver adm10262+=====================3+4+Supported chips:5+ * Analog Devices ADM10266+ Prefix: 'adm1026'7+ Addresses scanned: I2C 0x2c, 0x2d, 0x2e8+ Datasheet: Publicly available at the Analog Devices website9+ http://www.analog.com/en/prod/0,,766_825_ADM1026,00.html10+11+Authors:12+ Philip Pokorny <ppokorny@penguincomputing.com> for Penguin Computing13+ Justin Thiessen <jthiessen@penguincomputing.com>14+15+Module Parameters16+-----------------17+18+* gpio_input: int array (min = 1, max = 17)19+ List of GPIO pins (0-16) to program as inputs20+* gpio_output: int array (min = 1, max = 17)21+ List of GPIO pins (0-16) to program as outputs22+* gpio_inverted: int array (min = 1, max = 17)23+ List of GPIO pins (0-16) to program as inverted24+* gpio_normal: int array (min = 1, max = 17)25+ List of GPIO pins (0-16) to program as normal/non-inverted26+* gpio_fan: int array (min = 1, max = 8)27+ List of GPIO pins (0-7) to program as fan tachs28+29+30+Description31+-----------32+33+This driver implements support for the Analog Devices ADM1026. Analog34+Devices calls it a "complete thermal system management controller."35+36+The ADM1026 implements three (3) temperature sensors, 17 voltage sensors,37+16 general purpose digital I/O lines, eight (8) fan speed sensors (8-bit),38+an analog output and a PWM output along with limit, alarm and mask bits for39+all of the above. There is even 8k bytes of EEPROM memory on chip.40+41+Temperatures are measured in degrees Celsius. There are two external42+sensor inputs and one internal sensor. Each sensor has a high and low43+limit. If the limit is exceeded, an interrupt (#SMBALERT) can be44+generated. The interrupts can be masked. In addition, there are over-temp45+limits for each sensor. If this limit is exceeded, the #THERM output will46+be asserted. The current temperature and limits have a resolution of 147+degree.48+49+Fan rotation speeds are reported in RPM (rotations per minute) but measured50+in counts of a 22.5kHz internal clock. Each fan has a high limit which51+corresponds to a minimum fan speed. If the limit is exceeded, an interrupt52+can be generated. Each fan can be programmed to divide the reference clock53+by 1, 2, 4 or 8. Not all RPM values can accurately be represented, so some54+rounding is done. With a divider of 8, the slowest measurable speed of a55+two pulse per revolution fan is 661 RPM.56+57+There are 17 voltage sensors. An alarm is triggered if the voltage has58+crossed a programmable minimum or maximum limit. Note that minimum in this59+case always means 'closest to zero'; this is important for negative voltage60+measurements. Several inputs have integrated attenuators so they can measure61+higher voltages directly. 3.3V, 5V, 12V, -12V and battery voltage all have62+dedicated inputs. There are several inputs scaled to 0-3V full-scale range63+for SCSI terminator power. The remaining inputs are not scaled and have64+a 0-2.5V full-scale range. A 2.5V or 1.82V reference voltage is provided65+for negative voltage measurements.66+67+If an alarm triggers, it will remain triggered until the hardware register68+is read at least once. This means that the cause for the alarm may already69+have disappeared! Note that in the current implementation, all hardware70+registers are read whenever any data is read (unless it is less than 2.071+seconds since the last update). This means that you can easily miss72+once-only alarms.73+74+The ADM1026 measures continuously. Analog inputs are measured about 475+times a second. Fan speed measurement time depends on fan speed and76+divisor. It can take as long as 1.5 seconds to measure all fan speeds.77+78+The ADM1026 has the ability to automatically control fan speed based on the79+temperature sensor inputs. Both the PWM output and the DAC output can be80+used to control fan speed. Usually only one of these two outputs will be81+used. Write the minimum PWM or DAC value to the appropriate control82+register. Then set the low temperature limit in the tmin values for each83+temperature sensor. The range of control is fixed at 20 �C, and the84+largest difference between current and tmin of the temperature sensors sets85+the control output. See the datasheet for several example circuits for86+controlling fan speed with the PWM and DAC outputs. The fan speed sensors87+do not have PWM compensation, so it is probably best to control the fan88+voltage from the power lead rather than on the ground lead.89+90+The datasheet shows an example application with VID signals attached to91+GPIO lines. Unfortunately, the chip may not be connected to the VID lines92+in this way. The driver assumes that the chips *is* connected this way to93+get a VID voltage.
+35
Documentation/i2c/chips/adm1031
···00000000000000000000000000000000000
···1+Kernel driver adm10312+=====================3+4+Supported chips:5+ * Analog Devices ADM10306+ Prefix: 'adm1030'7+ Addresses scanned: I2C 0x2c to 0x2e8+ Datasheet: Publicly available at the Analog Devices website9+ http://products.analog.com/products/info.asp?product=ADM103010+11+ * Analog Devices ADM103112+ Prefix: 'adm1031'13+ Addresses scanned: I2C 0x2c to 0x2e14+ Datasheet: Publicly available at the Analog Devices website15+ http://products.analog.com/products/info.asp?product=ADM103116+17+Authors:18+ Alexandre d'Alton <alex@alexdalton.org>19+ Jean Delvare <khali@linux-fr.org>20+21+Description22+-----------23+24+The ADM1030 and ADM1031 are digital temperature sensors and fan controllers.25+They sense their own temperature as well as the temperature of up to one26+(ADM1030) or two (ADM1031) external diodes.27+28+All temperature values are given in degrees Celsius. Resolution is 0.529+degree for the local temperature, 0.125 degree for the remote temperatures.30+31+Each temperature channel has its own high and low limits, plus a critical32+limit.33+34+The ADM1030 monitors a single fan speed, while the ADM1031 monitors up to35+two. Each fan channel has its own low speed limit.
···1+Kernel driver adm92402+=====================3+4+Supported chips:5+ * Analog Devices ADM92406+ Prefix: 'adm9240'7+ Addresses scanned: I2C 0x2c - 0x2f8+ Datasheet: Publicly available at the Analog Devices website9+ http://www.analog.com/UploadedFiles/Data_Sheets/79857778ADM9240_0.pdf10+11+ * Dallas Semiconductor DS178012+ Prefix: 'ds1780'13+ Addresses scanned: I2C 0x2c - 0x2f14+ Datasheet: Publicly available at the Dallas Semiconductor (Maxim) website15+ http://pdfserv.maxim-ic.com/en/ds/DS1780.pdf16+17+ * National Semiconductor LM8118+ Prefix: 'lm81'19+ Addresses scanned: I2C 0x2c - 0x2f20+ Datasheet: Publicly available at the National Semiconductor website21+ http://www.national.com/ds.cgi/LM/LM81.pdf22+23+Authors:24+ Frodo Looijaard <frodol@dds.nl>,25+ Philip Edelbrock <phil@netroedge.com>,26+ Michiel Rook <michiel@grendelproject.nl>,27+ Grant Coady <gcoady@gmail.com> with guidance28+ from Jean Delvare <khali@linux-fr.org>29+30+Interface31+---------32+The I2C addresses listed above assume BIOS has not changed the33+chip MSB 5-bit address. Each chip reports a unique manufacturer34+identification code as well as the chip revision/stepping level.35+36+Description37+-----------38+[From ADM9240] The ADM9240 is a complete system hardware monitor for39+microprocessor-based systems, providing measurement and limit comparison40+of up to four power supplies and two processor core voltages, plus41+temperature, two fan speeds and chassis intrusion. Measured values can42+be read out via an I2C-compatible serial System Management Bus, and values43+for limit comparisons can be programmed in over the same serial bus. The44+high speed successive approximation ADC allows frequent sampling of all45+analog channels to ensure a fast interrupt response to any out-of-limit46+measurement.47+48+The ADM9240, DS1780 and LM81 are register compatible, the following49+details are common to the three chips. Chip differences are described50+after this section.51+52+53+Measurements54+------------55+The measurement cycle56+57+The adm9240 driver will take a measurement reading no faster than once58+each two seconds. User-space may read sysfs interface faster than the59+measurement update rate and will receive cached data from the most60+recent measurement.61+62+ADM9240 has a very fast 320us temperature and voltage measurement cycle63+with independent fan speed measurement cycles counting alternating rising64+edges of the fan tacho inputs.65+66+DS1780 measurement cycle is about once per second including fan speed.67+68+LM81 measurement cycle is about once per 400ms including fan speed.69+The LM81 12-bit extended temperature measurement mode is not supported.70+71+Temperature72+-----------73+On chip temperature is reported as degrees Celsius as 9-bit signed data74+with resolution of 0.5 degrees Celsius. High and low temperature limits75+are 8-bit signed data with resolution of one degree Celsius.76+77+Temperature alarm is asserted once the temperature exceeds the high limit,78+and is cleared when the temperature falls below the temp1_max_hyst value.79+80+Fan Speed81+---------82+Two fan tacho inputs are provided, the ADM9240 gates an internal 22.5kHz83+clock via a divider to an 8-bit counter. Fan speed (rpm) is calculated by:84+85+rpm = (22500 * 60) / (count * divider)86+87+Automatic fan clock divider88+89+ * User sets 0 to fan_min limit90+ - low speed alarm is disabled91+ - fan clock divider not changed92+ - auto fan clock adjuster enabled for valid fan speed reading93+94+ * User sets fan_min limit too low95+ - low speed alarm is enabled96+ - fan clock divider set to max97+ - fan_min set to register value 254 which corresponds98+ to 664 rpm on adm924099+ - low speed alarm will be asserted if fan speed is100+ less than minimum measurable speed101+ - auto fan clock adjuster disabled102+103+ * User sets reasonable fan speed104+ - low speed alarm is enabled105+ - fan clock divider set to suit fan_min106+ - auto fan clock adjuster enabled: adjusts fan_min107+108+ * User sets unreasonably high low fan speed limit109+ - resolution of the low speed limit may be reduced110+ - alarm will be asserted111+ - auto fan clock adjuster enabled: adjusts fan_min112+113+ * fan speed may be displayed as zero until the auto fan clock divider114+ adjuster brings fan speed clock divider back into chip measurement115+ range, this will occur within a few measurement cycles.116+117+Analog Output118+-------------119+An analog output provides a 0 to 1.25 volt signal intended for an external120+fan speed amplifier circuit. The analog output is set to maximum value on121+power up or reset. This doesn't do much on the test Intel SE440BX-2.122+123+Voltage Monitor124+125+Voltage (IN) measurement is internally scaled:126+127+ nr label nominal maximum resolution128+ mV mV mV129+ 0 +2.5V 2500 3320 13.0130+ 1 Vccp1 2700 3600 14.1131+ 2 +3.3V 3300 4380 17.2132+ 3 +5V 5000 6640 26.0133+ 4 +12V 12000 15940 62.5134+ 5 Vccp2 2700 3600 14.1135+136+The reading is an unsigned 8-bit value, nominal voltage measurement is137+represented by a reading of 192, being 3/4 of the measurement range.138+139+An alarm is asserted for any voltage going below or above the set limits.140+141+The driver reports and accepts voltage limits scaled to the above table.142+143+VID Monitor144+-----------145+The chip has five inputs to read the 5-bit VID and reports the mV value146+based on detected CPU type.147+148+Chassis Intrusion149+-----------------150+An alarm is asserted when the CI pin goes active high. The ADM9240151+Datasheet has an example of an external temperature sensor driving152+this pin. On an Intel SE440BX-2 the Chassis Intrusion header is153+connected to a normally open switch.154+155+The ADM9240 provides an internal open drain on this line, and may output156+a 20 ms active low pulse to reset an external Chassis Intrusion latch.157+158+Clear the CI latch by writing value 1 to the sysfs chassis_clear file.159+160+Alarm flags reported as 16-bit word161+162+ bit label comment163+ --- ------------- --------------------------164+ 0 +2.5 V_Error high or low limit exceeded165+ 1 VCCP_Error high or low limit exceeded166+ 2 +3.3 V_Error high or low limit exceeded167+ 3 +5 V_Error high or low limit exceeded168+ 4 Temp_Error temperature error169+ 6 FAN1_Error fan low limit exceeded170+ 7 FAN2_Error fan low limit exceeded171+ 8 +12 V_Error high or low limit exceeded172+ 9 VCCP2_Error high or low limit exceeded173+ 12 Chassis_Error CI pin went high174+175+Remaining bits are reserved and thus undefined. It is important to note176+that alarm bits may be cleared on read, user-space may latch alarms and177+provide the end-user with a method to clear alarm memory.
···1+Kernel driver asb1002+====================3+4+Supported Chips:5+ * Asus ASB100 and ASB100-A "Bach"6+ Prefix: 'asb100'7+ Addresses scanned: I2C 0x2d8+ Datasheet: none released9+10+Author: Mark M. Hoffman <mhoffman@lightlink.com>11+12+Description13+-----------14+15+This driver implements support for the Asus ASB100 and ASB100-A "Bach".16+These are custom ASICs available only on Asus mainboards. Asus refuses to17+supply a datasheet for these chips. Thanks go to many people who helped18+investigate their hardware, including:19+20+Vitaly V. Bursov21+Alexander van Kaam (author of MBM for Windows)22+Bertrik Sikken23+24+The ASB100 implements seven voltage sensors, three fan rotation speed25+sensors, four temperature sensors, VID lines and alarms. In addition to26+these, the ASB100-A also implements a single PWM controller for fans 2 and27+3 (i.e. one setting controls both.) If you have a plain ASB100, the PWM28+controller will simply not work (or maybe it will for you... it doesn't for29+me).30+31+Temperatures are measured and reported in degrees Celsius.32+33+Fan speeds are reported in RPM (rotations per minute). An alarm is34+triggered if the rotation speed has dropped below a programmable limit.35+36+Voltage sensors (also known as IN sensors) report values in volts.37+38+The VID lines encode the core voltage value: the voltage level your39+processor should work with. This is hardcoded by the mainboard and/or40+processor itself. It is a value in volts.41+42+Alarms: (TODO question marks indicate may or may not work)43+44+0x0001 => in0 (?)45+0x0002 => in1 (?)46+0x0004 => in247+0x0008 => in348+0x0010 => temp1 (1)49+0x0020 => temp250+0x0040 => fan151+0x0080 => fan252+0x0100 => in453+0x0200 => in5 (?) (2)54+0x0400 => in6 (?) (2)55+0x0800 => fan356+0x1000 => chassis switch57+0x2000 => temp358+59+Alarm Notes:60+61+(1) This alarm will only trigger if the hysteresis value is 127C.62+I.e. it behaves the same as w83781d.63+64+(2) The min and max registers for these values appear to65+be read-only or otherwise stuck at 0x00.66+67+TODO:68+* Experiment with fan divisors > 8.69+* Experiment with temp. sensor types.70+* Are there really 13 voltage inputs? Probably not...71+* Cleanups, no doubt...72+
···1+Kernel driver ds16212+====================3+4+Supported chips:5+ * Dallas Semiconductor DS16216+ Prefix: 'ds1621'7+ Addresses scanned: I2C 0x48 - 0x4f8+ Datasheet: Publicly available at the Dallas Semiconductor website9+ http://www.dalsemi.com/10+ * Dallas Semiconductor DS162511+ Prefix: 'ds1621'12+ Addresses scanned: I2C 0x48 - 0x4f13+ Datasheet: Publicly available at the Dallas Semiconductor website14+ http://www.dalsemi.com/15+16+Authors:17+ Christian W. Zuckschwerdt <zany@triq.net>18+ valuable contributions by Jan M. Sendler <sendler@sendler.de>19+ ported to 2.6 by Aurelien Jarno <aurelien@aurel32.net>20+ with the help of Jean Delvare <khali@linux-fr.org>21+22+Module Parameters23+------------------24+25+* polarity int26+ Output's polarity: 0 = active high, 1 = active low27+28+Description29+-----------30+31+The DS1621 is a (one instance) digital thermometer and thermostat. It has32+both high and low temperature limits which can be user defined (i.e.33+programmed into non-volatile on-chip registers). Temperature range is -5534+degree Celsius to +125 in 0.5 increments. You may convert this into a35+Fahrenheit range of -67 to +257 degrees with 0.9 steps. If polarity36+parameter is not provided, original value is used.37+38+As for the thermostat, behavior can also be programmed using the polarity39+toggle. On the one hand ("heater"), the thermostat output of the chip,40+Tout, will trigger when the low limit temperature is met or underrun and41+stays high until the high limit is met or exceeded. On the other hand42+("cooler"), vice versa. That way "heater" equals "active low", whereas43+"conditioner" equals "active high". Please note that the DS1621 data sheet44+is somewhat misleading in this point since setting the polarity bit does45+not simply invert Tout.46+47+A second thing is that, during extensive testing, Tout showed a tolerance48+of up to +/- 0.5 degrees even when compared against precise temperature49+readings. Be sure to have a high vs. low temperature limit gap of al least50+1.0 degree Celsius to avoid Tout "bouncing", though!51+52+As for alarms, you can read the alarm status of the DS1621 via the 'alarms'53+/sys file interface. The result consists mainly of bit 6 and 5 of the54+configuration register of the chip; bit 6 (0x40 or 64) is the high alarm55+bit and bit 5 (0x20 or 32) the low one. These bits are set when the high or56+low limits are met or exceeded and are reset by the module as soon as the57+respective temperature ranges are left.58+59+The alarm registers are in no way suitable to find out about the actual60+status of Tout. They will only tell you about its history, whether or not61+any of the limits have ever been met or exceeded since last power-up or62+reset. Be aware: When testing, it showed that the status of Tout can change63+with neither of the alarms set.64+65+Temperature conversion of the DS1621 takes up to 1000ms; internal access to66+non-volatile registers may last for 10ms or below.67+68+High Accuracy Temperature Reading69+---------------------------------70+71+As said before, the temperature issued via the 9-bit i2c-bus data is72+somewhat arbitrary. Internally, the temperature conversion is of a73+different kind that is explained (not so...) well in the DS1621 data sheet.74+To cut the long story short: Inside the DS1621 there are two oscillators,75+both of them biassed by a temperature coefficient.76+77+Higher resolution of the temperature reading can be achieved using the78+internal projection, which means taking account of REG_COUNT and REG_SLOPE79+(the driver manages them):80+81+Taken from Dallas Semiconductors App Note 068: 'Increasing Temperature82+Resolution on the DS1620' and App Note 105: 'High Resolution Temperature83+Measurement with Dallas Direct-to-Digital Temperature Sensors'84+85+- Read the 9-bit temperature and strip the LSB (Truncate the .5 degs)86+- The resulting value is TEMP_READ.87+- Then, read REG_COUNT.88+- And then, REG_SLOPE.89+90+ TEMP = TEMP_READ - 0.25 + ((REG_SLOPE - REG_COUNT) / REG_SLOPE)91+92+Note that this is what the DONE bit in the DS1621 configuration register is93+good for: Internally, one temperature conversion takes up to 1000ms. Before94+that conversion is complete you will not be able to read valid things out95+of REG_COUNT and REG_SLOPE. The DONE bit, as you may have guessed by now,96+tells you whether the conversion is complete ("done", in plain English) and97+thus, whether the values you read are good or not.98+99+The DS1621 has two modes of operation: "Continuous" conversion, which can100+be understood as the default stand-alone mode where the chip gets the101+temperature and controls external devices via its Tout pin or tells other102+i2c's about it if they care. The other mode is called "1SHOT", that means103+that it only figures out about the temperature when it is explicitly told104+to do so; this can be seen as power saving mode.105+106+Now if you want to read REG_COUNT and REG_SLOPE, you have to either stop107+the continuous conversions until the contents of these registers are valid,108+or, in 1SHOT mode, you have to have one conversion made.
···1+Kernel driver eeprom2+====================3+4+Supported chips:5+ * Any EEPROM chip in the designated address range6+ Prefix: 'eeprom'7+ Addresses scanned: I2C 0x50 - 0x578+ Datasheets: Publicly available from:9+ Atmel (www.atmel.com),10+ Catalyst (www.catsemi.com),11+ Fairchild (www.fairchildsemi.com),12+ Microchip (www.microchip.com),13+ Philips (www.semiconductor.philips.com),14+ Rohm (www.rohm.com),15+ ST (www.st.com),16+ Xicor (www.xicor.com),17+ and others.18+19+ Chip Size (bits) Address20+ 24C01 1K 0x50 (shadows at 0x51 - 0x57)21+ 24C01A 1K 0x50 - 0x57 (Typical device on DIMMs)22+ 24C02 2K 0x50 - 0x5723+ 24C04 4K 0x50, 0x52, 0x54, 0x5624+ (additional data at 0x51, 0x53, 0x55, 0x57)25+ 24C08 8K 0x50, 0x54 (additional data at 0x51, 0x52,26+ 0x53, 0x55, 0x56, 0x57)27+ 24C16 16K 0x50 (additional data at 0x51 - 0x57)28+ Sony 2K 0x5729+30+ Atmel 34C02B 2K 0x50 - 0x57, SW write protect at 0x30-3731+ Catalyst 34FC02 2K 0x50 - 0x57, SW write protect at 0x30-3732+ Catalyst 34RC02 2K 0x50 - 0x57, SW write protect at 0x30-3733+ Fairchild 34W02 2K 0x50 - 0x57, SW write protect at 0x30-3734+ Microchip 24AA52 2K 0x50 - 0x57, SW write protect at 0x30-3735+ ST M34C02 2K 0x50 - 0x57, SW write protect at 0x30-3736+37+38+Authors:39+ Frodo Looijaard <frodol@dds.nl>,40+ Philip Edelbrock <phil@netroedge.com>,41+ Jean Delvare <khali@linux-fr.org>,42+ Greg Kroah-Hartman <greg@kroah.com>,43+ IBM Corp.44+45+Description46+-----------47+48+This is a simple EEPROM module meant to enable reading the first 256 bytes49+of an EEPROM (on a SDRAM DIMM for example). However, it will access serial50+EEPROMs on any I2C adapter. The supported devices are generically called51+24Cxx, and are listed above; however the numbering for these52+industry-standard devices may vary by manufacturer.53+54+This module was a programming exercise to get used to the new project55+organization laid out by Frodo, but it should be at least completely56+effective for decoding the contents of EEPROMs on DIMMs.57+58+DIMMS will typically contain a 24C01A or 24C02, or the 34C02 variants.59+The other devices will not be found on a DIMM because they respond to more60+than one address.61+62+DDC Monitors may contain any device. Often a 24C01, which responds to all 863+addresses, is found.64+65+Recent Sony Vaio laptops have an EEPROM at 0x57. We couldn't get the66+specification, so it is guess work and far from being complete.67+68+The Microchip 24AA52/24LCS52, ST M34C02, and others support an additional69+software write protect register at 0x30 - 0x37 (0x20 less than the memory70+location). The chip responds to "write quick" detection at this address but71+does not respond to byte reads. If this register is present, the lower 12872+bytes of the memory array are not write protected. Any byte data write to73+this address will write protect the memory array permanently, and the74+device will no longer respond at the 0x30-37 address. The eeprom driver75+does not support this register.76+77+Lacking functionality:78+79+* Full support for larger devices (24C04, 24C08, 24C16). These are not80+typically found on a PC. These devices will appear as separate devices at81+multiple addresses.82+83+* Support for really large devices (24C32, 24C64, 24C128, 24C256, 24C512).84+These devices require two-byte address fields and are not supported.85+86+* Enable Writing. Again, no technical reason why not, but making it easy87+to change the contents of the EEPROMs (on DIMMs anyway) also makes it easy88+to disable the DIMMs (potentially preventing the computer from booting)89+until the values are restored somehow.90+91+Use:92+93+After inserting the module (and any other required SMBus/i2c modules), you94+should have some EEPROM directories in /sys/bus/i2c/devices/* of names such95+as "0-0050". Inside each of these is a series of files, the eeprom file96+contains the binary data from EEPROM.
···1+Kernel driver fscher2+====================3+4+Supported chips:5+ * Fujitsu-Siemens Hermes chip6+ Prefix: 'fscher'7+ Addresses scanned: I2C 0x738+9+Authors:10+ Reinhard Nissl <rnissl@gmx.de> based on work11+ from Hermann Jung <hej@odn.de>,12+ Frodo Looijaard <frodol@dds.nl>,13+ Philip Edelbrock <phil@netroedge.com>14+15+Description16+-----------17+18+This driver implements support for the Fujitsu-Siemens Hermes chip. It is19+described in the 'Register Set Specification BMC Hermes based Systemboard'20+from Fujitsu-Siemens.21+22+The Hermes chip implements a hardware-based system management, e.g. for23+controlling fan speed and core voltage. There is also a watchdog counter on24+the chip which can trigger an alarm and even shut the system down.25+26+The chip provides three temperature values (CPU, motherboard and27+auxiliary), three voltage values (+12V, +5V and battery) and three fans28+(power supply, CPU and auxiliary).29+30+Temperatures are measured in degrees Celsius. The resolution is 1 degree.31+32+Fan rotation speeds are reported in RPM (rotations per minute). The value33+can be divided by a programmable divider (1, 2 or 4) which is stored on34+the chip.35+36+Voltage sensors (also known as "in" sensors) report their values in volts.37+38+All values are reported as final values from the driver. There is no need39+for further calculations.40+41+42+Detailed description43+--------------------44+45+Below you'll find a single line description of all the bit values. With46+this information, you're able to decode e. g. alarms, wdog, etc. To make47+use of the watchdog, you'll need to set the watchdog time and enable the48+watchdog. After that it is necessary to restart the watchdog time within49+the specified period of time, or a system reset will occur.50+51+* revision52+ READING & 0xff = 0x??: HERMES revision identification53+54+* alarms55+ READING & 0x80 = 0x80: CPU throttling active56+ READING & 0x80 = 0x00: CPU running at full speed57+58+ READING & 0x10 = 0x10: software event (see control:1)59+ READING & 0x10 = 0x00: no software event60+61+ READING & 0x08 = 0x08: watchdog event (see wdog:2)62+ READING & 0x08 = 0x00: no watchdog event63+64+ READING & 0x02 = 0x02: thermal event (see temp*:1)65+ READING & 0x02 = 0x00: no thermal event66+67+ READING & 0x01 = 0x01: fan event (see fan*:1)68+ READING & 0x01 = 0x00: no fan event69+70+ READING & 0x13 ! 0x00: ALERT LED is flashing71+72+* control73+ READING & 0x01 = 0x01: software event74+ READING & 0x01 = 0x00: no software event75+76+ WRITING & 0x01 = 0x01: set software event77+ WRITING & 0x01 = 0x00: clear software event78+79+* watchdog_control80+ READING & 0x80 = 0x80: power off on watchdog event while thermal event81+ READING & 0x80 = 0x00: watchdog power off disabled (just system reset enabled)82+83+ READING & 0x40 = 0x40: watchdog timebase 60 seconds (see also wdog:1)84+ READING & 0x40 = 0x00: watchdog timebase 2 seconds85+86+ READING & 0x10 = 0x10: watchdog enabled87+ READING & 0x10 = 0x00: watchdog disabled88+89+ WRITING & 0x80 = 0x80: enable "power off on watchdog event while thermal event"90+ WRITING & 0x80 = 0x00: disable "power off on watchdog event while thermal event"91+92+ WRITING & 0x40 = 0x40: set watchdog timebase to 60 seconds93+ WRITING & 0x40 = 0x00: set watchdog timebase to 2 seconds94+95+ WRITING & 0x20 = 0x20: disable watchdog96+97+ WRITING & 0x10 = 0x10: enable watchdog / restart watchdog time98+99+* watchdog_state100+ READING & 0x02 = 0x02: watchdog system reset occurred101+ READING & 0x02 = 0x00: no watchdog system reset occurred102+103+ WRITING & 0x02 = 0x02: clear watchdog event104+105+* watchdog_preset106+ READING & 0xff = 0x??: configured watch dog time in units (see wdog:3 0x40)107+108+ WRITING & 0xff = 0x??: configure watch dog time in units109+110+* in* (0: +5V, 1: +12V, 2: onboard 3V battery)111+ READING: actual voltage value112+113+* temp*_status (1: CPU sensor, 2: onboard sensor, 3: auxiliary sensor)114+ READING & 0x02 = 0x02: thermal event (overtemperature)115+ READING & 0x02 = 0x00: no thermal event116+117+ READING & 0x01 = 0x01: sensor is working118+ READING & 0x01 = 0x00: sensor is faulty119+120+ WRITING & 0x02 = 0x02: clear thermal event121+122+* temp*_input (1: CPU sensor, 2: onboard sensor, 3: auxiliary sensor)123+ READING: actual temperature value124+125+* fan*_status (1: power supply fan, 2: CPU fan, 3: auxiliary fan)126+ READING & 0x04 = 0x04: fan event (fan fault)127+ READING & 0x04 = 0x00: no fan event128+129+ WRITING & 0x04 = 0x04: clear fan event130+131+* fan*_div (1: power supply fan, 2: CPU fan, 3: auxiliary fan)132+ Divisors 2,4 and 8 are supported, both for reading and writing133+134+* fan*_pwm (1: power supply fan, 2: CPU fan, 3: auxiliary fan)135+ READING & 0xff = 0x00: fan may be switched off136+ READING & 0xff = 0x01: fan must run at least at minimum speed (supply: 6V)137+ READING & 0xff = 0xff: fan must run at maximum speed (supply: 12V)138+ READING & 0xff = 0x??: fan must run at least at given speed (supply: 6V..12V)139+140+ WRITING & 0xff = 0x00: fan may be switched off141+ WRITING & 0xff = 0x01: fan must run at least at minimum speed (supply: 6V)142+ WRITING & 0xff = 0xff: fan must run at maximum speed (supply: 12V)143+ WRITING & 0xff = 0x??: fan must run at least at given speed (supply: 6V..12V)144+145+* fan*_input (1: power supply fan, 2: CPU fan, 3: auxiliary fan)146+ READING: actual RPM value147+148+149+Limitations150+-----------151+152+* Measuring fan speed153+It seems that the chip counts "ripples" (typical fans produce 2 ripples per154+rotation while VERAX fans produce 18) in a 9-bit register. This register is155+read out every second, then the ripple prescaler (2, 4 or 8) is applied and156+the result is stored in the 8 bit output register. Due to the limitation of157+the counting register to 9 bits, it is impossible to measure a VERAX fan158+properly (even with a prescaler of 8). At its maximum speed of 3500 RPM the159+fan produces 1080 ripples per second which causes the counting register to160+overflow twice, leading to only 186 RPM.161+162+* Measuring input voltages163+in2 ("battery") reports the voltage of the onboard lithium battery and not164++3.3V from the power supply.165+166+* Undocumented features167+Fujitsu-Siemens Computers has not documented all features of the chip so168+far. Their software, System Guard, shows that there are a still some169+features which cannot be controlled by this implementation.
···1+Kernel driver gl518sm2+=====================3+4+Supported chips:5+ * Genesys Logic GL518SM release 0x006+ Prefix: 'gl518sm'7+ Addresses scanned: I2C 0x2c and 0x2d8+ Datasheet: http://www.genesyslogic.com/pdf9+ * Genesys Logic GL518SM release 0x8010+ Prefix: 'gl518sm'11+ Addresses scanned: I2C 0x2c and 0x2d12+ Datasheet: http://www.genesyslogic.com/pdf13+14+Authors:15+ Frodo Looijaard <frodol@dds.nl>,16+ Ky�sti M�lkki <kmalkki@cc.hut.fi>17+ Hong-Gunn Chew <hglinux@gunnet.org>18+ Jean Delvare <khali@linux-fr.org>19+20+Description21+-----------22+23+IMPORTANT:24+25+For the revision 0x00 chip, the in0, in1, and in2 values (+5V, +3V,26+and +12V) CANNOT be read. This is a limitation of the chip, not the driver.27+28+This driver supports the Genesys Logic GL518SM chip. There are at least29+two revision of this chip, which we call revision 0x00 and 0x80. Revision30+0x80 chips support the reading of all voltages and revision 0x00 only31+for VIN3.32+33+The GL518SM implements one temperature sensor, two fan rotation speed34+sensors, and four voltage sensors. It can report alarms through the35+computer speakers.36+37+Temperatures are measured in degrees Celsius. An alarm goes off while the38+temperature is above the over temperature limit, and has not yet dropped39+below the hysteresis limit. The alarm always reflects the current40+situation. Measurements are guaranteed between -10 degrees and +11041+degrees, with a accuracy of +/-3 degrees.42+43+Rotation speeds are reported in RPM (rotations per minute). An alarm is44+triggered if the rotation speed has dropped below a programmable limit. In45+case when you have selected to turn fan1 off, no fan1 alarm is triggered.46+47+Fan readings can be divided by a programmable divider (1, 2, 4 or 8) to48+give the readings more range or accuracy. Not all RPM values can49+accurately be represented, so some rounding is done. With a divider50+of 2, the lowest representable value is around 1900 RPM.51+52+Voltage sensors (also known as VIN sensors) report their values in volts.53+An alarm is triggered if the voltage has crossed a programmable minimum or54+maximum limit. Note that minimum in this case always means 'closest to55+zero'; this is important for negative voltage measurements. The VDD input56+measures voltages between 0.000 and 5.865 volt, with a resolution of 0.02357+volt. The other inputs measure voltages between 0.000 and 4.845 volt, with58+a resolution of 0.019 volt. Note that revision 0x00 chips do not support59+reading the current voltage of any input except for VIN3; limit setting and60+alarms work fine, though.61+62+When an alarm is triggered, you can be warned by a beeping signal through your63+computer speaker. It is possible to enable all beeping globally, or only the64+beeping for some alarms.65+66+If an alarm triggers, it will remain triggered until the hardware register67+is read at least once (except for temperature alarms). This means that the68+cause for the alarm may already have disappeared! Note that in the current69+implementation, all hardware registers are read whenever any data is read70+(unless it is less than 1.5 seconds since the last update). This means that71+you can easily miss once-only alarms.72+73+The GL518SM only updates its values each 1.5 seconds; reading it more often74+will do no harm, but will return 'old' values.
···1+Kernel driver it872+==================3+4+Supported chips:5+ * IT8705F6+ Prefix: 'it87'7+ Addresses scanned: from Super I/O config space, or default ISA 0x290 (8 I/O ports)8+ Datasheet: Publicly available at the ITE website9+ http://www.ite.com.tw/10+ * IT8712F11+ Prefix: 'it8712'12+ Addresses scanned: I2C 0x28 - 0x2f13+ from Super I/O config space, or default ISA 0x290 (8 I/O ports)14+ Datasheet: Publicly available at the ITE website15+ http://www.ite.com.tw/16+ * SiS950 [clone of IT8705F]17+ Prefix: 'sis950'18+ Addresses scanned: from Super I/O config space, or default ISA 0x290 (8 I/O ports)19+ Datasheet: No longer be available20+21+Author: Christophe Gauthron <chrisg@0-in.com>22+23+24+Module Parameters25+-----------------26+27+* update_vbat: int28+29+ 0 if vbat should report power on value, 1 if vbat should be updated after30+ each read. Default is 0. On some boards the battery voltage is provided31+ by either the battery or the onboard power supply. Only the first reading32+ at power on will be the actual battery voltage (which the chip does33+ automatically). On other boards the battery voltage is always fed to34+ the chip so can be read at any time. Excessive reading may decrease35+ battery life but no information is given in the datasheet.36+37+* fix_pwm_polarity int38+39+ Force PWM polarity to active high (DANGEROUS). Some chips are40+ misconfigured by BIOS - PWM values would be inverted. This option tries41+ to fix this. Please contact your BIOS manufacturer and ask him for fix.42+43+Description44+-----------45+46+This driver implements support for the IT8705F, IT8712F and SiS950 chips.47+48+This driver also supports IT8712F, which adds SMBus access, and a VID49+input, used to report the Vcore voltage of the Pentium processor.50+The IT8712F additionally features VID inputs.51+52+These chips are 'Super I/O chips', supporting floppy disks, infrared ports,53+joysticks and other miscellaneous stuff. For hardware monitoring, they54+include an 'environment controller' with 3 temperature sensors, 3 fan55+rotation speed sensors, 8 voltage sensors, and associated alarms.56+57+Temperatures are measured in degrees Celsius. An alarm is triggered once58+when the Overtemperature Shutdown limit is crossed.59+60+Fan rotation speeds are reported in RPM (rotations per minute). An alarm is61+triggered if the rotation speed has dropped below a programmable limit. Fan62+readings can be divided by a programmable divider (1, 2, 4 or 8) to give the63+readings more range or accuracy. Not all RPM values can accurately be64+represented, so some rounding is done. With a divider of 2, the lowest65+representable value is around 2600 RPM.66+67+Voltage sensors (also known as IN sensors) report their values in volts. An68+alarm is triggered if the voltage has crossed a programmable minimum or69+maximum limit. Note that minimum in this case always means 'closest to70+zero'; this is important for negative voltage measurements. All voltage71+inputs can measure voltages between 0 and 4.08 volts, with a resolution of72+0.016 volt. The battery voltage in8 does not have limit registers.73+74+The VID lines (IT8712F only) encode the core voltage value: the voltage75+level your processor should work with. This is hardcoded by the mainboard76+and/or processor itself. It is a value in volts.77+78+If an alarm triggers, it will remain triggered until the hardware register79+is read at least once. This means that the cause for the alarm may already80+have disappeared! Note that in the current implementation, all hardware81+registers are read whenever any data is read (unless it is less than 1.582+seconds since the last update). This means that you can easily miss83+once-only alarms.84+85+The IT87xx only updates its values each 1.5 seconds; reading it more often86+will do no harm, but will return 'old' values.87+88+To change sensor N to a thermistor, 'echo 2 > tempN_type' where N is 1, 2,89+or 3. To change sensor N to a thermal diode, 'echo 3 > tempN_type'.90+Give 0 for unused sensor. Any other value is invalid. To configure this at91+startup, consult lm_sensors's /etc/sensors.conf. (2 = thermistor;92+3 = thermal diode)93+94+The fan speed control features are limited to manual PWM mode. Automatic95+"Smart Guardian" mode control handling is not implemented. However96+if you want to go for "manual mode" just write 1 to pwmN_enable.
···1+Kernel driver lm632+==================3+4+Supported chips:5+ * National Semiconductor LM636+ Prefix: 'lm63'7+ Addresses scanned: I2C 0x4c8+ Datasheet: Publicly available at the National Semiconductor website9+ http://www.national.com/pf/LM/LM63.html10+11+Author: Jean Delvare <khali@linux-fr.org>12+13+Thanks go to Tyan and especially Alex Buckingham for setting up a remote14+access to their S4882 test platform for this driver.15+ http://www.tyan.com/16+17+Description18+-----------19+20+The LM63 is a digital temperature sensor with integrated fan monitoring21+and control.22+23+The LM63 is basically an LM86 with fan speed monitoring and control24+capabilities added. It misses some of the LM86 features though:25+ - No low limit for local temperature.26+ - No critical limit for local temperature.27+ - Critical limit for remote temperature can be changed only once. We28+ will consider that the critical limit is read-only.29+30+The datasheet isn't very clear about what the tachometer reading is.31+32+An explanation from National Semiconductor: The two lower bits of the read33+value have to be masked out. The value is still 16 bit in width.34+35+All temperature values are given in degrees Celsius. Resolution is 1.036+degree for the local temperature, 0.125 degree for the remote temperature.37+38+The fan speed is measured using a tachometer. Contrary to most chips which39+store the value in an 8-bit register and have a selectable clock divider40+to make sure that the result will fit in the register, the LM63 uses 16-bit41+value for measuring the speed of the fan. It can measure fan speeds down to42+83 RPM, at least in theory.43+44+Note that the pin used for fan monitoring is shared with an alert out45+function. Depending on how the board designer wanted to use the chip, fan46+speed monitoring will or will not be possible. The proper chip configuration47+is left to the BIOS, and the driver will blindly trust it.48+49+A PWM output can be used to control the speed of the fan. The LM63 has two50+PWM modes: manual and automatic. Automatic mode is not fully implemented yet51+(you cannot define your custom PWM/temperature curve), and mode change isn't52+supported either.53+54+The lm63 driver will not update its values more frequently than every55+second; reading them more often will do no harm, but will return 'old'56+values.57+
···1+Kernel driver lm752+==================3+4+Supported chips:5+ * National Semiconductor LM756+ Prefix: 'lm75'7+ Addresses scanned: I2C 0x48 - 0x4f8+ Datasheet: Publicly available at the National Semiconductor website9+ http://www.national.com/10+ * Dallas Semiconductor DS7511+ Prefix: 'lm75'12+ Addresses scanned: I2C 0x48 - 0x4f13+ Datasheet: Publicly available at the Dallas Semiconductor website14+ http://www.maxim-ic.com/15+ * Dallas Semiconductor DS177516+ Prefix: 'lm75'17+ Addresses scanned: I2C 0x48 - 0x4f18+ Datasheet: Publicly available at the Dallas Semiconductor website19+ http://www.maxim-ic.com/20+ * Maxim MAX6625, MAX662621+ Prefix: 'lm75'22+ Addresses scanned: I2C 0x48 - 0x4b23+ Datasheet: Publicly available at the Maxim website24+ http://www.maxim-ic.com/25+ * Microchip (TelCom) TCN7526+ Prefix: 'lm75'27+ Addresses scanned: I2C 0x48 - 0x4f28+ Datasheet: Publicly available at the Microchip website29+ http://www.microchip.com/30+31+Author: Frodo Looijaard <frodol@dds.nl>32+33+Description34+-----------35+36+The LM75 implements one temperature sensor. Limits can be set through the37+Overtemperature Shutdown register and Hysteresis register. Each value can be38+set and read to half-degree accuracy.39+An alarm is issued (usually to a connected LM78) when the temperature40+gets higher then the Overtemperature Shutdown value; it stays on until41+the temperature falls below the Hysteresis value.42+All temperatures are in degrees Celsius, and are guaranteed within a43+range of -55 to +125 degrees.44+45+The LM75 only updates its values each 1.5 seconds; reading it more often46+will do no harm, but will return 'old' values.47+48+The LM75 is usually used in combination with LM78-like chips, to measure49+the temperature of the processor(s).50+51+The DS75, DS1775, MAX6625, and MAX6626 are supported as well.52+They are not distinguished from an LM75. While most of these chips53+have three additional bits of accuracy (12 vs. 9 for the LM75),54+the additional bits are not supported. Not only that, but these chips will55+not be detected if not in 9-bit precision mode (use the force parameter if56+needed).57+58+The TCN75 is supported as well, and is not distinguished from an LM75.59+60+The LM75 is essentially an industry standard; there may be other61+LM75 clones not listed here, with or without various enhancements,62+that are supported.63+64+The LM77 is not supported, contrary to what we pretended for a long time.65+Both chips are simply not compatible, value encoding differs.
+22
Documentation/i2c/chips/lm77
···0000000000000000000000
···1+Kernel driver lm772+==================3+4+Supported chips:5+ * National Semiconductor LM776+ Prefix: 'lm77'7+ Addresses scanned: I2C 0x48 - 0x4b8+ Datasheet: Publicly available at the National Semiconductor website9+ http://www.national.com/10+11+Author: Andras BALI <drewie@freemail.hu>12+13+Description14+-----------15+16+The LM77 implements one temperature sensor. The temperature17+sensor incorporates a band-gap type temperature sensor,18+10-bit ADC, and a digital comparator with user-programmable upper19+and lower limit values.20+21+Limits can be set through the Overtemperature Shutdown register and22+Hysteresis register.
···1+Kernel driver lm782+==================3+4+Supported chips:5+ * National Semiconductor LM786+ Prefix: 'lm78'7+ Addresses scanned: I2C 0x20 - 0x2f, ISA 0x290 (8 I/O ports)8+ Datasheet: Publicly available at the National Semiconductor website9+ http://www.national.com/10+ * National Semiconductor LM78-J11+ Prefix: 'lm78-j'12+ Addresses scanned: I2C 0x20 - 0x2f, ISA 0x290 (8 I/O ports)13+ Datasheet: Publicly available at the National Semiconductor website14+ http://www.national.com/15+ * National Semiconductor LM7916+ Prefix: 'lm79'17+ Addresses scanned: I2C 0x20 - 0x2f, ISA 0x290 (8 I/O ports)18+ Datasheet: Publicly available at the National Semiconductor website19+ http://www.national.com/20+21+Author: Frodo Looijaard <frodol@dds.nl>22+23+Description24+-----------25+26+This driver implements support for the National Semiconductor LM78, LM78-J27+and LM79. They are described as 'Microprocessor System Hardware Monitors'.28+29+There is almost no difference between the three supported chips. Functionally,30+the LM78 and LM78-J are exactly identical. The LM79 has one more VID line,31+which is used to report the lower voltages newer Pentium processors use.32+From here on, LM7* means either of these three types.33+34+The LM7* implements one temperature sensor, three fan rotation speed sensors,35+seven voltage sensors, VID lines, alarms, and some miscellaneous stuff.36+37+Temperatures are measured in degrees Celsius. An alarm is triggered once38+when the Overtemperature Shutdown limit is crossed; it is triggered again39+as soon as it drops below the Hysteresis value. A more useful behavior40+can be found by setting the Hysteresis value to +127 degrees Celsius; in41+this case, alarms are issued during all the time when the actual temperature42+is above the Overtemperature Shutdown value. Measurements are guaranteed43+between -55 and +125 degrees, with a resolution of 1 degree.44+45+Fan rotation speeds are reported in RPM (rotations per minute). An alarm is46+triggered if the rotation speed has dropped below a programmable limit. Fan47+readings can be divided by a programmable divider (1, 2, 4 or 8) to give48+the readings more range or accuracy. Not all RPM values can accurately be49+represented, so some rounding is done. With a divider of 2, the lowest50+representable value is around 2600 RPM.51+52+Voltage sensors (also known as IN sensors) report their values in volts.53+An alarm is triggered if the voltage has crossed a programmable minimum54+or maximum limit. Note that minimum in this case always means 'closest to55+zero'; this is important for negative voltage measurements. All voltage56+inputs can measure voltages between 0 and 4.08 volts, with a resolution57+of 0.016 volt.58+59+The VID lines encode the core voltage value: the voltage level your processor60+should work with. This is hardcoded by the mainboard and/or processor itself.61+It is a value in volts. When it is unconnected, you will often find the62+value 3.50 V here.63+64+In addition to the alarms described above, there are a couple of additional65+ones. There is a BTI alarm, which gets triggered when an external chip has66+crossed its limits. Usually, this is connected to all LM75 chips; if at67+least one crosses its limits, this bit gets set. The CHAS alarm triggers68+if your computer case is open. The FIFO alarms should never trigger; it69+indicates an internal error. The SMI_IN alarm indicates some other chip70+has triggered an SMI interrupt. As we do not use SMI interrupts at all,71+this condition usually indicates there is a problem with some other72+device.73+74+If an alarm triggers, it will remain triggered until the hardware register75+is read at least once. This means that the cause for the alarm may76+already have disappeared! Note that in the current implementation, all77+hardware registers are read whenever any data is read (unless it is less78+than 1.5 seconds since the last update). This means that you can easily79+miss once-only alarms.80+81+The LM7* only updates its values each 1.5 seconds; reading it more often82+will do no harm, but will return 'old' values.
···1+Kernel driver lm802+==================3+4+Supported chips:5+ * National Semiconductor LM806+ Prefix: 'lm80'7+ Addresses scanned: I2C 0x28 - 0x2f8+ Datasheet: Publicly available at the National Semiconductor website9+ http://www.national.com/10+11+Authors:12+ Frodo Looijaard <frodol@dds.nl>,13+ Philip Edelbrock <phil@netroedge.com>14+15+Description16+-----------17+18+This driver implements support for the National Semiconductor LM80.19+It is described as a 'Serial Interface ACPI-Compatible Microprocessor20+System Hardware Monitor'.21+22+The LM80 implements one temperature sensor, two fan rotation speed sensors,23+seven voltage sensors, alarms, and some miscellaneous stuff.24+25+Temperatures are measured in degrees Celsius. There are two sets of limits26+which operate independently. When the HOT Temperature Limit is crossed,27+this will cause an alarm that will be reasserted until the temperature28+drops below the HOT Hysteresis. The Overtemperature Shutdown (OS) limits29+should work in the same way (but this must be checked; the datasheet30+is unclear about this). Measurements are guaranteed between -55 and31++125 degrees. The current temperature measurement has a resolution of32+0.0625 degrees; the limits have a resolution of 1 degree.33+34+Fan rotation speeds are reported in RPM (rotations per minute). An alarm is35+triggered if the rotation speed has dropped below a programmable limit. Fan36+readings can be divided by a programmable divider (1, 2, 4 or 8) to give37+the readings more range or accuracy. Not all RPM values can accurately be38+represented, so some rounding is done. With a divider of 2, the lowest39+representable value is around 2600 RPM.40+41+Voltage sensors (also known as IN sensors) report their values in volts.42+An alarm is triggered if the voltage has crossed a programmable minimum43+or maximum limit. Note that minimum in this case always means 'closest to44+zero'; this is important for negative voltage measurements. All voltage45+inputs can measure voltages between 0 and 2.55 volts, with a resolution46+of 0.01 volt.47+48+If an alarm triggers, it will remain triggered until the hardware register49+is read at least once. This means that the cause for the alarm may50+already have disappeared! Note that in the current implementation, all51+hardware registers are read whenever any data is read (unless it is less52+than 2.0 seconds since the last update). This means that you can easily53+miss once-only alarms.54+55+The LM80 only updates its values each 1.5 seconds; reading it more often56+will do no harm, but will return 'old' values.
···1+Kernel driver lm832+==================3+4+Supported chips:5+ * National Semiconductor LM836+ Prefix: 'lm83'7+ Addresses scanned: I2C 0x18 - 0x1a, 0x29 - 0x2b, 0x4c - 0x4e8+ Datasheet: Publicly available at the National Semiconductor website9+ http://www.national.com/pf/LM/LM83.html10+11+12+Author: Jean Delvare <khali@linux-fr.org>13+14+Description15+-----------16+17+The LM83 is a digital temperature sensor. It senses its own temperature as18+well as the temperature of up to three external diodes. It is compatible19+with many other devices such as the LM84 and all other ADM1021 clones.20+The main difference between the LM83 and the LM84 in that the later can21+only sense the temperature of one external diode.22+23+Using the adm1021 driver for a LM83 should work, but only two temperatures24+will be reported instead of four.25+26+The LM83 is only found on a handful of motherboards. Both a confirmed27+list and an unconfirmed list follow. If you can confirm or infirm the28+fact that any of these motherboards do actually have an LM83, please29+contact us. Note that the LM90 can easily be misdetected as a LM83.30+31+Confirmed motherboards:32+ SBS P01433+34+Unconfirmed motherboards:35+ Gigabyte GA-8IK110036+ Iwill MPX237+ Soltek SL-75DRV538+39+The driver has been successfully tested by Magnus Forsstr�m, who I'd40+like to thank here. More testers will be of course welcome.41+42+The fact that the LM83 is only scarcely used can be easily explained.43+Most motherboards come with more than just temperature sensors for44+health monitoring. They also have voltage and fan rotation speed45+sensors. This means that temperature-only chips are usually used as46+secondary chips coupled with another chip such as an IT8705F or similar47+chip, which provides more features. Since systems usually need three48+temperature sensors (motherboard, processor, power supply) and primary49+chips provide some temperature sensors, the secondary chip, if needed,50+won't have to handle more than two temperatures. Thus, ADM1021 clones51+are sufficient, and there is no need for a four temperatures sensor52+chip such as the LM83. The only case where using an LM83 would make53+sense is on SMP systems, such as the above-mentioned Iwill MPX2,54+because you want an additional temperature sensor for each additional55+CPU.56+57+On the SBS P014, this is different, since the LM83 is the only hardware58+monitoring chipset. One temperature sensor is used for the motherboard59+(actually measuring the LM83's own temperature), one is used for the60+CPU. The two other sensors must be used to measure the temperature of61+two other points of the motherboard. We suspect these points to be the62+north and south bridges, but this couldn't be confirmed.63+64+All temperature values are given in degrees Celsius. Local temperature65+is given within a range of 0 to +85 degrees. Remote temperatures are66+given within a range of 0 to +125 degrees. Resolution is 1.0 degree,67+accuracy is guaranteed to 3.0 degrees (see the datasheet for more68+details).69+70+Each sensor has its own high limit, but the critical limit is common to71+all four sensors. There is no hysteresis mechanism as found on most72+recent temperature sensors.73+74+The lm83 driver will not update its values more frequently than every75+other second; reading them more often will do no harm, but will return76+'old' values.
···1+Kernel driver lm852+==================3+4+Supported chips:5+ * National Semiconductor LM85 (B and C versions)6+ Prefix: 'lm85'7+ Addresses scanned: I2C 0x2c, 0x2d, 0x2e8+ Datasheet: http://www.national.com/pf/LM/LM85.html9+ * Analog Devices ADM102710+ Prefix: 'adm1027'11+ Addresses scanned: I2C 0x2c, 0x2d, 0x2e12+ Datasheet: http://www.analog.com/en/prod/0,,766_825_ADM1027,00.html13+ * Analog Devices ADT746314+ Prefix: 'adt7463'15+ Addresses scanned: I2C 0x2c, 0x2d, 0x2e16+ Datasheet: http://www.analog.com/en/prod/0,,766_825_ADT7463,00.html17+ * SMSC EMC6D100, SMSC EMC6D10118+ Prefix: 'emc6d100'19+ Addresses scanned: I2C 0x2c, 0x2d, 0x2e20+ Datasheet: http://www.smsc.com/main/tools/discontinued/6d100.pdf21+ * SMSC EMC6D10222+ Prefix: 'emc6d102'23+ Addresses scanned: I2C 0x2c, 0x2d, 0x2e24+ Datasheet: http://www.smsc.com/main/catalog/emc6d102.html25+26+Authors:27+ Philip Pokorny <ppokorny@penguincomputing.com>,28+ Frodo Looijaard <frodol@dds.nl>,29+ Richard Barrington <rich_b_nz@clear.net.nz>,30+ Margit Schubert-While <margitsw@t-online.de>,31+ Justin Thiessen <jthiessen@penguincomputing.com>32+33+Description34+-----------35+36+This driver implements support for the National Semiconductor LM85 and37+compatible chips including the Analog Devices ADM1027, ADT7463 and38+SMSC EMC6D10x chips family.39+40+The LM85 uses the 2-wire interface compatible with the SMBUS 2.041+specification. Using an analog to digital converter it measures three (3)42+temperatures and five (5) voltages. It has four (4) 16-bit counters for43+measuring fan speed. Five (5) digital inputs are provided for sampling the44+VID signals from the processor to the VRM. Lastly, there are three (3) PWM45+outputs that can be used to control fan speed.46+47+The voltage inputs have internal scaling resistors so that the following48+voltage can be measured without external resistors:49+50+ 2.5V, 3.3V, 5V, 12V, and CPU core voltage (2.25V)51+52+The temperatures measured are one internal diode, and two remote diodes.53+Remote 1 is generally the CPU temperature. These inputs are designed to54+measure a thermal diode like the one in a Pentium 4 processor in a socket55+423 or socket 478 package. They can also measure temperature using a56+transistor like the 2N3904.57+58+A sophisticated control system for the PWM outputs is designed into the59+LM85 that allows fan speed to be adjusted automatically based on any of the60+three temperature sensors. Each PWM output is individually adjustable and61+programmable. Once configured, the LM85 will adjust the PWM outputs in62+response to the measured temperatures without further host intervention.63+This feature can also be disabled for manual control of the PWM's.64+65+Each of the measured inputs (voltage, temperature, fan speed) has66+corresponding high/low limit values. The LM85 will signal an ALARM if any67+measured value exceeds either limit.68+69+The LM85 samples all inputs continuously. The lm85 driver will not read70+the registers more often than once a second. Further, configuration data is71+only read once each 5 minutes. There is twice as much config data as72+measurements, so this would seem to be a worthwhile optimization.73+74+Special Features75+----------------76+77+The LM85 has four fan speed monitoring modes. The ADM1027 has only two.78+Both have special circuitry to compensate for PWM interactions with the79+TACH signal from the fans. The ADM1027 can be configured to measure the80+speed of a two wire fan, but the input conditioning circuitry is different81+for 3-wire and 2-wire mode. For this reason, the 2-wire fan modes are not82+exposed to user control. The BIOS should initialize them to the correct83+mode. If you've designed your own ADM1027, you'll have to modify the84+init_client function and add an insmod parameter to set this up.85+86+To smooth the response of fans to changes in temperature, the LM85 has an87+optional filter for smoothing temperatures. The ADM1027 has the same88+config option but uses it to rate limit the changes to fan speed instead.89+90+The ADM1027 and ADT7463 have a 10-bit ADC and can therefore measure91+temperatures with 0.25 degC resolution. They also provide an offset to the92+temperature readings that is automatically applied during measurement.93+This offset can be used to zero out any errors due to traces and placement.94+The documentation says that the offset is in 0.25 degC steps, but in95+initial testing of the ADM1027 it was 1.00 degC steps. Analog Devices has96+confirmed this "bug". The ADT7463 is reported to work as described in the97+documentation. The current lm85 driver does not show the offset register.98+99+The ADT7463 has a THERM asserted counter. This counter has a 22.76ms100+resolution and a range of 5.8 seconds. The driver implements a 32-bit101+accumulator of the counter value to extend the range to over a year. The102+counter will stay at it's max value until read.103+104+See the vendor datasheets for more information. There is application note105+from National (AN-1260) with some additional information about the LM85.106+The Analog Devices datasheet is very detailed and describes a procedure for107+determining an optimal configuration for the automatic PWM control.108+109+The SMSC EMC6D100 & EMC6D101 monitor external voltages, temperatures, and110+fan speeds. They use this monitoring capability to alert the system to out111+of limit conditions and can automatically control the speeds of multiple112+fans in a PC or embedded system. The EMC6D101, available in a 24-pin SSOP113+package, and the EMC6D100, available in a 28-pin SSOP package, are designed114+to be register compatible. The EMC6D100 offers all the features of the115+EMC6D101 plus additional voltage monitoring and system control features.116+Unfortunately it is not possible to distinguish between the package117+versions on register level so these additional voltage inputs may read118+zero. The EMC6D102 features addtional ADC bits thus extending precision119+of voltage and temperature channels.120+121+122+Hardware Configurations123+-----------------------124+125+The LM85 can be jumpered for 3 different SMBus addresses. There are126+no other hardware configuration options for the LM85.127+128+The lm85 driver detects both LM85B and LM85C revisions of the chip. See the129+datasheet for a complete description of the differences. Other than130+identifying the chip, the driver behaves no differently with regard to131+these two chips. The LM85B is recommended for new designs.132+133+The ADM1027 and ADT7463 chips have an optional SMBALERT output that can be134+used to signal the chipset in case a limit is exceeded or the temperature135+sensors fail. Individual sensor interrupts can be masked so they won't136+trigger SMBALERT. The SMBALERT output if configured replaces one of the other137+functions (PWM2 or IN0). This functionality is not implemented in current138+driver.139+140+The ADT7463 also has an optional THERM output/input which can be connected141+to the processor PROC_HOT output. If available, the autofan control142+dynamic Tmin feature can be enabled to keep the system temperature within143+spec (just?!) with the least possible fan noise.144+145+Configuration Notes146+-------------------147+148+Besides standard interfaces driver adds following:149+150+* Temperatures and Zones151+152+Each temperature sensor is associated with a Zone. There are three153+sensors and therefore three zones (# 1, 2 and 3). Each zone has the following154+temperature configuration points:155+156+* temp#_auto_temp_off - temperature below which fans should be off or spinning very low.157+* temp#_auto_temp_min - temperature over which fans start to spin.158+* temp#_auto_temp_max - temperature when fans spin at full speed.159+* temp#_auto_temp_crit - temperature when all fans will run full speed.160+161+* PWM Control162+163+There are three PWM outputs. The LM85 datasheet suggests that the164+pwm3 output control both fan3 and fan4. Each PWM can be individually165+configured and assigned to a zone for it's control value. Each PWM can be166+configured individually according to the following options.167+168+* pwm#_auto_pwm_min - this specifies the PWM value for temp#_auto_temp_off169+ temperature. (PWM value from 0 to 255)170+171+* pwm#_auto_pwm_freq - select base frequency of PWM output. You can select172+ in range of 10.0 to 94.0 Hz in .1 Hz units.173+ (Values 100 to 940).174+175+The pwm#_auto_pwm_freq can be set to one of the following 8 values. Setting the176+frequency to a value not on this list, will result in the next higher frequency177+being selected. The actual device frequency may vary slightly from this178+specification as designed by the manufacturer. Consult the datasheet for more179+details. (PWM Frequency values: 100, 150, 230, 300, 380, 470, 620, 940)180+181+* pwm#_auto_pwm_minctl - this flags selects for temp#_auto_temp_off temperature182+ the bahaviour of fans. Write 1 to let fans spinning at183+ pwm#_auto_pwm_min or write 0 to let them off.184+185+NOTE: It has been reported that there is a bug in the LM85 that causes the flag186+to be associated with the zones not the PWMs. This contradicts all the187+published documentation. Setting pwm#_min_ctl in this case actually affects all188+PWMs controlled by zone '#'.189+190+* PWM Controlling Zone selection191+192+* pwm#_auto_channels - controls zone that is associated with PWM193+194+Configuration choices:195+196+ Value Meaning197+ ------ ------------------------------------------------198+ 1 Controlled by Zone 1199+ 2 Controlled by Zone 2200+ 3 Controlled by Zone 3201+ 23 Controlled by higher temp of Zone 2 or 3202+ 123 Controlled by highest temp of Zone 1, 2 or 3203+ 0 PWM always 0% (off)204+ -1 PWM always 100% (full on)205+ -2 Manual control (write to 'pwm#' to set)206+207+The National LM85's have two vendor specific configuration208+features. Tach. mode and Spinup Control. For more details on these,209+see the LM85 datasheet or Application Note AN-1260.210+211+The Analog Devices ADM1027 has several vendor specific enhancements.212+The number of pulses-per-rev of the fans can be set, Tach monitoring213+can be optimized for PWM operation, and an offset can be applied to214+the temperatures to compensate for systemic errors in the215+measurements.216+217+In addition to the ADM1027 features, the ADT7463 also has Tmin control218+and THERM asserted counts. Automatic Tmin control acts to adjust the219+Tmin value to maintain the measured temperature sensor at a specified220+temperature. There isn't much documentation on this feature in the221+ADT7463 data sheet. This is not supported by current driver.
···1+Kernel driver lm872+==================3+4+Supported chips:5+ * National Semiconductor LM876+ Prefix: 'lm87'7+ Addresses scanned: I2C 0x2c - 0x2f8+ Datasheet: http://www.national.com/pf/LM/LM87.html9+10+Authors:11+ Frodo Looijaard <frodol@dds.nl>,12+ Philip Edelbrock <phil@netroedge.com>,13+ Mark Studebaker <mdsxyz123@yahoo.com>,14+ Stephen Rousset <stephen.rousset@rocketlogix.com>,15+ Dan Eaton <dan.eaton@rocketlogix.com>,16+ Jean Delvare <khali@linux-fr.org>,17+ Original 2.6 port Jeff Oliver18+19+Description20+-----------21+22+This driver implements support for the National Semiconductor LM87.23+24+The LM87 implements up to three temperature sensors, up to two fan25+rotation speed sensors, up to seven voltage sensors, alarms, and some26+miscellaneous stuff.27+28+Temperatures are measured in degrees Celsius. Each input has a high29+and low alarm settings. A high limit produces an alarm when the value30+goes above it, and an alarm is also produced when the value goes below31+the low limit.32+33+Fan rotation speeds are reported in RPM (rotations per minute). An alarm is34+triggered if the rotation speed has dropped below a programmable limit. Fan35+readings can be divided by a programmable divider (1, 2, 4 or 8) to give36+the readings more range or accuracy. Not all RPM values can accurately be37+represented, so some rounding is done. With a divider of 2, the lowest38+representable value is around 2600 RPM.39+40+Voltage sensors (also known as IN sensors) report their values in41+volts. An alarm is triggered if the voltage has crossed a programmable42+minimum or maximum limit. Note that minimum in this case always means43+'closest to zero'; this is important for negative voltage measurements.44+45+If an alarm triggers, it will remain triggered until the hardware register46+is read at least once. This means that the cause for the alarm may47+already have disappeared! Note that in the current implementation, all48+hardware registers are read whenever any data is read (unless it is less49+than 1.0 seconds since the last update). This means that you can easily50+miss once-only alarms.51+52+The lm87 driver only updates its values each 1.0 seconds; reading it more53+often will do no harm, but will return 'old' values.54+55+56+Hardware Configurations57+-----------------------58+59+The LM87 has four pins which can serve one of two possible functions,60+depending on the hardware configuration.61+62+Some functions share pins, so not all functions are available at the same63+time. Which are depends on the hardware setup. This driver assumes that64+the BIOS configured the chip correctly. In that respect, it differs from65+the original driver (from lm_sensors for Linux 2.4), which would force the66+LM87 to an arbitrary, compile-time chosen mode, regardless of the actual67+chipset wiring.68+69+For reference, here is the list of exclusive functions:70+ - in0+in5 (default) or temp371+ - fan1 (default) or in672+ - fan2 (default) or in773+ - VID lines (default) or IRQ lines (not handled by this driver)
···1+Kernel driver lm902+==================3+4+Supported chips:5+ * National Semiconductor LM906+ Prefix: 'lm90'7+ Addresses scanned: I2C 0x4c8+ Datasheet: Publicly available at the National Semiconductor website9+ http://www.national.com/pf/LM/LM90.html10+ * National Semiconductor LM8911+ Prefix: 'lm99'12+ Addresses scanned: I2C 0x4c and 0x4d13+ Datasheet: Publicly available at the National Semiconductor website14+ http://www.national.com/pf/LM/LM89.html15+ * National Semiconductor LM9916+ Prefix: 'lm99'17+ Addresses scanned: I2C 0x4c and 0x4d18+ Datasheet: Publicly available at the National Semiconductor website19+ http://www.national.com/pf/LM/LM99.html20+ * National Semiconductor LM8621+ Prefix: 'lm86'22+ Addresses scanned: I2C 0x4c23+ Datasheet: Publicly available at the National Semiconductor website24+ http://www.national.com/pf/LM/LM86.html25+ * Analog Devices ADM103226+ Prefix: 'adm1032'27+ Addresses scanned: I2C 0x4c28+ Datasheet: Publicly available at the Analog Devices website29+ http://products.analog.com/products/info.asp?product=ADM103230+ * Analog Devices ADT746131+ Prefix: 'adt7461'32+ Addresses scanned: I2C 0x4c33+ Datasheet: Publicly available at the Analog Devices website34+ http://products.analog.com/products/info.asp?product=ADT746135+ Note: Only if in ADM1032 compatibility mode36+ * Maxim MAX665737+ Prefix: 'max6657'38+ Addresses scanned: I2C 0x4c39+ Datasheet: Publicly available at the Maxim website40+ http://www.maxim-ic.com/quick_view2.cfm/qv_pk/257841+ * Maxim MAX665842+ Prefix: 'max6657'43+ Addresses scanned: I2C 0x4c44+ Datasheet: Publicly available at the Maxim website45+ http://www.maxim-ic.com/quick_view2.cfm/qv_pk/257846+ * Maxim MAX665947+ Prefix: 'max6657'48+ Addresses scanned: I2C 0x4c, 0x4d (unsupported 0x4e)49+ Datasheet: Publicly available at the Maxim website50+ http://www.maxim-ic.com/quick_view2.cfm/qv_pk/257851+52+53+Author: Jean Delvare <khali@linux-fr.org>54+55+56+Description57+-----------58+59+The LM90 is a digital temperature sensor. It senses its own temperature as60+well as the temperature of up to one external diode. It is compatible61+with many other devices such as the LM86, the LM89, the LM99, the ADM1032,62+the MAX6657, MAX6658 and the MAX6659 all of which are supported by this driver.63+Note that there is no easy way to differentiate between the last three64+variants. The extra address and features of the MAX6659 are not supported by65+this driver. Additionally, the ADT7461 is supported if found in ADM103266+compatibility mode.67+68+The specificity of this family of chipsets over the ADM1021/LM8469+family is that it features critical limits with hysteresis, and an70+increased resolution of the remote temperature measurement.71+72+The different chipsets of the family are not strictly identical, although73+very similar. This driver doesn't handle any specific feature for now,74+but could if there ever was a need for it. For reference, here comes a75+non-exhaustive list of specific features:76+77+LM90:78+ * Filter and alert configuration register at 0xBF.79+ * ALERT is triggered by temperatures over critical limits.80+81+LM86 and LM89:82+ * Same as LM9083+ * Better external channel accuracy84+85+LM99:86+ * Same as LM8987+ * External temperature shifted by 16 degrees down88+89+ADM1032:90+ * Consecutive alert register at 0x22.91+ * Conversion averaging.92+ * Up to 64 conversions/s.93+ * ALERT is triggered by open remote sensor.94+95+ADT746196+ * Extended temperature range (breaks compatibility)97+ * Lower resolution for remote temperature98+99+MAX6657 and MAX6658:100+ * Remote sensor type selection101+102+MAX6659103+ * Selectable address104+ * Second critical temperature limit105+ * Remote sensor type selection106+107+All temperature values are given in degrees Celsius. Resolution108+is 1.0 degree for the local temperature, 0.125 degree for the remote109+temperature.110+111+Each sensor has its own high and low limits, plus a critical limit.112+Additionally, there is a relative hysteresis value common to both critical113+values. To make life easier to user-space applications, two absolute values114+are exported, one for each channel, but these values are of course linked.115+Only the local hysteresis can be set from user-space, and the same delta116+applies to the remote hysteresis.117+118+The lm90 driver will not update its values more frequently than every119+other second; reading them more often will do no harm, but will return120+'old' values.121+
+37
Documentation/i2c/chips/lm92
···0000000000000000000000000000000000000
···1+Kernel driver lm922+==================3+4+Supported chips:5+ * National Semiconductor LM926+ Prefix: 'lm92'7+ Addresses scanned: I2C 0x48 - 0x4b8+ Datasheet: http://www.national.com/pf/LM/LM92.html9+ * National Semiconductor LM7610+ Prefix: 'lm92'11+ Addresses scanned: none, force parameter needed12+ Datasheet: http://www.national.com/pf/LM/LM76.html13+ * Maxim MAX6633/MAX6634/MAX663514+ Prefix: 'lm92'15+ Addresses scanned: I2C 0x48 - 0x4b16+ MAX6633 with address in 0x40 - 0x47, 0x4c - 0x4f needs force parameter17+ and MAX6634 with address in 0x4c - 0x4f needs force parameter18+ Datasheet: http://www.maxim-ic.com/quick_view2.cfm/qv_pk/307419+20+Authors:21+ Abraham van der Merwe <abraham@2d3d.co.za>22+ Jean Delvare <khali@linux-fr.org>23+24+25+Description26+-----------27+28+This driver implements support for the National Semiconductor LM9229+temperature sensor.30+31+Each LM92 temperature sensor supports a single temperature sensor. There are32+alarms for high, low, and critical thresholds. There's also an hysteresis to33+control the thresholds for resetting alarms.34+35+Support was added later for the LM76 and Maxim MAX6633/MAX6634/MAX6635,36+which are mostly compatible. They have not all been tested, so you37+may need to use the force parameter.
+29
Documentation/i2c/chips/max1619
···00000000000000000000000000000
···1+Kernel driver max16192+=====================3+4+Supported chips:5+ * Maxim MAX16196+ Prefix: 'max1619'7+ Addresses scanned: I2C 0x18-0x1a, 0x29-0x2b, 0x4c-0x4e8+ Datasheet: Publicly available at the Maxim website9+ http://pdfserv.maxim-ic.com/en/ds/MAX1619.pdf10+11+Authors:12+ Alexey Fisher <fishor@mail.ru>,13+ Jean Delvare <khali@linux-fr.org>14+15+Description16+-----------17+18+The MAX1619 is a digital temperature sensor. It senses its own temperature as19+well as the temperature of up to one external diode.20+21+All temperature values are given in degrees Celsius. Resolution22+is 1.0 degree for the local temperature and for the remote temperature.23+24+Only the external sensor has high and low limits.25+26+The max1619 driver will not update its values more frequently than every27+other second; reading them more often will do no harm, but will return28+'old' values.29+
···1+Kernel driver max68752+=====================3+4+Supported chips:5+ * Maxim max6874, max68756+ Prefixes: 'max6875'7+ Addresses scanned: 0x50, 0x528+ Datasheets:9+ http://pdfserv.maxim-ic.com/en/ds/MAX6874-MAX6875.pdf10+11+Author: Ben Gardner <bgardner@wabtec.com>12+13+14+Module Parameters15+-----------------16+17+* allow_write int18+ Set to non-zero to enable write permission:19+ *0: Read only20+ 1: Read and write21+22+23+Description24+-----------25+26+The MAXIM max6875 is a EEPROM-programmable power-supply sequencer/supervisor.27+It provides timed outputs that can be used as a watchdog, if properly wired.28+It also provides 512 bytes of user EEPROM.29+30+At reset, the max6875 reads the configuration eeprom into its configuration31+registers. The chip then begins to operate according to the values in the32+registers.33+34+See the datasheet for details on how to program the EEPROM.35+36+37+Sysfs entries38+-------------39+40+eeprom_user - 512 bytes of user-defined EEPROM space. Only writable if41+ allow_write was set and register 0x43 is 0.42+43+eeprom_config - 70 bytes of config EEPROM. Note that changes will not get44+ loaded into register space until a power cycle or device reset.45+46+reg_config - 70 bytes of register space. Any changes take affect immediately.47+48+49+General Remarks50+---------------51+52+A typical application will require that the EEPROMs be programmed once and53+never altered afterwards.54+
···1+Kernel driver pc873602+=====================3+4+Supported chips:5+ * National Semiconductor PC87360, PC87363, PC87364, PC87365 and PC873666+ Prefixes: 'pc87360', 'pc87363', 'pc87364', 'pc87365', 'pc87366'7+ Addresses scanned: none, address read from Super I/O config space8+ Datasheets:9+ http://www.national.com/pf/PC/PC87360.html10+ http://www.national.com/pf/PC/PC87363.html11+ http://www.national.com/pf/PC/PC87364.html12+ http://www.national.com/pf/PC/PC87365.html13+ http://www.national.com/pf/PC/PC87366.html14+15+Authors: Jean Delvare <khali@linux-fr.org>16+17+Thanks to Sandeep Mehta, Tonko de Rooy and Daniel Ceregatti for testing.18+Thanks to Rudolf Marek for helping me investigate conversion issues.19+20+21+Module Parameters22+-----------------23+24+* init int25+ Chip initialization level:26+ 0: None27+ *1: Forcibly enable internal voltage and temperature channels, except in928+ 2: Forcibly enable all voltage and temperature channels, except in929+ 3: Forcibly enable all voltage and temperature channels, including in930+31+Note that this parameter has no effect for the PC87360, PC87363 and PC8736432+chips.33+34+Also note that for the PC87366, initialization levels 2 and 3 don't enable35+all temperature channels, because some of them share pins with each other,36+so they can't be used at the same time.37+38+39+Description40+-----------41+42+The National Semiconductor PC87360 Super I/O chip contains monitoring and43+PWM control circuitry for two fans. The PC87363 chip is similar, and the44+PC87364 chip has monitoring and PWM control for a third fan.45+46+The National Semiconductor PC87365 and PC87366 Super I/O chips are complete47+hardware monitoring chipsets, not only controlling and monitoring three fans,48+but also monitoring eleven voltage inputs and two (PC87365) or up to four49+(PC87366) temperatures.50+51+ Chip #vin #fan #pwm #temp devid52+53+ PC87360 - 2 2 - 0xE154+ PC87363 - 2 2 - 0xE855+ PC87364 - 3 3 - 0xE456+ PC87365 11 3 3 2 0xE557+ PC87366 11 3 3 3-4 0xE958+59+The driver assumes that no more than one chip is present, and one of the60+standard Super I/O addresses is used (0x2E/0x2F or 0x4E/0x4F)61+62+Fan Monitoring63+--------------64+65+Fan rotation speeds are reported in RPM (revolutions per minute). An alarm66+is triggered if the rotation speed has dropped below a programmable limit.67+A different alarm is triggered if the fan speed is too low to be measured.68+69+Fan readings are affected by a programmable clock divider, giving the70+readings more range or accuracy. Usually, users have to learn how it works,71+but this driver implements dynamic clock divider selection, so you don't72+have to care no more.73+74+For reference, here are a few values about clock dividers:75+76+ slowest accuracy highest77+ measurable around 3000 accurate78+ divider speed (RPM) RPM (RPM) speed (RPM)79+ 1 1882 18 692880+ 2 941 37 489881+ 4 470 74 346482+ 8 235 150 244983+84+For the curious, here is how the values above were computed:85+ * slowest measurable speed: clock/(255*divider)86+ * accuracy around 3000 RPM: 3000^2/clock87+ * highest accurate speed: sqrt(clock*100)88+The clock speed for the PC87360 family is 480 kHz. I arbitrarily chose 10089+RPM as the lowest acceptable accuracy.90+91+As mentioned above, you don't have to care about this no more.92+93+Note that not all RPM values can be represented, even when the best clock94+divider is selected. This is not only true for the measured speeds, but95+also for the programmable low limits, so don't be surprised if you try to96+set, say, fan1_min to 2900 and it finally reads 2909.97+98+99+Fan Control100+-----------101+102+PWM (pulse width modulation) values range from 0 to 255, with 0 meaning103+that the fan is stopped, and 255 meaning that the fan goes at full speed.104+105+Be extremely careful when changing PWM values. Low PWM values, even106+non-zero, can stop the fan, which may cause irreversible damage to your107+hardware if temperature increases too much. When changing PWM values, go108+step by step and keep an eye on temperatures.109+110+One user reported problems with PWM. Changing PWM values would break fan111+speed readings. No explanation nor fix could be found.112+113+114+Temperature Monitoring115+----------------------116+117+Temperatures are reported in degrees Celsius. Each temperature measured has118+associated low, high and overtemperature limits, each of which triggers an119+alarm when crossed.120+121+The first two temperature channels are external. The third one (PC87366122+only) is internal.123+124+The PC87366 has three additional temperature channels, based on125+thermistors (as opposed to thermal diodes for the first three temperature126+channels). For technical reasons, these channels are held by the VLM127+(voltage level monitor) logical device, not the TMS (temperature128+measurement) one. As a consequence, these temperatures are exported as129+voltages, and converted into temperatures in user-space.130+131+Note that these three additional channels share their pins with the132+external thermal diode channels, so you (physically) can't use them all at133+the same time. Although it should be possible to mix the two sensor types,134+the documents from National Semiconductor suggest that motherboard135+manufacturers should choose one type and stick to it. So you will more136+likely have either channels 1 to 3 (thermal diodes) or 3 to 6 (internal137+thermal diode, and thermistors).138+139+140+Voltage Monitoring141+------------------142+143+Voltages are reported relatively to a reference voltage, either internal or144+external. Some of them (in7:Vsb, in8:Vdd and in10:AVdd) are divided by two145+internally, you will have to compensate in sensors.conf. Others (in0 to in6)146+are likely to be divided externally. The meaning of each of these inputs as147+well as the values of the resistors used for division is left to the148+motherboard manufacturers, so you will have to document yourself and edit149+sensors.conf accordingly. National Semiconductor has a document with150+recommended resistor values for some voltages, but this still leaves much151+room for per motherboard specificities, unfortunately. Even worse,152+motherboard manufacturers don't seem to care about National Semiconductor's153+recommendations.154+155+Each voltage measured has associated low and high limits, each of which156+triggers an alarm when crossed.157+158+When available, VID inputs are used to provide the nominal CPU Core voltage.159+The driver will default to VRM 9.0, but this can be changed from user-space.160+The chipsets can handle two sets of VID inputs (on dual-CPU systems), but161+the driver will only export one for now. This may change later if there is162+a need.163+164+165+General Remarks166+---------------167+168+If an alarm triggers, it will remain triggered until the hardware register169+is read at least once. This means that the cause for the alarm may already170+have disappeared! Note that all hardware registers are read whenever any171+data is read (unless it is less than 2 seconds since the last update, in172+which case cached values are returned instead). As a consequence, when173+a once-only alarm triggers, it may take 2 seconds for it to show, and 2174+more seconds for it to disappear.175+176+Monitoring of in9 isn't enabled at lower init levels (<3) because that177+channel measures the battery voltage (Vbat). It is a known fact that178+repeatedly sampling the battery voltage reduces its lifetime. National179+Semiconductor smartly designed their chipset so that in9 is sampled only180+once every 1024 sampling cycles (that is every 34 minutes at the default181+sampling rate), so the effect is attenuated, but still present.182+183+184+Limitations185+-----------186+187+The datasheets suggests that some values (fan mins, fan dividers)188+shouldn't be changed once the monitoring has started, but we ignore that189+recommendation. We'll reconsider if it actually causes trouble.
···1+Kernel driver pca95392+=====================3+4+Supported chips:5+ * Philips PCA95396+ Prefix: 'pca9539'7+ Addresses scanned: 0x74 - 0x778+ Datasheet:9+ http://www.semiconductors.philips.com/acrobat/datasheets/PCA9539_2.pdf10+11+Author: Ben Gardner <bgardner@wabtec.com>12+13+14+Description15+-----------16+17+The Philips PCA9539 is a 16 bit low power I/O device.18+All 16 lines can be individually configured as an input or output.19+The input sense can also be inverted.20+The 16 lines are split between two bytes.21+22+23+Sysfs entries24+-------------25+26+Each is a byte that maps to the 8 I/O bits.27+A '0' suffix is for bits 0-7, while '1' is for bits 8-15.28+29+input[01] - read the current value30+output[01] - sets the output value31+direction[01] - direction of each bit: 1=input, 0=output32+invert[01] - toggle the input bit sense33+34+input reads the actual state of the line and is always available.35+The direction defaults to input for all channels.36+37+38+General Remarks39+---------------40+41+Note that each output, direction, and invert entry controls 8 lines.42+You should use the read, modify, write sequence.43+For example. to set output bit 0 of 1.44+ val=$(cat output0)45+ val=$(( $val | 1 ))46+ echo $val > output047+
···1+Kernel driver pcf85742+=====================3+4+Supported chips:5+ * Philips PCF85746+ Prefix: 'pcf8574'7+ Addresses scanned: I2C 0x20 - 0x278+ Datasheet: Publicly available at the Philips Semiconductors website9+ http://www.semiconductors.philips.com/pip/PCF8574P.html10+11+ * Philips PCF8574A12+ Prefix: 'pcf8574a'13+ Addresses scanned: I2C 0x38 - 0x3f14+ Datasheet: Publicly available at the Philips Semiconductors website15+ http://www.semiconductors.philips.com/pip/PCF8574P.html16+17+Authors:18+ Frodo Looijaard <frodol@dds.nl>,19+ Philip Edelbrock <phil@netroedge.com>,20+ Dan Eaton <dan.eaton@rocketlogix.com>,21+ Aurelien Jarno <aurelien@aurel32.net>,22+ Jean Delvare <khali@linux-fr.org>,23+24+25+Description26+-----------27+The PCF8574(A) is an 8-bit I/O expander for the I2C bus produced by Philips28+Semiconductors. It is designed to provide a byte I2C interface to up to 1629+separate devices (8 x PCF8574 and 8 x PCF8574A).30+31+This device consists of a quasi-bidirectional port. Each of the eight I/Os32+can be independently used as an input or output. To setup an I/O as an33+input, you have to write a 1 to the corresponding output.34+35+For more informations see the datasheet.36+37+38+Accessing PCF8574(A) via /sys interface39+-------------------------------------40+41+! Be careful !42+The PCF8574(A) is plainly impossible to detect ! Stupid chip.43+So every chip with address in the interval [20..27] and [38..3f] are44+detected as PCF8574(A). If you have other chips in this address45+range, the workaround is to load this module after the one46+for your others chips.47+48+On detection (i.e. insmod, modprobe et al.), directories are being49+created for each detected PCF8574(A):50+51+/sys/bus/i2c/devices/<0>-<1>/52+where <0> is the bus the chip was detected on (e. g. i2c-0)53+and <1> the chip address ([20..27] or [38..3f]):54+55+(example: /sys/bus/i2c/devices/1-0020/)56+57+Inside these directories, there are two files each:58+read and write (and one file with chip name).59+60+The read file is read-only. Reading gives you the current I/O input61+if the corresponding output is set as 1, otherwise the current output62+value, that is to say 0.63+64+The write file is read/write. Writing a value outputs it on the I/O65+port. Reading returns the last written value.66+67+On module initialization the chip is configured as eight inputs (all68+outputs to 1), so you can connect any circuit to the PCF8574(A) without69+being afraid of short-circuit.
···1+Kernel driver pcf85912+=====================3+4+Supported chips:5+ * Philips PCF85916+ Prefix: 'pcf8591'7+ Addresses scanned: I2C 0x48 - 0x4f8+ Datasheet: Publicly available at the Philips Semiconductor website9+ http://www.semiconductors.philips.com/pip/PCF8591P.html10+11+Authors:12+ Aurelien Jarno <aurelien@aurel32.net>13+ valuable contributions by Jan M. Sendler <sendler@sendler.de>,14+ Jean Delvare <khali@linux-fr.org>15+16+17+Description18+-----------19+The PCF8591 is an 8-bit A/D and D/A converter (4 analog inputs and one20+analog output) for the I2C bus produced by Philips Semiconductors. It21+is designed to provide a byte I2C interface to up to 4 separate devices.22+23+The PCF8591 has 4 analog inputs programmable as single-ended or24+differential inputs :25+- mode 0 : four single ended inputs26+ Pins AIN0 to AIN3 are single ended inputs for channels 0 to 327+28+- mode 1 : three differential inputs29+ Pins AIN3 is the common negative differential input30+ Pins AIN0 to AIN2 are positive differential inputs for channels 0 to 231+32+- mode 2 : single ended and differential mixed33+ Pins AIN0 and AIN1 are single ended inputs for channels 0 and 134+ Pins AIN2 is the positive differential input for channel 335+ Pins AIN3 is the negative differential input for channel 336+37+- mode 3 : two differential inputs38+ Pins AIN0 is the positive differential input for channel 039+ Pins AIN1 is the negative differential input for channel 040+ Pins AIN2 is the positive differential input for channel 141+ Pins AIN3 is the negative differential input for channel 142+43+See the datasheet for details.44+45+Module parameters46+-----------------47+48+* input_mode int49+50+ Analog input mode:51+ 0 = four single ended inputs52+ 1 = three differential inputs53+ 2 = single ended and differential mixed54+ 3 = two differential inputs55+56+57+Accessing PCF8591 via /sys interface58+-------------------------------------59+60+! Be careful !61+The PCF8591 is plainly impossible to detect ! Stupid chip.62+So every chip with address in the interval [48..4f] is63+detected as PCF8591. If you have other chips in this address64+range, the workaround is to load this module after the one65+for your others chips.66+67+On detection (i.e. insmod, modprobe et al.), directories are being68+created for each detected PCF8591:69+70+/sys/bus/devices/<0>-<1>/71+where <0> is the bus the chip was detected on (e. g. i2c-0)72+and <1> the chip address ([48..4f])73+74+Inside these directories, there are such files:75+in0, in1, in2, in3, out0_enable, out0_output, name76+77+Name contains chip name.78+79+The in0, in1, in2 and in3 files are RO. Reading gives the value of the80+corresponding channel. Depending on the current analog inputs configuration,81+files in2 and/or in3 do not exist. Values range are from 0 to 255 for single82+ended inputs and -128 to +127 for differential inputs (8-bit ADC).83+84+The out0_enable file is RW. Reading gives "1" for analog output enabled and85+"0" for analog output disabled. Writing accepts "0" and "1" accordingly.86+87+The out0_output file is RW. Writing a number between 0 and 255 (8-bit DAC), send88+the value to the digital-to-analog converter. Note that a voltage will89+only appears on AOUT pin if aout0_enable equals 1. Reading returns the last90+value written.
···1+Kernel driver sis55952+=====================3+4+Supported chips:5+ * Silicon Integrated Systems Corp. SiS5595 Southbridge Hardware Monitor6+ Prefix: 'sis5595'7+ Addresses scanned: ISA in PCI-space encoded address8+ Datasheet: Publicly available at the Silicon Integrated Systems Corp. site.9+10+Authors:11+ Ky�sti M�lkki <kmalkki@cc.hut.fi>,12+ Mark D. Studebaker <mdsxyz123@yahoo.com>,13+ Aurelien Jarno <aurelien@aurel32.net> 2.6 port14+15+ SiS southbridge has a LM78-like chip integrated on the same IC.16+ This driver is a customized copy of lm78.c17+18+ Supports following revisions:19+ Version PCI ID PCI Revision20+ 1 1039/0008 AF or less21+ 2 1039/0008 B0 or greater22+23+ Note: these chips contain a 0008 device which is incompatible with the24+ 5595. We recognize these by the presence of the listed25+ "blacklist" PCI ID and refuse to load.26+27+ NOT SUPPORTED PCI ID BLACKLIST PCI ID28+ 540 0008 054029+ 550 0008 055030+ 5513 0008 551131+ 5581 0008 559732+ 5582 0008 559733+ 5597 0008 559734+ 630 0008 063035+ 645 0008 064536+ 730 0008 073037+ 735 0008 073538+39+40+Module Parameters41+-----------------42+force_addr=0xaddr Set the I/O base address. Useful for boards43+ that don't set the address in the BIOS. Does not do a44+ PCI force; the device must still be present in lspci.45+ Don't use this unless the driver complains that the46+ base address is not set.47+ Example: 'modprobe sis5595 force_addr=0x290'48+49+50+Description51+-----------52+53+The SiS5595 southbridge has integrated hardware monitor functions. It also54+has an I2C bus, but this driver only supports the hardware monitor. For the55+I2C bus driver see i2c-sis5595.56+57+The SiS5595 implements zero or one temperature sensor, two fan speed58+sensors, four or five voltage sensors, and alarms.59+60+On the first version of the chip, there are four voltage sensors and one61+temperature sensor.62+63+On the second version of the chip, the temperature sensor (temp) and the64+fifth voltage sensor (in4) share a pin which is configurable, but not65+through the driver. Sorry. The driver senses the configuration of the pin,66+which was hopefully set by the BIOS.67+68+Temperatures are measured in degrees Celsius. An alarm is triggered once69+when the max is crossed; it is also triggered when it drops below the min70+value. Measurements are guaranteed between -55 and +125 degrees, with a71+resolution of 1 degree.72+73+Fan rotation speeds are reported in RPM (rotations per minute). An alarm is74+triggered if the rotation speed has dropped below a programmable limit. Fan75+readings can be divided by a programmable divider (1, 2, 4 or 8) to give76+the readings more range or accuracy. Not all RPM values can accurately be77+represented, so some rounding is done. With a divider of 2, the lowest78+representable value is around 2600 RPM.79+80+Voltage sensors (also known as IN sensors) report their values in volts. An81+alarm is triggered if the voltage has crossed a programmable minimum or82+maximum limit. Note that minimum in this case always means 'closest to83+zero'; this is important for negative voltage measurements. All voltage84+inputs can measure voltages between 0 and 4.08 volts, with a resolution of85+0.016 volt.86+87+In addition to the alarms described above, there is a BTI alarm, which gets88+triggered when an external chip has crossed its limits. Usually, this is89+connected to some LM75-like chip; if at least one crosses its limits, this90+bit gets set.91+92+If an alarm triggers, it will remain triggered until the hardware register93+is read at least once. This means that the cause for the alarm may already94+have disappeared! Note that in the current implementation, all hardware95+registers are read whenever any data is read (unless it is less than 1.596+seconds since the last update). This means that you can easily miss97+once-only alarms.98+99+The SiS5595 only updates its values each 1.5 seconds; reading it more often100+will do no harm, but will return 'old' values.101+102+Problems103+--------104+Some chips refuse to be enabled. We don't know why.105+The driver will recognize this and print a message in dmesg.106+
···0000000000001November 23, 200423The following specification describes the SMSC LPC47B397-NC sensor chip4-(for which there is no public datasheet available). This document was5provided by Craig Kelly (In-Store Broadcast Network) and edited/corrected6by Mark M. Hoffman <mhoffman@lightlink.com>.7···22Methods for detecting the HP SIO and reading the thermal data on a dc7100.2324The thermal information on the dc7100 is contained in the SIO Hardware Monitor25-(HWM). The information is accessed through an index/data pair. The index/data26-pair is located at the HWM Base Address + 0 and the HWM Base Address + 1. The27HWM Base address can be obtained from Logical Device 8, registers 0x60 (MSB)28-and 0x61 (LSB). Currently we are using 0x480 for the HWM Base Address and290x480 and 0x481 for the index/data pair.3031Reading temperature information.···62The LSB Must be read first.6364How to convert the tach reading to RPM.65-The tach reading (TCount) is given by: (Tach MSB * 256) + (Tach LSB)66The SIO counts the number of 90kHz (11.111us) pulses per revolution.67RPM = 60/(TCount * 11.111us)68···8485Enter Configuration Mode86To place the chip into the Configuration State The config key (0x55) is written87-to the CONFIG PORT (0x2E). 8889Configuration Mode90In configuration mode, the INDEX PORT is located at the CONFIG PORT address and91the DATA PORT is at INDEX PORT address + 1.9293-The desired configuration registers are accessed in two steps: 94a. Write the index of the Logical Device Number Configuration Register95 (i.e., 0x07) to the INDEX PORT and then write the number of the96 desired logical device to the DATA PORT.9798b. Write the address of the desired configuration register within the99 logical device to the INDEX PORT and then write or read the config-100- uration register through the DATA PORT. 101102Note: If accessing the Global Configuration Registers, step (a) is not required.103···108Programming Example109The following is an example of how to read the SIO Device ID located at 0x20110111-; ENTER CONFIGURATION MODE 112MOV DX,02EH113MOV AX,055H114OUT DX,AL115-; GLOBAL CONFIGURATION REGISTER 116MOV DX,02EH117MOV AL,20H118-OUT DX,AL 119; READ THE DATA120MOV DX,02FH121IN AL,DX122-; EXIT CONFIGURATION MODE 123MOV DX,02EH124MOV AX,0AAH125OUT DX,AL···134The following is an example of how to read the HWM Base Address located in135Logical Device 8.136137-; ENTER CONFIGURATION MODE 138MOV DX,02EH139MOV AX,055H140OUT DX,AL141-; CONFIGURE REGISTER CRE0, 142-; LOGICAL DEVICE 8 143MOV DX,02EH144MOV AL,07H145OUT DX,AL ;Point to LD# Config Reg···147MOV AL, 08H148OUT DX,AL;Point to Logical Device 8149;150-MOV DX,02EH 151MOV AL,60H152OUT DX,AL ; Point to HWM Base Addr MSB153MOV DX,02FH154IN AL,DX ; Get MSB of HWM Base Addr155-; EXIT CONFIGURATION MODE 156MOV DX,02EH157MOV AX,0AAH158OUT DX,AL
···1+Kernel driver smsc47b3972+========================3+4+Supported chips:5+ * SMSC LPC47B397-NC6+ Prefix: 'smsc47b397'7+ Addresses scanned: none, address read from Super I/O config space8+ Datasheet: In this file9+10+Authors: Mark M. Hoffman <mhoffman@lightlink.com>11+ Utilitek Systems, Inc.12+13November 23, 20041415The following specification describes the SMSC LPC47B397-NC sensor chip16+(for which there is no public datasheet available). This document was17provided by Craig Kelly (In-Store Broadcast Network) and edited/corrected18by Mark M. Hoffman <mhoffman@lightlink.com>.19···10Methods for detecting the HP SIO and reading the thermal data on a dc7100.1112The thermal information on the dc7100 is contained in the SIO Hardware Monitor13+(HWM). The information is accessed through an index/data pair. The index/data14+pair is located at the HWM Base Address + 0 and the HWM Base Address + 1. The15HWM Base address can be obtained from Logical Device 8, registers 0x60 (MSB)16+and 0x61 (LSB). Currently we are using 0x480 for the HWM Base Address and170x480 and 0x481 for the index/data pair.1819Reading temperature information.···50The LSB Must be read first.5152How to convert the tach reading to RPM.53+The tach reading (TCount) is given by: (Tach MSB * 256) + (Tach LSB)54The SIO counts the number of 90kHz (11.111us) pulses per revolution.55RPM = 60/(TCount * 11.111us)56···7273Enter Configuration Mode74To place the chip into the Configuration State The config key (0x55) is written75+to the CONFIG PORT (0x2E).7677Configuration Mode78In configuration mode, the INDEX PORT is located at the CONFIG PORT address and79the DATA PORT is at INDEX PORT address + 1.8081+The desired configuration registers are accessed in two steps:82a. Write the index of the Logical Device Number Configuration Register83 (i.e., 0x07) to the INDEX PORT and then write the number of the84 desired logical device to the DATA PORT.8586b. Write the address of the desired configuration register within the87 logical device to the INDEX PORT and then write or read the config-88+ uration register through the DATA PORT.8990Note: If accessing the Global Configuration Registers, step (a) is not required.91···96Programming Example97The following is an example of how to read the SIO Device ID located at 0x209899+; ENTER CONFIGURATION MODE100MOV DX,02EH101MOV AX,055H102OUT DX,AL103+; GLOBAL CONFIGURATION REGISTER104MOV DX,02EH105MOV AL,20H106+OUT DX,AL107; READ THE DATA108MOV DX,02FH109IN AL,DX110+; EXIT CONFIGURATION MODE111MOV DX,02EH112MOV AX,0AAH113OUT DX,AL···122The following is an example of how to read the HWM Base Address located in123Logical Device 8.124125+; ENTER CONFIGURATION MODE126MOV DX,02EH127MOV AX,055H128OUT DX,AL129+; CONFIGURE REGISTER CRE0,130+; LOGICAL DEVICE 8131MOV DX,02EH132MOV AL,07H133OUT DX,AL ;Point to LD# Config Reg···135MOV AL, 08H136OUT DX,AL;Point to Logical Device 8137;138+MOV DX,02EH139MOV AL,60H140OUT DX,AL ; Point to HWM Base Addr MSB141MOV DX,02FH142IN AL,DX ; Get MSB of HWM Base Addr143+; EXIT CONFIGURATION MODE144MOV DX,02EH145MOV AX,0AAH146OUT DX,AL
···1+Kernel driver smsc47m12+======================3+4+Supported chips:5+ * SMSC LPC47B27x, LPC47M10x, LPC47M13x, LPC47M14x, LPC47M15x and LPC47M1926+ Addresses scanned: none, address read from Super I/O config space7+ Prefix: 'smsc47m1'8+ Datasheets:9+ http://www.smsc.com/main/datasheets/47b27x.pdf10+ http://www.smsc.com/main/datasheets/47m10x.pdf11+ http://www.smsc.com/main/tools/discontinued/47m13x.pdf12+ http://www.smsc.com/main/datasheets/47m14x.pdf13+ http://www.smsc.com/main/tools/discontinued/47m15x.pdf14+ http://www.smsc.com/main/datasheets/47m192.pdf15+16+Authors:17+ Mark D. Studebaker <mdsxyz123@yahoo.com>,18+ With assistance from Bruce Allen <ballen@uwm.edu>, and his19+ fan.c program: http://www.lsc-group.phys.uwm.edu/%7Eballen/driver/20+ Gabriele Gorla <gorlik@yahoo.com>,21+ Jean Delvare <khali@linux-fr.org>22+23+Description24+-----------25+26+The Standard Microsystems Corporation (SMSC) 47M1xx Super I/O chips27+contain monitoring and PWM control circuitry for two fans.28+29+The 47M15x and 47M192 chips contain a full 'hardware monitoring block'30+in addition to the fan monitoring and control. The hardware monitoring31+block is not supported by the driver.32+33+Fan rotation speeds are reported in RPM (rotations per minute). An alarm is34+triggered if the rotation speed has dropped below a programmable limit. Fan35+readings can be divided by a programmable divider (1, 2, 4 or 8) to give36+the readings more range or accuracy. Not all RPM values can accurately be37+represented, so some rounding is done. With a divider of 2, the lowest38+representable value is around 2600 RPM.39+40+PWM values are from 0 to 255.41+42+If an alarm triggers, it will remain triggered until the hardware register43+is read at least once. This means that the cause for the alarm may44+already have disappeared! Note that in the current implementation, all45+hardware registers are read whenever any data is read (unless it is less46+than 1.5 seconds since the last update). This means that you can easily47+miss once-only alarms.48+49+50+**********************51+The lm_sensors project gratefully acknowledges the support of52+Intel in the development of this driver.
···1+Kernel driver via686a2+=====================3+4+Supported chips:5+ * Via VT82C686A, VT82C686B Southbridge Integrated Hardware Monitor6+ Prefix: 'via686a'7+ Addresses scanned: ISA in PCI-space encoded address8+ Datasheet: On request through web form (http://www.via.com.tw/en/support/datasheets/)9+10+Authors:11+ Ky�sti M�lkki <kmalkki@cc.hut.fi>,12+ Mark D. Studebaker <mdsxyz123@yahoo.com>13+ Bob Dougherty <bobd@stanford.edu>14+ (Some conversion-factor data were contributed by15+ Jonathan Teh Soon Yew <j.teh@iname.com>16+ and Alex van Kaam <darkside@chello.nl>.)17+18+Module Parameters19+-----------------20+21+force_addr=0xaddr Set the I/O base address. Useful for Asus A7V boards22+ that don't set the address in the BIOS. Does not do a23+ PCI force; the via686a must still be present in lspci.24+ Don't use this unless the driver complains that the25+ base address is not set.26+ Example: 'modprobe via686a force_addr=0x6000'27+28+Description29+-----------30+31+The driver does not distinguish between the chips and reports32+all as a 686A.33+34+The Via 686a southbridge has integrated hardware monitor functionality.35+It also has an I2C bus, but this driver only supports the hardware monitor.36+For the I2C bus driver, see <file:Documentation/i2c/busses/i2c-viapro>37+38+The Via 686a implements three temperature sensors, two fan rotation speed39+sensors, five voltage sensors and alarms.40+41+Temperatures are measured in degrees Celsius. An alarm is triggered once42+when the Overtemperature Shutdown limit is crossed; it is triggered again43+as soon as it drops below the hysteresis value.44+45+Fan rotation speeds are reported in RPM (rotations per minute). An alarm is46+triggered if the rotation speed has dropped below a programmable limit. Fan47+readings can be divided by a programmable divider (1, 2, 4 or 8) to give48+the readings more range or accuracy. Not all RPM values can accurately be49+represented, so some rounding is done. With a divider of 2, the lowest50+representable value is around 2600 RPM.51+52+Voltage sensors (also known as IN sensors) report their values in volts.53+An alarm is triggered if the voltage has crossed a programmable minimum54+or maximum limit. Voltages are internally scalled, so each voltage channel55+has a different resolution and range.56+57+If an alarm triggers, it will remain triggered until the hardware register58+is read at least once. This means that the cause for the alarm may59+already have disappeared! Note that in the current implementation, all60+hardware registers are read whenever any data is read (unless it is less61+than 1.5 seconds since the last update). This means that you can easily62+miss once-only alarms.63+64+The driver only updates its values each 1.5 seconds; reading it more often65+will do no harm, but will return 'old' values.
···1+Kernel driver w83627hf2+======================3+4+Supported chips:5+ * Winbond W83627HF (ISA accesses ONLY)6+ Prefix: 'w83627hf'7+ Addresses scanned: ISA address retrieved from Super I/O registers8+ Datasheet: http://www.winbond.com/PDF/sheet/w83627hf.pdf9+ * Winbond W83627THF10+ Prefix: 'w83627thf'11+ Addresses scanned: ISA address retrieved from Super I/O registers12+ Datasheet: http://www.winbond.com/PDF/sheet/w83627thf.pdf13+ * Winbond W83697HF14+ Prefix: 'w83697hf'15+ Addresses scanned: ISA address retrieved from Super I/O registers16+ Datasheet: http://www.winbond.com/PDF/sheet/697hf.pdf17+ * Winbond W83637HF18+ Prefix: 'w83637hf'19+ Addresses scanned: ISA address retrieved from Super I/O registers20+ Datasheet: http://www.winbond.com/PDF/sheet/w83637hf.pdf21+22+Authors:23+ Frodo Looijaard <frodol@dds.nl>,24+ Philip Edelbrock <phil@netroedge.com>,25+ Mark Studebaker <mdsxyz123@yahoo.com>,26+ Bernhard C. Schrenk <clemy@clemy.org>27+28+Module Parameters29+-----------------30+31+* force_addr: int32+ Initialize the ISA address of the sensors33+* force_i2c: int34+ Initialize the I2C address of the sensors35+* init: int36+ (default is 1)37+ Use 'init=0' to bypass initializing the chip.38+ Try this if your computer crashes when you load the module.39+40+Description41+-----------42+43+This driver implements support for ISA accesses *only* for44+the Winbond W83627HF, W83627THF, W83697HF and W83637HF Super I/O chips.45+We will refer to them collectively as Winbond chips.46+47+This driver supports ISA accesses, which should be more reliable48+than i2c accesses. Also, for Tyan boards which contain both a49+Super I/O chip and a second i2c-only Winbond chip (often a W83782D),50+using this driver will avoid i2c address conflicts and complex51+initialization that were required in the w83781d driver.52+53+If you really want i2c accesses for these Super I/O chips,54+use the w83781d driver. However this is not the preferred method55+now that this ISA driver has been developed.56+57+Technically, the w83627thf does not support a VID reading. However, it's58+possible or even likely that your mainboard maker has routed these signals59+to a specific set of general purpose IO pins (the Asus P4C800-E is one such60+board). The w83627thf driver now interprets these as VID. If the VID on61+your board doesn't work, first see doc/vid in the lm_sensors package. If62+that still doesn't help, email us at lm-sensors@lm-sensors.org.63+64+For further information on this driver see the w83781d driver65+documentation.66+
···1+Kernel driver w83781d2+=====================3+4+Supported chips:5+ * Winbond W83781D6+ Prefix: 'w83781d'7+ Addresses scanned: I2C 0x20 - 0x2f, ISA 0x290 (8 I/O ports)8+ Datasheet: http://www.winbond-usa.com/products/winbond_products/pdfs/PCIC/w83781d.pdf9+ * Winbond W83782D10+ Prefix: 'w83782d'11+ Addresses scanned: I2C 0x20 - 0x2f, ISA 0x290 (8 I/O ports)12+ Datasheet: http://www.winbond.com/PDF/sheet/w83782d.pdf13+ * Winbond W83783S14+ Prefix: 'w83783s'15+ Addresses scanned: I2C 0x2d16+ Datasheet: http://www.winbond-usa.com/products/winbond_products/pdfs/PCIC/w83783s.pdf17+ * Winbond W83627HF18+ Prefix: 'w83627hf'19+ Addresses scanned: I2C 0x20 - 0x2f, ISA 0x290 (8 I/O ports)20+ Datasheet: http://www.winbond.com/PDF/sheet/w83627hf.pdf21+ * Asus AS99127F22+ Prefix: 'as99127f'23+ Addresses scanned: I2C 0x28 - 0x2f24+ Datasheet: Unavailable from Asus25+26+Authors:27+ Frodo Looijaard <frodol@dds.nl>,28+ Philip Edelbrock <phil@netroedge.com>,29+ Mark Studebaker <mdsxyz123@yahoo.com>30+31+Module parameters32+-----------------33+34+* init int35+ (default 1)36+ Use 'init=0' to bypass initializing the chip.37+ Try this if your computer crashes when you load the module.38+39+force_subclients=bus,caddr,saddr,saddr40+ This is used to force the i2c addresses for subclients of41+ a certain chip. Typical usage is `force_subclients=0,0x2d,0x4a,0x4b'42+ to force the subclients of chip 0x2d on bus 0 to i2c addresses43+ 0x4a and 0x4b. This parameter is useful for certain Tyan boards.44+45+Description46+-----------47+48+This driver implements support for the Winbond W83781D, W83782D, W83783S,49+W83627HF chips, and the Asus AS99127F chips. We will refer to them50+collectively as W8378* chips.51+52+There is quite some difference between these chips, but they are similar53+enough that it was sensible to put them together in one driver.54+The W83627HF chip is assumed to be identical to the ISA W83782D.55+The Asus chips are similar to an I2C-only W83782D.56+57+Chip #vin #fanin #pwm #temp wchipid vendid i2c ISA58+as99127f 7 3 0 3 0x31 0x12c3 yes no59+as99127f rev.2 (type_name = as99127f) 0x31 0x5ca3 yes no60+w83781d 7 3 0 3 0x10-1 0x5ca3 yes yes61+w83627hf 9 3 2 3 0x21 0x5ca3 yes yes(LPC)62+w83782d 9 3 2-4 3 0x30 0x5ca3 yes yes63+w83783s 5-6 3 2 1-2 0x40 0x5ca3 yes no64+65+Detection of these chips can sometimes be foiled because they can be in66+an internal state that allows no clean access. If you know the address67+of the chip, use a 'force' parameter; this will put them into a more68+well-behaved state first.69+70+The W8378* implements temperature sensors (three on the W83781D and W83782D,71+two on the W83783S), three fan rotation speed sensors, voltage sensors72+(seven on the W83781D, nine on the W83782D and six on the W83783S), VID73+lines, alarms with beep warnings, and some miscellaneous stuff.74+75+Temperatures are measured in degrees Celsius. There is always one main76+temperature sensor, and one (W83783S) or two (W83781D and W83782D) other77+sensors. An alarm is triggered for the main sensor once when the78+Overtemperature Shutdown limit is crossed; it is triggered again as soon as79+it drops below the Hysteresis value. A more useful behavior80+can be found by setting the Hysteresis value to +127 degrees Celsius; in81+this case, alarms are issued during all the time when the actual temperature82+is above the Overtemperature Shutdown value. The driver sets the83+hysteresis value for temp1 to 127 at initialization.84+85+For the other temperature sensor(s), an alarm is triggered when the86+temperature gets higher then the Overtemperature Shutdown value; it stays87+on until the temperature falls below the Hysteresis value. But on the88+W83781D, there is only one alarm that functions for both other sensors!89+Temperatures are guaranteed within a range of -55 to +125 degrees. The90+main temperature sensors has a resolution of 1 degree; the other sensor(s)91+of 0.5 degree.92+93+Fan rotation speeds are reported in RPM (rotations per minute). An alarm is94+triggered if the rotation speed has dropped below a programmable limit. Fan95+readings can be divided by a programmable divider (1, 2, 4 or 8 for the96+W83781D; 1, 2, 4, 8, 16, 32, 64 or 128 for the others) to give97+the readings more range or accuracy. Not all RPM values can accurately98+be represented, so some rounding is done. With a divider of 2, the lowest99+representable value is around 2600 RPM.100+101+Voltage sensors (also known as IN sensors) report their values in volts.102+An alarm is triggered if the voltage has crossed a programmable minimum103+or maximum limit. Note that minimum in this case always means 'closest to104+zero'; this is important for negative voltage measurements. All voltage105+inputs can measure voltages between 0 and 4.08 volts, with a resolution106+of 0.016 volt.107+108+The VID lines encode the core voltage value: the voltage level your processor109+should work with. This is hardcoded by the mainboard and/or processor itself.110+It is a value in volts. When it is unconnected, you will often find the111+value 3.50 V here.112+113+The W83782D and W83783S temperature conversion machine understands about114+several kinds of temperature probes. You can program the so-called115+beta value in the sensor files. '1' is the PII/Celeron diode, '2' is the116+TN3904 transistor, and 3435 the default thermistor value. Other values117+are (not yet) supported.118+119+In addition to the alarms described above, there is a CHAS alarm on the120+chips which triggers if your computer case is open.121+122+When an alarm goes off, you can be warned by a beeping signal through123+your computer speaker. It is possible to enable all beeping globally,124+or only the beeping for some alarms.125+126+If an alarm triggers, it will remain triggered until the hardware register127+is read at least once. This means that the cause for the alarm may128+already have disappeared! Note that in the current implementation, all129+hardware registers are read whenever any data is read (unless it is less130+than 1.5 seconds since the last update). This means that you can easily131+miss once-only alarms.132+133+The chips only update values each 1.5 seconds; reading them more often134+will do no harm, but will return 'old' values.135+136+AS99127F PROBLEMS137+-----------------138+The as99127f support was developed without the benefit of a datasheet.139+In most cases it is treated as a w83781d (although revision 2 of the140+AS99127F looks more like a w83782d).141+This support will be BETA until a datasheet is released.142+One user has reported problems with fans stopping143+occasionally.144+145+Note that the individual beep bits are inverted from the other chips.146+The driver now takes care of this so that user-space applications147+don't have to know about it.148+149+Known problems:150+ - Problems with diode/thermistor settings (supported?)151+ - One user reports fans stopping under high server load.152+ - Revision 2 seems to have 2 PWM registers but we don't know153+ how to handle them. More details below.154+155+These will not be fixed unless we get a datasheet.156+If you have problems, please lobby Asus to release a datasheet.157+Unfortunately several others have without success.158+Please do not send mail to us asking for better as99127f support.159+We have done the best we can without a datasheet.160+Please do not send mail to the author or the sensors group asking for161+a datasheet or ideas on how to convince Asus. We can't help.162+163+164+NOTES:165+-----166+ 783s has no in1 so that in[2-6] are compatible with the 781d/782d.167+168+ 783s pin is programmable for -5V or temp1; defaults to -5V,169+ no control in driver so temp1 doesn't work.170+171+ 782d and 783s datasheets differ on which is pwm1 and which is pwm2.172+ We chose to follow 782d.173+174+ 782d and 783s pin is programmable for fan3 input or pwm2 output;175+ defaults to fan3 input.176+ If pwm2 is enabled (with echo 255 1 > pwm2), then177+ fan3 will report 0.178+179+ 782d has pwm1-2 for ISA, pwm1-4 for i2c. (pwm3-4 share pins with180+ the ISA pins)181+182+Data sheet updates:183+------------------184+ - PWM clock registers:185+186+ 000: master / 512187+ 001: master / 1024188+ 010: master / 2048189+ 011: master / 4096190+ 100: master / 8192191+192+193+Answers from Winbond tech support194+---------------------------------195+>196+> 1) In the W83781D data sheet section 7.2 last paragraph, it talks about197+> reprogramming the R-T table if the Beta of the thermistor is not198+> 3435K. The R-T table is described briefly in section 8.20.199+> What formulas do I use to program a new R-T table for a given Beta?200+>201+ We are sorry that the calculation for R-T table value is202+confidential. If you have another Beta value of thermistor, we can help203+to calculate the R-T table for you. But you should give us real R-T204+Table which can be gotten by thermistor vendor. Therefore we will calculate205+them and obtain 32-byte data, and you can fill the 32-byte data to the206+register in Bank0.CR51 of W83781D.207+208+209+> 2) In the W83782D data sheet, it mentions that pins 38, 39, and 40 are210+> programmable to be either thermistor or Pentium II diode inputs.211+> How do I program them for diode inputs? I can't find any register212+> to program these to be diode inputs.213+ --> You may program Bank0 CR[5Dh] and CR[59h] registers.214+215+ CR[5Dh] bit 1(VTIN1) bit 2(VTIN2) bit 3(VTIN3)216+217+ thermistor 0 0 0218+ diode 1 1 1219+220+221+(error) CR[59h] bit 4(VTIN1) bit 2(VTIN2) bit 3(VTIN3)222+(right) CR[59h] bit 4(VTIN1) bit 5(VTIN2) bit 6(VTIN3)223+224+ PII thermal diode 1 1 1225+ 2N3904 diode 0 0 0226+227+228+Asus Clones229+-----------230+231+We have no datasheets for the Asus clones (AS99127F and ASB100 Bach).232+Here are some very useful information that were given to us by Alex Van233+Kaam about how to detect these chips, and how to read their values. He234+also gives advice for another Asus chipset, the Mozart-2 (which we235+don't support yet). Thanks Alex!236+I reworded some parts and added personal comments.237+238+# Detection:239+240+AS99127F rev.1, AS99127F rev.2 and ASB100:241+- I2C address range: 0x29 - 0x2F242+- If register 0x58 holds 0x31 then we have an Asus (either ASB100 or243+ AS99127F)244+- Which one depends on register 0x4F (manufacturer ID):245+ 0x06 or 0x94: ASB100246+ 0x12 or 0xC3: AS99127F rev.1247+ 0x5C or 0xA3: AS99127F rev.2248+ Note that 0x5CA3 is Winbond's ID (WEC), which let us think Asus get their249+ AS99127F rev.2 direct from Winbond. The other codes mean ATT and DVC,250+ respectively. ATT could stand for Asustek something (although it would be251+ very badly chosen IMHO), I don't know what DVC could stand for. Maybe252+ these codes simply aren't meant to be decoded that way.253+254+Mozart-2:255+- I2C address: 0x77256+- If register 0x58 holds 0x56 or 0x10 then we have a Mozart-2257+- Of the Mozart there are 3 types:258+ 0x58=0x56, 0x4E=0x94, 0x4F=0x36: Asus ASM58 Mozart-2259+ 0x58=0x56, 0x4E=0x94, 0x4F=0x06: Asus AS2K129R Mozart-2260+ 0x58=0x10, 0x4E=0x5C, 0x4F=0xA3: Asus ??? Mozart-2261+ You can handle all 3 the exact same way :)262+263+# Temperature sensors:264+265+ASB100:266+- sensor 1: register 0x27267+- sensor 2 & 3 are the 2 LM75's on the SMBus268+- sensor 4: register 0x17269+Remark: I noticed that on Intel boards sensor 2 is used for the CPU270+ and 4 is ignored/stuck, on AMD boards sensor 4 is the CPU and sensor 2 is271+ either ignored or a socket temperature.272+273+AS99127F (rev.1 and 2 alike):274+- sensor 1: register 0x27275+- sensor 2 & 3 are the 2 LM75's on the SMBus276+Remark: Register 0x5b is suspected to be temperature type selector. Bit 1277+ would control temp1, bit 3 temp2 and bit 5 temp3.278+279+Mozart-2:280+- sensor 1: register 0x27281+- sensor 2: register 0x13282+283+# Fan sensors:284+285+ASB100, AS99127F (rev.1 and 2 alike):286+- 3 fans, identical to the W83781D287+288+Mozart-2:289+- 2 fans only, 1350000/RPM/div290+- fan 1: register 0x28, divisor on register 0xA1 (bits 4-5)291+- fan 2: register 0x29, divisor on register 0xA1 (bits 6-7)292+293+# Voltages:294+295+This is where there is a difference between AS99127F rev.1 and 2.296+Remark: The difference is similar to the difference between297+ W83781D and W83782D.298+299+ASB100:300+in0=r(0x20)*0.016301+in1=r(0x21)*0.016302+in2=r(0x22)*0.016303+in3=r(0x23)*0.016*1.68304+in4=r(0x24)*0.016*3.8305+in5=r(0x25)*(-0.016)*3.97306+in6=r(0x26)*(-0.016)*1.666307+308+AS99127F rev.1:309+in0=r(0x20)*0.016310+in1=r(0x21)*0.016311+in2=r(0x22)*0.016312+in3=r(0x23)*0.016*1.68313+in4=r(0x24)*0.016*3.8314+in5=r(0x25)*(-0.016)*3.97315+in6=r(0x26)*(-0.016)*1.503316+317+AS99127F rev.2:318+in0=r(0x20)*0.016319+in1=r(0x21)*0.016320+in2=r(0x22)*0.016321+in3=r(0x23)*0.016*1.68322+in4=r(0x24)*0.016*3.8323+in5=(r(0x25)*0.016-3.6)*5.14+3.6324+in6=(r(0x26)*0.016-3.6)*3.14+3.6325+326+Mozart-2:327+in0=r(0x20)*0.016328+in1=255329+in2=r(0x22)*0.016330+in3=r(0x23)*0.016*1.68331+in4=r(0x24)*0.016*4332+in5=255333+in6=255334+335+336+# PWM337+338+Additional info about PWM on the AS99127F (may apply to other Asus339+chips as well) by Jean Delvare as of 2004-04-09:340+341+AS99127F revision 2 seems to have two PWM registers at 0x59 and 0x5A,342+and a temperature sensor type selector at 0x5B (which basically means343+that they swapped registers 0x59 and 0x5B when you compare with Winbond344+chips).345+Revision 1 of the chip also has the temperature sensor type selector at346+0x5B, but PWM registers have no effect.347+348+We don't know exactly how the temperature sensor type selection works.349+Looks like bits 1-0 are for temp1, bits 3-2 for temp2 and bits 5-4 for350+temp3, although it is possible that only the most significant bit matters351+each time. So far, values other than 0 always broke the readings.352+353+PWM registers seem to be split in two parts: bit 7 is a mode selector,354+while the other bits seem to define a value or threshold.355+356+When bit 7 is clear, bits 6-0 seem to hold a threshold value. If the value357+is below a given limit, the fan runs at low speed. If the value is above358+the limit, the fan runs at full speed. We have no clue as to what the limit359+represents. Note that there seem to be some inertia in this mode, speed360+changes may need some time to trigger. Also, an hysteresis mechanism is361+suspected since walking through all the values increasingly and then362+decreasingly led to slightly different limits.363+364+When bit 7 is set, bits 3-0 seem to hold a threshold value, while bits 6-4365+would not be significant. If the value is below a given limit, the fan runs366+at full speed, while if it is above the limit it runs at low speed (so this367+is the contrary of the other mode, in a way). Here again, we don't know368+what the limit is supposed to represent.369+370+One remarkable thing is that the fans would only have two or three371+different speeds (transitional states left apart), not a whole range as372+you usually get with PWM.373+374+As a conclusion, you can write 0x00 or 0x8F to the PWM registers to make375+fans run at low speed, and 0x7F or 0x80 to make them run at full speed.376+377+Please contact us if you can figure out how it is supposed to work. As378+long as we don't know more, the w83781d driver doesn't handle PWM on379+AS99127F chips at all.380+381+Additional info about PWM on the AS99127F rev.1 by Hector Martin:382+383+I've been fiddling around with the (in)famous 0x59 register and384+found out the following values do work as a form of coarse pwm:385+386+0x80 - seems to turn fans off after some time(1-2 minutes)... might be387+some form of auto-fan-control based on temp? hmm (Qfan? this mobo is an388+old ASUS, it isn't marketed as Qfan. Maybe some beta pre-attemp at Qfan389+that was dropped at the BIOS)390+0x81 - off391+0x82 - slightly "on-ner" than off, but my fans do not get to move. I can392+hear the high-pitched PWM sound that motors give off at too-low-pwm.393+0x83 - now they do move. Estimate about 70% speed or so.394+0x84-0x8f - full on395+396+Changing the high nibble doesn't seem to do much except the high bit397+(0x80) must be set for PWM to work, else the current pwm doesn't seem to398+change.399+400+My mobo is an ASUS A7V266-E. This behavior is similar to what I got401+with speedfan under Windows, where 0-15% would be off, 15-2x% (can't402+remember the exact value) would be 70% and higher would be full on.
+39
Documentation/i2c/chips/w83l785ts
···000000000000000000000000000000000000000
···1+Kernel driver w83l785ts2+=======================3+4+Supported chips:5+ * Winbond W83L785TS-S6+ Prefix: 'w83l785ts'7+ Addresses scanned: I2C 0x2e8+ Datasheet: Publicly available at the Winbond USA website9+ http://www.winbond-usa.com/products/winbond_products/pdfs/PCIC/W83L785TS-S.pdf10+11+Authors:12+ Jean Delvare <khali@linux-fr.org>13+14+Description15+-----------16+17+The W83L785TS-S is a digital temperature sensor. It senses the18+temperature of a single external diode. The high limit is19+theoretically defined as 85 or 100 degrees C through a combination20+of external resistors, so the user cannot change it. Values seen so21+far suggest that the two possible limits are actually 95 and 11022+degrees C. The datasheet is rather poor and obviously inaccurate23+on several points including this one.24+25+All temperature values are given in degrees Celsius. Resolution26+is 1.0 degree. See the datasheet for details.27+28+The w83l785ts driver will not update its values more frequently than29+every other second; reading them more often will do no harm, but will30+return 'old' values.31+32+Known Issues33+------------34+35+On some systems (Asus), the BIOS is known to interfere with the driver36+and cause read errors. The driver will retry a given number of times37+(5 by default) and then give up, returning the old value (or 0 if38+there is no old value). It seems to work well enough so that you should39+not notice anything. Thanks to James Bolt for helping test this feature.
+1-1
Documentation/i2c/porting-clients
···57 Documentation/i2c/sysfs-interface for the individual files. Also58 convert the units these files read and write to the specified ones.59 If you need to add a new type of file, please discuss it on the60- sensors mailing list <sensors@stimpy.netroedge.com> by providing a61 patch to the Documentation/i2c/sysfs-interface file.6263* [Attach] For I2C drivers, the attach function should make sure
···57 Documentation/i2c/sysfs-interface for the individual files. Also58 convert the units these files read and write to the specified ones.59 If you need to add a new type of file, please discuss it on the60+ sensors mailing list <lm-sensors@lm-sensors.org> by providing a61 patch to the Documentation/i2c/sysfs-interface file.6263* [Attach] For I2C drivers, the attach function should make sure
+39
Documentation/i2c/userspace-tools
···000000000000000000000000000000000000000
···1+Introduction2+------------3+4+Most mainboards have sensor chips to monitor system health (like temperatures,5+voltages, fans speed). They are often connected through an I2C bus, but some6+are also connected directly through the ISA bus.7+8+The kernel drivers make the data from the sensor chips available in the /sys9+virtual filesystem. Userspace tools are then used to display or set or the10+data in a more friendly manner.11+12+Lm-sensors13+----------14+15+Core set of utilites that will allow you to obtain health information,16+setup monitoring limits etc. You can get them on their homepage17+http://www.lm-sensors.nu/ or as a package from your Linux distribution.18+19+If from website:20+Get lmsensors from project web site. Please note, you need only userspace21+part, so compile with "make user_install" target.22+23+General hints to get things working:24+25+0) get lm-sensors userspace utils26+1) compile all drivers in I2C section as modules in your kernel27+2) run sensors-detect script, it will tell you what modules you need to load.28+3) load them and run "sensors" command, you should see some results.29+4) fix sensors.conf, labels, limits, fan divisors30+5) if any more problems consult FAQ, or documentation31+32+Other utilites33+--------------34+35+If you want some graphical indicators of system health look for applications36+like: gkrellm, ksensors, xsensors, wmtemp, wmsensors, wmgtemp, ksysguardd,37+hardware-monitor38+39+If you are server administrator you can try snmpd or mrtgutils.
+12-50
Documentation/i2c/writing-clients
···171172 normal_i2c: filled in by the module writer. 173 A list of I2C addresses which should normally be examined.174- normal_i2c_range: filled in by the module writer.175- A list of pairs of I2C addresses, each pair being an inclusive range of176- addresses which should normally be examined.177 probe: insmod parameter. 178 A list of pairs. The first value is a bus number (-1 for any I2C bus), 179 the second is the address. These addresses are also probed, as if they 180 were in the 'normal' list.181- probe_range: insmod parameter. 182- A list of triples. The first value is a bus number (-1 for any I2C bus), 183- the second and third are addresses. These form an inclusive range of 184- addresses that are also probed, as if they were in the 'normal' list.185 ignore: insmod parameter.186 A list of pairs. The first value is a bus number (-1 for any I2C bus), 187 the second is the I2C address. These addresses are never probed. 188- This parameter overrules 'normal' and 'probe', but not the 'force' lists.189- ignore_range: insmod parameter. 190- A list of triples. The first value is a bus number (-1 for any I2C bus), 191- the second and third are addresses. These form an inclusive range of 192- I2C addresses that are never probed.193 This parameter overrules 'normal' and 'probe', but not the 'force' lists.194 force: insmod parameter. 195 A list of pairs. The first value is a bus number (-1 for any I2C bus),196 the second is the I2C address. A device is blindly assumed to be on197 the given address, no probing is done. 198199-Fortunately, as a module writer, you just have to define the `normal' 200-and/or `normal_range' parameters. The complete declaration could look201-like this:202203- /* Scan 0x20 to 0x2f, 0x37, and 0x40 to 0x4f */204- static unsigned short normal_i2c[] = { 0x37,I2C_CLIENT_END }; 205- static unsigned short normal_i2c_range[] = { 0x20, 0x2f, 0x40, 0x4f, 206- I2C_CLIENT_END };207208 /* Magic definition of all other variables and things */209 I2C_CLIENT_INSMOD;210211-Note that you *have* to call the two defined variables `normal_i2c' and212-`normal_i2c_range', without any prefix!213214215Probing classes (sensors)···209210 normal_i2c: filled in by the module writer. Terminated by SENSORS_I2C_END.211 A list of I2C addresses which should normally be examined.212- normal_i2c_range: filled in by the module writer. Terminated by 213- SENSORS_I2C_END214- A list of pairs of I2C addresses, each pair being an inclusive range of215- addresses which should normally be examined.216 normal_isa: filled in by the module writer. Terminated by SENSORS_ISA_END.217 A list of ISA addresses which should normally be examined.218- normal_isa_range: filled in by the module writer. Terminated by 219- SENSORS_ISA_END220- A list of triples. The first two elements are ISA addresses, being an221- range of addresses which should normally be examined. The third is the222- modulo parameter: only addresses which are 0 module this value relative223- to the first address of the range are actually considered.224 probe: insmod parameter. Initialize this list with SENSORS_I2C_END values.225 A list of pairs. The first value is a bus number (SENSORS_ISA_BUS for226 the ISA bus, -1 for any I2C bus), the second is the address. These227 addresses are also probed, as if they were in the 'normal' list.228- probe_range: insmod parameter. Initialize this list with SENSORS_I2C_END 229- values.230- A list of triples. The first value is a bus number (SENSORS_ISA_BUS for231- the ISA bus, -1 for any I2C bus), the second and third are addresses. 232- These form an inclusive range of addresses that are also probed, as233- if they were in the 'normal' list.234 ignore: insmod parameter. Initialize this list with SENSORS_I2C_END values.235 A list of pairs. The first value is a bus number (SENSORS_ISA_BUS for236 the ISA bus, -1 for any I2C bus), the second is the I2C address. These237 addresses are never probed. This parameter overrules 'normal' and 238 'probe', but not the 'force' lists.239- ignore_range: insmod parameter. Initialize this list with SENSORS_I2C_END 240- values.241- A list of triples. The first value is a bus number (SENSORS_ISA_BUS for242- the ISA bus, -1 for any I2C bus), the second and third are addresses. 243- These form an inclusive range of I2C addresses that are never probed.244- This parameter overrules 'normal' and 'probe', but not the 'force' lists.245246Also used is a list of pointers to sensors_force_data structures:247 force_data: insmod parameters. A list, ending with an element of which···233So we have a generic insmod variabled `force', and chip-specific variables234`force_CHIPNAME'.235236-Fortunately, as a module writer, you just have to define the `normal' 237-and/or `normal_range' parameters, and define what chip names are used. 238The complete declaration could look like this:239- /* Scan i2c addresses 0x20 to 0x2f, 0x37, and 0x40 to 0x4f240- static unsigned short normal_i2c[] = {0x37,SENSORS_I2C_END};241- static unsigned short normal_i2c_range[] = {0x20,0x2f,0x40,0x4f,242- SENSORS_I2C_END};243 /* Scan ISA address 0x290 */244 static unsigned int normal_isa[] = {0x0290,SENSORS_ISA_END};245- static unsigned int normal_isa_range[] = {SENSORS_ISA_END};246247 /* Define chips foo and bar, as well as all module parameters and things */248 SENSORS_INSMOD_2(foo,bar);
···171172 normal_i2c: filled in by the module writer. 173 A list of I2C addresses which should normally be examined.000174 probe: insmod parameter. 175 A list of pairs. The first value is a bus number (-1 for any I2C bus), 176 the second is the address. These addresses are also probed, as if they 177 were in the 'normal' list.0000178 ignore: insmod parameter.179 A list of pairs. The first value is a bus number (-1 for any I2C bus), 180 the second is the I2C address. These addresses are never probed. 00000181 This parameter overrules 'normal' and 'probe', but not the 'force' lists.182 force: insmod parameter. 183 A list of pairs. The first value is a bus number (-1 for any I2C bus),184 the second is the I2C address. A device is blindly assumed to be on185 the given address, no probing is done. 186187+Fortunately, as a module writer, you just have to define the `normal_i2c' 188+parameter. The complete declaration could look like this:0189190+ /* Scan 0x37, and 0x48 to 0x4f */191+ static unsigned short normal_i2c[] = { 0x37, 0x48, 0x49, 0x4a, 0x4b, 0x4c,192+ 0x4d, 0x4e, 0x4f, I2C_CLIENT_END };0193194 /* Magic definition of all other variables and things */195 I2C_CLIENT_INSMOD;196197+Note that you *have* to call the defined variable `normal_i2c',198+without any prefix!199200201Probing classes (sensors)···223224 normal_i2c: filled in by the module writer. Terminated by SENSORS_I2C_END.225 A list of I2C addresses which should normally be examined.0000226 normal_isa: filled in by the module writer. Terminated by SENSORS_ISA_END.227 A list of ISA addresses which should normally be examined.000000228 probe: insmod parameter. Initialize this list with SENSORS_I2C_END values.229 A list of pairs. The first value is a bus number (SENSORS_ISA_BUS for230 the ISA bus, -1 for any I2C bus), the second is the address. These231 addresses are also probed, as if they were in the 'normal' list.000000232 ignore: insmod parameter. Initialize this list with SENSORS_I2C_END values.233 A list of pairs. The first value is a bus number (SENSORS_ISA_BUS for234 the ISA bus, -1 for any I2C bus), the second is the I2C address. These235 addresses are never probed. This parameter overrules 'normal' and 236 'probe', but not the 'force' lists.000000237238Also used is a list of pointers to sensors_force_data structures:239 force_data: insmod parameters. A list, ending with an element of which···269So we have a generic insmod variabled `force', and chip-specific variables270`force_CHIPNAME'.271272+Fortunately, as a module writer, you just have to define the `normal_i2c' 273+and `normal_isa' parameters, and define what chip names are used. 274The complete declaration could look like this:275+ /* Scan i2c addresses 0x37, and 0x48 to 0x4f */276+ static unsigned short normal_i2c[] = { 0x37, 0x48, 0x49, 0x4a, 0x4b, 0x4c,277+ 0x4d, 0x4e, 0x4f, I2C_CLIENT_END };0278 /* Scan ISA address 0x290 */279 static unsigned int normal_isa[] = {0x0290,SENSORS_ISA_END};0280281 /* Define chips foo and bar, as well as all module parameters and things */282 SENSORS_INSMOD_2(foo,bar);
+8-8
MAINTAINERS
···194ADM1025 HARDWARE MONITOR DRIVER195P: Jean Delvare196M: khali@linux-fr.org197-L: sensors@stimpy.netroedge.com198S: Maintained199200ADT746X FAN DRIVER···242ALI1563 I2C DRIVER243P: Rudolf Marek244M: r.marek@sh.cvut.cz245-L: sensors@stimpy.netroedge.com246S: Maintained247248ALPHA PORT···1002M: greg@kroah.com1003P: Jean Delvare1004M: khali@linux-fr.org1005-L: sensors@stimpy.netroedge.com1006W: http://www.lm-sensors.nu/1007S: Maintained1008···1430LM83 HARDWARE MONITOR DRIVER1431P: Jean Delvare1432M: khali@linux-fr.org1433-L: sensors@stimpy.netroedge.com1434S: Maintained14351436LM90 HARDWARE MONITOR DRIVER1437P: Jean Delvare1438M: khali@linux-fr.org1439-L: sensors@stimpy.netroedge.com1440S: Maintained14411442LOGICAL DISK MANAGER SUPPORT (LDM, Windows 2000/XP Dynamic Disks)···2075SMSC47M1 HARDWARE MONITOR DRIVER2076P: Jean Delvare2077M: khali@linux-fr.org2078-L: sensors@stimpy.netroedge.com2079S: Odd Fixes20802081SMB FILESYSTEM···2614W1 DALLAS'S 1-WIRE BUS2615P: Evgeniy Polyakov2616M: johnpol@2ka.mipt.ru2617-L: sensors@stimpy.netroedge.com2618S: Maintained26192620W83L51xD SD/MMC CARD INTERFACE DRIVER···2627W83L785TS HARDWARE MONITOR DRIVER2628P: Jean Delvare2629M: khali@linux-fr.org2630-L: sensors@stimpy.netroedge.com2631S: Odd Fixes26322633WAN ROUTER & SANGOMA WANPIPE DRIVERS & API (X.25, FRAME RELAY, PPP, CISCO HDLC)
···194ADM1025 HARDWARE MONITOR DRIVER195P: Jean Delvare196M: khali@linux-fr.org197+L: lm-sensors@lm-sensors.org198S: Maintained199200ADT746X FAN DRIVER···242ALI1563 I2C DRIVER243P: Rudolf Marek244M: r.marek@sh.cvut.cz245+L: lm-sensors@lm-sensors.org246S: Maintained247248ALPHA PORT···1002M: greg@kroah.com1003P: Jean Delvare1004M: khali@linux-fr.org1005+L: lm-sensors@lm-sensors.org1006W: http://www.lm-sensors.nu/1007S: Maintained1008···1430LM83 HARDWARE MONITOR DRIVER1431P: Jean Delvare1432M: khali@linux-fr.org1433+L: lm-sensors@lm-sensors.org1434S: Maintained14351436LM90 HARDWARE MONITOR DRIVER1437P: Jean Delvare1438M: khali@linux-fr.org1439+L: lm-sensors@lm-sensors.org1440S: Maintained14411442LOGICAL DISK MANAGER SUPPORT (LDM, Windows 2000/XP Dynamic Disks)···2075SMSC47M1 HARDWARE MONITOR DRIVER2076P: Jean Delvare2077M: khali@linux-fr.org2078+L: lm-sensors@lm-sensors.org2079S: Odd Fixes20802081SMB FILESYSTEM···2614W1 DALLAS'S 1-WIRE BUS2615P: Evgeniy Polyakov2616M: johnpol@2ka.mipt.ru2617+L: lm-sensors@lm-sensors.org2618S: Maintained26192620W83L51xD SD/MMC CARD INTERFACE DRIVER···2627W83L785TS HARDWARE MONITOR DRIVER2628P: Jean Delvare2629M: khali@linux-fr.org2630+L: lm-sensors@lm-sensors.org2631S: Odd Fixes26322633WAN ROUTER & SANGOMA WANPIPE DRIVERS & API (X.25, FRAME RELAY, PPP, CISCO HDLC)
···49/*50 * Generate a start condition on the i2c bus.51 *52- * returns after the start condition has occured53 */54static void pca_start(struct i2c_algo_pca_data *adap)55{···62}6364/*65- * Generate a repeated start condition on the i2c bus 66 *67- * return after the repeated start condition has occured68 */69static void pca_repeated_start(struct i2c_algo_pca_data *adap)70{···82 * returns after the stop condition has been generated83 *84 * STOPs do not generate an interrupt or set the SI flag, since the85- * part returns the the idle state (0xf8). Hence we don't need to86 * pca_wait here.87 */88static void pca_stop(struct i2c_algo_pca_data *adap)
···49/*50 * Generate a start condition on the i2c bus.51 *52+ * returns after the start condition has occurred53 */54static void pca_start(struct i2c_algo_pca_data *adap)55{···62}6364/*65+ * Generate a repeated start condition on the i2c bus66 *67+ * return after the repeated start condition has occurred68 */69static void pca_repeated_start(struct i2c_algo_pca_data *adap)70{···82 * returns after the stop condition has been generated83 *84 * STOPs do not generate an interrupt or set the SI flag, since the85+ * part returns the idle state (0xf8). Hence we don't need to86 * pca_wait here.87 */88static void pca_stop(struct i2c_algo_pca_data *adap)
-1
drivers/i2c/algos/i2c-algo-sibyte.c
···2425/* Ported for SiByte SOCs by Broadcom Corporation. */2627-#include <linux/config.h>28#include <linux/kernel.h>29#include <linux/module.h>30#include <linux/init.h>
···2425/* Ported for SiByte SOCs by Broadcom Corporation. */26027#include <linux/kernel.h>28#include <linux/module.h>29#include <linux/init.h>
+17-17
drivers/i2c/busses/Kconfig
···78config I2C_ALI15359 tristate "ALI 1535"10- depends on I2C && PCI && EXPERIMENTAL11 help12 If you say yes to this option, support will be included for the SMB13 Host controller on Acer Labs Inc. (ALI) M1535 South Bridges. The SMB···3132config I2C_ALI15X333 tristate "ALI 15x3"34- depends on I2C && PCI && EXPERIMENTAL35 help36 If you say yes to this option, support will be included for the37 Acer Labs Inc. (ALI) M1514 and M1543 motherboard I2C interfaces.···4142config I2C_AMD75643 tristate "AMD 756/766/768/8111 and nVidia nForce"44- depends on I2C && PCI && EXPERIMENTAL45 help46 If you say yes to this option, support will be included for the AMD47 756/766/768 mainboard I2C interfaces. The driver also includes···6667config I2C_AMD811168 tristate "AMD 8111"69- depends on I2C && PCI && EXPERIMENTAL70 help71 If you say yes to this option, support will be included for the72 second (SMBus 2.0) AMD 8111 mainboard I2C interface.···109110config I2C_I801111 tristate "Intel 82801 (ICH)"112- depends on I2C && PCI && EXPERIMENTAL113 help114 If you say yes to this option, support will be included for the Intel115 801 family of mainboard I2C interfaces. Specifically, the following···130131config I2C_I810132 tristate "Intel 810/815"133- depends on I2C && PCI && EXPERIMENTAL134 select I2C_ALGOBIT135 help136 If you say yes to this option, support will be included for the Intel···183184config I2C_ISA185 tristate "ISA Bus support"186- depends on I2C && EXPERIMENTAL187 help188 If you say yes to this option, support will be included for i2c189 interfaces that are on the ISA bus.···248 will be called i2c-mpc.249250config I2C_NFORCE2251- tristate "Nvidia Nforce2"252- depends on I2C && PCI && EXPERIMENTAL253 help254 If you say yes to this option, support will be included for the Nvidia255- Nforce2 family of mainboard I2C interfaces.256- This driver also supports the nForce3 Pro 150 MCP.257258 This driver can also be built as a module. If so, the module259 will be called i2c-nforce2.···304305config I2C_PROSAVAGE306 tristate "S3/VIA (Pro)Savage"307- depends on I2C && PCI && EXPERIMENTAL308 select I2C_ALGOBIT309 help310 If you say yes to this option, support will be included for the···387388config I2C_SIS5595389 tristate "SiS 5595"390- depends on I2C && PCI && EXPERIMENTAL391 help392 If you say yes to this option, support will be included for the 393 SiS5595 SMBus (a subset of I2C) interface.···397398config I2C_SIS630399 tristate "SiS 630/730"400- depends on I2C && PCI && EXPERIMENTAL401 help402 If you say yes to this option, support will be included for the 403 SiS630 and SiS730 SMBus (a subset of I2C) interface.···407408config I2C_SIS96X409 tristate "SiS 96x"410- depends on I2C && PCI && EXPERIMENTAL411 help412 If you say yes to this option, support will be included for the SiS413 96x SMBus (a subset of I2C) interfaces. Specifically, the following···418 648/961419 650/961420 7350421422 This driver can also be built as a module. If so, the module423 will be called i2c-sis96x.···449450config I2C_VIAPRO451 tristate "VIA 82C596/82C686/823x"452- depends on I2C && PCI && EXPERIMENTAL453 help454 If you say yes to this option, support will be included for the VIA455 82C596/82C686/823x I2C interfaces. Specifically, the following ···467468config I2C_VOODOO3469 tristate "Voodoo 3"470- depends on I2C && PCI && EXPERIMENTAL471 select I2C_ALGOBIT472 help473 If you say yes to this option, support will be included for the
···78config I2C_ALI15359 tristate "ALI 1535"10+ depends on I2C && PCI11 help12 If you say yes to this option, support will be included for the SMB13 Host controller on Acer Labs Inc. (ALI) M1535 South Bridges. The SMB···3132config I2C_ALI15X333 tristate "ALI 15x3"34+ depends on I2C && PCI35 help36 If you say yes to this option, support will be included for the37 Acer Labs Inc. (ALI) M1514 and M1543 motherboard I2C interfaces.···4142config I2C_AMD75643 tristate "AMD 756/766/768/8111 and nVidia nForce"44+ depends on I2C && PCI45 help46 If you say yes to this option, support will be included for the AMD47 756/766/768 mainboard I2C interfaces. The driver also includes···6667config I2C_AMD811168 tristate "AMD 8111"69+ depends on I2C && PCI70 help71 If you say yes to this option, support will be included for the72 second (SMBus 2.0) AMD 8111 mainboard I2C interface.···109110config I2C_I801111 tristate "Intel 82801 (ICH)"112+ depends on I2C && PCI113 help114 If you say yes to this option, support will be included for the Intel115 801 family of mainboard I2C interfaces. Specifically, the following···130131config I2C_I810132 tristate "Intel 810/815"133+ depends on I2C && PCI134 select I2C_ALGOBIT135 help136 If you say yes to this option, support will be included for the Intel···183184config I2C_ISA185 tristate "ISA Bus support"186+ depends on I2C187 help188 If you say yes to this option, support will be included for i2c189 interfaces that are on the ISA bus.···248 will be called i2c-mpc.249250config I2C_NFORCE2251+ tristate "Nvidia nForce2, nForce3 and nForce4"252+ depends on I2C && PCI253 help254 If you say yes to this option, support will be included for the Nvidia255+ nForce2, nForce3 and nForce4 families of mainboard I2C interfaces.0256257 This driver can also be built as a module. If so, the module258 will be called i2c-nforce2.···305306config I2C_PROSAVAGE307 tristate "S3/VIA (Pro)Savage"308+ depends on I2C && PCI309 select I2C_ALGOBIT310 help311 If you say yes to this option, support will be included for the···388389config I2C_SIS5595390 tristate "SiS 5595"391+ depends on I2C && PCI392 help393 If you say yes to this option, support will be included for the 394 SiS5595 SMBus (a subset of I2C) interface.···398399config I2C_SIS630400 tristate "SiS 630/730"401+ depends on I2C && PCI402 help403 If you say yes to this option, support will be included for the 404 SiS630 and SiS730 SMBus (a subset of I2C) interface.···408409config I2C_SIS96X410 tristate "SiS 96x"411+ depends on I2C && PCI412 help413 If you say yes to this option, support will be included for the SiS414 96x SMBus (a subset of I2C) interfaces. Specifically, the following···419 648/961420 650/961421 735422+ 745423424 This driver can also be built as a module. If so, the module425 will be called i2c-sis96x.···449450config I2C_VIAPRO451 tristate "VIA 82C596/82C686/823x"452+ depends on I2C && PCI453 help454 If you say yes to this option, support will be included for the VIA455 82C596/82C686/823x I2C interfaces. Specifically, the following ···467468config I2C_VOODOO3469 tristate "Voodoo 3"470+ depends on I2C && PCI471 select I2C_ALGOBIT472 help473 If you say yes to this option, support will be included for the
-1
drivers/i2c/busses/i2c-ali1535.c
···5354/* Note: we assume there can only be one ALI1535, with one SMBus interface */5556-#include <linux/config.h>57#include <linux/module.h>58#include <linux/pci.h>59#include <linux/kernel.h>
···5354/* Note: we assume there can only be one ALI1535, with one SMBus interface */55056#include <linux/module.h>57#include <linux/pci.h>58#include <linux/kernel.h>
-1
drivers/i2c/busses/i2c-ali15x3.c
···6061/* Note: we assume there can only be one ALI15X3, with one SMBus interface */6263-#include <linux/config.h>64#include <linux/module.h>65#include <linux/pci.h>66#include <linux/kernel.h>
···6061/* Note: we assume there can only be one ALI15X3, with one SMBus interface */62063#include <linux/module.h>64#include <linux/pci.h>65#include <linux/kernel.h>
-1
drivers/i2c/busses/i2c-amd756.c
···37 Note: we assume there can only be one device, with one SMBus interface.38*/3940-#include <linux/config.h>41#include <linux/module.h>42#include <linux/pci.h>43#include <linux/kernel.h>
···37 Note: we assume there can only be one device, with one SMBus interface.38*/39040#include <linux/module.h>41#include <linux/pci.h>42#include <linux/kernel.h>
-1
drivers/i2c/busses/i2c-amd8111.c
···8 * the Free Software Foundation version 2.9 */1011-#include <linux/config.h>12#include <linux/module.h>13#include <linux/pci.h>14#include <linux/kernel.h>
···8 * the Free Software Foundation version 2.9 */10011#include <linux/module.h>12#include <linux/pci.h>13#include <linux/kernel.h>
-1
drivers/i2c/busses/i2c-au1550.c
···27 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.28 */2930-#include <linux/config.h>31#include <linux/delay.h>32#include <linux/kernel.h>33#include <linux/module.h>
···27 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.28 */29030#include <linux/delay.h>31#include <linux/kernel.h>32#include <linux/module.h>
-1
drivers/i2c/busses/i2c-elektor.c
···25/* Partialy rewriten by Oleg I. Vdovikin for mmapped support of 26 for Alpha Processor Inc. UP-2000(+) boards */2728-#include <linux/config.h>29#include <linux/kernel.h>30#include <linux/ioport.h>31#include <linux/module.h>
···25/* Partialy rewriten by Oleg I. Vdovikin for mmapped support of 26 for Alpha Processor Inc. UP-2000(+) boards */27028#include <linux/kernel.h>29#include <linux/ioport.h>30#include <linux/module.h>
-1
drivers/i2c/busses/i2c-frodo.c
···12 * version 2 as published by the Free Software Foundation.13 */1415-#include <linux/config.h>16#include <linux/module.h>17#include <linux/kernel.h>18#include <linux/init.h>
···12 * version 2 as published by the Free Software Foundation.13 */14015#include <linux/module.h>16#include <linux/kernel.h>17#include <linux/init.h>
-1
drivers/i2c/busses/i2c-i801.c
···4142/* Note: we assume there can only be one I801, with one SMBus interface */4344-#include <linux/config.h>45#include <linux/module.h>46#include <linux/pci.h>47#include <linux/kernel.h>
···4142/* Note: we assume there can only be one I801, with one SMBus interface */43044#include <linux/module.h>45#include <linux/pci.h>46#include <linux/kernel.h>
···85 u32 cr = IOP3XX_ICR_GCD | IOP3XX_ICR_SCLEN | IOP3XX_ICR_UE;8687 /* 88- * Everytime unit enable is asserted, GPOD needs to be cleared89 * on IOP321 to avoid data corruption on the bus.90 */91#ifdef CONFIG_ARCH_IOP321
···85 u32 cr = IOP3XX_ICR_GCD | IOP3XX_ICR_SCLEN | IOP3XX_ICR_UE;8687 /* 88+ * Every time unit enable is asserted, GPOD needs to be cleared89 * on IOP321 to avoid data corruption on the bus.90 */91#ifdef CONFIG_ARCH_IOP321
-1
drivers/i2c/busses/i2c-isa.c
···24 the SMBus and the ISA bus very much easier. See lm78.c for an example25 of this. */2627-#include <linux/config.h>28#include <linux/init.h>29#include <linux/module.h>30#include <linux/kernel.h>
···24 the SMBus and the ISA bus very much easier. See lm78.c for an example25 of this. */26027#include <linux/init.h>28#include <linux/module.h>29#include <linux/kernel.h>
-1
drivers/i2c/busses/i2c-ite.c
···33/* With some changes from Ky�sti M�lkki <kmalkki@cc.hut.fi> and even34 Frodo Looijaard <frodol@dds.nl> */3536-#include <linux/config.h>37#include <linux/kernel.h>38#include <linux/ioport.h>39#include <linux/module.h>
···33/* With some changes from Ky�sti M�lkki <kmalkki@cc.hut.fi> and even34 Frodo Looijaard <frodol@dds.nl> */35036#include <linux/kernel.h>37#include <linux/ioport.h>38#include <linux/module.h>
-5
drivers/i2c/busses/i2c-ixp2000.c
···26 * 'enabled' to drive the GPIOs.27 */2829-#include <linux/config.h>30-#ifdef CONFIG_I2C_DEBUG_BUS31-#define DEBUG 132-#endif33-34#include <linux/kernel.h>35#include <linux/init.h>36#include <linux/device.h>
···26 * 'enabled' to drive the GPIOs.27 */280000029#include <linux/kernel.h>30#include <linux/init.h>31#include <linux/device.h>
-5
drivers/i2c/busses/i2c-ixp4xx.c
···26 * that is passed as the platform_data to this driver.27 */2829-#include <linux/config.h>30-#ifdef CONFIG_I2C_DEBUG_BUS31-#define DEBUG 132-#endif33-34#include <linux/kernel.h>35#include <linux/init.h>36#include <linux/device.h>
···26 * that is passed as the platform_data to this driver.27 */280000029#include <linux/kernel.h>30#include <linux/init.h>31#include <linux/device.h>
-1
drivers/i2c/busses/i2c-keywest.c
···46 sound driver to be happy47*/4849-#include <linux/config.h>50#include <linux/module.h>51#include <linux/kernel.h>52#include <linux/ioport.h>
···46 sound driver to be happy47*/48049#include <linux/module.h>50#include <linux/kernel.h>51#include <linux/ioport.h>
···3738/* Note: we assume there can only be one nForce2, with two SMBus interfaces */3940-#include <linux/config.h>41#include <linux/module.h>42#include <linux/pci.h>43#include <linux/kernel.h>
···3738/* Note: we assume there can only be one nForce2, with two SMBus interfaces */39040#include <linux/module.h>41#include <linux/pci.h>42#include <linux/kernel.h>
-1
drivers/i2c/busses/i2c-parport-light.c
···24 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.25 * ------------------------------------------------------------------------ */2627-#include <linux/config.h>28#include <linux/kernel.h>29#include <linux/module.h>30#include <linux/init.h>
···24 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.25 * ------------------------------------------------------------------------ */26027#include <linux/kernel.h>28#include <linux/module.h>29#include <linux/init.h>
+1-2
drivers/i2c/busses/i2c-parport.c
···24 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.25 * ------------------------------------------------------------------------ */2627-#include <linux/config.h>28#include <linux/kernel.h>29#include <linux/module.h>30#include <linux/init.h>···130/* Encapsulate the functions above in the correct structure.131 Note that this is only a template, from which the real structures are132 copied. The attaching code will set getscl to NULL for adapters that133- cannot read SCL back, and will also make the the data field point to134 the parallel port structure. */135static struct i2c_algo_bit_data parport_algo_data = {136 .setsda = parport_setsda,
···24 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.25 * ------------------------------------------------------------------------ */26027#include <linux/kernel.h>28#include <linux/module.h>29#include <linux/init.h>···131/* Encapsulate the functions above in the correct structure.132 Note that this is only a template, from which the real structures are133 copied. The attaching code will set getscl to NULL for adapters that134+ cannot read SCL back, and will also make the data field point to135 the parallel port structure. */136static struct i2c_algo_bit_data parport_algo_data = {137 .setsda = parport_setsda,
-1
drivers/i2c/busses/i2c-pca-isa.c
···17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.18 */1920-#include <linux/config.h>21#include <linux/kernel.h>22#include <linux/ioport.h>23#include <linux/module.h>
···17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.18 */19020#include <linux/kernel.h>21#include <linux/ioport.h>22#include <linux/module.h>
-1
drivers/i2c/busses/i2c-piix4.c
···28 Note: we assume there can only be one device, with one SMBus interface.29*/3031-#include <linux/config.h>32#include <linux/module.h>33#include <linux/moduleparam.h>34#include <linux/pci.h>
···28 Note: we assume there can only be one device, with one SMBus interface.29*/30031#include <linux/module.h>32#include <linux/moduleparam.h>33#include <linux/pci.h>
···20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA21*/22023#include <linux/kernel.h>24#include <linux/module.h>25···534/* s3c24xx_i2c_xfer535 *536 * first port of call from the i2c bus code when an message needs537- * transfering across the i2c bus.538*/539540static int s3c24xx_i2c_xfer(struct i2c_adapter *adap,
···20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA21*/2223+#include <linux/config.h>24#include <linux/kernel.h>25#include <linux/module.h>26···533/* s3c24xx_i2c_xfer534 *535 * first port of call from the i2c bus code when an message needs536+ * transferring across the i2c bus.537*/538539static int s3c24xx_i2c_xfer(struct i2c_adapter *adap,
-1
drivers/i2c/busses/i2c-savage4.c
···29 it easier to add later.30*/3132-#include <linux/config.h>33#include <linux/kernel.h>34#include <linux/module.h>35#include <linux/init.h>
···29 it easier to add later.30*/31032#include <linux/kernel.h>33#include <linux/module.h>34#include <linux/init.h>
-1
drivers/i2c/busses/i2c-sibyte.c
···17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.18 */1920-#include <linux/config.h>21#include <linux/module.h>22#include <linux/i2c-algo-sibyte.h>23#include <asm/sibyte/sb1250_regs.h>
···17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.18 */19020#include <linux/module.h>21#include <linux/i2c-algo-sibyte.h>22#include <asm/sibyte/sb1250_regs.h>
···48 Note: we assume there can only be one device, with one SMBus interface.49*/5051-#include <linux/config.h>52#include <linux/kernel.h>53#include <linux/module.h>54#include <linux/delay.h>
···48 Note: we assume there can only be one device, with one SMBus interface.49*/50051#include <linux/kernel.h>52#include <linux/module.h>53#include <linux/delay.h>
-1
drivers/i2c/busses/i2c-sis96x.c
···32 We assume there can only be one SiS96x with one SMBus interface.33*/3435-#include <linux/config.h>36#include <linux/module.h>37#include <linux/pci.h>38#include <linux/kernel.h>
···32 We assume there can only be one SiS96x with one SMBus interface.33*/34035#include <linux/module.h>36#include <linux/pci.h>37#include <linux/kernel.h>
···21 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.22*/2324-#include <linux/config.h>25#include <linux/kernel.h>26#include <linux/module.h>27#include <linux/pci.h>
···21 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.22*/23024#include <linux/kernel.h>25#include <linux/module.h>26#include <linux/pci.h>
-1
drivers/i2c/busses/i2c-viapro.c
···33 Note: we assume there can only be one device, with one SMBus interface.34*/3536-#include <linux/config.h>37#include <linux/module.h>38#include <linux/delay.h>39#include <linux/pci.h>
···33 Note: we assume there can only be one device, with one SMBus interface.34*/35036#include <linux/module.h>37#include <linux/delay.h>38#include <linux/pci.h>
-1
drivers/i2c/busses/i2c-voodoo3.c
···27/* This interfaces to the I2C bus of the Voodoo3 to gain access to28 the BT869 and possibly other I2C devices. */2930-#include <linux/config.h>31#include <linux/kernel.h>32#include <linux/module.h>33#include <linux/init.h>
···27/* This interfaces to the I2C bus of the Voodoo3 to gain access to28 the BT869 and possibly other I2C devices. */29030#include <linux/kernel.h>31#include <linux/module.h>32#include <linux/init.h>
···1#2-# I2C Sensor device configuration3#45menu "Hardware Sensors Chip support"···1112config SENSORS_ADM102113 tristate "Analog Devices ADM1021 and compatibles"14- depends on I2C && EXPERIMENTAL15 select I2C_SENSOR16 help17 If you say yes here you get support for Analog Devices ADM1021 ···29 help30 If you say yes here you get support for Analog Devices ADM102531 and Philips NE1619 sensor chips.032 This driver can also be built as a module. If so, the module33 will be called adm1025.34···39 select I2C_SENSOR40 help41 If you say yes here you get support for Analog Devices ADM10260042 This driver can also be built as a module. If so, the module43 will be called adm1026.44···51 help52 If you say yes here you get support for Analog Devices ADM1031 53 and ADM1030 sensor chips.054 This driver can also be built as a module. If so, the module55 will be called adm1031.000000000005657config SENSORS_ASB10058 tristate "Asus ASB100 Bach"···7677 This driver can also be built as a module. If so, the module78 will be called asb100.00000000000007980config SENSORS_DS162181 tristate "Dallas Semiconductor DS1621 and DS1625"···125126config SENSORS_GL518SM127 tristate "Genesys Logic GL518SM"128- depends on I2C && EXPERIMENTAL129 select I2C_SENSOR130 help131 If you say yes here you get support for Genesys Logic GL518SM···147148config SENSORS_IT87149 tristate "ITE IT87xx and compatibles"150- depends on I2C && EXPERIMENTAL151 select I2C_SENSOR152 help153 If you say yes here you get support for ITE IT87xx sensor chips···171172config SENSORS_LM75173 tristate "National Semiconductor LM75 and compatibles"174- depends on I2C && EXPERIMENTAL175 select I2C_SENSOR176 help177 If you say yes here you get support for National Semiconductor LM75···202 select I2C_SENSOR203 help204 If you say yes here you get support for National Semiconductor LM78,205- LM78-J and LM79. This can also be built as a module which can be206- inserted and removed while the kernel is running.207208 This driver can also be built as a module. If so, the module209 will be called lm78.···235 select I2C_SENSOR236 help237 If you say yes here you get support for National Semiconductor LM85238- sensor chips and clones: ADT7463 and ADM1027.239240 This driver can also be built as a module. If so, the module241 will be called lm85.···334 help335 If you say yes here you get support for the integrated fan336 monitoring and control capabilities of the SMSC LPC47B27x,337- LPC47M10x, LPC47M13x and LPC47M14x chips.338339 This driver can also be built as a module. If so, the module340 will be called smsc47m1.341342config SENSORS_VIA686A343 tristate "VIA686A"344- depends on I2C && PCI && EXPERIMENTAL345 select I2C_SENSOR346 select I2C_ISA347 help···353354config SENSORS_W83781D355 tristate "Winbond W83781D, W83782D, W83783S, W83627HF, Asus AS99127F"356- depends on I2C && EXPERIMENTAL357 select I2C_SENSOR358 help359 If you say yes here you get support for the Winbond W8378x series···387 This driver can also be built as a module. If so, the module388 will be called w83627hf.38900000000000000390endmenu391392menu "Other I2C Chip support"393 depends on I2C394395config SENSORS_DS1337396- tristate "Dallas Semiconductor DS1337 Real Time Clock"397 depends on I2C && EXPERIMENTAL398 select I2C_SENSOR399 help400 If you say yes here you get support for Dallas Semiconductor401- DS1337 real-time clock chips. 402403 This driver can also be built as a module. If so, the module404 will be called ds1337.00000000000405406config SENSORS_EEPROM407 tristate "EEPROM reader"···450451 This driver can also be built as a module. If so, the module452 will be called pcf8574.0000000000453454config SENSORS_PCF8591455 tristate "Philips PCF8591"···493 This driver can also be built as a module. If so, the module494 will be called isp1301_omap.49500000000000000000496config SENSORS_M41T00497 tristate "ST M41T00 RTC chip"498 depends on I2C && PPC32···518519 This driver can also be built as a module. If so, the module520 will be called m41t00.000000000000521522endmenu
···1#2+# I2C Sensor and "other" chip configuration3#45menu "Hardware Sensors Chip support"···1112config SENSORS_ADM102113 tristate "Analog Devices ADM1021 and compatibles"14+ depends on I2C15 select I2C_SENSOR16 help17 If you say yes here you get support for Analog Devices ADM1021 ···29 help30 If you say yes here you get support for Analog Devices ADM102531 and Philips NE1619 sensor chips.32+33 This driver can also be built as a module. If so, the module34 will be called adm1025.35···38 select I2C_SENSOR39 help40 If you say yes here you get support for Analog Devices ADM102641+ sensor chip.42+43 This driver can also be built as a module. If so, the module44 will be called adm1026.45···48 help49 If you say yes here you get support for Analog Devices ADM1031 50 and ADM1030 sensor chips.51+52 This driver can also be built as a module. If so, the module53 will be called adm1031.54+55+config SENSORS_ADM924056+ tristate "Analog Devices ADM9240 and compatibles"57+ depends on I2C && EXPERIMENTAL58+ select I2C_SENSOR59+ help60+ If you say yes here you get support for Analog Devices ADM9240,61+ Dallas DS1780, National Semiconductor LM81 sensor chips.62+63+ This driver can also be built as a module. If so, the module64+ will be called adm9240.6566config SENSORS_ASB10067 tristate "Asus ASB100 Bach"···6162 This driver can also be built as a module. If so, the module63 will be called asb100.64+65+config SENSORS_ATXP166+ tristate "Attansic ATXP1 VID controller"67+ depends on I2C && EXPERIMENTAL68+ help69+ If you say yes here you get support for the Attansic ATXP1 VID70+ controller.71+72+ If your board have such a chip, you are able to control your CPU73+ core and other voltages.74+75+ This driver can also be built as a module. If so, the module76+ will be called atxp1.7778config SENSORS_DS162179 tristate "Dallas Semiconductor DS1621 and DS1625"···9798config SENSORS_GL518SM99 tristate "Genesys Logic GL518SM"100+ depends on I2C101 select I2C_SENSOR102 help103 If you say yes here you get support for Genesys Logic GL518SM···119120config SENSORS_IT87121 tristate "ITE IT87xx and compatibles"122+ depends on I2C123 select I2C_SENSOR124 help125 If you say yes here you get support for ITE IT87xx sensor chips···143144config SENSORS_LM75145 tristate "National Semiconductor LM75 and compatibles"146+ depends on I2C147 select I2C_SENSOR148 help149 If you say yes here you get support for National Semiconductor LM75···174 select I2C_SENSOR175 help176 If you say yes here you get support for National Semiconductor LM78,177+ LM78-J and LM79.0178179 This driver can also be built as a module. If so, the module180 will be called lm78.···208 select I2C_SENSOR209 help210 If you say yes here you get support for National Semiconductor LM85211+ sensor chips and clones: ADT7463, EMC6D100, EMC6D102 and ADM1027.212213 This driver can also be built as a module. If so, the module214 will be called lm85.···307 help308 If you say yes here you get support for the integrated fan309 monitoring and control capabilities of the SMSC LPC47B27x,310+ LPC47M10x, LPC47M13x, LPC47M14x, LPC47M15x and LPC47M192 chips.311312 This driver can also be built as a module. If so, the module313 will be called smsc47m1.314315config SENSORS_VIA686A316 tristate "VIA686A"317+ depends on I2C && PCI318 select I2C_SENSOR319 select I2C_ISA320 help···326327config SENSORS_W83781D328 tristate "Winbond W83781D, W83782D, W83783S, W83627HF, Asus AS99127F"329+ depends on I2C330 select I2C_SENSOR331 help332 If you say yes here you get support for the Winbond W8378x series···360 This driver can also be built as a module. If so, the module361 will be called w83627hf.362363+config SENSORS_W83627EHF364+ tristate "Winbond W83627EHF"365+ depends on I2C && EXPERIMENTAL366+ select I2C_SENSOR367+ select I2C_ISA368+ help369+ If you say yes here you get preliminary support for the hardware370+ monitoring functionality of the Winbond W83627EHF Super-I/O chip.371+ Only fan and temperature inputs are supported at the moment, while372+ the chip does much more than that.373+374+ This driver can also be built as a module. If so, the module375+ will be called w83627ehf.376+377endmenu378379menu "Other I2C Chip support"380 depends on I2C381382config SENSORS_DS1337383+ tristate "Dallas Semiconductor DS1337 and DS1339 Real Time Clock"384 depends on I2C && EXPERIMENTAL385 select I2C_SENSOR386 help387 If you say yes here you get support for Dallas Semiconductor388+ DS1337 and DS1339 real-time clock chips.389390 This driver can also be built as a module. If so, the module391 will be called ds1337.392+393+config SENSORS_DS1374394+ tristate "Maxim/Dallas Semiconductor DS1374 Real Time Clock"395+ depends on I2C && EXPERIMENTAL396+ select I2C_SENSOR397+ help398+ If you say yes here you get support for Dallas Semiconductor399+ DS1374 real-time clock chips.400+401+ This driver can also be built as a module. If so, the module402+ will be called ds1374.403404config SENSORS_EEPROM405 tristate "EEPROM reader"···398399 This driver can also be built as a module. If so, the module400 will be called pcf8574.401+402+config SENSORS_PCA9539403+ tristate "Philips PCA9539 16-bit I/O port"404+ depends on I2C && EXPERIMENTAL405+ help406+ If you say yes here you get support for the Philips PCA9539407+ 16-bit I/O port.408+409+ This driver can also be built as a module. If so, the module410+ will be called pca9539.411412config SENSORS_PCF8591413 tristate "Philips PCF8591"···431 This driver can also be built as a module. If so, the module432 will be called isp1301_omap.433434+# NOTE: This isn't really OMAP-specific, except for the current435+# interface location in <include/asm-arm/arch-omap/tps65010.h>436+# and having mostly OMAP-specific board support437+config TPS65010438+ tristate "TPS6501x Power Management chips"439+ depends on I2C && ARCH_OMAP440+ default y if MACH_OMAP_H2 || MACH_OMAP_H3 || MACH_OMAP_OSK441+ help442+ If you say yes here you get support for the TPS6501x series of443+ Power Management chips. These include voltage regulators,444+ lithium ion/polymer battery charging, and other features that445+ are often used in portable devices like cell phones and cameras.446+447+ This driver can also be built as a module. If so, the module448+ will be called tps65010.449+450+451config SENSORS_M41T00452 tristate "ST M41T00 RTC chip"453 depends on I2C && PPC32···439440 This driver can also be built as a module. If so, the module441 will be called m41t00.442+443+config SENSORS_MAX6875444+ tristate "MAXIM MAX6875 Power supply supervisor"445+ depends on I2C && EXPERIMENTAL446+ help447+ If you say yes here you get support for the MAX6875448+ EEPROM-Programmable, Hex/Quad, Power-Suppy Sequencers/Supervisors.449+450+ This provides a interface to program the EEPROM and reset the chip.451+452+ This driver can also be built as a module. If so, the module453+ will be called max6875.454455endmenu
+9-1
drivers/i2c/chips/Makefile
···1#2-# Makefile for the kernel hardware sensors chip drivers.3#45# asb100, then w83781d go first, as they can override other drivers' addresses.···11obj-$(CONFIG_SENSORS_ADM1025) += adm1025.o12obj-$(CONFIG_SENSORS_ADM1026) += adm1026.o13obj-$(CONFIG_SENSORS_ADM1031) += adm1031.o0014obj-$(CONFIG_SENSORS_DS1337) += ds1337.o015obj-$(CONFIG_SENSORS_DS1621) += ds1621.o16obj-$(CONFIG_SENSORS_EEPROM) += eeprom.o17obj-$(CONFIG_SENSORS_FSCHER) += fscher.o···33obj-$(CONFIG_SENSORS_LM90) += lm90.o34obj-$(CONFIG_SENSORS_LM92) += lm92.o35obj-$(CONFIG_SENSORS_MAX1619) += max1619.o036obj-$(CONFIG_SENSORS_M41T00) += m41t00.o37obj-$(CONFIG_SENSORS_PC87360) += pc87360.o038obj-$(CONFIG_SENSORS_PCF8574) += pcf8574.o39obj-$(CONFIG_SENSORS_PCF8591) += pcf8591.o40obj-$(CONFIG_SENSORS_RTC8564) += rtc8564.o···44obj-$(CONFIG_SENSORS_SMSC47B397)+= smsc47b397.o45obj-$(CONFIG_SENSORS_SMSC47M1) += smsc47m1.o46obj-$(CONFIG_SENSORS_VIA686A) += via686a.o047obj-$(CONFIG_SENSORS_W83L785TS) += w83l785ts.o048obj-$(CONFIG_ISP1301_OMAP) += isp1301_omap.o04950ifeq ($(CONFIG_I2C_DEBUG_CHIP),y)51EXTRA_CFLAGS += -DDEBUG
···1#2+# Makefile for sensor and "other" I2C chip drivers.3#45# asb100, then w83781d go first, as they can override other drivers' addresses.···11obj-$(CONFIG_SENSORS_ADM1025) += adm1025.o12obj-$(CONFIG_SENSORS_ADM1026) += adm1026.o13obj-$(CONFIG_SENSORS_ADM1031) += adm1031.o14+obj-$(CONFIG_SENSORS_ADM9240) += adm9240.o15+obj-$(CONFIG_SENSORS_ATXP1) += atxp1.o16obj-$(CONFIG_SENSORS_DS1337) += ds1337.o17+obj-$(CONFIG_SENSORS_DS1374) += ds1374.o18obj-$(CONFIG_SENSORS_DS1621) += ds1621.o19obj-$(CONFIG_SENSORS_EEPROM) += eeprom.o20obj-$(CONFIG_SENSORS_FSCHER) += fscher.o···30obj-$(CONFIG_SENSORS_LM90) += lm90.o31obj-$(CONFIG_SENSORS_LM92) += lm92.o32obj-$(CONFIG_SENSORS_MAX1619) += max1619.o33+obj-$(CONFIG_SENSORS_MAX6875) += max6875.o34obj-$(CONFIG_SENSORS_M41T00) += m41t00.o35obj-$(CONFIG_SENSORS_PC87360) += pc87360.o36+obj-$(CONFIG_SENSORS_PCA9539) += pca9539.o37obj-$(CONFIG_SENSORS_PCF8574) += pcf8574.o38obj-$(CONFIG_SENSORS_PCF8591) += pcf8591.o39obj-$(CONFIG_SENSORS_RTC8564) += rtc8564.o···39obj-$(CONFIG_SENSORS_SMSC47B397)+= smsc47b397.o40obj-$(CONFIG_SENSORS_SMSC47M1) += smsc47m1.o41obj-$(CONFIG_SENSORS_VIA686A) += via686a.o42+obj-$(CONFIG_SENSORS_W83627EHF) += w83627ehf.o43obj-$(CONFIG_SENSORS_W83L785TS) += w83l785ts.o44+45obj-$(CONFIG_ISP1301_OMAP) += isp1301_omap.o46+obj-$(CONFIG_TPS65010) += tps65010.o4748ifeq ($(CONFIG_I2C_DEBUG_CHIP),y)49EXTRA_CFLAGS += -DDEBUG
···23 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.24*/25026#include <linux/module.h>27#include <linux/init.h>28#include <linux/slab.h>29#include <linux/jiffies.h>30#include <linux/i2c.h>31#include <linux/i2c-sensor.h>032#include <linux/i2c-vid.h>33+#include <linux/hwmon-sysfs.h>3435/* Addresses to scan */36static unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, I2C_CLIENT_END };···1225 struct adm1026_data *data = adm1026_update_device(dev);1226 return sprintf(buf,"%d\n", vid_from_reg(data->vid & 0x3f, data->vrm));1227}1228+/* vid deprecated in favour of cpu0_vid, remove after 2005-11-11 */1229static DEVICE_ATTR(vid, S_IRUGO, show_vid_reg, NULL);1230+static DEVICE_ATTR(cpu0_vid, S_IRUGO, show_vid_reg, NULL);12311232static ssize_t show_vrm_reg(struct device *dev, struct device_attribute *attr, char *buf)1233{···1666 device_create_file(&new_client->dev, &dev_attr_temp1_crit_enable);1667 device_create_file(&new_client->dev, &dev_attr_temp2_crit_enable);1668 device_create_file(&new_client->dev, &dev_attr_temp3_crit_enable);1669+ /* vid deprecated in favour of cpu0_vid, remove after 2005-11-11 */1670 device_create_file(&new_client->dev, &dev_attr_vid);1671+ device_create_file(&new_client->dev, &dev_attr_cpu0_vid);1672 device_create_file(&new_client->dev, &dev_attr_vrm);1673 device_create_file(&new_client->dev, &dev_attr_alarms);1674 device_create_file(&new_client->dev, &dev_attr_alarm_mask);
+1-1
drivers/i2c/chips/adm1031.c
···440441/*442 * That function checks the cases where the fan reading is not443- * relevent. It is used to provide 0 as fan reading when the fan is444 * not supposed to run445 */446static int trust_fan_readings(struct adm1031_data *data, int chan)
···440441/*442 * That function checks the cases where the fan reading is not443+ * relevant. It is used to provide 0 as fan reading when the fan is444 * not supposed to run445 */446static int trust_fan_readings(struct adm1031_data *data, int chan)
···1+/*2+ * drivers/i2c/chips/ds1374.c3+ *4+ * I2C client/driver for the Maxim/Dallas DS1374 Real-Time Clock5+ *6+ * Author: Randy Vinson <rvinson@mvista.com>7+ *8+ * Based on the m41t00.c by Mark Greer <mgreer@mvista.com>9+ *10+ * 2005 (c) MontaVista Software, Inc. This file is licensed under11+ * the terms of the GNU General Public License version 2. This program12+ * is licensed "as is" without any warranty of any kind, whether express13+ * or implied.14+ */15+/*16+ * This i2c client/driver wedges between the drivers/char/genrtc.c RTC17+ * interface and the SMBus interface of the i2c subsystem.18+ * It would be more efficient to use i2c msgs/i2c_transfer directly but, as19+ * recommened in .../Documentation/i2c/writing-clients section20+ * "Sending and receiving", using SMBus level communication is preferred.21+ */22+23+#include <linux/kernel.h>24+#include <linux/module.h>25+#include <linux/interrupt.h>26+#include <linux/i2c.h>27+#include <linux/rtc.h>28+#include <linux/bcd.h>29+30+#define DS1374_REG_TOD0 0x0031+#define DS1374_REG_TOD1 0x0132+#define DS1374_REG_TOD2 0x0233+#define DS1374_REG_TOD3 0x0334+#define DS1374_REG_WDALM0 0x0435+#define DS1374_REG_WDALM1 0x0536+#define DS1374_REG_WDALM2 0x0637+#define DS1374_REG_CR 0x0738+#define DS1374_REG_SR 0x0839+#define DS1374_REG_SR_OSF 0x8040+#define DS1374_REG_TCR 0x0941+42+#define DS1374_DRV_NAME "ds1374"43+44+static DECLARE_MUTEX(ds1374_mutex);45+46+static struct i2c_driver ds1374_driver;47+static struct i2c_client *save_client;48+49+static unsigned short ignore[] = { I2C_CLIENT_END };50+static unsigned short normal_addr[] = { 0x68, I2C_CLIENT_END };51+52+static struct i2c_client_address_data addr_data = {53+ .normal_i2c = normal_addr,54+ .probe = ignore,55+ .ignore = ignore,56+ .force = ignore,57+};58+59+static ulong ds1374_read_rtc(void)60+{61+ ulong time = 0;62+ int reg = DS1374_REG_WDALM0;63+64+ while (reg--) {65+ s32 tmp;66+ if ((tmp = i2c_smbus_read_byte_data(save_client, reg)) < 0) {67+ dev_warn(&save_client->dev,68+ "can't read from rtc chip\n");69+ return 0;70+ }71+ time = (time << 8) | (tmp & 0xff);72+ }73+ return time;74+}75+76+static void ds1374_write_rtc(ulong time)77+{78+ int reg;79+80+ for (reg = DS1374_REG_TOD0; reg < DS1374_REG_WDALM0; reg++) {81+ if (i2c_smbus_write_byte_data(save_client, reg, time & 0xff)82+ < 0) {83+ dev_warn(&save_client->dev,84+ "can't write to rtc chip\n");85+ break;86+ }87+ time = time >> 8;88+ }89+}90+91+static void ds1374_check_rtc_status(void)92+{93+ s32 tmp;94+95+ tmp = i2c_smbus_read_byte_data(save_client, DS1374_REG_SR);96+ if (tmp < 0) {97+ dev_warn(&save_client->dev,98+ "can't read status from rtc chip\n");99+ return;100+ }101+ if (tmp & DS1374_REG_SR_OSF) {102+ dev_warn(&save_client->dev,103+ "oscillator discontinuity flagged, time unreliable\n");104+ tmp &= ~DS1374_REG_SR_OSF;105+ tmp = i2c_smbus_write_byte_data(save_client, DS1374_REG_SR,106+ tmp & 0xff);107+ if (tmp < 0)108+ dev_warn(&save_client->dev,109+ "can't clear discontinuity notification\n");110+ }111+}112+113+ulong ds1374_get_rtc_time(void)114+{115+ ulong t1, t2;116+ int limit = 10; /* arbitrary retry limit */117+118+ down(&ds1374_mutex);119+120+ /*121+ * Since the reads are being performed one byte at a time using122+ * the SMBus vs a 4-byte i2c transfer, there is a chance that a123+ * carry will occur during the read. To detect this, 2 reads are124+ * performed and compared.125+ */126+ do {127+ t1 = ds1374_read_rtc();128+ t2 = ds1374_read_rtc();129+ } while (t1 != t2 && limit--);130+131+ up(&ds1374_mutex);132+133+ if (t1 != t2) {134+ dev_warn(&save_client->dev,135+ "can't get consistent time from rtc chip\n");136+ t1 = 0;137+ }138+139+ return t1;140+}141+142+static void ds1374_set_tlet(ulong arg)143+{144+ ulong t1, t2;145+ int limit = 10; /* arbitrary retry limit */146+147+ t1 = *(ulong *) arg;148+149+ down(&ds1374_mutex);150+151+ /*152+ * Since the writes are being performed one byte at a time using153+ * the SMBus vs a 4-byte i2c transfer, there is a chance that a154+ * carry will occur during the write. To detect this, the write155+ * value is read back and compared.156+ */157+ do {158+ ds1374_write_rtc(t1);159+ t2 = ds1374_read_rtc();160+ } while (t1 != t2 && limit--);161+162+ up(&ds1374_mutex);163+164+ if (t1 != t2)165+ dev_warn(&save_client->dev,166+ "can't confirm time set from rtc chip\n");167+}168+169+ulong new_time;170+171+DECLARE_TASKLET_DISABLED(ds1374_tasklet, ds1374_set_tlet, (ulong) & new_time);172+173+int ds1374_set_rtc_time(ulong nowtime)174+{175+ new_time = nowtime;176+177+ if (in_interrupt())178+ tasklet_schedule(&ds1374_tasklet);179+ else180+ ds1374_set_tlet((ulong) & new_time);181+182+ return 0;183+}184+185+/*186+ *****************************************************************************187+ *188+ * Driver Interface189+ *190+ *****************************************************************************191+ */192+static int ds1374_probe(struct i2c_adapter *adap, int addr, int kind)193+{194+ struct i2c_client *client;195+ int rc;196+197+ client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL);198+ if (!client)199+ return -ENOMEM;200+201+ memset(client, 0, sizeof(struct i2c_client));202+ strncpy(client->name, DS1374_DRV_NAME, I2C_NAME_SIZE);203+ client->flags = I2C_DF_NOTIFY;204+ client->addr = addr;205+ client->adapter = adap;206+ client->driver = &ds1374_driver;207+208+ if ((rc = i2c_attach_client(client)) != 0) {209+ kfree(client);210+ return rc;211+ }212+213+ save_client = client;214+215+ ds1374_check_rtc_status();216+217+ return 0;218+}219+220+static int ds1374_attach(struct i2c_adapter *adap)221+{222+ return i2c_probe(adap, &addr_data, ds1374_probe);223+}224+225+static int ds1374_detach(struct i2c_client *client)226+{227+ int rc;228+229+ if ((rc = i2c_detach_client(client)) == 0) {230+ kfree(i2c_get_clientdata(client));231+ tasklet_kill(&ds1374_tasklet);232+ }233+ return rc;234+}235+236+static struct i2c_driver ds1374_driver = {237+ .owner = THIS_MODULE,238+ .name = DS1374_DRV_NAME,239+ .id = I2C_DRIVERID_DS1374,240+ .flags = I2C_DF_NOTIFY,241+ .attach_adapter = ds1374_attach,242+ .detach_client = ds1374_detach,243+};244+245+static int __init ds1374_init(void)246+{247+ return i2c_add_driver(&ds1374_driver);248+}249+250+static void __exit ds1374_exit(void)251+{252+ i2c_del_driver(&ds1374_driver);253+}254+255+module_init(ds1374_init);256+module_exit(ds1374_exit);257+258+MODULE_AUTHOR("Randy Vinson <rvinson@mvista.com>");259+MODULE_DESCRIPTION("Maxim/Dallas DS1374 RTC I2C Client Driver");260+MODULE_LICENSE("GPL");
···18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.19*/2021-#include <linux/config.h>22#include <linux/module.h>23#include <linux/init.h>24#include <linux/slab.h>
···18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.19*/20021#include <linux/module.h>22#include <linux/init.h>23#include <linux/slab.h>
-1
drivers/i2c/chips/lm77.c
···25 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.26*/2728-#include <linux/config.h>29#include <linux/module.h>30#include <linux/init.h>31#include <linux/slab.h>
···25 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.26*/27028#include <linux/module.h>29#include <linux/init.h>30#include <linux/slab.h>
+2-3
drivers/i2c/chips/lm78.c
···18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.19*/2021-#include <linux/config.h>22#include <linux/module.h>23#include <linux/init.h>24#include <linux/slab.h>···670 return 0;671}672673-/* The SMBus locks itself, but ISA access must be locked explicitely! 674 We don't want to lock the whole ISA bus, so we lock each client675 separately.676 We ignore the LM78 BUSY flag at this moment - it could lead to deadlocks,···689 return i2c_smbus_read_byte_data(client, reg);690}691692-/* The SMBus locks itself, but ISA access muse be locked explicitely! 693 We don't want to lock the whole ISA bus, so we lock each client694 separately.695 We ignore the LM78 BUSY flag at this moment - it could lead to deadlocks,
···18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.19*/20021#include <linux/module.h>22#include <linux/init.h>23#include <linux/slab.h>···671 return 0;672}673674+/* The SMBus locks itself, but ISA access must be locked explicitly! 675 We don't want to lock the whole ISA bus, so we lock each client676 separately.677 We ignore the LM78 BUSY flag at this moment - it could lead to deadlocks,···690 return i2c_smbus_read_byte_data(client, reg);691}692693+/* The SMBus locks itself, but ISA access muse be locked explicitly! 694 We don't want to lock the whole ISA bus, so we lock each client695 separately.696 We ignore the LM78 BUSY flag at this moment - it could lead to deadlocks,
-1
drivers/i2c/chips/lm80.c
···21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.22 */2324-#include <linux/config.h>25#include <linux/module.h>26#include <linux/init.h>27#include <linux/slab.h>
···21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.22 */23024#include <linux/module.h>25#include <linux/init.h>26#include <linux/slab.h>
···23 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.24*/2526-#include <linux/config.h>27#include <linux/module.h>28#include <linux/init.h>29#include <linux/slab.h>···284/* i2c-vid.h defines vid_from_reg() */285#define VID_FROM_REG(val,vrm) (vid_from_reg((val),(vrm)))286287-#define ALARMS_FROM_REG(val) (val)288-289/* Unlike some other drivers we DO NOT set initial limits. Use290 * the config file to set limits. Some users have reported291 * motherboards shutting down when we set limits in a previous···478static ssize_t show_alarms_reg(struct device *dev, struct device_attribute *attr, char *buf)479{480 struct lm85_data *data = lm85_update_device(dev);481- return sprintf(buf, "%ld\n", (long) ALARMS_FROM_REG(data->alarms));482}483484static DEVICE_ATTR(alarms, S_IRUGO, show_alarms_reg, NULL);
···23 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.24*/25026#include <linux/module.h>27#include <linux/init.h>28#include <linux/slab.h>···285/* i2c-vid.h defines vid_from_reg() */286#define VID_FROM_REG(val,vrm) (vid_from_reg((val),(vrm)))28700288/* Unlike some other drivers we DO NOT set initial limits. Use289 * the config file to set limits. Some users have reported290 * motherboards shutting down when we set limits in a previous···481static ssize_t show_alarms_reg(struct device *dev, struct device_attribute *attr, char *buf)482{483 struct lm85_data *data = lm85_update_device(dev);484+ return sprintf(buf, "%u\n", data->alarms);485}486487static DEVICE_ATTR(alarms, S_IRUGO, show_alarms_reg, NULL);
-1
drivers/i2c/chips/lm87.c
···52 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.53 */5455-#include <linux/config.h>56#include <linux/module.h>57#include <linux/init.h>58#include <linux/slab.h>
···52 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.53 */54055#include <linux/module.h>56#include <linux/init.h>57#include <linux/slab.h>
+152-123
drivers/i2c/chips/lm90.c
···1/*2 * lm90.c - Part of lm_sensors, Linux kernel modules for hardware3 * monitoring4- * Copyright (C) 2003-2004 Jean Delvare <khali@linux-fr.org>5 *6 * Based on the lm83 driver. The LM90 is a sensor chip made by National7 * Semiconductor. It reports up to two temperatures (its own plus up to···19 * Complete datasheets can be obtained from National's website at:20 * http://www.national.com/pf/LM/LM89.html21 * http://www.national.com/pf/LM/LM99.html22- * Note that there is no way to differenciate between both chips.23 *24 * This driver also supports the LM86, another sensor chip made by25 * National Semiconductor. It is exactly similar to the LM90 except it···39 * chips made by Maxim. These chips are similar to the LM86. Complete40 * datasheet can be obtained at Maxim's website at:41 * http://www.maxim-ic.com/quick_view2.cfm/qv_pk/257842- * Note that there is no easy way to differenciate between the three43 * variants. The extra address and features of the MAX6659 are not44 * supported by this driver.45 *···70 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.71 */7273-#include <linux/config.h>74#include <linux/module.h>75#include <linux/init.h>76#include <linux/slab.h>77#include <linux/jiffies.h>78#include <linux/i2c.h>79#include <linux/i2c-sensor.h>08081/*82 * Addresses to scan···139/*140 * Conversions and various macros141 * For local temperatures and limits, critical limits and the hysteresis142- * value, the LM90 uses signed 8-bit values with LSB = 1 degree Celcius.143 * For remote temperatures and limits, it uses signed 11-bit values with144- * LSB = 0.125 degree Celcius, left-justified in 16-bit registers.145 */146147#define TEMP1_FROM_REG(val) ((val) * 1000)···206 int kind;207208 /* registers values */209- s8 temp_input1, temp_low1, temp_high1; /* local */210- s16 temp_input2, temp_low2, temp_high2; /* remote, combined */211- s8 temp_crit1, temp_crit2;00000212 u8 temp_hyst;213 u8 alarms; /* bitvector */214};···222 * Sysfs stuff223 */224225-#define show_temp(value, converter) \226-static ssize_t show_##value(struct device *dev, struct device_attribute *attr, char *buf) \227-{ \228- struct lm90_data *data = lm90_update_device(dev); \229- return sprintf(buf, "%d\n", converter(data->value)); \0230}231-show_temp(temp_input1, TEMP1_FROM_REG);232-show_temp(temp_input2, TEMP2_FROM_REG);233-show_temp(temp_low1, TEMP1_FROM_REG);234-show_temp(temp_low2, TEMP2_FROM_REG);235-show_temp(temp_high1, TEMP1_FROM_REG);236-show_temp(temp_high2, TEMP2_FROM_REG);237-show_temp(temp_crit1, TEMP1_FROM_REG);238-show_temp(temp_crit2, TEMP1_FROM_REG);239240-#define set_temp1(value, reg) \241-static ssize_t set_##value(struct device *dev, struct device_attribute *attr, const char *buf, \242- size_t count) \243-{ \244- struct i2c_client *client = to_i2c_client(dev); \245- struct lm90_data *data = i2c_get_clientdata(client); \246- long val = simple_strtol(buf, NULL, 10); \247- \248- down(&data->update_lock); \249- if (data->kind == adt7461) \250- data->value = TEMP1_TO_REG_ADT7461(val); \251- else \252- data->value = TEMP1_TO_REG(val); \253- i2c_smbus_write_byte_data(client, reg, data->value); \254- up(&data->update_lock); \255- return count; \256-}257-#define set_temp2(value, regh, regl) \258-static ssize_t set_##value(struct device *dev, struct device_attribute *attr, const char *buf, \259- size_t count) \260-{ \261- struct i2c_client *client = to_i2c_client(dev); \262- struct lm90_data *data = i2c_get_clientdata(client); \263- long val = simple_strtol(buf, NULL, 10); \264- \265- down(&data->update_lock); \266- if (data->kind == adt7461) \267- data->value = TEMP2_TO_REG_ADT7461(val); \268- else \269- data->value = TEMP2_TO_REG(val); \270- i2c_smbus_write_byte_data(client, regh, data->value >> 8); \271- i2c_smbus_write_byte_data(client, regl, data->value & 0xff); \272- up(&data->update_lock); \273- return count; \274-}275-set_temp1(temp_low1, LM90_REG_W_LOCAL_LOW);276-set_temp2(temp_low2, LM90_REG_W_REMOTE_LOWH, LM90_REG_W_REMOTE_LOWL);277-set_temp1(temp_high1, LM90_REG_W_LOCAL_HIGH);278-set_temp2(temp_high2, LM90_REG_W_REMOTE_HIGHH, LM90_REG_W_REMOTE_HIGHL);279-set_temp1(temp_crit1, LM90_REG_W_LOCAL_CRIT);280-set_temp1(temp_crit2, LM90_REG_W_REMOTE_CRIT);281282-#define show_temp_hyst(value, basereg) \283-static ssize_t show_##value(struct device *dev, struct device_attribute *attr, char *buf) \284-{ \285- struct lm90_data *data = lm90_update_device(dev); \286- return sprintf(buf, "%d\n", TEMP1_FROM_REG(data->basereg) \287- - TEMP1_FROM_REG(data->temp_hyst)); \288-}289-show_temp_hyst(temp_hyst1, temp_crit1);290-show_temp_hyst(temp_hyst2, temp_crit2);291292-static ssize_t set_temp_hyst1(struct device *dev, struct device_attribute *attr, const char *buf,293- size_t count)00000000000000000000000000000000000000000000000000000000294{295 struct i2c_client *client = to_i2c_client(dev);296 struct lm90_data *data = i2c_get_clientdata(client);···311 long hyst;312313 down(&data->update_lock);314- hyst = TEMP1_FROM_REG(data->temp_crit1) - val;315 i2c_smbus_write_byte_data(client, LM90_REG_W_TCRIT_HYST,316 HYST_TO_REG(hyst));317 up(&data->update_lock);318 return count;319}320321-static ssize_t show_alarms(struct device *dev, struct device_attribute *attr, char *buf)0322{323 struct lm90_data *data = lm90_update_device(dev);324 return sprintf(buf, "%d\n", data->alarms);325}326327-static DEVICE_ATTR(temp1_input, S_IRUGO, show_temp_input1, NULL);328-static DEVICE_ATTR(temp2_input, S_IRUGO, show_temp_input2, NULL);329-static DEVICE_ATTR(temp1_min, S_IWUSR | S_IRUGO, show_temp_low1,330- set_temp_low1);331-static DEVICE_ATTR(temp2_min, S_IWUSR | S_IRUGO, show_temp_low2,332- set_temp_low2);333-static DEVICE_ATTR(temp1_max, S_IWUSR | S_IRUGO, show_temp_high1,334- set_temp_high1);335-static DEVICE_ATTR(temp2_max, S_IWUSR | S_IRUGO, show_temp_high2,336- set_temp_high2);337-static DEVICE_ATTR(temp1_crit, S_IWUSR | S_IRUGO, show_temp_crit1,338- set_temp_crit1);339-static DEVICE_ATTR(temp2_crit, S_IWUSR | S_IRUGO, show_temp_crit2,340- set_temp_crit2);341-static DEVICE_ATTR(temp1_crit_hyst, S_IWUSR | S_IRUGO, show_temp_hyst1,342- set_temp_hyst1);343-static DEVICE_ATTR(temp2_crit_hyst, S_IRUGO, show_temp_hyst2, NULL);344static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL);345346/*···500 lm90_init_client(new_client);501502 /* Register sysfs hooks */503- device_create_file(&new_client->dev, &dev_attr_temp1_input);504- device_create_file(&new_client->dev, &dev_attr_temp2_input);505- device_create_file(&new_client->dev, &dev_attr_temp1_min);506- device_create_file(&new_client->dev, &dev_attr_temp2_min);507- device_create_file(&new_client->dev, &dev_attr_temp1_max);508- device_create_file(&new_client->dev, &dev_attr_temp2_max);509- device_create_file(&new_client->dev, &dev_attr_temp1_crit);510- device_create_file(&new_client->dev, &dev_attr_temp2_crit);511- device_create_file(&new_client->dev, &dev_attr_temp1_crit_hyst);512- device_create_file(&new_client->dev, &dev_attr_temp2_crit_hyst);0000000000513 device_create_file(&new_client->dev, &dev_attr_alarms);514515 return 0;···570 u8 oldh, newh;571572 dev_dbg(&client->dev, "Updating lm90 data.\n");573- data->temp_input1 = i2c_smbus_read_byte_data(client,574- LM90_REG_R_LOCAL_TEMP);575- data->temp_high1 = i2c_smbus_read_byte_data(client,576- LM90_REG_R_LOCAL_HIGH);577- data->temp_low1 = i2c_smbus_read_byte_data(client,578- LM90_REG_R_LOCAL_LOW);579- data->temp_crit1 = i2c_smbus_read_byte_data(client,580- LM90_REG_R_LOCAL_CRIT);581- data->temp_crit2 = i2c_smbus_read_byte_data(client,582- LM90_REG_R_REMOTE_CRIT);583 data->temp_hyst = i2c_smbus_read_byte_data(client,584 LM90_REG_R_TCRIT_HYST);585···599 */600 oldh = i2c_smbus_read_byte_data(client,601 LM90_REG_R_REMOTE_TEMPH);602- data->temp_input2 = i2c_smbus_read_byte_data(client,603- LM90_REG_R_REMOTE_TEMPL);604 newh = i2c_smbus_read_byte_data(client,605 LM90_REG_R_REMOTE_TEMPH);606 if (newh != oldh) {607- data->temp_input2 = i2c_smbus_read_byte_data(client,608- LM90_REG_R_REMOTE_TEMPL);609#ifdef DEBUG610 oldh = i2c_smbus_read_byte_data(client,611 LM90_REG_R_REMOTE_TEMPH);···615 "wrong.\n");616#endif617 }618- data->temp_input2 |= (newh << 8);619620- data->temp_high2 = (i2c_smbus_read_byte_data(client,0000621 LM90_REG_R_REMOTE_HIGHH) << 8) +622 i2c_smbus_read_byte_data(client,623 LM90_REG_R_REMOTE_HIGHL);624- data->temp_low2 = (i2c_smbus_read_byte_data(client,625- LM90_REG_R_REMOTE_LOWH) << 8) +626- i2c_smbus_read_byte_data(client,627- LM90_REG_R_REMOTE_LOWL);628 data->alarms = i2c_smbus_read_byte_data(client,629 LM90_REG_R_STATUS);630
···1/*2 * lm90.c - Part of lm_sensors, Linux kernel modules for hardware3 * monitoring4+ * Copyright (C) 2003-2005 Jean Delvare <khali@linux-fr.org>5 *6 * Based on the lm83 driver. The LM90 is a sensor chip made by National7 * Semiconductor. It reports up to two temperatures (its own plus up to···19 * Complete datasheets can be obtained from National's website at:20 * http://www.national.com/pf/LM/LM89.html21 * http://www.national.com/pf/LM/LM99.html22+ * Note that there is no way to differentiate between both chips.23 *24 * This driver also supports the LM86, another sensor chip made by25 * National Semiconductor. It is exactly similar to the LM90 except it···39 * chips made by Maxim. These chips are similar to the LM86. Complete40 * datasheet can be obtained at Maxim's website at:41 * http://www.maxim-ic.com/quick_view2.cfm/qv_pk/257842+ * Note that there is no easy way to differentiate between the three43 * variants. The extra address and features of the MAX6659 are not44 * supported by this driver.45 *···70 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.71 */72073#include <linux/module.h>74#include <linux/init.h>75#include <linux/slab.h>76#include <linux/jiffies.h>77#include <linux/i2c.h>78#include <linux/i2c-sensor.h>79+#include <linux/hwmon-sysfs.h>8081/*82 * Addresses to scan···139/*140 * Conversions and various macros141 * For local temperatures and limits, critical limits and the hysteresis142+ * value, the LM90 uses signed 8-bit values with LSB = 1 degree Celsius.143 * For remote temperatures and limits, it uses signed 11-bit values with144+ * LSB = 0.125 degree Celsius, left-justified in 16-bit registers.145 */146147#define TEMP1_FROM_REG(val) ((val) * 1000)···206 int kind;207208 /* registers values */209+ s8 temp8[5]; /* 0: local input210+ 1: local low limit211+ 2: local high limit212+ 3: local critical limit213+ 4: remote critical limit */214+ s16 temp11[3]; /* 0: remote input215+ 1: remote low limit216+ 2: remote high limit */217 u8 temp_hyst;218 u8 alarms; /* bitvector */219};···217 * Sysfs stuff218 */219220+static ssize_t show_temp8(struct device *dev, struct device_attribute *devattr,221+ char *buf)222+{223+ struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);224+ struct lm90_data *data = lm90_update_device(dev);225+ return sprintf(buf, "%d\n", TEMP1_FROM_REG(data->temp8[attr->index]));226}00000000227228+static ssize_t set_temp8(struct device *dev, struct device_attribute *devattr,229+ const char *buf, size_t count)230+{231+ static const u8 reg[4] = {232+ LM90_REG_W_LOCAL_LOW,233+ LM90_REG_W_LOCAL_HIGH,234+ LM90_REG_W_LOCAL_CRIT,235+ LM90_REG_W_REMOTE_CRIT,236+ };00000000000000000000000000000000237238+ struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);239+ struct i2c_client *client = to_i2c_client(dev);240+ struct lm90_data *data = i2c_get_clientdata(client);241+ long val = simple_strtol(buf, NULL, 10);242+ int nr = attr->index;0000243244+ down(&data->update_lock);245+ if (data->kind == adt7461)246+ data->temp8[nr] = TEMP1_TO_REG_ADT7461(val);247+ else248+ data->temp8[nr] = TEMP1_TO_REG(val);249+ i2c_smbus_write_byte_data(client, reg[nr - 1], data->temp8[nr]);250+ up(&data->update_lock);251+ return count;252+}253+254+static ssize_t show_temp11(struct device *dev, struct device_attribute *devattr,255+ char *buf)256+{257+ struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);258+ struct lm90_data *data = lm90_update_device(dev);259+ return sprintf(buf, "%d\n", TEMP2_FROM_REG(data->temp11[attr->index]));260+}261+262+static ssize_t set_temp11(struct device *dev, struct device_attribute *devattr,263+ const char *buf, size_t count)264+{265+ static const u8 reg[4] = {266+ LM90_REG_W_REMOTE_LOWH,267+ LM90_REG_W_REMOTE_LOWL,268+ LM90_REG_W_REMOTE_HIGHH,269+ LM90_REG_W_REMOTE_HIGHL,270+ };271+272+ struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);273+ struct i2c_client *client = to_i2c_client(dev);274+ struct lm90_data *data = i2c_get_clientdata(client);275+ long val = simple_strtol(buf, NULL, 10);276+ int nr = attr->index;277+278+ down(&data->update_lock);279+ if (data->kind == adt7461)280+ data->temp11[nr] = TEMP2_TO_REG_ADT7461(val);281+ else282+ data->temp11[nr] = TEMP2_TO_REG(val);283+ i2c_smbus_write_byte_data(client, reg[(nr - 1) * 2],284+ data->temp11[nr] >> 8);285+ i2c_smbus_write_byte_data(client, reg[(nr - 1) * 2 + 1],286+ data->temp11[nr] & 0xff);287+ up(&data->update_lock);288+ return count;289+}290+291+static ssize_t show_temphyst(struct device *dev, struct device_attribute *devattr,292+ char *buf)293+{294+ struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);295+ struct lm90_data *data = lm90_update_device(dev);296+ return sprintf(buf, "%d\n", TEMP1_FROM_REG(data->temp8[attr->index])297+ - TEMP1_FROM_REG(data->temp_hyst));298+}299+300+static ssize_t set_temphyst(struct device *dev, struct device_attribute *dummy,301+ const char *buf, size_t count)302{303 struct i2c_client *client = to_i2c_client(dev);304 struct lm90_data *data = i2c_get_clientdata(client);···293 long hyst;294295 down(&data->update_lock);296+ hyst = TEMP1_FROM_REG(data->temp8[3]) - val;297 i2c_smbus_write_byte_data(client, LM90_REG_W_TCRIT_HYST,298 HYST_TO_REG(hyst));299 up(&data->update_lock);300 return count;301}302303+static ssize_t show_alarms(struct device *dev, struct device_attribute *dummy,304+ char *buf)305{306 struct lm90_data *data = lm90_update_device(dev);307 return sprintf(buf, "%d\n", data->alarms);308}309310+static SENSOR_DEVICE_ATTR(temp1_input, S_IRUGO, show_temp8, NULL, 0);311+static SENSOR_DEVICE_ATTR(temp2_input, S_IRUGO, show_temp11, NULL, 0);312+static SENSOR_DEVICE_ATTR(temp1_min, S_IWUSR | S_IRUGO, show_temp8,313+ set_temp8, 1);314+static SENSOR_DEVICE_ATTR(temp2_min, S_IWUSR | S_IRUGO, show_temp11,315+ set_temp11, 1);316+static SENSOR_DEVICE_ATTR(temp1_max, S_IWUSR | S_IRUGO, show_temp8,317+ set_temp8, 2);318+static SENSOR_DEVICE_ATTR(temp2_max, S_IWUSR | S_IRUGO, show_temp11,319+ set_temp11, 2);320+static SENSOR_DEVICE_ATTR(temp1_crit, S_IWUSR | S_IRUGO, show_temp8,321+ set_temp8, 3);322+static SENSOR_DEVICE_ATTR(temp2_crit, S_IWUSR | S_IRUGO, show_temp8,323+ set_temp8, 4);324+static SENSOR_DEVICE_ATTR(temp1_crit_hyst, S_IWUSR | S_IRUGO, show_temphyst,325+ set_temphyst, 3);326+static SENSOR_DEVICE_ATTR(temp2_crit_hyst, S_IRUGO, show_temphyst, NULL, 4);327static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL);328329/*···481 lm90_init_client(new_client);482483 /* Register sysfs hooks */484+ device_create_file(&new_client->dev,485+ &sensor_dev_attr_temp1_input.dev_attr);486+ device_create_file(&new_client->dev,487+ &sensor_dev_attr_temp2_input.dev_attr);488+ device_create_file(&new_client->dev,489+ &sensor_dev_attr_temp1_min.dev_attr);490+ device_create_file(&new_client->dev,491+ &sensor_dev_attr_temp2_min.dev_attr);492+ device_create_file(&new_client->dev,493+ &sensor_dev_attr_temp1_max.dev_attr);494+ device_create_file(&new_client->dev,495+ &sensor_dev_attr_temp2_max.dev_attr);496+ device_create_file(&new_client->dev,497+ &sensor_dev_attr_temp1_crit.dev_attr);498+ device_create_file(&new_client->dev,499+ &sensor_dev_attr_temp2_crit.dev_attr);500+ device_create_file(&new_client->dev,501+ &sensor_dev_attr_temp1_crit_hyst.dev_attr);502+ device_create_file(&new_client->dev,503+ &sensor_dev_attr_temp2_crit_hyst.dev_attr);504 device_create_file(&new_client->dev, &dev_attr_alarms);505506 return 0;···541 u8 oldh, newh;542543 dev_dbg(&client->dev, "Updating lm90 data.\n");544+ data->temp8[0] = i2c_smbus_read_byte_data(client,545+ LM90_REG_R_LOCAL_TEMP);546+ data->temp8[1] = i2c_smbus_read_byte_data(client,547+ LM90_REG_R_LOCAL_LOW);548+ data->temp8[2] = i2c_smbus_read_byte_data(client,549+ LM90_REG_R_LOCAL_HIGH);550+ data->temp8[3] = i2c_smbus_read_byte_data(client,551+ LM90_REG_R_LOCAL_CRIT);552+ data->temp8[4] = i2c_smbus_read_byte_data(client,553+ LM90_REG_R_REMOTE_CRIT);554 data->temp_hyst = i2c_smbus_read_byte_data(client,555 LM90_REG_R_TCRIT_HYST);556···570 */571 oldh = i2c_smbus_read_byte_data(client,572 LM90_REG_R_REMOTE_TEMPH);573+ data->temp11[0] = i2c_smbus_read_byte_data(client,574+ LM90_REG_R_REMOTE_TEMPL);575 newh = i2c_smbus_read_byte_data(client,576 LM90_REG_R_REMOTE_TEMPH);577 if (newh != oldh) {578+ data->temp11[0] = i2c_smbus_read_byte_data(client,579+ LM90_REG_R_REMOTE_TEMPL);580#ifdef DEBUG581 oldh = i2c_smbus_read_byte_data(client,582 LM90_REG_R_REMOTE_TEMPH);···586 "wrong.\n");587#endif588 }589+ data->temp11[0] |= (newh << 8);590591+ data->temp11[1] = (i2c_smbus_read_byte_data(client,592+ LM90_REG_R_REMOTE_LOWH) << 8) +593+ i2c_smbus_read_byte_data(client,594+ LM90_REG_R_REMOTE_LOWL);595+ data->temp11[2] = (i2c_smbus_read_byte_data(client,596 LM90_REG_R_REMOTE_HIGHH) << 8) +597 i2c_smbus_read_byte_data(client,598 LM90_REG_R_REMOTE_HIGHL);0000599 data->alarms = i2c_smbus_read_byte_data(client,600 LM90_REG_R_STATUS);601
···1+/*2+ max6875.c - driver for MAX6874/MAX68753+4+ Copyright (C) 2005 Ben Gardner <bgardner@wabtec.com>5+6+ Based on i2c/chips/eeprom.c7+8+ The MAX6875 has two EEPROM sections: config and user.9+ At reset, the config EEPROM is read into the registers.10+11+ This driver make 3 binary files available in sysfs:12+ reg_config - direct access to the registers13+ eeprom_config - acesses configuration eeprom space14+ eeprom_user - free for application use15+16+ In our application, we put device serial & model numbers in user eeprom.17+18+ Notes:19+ 1) The datasheet says that register 0x44 / EEPROM 0x8044 should NOT20+ be overwritten, so the driver explicitly prevents that.21+ 2) It's a good idea to keep the config (0x45) locked in config EEPROM.22+ You can temporarily enable config writes by changing register 0x45.23+24+ This program is free software; you can redistribute it and/or modify25+ it under the terms of the GNU General Public License as published by26+ the Free Software Foundation; version 2 of the License.27+*/28+29+#include <linux/config.h>30+#include <linux/kernel.h>31+#include <linux/init.h>32+#include <linux/module.h>33+#include <linux/slab.h>34+#include <linux/sched.h>35+#include <linux/delay.h>36+#include <linux/i2c.h>37+#include <linux/i2c-sensor.h>38+39+/* Addresses to scan */40+static unsigned short normal_i2c[] = {0x50, 0x52, I2C_CLIENT_END};41+static unsigned int normal_isa[] = {I2C_CLIENT_ISA_END};42+43+/* Insmod parameters */44+SENSORS_INSMOD_1(max6875);45+46+/* this param will prevent 'accidental' writes to the eeprom */47+static int allow_write = 0;48+module_param(allow_write, int, 0);49+MODULE_PARM_DESC(allow_write,50+ "Enable write access:\n"51+ "*0: Read only\n"52+ " 1: Read/Write access");53+54+/* The MAX6875 can only read/write 16 bytes at a time */55+#define SLICE_SIZE 1656+#define SLICE_BITS 457+58+/* CONFIG EEPROM is at addresses 0x8000 - 0x8045, registers are at 0 - 0x45 */59+#define CONFIG_EEPROM_BASE 0x800060+#define CONFIG_EEPROM_SIZE 0x004661+#define CONFIG_EEPROM_SLICES 562+63+/* USER EEPROM is at addresses 0x8100 - 0x82FF */64+#define USER_EEPROM_BASE 0x810065+#define USER_EEPROM_SIZE 0x020066+#define USER_EEPROM_SLICES 3267+68+/* MAX6875 commands */69+#define MAX6875_CMD_BLOCK_WRITE 0x8370+#define MAX6875_CMD_BLOCK_READ 0x8471+#define MAX6875_CMD_REBOOT 0x8872+73+enum max6875_area_type {74+ max6875_register_config=0,75+ max6875_eeprom_config,76+ max6875_eeprom_user,77+ max6857_max78+};79+80+struct eeprom_block {81+ enum max6875_area_type type;82+ u8 slices;83+ u32 size;84+ u32 valid;85+ u32 base;86+ unsigned long *updated;87+ u8 *data;88+};89+90+/* Each client has this additional data */91+struct max6875_data {92+ struct i2c_client client;93+ struct semaphore update_lock;94+ struct eeprom_block blocks[max6857_max];95+ /* the above structs point into the arrays below */96+ u8 data[USER_EEPROM_SIZE + (CONFIG_EEPROM_SIZE*2)];97+ unsigned long last_updated[USER_EEPROM_SLICES + (CONFIG_EEPROM_SLICES*2)];98+};99+100+static int max6875_attach_adapter(struct i2c_adapter *adapter);101+static int max6875_detect(struct i2c_adapter *adapter, int address, int kind);102+static int max6875_detach_client(struct i2c_client *client);103+104+/* This is the driver that will be inserted */105+static struct i2c_driver max6875_driver = {106+ .owner = THIS_MODULE,107+ .name = "max6875",108+ .flags = I2C_DF_NOTIFY,109+ .attach_adapter = max6875_attach_adapter,110+ .detach_client = max6875_detach_client,111+};112+113+static int max6875_update_slice(struct i2c_client *client,114+ struct eeprom_block *blk,115+ int slice)116+{117+ struct max6875_data *data = i2c_get_clientdata(client);118+ int i, j, addr, count;119+ u8 rdbuf[SLICE_SIZE];120+ int retval = 0;121+122+ if (slice >= blk->slices)123+ return -1;124+125+ down(&data->update_lock);126+127+ if (!(blk->valid & (1 << slice)) ||128+ (jiffies - blk->updated[slice] > 300 * HZ) ||129+ (jiffies < blk->updated[slice])) {130+ dev_dbg(&client->dev, "Starting eeprom update, slice %u, base %u\n",131+ slice, blk->base);132+133+ addr = blk->base + (slice << SLICE_BITS);134+ count = blk->size - (slice << SLICE_BITS);135+ if (count > SLICE_SIZE) {136+ count = SLICE_SIZE;137+ }138+139+ /* Preset the read address */140+ if (addr < 0x100) {141+ /* select the register */142+ if (i2c_smbus_write_byte(client, addr & 0xFF)) {143+ dev_dbg(&client->dev, "max6875 register select has failed!\n");144+ retval = -1;145+ goto exit;146+ }147+ } else {148+ /* select the eeprom */149+ if (i2c_smbus_write_byte_data(client, addr >> 8, addr & 0xFF)) {150+ dev_dbg(&client->dev, "max6875 address set has failed!\n");151+ retval = -1;152+ goto exit;153+ }154+ }155+156+ if (i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_READ_I2C_BLOCK)) {157+ if (i2c_smbus_read_i2c_block_data(client, MAX6875_CMD_BLOCK_READ,158+ rdbuf) != SLICE_SIZE)159+ {160+ retval = -1;161+ goto exit;162+ }163+164+ memcpy(&blk->data[slice << SLICE_BITS], rdbuf, count);165+ } else {166+ for (i = 0; i < count; i++) {167+ j = i2c_smbus_read_byte(client);168+ if (j < 0)169+ {170+ retval = -1;171+ goto exit;172+ }173+ blk->data[(slice << SLICE_BITS) + i] = (u8) j;174+ }175+ }176+ blk->updated[slice] = jiffies;177+ blk->valid |= (1 << slice);178+ }179+ exit:180+ up(&data->update_lock);181+ return retval;182+}183+184+static ssize_t max6875_read(struct kobject *kobj, char *buf, loff_t off, size_t count,185+ enum max6875_area_type area_type)186+{187+ struct i2c_client *client = to_i2c_client(container_of(kobj, struct device, kobj));188+ struct max6875_data *data = i2c_get_clientdata(client);189+ struct eeprom_block *blk;190+ int slice;191+192+ blk = &data->blocks[area_type];193+194+ if (off > blk->size)195+ return 0;196+ if (off + count > blk->size)197+ count = blk->size - off;198+199+ /* Only refresh slices which contain requested bytes */200+ for (slice = (off >> SLICE_BITS); slice <= ((off + count - 1) >> SLICE_BITS); slice++)201+ max6875_update_slice(client, blk, slice);202+203+ memcpy(buf, &blk->data[off], count);204+205+ return count;206+}207+208+static ssize_t max6875_user_read(struct kobject *kobj, char *buf, loff_t off, size_t count)209+{210+ return max6875_read(kobj, buf, off, count, max6875_eeprom_user);211+}212+213+static ssize_t max6875_config_read(struct kobject *kobj, char *buf, loff_t off, size_t count)214+{215+ return max6875_read(kobj, buf, off, count, max6875_eeprom_config);216+}217+218+static ssize_t max6875_cfgreg_read(struct kobject *kobj, char *buf, loff_t off, size_t count)219+{220+ return max6875_read(kobj, buf, off, count, max6875_register_config);221+}222+223+224+static ssize_t max6875_write(struct kobject *kobj, char *buf, loff_t off, size_t count,225+ enum max6875_area_type area_type)226+{227+ struct i2c_client *client = to_i2c_client(container_of(kobj, struct device, kobj));228+ struct max6875_data *data = i2c_get_clientdata(client);229+ struct eeprom_block *blk;230+ int slice, addr, retval;231+ ssize_t sent = 0;232+233+ blk = &data->blocks[area_type];234+235+ if (off > blk->size)236+ return 0;237+ if ((off + count) > blk->size)238+ count = blk->size - off;239+240+ if (down_interruptible(&data->update_lock))241+ return -EAGAIN;242+243+ /* writing to a register is done with i2c_smbus_write_byte_data() */244+ if (blk->type == max6875_register_config) {245+ for (sent = 0; sent < count; sent++) {246+ addr = off + sent;247+ if (addr == 0x44)248+ continue;249+250+ retval = i2c_smbus_write_byte_data(client, addr, buf[sent]);251+ }252+ } else {253+ int cmd, val;254+255+ /* We are writing to EEPROM */256+ for (sent = 0; sent < count; sent++) {257+ addr = blk->base + off + sent;258+ cmd = addr >> 8;259+ val = (addr & 0xff) | (buf[sent] << 8); // reversed260+261+ if (addr == 0x8044)262+ continue;263+264+ retval = i2c_smbus_write_word_data(client, cmd, val);265+266+ if (retval) {267+ goto error_exit;268+ }269+270+ /* A write takes up to 11 ms */271+ msleep(11);272+ }273+ }274+275+ /* Invalidate the scratch buffer */276+ for (slice = (off >> SLICE_BITS); slice <= ((off + count - 1) >> SLICE_BITS); slice++)277+ blk->valid &= ~(1 << slice);278+279+ error_exit:280+ up(&data->update_lock);281+282+ return sent;283+}284+285+static ssize_t max6875_user_write(struct kobject *kobj, char *buf, loff_t off, size_t count)286+{287+ return max6875_write(kobj, buf, off, count, max6875_eeprom_user);288+}289+290+static ssize_t max6875_config_write(struct kobject *kobj, char *buf, loff_t off, size_t count)291+{292+ return max6875_write(kobj, buf, off, count, max6875_eeprom_config);293+}294+295+static ssize_t max6875_cfgreg_write(struct kobject *kobj, char *buf, loff_t off, size_t count)296+{297+ return max6875_write(kobj, buf, off, count, max6875_register_config);298+}299+300+static struct bin_attribute user_eeprom_attr = {301+ .attr = {302+ .name = "eeprom_user",303+ .mode = S_IRUGO | S_IWUSR | S_IWGRP,304+ .owner = THIS_MODULE,305+ },306+ .size = USER_EEPROM_SIZE,307+ .read = max6875_user_read,308+ .write = max6875_user_write,309+};310+311+static struct bin_attribute config_eeprom_attr = {312+ .attr = {313+ .name = "eeprom_config",314+ .mode = S_IRUGO | S_IWUSR,315+ .owner = THIS_MODULE,316+ },317+ .size = CONFIG_EEPROM_SIZE,318+ .read = max6875_config_read,319+ .write = max6875_config_write,320+};321+322+static struct bin_attribute config_register_attr = {323+ .attr = {324+ .name = "reg_config",325+ .mode = S_IRUGO | S_IWUSR,326+ .owner = THIS_MODULE,327+ },328+ .size = CONFIG_EEPROM_SIZE,329+ .read = max6875_cfgreg_read,330+ .write = max6875_cfgreg_write,331+};332+333+static int max6875_attach_adapter(struct i2c_adapter *adapter)334+{335+ return i2c_detect(adapter, &addr_data, max6875_detect);336+}337+338+/* This function is called by i2c_detect */339+static int max6875_detect(struct i2c_adapter *adapter, int address, int kind)340+{341+ struct i2c_client *new_client;342+ struct max6875_data *data;343+ int err = 0;344+345+ /* There are three ways we can read the EEPROM data:346+ (1) I2C block reads (faster, but unsupported by most adapters)347+ (2) Consecutive byte reads (100% overhead)348+ (3) Regular byte data reads (200% overhead)349+ The third method is not implemented by this driver because all350+ known adapters support at least the second. */351+ if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_READ_BYTE_DATA |352+ I2C_FUNC_SMBUS_BYTE |353+ I2C_FUNC_SMBUS_WRITE_BYTE_DATA))354+ goto exit;355+356+ /* OK. For now, we presume we have a valid client. We now create the357+ client structure, even though we cannot fill it completely yet.358+ But it allows us to access eeprom_{read,write}_value. */359+ if (!(data = kmalloc(sizeof(struct max6875_data), GFP_KERNEL))) {360+ err = -ENOMEM;361+ goto exit;362+ }363+ memset(data, 0, sizeof(struct max6875_data));364+365+ new_client = &data->client;366+ i2c_set_clientdata(new_client, data);367+ new_client->addr = address;368+ new_client->adapter = adapter;369+ new_client->driver = &max6875_driver;370+ new_client->flags = 0;371+372+ /* Setup the user section */373+ data->blocks[max6875_eeprom_user].type = max6875_eeprom_user;374+ data->blocks[max6875_eeprom_user].slices = USER_EEPROM_SLICES;375+ data->blocks[max6875_eeprom_user].size = USER_EEPROM_SIZE;376+ data->blocks[max6875_eeprom_user].base = USER_EEPROM_BASE;377+ data->blocks[max6875_eeprom_user].data = data->data;378+ data->blocks[max6875_eeprom_user].updated = data->last_updated;379+380+ /* Setup the config section */381+ data->blocks[max6875_eeprom_config].type = max6875_eeprom_config;382+ data->blocks[max6875_eeprom_config].slices = CONFIG_EEPROM_SLICES;383+ data->blocks[max6875_eeprom_config].size = CONFIG_EEPROM_SIZE;384+ data->blocks[max6875_eeprom_config].base = CONFIG_EEPROM_BASE;385+ data->blocks[max6875_eeprom_config].data = &data->data[USER_EEPROM_SIZE];386+ data->blocks[max6875_eeprom_config].updated = &data->last_updated[USER_EEPROM_SLICES];387+388+ /* Setup the register section */389+ data->blocks[max6875_register_config].type = max6875_register_config;390+ data->blocks[max6875_register_config].slices = CONFIG_EEPROM_SLICES;391+ data->blocks[max6875_register_config].size = CONFIG_EEPROM_SIZE;392+ data->blocks[max6875_register_config].base = 0;393+ data->blocks[max6875_register_config].data = &data->data[USER_EEPROM_SIZE+CONFIG_EEPROM_SIZE];394+ data->blocks[max6875_register_config].updated = &data->last_updated[USER_EEPROM_SLICES+CONFIG_EEPROM_SLICES];395+396+ /* Init the data */397+ memset(data->data, 0xff, sizeof(data->data));398+399+ /* Fill in the remaining client fields */400+ strlcpy(new_client->name, "max6875", I2C_NAME_SIZE);401+ init_MUTEX(&data->update_lock);402+403+ /* Verify that the chip is really what we think it is */404+ if ((max6875_update_slice(new_client, &data->blocks[max6875_eeprom_config], 4) < 0) ||405+ (max6875_update_slice(new_client, &data->blocks[max6875_register_config], 4) < 0))406+ goto exit_kfree;407+408+ /* 0x41,0x42 must be zero and 0x40 must match in eeprom and registers */409+ if ((data->blocks[max6875_eeprom_config].data[0x41] != 0) ||410+ (data->blocks[max6875_eeprom_config].data[0x42] != 0) ||411+ (data->blocks[max6875_register_config].data[0x41] != 0) ||412+ (data->blocks[max6875_register_config].data[0x42] != 0) ||413+ (data->blocks[max6875_eeprom_config].data[0x40] !=414+ data->blocks[max6875_register_config].data[0x40]))415+ goto exit_kfree;416+417+ /* Tell the I2C layer a new client has arrived */418+ if ((err = i2c_attach_client(new_client)))419+ goto exit_kfree;420+421+ /* create the sysfs eeprom files with the correct permissions */422+ if (allow_write == 0) {423+ user_eeprom_attr.attr.mode &= ~S_IWUGO;424+ user_eeprom_attr.write = NULL;425+ config_eeprom_attr.attr.mode &= ~S_IWUGO;426+ config_eeprom_attr.write = NULL;427+ config_register_attr.attr.mode &= ~S_IWUGO;428+ config_register_attr.write = NULL;429+ }430+ sysfs_create_bin_file(&new_client->dev.kobj, &user_eeprom_attr);431+ sysfs_create_bin_file(&new_client->dev.kobj, &config_eeprom_attr);432+ sysfs_create_bin_file(&new_client->dev.kobj, &config_register_attr);433+434+ return 0;435+436+exit_kfree:437+ kfree(data);438+exit:439+ return err;440+}441+442+static int max6875_detach_client(struct i2c_client *client)443+{444+ int err;445+446+ err = i2c_detach_client(client);447+ if (err) {448+ dev_err(&client->dev, "Client deregistration failed, client not detached.\n");449+ return err;450+ }451+452+ kfree(i2c_get_clientdata(client));453+454+ return 0;455+}456+457+static int __init max6875_init(void)458+{459+ return i2c_add_driver(&max6875_driver);460+}461+462+static void __exit max6875_exit(void)463+{464+ i2c_del_driver(&max6875_driver);465+}466+467+468+MODULE_AUTHOR("Ben Gardner <bgardner@wabtec.com>");469+MODULE_DESCRIPTION("MAX6875 driver");470+MODULE_LICENSE("GPL");471+472+module_init(max6875_init);473+module_exit(max6875_exit);
-1
drivers/i2c/chips/pc87360.c
···33 * the standard Super-I/O addresses is used (0x2E/0x2F or 0x4E/0x4F).34 */3536-#include <linux/config.h>37#include <linux/module.h>38#include <linux/init.h>39#include <linux/slab.h>
···33 * the standard Super-I/O addresses is used (0x2E/0x2F or 0x4E/0x4F).34 */35036#include <linux/module.h>37#include <linux/init.h>38#include <linux/slab.h>
···372 * SMSC LPC47M10x/LPC47M13x (device id 0x59), LPC47M14x (device id373 * 0x5F) and LPC47B27x (device id 0x51) have fan control.374 * The LPC47M15x and LPC47M192 chips "with hardware monitoring block"375- * can do much more besides (device id 0x60, unsupported).376 */377 if (val == 0x51)378- printk(KERN_INFO "smsc47m1: Found SMSC47B27x\n");379 else if (val == 0x59)380- printk(KERN_INFO "smsc47m1: Found SMSC47M10x/SMSC47M13x\n");381 else if (val == 0x5F)382- printk(KERN_INFO "smsc47m1: Found SMSC47M14x\n");00383 else {384 superio_exit();385 return -ENODEV;
···372 * SMSC LPC47M10x/LPC47M13x (device id 0x59), LPC47M14x (device id373 * 0x5F) and LPC47B27x (device id 0x51) have fan control.374 * The LPC47M15x and LPC47M192 chips "with hardware monitoring block"375+ * can do much more besides (device id 0x60).376 */377 if (val == 0x51)378+ printk(KERN_INFO "smsc47m1: Found SMSC LPC47B27x\n");379 else if (val == 0x59)380+ printk(KERN_INFO "smsc47m1: Found SMSC LPC47M10x/LPC47M13x\n");381 else if (val == 0x5F)382+ printk(KERN_INFO "smsc47m1: Found SMSC LPC47M14x\n");383+ else if (val == 0x60)384+ printk(KERN_INFO "smsc47m1: Found SMSC LPC47M15x/LPC47M192\n");385 else {386 superio_exit();387 return -ENODEV;
···1+/*2+ w83627ehf - Driver for the hardware monitoring functionality of3+ the Winbond W83627EHF Super-I/O chip4+ Copyright (C) 2005 Jean Delvare <khali@linux-fr.org>5+6+ Shamelessly ripped from the w83627hf driver7+ Copyright (C) 2003 Mark Studebaker8+9+ Thanks to Leon Moonen, Steve Cliffe and Grant Coady for their help10+ in testing and debugging this driver.11+12+ This program is free software; you can redistribute it and/or modify13+ it under the terms of the GNU General Public License as published by14+ the Free Software Foundation; either version 2 of the License, or15+ (at your option) any later version.16+17+ This program is distributed in the hope that it will be useful,18+ but WITHOUT ANY WARRANTY; without even the implied warranty of19+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the20+ GNU General Public License for more details.21+22+ You should have received a copy of the GNU General Public License23+ along with this program; if not, write to the Free Software24+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.25+26+27+ Supports the following chips:28+29+ Chip #vin #fan #pwm #temp chip_id man_id30+ w83627ehf - 5 - 3 0x88 0x5ca331+32+ This is a preliminary version of the driver, only supporting the33+ fan and temperature inputs. The chip does much more than that.34+*/35+36+#include <linux/module.h>37+#include <linux/init.h>38+#include <linux/slab.h>39+#include <linux/i2c.h>40+#include <linux/i2c-sensor.h>41+#include <asm/io.h>42+#include "lm75.h"43+44+/* Addresses to scan45+ The actual ISA address is read from Super-I/O configuration space */46+static unsigned short normal_i2c[] = { I2C_CLIENT_END };47+static unsigned int normal_isa[] = { 0, I2C_CLIENT_ISA_END };48+49+/* Insmod parameters */50+SENSORS_INSMOD_1(w83627ehf);51+52+/*53+ * Super-I/O constants and functions54+ */55+56+static int REG; /* The register to read/write */57+static int VAL; /* The value to read/write */58+59+#define W83627EHF_LD_HWM 0x0b60+61+#define SIO_REG_LDSEL 0x07 /* Logical device select */62+#define SIO_REG_DEVID 0x20 /* Device ID (2 bytes) */63+#define SIO_REG_ENABLE 0x30 /* Logical device enable */64+#define SIO_REG_ADDR 0x60 /* Logical device address (2 bytes) */65+66+#define SIO_W83627EHF_ID 0x884067+#define SIO_ID_MASK 0xFFC068+69+static inline void70+superio_outb(int reg, int val)71+{72+ outb(reg, REG);73+ outb(val, VAL);74+}75+76+static inline int77+superio_inb(int reg)78+{79+ outb(reg, REG);80+ return inb(VAL);81+}82+83+static inline void84+superio_select(int ld)85+{86+ outb(SIO_REG_LDSEL, REG);87+ outb(ld, VAL);88+}89+90+static inline void91+superio_enter(void)92+{93+ outb(0x87, REG);94+ outb(0x87, REG);95+}96+97+static inline void98+superio_exit(void)99+{100+ outb(0x02, REG);101+ outb(0x02, VAL);102+}103+104+/*105+ * ISA constants106+ */107+108+#define REGION_LENGTH 8109+#define ADDR_REG_OFFSET 5110+#define DATA_REG_OFFSET 6111+112+#define W83627EHF_REG_BANK 0x4E113+#define W83627EHF_REG_CONFIG 0x40114+#define W83627EHF_REG_CHIP_ID 0x49115+#define W83627EHF_REG_MAN_ID 0x4F116+117+static const u16 W83627EHF_REG_FAN[] = { 0x28, 0x29, 0x2a, 0x3f, 0x553 };118+static const u16 W83627EHF_REG_FAN_MIN[] = { 0x3b, 0x3c, 0x3d, 0x3e, 0x55c };119+120+#define W83627EHF_REG_TEMP1 0x27121+#define W83627EHF_REG_TEMP1_HYST 0x3a122+#define W83627EHF_REG_TEMP1_OVER 0x39123+static const u16 W83627EHF_REG_TEMP[] = { 0x150, 0x250 };124+static const u16 W83627EHF_REG_TEMP_HYST[] = { 0x153, 0x253 };125+static const u16 W83627EHF_REG_TEMP_OVER[] = { 0x155, 0x255 };126+static const u16 W83627EHF_REG_TEMP_CONFIG[] = { 0x152, 0x252 };127+128+/* Fan clock dividers are spread over the following five registers */129+#define W83627EHF_REG_FANDIV1 0x47130+#define W83627EHF_REG_FANDIV2 0x4B131+#define W83627EHF_REG_VBAT 0x5D132+#define W83627EHF_REG_DIODE 0x59133+#define W83627EHF_REG_SMI_OVT 0x4C134+135+/*136+ * Conversions137+ */138+139+static inline unsigned int140+fan_from_reg(u8 reg, unsigned int div)141+{142+ if (reg == 0 || reg == 255)143+ return 0;144+ return 1350000U / (reg * div);145+}146+147+static inline unsigned int148+div_from_reg(u8 reg)149+{150+ return 1 << reg;151+}152+153+static inline int154+temp1_from_reg(s8 reg)155+{156+ return reg * 1000;157+}158+159+static inline s8160+temp1_to_reg(int temp)161+{162+ if (temp <= -128000)163+ return -128;164+ if (temp >= 127000)165+ return 127;166+ if (temp < 0)167+ return (temp - 500) / 1000;168+ return (temp + 500) / 1000;169+}170+171+/*172+ * Data structures and manipulation thereof173+ */174+175+struct w83627ehf_data {176+ struct i2c_client client;177+ struct semaphore lock;178+179+ struct semaphore update_lock;180+ char valid; /* !=0 if following fields are valid */181+ unsigned long last_updated; /* In jiffies */182+183+ /* Register values */184+ u8 fan[5];185+ u8 fan_min[5];186+ u8 fan_div[5];187+ u8 has_fan; /* some fan inputs can be disabled */188+ s8 temp1;189+ s8 temp1_max;190+ s8 temp1_max_hyst;191+ s16 temp[2];192+ s16 temp_max[2];193+ s16 temp_max_hyst[2];194+};195+196+static inline int is_word_sized(u16 reg)197+{198+ return (((reg & 0xff00) == 0x100199+ || (reg & 0xff00) == 0x200)200+ && ((reg & 0x00ff) == 0x50201+ || (reg & 0x00ff) == 0x53202+ || (reg & 0x00ff) == 0x55));203+}204+205+/* We assume that the default bank is 0, thus the following two functions do206+ nothing for registers which live in bank 0. For others, they respectively207+ set the bank register to the correct value (before the register is208+ accessed), and back to 0 (afterwards). */209+static inline void w83627ehf_set_bank(struct i2c_client *client, u16 reg)210+{211+ if (reg & 0xff00) {212+ outb_p(W83627EHF_REG_BANK, client->addr + ADDR_REG_OFFSET);213+ outb_p(reg >> 8, client->addr + DATA_REG_OFFSET);214+ }215+}216+217+static inline void w83627ehf_reset_bank(struct i2c_client *client, u16 reg)218+{219+ if (reg & 0xff00) {220+ outb_p(W83627EHF_REG_BANK, client->addr + ADDR_REG_OFFSET);221+ outb_p(0, client->addr + DATA_REG_OFFSET);222+ }223+}224+225+static u16 w83627ehf_read_value(struct i2c_client *client, u16 reg)226+{227+ struct w83627ehf_data *data = i2c_get_clientdata(client);228+ int res, word_sized = is_word_sized(reg);229+230+ down(&data->lock);231+232+ w83627ehf_set_bank(client, reg);233+ outb_p(reg & 0xff, client->addr + ADDR_REG_OFFSET);234+ res = inb_p(client->addr + DATA_REG_OFFSET);235+ if (word_sized) {236+ outb_p((reg & 0xff) + 1,237+ client->addr + ADDR_REG_OFFSET);238+ res = (res << 8) + inb_p(client->addr + DATA_REG_OFFSET);239+ }240+ w83627ehf_reset_bank(client, reg);241+242+ up(&data->lock);243+244+ return res;245+}246+247+static int w83627ehf_write_value(struct i2c_client *client, u16 reg, u16 value)248+{249+ struct w83627ehf_data *data = i2c_get_clientdata(client);250+ int word_sized = is_word_sized(reg);251+252+ down(&data->lock);253+254+ w83627ehf_set_bank(client, reg);255+ outb_p(reg & 0xff, client->addr + ADDR_REG_OFFSET);256+ if (word_sized) {257+ outb_p(value >> 8, client->addr + DATA_REG_OFFSET);258+ outb_p((reg & 0xff) + 1,259+ client->addr + ADDR_REG_OFFSET);260+ }261+ outb_p(value & 0xff, client->addr + DATA_REG_OFFSET);262+ w83627ehf_reset_bank(client, reg);263+264+ up(&data->lock);265+ return 0;266+}267+268+/* This function assumes that the caller holds data->update_lock */269+static void w83627ehf_write_fan_div(struct i2c_client *client, int nr)270+{271+ struct w83627ehf_data *data = i2c_get_clientdata(client);272+ u8 reg;273+274+ switch (nr) {275+ case 0:276+ reg = (w83627ehf_read_value(client, W83627EHF_REG_FANDIV1) & 0xcf)277+ | ((data->fan_div[0] & 0x03) << 4);278+ w83627ehf_write_value(client, W83627EHF_REG_FANDIV1, reg);279+ reg = (w83627ehf_read_value(client, W83627EHF_REG_VBAT) & 0xdf)280+ | ((data->fan_div[0] & 0x04) << 3);281+ w83627ehf_write_value(client, W83627EHF_REG_VBAT, reg);282+ break;283+ case 1:284+ reg = (w83627ehf_read_value(client, W83627EHF_REG_FANDIV1) & 0x3f)285+ | ((data->fan_div[1] & 0x03) << 6);286+ w83627ehf_write_value(client, W83627EHF_REG_FANDIV1, reg);287+ reg = (w83627ehf_read_value(client, W83627EHF_REG_VBAT) & 0xbf)288+ | ((data->fan_div[1] & 0x04) << 4);289+ w83627ehf_write_value(client, W83627EHF_REG_VBAT, reg);290+ break;291+ case 2:292+ reg = (w83627ehf_read_value(client, W83627EHF_REG_FANDIV2) & 0x3f)293+ | ((data->fan_div[2] & 0x03) << 6);294+ w83627ehf_write_value(client, W83627EHF_REG_FANDIV2, reg);295+ reg = (w83627ehf_read_value(client, W83627EHF_REG_VBAT) & 0x7f)296+ | ((data->fan_div[2] & 0x04) << 5);297+ w83627ehf_write_value(client, W83627EHF_REG_VBAT, reg);298+ break;299+ case 3:300+ reg = (w83627ehf_read_value(client, W83627EHF_REG_DIODE) & 0xfc)301+ | (data->fan_div[3] & 0x03);302+ w83627ehf_write_value(client, W83627EHF_REG_DIODE, reg);303+ reg = (w83627ehf_read_value(client, W83627EHF_REG_SMI_OVT) & 0x7f)304+ | ((data->fan_div[3] & 0x04) << 5);305+ w83627ehf_write_value(client, W83627EHF_REG_SMI_OVT, reg);306+ break;307+ case 4:308+ reg = (w83627ehf_read_value(client, W83627EHF_REG_DIODE) & 0x73)309+ | ((data->fan_div[4] & 0x03) << 3)310+ | ((data->fan_div[4] & 0x04) << 5);311+ w83627ehf_write_value(client, W83627EHF_REG_DIODE, reg);312+ break;313+ }314+}315+316+static struct w83627ehf_data *w83627ehf_update_device(struct device *dev)317+{318+ struct i2c_client *client = to_i2c_client(dev);319+ struct w83627ehf_data *data = i2c_get_clientdata(client);320+ int i;321+322+ down(&data->update_lock);323+324+ if (time_after(jiffies, data->last_updated + HZ)325+ || !data->valid) {326+ /* Fan clock dividers */327+ i = w83627ehf_read_value(client, W83627EHF_REG_FANDIV1);328+ data->fan_div[0] = (i >> 4) & 0x03;329+ data->fan_div[1] = (i >> 6) & 0x03;330+ i = w83627ehf_read_value(client, W83627EHF_REG_FANDIV2);331+ data->fan_div[2] = (i >> 6) & 0x03;332+ i = w83627ehf_read_value(client, W83627EHF_REG_VBAT);333+ data->fan_div[0] |= (i >> 3) & 0x04;334+ data->fan_div[1] |= (i >> 4) & 0x04;335+ data->fan_div[2] |= (i >> 5) & 0x04;336+ if (data->has_fan & ((1 << 3) | (1 << 4))) {337+ i = w83627ehf_read_value(client, W83627EHF_REG_DIODE);338+ data->fan_div[3] = i & 0x03;339+ data->fan_div[4] = ((i >> 2) & 0x03)340+ | ((i >> 5) & 0x04);341+ }342+ if (data->has_fan & (1 << 3)) {343+ i = w83627ehf_read_value(client, W83627EHF_REG_SMI_OVT);344+ data->fan_div[3] |= (i >> 5) & 0x04;345+ }346+347+ /* Measured fan speeds and limits */348+ for (i = 0; i < 5; i++) {349+ if (!(data->has_fan & (1 << i)))350+ continue;351+352+ data->fan[i] = w83627ehf_read_value(client,353+ W83627EHF_REG_FAN[i]);354+ data->fan_min[i] = w83627ehf_read_value(client,355+ W83627EHF_REG_FAN_MIN[i]);356+357+ /* If we failed to measure the fan speed and clock358+ divider can be increased, let's try that for next359+ time */360+ if (data->fan[i] == 0xff361+ && data->fan_div[i] < 0x07) {362+ dev_dbg(&client->dev, "Increasing fan %d "363+ "clock divider from %u to %u\n",364+ i, div_from_reg(data->fan_div[i]),365+ div_from_reg(data->fan_div[i] + 1));366+ data->fan_div[i]++;367+ w83627ehf_write_fan_div(client, i);368+ /* Preserve min limit if possible */369+ if (data->fan_min[i] >= 2370+ && data->fan_min[i] != 255)371+ w83627ehf_write_value(client,372+ W83627EHF_REG_FAN_MIN[i],373+ (data->fan_min[i] /= 2));374+ }375+ }376+377+ /* Measured temperatures and limits */378+ data->temp1 = w83627ehf_read_value(client,379+ W83627EHF_REG_TEMP1);380+ data->temp1_max = w83627ehf_read_value(client,381+ W83627EHF_REG_TEMP1_OVER);382+ data->temp1_max_hyst = w83627ehf_read_value(client,383+ W83627EHF_REG_TEMP1_HYST);384+ for (i = 0; i < 2; i++) {385+ data->temp[i] = w83627ehf_read_value(client,386+ W83627EHF_REG_TEMP[i]);387+ data->temp_max[i] = w83627ehf_read_value(client,388+ W83627EHF_REG_TEMP_OVER[i]);389+ data->temp_max_hyst[i] = w83627ehf_read_value(client,390+ W83627EHF_REG_TEMP_HYST[i]);391+ }392+393+ data->last_updated = jiffies;394+ data->valid = 1;395+ }396+397+ up(&data->update_lock);398+ return data;399+}400+401+/*402+ * Sysfs callback functions403+ */404+405+#define show_fan_reg(reg) \406+static ssize_t \407+show_##reg(struct device *dev, char *buf, int nr) \408+{ \409+ struct w83627ehf_data *data = w83627ehf_update_device(dev); \410+ return sprintf(buf, "%d\n", \411+ fan_from_reg(data->reg[nr], \412+ div_from_reg(data->fan_div[nr]))); \413+}414+show_fan_reg(fan);415+show_fan_reg(fan_min);416+417+static ssize_t418+show_fan_div(struct device *dev, char *buf, int nr)419+{420+ struct w83627ehf_data *data = w83627ehf_update_device(dev);421+ return sprintf(buf, "%u\n",422+ div_from_reg(data->fan_div[nr]));423+}424+425+static ssize_t426+store_fan_min(struct device *dev, const char *buf, size_t count, int nr)427+{428+ struct i2c_client *client = to_i2c_client(dev);429+ struct w83627ehf_data *data = i2c_get_clientdata(client);430+ unsigned int val = simple_strtoul(buf, NULL, 10);431+ unsigned int reg;432+ u8 new_div;433+434+ down(&data->update_lock);435+ if (!val) {436+ /* No min limit, alarm disabled */437+ data->fan_min[nr] = 255;438+ new_div = data->fan_div[nr]; /* No change */439+ dev_info(dev, "fan%u low limit and alarm disabled\n", nr + 1);440+ } else if ((reg = 1350000U / val) >= 128 * 255) {441+ /* Speed below this value cannot possibly be represented,442+ even with the highest divider (128) */443+ data->fan_min[nr] = 254;444+ new_div = 7; /* 128 == (1 << 7) */445+ dev_warn(dev, "fan%u low limit %u below minimum %u, set to "446+ "minimum\n", nr + 1, val, fan_from_reg(254, 128));447+ } else if (!reg) {448+ /* Speed above this value cannot possibly be represented,449+ even with the lowest divider (1) */450+ data->fan_min[nr] = 1;451+ new_div = 0; /* 1 == (1 << 0) */452+ dev_warn(dev, "fan%u low limit %u above maximum %u, set to "453+ "maximum\n", nr + 1, val, fan_from_reg(1, 1));454+ } else {455+ /* Automatically pick the best divider, i.e. the one such456+ that the min limit will correspond to a register value457+ in the 96..192 range */458+ new_div = 0;459+ while (reg > 192 && new_div < 7) {460+ reg >>= 1;461+ new_div++;462+ }463+ data->fan_min[nr] = reg;464+ }465+466+ /* Write both the fan clock divider (if it changed) and the new467+ fan min (unconditionally) */468+ if (new_div != data->fan_div[nr]) {469+ if (new_div > data->fan_div[nr])470+ data->fan[nr] >>= (data->fan_div[nr] - new_div);471+ else472+ data->fan[nr] <<= (new_div - data->fan_div[nr]);473+474+ dev_dbg(dev, "fan%u clock divider changed from %u to %u\n",475+ nr + 1, div_from_reg(data->fan_div[nr]),476+ div_from_reg(new_div));477+ data->fan_div[nr] = new_div;478+ w83627ehf_write_fan_div(client, nr);479+ }480+ w83627ehf_write_value(client, W83627EHF_REG_FAN_MIN[nr],481+ data->fan_min[nr]);482+ up(&data->update_lock);483+484+ return count;485+}486+487+#define sysfs_fan_offset(offset) \488+static ssize_t \489+show_reg_fan_##offset(struct device *dev, struct device_attribute *attr, \490+ char *buf) \491+{ \492+ return show_fan(dev, buf, offset-1); \493+} \494+static DEVICE_ATTR(fan##offset##_input, S_IRUGO, \495+ show_reg_fan_##offset, NULL);496+497+#define sysfs_fan_min_offset(offset) \498+static ssize_t \499+show_reg_fan##offset##_min(struct device *dev, struct device_attribute *attr, \500+ char *buf) \501+{ \502+ return show_fan_min(dev, buf, offset-1); \503+} \504+static ssize_t \505+store_reg_fan##offset##_min(struct device *dev, struct device_attribute *attr, \506+ const char *buf, size_t count) \507+{ \508+ return store_fan_min(dev, buf, count, offset-1); \509+} \510+static DEVICE_ATTR(fan##offset##_min, S_IRUGO | S_IWUSR, \511+ show_reg_fan##offset##_min, \512+ store_reg_fan##offset##_min);513+514+#define sysfs_fan_div_offset(offset) \515+static ssize_t \516+show_reg_fan##offset##_div(struct device *dev, struct device_attribute *attr, \517+ char *buf) \518+{ \519+ return show_fan_div(dev, buf, offset - 1); \520+} \521+static DEVICE_ATTR(fan##offset##_div, S_IRUGO, \522+ show_reg_fan##offset##_div, NULL);523+524+sysfs_fan_offset(1);525+sysfs_fan_min_offset(1);526+sysfs_fan_div_offset(1);527+sysfs_fan_offset(2);528+sysfs_fan_min_offset(2);529+sysfs_fan_div_offset(2);530+sysfs_fan_offset(3);531+sysfs_fan_min_offset(3);532+sysfs_fan_div_offset(3);533+sysfs_fan_offset(4);534+sysfs_fan_min_offset(4);535+sysfs_fan_div_offset(4);536+sysfs_fan_offset(5);537+sysfs_fan_min_offset(5);538+sysfs_fan_div_offset(5);539+540+#define show_temp1_reg(reg) \541+static ssize_t \542+show_##reg(struct device *dev, struct device_attribute *attr, \543+ char *buf) \544+{ \545+ struct w83627ehf_data *data = w83627ehf_update_device(dev); \546+ return sprintf(buf, "%d\n", temp1_from_reg(data->reg)); \547+}548+show_temp1_reg(temp1);549+show_temp1_reg(temp1_max);550+show_temp1_reg(temp1_max_hyst);551+552+#define store_temp1_reg(REG, reg) \553+static ssize_t \554+store_temp1_##reg(struct device *dev, struct device_attribute *attr, \555+ const char *buf, size_t count) \556+{ \557+ struct i2c_client *client = to_i2c_client(dev); \558+ struct w83627ehf_data *data = i2c_get_clientdata(client); \559+ u32 val = simple_strtoul(buf, NULL, 10); \560+ \561+ down(&data->update_lock); \562+ data->temp1_##reg = temp1_to_reg(val); \563+ w83627ehf_write_value(client, W83627EHF_REG_TEMP1_##REG, \564+ data->temp1_##reg); \565+ up(&data->update_lock); \566+ return count; \567+}568+store_temp1_reg(OVER, max);569+store_temp1_reg(HYST, max_hyst);570+571+static DEVICE_ATTR(temp1_input, S_IRUGO, show_temp1, NULL);572+static DEVICE_ATTR(temp1_max, S_IRUGO| S_IWUSR,573+ show_temp1_max, store_temp1_max);574+static DEVICE_ATTR(temp1_max_hyst, S_IRUGO| S_IWUSR,575+ show_temp1_max_hyst, store_temp1_max_hyst);576+577+#define show_temp_reg(reg) \578+static ssize_t \579+show_##reg (struct device *dev, char *buf, int nr) \580+{ \581+ struct w83627ehf_data *data = w83627ehf_update_device(dev); \582+ return sprintf(buf, "%d\n", \583+ LM75_TEMP_FROM_REG(data->reg[nr])); \584+}585+show_temp_reg(temp);586+show_temp_reg(temp_max);587+show_temp_reg(temp_max_hyst);588+589+#define store_temp_reg(REG, reg) \590+static ssize_t \591+store_##reg (struct device *dev, const char *buf, size_t count, int nr) \592+{ \593+ struct i2c_client *client = to_i2c_client(dev); \594+ struct w83627ehf_data *data = i2c_get_clientdata(client); \595+ u32 val = simple_strtoul(buf, NULL, 10); \596+ \597+ down(&data->update_lock); \598+ data->reg[nr] = LM75_TEMP_TO_REG(val); \599+ w83627ehf_write_value(client, W83627EHF_REG_TEMP_##REG[nr], \600+ data->reg[nr]); \601+ up(&data->update_lock); \602+ return count; \603+}604+store_temp_reg(OVER, temp_max);605+store_temp_reg(HYST, temp_max_hyst);606+607+#define sysfs_temp_offset(offset) \608+static ssize_t \609+show_reg_temp##offset (struct device *dev, struct device_attribute *attr, \610+ char *buf) \611+{ \612+ return show_temp(dev, buf, offset - 2); \613+} \614+static DEVICE_ATTR(temp##offset##_input, S_IRUGO, \615+ show_reg_temp##offset, NULL);616+617+#define sysfs_temp_reg_offset(reg, offset) \618+static ssize_t \619+show_reg_temp##offset##_##reg(struct device *dev, struct device_attribute *attr, \620+ char *buf) \621+{ \622+ return show_temp_##reg(dev, buf, offset - 2); \623+} \624+static ssize_t \625+store_reg_temp##offset##_##reg(struct device *dev, struct device_attribute *attr, \626+ const char *buf, size_t count) \627+{ \628+ return store_temp_##reg(dev, buf, count, offset - 2); \629+} \630+static DEVICE_ATTR(temp##offset##_##reg, S_IRUGO| S_IWUSR, \631+ show_reg_temp##offset##_##reg, \632+ store_reg_temp##offset##_##reg);633+634+sysfs_temp_offset(2);635+sysfs_temp_reg_offset(max, 2);636+sysfs_temp_reg_offset(max_hyst, 2);637+sysfs_temp_offset(3);638+sysfs_temp_reg_offset(max, 3);639+sysfs_temp_reg_offset(max_hyst, 3);640+641+/*642+ * Driver and client management643+ */644+645+static struct i2c_driver w83627ehf_driver;646+647+static void w83627ehf_init_client(struct i2c_client *client)648+{649+ int i;650+ u8 tmp;651+652+ /* Start monitoring is needed */653+ tmp = w83627ehf_read_value(client, W83627EHF_REG_CONFIG);654+ if (!(tmp & 0x01))655+ w83627ehf_write_value(client, W83627EHF_REG_CONFIG,656+ tmp | 0x01);657+658+ /* Enable temp2 and temp3 if needed */659+ for (i = 0; i < 2; i++) {660+ tmp = w83627ehf_read_value(client,661+ W83627EHF_REG_TEMP_CONFIG[i]);662+ if (tmp & 0x01)663+ w83627ehf_write_value(client,664+ W83627EHF_REG_TEMP_CONFIG[i],665+ tmp & 0xfe);666+ }667+}668+669+static int w83627ehf_detect(struct i2c_adapter *adapter, int address, int kind)670+{671+ struct i2c_client *client;672+ struct w83627ehf_data *data;673+ int i, err = 0;674+675+ if (!i2c_is_isa_adapter(adapter))676+ return 0;677+678+ if (!request_region(address, REGION_LENGTH, w83627ehf_driver.name)) {679+ err = -EBUSY;680+ goto exit;681+ }682+683+ if (!(data = kmalloc(sizeof(struct w83627ehf_data), GFP_KERNEL))) {684+ err = -ENOMEM;685+ goto exit_release;686+ }687+ memset(data, 0, sizeof(struct w83627ehf_data));688+689+ client = &data->client;690+ i2c_set_clientdata(client, data);691+ client->addr = address;692+ init_MUTEX(&data->lock);693+ client->adapter = adapter;694+ client->driver = &w83627ehf_driver;695+ client->flags = 0;696+697+ strlcpy(client->name, "w83627ehf", I2C_NAME_SIZE);698+ data->valid = 0;699+ init_MUTEX(&data->update_lock);700+701+ /* Tell the i2c layer a new client has arrived */702+ if ((err = i2c_attach_client(client)))703+ goto exit_free;704+705+ /* Initialize the chip */706+ w83627ehf_init_client(client);707+708+ /* A few vars need to be filled upon startup */709+ for (i = 0; i < 5; i++)710+ data->fan_min[i] = w83627ehf_read_value(client,711+ W83627EHF_REG_FAN_MIN[i]);712+713+ /* It looks like fan4 and fan5 pins can be alternatively used714+ as fan on/off switches */715+ data->has_fan = 0x07; /* fan1, fan2 and fan3 */716+ i = w83627ehf_read_value(client, W83627EHF_REG_FANDIV1);717+ if (i & (1 << 2))718+ data->has_fan |= (1 << 3);719+ if (i & (1 << 0))720+ data->has_fan |= (1 << 4);721+722+ /* Register sysfs hooks */723+ device_create_file(&client->dev, &dev_attr_fan1_input);724+ device_create_file(&client->dev, &dev_attr_fan1_min);725+ device_create_file(&client->dev, &dev_attr_fan1_div);726+ device_create_file(&client->dev, &dev_attr_fan2_input);727+ device_create_file(&client->dev, &dev_attr_fan2_min);728+ device_create_file(&client->dev, &dev_attr_fan2_div);729+ device_create_file(&client->dev, &dev_attr_fan3_input);730+ device_create_file(&client->dev, &dev_attr_fan3_min);731+ device_create_file(&client->dev, &dev_attr_fan3_div);732+733+ if (data->has_fan & (1 << 3)) {734+ device_create_file(&client->dev, &dev_attr_fan4_input);735+ device_create_file(&client->dev, &dev_attr_fan4_min);736+ device_create_file(&client->dev, &dev_attr_fan4_div);737+ }738+ if (data->has_fan & (1 << 4)) {739+ device_create_file(&client->dev, &dev_attr_fan5_input);740+ device_create_file(&client->dev, &dev_attr_fan5_min);741+ device_create_file(&client->dev, &dev_attr_fan5_div);742+ }743+744+ device_create_file(&client->dev, &dev_attr_temp1_input);745+ device_create_file(&client->dev, &dev_attr_temp1_max);746+ device_create_file(&client->dev, &dev_attr_temp1_max_hyst);747+ device_create_file(&client->dev, &dev_attr_temp2_input);748+ device_create_file(&client->dev, &dev_attr_temp2_max);749+ device_create_file(&client->dev, &dev_attr_temp2_max_hyst);750+ device_create_file(&client->dev, &dev_attr_temp3_input);751+ device_create_file(&client->dev, &dev_attr_temp3_max);752+ device_create_file(&client->dev, &dev_attr_temp3_max_hyst);753+754+ return 0;755+756+exit_free:757+ kfree(data);758+exit_release:759+ release_region(address, REGION_LENGTH);760+exit:761+ return err;762+}763+764+static int w83627ehf_attach_adapter(struct i2c_adapter *adapter)765+{766+ if (!(adapter->class & I2C_CLASS_HWMON))767+ return 0;768+ return i2c_detect(adapter, &addr_data, w83627ehf_detect);769+}770+771+static int w83627ehf_detach_client(struct i2c_client *client)772+{773+ int err;774+775+ if ((err = i2c_detach_client(client))) {776+ dev_err(&client->dev, "Client deregistration failed, "777+ "client not detached.\n");778+ return err;779+ }780+ release_region(client->addr, REGION_LENGTH);781+ kfree(i2c_get_clientdata(client));782+783+ return 0;784+}785+786+static struct i2c_driver w83627ehf_driver = {787+ .owner = THIS_MODULE,788+ .name = "w83627ehf",789+ .flags = I2C_DF_NOTIFY,790+ .attach_adapter = w83627ehf_attach_adapter,791+ .detach_client = w83627ehf_detach_client,792+};793+794+static int __init w83627ehf_find(int sioaddr, int *address)795+{796+ u16 val;797+798+ REG = sioaddr;799+ VAL = sioaddr + 1;800+ superio_enter();801+802+ val = (superio_inb(SIO_REG_DEVID) << 8)803+ | superio_inb(SIO_REG_DEVID + 1);804+ if ((val & SIO_ID_MASK) != SIO_W83627EHF_ID) {805+ superio_exit();806+ return -ENODEV;807+ }808+809+ superio_select(W83627EHF_LD_HWM);810+ val = (superio_inb(SIO_REG_ADDR) << 8)811+ | superio_inb(SIO_REG_ADDR + 1);812+ *address = val & ~(REGION_LENGTH - 1);813+ if (*address == 0) {814+ superio_exit();815+ return -ENODEV;816+ }817+818+ /* Activate logical device if needed */819+ val = superio_inb(SIO_REG_ENABLE);820+ if (!(val & 0x01))821+ superio_outb(SIO_REG_ENABLE, val | 0x01);822+823+ superio_exit();824+ return 0;825+}826+827+static int __init sensors_w83627ehf_init(void)828+{829+ if (w83627ehf_find(0x2e, &normal_isa[0])830+ && w83627ehf_find(0x4e, &normal_isa[0]))831+ return -ENODEV;832+833+ return i2c_add_driver(&w83627ehf_driver);834+}835+836+static void __exit sensors_w83627ehf_exit(void)837+{838+ i2c_del_driver(&w83627ehf_driver);839+}840+841+MODULE_AUTHOR("Jean Delvare <khali@linux-fr.org>");842+MODULE_DESCRIPTION("W83627EHF driver");843+MODULE_LICENSE("GPL");844+845+module_init(sensors_w83627ehf_init);846+module_exit(sensors_w83627ehf_exit);
+1-1
drivers/i2c/chips/w83627hf.c
···264{265 int i;266 val = SENSORS_LIMIT(val, 1, 128) >> 1;267- for (i = 0; i < 6; i++) {268 if (val == 0)269 break;270 val >>= 1;
···264{265 int i;266 val = SENSORS_LIMIT(val, 1, 128) >> 1;267+ for (i = 0; i < 7; i++) {268 if (val == 0)269 break;270 val >>= 1;
+23-55
drivers/i2c/chips/w83781d.c
···28 as99127f rev.2 (type_name = as99127f) 0x31 0x5ca3 yes no29 w83781d 7 3 0 3 0x10-1 0x5ca3 yes yes30 w83627hf 9 3 2 3 0x21 0x5ca3 yes yes(LPC)31- w83627thf 9 3 2 3 0x90 0x5ca3 no yes(LPC)32 w83782d 9 3 2-4 3 0x30 0x5ca3 yes yes33 w83783s 5-6 3 2 1-2 0x40 0x5ca3 yes no34- w83697hf 8 2 2 2 0x60 0x5ca3 no yes(LPC)3536*/3738-#include <linux/config.h>39#include <linux/module.h>40#include <linux/init.h>41#include <linux/slab.h>···50static unsigned int normal_isa[] = { 0x0290, I2C_CLIENT_ISA_END };5152/* Insmod parameters */53-SENSORS_INSMOD_6(w83781d, w83782d, w83783s, w83627hf, as99127f, w83697hf);54I2C_CLIENT_MODULE_PARM(force_subclients, "List of subclient addresses: "55 "{bus, clientaddr, subclientaddr1, subclientaddr2}");56···170 : (val)) / 1000, 0, 0xff))171#define TEMP_FROM_REG(val) (((val) & 0x80 ? (val)-0x100 : (val)) * 1000)172173-#define ALARMS_FROM_REG(val) (val)174#define PWM_FROM_REG(val) (val)175#define PWM_TO_REG(val) (SENSORS_LIMIT((val),0,255))176#define BEEP_MASK_FROM_REG(val,type) ((type) == as99127f ? \···189 val = SENSORS_LIMIT(val, 1,190 ((type == w83781d191 || type == as99127f) ? 8 : 128)) >> 1;192- for (i = 0; i < 6; i++) {193 if (val == 0)194 break;195 val >>= 1;···520show_alarms_reg(struct device *dev, struct device_attribute *attr, char *buf)521{522 struct w83781d_data *data = w83781d_update_device(dev);523- return sprintf(buf, "%ld\n", (long) ALARMS_FROM_REG(data->alarms));524}525526static···996 err = -EINVAL;997 goto ERROR0;998 }999- if (!is_isa && kind == w83697hf) {1000- dev_err(&adapter->dev,1001- "Cannot force ISA-only chip for I2C address 0x%02x.\n",1002- address);1003- err = -EINVAL;1004- goto ERROR0;1005- }10061007 if (is_isa)1008 if (!request_region(address, W83781D_EXTENT,···1128 else if (val1 == 0x40 && vendid == winbond && !is_isa1129 && address == 0x2d)1130 kind = w83783s;1131- else if ((val1 == 0x21 || val1 == 0x90) && vendid == winbond)1132 kind = w83627hf;1133 else if (val1 == 0x31 && !is_isa && address >= 0x28)1134 kind = as99127f;1135- else if (val1 == 0x60 && vendid == winbond && is_isa)1136- kind = w83697hf;1137 else {1138 if (kind == 0)1139 dev_warn(&new_client->dev, "Ignoring 'force' "···1150 } else if (kind == w83783s) {1151 client_name = "w83783s";1152 } else if (kind == w83627hf) {1153- if (val1 == 0x90)1154- client_name = "w83627thf";1155- else1156- client_name = "w83627hf";1157 } else if (kind == as99127f) {1158 client_name = "as99127f";1159- } else if (kind == w83697hf) {1160- client_name = "w83697hf";1161 }11621163 /* Fill in the remaining client fields and put into the global list */···11901191 /* Register sysfs hooks */1192 device_create_file_in(new_client, 0);1193- if (kind != w83783s && kind != w83697hf)1194 device_create_file_in(new_client, 1);1195 device_create_file_in(new_client, 2);1196 device_create_file_in(new_client, 3);···12041205 device_create_file_fan(new_client, 1);1206 device_create_file_fan(new_client, 2);1207- if (kind != w83697hf)1208- device_create_file_fan(new_client, 3);12091210 device_create_file_temp(new_client, 1);1211 device_create_file_temp(new_client, 2);1212- if (kind != w83783s && kind != w83697hf)1213 device_create_file_temp(new_client, 3);12141215- if (kind != w83697hf)1216- device_create_file_vid(new_client);1217-1218- if (kind != w83697hf)1219- device_create_file_vrm(new_client);12201221 device_create_file_fan_div(new_client, 1);1222 device_create_file_fan_div(new_client, 2);1223- if (kind != w83697hf)1224- device_create_file_fan_div(new_client, 3);12251226 device_create_file_alarms(new_client);1227···1235 if (kind != as99127f && kind != w83781d) {1236 device_create_file_sensor(new_client, 1);1237 device_create_file_sensor(new_client, 2);1238- if (kind != w83783s && kind != w83697hf)1239 device_create_file_sensor(new_client, 3);1240 }1241···1458 else1459 data->sens[i - 1] = 2;1460 }1461- if ((type == w83783s || type == w83697hf) && (i == 2))1462 break;1463 }1464 }···1474 }14751476 /* Enable temp3 */1477- if (type != w83783s && type != w83697hf) {1478 tmp = w83781d_read_value(client,1479 W83781D_REG_TEMP3_CONFIG);1480 if (tmp & 0x01) {···1515 dev_dbg(dev, "Starting device update\n");15161517 for (i = 0; i <= 8; i++) {1518- if ((data->type == w83783s || data->type == w83697hf)1519- && (i == 1))1520 continue; /* 783S has no in1 */1521 data->in[i] =1522 w83781d_read_value(client, W83781D_REG_IN(i));···1523 w83781d_read_value(client, W83781D_REG_IN_MIN(i));1524 data->in_max[i] =1525 w83781d_read_value(client, W83781D_REG_IN_MAX(i));1526- if ((data->type != w83782d) && (data->type != w83697hf)1527 && (data->type != w83627hf) && (i == 6))1528 break;1529 }···1559 w83781d_read_value(client, W83781D_REG_TEMP_OVER(2));1560 data->temp_max_hyst_add[0] =1561 w83781d_read_value(client, W83781D_REG_TEMP_HYST(2));1562- if (data->type != w83783s && data->type != w83697hf) {1563 data->temp_add[1] =1564 w83781d_read_value(client, W83781D_REG_TEMP(3));1565 data->temp_max_add[1] =···1570 W83781D_REG_TEMP_HYST(3));1571 }1572 i = w83781d_read_value(client, W83781D_REG_VID_FANDIV);1573- if (data->type != w83697hf) {1574- data->vid = i & 0x0f;1575- data->vid |=1576- (w83781d_read_value(client, W83781D_REG_CHIPID) &1577- 0x01)1578- << 4;1579- }1580 data->fan_div[0] = (i >> 4) & 0x03;1581 data->fan_div[1] = (i >> 6) & 0x03;1582- if (data->type != w83697hf) {1583- data->fan_div[2] = (w83781d_read_value(client,1584- W83781D_REG_PIN)1585- >> 6) & 0x03;1586- }1587 if ((data->type != w83781d) && (data->type != as99127f)) {1588 i = w83781d_read_value(client, W83781D_REG_VBAT);1589 data->fan_div[0] |= (i >> 3) & 0x04;1590 data->fan_div[1] |= (i >> 4) & 0x04;1591- if (data->type != w83697hf)1592- data->fan_div[2] |= (i >> 5) & 0x04;1593 }1594 data->alarms =1595 w83781d_read_value(client,
···28 as99127f rev.2 (type_name = as99127f) 0x31 0x5ca3 yes no29 w83781d 7 3 0 3 0x10-1 0x5ca3 yes yes30 w83627hf 9 3 2 3 0x21 0x5ca3 yes yes(LPC)031 w83782d 9 3 2-4 3 0x30 0x5ca3 yes yes32 w83783s 5-6 3 2 1-2 0x40 0x5ca3 yes no03334*/35036#include <linux/module.h>37#include <linux/init.h>38#include <linux/slab.h>···53static unsigned int normal_isa[] = { 0x0290, I2C_CLIENT_ISA_END };5455/* Insmod parameters */56+SENSORS_INSMOD_5(w83781d, w83782d, w83783s, w83627hf, as99127f);57I2C_CLIENT_MODULE_PARM(force_subclients, "List of subclient addresses: "58 "{bus, clientaddr, subclientaddr1, subclientaddr2}");59···173 : (val)) / 1000, 0, 0xff))174#define TEMP_FROM_REG(val) (((val) & 0x80 ? (val)-0x100 : (val)) * 1000)1750176#define PWM_FROM_REG(val) (val)177#define PWM_TO_REG(val) (SENSORS_LIMIT((val),0,255))178#define BEEP_MASK_FROM_REG(val,type) ((type) == as99127f ? \···193 val = SENSORS_LIMIT(val, 1,194 ((type == w83781d195 || type == as99127f) ? 8 : 128)) >> 1;196+ for (i = 0; i < 7; i++) {197 if (val == 0)198 break;199 val >>= 1;···524show_alarms_reg(struct device *dev, struct device_attribute *attr, char *buf)525{526 struct w83781d_data *data = w83781d_update_device(dev);527+ return sprintf(buf, "%u\n", data->alarms);528}529530static···1000 err = -EINVAL;1001 goto ERROR0;1002 }000000010031004 if (is_isa)1005 if (!request_region(address, W83781D_EXTENT,···1139 else if (val1 == 0x40 && vendid == winbond && !is_isa1140 && address == 0x2d)1141 kind = w83783s;1142+ else if (val1 == 0x21 && vendid == winbond)1143 kind = w83627hf;1144 else if (val1 == 0x31 && !is_isa && address >= 0x28)1145 kind = as99127f;001146 else {1147 if (kind == 0)1148 dev_warn(&new_client->dev, "Ignoring 'force' "···1163 } else if (kind == w83783s) {1164 client_name = "w83783s";1165 } else if (kind == w83627hf) {1166+ client_name = "w83627hf";0001167 } else if (kind == as99127f) {1168 client_name = "as99127f";001169 }11701171 /* Fill in the remaining client fields and put into the global list */···12081209 /* Register sysfs hooks */1210 device_create_file_in(new_client, 0);1211+ if (kind != w83783s)1212 device_create_file_in(new_client, 1);1213 device_create_file_in(new_client, 2);1214 device_create_file_in(new_client, 3);···12221223 device_create_file_fan(new_client, 1);1224 device_create_file_fan(new_client, 2);1225+ device_create_file_fan(new_client, 3);012261227 device_create_file_temp(new_client, 1);1228 device_create_file_temp(new_client, 2);1229+ if (kind != w83783s)1230 device_create_file_temp(new_client, 3);12311232+ device_create_file_vid(new_client);1233+ device_create_file_vrm(new_client);00012341235 device_create_file_fan_div(new_client, 1);1236 device_create_file_fan_div(new_client, 2);1237+ device_create_file_fan_div(new_client, 3);012381239 device_create_file_alarms(new_client);1240···1258 if (kind != as99127f && kind != w83781d) {1259 device_create_file_sensor(new_client, 1);1260 device_create_file_sensor(new_client, 2);1261+ if (kind != w83783s)1262 device_create_file_sensor(new_client, 3);1263 }1264···1481 else1482 data->sens[i - 1] = 2;1483 }1484+ if (type == w83783s && i == 2)1485 break;1486 }1487 }···1497 }14981499 /* Enable temp3 */1500+ if (type != w83783s) {1501 tmp = w83781d_read_value(client,1502 W83781D_REG_TEMP3_CONFIG);1503 if (tmp & 0x01) {···1538 dev_dbg(dev, "Starting device update\n");15391540 for (i = 0; i <= 8; i++) {1541+ if (data->type == w83783s && i == 1)01542 continue; /* 783S has no in1 */1543 data->in[i] =1544 w83781d_read_value(client, W83781D_REG_IN(i));···1547 w83781d_read_value(client, W83781D_REG_IN_MIN(i));1548 data->in_max[i] =1549 w83781d_read_value(client, W83781D_REG_IN_MAX(i));1550+ if ((data->type != w83782d)1551 && (data->type != w83627hf) && (i == 6))1552 break;1553 }···1583 w83781d_read_value(client, W83781D_REG_TEMP_OVER(2));1584 data->temp_max_hyst_add[0] =1585 w83781d_read_value(client, W83781D_REG_TEMP_HYST(2));1586+ if (data->type != w83783s) {1587 data->temp_add[1] =1588 w83781d_read_value(client, W83781D_REG_TEMP(3));1589 data->temp_max_add[1] =···1594 W83781D_REG_TEMP_HYST(3));1595 }1596 i = w83781d_read_value(client, W83781D_REG_VID_FANDIV);1597+ data->vid = i & 0x0f;1598+ data->vid |= (w83781d_read_value(client,1599+ W83781D_REG_CHIPID) & 0x01) << 4;00001600 data->fan_div[0] = (i >> 4) & 0x03;1601 data->fan_div[1] = (i >> 6) & 0x03;1602+ data->fan_div[2] = (w83781d_read_value(client,1603+ W83781D_REG_PIN) >> 6) & 0x03;0001604 if ((data->type != w83781d) && (data->type != as99127f)) {1605 i = w83781d_read_value(client, W83781D_REG_VBAT);1606 data->fan_div[0] |= (i >> 3) & 0x04;1607 data->fan_div[1] |= (i >> 4) & 0x04;1608+ data->fan_div[2] |= (i >> 5) & 0x04;01609 }1610 data->alarms =1611 w83781d_read_value(client,
-1
drivers/i2c/chips/w83l785ts.c
···30 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.31 */3233-#include <linux/config.h>34#include <linux/module.h>35#include <linux/delay.h>36#include <linux/init.h>
···30 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.31 */32033#include <linux/module.h>34#include <linux/delay.h>35#include <linux/init.h>
+20-80
drivers/i2c/i2c-core.c
···21 All SMBus-related things are written by Frodo Looijaard <frodol@dds.nl>22 SMBus 2.0 support by Mark Studebaker <mdsxyz123@yahoo.com> */2324-#include <linux/config.h>25#include <linux/module.h>26#include <linux/kernel.h>27#include <linux/errno.h>···238 }239240 /* detach any active clients. This must be done first, because241- * it can fail; in which case we give upp. */242 list_for_each_safe(item, _n, &adap->clients) {243 client = list_entry(item, struct i2c_client, list);244···611 struct i2c_adapter *adap=client->adapter;612 struct i2c_msg msg;613614- if (client->adapter->algo->master_xfer) {615- msg.addr = client->addr;616- msg.flags = client->flags & I2C_M_TEN;617- msg.len = count;618- msg.buf = (char *)buf;619620- dev_dbg(&client->adapter->dev, "master_send: writing %d bytes.\n",621- count);622-623- down(&adap->bus_lock);624- ret = adap->algo->master_xfer(adap,&msg,1);625- up(&adap->bus_lock);626627- /* if everything went ok (i.e. 1 msg transmitted), return #bytes628- * transmitted, else error code.629- */630- return (ret == 1 )? count : ret;631- } else {632- dev_err(&client->adapter->dev, "I2C level transfers not supported\n");633- return -ENOSYS;634- }635}636637int i2c_master_recv(struct i2c_client *client, char *buf ,int count)···628 struct i2c_adapter *adap=client->adapter;629 struct i2c_msg msg;630 int ret;631- if (client->adapter->algo->master_xfer) {632- msg.addr = client->addr;633- msg.flags = client->flags & I2C_M_TEN;634- msg.flags |= I2C_M_RD;635- msg.len = count;636- msg.buf = buf;637638- dev_dbg(&client->adapter->dev, "master_recv: reading %d bytes.\n",639- count);640-641- down(&adap->bus_lock);642- ret = adap->algo->master_xfer(adap,&msg,1);643- up(&adap->bus_lock);644-645- dev_dbg(&client->adapter->dev, "master_recv: return:%d (count:%d, addr:0x%02x)\n",646- ret, count, client->addr);647-648- /* if everything went ok (i.e. 1 msg transmitted), return #bytes649- * transmitted, else error code.650- */651- return (ret == 1 )? count : ret;652- } else {653- dev_err(&client->adapter->dev, "I2C level transfers not supported\n");654- return -ENOSYS;655- }656}657658···717 found = 1;718 }719 }720- for (i = 0;721- !found && (address_data->ignore_range[i] != I2C_CLIENT_END);722- i += 3) {723- if (((adap_id == address_data->ignore_range[i]) ||724- ((address_data->ignore_range[i]==ANY_I2C_BUS))) &&725- (addr >= address_data->ignore_range[i+1]) &&726- (addr <= address_data->ignore_range[i+2])) {727- dev_dbg(&adapter->dev, "found ignore_range parameter for adapter %d, "728- "addr %04x\n", adap_id,addr);729- found = 1;730- }731- }732 if (found) 733 continue;734···733 }734735 for (i = 0;736- !found && (address_data->normal_i2c_range[i] != I2C_CLIENT_END);737- i += 2) {738- if ((addr >= address_data->normal_i2c_range[i]) &&739- (addr <= address_data->normal_i2c_range[i+1])) {740- found = 1;741- dev_dbg(&adapter->dev, "found normal i2c_range entry for adapter %d, "742- "addr %04x\n", adap_id,addr);743- }744- }745-746- for (i = 0;747 !found && (address_data->probe[i] != I2C_CLIENT_END);748 i += 2) {749 if (((adap_id == address_data->probe[i]) ||···740 (addr == address_data->probe[i+1])) {741 found = 1;742 dev_dbg(&adapter->dev, "found probe parameter for adapter %d, "743- "addr %04x\n", adap_id,addr);744- }745- }746- for (i = 0;747- !found && (address_data->probe_range[i] != I2C_CLIENT_END);748- i += 3) {749- if (((adap_id == address_data->probe_range[i]) ||750- (address_data->probe_range[i] == ANY_I2C_BUS)) &&751- (addr >= address_data->probe_range[i+1]) &&752- (addr <= address_data->probe_range[i+2])) {753- found = 1;754- dev_dbg(&adapter->dev, "found probe_range parameter for adapter %d, "755 "addr %04x\n", adap_id,addr);756 }757 }
···21 All SMBus-related things are written by Frodo Looijaard <frodol@dds.nl>22 SMBus 2.0 support by Mark Studebaker <mdsxyz123@yahoo.com> */23024#include <linux/module.h>25#include <linux/kernel.h>26#include <linux/errno.h>···239 }240241 /* detach any active clients. This must be done first, because242+ * it can fail; in which case we give up. */243 list_for_each_safe(item, _n, &adap->clients) {244 client = list_entry(item, struct i2c_client, list);245···612 struct i2c_adapter *adap=client->adapter;613 struct i2c_msg msg;614615+ msg.addr = client->addr;616+ msg.flags = client->flags & I2C_M_TEN;617+ msg.len = count;618+ msg.buf = (char *)buf;0619620+ ret = i2c_transfer(adap, &msg, 1);00000621622+ /* If everything went ok (i.e. 1 msg transmitted), return #bytes623+ transmitted, else error code. */624+ return (ret == 1) ? count : ret;00000625}626627int i2c_master_recv(struct i2c_client *client, char *buf ,int count)···640 struct i2c_adapter *adap=client->adapter;641 struct i2c_msg msg;642 int ret;000000643644+ msg.addr = client->addr;645+ msg.flags = client->flags & I2C_M_TEN;646+ msg.flags |= I2C_M_RD;647+ msg.len = count;648+ msg.buf = buf;649+650+ ret = i2c_transfer(adap, &msg, 1);651+652+ /* If everything went ok (i.e. 1 msg transmitted), return #bytes653+ transmitted, else error code. */654+ return (ret == 1) ? count : ret;0000000655}656657···742 found = 1;743 }744 }000000000000745 if (found) 746 continue;747···770 }771772 for (i = 0;00000000000773 !found && (address_data->probe[i] != I2C_CLIENT_END);774 i += 2) {775 if (((adap_id == address_data->probe[i]) ||···788 (addr == address_data->probe[i+1])) {789 found = 1;790 dev_dbg(&adapter->dev, "found probe parameter for adapter %d, "000000000000791 "addr %04x\n", adap_id,addr);792 }793 }
+1-2
drivers/i2c/i2c-dev.c
···29/* The devfs code is contributed by Philipp Matthias Hahn 30 <pmhahn@titan.lahn.de> */3132-#include <linux/config.h>33#include <linux/kernel.h>34#include <linux/module.h>35#include <linux/fs.h>···213 sizeof(rdwr_arg)))214 return -EFAULT;215216- /* Put an arbritrary limit on the number of messages that can217 * be sent at once */218 if (rdwr_arg.nmsgs > I2C_RDRW_IOCTL_MAX_MSGS)219 return -EINVAL;
···29/* The devfs code is contributed by Philipp Matthias Hahn 30 <pmhahn@titan.lahn.de> */31032#include <linux/kernel.h>33#include <linux/module.h>34#include <linux/fs.h>···214 sizeof(rdwr_arg)))215 return -EFAULT;216217+ /* Put an arbitrary limit on the number of messages that can218 * be sent at once */219 if (rdwr_arg.nmsgs > I2C_RDRW_IOCTL_MAX_MSGS)220 return -EINVAL;
+4-2
drivers/macintosh/therm_windtunnel.c
···51static int do_probe( struct i2c_adapter *adapter, int addr, int kind);5253/* scan 0x48-0x4f (DS1775) and 0x2c-2x2f (ADM1030) */54-static unsigned short normal_i2c[] = { 0x49, 0x2c, I2C_CLIENT_END };55-static unsigned short normal_i2c_range[] = { 0x48, 0x4f, 0x2c, 0x2f, I2C_CLIENT_END };005657I2C_CLIENT_INSMOD;58
···51static int do_probe( struct i2c_adapter *adapter, int addr, int kind);5253/* scan 0x48-0x4f (DS1775) and 0x2c-2x2f (ADM1030) */54+static unsigned short normal_i2c[] = { 0x48, 0x49, 0x4a, 0x4b,55+ 0x4c, 0x4d, 0x4e, 0x4f,56+ 0x2c, 0x2d, 0x2e, 0x2f,57+ I2C_CLIENT_END };5859I2C_CLIENT_INSMOD;60
···2223/* Addresses to scan */24static unsigned short normal_i2c[] = {0x20, I2C_CLIENT_END};25-static unsigned short normal_i2c_range[] = {I2C_CLIENT_END};26I2C_CLIENT_INSMOD;2728MODULE_DESCRIPTION("device driver for saa6752hs MPEG2 encoder");
···2223/* Addresses to scan */24static unsigned short normal_i2c[] = {0x20, I2C_CLIENT_END};025I2C_CLIENT_INSMOD;2627MODULE_DESCRIPTION("device driver for saa6752hs MPEG2 encoder");
+4-12
drivers/media/video/saa7185.c
···380 * concerning the addresses: i2c wants 7 bit (without the r/w bit), so '>>1'381 */382static unsigned short normal_i2c[] = { I2C_SAA7185 >> 1, I2C_CLIENT_END };383-static unsigned short normal_i2c_range[] = { I2C_CLIENT_END };384385-static unsigned short probe[2] = { I2C_CLIENT_END, I2C_CLIENT_END };386-static unsigned short probe_range[2] = { I2C_CLIENT_END, I2C_CLIENT_END };387-static unsigned short ignore[2] = { I2C_CLIENT_END, I2C_CLIENT_END };388-static unsigned short ignore_range[2] = { I2C_CLIENT_END, I2C_CLIENT_END };389-static unsigned short force[2] = { I2C_CLIENT_END , I2C_CLIENT_END };390391static struct i2c_client_address_data addr_data = {392 .normal_i2c = normal_i2c,393- .normal_i2c_range = normal_i2c_range,394- .probe = probe,395- .probe_range = probe_range,396- .ignore = ignore,397- .ignore_range = ignore_range,398- .force = force399};400401static struct i2c_driver i2c_driver_saa7185;
···380 * concerning the addresses: i2c wants 7 bit (without the r/w bit), so '>>1'381 */382static unsigned short normal_i2c[] = { I2C_SAA7185 >> 1, I2C_CLIENT_END };0383384+static unsigned short ignore = I2C_CLIENT_END;0000385386static struct i2c_client_address_data addr_data = {387 .normal_i2c = normal_i2c,388+ .probe = &ignore,389+ .ignore = &ignore,390+ .force = &ignore,000391};392393static struct i2c_driver i2c_driver_saa7185;
-1
drivers/media/video/tda7432.c
···74 I2C_TDA7432 >> 1,75 I2C_CLIENT_END,76};77-static unsigned short normal_i2c_range[] = { I2C_CLIENT_END, I2C_CLIENT_END };78I2C_CLIENT_INSMOD;7980/* Structure of address and subaddresses for the tda7432 */
···74 I2C_TDA7432 >> 1,75 I2C_CLIENT_END,76};077I2C_CLIENT_INSMOD;7879/* Structure of address and subaddresses for the tda7432 */
-1
drivers/media/video/tda9840.c
···4344/* addresses to scan, found only at 0x42 (7-Bit) */45static unsigned short normal_i2c[] = { I2C_TDA9840, I2C_CLIENT_END };46-static unsigned short normal_i2c_range[] = { I2C_CLIENT_END };4748/* magic definition of all other variables and things */49I2C_CLIENT_INSMOD;
···4344/* addresses to scan, found only at 0x42 (7-Bit) */45static unsigned short normal_i2c[] = { I2C_TDA9840, I2C_CLIENT_END };04647/* magic definition of all other variables and things */48I2C_CLIENT_INSMOD;
-1
drivers/media/video/tda9875.c
···44 I2C_TDA9875 >> 1,45 I2C_CLIENT_END46};47-static unsigned short normal_i2c_range[] = {I2C_CLIENT_END};48I2C_CLIENT_INSMOD;4950/* This is a superset of the TDA9875 */
···44 I2C_TDA9875 >> 1,45 I2C_CLIENT_END46};047I2C_CLIENT_INSMOD;4849/* This is a superset of the TDA9875 */
···4344/* addresses to scan, found only at 0x03 and/or 0x43 (7-bit) */45static unsigned short normal_i2c[] = { I2C_TEA6415C_1, I2C_TEA6415C_2, I2C_CLIENT_END };46-static unsigned short normal_i2c_range[] = { I2C_CLIENT_END };4748/* magic definition of all other variables and things */49I2C_CLIENT_INSMOD;
···4344/* addresses to scan, found only at 0x03 and/or 0x43 (7-bit) */45static unsigned short normal_i2c[] = { I2C_TEA6415C_1, I2C_TEA6415C_2, I2C_CLIENT_END };04647/* magic definition of all other variables and things */48I2C_CLIENT_INSMOD;
-1
drivers/media/video/tea6420.c
···4041/* addresses to scan, found only at 0x4c and/or 0x4d (7-Bit) */42static unsigned short normal_i2c[] = { I2C_TEA6420_1, I2C_TEA6420_2, I2C_CLIENT_END };43-static unsigned short normal_i2c_range[] = { I2C_CLIENT_END };4445/* magic definition of all other variables and things */46I2C_CLIENT_INSMOD;
···4041/* addresses to scan, found only at 0x4c and/or 0x4d (7-Bit) */42static unsigned short normal_i2c[] = { I2C_TEA6420_1, I2C_TEA6420_2, I2C_CLIENT_END };04344/* magic definition of all other variables and things */45I2C_CLIENT_INSMOD;
+6-11
drivers/media/video/tuner-3036.c
···34static struct i2c_client client_template;3536/* Addresses to scan */37-static unsigned short normal_i2c[] = {I2C_CLIENT_END};38-static unsigned short normal_i2c_range[] = {0x60, 0x61, I2C_CLIENT_END};39-static unsigned short probe[2] = { I2C_CLIENT_END, I2C_CLIENT_END };40-static unsigned short probe_range[2] = { I2C_CLIENT_END, I2C_CLIENT_END };41-static unsigned short ignore[2] = { I2C_CLIENT_END, I2C_CLIENT_END };42-static unsigned short ignore_range[2] = { I2C_CLIENT_END, I2C_CLIENT_END };43-static unsigned short force[2] = { I2C_CLIENT_END, I2C_CLIENT_END };4445static struct i2c_client_address_data addr_data = {46- normal_i2c, normal_i2c_range, 47- probe, probe_range, 48- ignore, ignore_range, 49- force50};5152/* ---------------------------------------------------------------------- */