root/lm-sensors/trunk/mkpatch/mkpatch.pl

Revision 5368, 48.0 kB (checked in by khali, 1 month ago)

Add support for the VIA VX800/VX820 SMBus. Backported from Linux 2.6.

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
Line 
1 #!/usr/bin/perl -w
2
3 #    mkpatch - Create patches against the Linux kernel
4 #    Copyright (C) 1999  Frodo Looijaard <frodol@dds.nl>
5 #    Copyright (C) 2005-2007  Jean Delvare <khali@linux-fr.org>
6 #
7 #    This program is free software; you can redistribute it and/or modify
8 #    it under the terms of the GNU General Public License as published by
9 #    the Free Software Foundation; either version 2 of the License, or
10 #    (at your option) any later version.
11 #
12 #    This program is distributed in the hope that it will be useful,
13 #    but WITHOUT ANY WARRANTY; without even the implied warranty of
14 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 #    GNU General Public License for more details.
16 #
17 #    You should have received a copy of the GNU General Public License
18 #    along with this program; if not, write to the Free Software
19 #    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20
21 use strict;
22
23 use vars qw($temp);
24 $temp = "mkpatch/.temp";
25
26 # Generate a diff between the old kernel file and the new lm_sensors file. We
27 # arrange the headers to tell us the old tree was under directory
28 # `linux-old', and the new tree under `linux'.
29 # $_[0]: sensors package root (like /tmp/sensors)
30 # $_[1]: Linux kernel tree (like /usr/src/linux)
31 # $_[2]: Name of the kernel file
32 # $_[3]: Name of the patched file
33 sub print_diff
34 {
35   my ($package_root,$kernel_root,$kernel_file,$package_file) = @_;
36   my ($diff_command,$package_mtime,$kernel_mtime);
37
38   $diff_command = "diff -u";
39   if ( -e "$kernel_root/$kernel_file") {
40     $diff_command .= " $kernel_root/$kernel_file";
41     $kernel_mtime = (stat("$kernel_root/$kernel_file"))[9];
42   } else {
43     $diff_command .= " /dev/null";
44     $kernel_mtime = 0;
45   }
46   if ( -e "$package_root/$package_file") {
47     $diff_command .= " $package_root/$package_file";
48     $package_mtime = (stat("$package_root/$package_file"))[9];
49   } else {
50     $diff_command .= " /dev/null";
51     $package_mtime = 0;
52   }
53   open INPUT, "$diff_command|" or die "Can't execute `$diff_command'";
54   if (<INPUT>) {
55     <INPUT>;
56     print "--- linux-old/$kernel_file\t".gmtime($kernel_mtime)."\n".
57           "+++ linux/$kernel_file\t".gmtime($package_mtime)."\n";
58
59     print while <INPUT>;
60   }
61   close INPUT;
62 }
63
64 # This generates diffs for kernel file Documentation/Configure.help. This
65 # file contains the help texts that can be displayed during `make *config'
66 # for the kernel.
67 # The new texts are put at the end of the file, or just before the
68 # lm_sensors texts.
69 # Of course, care is taken old lines are removed.
70 # $_[0]: i2c package root (like /tmp/i2c)
71 # $_[1]: Linux kernel tree (like /usr/src/linux)
72 sub gen_Documentation_Configure_help
73 {
74   my ($package_root,$kernel_root) = @_;
75   my $kernel_file = "Documentation/Configure.help";
76   my $package_file = $temp;
77
78   open INPUT,"$kernel_root/$kernel_file"
79         or die "Can't open `$kernel_root/$kernel_file'";
80   open OUTPUT,">$package_root/$package_file"
81         or die "Can't open $package_root/$package_file";
82   MAIN: while(<INPUT>) {
83     if (m@I2C mainboard interfaces@ or
84            m@Acer Labs ALI 1535@ or
85            m@Acer Labs ALI 1533 and 1543C@ or
86            m@Acer Labs ALI 1563@ or
87            m@AMD 756/766/768/8111@ or
88            m@SMBus multiplexing on the Tyan S4882@ or
89            m@AMD 8111 SMBus 2.0@ or
90            m@Apple Hydra Mac I/O@ or
91            m@Intel I801@ or
92            m@Intel I810/I815 based Mainboard@ or
93            m@Intel 82371AB PIIX4\(E\)@ or
94            m@Nvidia Nforce2@ or
95            m@Silicon Integrated Systems Corp. SiS5595 based Mainboard@ or
96            m@VIA Technologies, Inc. VT82C586B@ or
97            m@VIA Technologies, Inc. VT82C596, 596B, 686A/B, 8233@ or
98            m@3DFX Banshee / Voodoo3@ or
99            m@DEC Tsunami 21272@ or
100            m@Pseudo ISA adapter \(for hardware sensors modules\)@ or
101            m@Analog Devices ADM1021 and compatibles@ or
102            m@Analog Devices ADM1024@ or
103            m@Analog Devices ADM1025@ or
104            m@Analog Devices ADM1026@ or
105            m@Analog Devices ADM1030, ADM1031@ or
106            m@Analog Devices ADM9240 and compatibles@ or
107            m@Asus ASB100@ or
108            m@Dallas DS1621 and DS1625@ or
109            m@Fintek F71805F@ or
110            m@Fujitsu-Siemens Hermes@ or
111            m@Fujitsu-Siemens Poseidon@ or
112            m@Fujitsu-Siemens Scylla@ or
113            m@Genesys Logic GL518SM@ or
114            m@Genesys Logic GL520SM@ or
115            m@HP Maxilife@ or
116            m@Intel Xeon Thermal Sensor@ or
117            m@ITE 8705, 8712, Sis950@ or
118            m@Maxim MAX1619@ or
119            m@Maxim MAX6650, MAX6651@ or
120            m@Myson MTP008@ or
121            m@National Semiconductor LM63@ or
122            m@National Semiconductor LM75 and compatibles@ or
123            m@National Semiconductor LM78@ or
124            m@National Semiconductor LM80@ or
125            m@National Semiconductor LM83@ or
126            m@National Semiconductor LM85@ or
127            m@National Semiconductor LM87@ or
128            m@National Semiconductor LM90@ or
129            m@National Semiconductor LM92@ or
130            m@National Semiconductor LM93@ or
131            m@National Semiconductor PC8736x@ or
132            m@Silicon Integrated Systems Corp. SiS5595 Sensor@ or
133            m@Texas Instruments THMC50 / Analog Devices ADM1022@ or
134            m@Via VT82C686A/B@ or
135            m@Winbond W83781D, W83782D, W83783S@ or
136            m@Winbond W83792D@ or
137            m@Winbond W83627HF, W83627THF@ or
138            m@Winbond W83627EHF/EHG@ or
139            m@Winbond W83L785TS-S@ or
140            m@EEprom \(DIMM\) reader@) {
141       $_ = <INPUT>;
142       $_ = <INPUT>;
143       $_ = <INPUT> while not m@^\S@ and not eof(INPUT);
144       redo MAIN;
145     }
146     if (eof(INPUT)) {
147       print OUTPUT <<'EOF'
148 I2C mainboard interfaces
149 CONFIG_I2C_MAINBOARD
150   Many modern mainboards have some kind of I2C interface integrated. This
151   is often in the form of a SMBus, or System Management Bus, which is
152   basically the same as I2C but which uses only a subset of the I2C
153   protocol.
154
155   You will also want the latest user-space utilities: you can find them
156   in the lm_sensors package, which you can download at
157   http://www.lm-sensors.org/
158
159 Acer Labs ALI 1535
160 CONFIG_I2C_ALI1535
161   If you say yes to this option, support will be included for the Acer
162   Labs ALI 1535 mainboard I2C interface. This can also be
163   built as a module.
164
165 Acer Labs ALI 1533 and 1543C
166 CONFIG_I2C_ALI15X3
167   If you say yes to this option, support will be included for the Acer
168   Labs ALI 1533 and 1543C mainboard I2C interfaces. This can also be
169   built as a module which can be inserted and removed while the kernel
170   is running.
171
172 Acer Labs ALI 1563
173 CONFIG_I2C_ALI1563
174   If you say yes to this option, support will be included for the Acer
175   Labs ALI M1563 mainboard SMBus interface. This can also be built as a
176   module.
177
178 AMD 756/766/768/8111 and nVidia nForce
179 CONFIG_I2C_AMD756
180   If you say yes to this option, support will be included for the AMD
181   756/766/768/8111 and nVidia nForce mainboard I2C interfaces. This can
182   also be built as a module which can be inserted and removed while the
183   kernel is running.
184
185 SMBus multiplexing on the Tyan S4882
186 CONFIG_I2C_AMD756_S4882
187   Enabling this option will add specific SMBus support for the Tyan
188   S4882 motherboard. On this 4-CPU board, the SMBus is multiplexed
189   over 8 different channels, where the various memory module EEPROMs
190   and temperature sensors live. Saying yes here will give you access
191   to these in addition to the trunk.
192
193 AMD 8111 SMBus 2.0
194 CONFIG_I2C_AMD8111
195   If you say yes to this option, support will be included for the AMD
196   8111 mainboard SMBus 2.0 interface. This can also be
197   built as a module which can be inserted and removed while the kernel
198   is running.
199
200 Apple Hydra Mac I/O
201 CONFIG_I2C_HYDRA
202   If you say yes to this option, support will be included for the
203   Hydra mainboard I2C interface. This can also be built as a module
204   which can be inserted and removed while the kernel is running.
205
206 Intel I801
207 CONFIG_I2C_I801
208   If you say yes to this option, support will be included for the
209   Intel I801 mainboard I2C interfaces. "I810" mainboard sensor chips are
210   generally located on the I801's I2C bus. This can also be
211   built as a module which can be inserted and removed while the kernel
212   is running.
213
214 Intel I810/I815 based Mainboard
215 CONFIG_I2C_I810
216   If you say yes to this option, support will be included for the
217   Intel I810/I810E/I815/I845G mainboard I2C interfaces. The I2C busses
218   of these chips are generally used only for video devices. For "810"
219   mainboard sensor chips, use the I801 I2C driver instead.
220  
221   This can also be built as a module which can be inserted and removed
222   while the kernel is running.
223
224 Intel 82371AB PIIX4(E), ServerWorks OSB4, CSB5, CSB6, HT-1000
225 CONFIG_I2C_PIIX4
226   If you say yes to this option, support will be included for the
227   Intel PIIX4, PIIX4E, 443MX, Serverworks OSB4, CSB5, CSB6 and
228   HT-1000, ATI IXP200, IXP300, IXP400, SB600, SB700 and SB800, and
229   SMSC Victory66 mainboard SMBus interfaces.
230  
231   This can also be built as a module which can be inserted and removed
232   while the kernel is running.
233
234 Nvidia Nforce2/3/4 based Mainboard
235 CONFIG_I2C_NFORCE2
236   If you say yes to this option, support will be included for the
237   Nvidia Nforce2, Nforce3 and Nforce4 families of mainboard SMBus
238   interfaces.
239  
240   This can also be built as a module which can be inserted and removed
241   while the kernel is running.
242
243 Silicon Integrated Systems Corp. SiS5595 based Mainboard
244 CONFIG_I2C_SIS5595
245   If you say yes to this option, support will be included for the
246   SiS5595 mainboard I2C interfaces. For integrated sensors on the
247   Sis5595, use CONFIG_SENSORS_SIS5595. This can also be
248   built as a module which can be inserted and removed while the kernel
249   is running.
250
251 Silicon Integrated Systems Corp. SiS630/730 based Mainboard
252 CONFIG_I2C_SIS630
253   If you say yes to this option, support will be included for the SiS 630
254   and 730 mainboard I2C interfaces. This can also be built as a module
255   which can be inserted and removed while the kernel is running.
256
257 Silicon Integrated Systems Corp. SiS645/961,645DX/961,735 based Mainboard
258 CONFIG_I2C_SIS645
259   If you say yes to this option, support will be included for the SiS 645/961,
260   645DX/961 and 735 mainboard I2C interfaces. This can also be built as a module
261   which can be inserted and removed while the kernel is running.
262
263 VIA Technologies, Inc. VT82C586B
264 CONFIG_I2C_VIA
265   If you say yes to this option, support will be included for the VIA
266   Technologies I2C adapter found on some motherboards. This can also
267   be built as a module which can be inserted and removed while the
268   kernel is running.
269
270 VIA Technologies, Inc. VT82C596/82C686/82xx and CX700/VX800/VX820
271 CONFIG_I2C_VIAPRO
272   If you say yes to this option, support will be included for the VIA
273   Technologies I2C adapter on these chips. For integrated sensors on the
274   Via 686A/B, use CONFIG_SENSORS_VIA686A. This can also be
275   be built as a module which can be inserted and removed while the
276   kernel is running.
277
278 3DFX Banshee / Voodoo3
279 CONFIG_I2C_VOODOO3
280   If you say yes to this option, support will be included for the
281   3DFX Banshee and Voodoo3 I2C interfaces. The I2C busses on the these
282   chips are generally used only for video devices.
283   This can also be
284   built as a module which can be inserted and removed while the kernel
285   is running.
286
287 DEC Tsunami 21272
288 CONFIG_I2C_TSUNAMI
289   If you say yes to this option, support will be included for the DEC
290   Tsunami chipset I2C adapter. Requires the Alpha architecture;
291   do not enable otherwise. This can also be built as a module which
292   can be inserted and removed while the kernel is running.
293
294 Pseudo ISA adapter (for hardware sensors modules)
295 CONFIG_I2C_ISA
296   This provides support for accessing some hardware sensor chips over
297   the ISA bus rather than the I2C or SMBus. If you want to do this,
298   say yes here. This feature can also be built as a module which can
299   be inserted and removed while the kernel is running.
300
301   You will also need the latest user-space utilities: you can find them
302   in the lm_sensors package, which you can download at
303   http://www.lm-sensors.org/
304
305 Analog Devices ADM1021 and compatibles
306 CONFIG_SENSORS_ADM1021
307   If you say yes here you get support for Analog Devices ADM1021
308   and ADM1023 sensor chips and clones: Maxim MAX1617 and MAX1617A,
309   Genesys Logic GL523SM, National Semi LM84, TI THMC10 and Onsemi
310   MC1066. This can also be built as a module which can be inserted
311   and removed while the kernel is running.
312
313   You will also need the latest user-space utilities: you can find them
314   in the lm_sensors package, which you can download at
315   http://www.lm-sensors.org/
316
317 Analog Devices ADM1024
318 CONFIG_SENSORS_ADM1024
319   If you say yes here you get support for Analog Devices ADM1024 sensor
320   chips.  This can also be built as a module.
321
322   You will also need the latest user-space utilities: you can find them
323   in the lm_sensors package, which you can download at
324   http://www.lm-sensors.org/
325
326 Analog Devices ADM1025
327 CONFIG_SENSORS_ADM1025
328   If you say yes here you get support for Analog Devices ADM1025 sensor
329   chips.  This can also be built as a module which can be inserted and
330   removed while the kernel is running.
331
332   You will also need the latest user-space utilities: you can find them
333   in the lm_sensors package, which you can download at
334   http://www.lm-sensors.org/
335
336 Analog Devices ADM1026
337 CONFIG_SENSORS_ADM1026
338   If you say yes here you get support for Analog Devices ADM1026 sensor
339   chips.  This can also be built as a module which can be inserted and
340   removed while the kernel is running.
341
342   You will also need the latest user-space utilities: you can find them
343   in the lm_sensors package, which you can download at
344   http://www.lm-sensors.org/
345
346 Analog Devices ADM1030, ADM1031
347 CONFIG_SENSORS_ADM1031
348   If you say yes here you get support for Analog Devices ADM1030 and
349   ADM1031 sensor chips.  This can also be built as a module which can
350   be inserted and removed while the kernel is running.
351
352   You will also need the latest user-space utilities: you can find them
353   in the lm_sensors package, which you can download at
354   http://www.lm-sensors.org/
355
356 Analog Devices ADM9240 and compatibles
357 CONFIG_SENSORS_ADM9240
358   If you say yes here you get support for Analog Devices ADM9240
359   sensor chips and clones: the Dallas Semiconductor DS1780 and
360   the National Semiconductor LM81. This can also be built as a
361   module which can be inserted and removed while the kernel is
362   running.
363
364   You will also need the latest user-space utilities: you can find them
365   in the lm_sensors package, which you can download at
366   http://www.lm-sensors.org/
367
368 Asus ASB100
369 CONFIG_SENSORS_ASB100
370   If you say yes here you get support for the Asus ASB100 (aka
371   "Bach") sensor chip.  This can also be built as a module.
372
373   You will also need the latest user-space utilities: you can find
374   them in the lm_sensors package, which you can download at
375   http://www.lm-sensors.org/
376
377 Dallas DS1621 and DS1625
378 CONFIG_SENSORS_DS1621
379   If you say yes here you get support for the Dallas DS1621 and DS1625x
380   sensor chips.  This can also be built as a module.
381
382   You will also need the latest user-space utilities: you can find them
383   in the lm_sensors package, which you can download at
384   http://www.lm-sensors.org/
385
386 Fintek F71805F
387 CONFIG_SENSORS_F71805F
388   If you say yes here you get support for the hardware monitoring
389   features of the Fintek F71805F/FG Super-I/O chip.  This can also be
390   built as a module.
391
392   You will also need the latest user-space utilities: you can find them
393   in the lm_sensors package, which you can download at
394   http://www.lm-sensors.org/
395
396 Fujitsu-Siemens Hermes
397 CONFIG_SENSORS_FSCHER
398   If you say yes here you get support for the Fujitsu-Siemens Hermes
399   sensor chip.  This can also be built as a module.
400
401   You will also need the latest user-space utilities: you can find them
402   in the lm_sensors package, which you can download at
403   http://www.lm-sensors.org/
404
405 Fujitsu-Siemens Poseidon
406 CONFIG_SENSORS_FSCPOS
407   If you say yes here you get support for the Fujitsu-Siemens Poseidon
408   sensor chip.  This can also be built as a module.
409
410   You will also need the latest user-space utilities: you can find them
411   in the lm_sensors package, which you can download at
412   http://www.lm-sensors.org/
413
414 Fujitsu-Siemens Scylla
415 CONFIG_SENSORS_FSCSCY
416   If you say yes here you get support for the Fujitsu-Siemens Scylla
417   sensor chip.  This can also be built as a module. This driver may/should
418   also work with the following Fujitsu-Siemens chips: "Poseidon",
419   "Poseidon II" and "Hydra". You may have to force loading of the module
420   for motherboards in these cases. Be careful - those motherboards have
421   not been tested with this driver.
422
423   You will also need the latest user-space utilities: you can find them
424   in the lm_sensors package, which you can download at
425   http://www.lm-sensors.org/
426
427 Genesys Logic GL518SM
428 CONFIG_SENSORS_GL518SM
429   If you say yes here you get support for Genesys Logic GL518SM sensor
430   chips.  This can also be built as a module which can be inserted and
431   removed while the kernel is running.
432
433   You will also need the latest user-space utilities: you can find them
434   in the lm_sensors package, which you can download at
435   http://www.lm-sensors.org/
436
437 Genesys Logic GL520SM
438 CONFIG_SENSORS_GL520SM
439   If you say yes here you get support for Genesys Logic GL518SM sensor
440   chips.  This can also be built as a module which can be inserted and
441   removed while the kernel is running.
442
443   You will also need the latest user-space utilities: you can find them
444   in the lm_sensors package, which you can download at
445   http://www.lm-sensors.org/
446
447 HP Maxilife
448 CONFIG_SENSORS_MAXILIFE
449   If you say yes here you get support for the HP Maxilife
450   sensor chip.  This can also be built as a module.
451
452   You will also need the latest user-space utilities: you can find them
453   in the lm_sensors package, which you can download at
454   http://www.lm-sensors.org/
455
456 Intel Xeon Thermal Sensor
457 CONFIG_SENSORS_XEONTEMP
458   If you say yes here you get support for the Intel Xeon processor
459   built-in thermal sensor. This can also be built as a module which
460   can be inserted and removed while the kernel is running.
461
462   You will also need the latest user-space utilities: you can find them
463   in the lm_sensors package, which you can download at
464   http://www.lm-sensors.org/
465
466 ITE 8705, 8712, Sis950
467 CONFIG_SENSORS_IT87
468   If you say yes here you get support for the ITE 8705 and 8712 and
469   SiS950 sensor chips.  This can also be built as a module.
470
471   You will also need the latest user-space utilities: you can find them
472   in the lm_sensors package, which you can download at
473   http://www.lm-sensors.org/
474
475 Maxim MAX1619
476 CONFIG_SENSORS_MAX1619
477   If you say yes here you get support for the Maxim MAX1619 sensor
478   chips.  This can also be built as a module.
479
480   You will also need the latest user-space utilities: you can find them
481   in the lm_sensors package, which you can download at
482   http://www.lm-sensors.org/
483
484 Maxim MAX6650, MAX6651
485 CONFIG_SENSORS_MAX6650
486   If you say yes here you get support for the Maxim MAX6650 and
487   MAX6651 sensor chips.  This can also be built as a module.
488
489   You will also need the latest user-space utilities: you can find them
490   in the lm_sensors package, which you can download at
491   http://www.lm-sensors.org/
492
493 Myson MTP008
494 CONFIG_SENSORS_MTP008
495   If you say yes here you get support for the Myson MTP008
496   sensor chip.  This can also be built as a module.
497
498   You will also need the latest user-space utilities: you can find them
499   in the lm_sensors package, which you can download at
500   http://www.lm-sensors.org/
501
502 National Semiconductor LM63
503 CONFIG_SENSORS_LM63
504   If you say yes here you get support for National Semiconductor LM63
505   sensor chips.  This can also be built as a module which can be inserted
506   and removed while the kernel is running.
507
508   You will also need the latest user-space utilities: you can find them
509   in the lm_sensors package, which you can download at
510   http://www.lm-sensors.org/
511
512 National Semiconductor LM75 and compatibles
513 CONFIG_SENSORS_LM75
514   If you say yes here you get support for National Semiconductor LM75
515   sensor chips and clones: Dallas Semiconductor DS75 and DS1775 (in
516   9-bit precision mode), and TelCom (now Microchip) TCN75. This can
517   also be built as a module which can be inserted and removed while
518   the kernel is running.
519
520   You will also need the latest user-space utilities: you can find them
521   in the lm_sensors package, which you can download at
522   http://www.lm-sensors.org/
523
524 National Semiconductor LM78
525 CONFIG_SENSORS_LM78
526   If you say yes here you get support for National Semiconductor LM78
527   sensor chips family: the LM78-J and LM79. Many clone chips will
528   also work at least somewhat with this driver. This can also be built
529   as a module which can be inserted and removed while the kernel is
530   running.
531
532   You will also need the latest user-space utilities: you can find them
533   in the lm_sensors package, which you can download at
534   http://www.lm-sensors.org/
535
536 National Semiconductor LM80
537 CONFIG_SENSORS_LM80
538   If you say yes here you get support for National Semiconductor LM80
539   sensor chips. This can also be built as a module which can be
540   inserted and removed while the kernel is running.
541
542   You will also need the latest user-space utilities: you can find them
543   in the lm_sensors package, which you can download at
544   http://www.lm-sensors.org/
545
546 National Semiconductor LM83 and compatibles
547 CONFIG_SENSORS_LM83
548   If you say yes here you get support for the National Semiconductor
549   LM82 and LM83 sensor chips.  This can also be built as a module.
550
551   You will also need the latest user-space utilities: you can find
552   them in the lm_sensors package, which you can download at
553   http://www.lm-sensors.org/
554
555 National Semiconductor LM85
556 CONFIG_SENSORS_LM85
557   If you say yes here you get support for National Semiconductor LM85
558   sensor chips and compatibles.  Compatible chips include the Analog
559   Devices ADM1027 and ADT7463 and SMSC EMC6D100 and EMC6D101.  This
560   can also be built as a module which can be inserted and removed
561   while the kernel is running.
562
563   You will also need the latest user-space utilities: you can find them
564   in the lm_sensors package, which you can download at
565   http://www.lm-sensors.org/
566
567 National Semiconductor LM87
568 CONFIG_SENSORS_LM87
569   If you say yes here you get support for National Semiconductor LM87
570   sensor chips. This can also be built as a module which can be
571   inserted and removed while the kernel is running.
572
573   You will also need the latest user-space utilities: you can find them
574   in the lm_sensors package, which you can download at
575   http://www.lm-sensors.org/
576
577 National Semiconductor LM90
578 CONFIG_SENSORS_LM90
579   If you say yes here you get support for the National Semiconductor
580   LM90, LM89 and LM99, Analog Devices ADM1032 and ADT7461, and Maxim
581   MAX6657 and MAX6658 sensor chips.  This can also be built as a module.
582
583   You will also need the latest user-space utilities: you can find
584   them in the lm_sensors package, which you can download at
585   http://www.lm-sensors.org/
586
587 National Semiconductor LM92
588 CONFIG_SENSORS_LM92
589   If you say yes here you get support for National Semiconductor LM92
590   sensor chips. This can also be built as a module which can be
591   inserted and removed while the kernel is running.
592
593   You will also need the latest user-space utilities: you can find them
594   in the lm_sensors package, which you can download at
595   http://www.lm-sensors.org/
596
597 National Semiconductor LM93
598 CONFIG_SENSORS_LM93
599   If you say yes here you get support for National Semiconductor LM93
600   sensor chips.  This can also be built as a module which can be inserted
601   and removed while the kernel is running.
602
603   You will also need the latest user-space utilities: you can find them
604   in the lm_sensors package, which you can download at
605   http://www.lm-sensors.org/
606
607 National Semiconductor PC8736x Sensors
608 CONFIG_SENSORS_PC87360
609   If you say yes here you get support for the integrated hardware
610   monitoring in the National Semicoductor PC87360, PC87363, PC87364,
611   PC87365 and PC87366 Super I/O chips. This can also be built as a
612   module which can be inserted and removed while the kernel is
613   running.
614
615   You will also need the latest user-space utilities: you can find them
616   in the lm_sensors package, which you can download at
617   http://www.lm-sensors.org/
618
619 Philips PCF8574
620 CONFIG_SENSORS_PCF8574
621   If you say yes here you get support for the Philips PCF8574
622   I2C 8-bit Parallel I/O device.
623   This can also be built as a module which can be
624   inserted and removed while the kernel is running.
625
626   You will also need the latest user-space utilities: you can find them
627   in the lm_sensors package, which you can download at
628   http://www.lm-sensors.org/
629
630 Philips PCF8591
631 CONFIG_SENSORS_PCF8591
632   If you say yes here you get support for the Philips PCF8591
633   I2C Quad D/A + Single A/D I/O device.
634   This can also be built as a module which can be
635   inserted and removed while the kernel is running.
636
637   You will also need the latest user-space utilities: you can find them
638   in the lm_sensors package, which you can download at
639   http://www.lm-sensors.org/
640
641 Silicon Integrated Systems Corp. SiS5595 Sensor
642 CONFIG_SENSORS_SIS5595
643   If you say yes here you get support for the integrated sensors in
644   SiS5595 South Bridges. This can also be built as a module
645   which can be inserted and removed while the kernel is running.
646
647   You will also need the latest user-space utilities: you can find them
648   in the lm_sensors package, which you can download at
649   http://www.lm-sensors.org/
650
651 SMSC47M1xx Super I/O Fan Support
652 CONFIG_SENSORS_SMSC47M1
653   If you say yes here you get support for the integrated fan
654   monitoring and control in the SMSC 47M1xx Super I/O chips.
655   This can also be built as a module
656   which can be inserted and removed while the kernel is running.
657
658   You will also need the latest user-space utilities: you can find them
659   in the lm_sensors package, which you can download at
660   http://www.lm-sensors.org/
661
662 Texas Instruments THMC50 / Analog Devices ADM1022
663 CONFIG_SENSORS_THMC50
664   If you say yes here you get support for Texas Instruments THMC50
665   sensor chips and clones: the Analog Devices ADM1022.
666   This can also be built as a module which
667   can be inserted and removed while the kernel is running.
668
669   You will also need the latest user-space utilities: you can find them
670   in the lm_sensors package, which you can download at
671   http://www.lm-sensors.org/
672
673 Via VT82C686A/B
674 CONFIG_SENSORS_VIA686A
675   If you say yes here you get support for the integrated sensors in
676   Via 686A/B South Bridges. This can also be built as a module
677   which can be inserted and removed while the kernel is running.
678
679   You will also need the latest user-space utilities: you can find them
680   in the lm_sensors package, which you can download at
681   http://www.lm-sensors.org/
682
683 Via VT1211 Sensors
684 CONFIG_SENSORS_VT1211
685   If you say yes here you get support for the integrated sensors in
686   the Via VT1211 Super I/O device. This can also be built as a module
687   which can be inserted and removed while the kernel is running.
688
689   You will also need the latest user-space utilities: you can find them
690   in the lm_sensors package, which you can download at
691   http://www.lm-sensors.org/
692
693 Via VT8231 Sensors
694 CONFIG_SENSORS_VT8231
695   If you say yes here you get support for the integrated sensors in
696   the Via VT8231 device. This can also be built as a module
697   which can be inserted and removed while the kernel is running.
698
699   You will also need the latest user-space utilities: you can find them
700   in the lm_sensors package, which you can download at
701   http://www.lm-sensors.org/
702
703 Winbond W83781D, W83782D, W83783S, W83627HF, AS99127F
704 CONFIG_SENSORS_W83781D
705   If you say yes here you get support for the Winbond W8378x series
706   of sensor chips: the W83781D, W83782D, W83783S and W83627HF,
707   and the similar Asus AS99127F. This can also be built as a module
708   which can be inserted and removed while the kernel is running.
709
710   You will also need the latest user-space utilities: you can find them
711   in the lm_sensors package, which you can download at
712   http://www.lm-sensors.org/
713
714 Winbond W83792D
715 CONFIG_SENSORS_W83792D
716   If you say yes here you get support for the Winbond W83792D
717   sensor chips.
718
719   You will also need the latest user-space utilities: you can find them
720   in the lm_sensors package, which you can download at
721   http://www.lm-sensors.org/
722
723 Winbond W83627HF, W83627THF, W83637HF, W83687THF, W83697HF
724 CONFIG_SENSORS_W83627HF
725   If you say yes here you get support for the Winbond W836x7 series
726   of sensor chips: the W83627HF, W83627THF, W83637HF, W83687THF and
727   W83697HF. This can also be built as a module which can be inserted
728   and removed while the kernel is running.
729
730   You will also need the latest user-space utilities: you can find
731   them in the lm_sensors package, which you can download at
732   http://www.lm-sensors.org/
733
734 Winbond W83627EHF/EHG
735 CONFIG_SENSORS_W83627EHF
736   If you say yes here you get support for the Winbond W83627EHF/EHG
737   sensor chips. This can also be built as a module which can be
738   inserted and removed while the kernel is running.
739
740   You will also need the latest user-space utilities: you can find
741   them in the lm_sensors package, which you can download at
742   http://www.lm-sensors.org/
743
744 Winbond W83L785TS-S
745 CONFIG_SENSORS_W83L785TS
746   If you say yes here you get support for the Winbond W83L785TS-S
747   sensor chip.  This can also be built as a module.
748
749   You will also need the latest user-space utilities: you can find
750   them in the lm_sensors package, which you can download at
751   http://www.lm-sensors.org/
752
753 EEprom (DIMM) reader
754 CONFIG_SENSORS_EEPROM
755   If you say yes here you get read-only access to the EEPROM data
756   available on modern memory DIMMs, and which could theoretically
757   also be available on other devices. This can also be built as a
758   module which can be inserted and removed while the kernel is
759   running.
760
761   You will also need the latest user-space utilities: you can find them
762   in the lm_sensors package, which you can download at
763   http://www.lm-sensors.org/
764
765 EOF
766     }
767     print OUTPUT;
768   }
769   close INPUT;
770   close OUTPUT;
771   print_diff $package_root,$kernel_root,$kernel_file,$package_file;
772 }
773
774
775 # This generates diffs for the main Linux Makefile.
776 # Three lines which add drivers/sensors/sensors.a to the DRIVERS list are
777 # put just before the place where the architecture Makefile is included.
778 # Of course, care is taken old lines are removed.
779 # $_[0]: sensors package root (like /tmp/sensors)
780 # $_[1]: Linux kernel tree (like /usr/src/linux)
781 sub gen_Makefile
782 {
783   my ($package_root,$kernel_root) = @_;
784   my $kernel_file = "Makefile";
785   my $package_file = $temp;
786   my $type = 0;
787   my $pr1 = 0;
788
789   open INPUT,"$kernel_root/$kernel_file"
790         or die "Can't open `$kernel_root/$kernel_file'";
791   open OUTPUT,">$package_root/$package_file"
792         or die "Can't open $package_root/$package_file";
793   `grep -q -s 'i2c\.o' "$kernel_root/$kernel_file"`;
794   $type = 2 if ! $?;
795   MAIN: while(<INPUT>) {
796     $type = 1 if !$type and (m@^DRIVERS-\$@);
797     if (m@DRIVERS-\$\(CONFIG_SENSORS\)@) {
798       $_ = <INPUT>;
799       redo MAIN;
800     } elsif (m@CONFIG_SENSORS@) {
801       $_ = <INPUT> while not m@endif@;
802       $_ = <INPUT>;
803       $_ = <INPUT> if m@^$@;
804       redo MAIN;
805     }
806     if ($type == 1 and m@^DRIVERS \+= \$\(DRIVERS-y\)@) {
807       print OUTPUT <<'EOF';
808 DRIVERS-$(CONFIG_SENSORS) += drivers/sensors/sensors.a
809 EOF
810       $pr1 = 1;
811     }
812     if ($type == 2 and m@^DRIVERS .*= \$\(DRIVERS-y\)@) {
813       print OUTPUT <<'EOF';
814 DRIVERS-$(CONFIG_SENSORS) += drivers/sensors/sensor.o
815 EOF
816       $pr1 = 1;
817     }
818     if ($type == 0 and m@include arch/\$\(ARCH\)/Makefile@) {
819       print OUTPUT <<'EOF';
820 ifeq ($(CONFIG_SENSORS),y)
821 DRIVERS := $(DRIVERS) drivers/sensors/sensors.a
822 endif
823
824 EOF
825       $pr1 = 1;
826     }
827     print OUTPUT;
828   }
829   close INPUT;
830   close OUTPUT;
831   die "Automatic patch generation for main `Makefile' failed.\n".
832       "See our home page http://www.lm-sensors.org/ for assistance!" if $pr1 == 0;
833   print_diff $package_root,$kernel_root,$kernel_file,$package_file;
834 }
835
836 # This generates diffs for drivers/Makefile
837 # First, `sensors' is added to the ALL_SUB_DIRS list. Next, a couple of lines
838 # to add sensors to the SUB_DIRS and/or MOD_SUB_DIRS lists is put right before
839 # Rules.make is included.
840 # Of course, care is taken old lines are removed.
841 # $_[0]: sensors package root (like /tmp/sensors)
842 # $_[1]: Linux kernel tree (like /usr/src/linux)
843 sub gen_drivers_Makefile
844 {
845   my ($package_root,$kernel_root) = @_;
846   my $kernel_file = "drivers/Makefile";
847   my $package_file = $temp;
848   m