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

Revision 4320, 47.5 KB (checked in by khali, 6 years ago)

Add ATI SB600 SMBus support, 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  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
21use strict;
22
23use 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
33sub 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)
72sub 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'
147I2C mainboard interfaces
148CONFIG_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
158Acer Labs ALI 1535
159CONFIG_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
164Acer Labs ALI 1533 and 1543C
165CONFIG_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
171Acer Labs ALI 1563
172CONFIG_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
177AMD 756/766/768/8111 and nVidia nForce
178CONFIG_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
184SMBus multiplexing on the Tyan S4882
185CONFIG_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
192AMD 8111 SMBus 2.0
193CONFIG_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
199Apple Hydra Mac I/O
200CONFIG_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
205Intel I801
206CONFIG_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
213Intel I810/I815 based Mainboard
214CONFIG_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
223Intel 82371AB PIIX4(E), ServerWorks OSB4, CSB5, CSB6, HT-1000
224CONFIG_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, IXP400 and SB600, and SMSC Victory66
228  mainboard SMBus interfaces.
229 
230  This can also be built as a module which can be inserted and removed
231  while the kernel is running.
232
233Nvidia Nforce2/3/4 based Mainboard
234CONFIG_I2C_NFORCE2
235  If you say yes to this option, support will be included for the
236  Nvidia Nforce2, Nforce3 and Nforce4 families of mainboard SMBus
237  interfaces.
238 
239  This can also be built as a module which can be inserted and removed
240  while the kernel is running.
241
242Silicon Integrated Systems Corp. SiS5595 based Mainboard
243CONFIG_I2C_SIS5595
244  If you say yes to this option, support will be included for the
245  SiS5595 mainboard I2C interfaces. For integrated sensors on the
246  Sis5595, use CONFIG_SENSORS_SIS5595. This can also be
247  built as a module which can be inserted and removed while the kernel
248  is running.
249
250Silicon Integrated Systems Corp. SiS630/730 based Mainboard
251CONFIG_I2C_SIS630
252  If you say yes to this option, support will be included for the SiS 630
253  and 730 mainboard I2C interfaces. This can also be built as a module
254  which can be inserted and removed while the kernel is running.
255
256Silicon Integrated Systems Corp. SiS645/961,645DX/961,735 based Mainboard
257CONFIG_I2C_SIS645
258  If you say yes to this option, support will be included for the SiS 645/961,
259  645DX/961 and 735 mainboard I2C interfaces. This can also be built as a module
260  which can be inserted and removed while the kernel is running.
261
262VIA Technologies, Inc. VT82C586B
263CONFIG_I2C_VIA
264  If you say yes to this option, support will be included for the VIA
265  Technologies I2C adapter found on some motherboards. This can also
266  be built as a module which can be inserted and removed while the
267  kernel is running.
268
269VIA Technologies, Inc. VT82C596/82C686/82xx and CX700
270CONFIG_I2C_VIAPRO
271  If you say yes to this option, support will be included for the VIA
272  Technologies I2C adapter on these chips. For integrated sensors on the
273  Via 686A/B, use CONFIG_SENSORS_VIA686A. This can also be
274  be built as a module which can be inserted and removed while the
275  kernel is running.
276
2773DFX Banshee / Voodoo3
278CONFIG_I2C_VOODOO3
279  If you say yes to this option, support will be included for the
280  3DFX Banshee and Voodoo3 I2C interfaces. The I2C busses on the these
281  chips are generally used only for video devices.
282  This can also be
283  built as a module which can be inserted and removed while the kernel
284  is running.
285
286DEC Tsunami 21272
287CONFIG_I2C_TSUNAMI
288  If you say yes to this option, support will be included for the DEC
289  Tsunami chipset I2C adapter. Requires the Alpha architecture;
290  do not enable otherwise. This can also be built as a module which
291  can be inserted and removed while the kernel is running.
292
293Pseudo ISA adapter (for hardware sensors modules)
294CONFIG_I2C_ISA
295  This provides support for accessing some hardware sensor chips over
296  the ISA bus rather than the I2C or SMBus. If you want to do this,
297  say yes here. This feature can also be built as a module which can
298  be inserted and removed while the kernel is running.
299
300  You will also need the latest user-space utilities: you can find them
301  in the lm_sensors package, which you can download at
302  http://www.lm-sensors.org/
303
304Analog Devices ADM1021 and compatibles
305CONFIG_SENSORS_ADM1021
306  If you say yes here you get support for Analog Devices ADM1021
307  and ADM1023 sensor chips and clones: Maxim MAX1617 and MAX1617A,
308  Genesys Logic GL523SM, National Semi LM84, TI THMC10 and Onsemi
309  MC1066. This can also be built as a module which can be inserted
310  and removed while the kernel is running.
311
312  You will also need the latest user-space utilities: you can find them
313  in the lm_sensors package, which you can download at
314  http://www.lm-sensors.org/
315
316Analog Devices ADM1024
317CONFIG_SENSORS_ADM1024
318  If you say yes here you get support for Analog Devices ADM1024 sensor
319  chips.  This can also be built as a module.
320
321  You will also need the latest user-space utilities: you can find them
322  in the lm_sensors package, which you can download at
323  http://www.lm-sensors.org/
324
325Analog Devices ADM1025
326CONFIG_SENSORS_ADM1025
327  If you say yes here you get support for Analog Devices ADM1025 sensor
328  chips.  This can also be built as a module which can be inserted and
329  removed while the kernel is running.
330
331  You will also need the latest user-space utilities: you can find them
332  in the lm_sensors package, which you can download at
333  http://www.lm-sensors.org/
334
335Analog Devices ADM1026
336CONFIG_SENSORS_ADM1026
337  If you say yes here you get support for Analog Devices ADM1026 sensor
338  chips.  This can also be built as a module which can be inserted and
339  removed while the kernel is running.
340
341  You will also need the latest user-space utilities: you can find them
342  in the lm_sensors package, which you can download at
343  http://www.lm-sensors.org/
344
345Analog Devices ADM1030, ADM1031
346CONFIG_SENSORS_ADM1031
347  If you say yes here you get support for Analog Devices ADM1030 and
348  ADM1031 sensor chips.  This can also be built as a module which can
349  be inserted and removed while the kernel is running.
350
351  You will also need the latest user-space utilities: you can find them
352  in the lm_sensors package, which you can download at
353  http://www.lm-sensors.org/
354
355Analog Devices ADM9240 and compatibles
356CONFIG_SENSORS_ADM9240
357  If you say yes here you get support for Analog Devices ADM9240
358  sensor chips and clones: the Dallas Semiconductor DS1780 and
359  the National Semiconductor LM81. This can also be built as a
360  module which can be inserted and removed while the kernel is
361  running.
362
363  You will also need the latest user-space utilities: you can find them
364  in the lm_sensors package, which you can download at
365  http://www.lm-sensors.org/
366
367Asus ASB100
368CONFIG_SENSORS_ASB100
369  If you say yes here you get support for the Asus ASB100 (aka
370  "Bach") sensor chip.  This can also be built as a module.
371
372  You will also need the latest user-space utilities: you can find
373  them in the lm_sensors package, which you can download at
374  http://www.lm-sensors.org/
375
376Dallas DS1621 and DS1625
377CONFIG_SENSORS_DS1621
378  If you say yes here you get support for the Dallas DS1621 and DS1625x
379  sensor chips.  This can also be built as a module.
380
381  You will also need the latest user-space utilities: you can find them
382  in the lm_sensors package, which you can download at
383  http://www.lm-sensors.org/
384
385Fintek F71805F
386CONFIG_SENSORS_F71805F
387  If you say yes here you get support for the hardware monitoring
388  features of the Fintek F71805F/FG Super-I/O chip.  This can also be
389  built as a module.
390
391  You will also need the latest user-space utilities: you can find them
392  in the lm_sensors package, which you can download at
393  http://www.lm-sensors.org/
394
395Fujitsu-Siemens Hermes
396CONFIG_SENSORS_FSCHER
397  If you say yes here you get support for the Fujitsu-Siemens Hermes
398  sensor chip.  This can also be built as a module.
399
400  You will also need the latest user-space utilities: you can find them
401  in the lm_sensors package, which you can download at
402  http://www.lm-sensors.org/
403
404Fujitsu-Siemens Poseidon
405CONFIG_SENSORS_FSCPOS
406  If you say yes here you get support for the Fujitsu-Siemens Poseidon
407  sensor chip.  This can also be built as a module.
408
409  You will also need the latest user-space utilities: you can find them
410  in the lm_sensors package, which you can download at
411  http://www.lm-sensors.org/
412
413Fujitsu-Siemens Scylla
414CONFIG_SENSORS_FSCSCY
415  If you say yes here you get support for the Fujitsu-Siemens Scylla
416  sensor chip.  This can also be built as a module. This driver may/should
417  also work with the following Fujitsu-Siemens chips: "Poseidon",
418  "Poseidon II" and "Hydra". You may have to force loading of the module
419  for motherboards in these cases. Be careful - those motherboards have
420  not been tested with this driver.
421
422  You will also need the latest user-space utilities: you can find them
423  in the lm_sensors package, which you can download at
424  http://www.lm-sensors.org/
425
426Genesys Logic GL518SM
427CONFIG_SENSORS_GL518SM
428  If you say yes here you get support for Genesys Logic GL518SM sensor
429  chips.  This can also be built as a module which can be inserted and
430  removed while the kernel is running.
431
432  You will also need the latest user-space utilities: you can find them
433  in the lm_sensors package, which you can download at
434  http://www.lm-sensors.org/
435
436Genesys Logic GL520SM
437CONFIG_SENSORS_GL520SM
438  If you say yes here you get support for Genesys Logic GL518SM sensor
439  chips.  This can also be built as a module which can be inserted and
440  removed while the kernel is running.
441
442  You will also need the latest user-space utilities: you can find them
443  in the lm_sensors package, which you can download at
444  http://www.lm-sensors.org/
445
446HP Maxilife
447CONFIG_SENSORS_MAXILIFE
448  If you say yes here you get support for the HP Maxilife
449  sensor chip.  This can also be built as a module.
450
451  You will also need the latest user-space utilities: you can find them
452  in the lm_sensors package, which you can download at
453  http://www.lm-sensors.org/
454
455Intel Xeon Thermal Sensor
456CONFIG_SENSORS_XEONTEMP
457  If you say yes here you get support for the Intel Xeon processor
458  built-in thermal sensor. This can also be built as a module which
459  can be inserted and removed while the kernel is running.
460
461  You will also need the latest user-space utilities: you can find them
462  in the lm_sensors package, which you can download at
463  http://www.lm-sensors.org/
464
465ITE 8705, 8712, Sis950
466CONFIG_SENSORS_IT87
467  If you say yes here you get support for the ITE 8705 and 8712 and
468  SiS950 sensor chips.  This can also be built as a module.
469
470  You will also need the latest user-space utilities: you can find them
471  in the lm_sensors package, which you can download at
472  http://www.lm-sensors.org/
473
474Maxim MAX1619
475CONFIG_SENSORS_MAX1619
476  If you say yes here you get support for the Maxim MAX1619 sensor
477  chips.  This can also be built as a module.
478
479  You will also need the latest user-space utilities: you can find them
480  in the lm_sensors package, which you can download at
481  http://www.lm-sensors.org/
482
483Maxim MAX6650, MAX6651
484CONFIG_SENSORS_MAX6650
485  If you say yes here you get support for the Maxim MAX6650 and
486  MAX6651 sensor chips.  This can also be built as a module.
487
488  You will also need the latest user-space utilities: you can find them
489  in the lm_sensors package, which you can download at
490  http://www.lm-sensors.org/
491
492Myson MTP008
493CONFIG_SENSORS_MTP008
494  If you say yes here you get support for the Myson MTP008
495  sensor chip.  This can also be built as a module.
496
497  You will also need the latest user-space utilities: you can find them
498  in the lm_sensors package, which you can download at
499  http://www.lm-sensors.org/
500
501National Semiconductor LM63
502CONFIG_SENSORS_LM63
503  If you say yes here you get support for National Semiconductor LM63
504  sensor chips.  This can also be built as a module which can be inserted
505  and removed while the kernel is running.
506
507  You will also need the latest user-space utilities: you can find them
508  in the lm_sensors package, which you can download at
509  http://www.lm-sensors.org/
510
511National Semiconductor LM75 and compatibles
512CONFIG_SENSORS_LM75
513  If you say yes here you get support for National Semiconductor LM75
514  sensor chips and clones: Dallas Semiconductor DS75 and DS1775 (in
515  9-bit precision mode), and TelCom (now Microchip) TCN75. This can
516  also be built as a module which can be inserted and removed while
517  the kernel is running.
518
519  You will also need the latest user-space utilities: you can find them
520  in the lm_sensors package, which you can download at
521  http://www.lm-sensors.org/
522
523National Semiconductor LM78
524CONFIG_SENSORS_LM78
525  If you say yes here you get support for National Semiconductor LM78
526  sensor chips family: the LM78-J and LM79. Many clone chips will
527  also work at least somewhat with this driver. This can also be built
528  as a module which can be inserted and removed while the kernel is
529  running.
530
531  You will also need the latest user-space utilities: you can find them
532  in the lm_sensors package, which you can download at
533  http://www.lm-sensors.org/
534
535National Semiconductor LM80
536CONFIG_SENSORS_LM80
537  If you say yes here you get support for National Semiconductor LM80
538  sensor chips. This can also be built as a module which can be
539  inserted and removed while the kernel is running.
540
541  You will also need the latest user-space utilities: you can find them
542  in the lm_sensors package, which you can download at
543  http://www.lm-sensors.org/
544
545National Semiconductor LM83 and compatibles
546CONFIG_SENSORS_LM83
547  If you say yes here you get support for the National Semiconductor
548  LM82 and LM83 sensor chips.  This can also be built as a module.
549
550  You will also need the latest user-space utilities: you can find
551  them in the lm_sensors package, which you can download at
552  http://www.lm-sensors.org/
553
554National Semiconductor LM85
555CONFIG_SENSORS_LM85
556  If you say yes here you get support for National Semiconductor LM85
557  sensor chips and compatibles.  Compatible chips include the Analog
558  Devices ADM1027 and ADT7463 and SMSC EMC6D100 and EMC6D101.  This
559  can also be built as a module which can be inserted and removed
560  while the kernel is running.
561
562  You will also need the latest user-space utilities: you can find them
563  in the lm_sensors package, which you can download at
564  http://www.lm-sensors.org/
565
566National Semiconductor LM87
567CONFIG_SENSORS_LM87
568  If you say yes here you get support for National Semiconductor LM87
569  sensor chips. This can also be built as a module which can be
570  inserted and removed while the kernel is running.
571
572  You will also need the latest user-space utilities: you can find them
573  in the lm_sensors package, which you can download at
574  http://www.lm-sensors.org/
575
576National Semiconductor LM90
577CONFIG_SENSORS_LM90
578  If you say yes here you get support for the National Semiconductor
579  LM90, LM89 and LM99, Analog Devices ADM1032 and ADT7461, and Maxim
580  MAX6657 and MAX6658 sensor chips.  This can also be built as a module.
581
582  You will also need the latest user-space utilities: you can find
583  them in the lm_sensors package, which you can download at
584  http://www.lm-sensors.org/
585
586National Semiconductor LM92
587CONFIG_SENSORS_LM92
588  If you say yes here you get support for National Semiconductor LM92
589  sensor chips. This can also be built as a module which can be
590  inserted and removed while the kernel is running.
591
592  You will also need the latest user-space utilities: you can find them
593  in the lm_sensors package, which you can download at
594  http://www.lm-sensors.org/
595
596National Semiconductor LM93
597CONFIG_SENSORS_LM93
598  If you say yes here you get support for National Semiconductor LM93
599  sensor chips.  This can also be built as a module which can be inserted
600  and removed while the kernel is running.
601
602  You will also need the latest user-space utilities: you can find them
603  in the lm_sensors package, which you can download at
604  http://www.lm-sensors.org/
605
606National Semiconductor PC8736x Sensors
607CONFIG_SENSORS_PC87360
608  If you say yes here you get support for the integrated hardware
609  monitoring in the National Semicoductor PC87360, PC87363, PC87364,
610  PC87365 and PC87366 Super I/O chips. This can also be built as a
611  module which can be inserted and removed while the kernel is
612  running.
613
614  You will also need the latest user-space utilities: you can find them
615  in the lm_sensors package, which you can download at
616  http://www.lm-sensors.org/
617
618Philips PCF8574
619CONFIG_SENSORS_PCF8574
620  If you say yes here you get support for the Philips PCF8574
621  I2C 8-bit Parallel I/O device.
622  This can also be built as a module which can be
623  inserted and removed while the kernel is running.
624
625  You will also need the latest user-space utilities: you can find them
626  in the lm_sensors package, which you can download at
627  http://www.lm-sensors.org/
628
629Philips PCF8591
630CONFIG_SENSORS_PCF8591
631  If you say yes here you get support for the Philips PCF8591
632  I2C Quad D/A + Single A/D I/O device.
633  This can also be built as a module which can be
634  inserted and removed while the kernel is running.
635
636  You will also need the latest user-space utilities: you can find them
637  in the lm_sensors package, which you can download at
638  http://www.lm-sensors.org/
639
640Silicon Integrated Systems Corp. SiS5595 Sensor
641CONFIG_SENSORS_SIS5595
642  If you say yes here you get support for the integrated sensors in
643  SiS5595 South Bridges. This can also be built as a module
644  which can be inserted and removed while the kernel is running.
645
646  You will also need the latest user-space utilities: you can find them
647  in the lm_sensors package, which you can download at
648  http://www.lm-sensors.org/
649
650SMSC47M1xx Super I/O Fan Support
651CONFIG_SENSORS_SMSC47M1
652  If you say yes here you get support for the integrated fan
653  monitoring and control in the SMSC 47M1xx Super I/O chips.
654  This can also be built as a module
655  which can be inserted and removed while the kernel is running.
656
657  You will also need the latest user-space utilities: you can find them
658  in the lm_sensors package, which you can download at
659  http://www.lm-sensors.org/
660
661Texas Instruments THMC50 / Analog Devices ADM1022
662CONFIG_SENSORS_THMC50
663  If you say yes here you get support for Texas Instruments THMC50
664  sensor chips and clones: the Analog Devices ADM1022.
665  This can also be built as a module which
666  can be inserted and removed while the kernel is running.
667
668  You will also need the latest user-space utilities: you can find them
669  in the lm_sensors package, which you can download at
670  http://www.lm-sensors.org/
671
672Via VT82C686A/B
673CONFIG_SENSORS_VIA686A
674  If you say yes here you get support for the integrated sensors in
675  Via 686A/B South Bridges. This can also be built as a module
676  which can be inserted and removed while the kernel is running.
677
678  You will also need the latest user-space utilities: you can find them
679  in the lm_sensors package, which you can download at
680  http://www.lm-sensors.org/
681
682Via VT1211 Sensors
683CONFIG_SENSORS_VT1211
684  If you say yes here you get support for the integrated sensors in
685  the Via VT1211 Super I/O device. This can also be built as a module
686  which can be inserted and removed while the kernel is running.
687
688  You will also need the latest user-space utilities: you can find them
689  in the lm_sensors package, which you can download at
690  http://www.lm-sensors.org/
691
692Via VT8231 Sensors
693CONFIG_SENSORS_VT8231
694  If you say yes here you get support for the integrated sensors in
695  the Via VT8231 device. This can also be built as a module
696  which can be inserted and removed while the kernel is running.
697
698  You will also need the latest user-space utilities: you can find them
699  in the lm_sensors package, which you can download at
700  http://www.lm-sensors.org/
701
702Winbond W83781D, W83782D, W83783S, W83627HF, AS99127F
703CONFIG_SENSORS_W83781D
704  If you say yes here you get support for the Winbond W8378x series
705  of sensor chips: the W83781D, W83782D, W83783S and W83627HF,
706  and the similar Asus AS99127F. This can also be built as a module
707  which can be inserted and removed while the kernel is running.
708
709  You will also need the latest user-space utilities: you can find them
710  in the lm_sensors package, which you can download at
711  http://www.lm-sensors.org/
712
713Winbond W83792D
714CONFIG_SENSORS_W83792D
715  If you say yes here you get support for the Winbond W83792D
716  sensor chips.
717
718  You will also need the latest user-space utilities: you can find them
719  in the lm_sensors package, which you can download at
720  http://www.lm-sensors.org/
721
722Winbond W83627HF, W83627THF, W83637HF, W83687THF, W83697HF
723CONFIG_SENSORS_W83627HF
724  If you say yes here you get support for the Winbond W836x7 series
725  of sensor chips: the W83627HF, W83627THF, W83637HF, W83687THF and
726  W83697HF. This can also be built as a module which can be inserted
727  and removed while the kernel is running.
728
729  You will also need the latest user-space utilities: you can find
730  them in the lm_sensors package, which you can download at
731  http://www.lm-sensors.org/
732
733Winbond W83L785TS-S
734CONFIG_SENSORS_W83L785TS
735  If you say yes here you get support for the Winbond W83L785TS-S
736  sensor chip.  This can also be built as a module.
737
738  You will also need the latest user-space utilities: you can find
739  them in the lm_sensors package, which you can download at
740  http://www.lm-sensors.org/
741
742EEprom (DIMM) reader
743CONFIG_SENSORS_EEPROM
744  If you say yes here you get read-only access to the EEPROM data
745  available on modern memory DIMMs, and which could theoretically
746  also be available on other devices. This can also be built as a
747  module which can be inserted and removed while the kernel is
748  running.
749
750  You will also need the latest user-space utilities: you can find them
751  in the lm_sensors package, which you can download at
752  http://www.lm-sensors.org/
753
754EOF
755    }
756    print OUTPUT;
757  }
758  close INPUT;
759  close OUTPUT;
760  print_diff $package_root,$kernel_root,$kernel_file,$package_file;
761}
762
763
764# This generates diffs for the main Linux Makefile.
765# Three lines which add drivers/sensors/sensors.a to the DRIVERS list are
766# put just before the place where the architecture Makefile is included.
767# Of course, care is taken old lines are removed.
768# $_[0]: sensors package root (like /tmp/sensors)
769# $_[1]: Linux kernel tree (like /usr/src/linux)
770sub gen_Makefile
771{
772  my ($package_root,$kernel_root) = @_;
773  my $kernel_file = "Makefile";
774  my $package_file = $temp;
775  my $type = 0;
776  my $pr1 = 0;
777
778  open INPUT,"$kernel_root/$kernel_file"
779        or die "Can't open `$kernel_root/$kernel_file'";
780  open OUTPUT,">$package_root/$package_file"
781        or die "Can't open $package_root/$package_file";
782  `grep -q -s 'i2c\.o' "$kernel_root/$kernel_file"`;
783  $type = 2 if ! $?;
784  MAIN: while(<INPUT>) {
785    $type = 1 if !$type and (m@^DRIVERS-\$@);
786    if (m@DRIVERS-\$\(CONFIG_SENSORS\)@) {
787      $_ = <INPUT>;
788      redo MAIN;
789    } elsif (m@CONFIG_SENSORS@) {
790      $_ = <INPUT> while not m@endif@;
791      $_ = <INPUT>;
792      $_ = <INPUT> if m@^$@;
793      redo MAIN;
794    }
795    if ($type == 1 and m@^DRIVERS \+= \$\(DRIVERS-y\)@) {
796      print OUTPUT <<'EOF';
797DRIVERS-$(CONFIG_SENSORS) += drivers/sensors/sensors.a
798EOF
799      $pr1 = 1;
800    }
801    if ($type == 2 and m@^DRIVERS .*= \$\(DRIVERS-y\)@) {
802      print OUTPUT <<'EOF';
803DRIVERS-$(CONFIG_SENSORS) += drivers/sensors/sensor.o
804EOF
805      $pr1 = 1;
806    }
807    if ($type == 0 and m@include arch/\$\(ARCH\)/Makefile@) {
808      print OUTPUT <<'EOF';
809ifeq ($(CONFIG_SENSORS),y)
810DRIVERS := $(DRIVERS) drivers/sensors/sensors.a
811endif
812
813EOF
814      $pr1 = 1;
815    }
816    print OUTPUT;
817  }
818  close INPUT;
819  close OUTPUT;
820  die "Automatic patch generation for main `Makefile' failed.\n".
821      "See our home page http://www.lm-sensors.org/ for assistance!" if $pr1 == 0;
822  print_diff $package_root,$kernel_root,$kernel_file,$package_file;
823}
824
825# This generates diffs for drivers/Makefile
826# First, `sensors' is added to the ALL_SUB_DIRS list. Next, a couple of lines
827# to add sensors to the SUB_DIRS and/or MOD_SUB_DIRS lists is put right before
828# Rules.make is included.
829# Of course, care is taken old lines are removed.
830# $_[0]: sensors package root (like /tmp/sensors)
831# $_[1]: Linux kernel tree (like /usr/src/linux)
832sub gen_drivers_Makefile
833{
834  my ($package_root,$kernel_root) = @_;
835  my $kernel_file = "drivers/Makefile";
836  my $package_file = $temp;
837  my $sensors_present;
838  my $pr1 = 0;
839  my $pr2 = 0;
840  my $new_style = 0;
841
842  open INPUT,"$kernel_root/$kernel_file"
843        or die "Can't open `$kernel_root/$kernel_file'";
844  open OUTPUT,">$package_root/$package_file"
845        or die "Can't open $package_root/$package_file";
846  MAIN: while(<INPUT>) {
847    if (m@^mod-subdirs\s*:=@) {
848      $new_style = 1;
849    }
850    if ((! $new_style and m@^ALL_SUB_DIRS\s*:=@) or m@^mod-subdirs\s*:=@) {
851      $pr1 = 1;
852      $sensors_present = 0;
853      while (m@\\$@) {
854        $sensors_present = 1 if m@sensors@;
855        print OUTPUT;
856        $_ = <INPUT>;
857      }
858      $sensors_present = 1 if m@sensors@;
859      s@$@ sensors@ if (not $sensors_present);
860      print OUTPUT;
861      $_ = <INPUT>;
862      redo MAIN;
863    }
864    if (m@^ifeq.*CONFIG_SENSORS@) {
865      $_ = <INPUT> while not m@^endif@;
866      $_ = <INPUT>;
867      $_ = <INPUT> if m@^$@;
868      redo MAIN;
869    }
870    if (m@^subdir.*CONFIG_SENSORS@) {
871      $_ = <INPUT>;
872      redo MAIN;
873    }
874    if (!$pr2 and (m@^include \$\(TOPDIR\)/Rules.make$@ or m@^subdir-\$\(CONFIG_ACPI@)) {
875      $pr2 = 1;
876      if ($new_style) {
877      print OUTPUT <<'EOF';
878subdir-$(CONFIG_SENSORS)        += sensors
879EOF
880      } else {
881      print OUTPUT <<'EOF';
882ifeq ($(CONFIG_SENSORS),y)
883SUB_DIRS += sensors
884MOD_SUB_DIRS += sensors
885else
886  ifeq ($(CONFIG_SENSORS),m)
887  MOD_SUB_DIRS += sensors
888  endif
889endif
890
891EOF
892      }
893    }
894    print OUTPUT;
895  }
896  close INPUT;
897  close OUTPUT;
898  die "Automatic patch generation for `drivers/Makefile' failed.\n".
899      "See our home page http://www.lm-sensors.org/ for assistance!" if $pr1 == 0 or $pr2 == 0;
900  print_diff $package_root,$kernel_root,$kernel_file,$package_file;
901}
902
903# This generates diffs for drivers/char/Config.in
904# It adds a line just before CONFIG_APM or main_menu_option lines to include
905# the sensors Config.in.
906# Of course, care is taken old lines are removed.
907# $_[0]: sensors package root (like /tmp/sensors)
908# $_[1]: Linux kernel tree (like /usr/src/linux)
909sub gen_drivers_char_Config_in
910{
911  my ($package_root,$kernel_root) = @_;
912  my $kernel_file = "drivers/char/Config.in";
913  my $package_file = $temp;
914  my $pr1 = 0;
915
916  open INPUT,"$kernel_root/$kernel_file"
917        or die "Can't open `$kernel_root/$kernel_file'";
918  open OUTPUT,">$package_root/$package_file"
919        or die "Can't open $package_root/$package_file";
920  MAIN: while(<INPUT>) {
921    if (m@source drivers/i2c/Config.in@) {
922      $pr1 = 1;
923      print OUTPUT;
924      print OUTPUT "\nsource drivers/sensors/Config.in\n";
925      $_ = <INPUT>;
926      redo MAIN;
927    }
928    if (m@sensors@) {
929      $_ = <INPUT>;
930      $_ = <INPUT> if m@^$@;
931      redo MAIN;
932    }
933    print OUTPUT;
934  }
935  close INPUT;
936  close OUTPUT;
937  die "Automatic patch generation for `drivers/char/Config.in' failed.\n".
938      "See our home page http://www.lm-sensors.org/ for assistance!" if $pr1 == 0;
939  print_diff $package_root,$kernel_root,$kernel_file,$package_file;
940}
941
942# This generates diffs for drivers/i2c/Config.in
943# Several adapter drivers that are included in the lm_sensors package are
944# added at the first and onlu sensors marker.
945# Of course, care is taken old lines are removed.
946# $_[0]: sensors package root (like /tmp/sensors)
947# $_[1]: Linux kernel tree (like /usr/src/linux)
948sub gen_drivers_i2c_Config_in
949{
950  my ($package_root,$kernel_root) = @_;
951  my $kernel_file = "drivers/i2c/Config.in";
952  my $package_file = "$temp";
953  my $pr1 = 0;
954
955  open INPUT,"$kernel_root/$kernel_file"
956        or die "Can't open `$kernel_root/$kernel_file'";
957  open OUTPUT,">$package_root/$package_file"
958        or die "Can't open $package_root/$package_file";
959  while(<INPUT>) {
960    if (m@sensors code starts here@) {
961      $pr1++;
962      print OUTPUT;
963      while (<INPUT>) {
964        last if m@sensors code ends here@;
965      }
966      print OUTPUT << 'EOF';
967  bool 'I2C mainboard interfaces' CONFIG_I2C_MAINBOARD
968  if [ "$CONFIG_I2C_MAINBOARD" = "y" ]; then
969    dep_tristate '  Acer Labs ALI 1535' CONFIG_I2C_ALI1535 $CONFIG_I2C
970    dep_tristate '  Acer Labs ALI 1533 and 1543C' CONFIG_I2C_ALI15X3 $CONFIG_I2C
971    dep_tristate '  Acer Labs ALI 1563' CONFIG_I2C_ALI1563 $CONFIG_I2C
972    dep_tristate '  Apple Hydra Mac I/O' CONFIG_I2C_HYDRA $CONFIG_I2C_ALGOBIT
973    dep_tristate '  AMD 756/766/768/8111 and nVidia nForce' CONFIG_I2C_AMD756 $CONFIG_I2C
974    if [ "$CONFIG_I2C_AMD756" != "n" ]; then
975      dep_tristate '    SMBus multiplexing on the Tyan S4882' CONFIG_I2C_AMD756_S4882 $CONFIG_I2C_AMD756
976    fi
977    dep_tristate '  AMD 8111 SMBus 2.0' CONFIG_I2C_AMD8111 $CONFIG_I2C
978    if [ "$CONFIG_ALPHA" = "y" ]; then
979      dep_tristate '  DEC Tsunami I2C interface' CONFIG_I2C_TSUNAMI $CONFIG_I2C_ALGOBIT
980    fi
981    dep_tristate '  Intel 82801 (ICH) and ESB' CONFIG_I2C_I801 $CONFIG_I2C
982    dep_tristate '  Intel i810AA/AB/E and i815' CONFIG_I2C_I810 $CONFIG_I2C_ALGOBIT
983    dep_tristate '  Intel 82371AB PIIX4(E), 443MX, ServerWorks OSB4/CSB5, SMSC Victory66' CONFIG_I2C_PIIX4 $CONFIG_I2C
984    dep_tristate '  Nvidia Nforce2/3/4' CONFIG_I2C_NFORCE2 $CONFIG_I2C
985    dep_tristate '  SiS 5595' CONFIG_I2C_SIS5595 $CONFIG_I2C
986    dep_tristate '  SiS 630/730' CONFIG_I2C_SIS630 $CONFIG_I2C
987    dep_tristate '  SiS 645/961,645DX/961,735' CONFIG_I2C_SIS645 $CONFIG_I2C $CONFIG_HOTPLUG
988    dep_tristate '  Savage 4' CONFIG_I2C_SAVAGE4 $CONFIG_I2C_ALGOBIT
989    dep_tristate '  VIA Technologies, Inc. VT82C586B' CONFIG_I2C_VIA $CONFIG_I2C_ALGOBIT
990    dep_tristate '  VIA Technologies, Inc. VT82C596/82C686/82xx and CX700' CONFIG_I2C_VIAPRO $CONFIG_I2C
991    dep_tristate '  Voodoo3 I2C interface' CONFIG_I2C_VOODOO3 $CONFIG_I2C_ALGOBIT
992    dep_tristate '  Pseudo ISA adapter (for some hardware sensors)' CONFIG_I2C_ISA $CONFIG_I2C
993  fi
994
995EOF
996    }
997    print OUTPUT;
998  }
999  close INPUT;
1000  close OUTPUT;
1001  die "Automatic patch generation for `drivers/i2c/Config.in' failed.\n".
1002      "See our home page http://www.lm-sensors.org/ for assistance!" if $pr1 != 1;
1003  print_diff $package_root,$kernel_root,$kernel_file,$package_file;
1004}
1005
1006sub gen_drivers_sensors_Makefile
1007{
1008  my ($package_root,$kernel_root) = @_;
1009  my $kernel_file = "drivers/sensors/Makefile";
1010  my $package_file = $temp;
1011
1012  open OUTPUT,">$package_root/$package_file"
1013        or die "Can't open $package_root/$package_file";
1014  print OUTPUT <<'EOF';
1015#
1016# Makefile for the kernel hardware sensors drivers.
1017#
1018
1019MOD_LIST_NAME := SENSORS_MODULES
1020O_TARGET := sensor.o
1021
1022obj-$(CONFIG_SENSORS_ADM1021)   += adm1021.o
1023obj-$(CONFIG_SENSORS_ADM1024)   += adm1024.o
1024obj-$(CONFIG_SENSORS_ADM1025)   += adm1025.o
1025obj-$(CONFIG_SENSORS_ADM1026)   += adm1026.o
1026obj-$(CONFIG_SENSORS_ADM1031)   += adm1031.o
1027obj-$(CONFIG_SENSORS_ADM9240)   += adm9240.o
1028obj-$(CONFIG_SENSORS_ASB100)    += asb100.o
1029obj-$(CONFIG_SENSORS_BT869)     += bt869.o
1030obj-$(CONFIG_SENSORS_DDCMON)    += ddcmon.o
1031obj-$(CONFIG_SENSORS_DS1621)    += ds1621.o
1032obj-$(CONFIG_SENSORS_EEPROM)    += eeprom.o
1033obj-$(CONFIG_SENSORS_F71805F)   += f71805f.o
1034obj-$(CONFIG_SENSORS_FSCHER)    += fscher.o
1035obj-$(CONFIG_SENSORS_FSCPOS)    += fscpos.o
1036obj-$(CONFIG_SENSORS_FSCSCY)    += fscscy.o
1037obj-$(CONFIG_SENSORS_GL518SM)   += gl518sm.o
1038obj-$(CONFIG_SENSORS_GL520SM)   += gl520sm.o
1039obj-$(CONFIG_SENSORS_IT87)      += it87.o
1040obj-$(CONFIG_SENSORS_LM63)      += lm63.o
1041obj-$(CONFIG_SENSORS_LM75)      += lm75.o
1042obj-$(CONFIG_SENSORS_LM78)      += lm78.o
1043obj-$(CONFIG_SENSORS_LM80)      += lm80.o
1044obj-$(CONFIG_SENSORS_LM83)      += lm83.o
1045obj-$(CONFIG_SENSORS_LM85)      += lm85.o
1046obj-$(CONFIG_SENSORS_LM87)      += lm87.o
1047obj-$(CONFIG_SENSORS_LM90)      += lm90.o
1048obj-$(CONFIG_SENSORS_LM92)      += lm92.o
1049obj-$(CONFIG_SENSORS_LM93)      += lm93.o
1050obj-$(CONFIG_SENSORS_MAX1619)   += max1619.o
1051obj-$(CONFIG_SENSORS_MAX6650)   += max6650.o
1052obj-$(CONFIG_SENSORS_MAXILIFE)  += maxilife.o
1053obj-$(CONFIG_SENSORS_MTP008)    += mtp008.o
1054obj-$(CONFIG_SENSORS_PC87360)   += pc87360.o
1055obj-$(CONFIG_SENSORS_PCF8574)   += pcf8574.o
1056obj-$(CONFIG_SENSORS_PCF8591)   += pcf8591.o
1057obj-$(CONFIG_SENSORS_SIS5595)   += sis5595.o
1058obj-$(CONFIG_SENSORS_SMSC47M1)  += smsc47m1.o
1059obj-$(CONFIG_SENSORS_THMC50)    += thmc50.o
1060obj-$(CONFIG_SENSORS_VIA686A)   += via686a.o
1061obj-$(CONFIG_SENSORS_VT1211)    += vt1211.o
1062obj-$(CONFIG_SENSORS_VT8231)    += vt8231.o
1063obj-$(CONFIG_SENSORS_W83781D)   += w83781d.o
1064obj-$(CONFIG_SENSORS_W83792D)   += w83792d.o
1065obj-$(CONFIG_SENSORS_W83627HF)  += w83627hf.o
1066obj-$(CONFIG_SENSORS_W83L785TS) += w83l785ts.o
1067obj-$(CONFIG_SENSORS_XEONTEMP)  += xeontemp.o
1068
1069include $(TOPDIR)/Rules.make
1070
1071EOF
1072  close OUTPUT;
1073  print_diff $package_root,$kernel_root,$kernel_file,$package_file;
1074}
1075
1076# This generates diffs for drivers/i2c/Makefile.
1077# Lines to add correct files to M_OBJS and/or L_OBJS are added just before
1078# Rules.make is included
1079# Of course, care is taken old lines are removed.
1080# $_[0]: sensors package root (like /tmp/sensors)
1081# $_[1]: Linux kernel tree (like /usr/src/linux)
1082sub gen_drivers_i2c_Makefile
1083{
1084  my ($package_root,$kernel_root) = @_;
1085  my $kernel_file = "drivers/i2c/Makefile";
1086  my $package_file = $temp;
1087  my $pr1 = 0;
1088
1089  open INPUT,"$kernel_root/$kernel_file"
1090        or die "Can't open `$kernel_root/$kernel_file'";
1091  open OUTPUT,">$package_root/$package_file"
1092        or die "Can't open $package_root/$package_file";
1093  while(<INPUT>) {
1094    if (m@sensors code starts here@) {
1095      $pr1 ++;
1096      print OUTPUT;
1097      while (<INPUT>) {
1098        last if m@sensors code ends here@;
1099      }
1100      print OUTPUT <<'EOF';
1101export-objs     += i2c-amd756.o
1102
1103obj-$(CONFIG_I2C_ALI1535)               += i2c-ali1535.o
1104obj-$(CONFIG_I2C_ALI15X3)               += i2c-ali15x3.o
1105obj-$(CONFIG_I2C_ALI1563)               += i2c-ali1563.o
1106obj-$(CONFIG_I2C_AMD756)                += i2c-amd756.o
1107obj-$(CONFIG_I2C_AMD756_S4882)          += i2c-amd756-s4882.o
1108obj-$(CONFIG_I2C_AMD8111)               += i2c-amd8111.o
1109obj-$(CONFIG_I2C_HYDRA)                 += i2c-hydra.o
1110obj-$(CONFIG_I2C_I801)                  += i2c-i801.o
1111obj-$(CONFIG_I2C_I810)                  += i2c-i810.o
1112obj-$(CONFIG_I2C_ISA)                   += i2c-isa.o
1113obj-$(CONFIG_I2C_NFORCE2)               += i2c-nforce2.o
1114obj-$(CONFIG_I2C_PIIX4)                 += i2c-piix4.o
1115obj-$(CONFIG_I2C_SIS5595)               += i2c-sis5595.o
1116obj-$(CONFIG_I2C_SIS630)                += i2c-sis630.o
1117obj-$(CONFIG_I2C_SIS645)                += i2c-sis645.o
1118obj-$(CONFIG_I2C_SAVAGE4)               += i2c-savage4.o
1119obj-$(CONFIG_I2C_TSUNAMI)               += i2c-tsunami.o
1120obj-$(CONFIG_I2C_VIA)                   += i2c-via.o
1121obj-$(CONFIG_I2C_VIAPRO)                += i2c-viapro.o
1122obj-$(CONFIG_I2C_VOODOO3)               += i2c-voodoo3.o
1123EOF
1124    }
1125    print OUTPUT;
1126  }
1127  close INPUT;
1128  close OUTPUT;
1129  die "Automatic patch generation for `drivers/i2c/Makefile' failed.\n".
1130      "See our home page http://www.lm-sensors.org/ for assistance!" if $pr1 != 1;
1131  print_diff $package_root,$kernel_root,$kernel_file,$package_file;
1132}
1133
1134# Generate the diffs for the list of MAINTAINERS
1135# $_[0]: i2c package root (like /tmp/i2c)
1136# $_[1]: Linux kernel tree (like /usr/src/linux)
1137sub gen_MAINTAINERS
1138{
1139  my ($package_root,$kernel_root) = @_;
1140  my $kernel_file = "MAINTAINERS";
1141  my $package_file = $temp;
1142  my $done = 0;
1143
1144  open INPUT,"$kernel_root/$kernel_file"
1145        or die "Can't open `$kernel_root/$kernel_file'";
1146  open OUTPUT,">$package_root/$package_file"
1147        or die "Can't open $package_root/$package_file";
1148  MAIN: while(<INPUT>) {
1149    if (m@SENSORS DRIVERS@) {
1150       $_=<INPUT> while not m@^$@;
1151       $_=<INPUT>;
1152       redo MAIN;
1153    }
1154    if (not $done and (m@SGI VISUAL WORKSTATION 320 AND 540@)) {
1155      print OUTPUT <<'EOF';
1156SENSORS DRIVERS
1157L:      lm-sensors@lm-sensors.org
1158W:      http://www.lm-sensors.org/
1159S:      Maintained
1160
1161EOF
1162      $done = 1;
1163    }
1164    print OUTPUT;
1165  }
1166  close INPUT;
1167  close OUTPUT;
1168  die "Automatic patch generation for `MAINTAINERS' failed.\n".
1169      "See our home page http://www.lm-sensors.org/ for assistance!" if $done == 0;
1170  print_diff $package_root,$kernel_root,$kernel_file,$package_file;
1171}
1172
1173# Generate the diffs for dmi_scan.c and i386_ksyms.c
1174# $_[0]: i2c package root (like /tmp/i2c)
1175# $_[1]: Linux kernel tree (like /usr/src/linux)
1176sub gen_dmi_scan
1177{
1178  my ($package_root,$kernel_root) = @_;
1179  my $kernel_file = "arch/i386/kernel/dmi_scan.c";
1180  my $package_file = $temp;
1181  my $done = 0;
1182
1183  open INPUT,"$kernel_root/$kernel_file"
1184        or die "Can't open `$kernel_root/$kernel_file'";
1185  open OUTPUT,">$package_root/$package_file"
1186        or die "Can't open $package_root/$package_file";
1187  MAIN: while(<INPUT>) {
1188    if ($done == 0 && m/^\s*int is_sony_vaio_laptop;\s*$/) {
1189      print OUTPUT <<'EOF';
1190int is_unsafe_smbus;
1191EOF
1192      $done++;
1193    }
1194    if ($done == 1 && m/^\s*\* Check for a Sony Vaio system\s*$/) {
1195      print OUTPUT <<'EOF';
1196 * Don't access SMBus on IBM systems which get corrupted eeproms
1197 */
1198
1199static __init int disable_smbus(struct dmi_blacklist *d)
1200{
1201        if (is_unsafe_smbus == 0) {
1202                is_unsafe_smbus = 1;
1203                printk(KERN_INFO "%s machine detected. Disabling SMBus accesses.\n", d->ident);
1204        }
1205        return 0;
1206}
1207
1208/*
1209EOF
1210      $done++;
1211    }
1212    if ($done == 2 && m/^\s*\{ sony_vaio_laptop, "Sony Vaio", \{ \/\* This is a Sony Vaio laptop \*\/\s*$/) {
1213      print OUTPUT <<'EOF';
1214        { disable_smbus, "IBM", {
1215                        MATCH(DMI_SYS_VENDOR, "IBM"),
1216                        NO_MATCH, NO_MATCH, NO_MATCH
1217                        } },
1218EOF
1219      $done++;
1220    }
1221    print OUTPUT;
1222  }
1223  close INPUT;
1224  close OUTPUT;
1225  die "Automatic patch generation for `$kernel_file' failed.\n".
1226      "See our home page http://www.lm-sensors.org/ for assistance!" if $done != 3;
1227  print_diff $package_root,$kernel_root,$kernel_file,$package_file;
1228
1229  $kernel_file = "arch/i386/kernel/i386_ksyms.c";
1230  $done = 0;
1231
1232  open INPUT,"$kernel_root/$kernel_file"
1233        or die "Can't open `$kernel_root/$kernel_file'";
1234  open OUTPUT,">$package_root/$package_file"
1235        or die "Can't open $package_root/$package_file";
1236  MAIN: while(<INPUT>) {
1237    if ($done == 0 && m/^\s*extern int is_sony_vaio_laptop;\s*$/) {
1238      print OUTPUT <<'EOF';
1239extern int is_unsafe_smbus;
1240EXPORT_SYMBOL(is_unsafe_smbus);
1241
1242EOF
1243      $done++;
1244    }
1245    print OUTPUT;
1246  }
1247  close INPUT;
1248  close OUTPUT;
1249  die "Automatic patch generation for `$kernel_file' failed.\n".
1250      "See our home page http://www.lm-sensors.org/ for assistance!" if $done != 1;
1251  print_diff $package_root,$kernel_root,$kernel_file,$package_file;
1252}
1253
1254
1255sub usage
1256{
1257  print "Usage: $0 package_root kernel_root\n";
1258  exit 1;
1259}
1260
1261# Main function
1262sub main
1263{
1264  my ($package_root,$kernel_root,%files,%includes,$package_file,$kernel_file);
1265  my ($diff_command,$dummy,$data0,$data1,$sedscript,$version_string);
1266
1267  # --> Read the command-line
1268  $package_root = $ARGV[0];
1269  usage() unless defined $package_root;
1270  die "Package root `$package_root' is not found\n"
1271        unless -d "$package_root/mkpatch";
1272  $kernel_root = $ARGV[1];
1273  usage() unless defined $kernel_root;
1274  die "Kernel root `$kernel_root' is not found\n"
1275        unless -f "$kernel_root/Rules.make";
1276
1277  # --> Read FILES
1278  open INPUT, "$package_root/mkpatch/FILES"
1279        or die "Can't open `$package_root/mkpatch/FILES'";
1280  while (<INPUT>) {
1281    ($data0,$data1) = /(\S+)\s+(\S+)/;
1282    $files{$data0} = $data1;
1283  }
1284  close INPUT;
1285
1286  # --> Read INCLUDES
1287  open INPUT, "$package_root/mkpatch/INCLUDES"
1288        or die "Can't open `$package_root/mkpatch/INCLUDES'";
1289  while (<INPUT>) {
1290    ($data0,$data1) = /(\S+)\s+(\S+)/;
1291    $includes{$data0} = $data1;
1292    $sedscript .= 's,(#\s*include\s*)'.$data0.'(\s*),$1'."$data1".'$2, ; ';
1293  }
1294  close INPUT;
1295
1296  die "First apply the i2c patches to `$kernel_root'!"
1297       if ! -d "$kernel_root/drivers/i2c";
1298
1299  # --> Read "version.h"
1300  open INPUT, "$package_root/version.h"
1301        or die "Can't open `$package_root/version.h'";
1302  $version_string .= $_ while <INPUT>;
1303  close INPUT;
1304
1305  # --> Start generating
1306  foreach $package_file (sort keys %files) {
1307    open INPUT,"$package_root/$package_file"
1308          or die "Can't open `$package_root/$package_file'";
1309    open OUTPUT,">$package_root/$temp"
1310          or die "Can't open `$package_root/$temp'";
1311    while (<INPUT>) {
1312      eval $sedscript;
1313      if (m@#\s*include\s*"version.h"@) {
1314        print OUTPUT $version_string;
1315      } else {
1316        print OUTPUT;
1317      }
1318    }
1319    close INPUT;
1320    close OUTPUT;
1321
1322    $kernel_file = $files{$package_file};
1323    print_diff $package_root,$kernel_root,$kernel_file,$temp;
1324  }
1325
1326  gen_Makefile $package_root, $kernel_root;
1327  gen_drivers_Makefile $package_root, $kernel_root;
1328  gen_drivers_sensors_Makefile $package_root, $kernel_root;
1329  gen_drivers_char_Config_in $package_root, $kernel_root;
1330  gen_drivers_i2c_Config_in $package_root, $kernel_root;
1331  gen_drivers_i2c_Makefile $package_root, $kernel_root;
1332  gen_Documentation_Configure_help $package_root, $kernel_root;
1333  gen_MAINTAINERS $package_root, $kernel_root;
1334  gen_dmi_scan $package_root, $kernel_root;
1335
1336  # Clear temporary file
1337  unlink("$package_root/$temp");
1338}
1339
1340main;
1341
Note: See TracBrowser for help on using the browser.