root/lm-sensors/tags/V2-10-1/mkpatch/mkpatch.pl

Revision 4162, 47.5 kB (checked in by khali, 2 years ago)

mkpatch: Turn warnings on (-w), and fix them.
Print a usage message on missing command line parameters.

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