| 1 | #!/usr/bin/perl |
|---|
| 2 | |
|---|
| 3 | # mkpatch - Create patches against the Linux kernel |
|---|
| 4 | # Copyright (c) 1999 Frodo Looijaard <frodol@dds.nl> |
|---|
| 5 | # |
|---|
| 6 | # This program is free software; you can redistribute it and/or modify |
|---|
| 7 | # it under the terms of the GNU General Public License as published by |
|---|
| 8 | # the Free Software Foundation; either version 2 of the License, or |
|---|
| 9 | # (at your option) any later version. |
|---|
| 10 | # |
|---|
| 11 | # This program is distributed in the hope that it will be useful, |
|---|
| 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 14 | # GNU General Public License for more details. |
|---|
| 15 | # |
|---|
| 16 | # You should have received a copy of the GNU General Public License |
|---|
| 17 | # along with this program; if not, write to the Free Software |
|---|
| 18 | # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
|---|
| 19 | |
|---|
| 20 | use strict; |
|---|
| 21 | |
|---|
| 22 | use vars qw($temp); |
|---|
| 23 | $temp = "mkpatch/.temp"; |
|---|
| 24 | |
|---|
| 25 | # Generate a diff between the old kernel file and the new lm_sensors file. We |
|---|
| 26 | # arrange the headers to tell us the old tree was under directory |
|---|
| 27 | # `linux-old', and the new tree under `linux'. |
|---|
| 28 | # $_[0]: sensors package root (like /tmp/sensors) |
|---|
| 29 | # $_[1]: Linux kernel tree (like /usr/src/linux) |
|---|
| 30 | # $_[2]: Name of the kernel file |
|---|
| 31 | # $_[3]: Name of the patched file |
|---|
| 32 | sub print_diff |
|---|
| 33 | { |
|---|
| 34 | my ($package_root,$kernel_root,$kernel_file,$package_file) = @_; |
|---|
| 35 | my ($diff_command,$package_mtime,$kernel_mtime); |
|---|
| 36 | |
|---|
| 37 | $diff_command = "diff -u"; |
|---|
| 38 | if ( -e "$kernel_root/$kernel_file") { |
|---|
| 39 | $diff_command .= " $kernel_root/$kernel_file"; |
|---|
| 40 | $kernel_mtime = (stat("$kernel_root/$kernel_file"))[9]; |
|---|
| 41 | } else { |
|---|
| 42 | $diff_command .= " /dev/null"; |
|---|
| 43 | $kernel_mtime = 0; |
|---|
| 44 | } |
|---|
| 45 | if ( -e "$package_root/$package_file") { |
|---|
| 46 | $diff_command .= " $package_root/$package_file"; |
|---|
| 47 | $package_mtime = (stat("$package_root/$package_file"))[9]; |
|---|
| 48 | } else { |
|---|
| 49 | $diff_command .= " /dev/null"; |
|---|
| 50 | $package_mtime = 0; |
|---|
| 51 | } |
|---|
| 52 | open INPUT, "$diff_command|" or die "Can't execute `$diff_command'"; |
|---|
| 53 | if (<INPUT>) { |
|---|
| 54 | <INPUT>; |
|---|
| 55 | print "--- linux-old/$kernel_file\t".gmtime($kernel_mtime)."\n". |
|---|
| 56 | "+++ linux/$kernel_file\t".gmtime($package_mtime)."\n"; |
|---|
| 57 | |
|---|
| 58 | print while <INPUT>; |
|---|
| 59 | } |
|---|
| 60 | close INPUT; |
|---|
| 61 | } |
|---|
| 62 | |
|---|
| 63 | # This generates diffs for kernel file Documentation/Configure.help. This |
|---|
| 64 | # file contains the help texts that can be displayed during `make *config' |
|---|
| 65 | # for the kernel. |
|---|
| 66 | # The new texts are put at the end of the file, or just before the |
|---|
| 67 | # lm_sensors texts. |
|---|
| 68 | # Of course, care is taken old lines are removed. |
|---|
| 69 | # $_[0]: i2c package root (like /tmp/i2c) |
|---|
| 70 | # $_[1]: Linux kernel tree (like /usr/src/linux) |
|---|
| 71 | sub gen_Documentation_Configure_help |
|---|
| 72 | { |
|---|
| 73 | my ($package_root,$kernel_root) = @_; |
|---|
| 74 | my $kernel_file = "Documentation/Configure.help"; |
|---|
| 75 | my $package_file = $temp; |
|---|
| 76 | |
|---|
| 77 | open INPUT,"$kernel_root/$kernel_file" |
|---|
| 78 | or die "Can't open `$kernel_root/$kernel_file'"; |
|---|
| 79 | open OUTPUT,">$package_root/$package_file" |
|---|
| 80 | or die "Can't open $package_root/$package_file"; |
|---|
| 81 | MAIN: while(<INPUT>) { |
|---|
| 82 | if (m@I2C mainboard interfaces@ or |
|---|
| 83 | m@Acer Labs ALI 1535@ or |
|---|
| 84 | m@Acer Labs ALI 1533 and 1543C@ or |
|---|
| 85 | m@AMD 756/766/768/8111@ or |
|---|
| 86 | m@AMD 8111 SMBus 2.0@ or |
|---|
| 87 | m@Apple Hydra Mac I/O@ or |
|---|
| 88 | m@Intel I801@ or |
|---|
| 89 | m@Intel I810/I815 based Mainboard@ or |
|---|
| 90 | m@Intel 82371AB PIIX4\(E\)@ or |
|---|
| 91 | m@Silicon Integrated Systems Corp. SiS5595 based Mainboard@ or |
|---|
| 92 | m@VIA Technologies, Inc. VT82C586B@ or |
|---|
| 93 | m@VIA Technologies, Inc. VT82C596, 596B, 686A/B, 8233@ or |
|---|
| 94 | m@3DFX Banshee / Voodoo3@ or |
|---|
| 95 | m@DEC Tsunami 21272@ or |
|---|
| 96 | m@Pseudo ISA adapter \(for hardware sensors modules\)@ or |
|---|
| 97 | m@Analog Devices ADM1021 and compatibles@ or |
|---|
| 98 | m@Analog Devices ADM1024@ or |
|---|
| 99 | m@Analog Devices ADM1025@ or |
|---|
| 100 | m@Analog Devices ADM1026@ or |
|---|
| 101 | m@Analog Devices ADM9240 and compatibles@ or |
|---|
| 102 | m@Asus ASB100@ or |
|---|
| 103 | m@Dallas DS1621 and DS1625@ or |
|---|
| 104 | m@Fujitsu-Siemens Poseidon@ or |
|---|
| 105 | m@Fujitsu-Siemens Scylla@ or |
|---|
| 106 | m@Genesys Logic GL518SM@ or |
|---|
| 107 | m@Genesys Logic GL520SM@ or |
|---|
| 108 | m@HP Maxilife@ or |
|---|
| 109 | m@ITE 8705, 8712, Sis950@ or |
|---|
| 110 | m@Maxim MAX6650, MAX6651@ or |
|---|
| 111 | m@Myson MTP008@ or |
|---|
| 112 | m@National Semiconductors LM75 and compatibles@ or |
|---|
| 113 | m@National Semiconductors LM78@ or |
|---|
| 114 | m@National Semiconductors LM80@ or |
|---|
| 115 | m@National Semiconductors LM83@ or |
|---|
| 116 | m@National Semiconductors LM85@ or |
|---|
| 117 | m@National Semiconductors LM87@ or |
|---|
| 118 | m@National Semiconductors LM90@ or |
|---|
| 119 | m@National Semiconductors LM92@ or |
|---|
| 120 | m@Silicon Integrated Systems Corp. SiS5595 Sensor@ or |
|---|
| 121 | m@Texas Instruments THMC50 / Analog Devices ADM1022@ or |
|---|
| 122 | m@Via VT82C686A/B@ or |
|---|
| 123 | m@Winbond W83781D, W83782D, W83783S, W83627HF, AS99127F@ or |
|---|
| 124 | m@Winbond W83L785TS-S@ or |
|---|
| 125 | m@EEprom \(DIMM\) reader@) { |
|---|
| 126 | $_ = <INPUT>; |
|---|
| 127 | $_ = <INPUT>; |
|---|
| 128 | $_ = <INPUT> while not m@^\S@ and not eof(INPUT); |
|---|
| 129 | redo MAIN; |
|---|
| 130 | } |
|---|
| 131 | if (eof(INPUT)) { |
|---|
| 132 | print OUTPUT <<'EOF' |
|---|
| 133 | I2C mainboard interfaces |
|---|
| 134 | CONFIG_I2C_MAINBOARD |
|---|
| 135 | Many modern mainboards have some kind of I2C interface integrated. This |
|---|
| 136 | is often in the form of a SMBus, or System Management Bus, which is |
|---|
| 137 | basically the same as I2C but which uses only a subset of the I2C |
|---|
| 138 | protocol. |
|---|
| 139 | |
|---|
| 140 | You will also want the latest user-space utilties: you can find them |
|---|
| 141 | in the lm_sensors package, which you can download at |
|---|
| 142 | http://www.lm-sensors.nu |
|---|
| 143 | |
|---|
| 144 | Acer Labs ALI 1535 |
|---|
| 145 | CONFIG_I2C_ALI1535 |
|---|
| 146 | If you say yes to this option, support will be included for the Acer |
|---|
| 147 | Labs ALI 1535 mainboard I2C interface. This can also be |
|---|
| 148 | built as a module. |
|---|
| 149 | |
|---|
| 150 | Acer Labs ALI 1533 and 1543C |
|---|
| 151 | CONFIG_I2C_ALI15X3 |
|---|
| 152 | If you say yes to this option, support will be included for the Acer |
|---|
| 153 | Labs ALI 1533 and 1543C mainboard I2C interfaces. This can also be |
|---|
| 154 | built as a module which can be inserted and removed while the kernel |
|---|
| 155 | is running. |
|---|
| 156 | |
|---|
| 157 | AMD 756/766/768/8111 |
|---|
| 158 | CONFIG_I2C_AMD756 |
|---|
| 159 | If you say yes to this option, support will be included for the AMD |
|---|
| 160 | 756/766/768/8111 mainboard I2C interfaces. This can also be |
|---|
| 161 | built as a module which can be inserted and removed while the kernel |
|---|
| 162 | is running. |
|---|
| 163 | |
|---|
| 164 | AMD 8111 SMBus 2.0 |
|---|
| 165 | CONFIG_I2C_AMD8111 |
|---|
| 166 | If you say yes to this option, support will be included for the AMD |
|---|
| 167 | 8111 mainboard SMBus 2.0 interface. This can also be |
|---|
| 168 | built as a module which can be inserted and removed while the kernel |
|---|
| 169 | is running. |
|---|
| 170 | |
|---|
| 171 | Apple Hydra Mac I/O |
|---|
| 172 | CONFIG_I2C_HYDRA |
|---|
| 173 | If you say yes to this option, support will be included for the |
|---|
| 174 | Hydra mainboard I2C interface. This can also be built as a module |
|---|
| 175 | which can be inserted and removed while the kernel is running. |
|---|
| 176 | |
|---|
| 177 | Intel I801 |
|---|
| 178 | CONFIG_I2C_I801 |
|---|
| 179 | If you say yes to this option, support will be included for the |
|---|
| 180 | Intel I801 mainboard I2C interfaces. "I810" mainboard sensor chips are |
|---|
| 181 | generally located on the I801's I2C bus. This can also be |
|---|
| 182 | built as a module which can be inserted and removed while the kernel |
|---|
| 183 | is running. |
|---|
| 184 | |
|---|
| 185 | Intel I810/I815 based Mainboard |
|---|
| 186 | CONFIG_I2C_I810 |
|---|
| 187 | If you say yes to this option, support will be included for the |
|---|
| 188 | Intel I810/I815 mainboard I2C interfaces. The I2C busses these chips |
|---|
| 189 | are generally used only for video devices. For "810" mainboard sensor |
|---|
| 190 | chips, use the I801 I2C driver instead. This can also be |
|---|
| 191 | built as a module which can be inserted and removed while the kernel |
|---|
| 192 | is running. |
|---|
| 193 | |
|---|
| 194 | Intel 82371AB PIIX4(E) / ServerWorks OSB4 and CSB5 |
|---|
| 195 | CONFIG_I2C_PIIX4 |
|---|
| 196 | If you say yes to this option, support will be included for the |
|---|
| 197 | Intel PIIX4, PIIX4E, and 443MX, Serverworks OSB4/CSB5, |
|---|
| 198 | and SMSC Victory66 mainboard |
|---|
| 199 | I2C interfaces. This can also be |
|---|
| 200 | built as a module which can be inserted and removed while the kernel |
|---|
| 201 | is running. |
|---|
| 202 | |
|---|
| 203 | Silicon Integrated Systems Corp. SiS5595 based Mainboard |
|---|
| 204 | CONFIG_I2C_SIS5595 |
|---|
| 205 | If you say yes to this option, support will be included for the |
|---|
| 206 | SiS5595 mainboard I2C interfaces. For integrated sensors on the |
|---|
| 207 | Sis5595, use CONFIG_SENSORS_SIS5595. This can also be |
|---|
| 208 | built as a module which can be inserted and removed while the kernel |
|---|
| 209 | is running. |
|---|
| 210 | |
|---|
| 211 | Silicon Integrated Systems Corp. SiS630/730 based Mainboard |
|---|
| 212 | CONFIG_I2C_SIS630 |
|---|
| 213 | If you say yes to this option, support will be included for the SiS 630 |
|---|
| 214 | and 730 mainboard I2C interfaces. This can also be built as a module |
|---|
| 215 | which can be inserted and removed while the kernel is running. |
|---|
| 216 | |
|---|
| 217 | Silicon Integrated Systems Corp. SiS645/961,645DX/961,735 based Mainboard |
|---|
| 218 | CONFIG_I2C_SIS645 |
|---|
| 219 | If you say yes to this option, support will be included for the SiS 645/961, |
|---|
| 220 | 645DX/961 and 735 mainboard I2C interfaces. This can also be built as a module |
|---|
| 221 | which can be inserted and removed while the kernel is running. |
|---|
| 222 | |
|---|
| 223 | VIA Technologies, Inc. VT82C586B |
|---|
| 224 | CONFIG_I2C_VIA |
|---|
| 225 | If you say yes to this option, support will be included for the VIA |
|---|
| 226 | Technologies I2C adapter found on some motherboards. This can also |
|---|
| 227 | be built as a module which can be inserted and removed while the |
|---|
| 228 | kernel is running. |
|---|
| 229 | |
|---|
| 230 | VIA Technologies, Inc. VT82C596, 596B, 686A/B, 8233, 8235 |
|---|
| 231 | CONFIG_I2C_VIAPRO |
|---|
| 232 | If you say yes to this option, support will be included for the VIA |
|---|
| 233 | Technologies I2C adapter on these chips. For integrated sensors on the |
|---|
| 234 | Via 686A/B, use CONFIG_SENSORS_VIA686A. This can also be |
|---|
| 235 | be built as a module which can be inserted and removed while the |
|---|
| 236 | kernel is running. |
|---|
| 237 | |
|---|
| 238 | 3DFX Banshee / Voodoo3 |
|---|
| 239 | CONFIG_I2C_VOODOO3 |
|---|
| 240 | If you say yes to this option, support will be included for the |
|---|
| 241 | 3DFX Banshee and Voodoo3 I2C interfaces. The I2C busses on the these |
|---|
| 242 | chips are generally used only for video devices. |
|---|
| 243 | This can also be |
|---|
| 244 | built as a module which can be inserted and removed while the kernel |
|---|
| 245 | is running. |
|---|
| 246 | |
|---|
| 247 | DEC Tsunami 21272 |
|---|
| 248 | CONFIG_I2C_TSUNAMI |
|---|
| 249 | If you say yes to this option, support will be included for the DEC |
|---|
| 250 | Tsunami chipset I2C adapter. Requires the Alpha architecture; |
|---|
| 251 | do not enable otherwise. This can also be built as a module which |
|---|
| 252 | can be inserted and removed while the kernel is running. |
|---|
| 253 | |
|---|
| 254 | Pseudo ISA adapter (for hardware sensors modules) |
|---|
| 255 | CONFIG_I2C_ISA |
|---|
| 256 | This provides support for accessing some hardware sensor chips over |
|---|
| 257 | the ISA bus rather than the I2C or SMBus. If you want to do this, |
|---|
| 258 | say yes here. This feature can also be built as a module which can |
|---|
| 259 | be inserted and removed while the kernel is running. |
|---|
| 260 | |
|---|
| 261 | You will also need the latest user-space utilties: you can find them |
|---|
| 262 | in the lm_sensors package, which you can download at |
|---|
| 263 | http://www.lm-sensors.nu |
|---|
| 264 | |
|---|
| 265 | Analog Devices ADM1021 and compatibles |
|---|
| 266 | CONFIG_SENSORS_ADM1021 |
|---|
| 267 | If you say yes here you get support for Analog Devices ADM1021 |
|---|
| 268 | and ADM1023 sensor chips and clones: Maxim MAX1617 and MAX1617A, |
|---|
| 269 | Genesys Logic GL523SM, National Semi LM84, TI THMC10, Onsemi MC1066 |
|---|
| 270 | and the XEON processor built-in sensor. This can also |
|---|
| 271 | be built as a module which can be inserted and removed while the |
|---|
| 272 | kernel is running. |
|---|
| 273 | |
|---|
| 274 | You will also need the latest user-space utilties: you can find them |
|---|
| 275 | in the lm_sensors package, which you can download at |
|---|
| 276 | http://www.lm-sensors.nu |
|---|
| 277 | |
|---|
| 278 | Analog Devices ADM1024 |
|---|
| 279 | CONFIG_SENSORS_ADM1024 |
|---|
| 280 | If you say yes here you get support for Analog Devices ADM1024 sensor |
|---|
| 281 | chips. This can also be built as a module. |
|---|
| 282 | |
|---|
| 283 | You will also need the latest user-space utilties: you can find them |
|---|
| 284 | in the lm_sensors package, which you can download at |
|---|
| 285 | http://www.lm-sensors.nu |
|---|
| 286 | |
|---|
| 287 | Analog Devices ADM1025 |
|---|
| 288 | CONFIG_SENSORS_ADM1025 |
|---|
| 289 | If you say yes here you get support for Analog Devices ADM1025 sensor |
|---|
| 290 | chips. This can also be built as a module which can be inserted and |
|---|
| 291 | removed while the kernel is running. |
|---|
| 292 | |
|---|
| 293 | You will also need the latest user-space utilties: you can find them |
|---|
| 294 | in the lm_sensors package, which you can download at |
|---|
| 295 | http://www.lm-sensors.nu |
|---|
| 296 | |
|---|
| 297 | Analog Devices ADM1026 |
|---|
| 298 | CONFIG_SENSORS_ADM1026 |
|---|
| 299 | If you say yes here you get support for Analog Devices ADM1026 sensor |
|---|
| 300 | chips. This can also be built as a module which can be inserted and |
|---|
| 301 | removed while the kernel is running. |
|---|
| 302 | |
|---|
| 303 | You will also need the latest user-space utilties: you can find them |
|---|
| 304 | in the lm_sensors package, which you can download at |
|---|
| 305 | http://www.lm-sensors.nu |
|---|
| 306 | |
|---|
| 307 | Analog Devices ADM9240 and compatibles |
|---|
| 308 | CONFIG_SENSORS_ADM9240 |
|---|
| 309 | If you say yes here you get support for Analog Devices ADM9240 |
|---|
| 310 | sensor chips and clones: the Dallas Semiconductor DS1780 and |
|---|
| 311 | the National Semiconductor LM81. This can also be built as a |
|---|
| 312 | module which can be inserted and removed while the kernel is |
|---|
| 313 | running. |
|---|
| 314 | |
|---|
| 315 | You will also need the latest user-space utilties: you can find them |
|---|
| 316 | in the lm_sensors package, which you can download at |
|---|
| 317 | http://www.lm-sensors.nu |
|---|
| 318 | |
|---|
| 319 | Asus ASB100 |
|---|
| 320 | CONFIG_SENSORS_ASB100 |
|---|
| 321 | If you say yes here you get support for the Asus ASB100 (aka |
|---|
| 322 | "Bach") sensor chip. This can also be built as a module. |
|---|
| 323 | |
|---|
| 324 | You will also need the latest user-space utilities: you can find |
|---|
| 325 | them in the lm_sensors package, which you can download at |
|---|
| 326 | http://www.lm-sensors.nu/ |
|---|
| 327 | |
|---|
| 328 | Dallas DS1621 and DS1625 |
|---|
| 329 | CONFIG_SENSORS_DS1621 |
|---|
| 330 | If you say yes here you get support for the Dallas DS1621 and DS1625x |
|---|
| 331 | sensor chips. This can also be built as a module. |
|---|
| 332 | |
|---|
| 333 | You will also need the latest user-space utilties: you can find them |
|---|
| 334 | in the lm_sensors package, which you can download at |
|---|
| 335 | http://www.lm-sensors.nu |
|---|
| 336 | |
|---|
| 337 | Fujitsu-Siemens Poseidon |
|---|
| 338 | CONFIG_SENSORS_FSCPOS |
|---|
| 339 | If you say yes here you get support for the Fujitsu-Siemens Poseidon |
|---|
| 340 | sensor chip. This can also be built as a module. |
|---|
| 341 | |
|---|
| 342 | You will also need the latest user-space utilties: you can find them |
|---|
| 343 | in the lm_sensors package, which you can download at |
|---|
| 344 | http://www.lm-sensors.nu |
|---|
| 345 | |
|---|
| 346 | Fujitsu-Siemens Scylla |
|---|
| 347 | CONFIG_SENSORS_FSCSCY |
|---|
| 348 | If you say yes here you get support for the Fujitsu-Siemens Scylla |
|---|
| 349 | sensor chip. This can also be built as a module. This driver may/should |
|---|
| 350 | also work with the following Fujitsu-Siemens chips: "Poseidon", |
|---|
| 351 | "Poseidon II" and "Hydra". You may have to force loading of the module |
|---|
| 352 | for motherboards in these cases. Be careful - those motherboards have |
|---|
| 353 | not been tested with this driver. |
|---|
| 354 | |
|---|
| 355 | You will also need the latest user-space utilties: you can find them |
|---|
| 356 | in the lm_sensors package, which you can download at |
|---|
| 357 | http://www.lm-sensors.nu |
|---|
| 358 | |
|---|
| 359 | Genesys Logic GL518SM |
|---|
| 360 | CONFIG_SENSORS_GL518SM |
|---|
| 361 | If you say yes here you get support for Genesys Logic GL518SM sensor |
|---|
| 362 | chips. This can also be built as a module which can be inserted and |
|---|
| 363 | removed while the kernel is running. |
|---|
| 364 | |
|---|
| 365 | You will also need the latest user-space utilties: you can find them |
|---|
| 366 | in the lm_sensors package, which you can download at |
|---|
| 367 | http://www.lm-sensors.nu |
|---|
| 368 | |
|---|
| 369 | Genesys Logic GL520SM |
|---|
| 370 | CONFIG_SENSORS_GL520SM |
|---|
| 371 | If you say yes here you get support for Genesys Logic GL518SM sensor |
|---|
| 372 | chips. This can also be built as a module which can be inserted and |
|---|
| 373 | removed while the kernel is running. |
|---|
| 374 | |
|---|
| 375 | You will also need the latest user-space utilties: you can find them |
|---|
| 376 | in the lm_sensors package, which you can download at |
|---|
| 377 | http://www.lm-sensors.nu |
|---|
| 378 | |
|---|
| 379 | HP Maxilife |
|---|
| 380 | CONFIG_SENSORS_MAXILIFE |
|---|
| 381 | If you say yes here you get support for the HP Maxilife |
|---|
| 382 | sensor chip. This can also be built as a module. |
|---|
| 383 | |
|---|
| 384 | You will also need the latest user-space utilties: you can find them |
|---|
| 385 | in the lm_sensors package, which you can download at |
|---|
| 386 | http://www.lm-sensors.nu |
|---|
| 387 | |
|---|
| 388 | ITE 8705, 8712, Sis950 |
|---|
| 389 | CONFIG_SENSORS_IT87 |
|---|
| 390 | If you say yes here you get support for the ITE 8705 and 8712 and |
|---|
| 391 | SiS950 sensor chips. This can also be built as a module. |
|---|
| 392 | |
|---|
| 393 | You will also need the latest user-space utilties: you can find them |
|---|
| 394 | in the lm_sensors package, which you can download at |
|---|
| 395 | http://www.lm-sensors.nu |
|---|
| 396 | |
|---|
| 397 | Maxim MAX6650, MAX6651 |
|---|
| 398 | CONFIG_SENSORS_MAX6650 |
|---|
| 399 | If you say yes here you get support for the Maxim MAX6650 and |
|---|
| 400 | MAX6651 sensor chips. This can also be built as a module. |
|---|
| 401 | |
|---|
| 402 | You will also need the latest user-space utilties: you can find them |
|---|
| 403 | in the lm_sensors package, which you can download at |
|---|
| 404 | http://www.lm-sensors.nu |
|---|
| 405 | |
|---|
| 406 | Myson MTP008 |
|---|
| 407 | CONFIG_SENSORS_MTP008 |
|---|
| 408 | If you say yes here you get support for the Myson MTP008 |
|---|
| 409 | sensor chip. This can also be built as a module. |
|---|
| 410 | |
|---|
| 411 | You will also need the latest user-space utilties: you can find them |
|---|
| 412 | in the lm_sensors package, which you can download at |
|---|
| 413 | http://www.lm-sensors.nu |
|---|
| 414 | |
|---|
| 415 | National Semiconductor LM75 and compatibles |
|---|
| 416 | CONFIG_SENSORS_LM75 |
|---|
| 417 | If you say yes here you get support for National Semiconductor LM75 |
|---|
| 418 | sensor chips and clones: Dallas Semi DS75 and DS1775, TelCon |
|---|
| 419 | TCN75, and National Semi LM77. This can also be built as a module which |
|---|
| 420 | can be inserted and removed while the kernel is running. |
|---|
| 421 | |
|---|
| 422 | You will also need the latest user-space utilties: you can find them |
|---|
| 423 | in the lm_sensors package, which you can download at |
|---|
| 424 | http://www.lm-sensors.nu |
|---|
| 425 | |
|---|
| 426 | National Semiconductor LM78 |
|---|
| 427 | CONFIG_SENSORS_LM78 |
|---|
| 428 | If you say yes here you get support for National Semiconductor LM78 |
|---|
| 429 | sensor chips family: the LM78-J and LM79. Many clone chips will |
|---|
| 430 | also work at least somewhat with this driver. This can also be built |
|---|
| 431 | as a module which can be inserted and removed while the kernel is |
|---|
| 432 | running. |
|---|
| 433 | |
|---|
| 434 | You will also need the latest user-space utilties: you can find them |
|---|
| 435 | in the lm_sensors package, which you can download at |
|---|
| 436 | http://www.lm-sensors.nu |
|---|
| 437 | |
|---|
| 438 | National Semiconductor LM80 |
|---|
| 439 | CONFIG_SENSORS_LM80 |
|---|
| 440 | If you say yes here you get support for National Semiconductor LM80 |
|---|
| 441 | sensor chips. This can also be built as a module which can be |
|---|
| 442 | inserted and removed while the kernel is running. |
|---|
| 443 | |
|---|
| 444 | You will also need the latest user-space utilties: you can find them |
|---|
| 445 | in the lm_sensors package, which you can download at |
|---|
| 446 | http://www.lm-sensors.nu |
|---|
| 447 | |
|---|
| 448 | National Semiconductor LM83 |
|---|
| 449 | CONFIG_SENSORS_LM83 |
|---|
| 450 | If you say yes here you get support for the National Semiconductor |
|---|
| 451 | LM83 sensor chip. This can also be built as a module. |
|---|
| 452 | |
|---|
| 453 | You will also need the latest user-space utilities: you can find |
|---|
| 454 | them in the lm_sensors package, which you can download at |
|---|
| 455 | http://www.lm-sensors.nu/ |
|---|
| 456 | |
|---|
| 457 | National Semiconductor LM85 |
|---|
| 458 | CONFIG_SENSORS_LM85 |
|---|
| 459 | If you say yes here you get support for National Semiconductor LM85 |
|---|
| 460 | sensor chips and compatibles. Compatible chips include the Analog |
|---|
| 461 | Devices ADM1027 and ADT7463 and SMSC EMC6D100 and EMC6D101. This |
|---|
| 462 | can also be built as a module which can be inserted and removed |
|---|
| 463 | while the kernel is running. |
|---|
| 464 | |
|---|
| 465 | You will also need the latest user-space utilties: you can find them |
|---|
| 466 | in the lm_sensors package, which you can download at |
|---|
| 467 | http://www.lm-sensors.nu |
|---|
| 468 | |
|---|
| 469 | National Semiconductor LM87 |
|---|
| 470 | CONFIG_SENSORS_LM87 |
|---|
| 471 | If you say yes here you get support for National Semiconductor LM87 |
|---|
| 472 | sensor chips. This can also be built as a module which can be |
|---|
| 473 | inserted and removed while the kernel is running. |
|---|
| 474 | |
|---|
| 475 | You will also need the latest user-space utilties: you can find them |
|---|
| 476 | in the lm_sensors package, which you can download at |
|---|
| 477 | http://www.lm-sensors.nu |
|---|
| 478 | |
|---|
| 479 | National Semiconductor LM90 |
|---|
| 480 | CONFIG_SENSORS_LM90 |
|---|
| 481 | If you say yes here you get support for the National Semiconductor |
|---|
| 482 | LM90 and Analog Devices ADM1032 sensor chips. This can also be |
|---|
| 483 | built as a module. |
|---|
| 484 | |
|---|
| 485 | You will also need the latest user-space utilities: you can find |
|---|
| 486 | them in the lm_sensors package, which you can download at |
|---|
| 487 | http://www.lm-sensors.nu/ |
|---|
| 488 | |
|---|
| 489 | National Semiconductor LM92 |
|---|
| 490 | CONFIG_SENSORS_LM92 |
|---|
| 491 | If you say yes here you get support for National Semiconductor LM92 |
|---|
| 492 | sensor chips. This can also be built as a module which can be |
|---|
| 493 | inserted and removed while the kernel is running. |
|---|
| 494 | |
|---|
| 495 | You will also need the latest user-space utilties: you can find them |
|---|
| 496 | in the lm_sensors package, which you can download at |
|---|
| 497 | http://www.lm-sensors.nu |
|---|
| 498 | |
|---|
| 499 | Philips PCF8574 |
|---|
| 500 | CONFIG_SENSORS_PCF8574 |
|---|
| 501 | If you say yes here you get support for the Philips PCF8574 |
|---|
| 502 | I2C 8-bit Parallel I/O device. |
|---|
| 503 | This can also be built as a module which can be |
|---|
| 504 | inserted and removed while the kernel is running. |
|---|
| 505 | |
|---|
| 506 | You will also need the latest user-space utilties: you can find them |
|---|
| 507 | in the lm_sensors package, which you can download at |
|---|
| 508 | http://www.lm-sensors.nu |
|---|
| 509 | |
|---|
| 510 | Philips PCF8591 |
|---|
| 511 | CONFIG_SENSORS_PCF8591 |
|---|
| 512 | If you say yes here you get support for the Philips PCF8591 |
|---|
| 513 | I2C Quad D/A + Single A/D I/O device. |
|---|
| 514 | This can also be built as a module which can be |
|---|
| 515 | inserted and removed while the kernel is running. |
|---|
| 516 | |
|---|
| 517 | You will also need the latest user-space utilties: you can find them |
|---|
| 518 | in the lm_sensors package, which you can download at |
|---|
| 519 | http://www.lm-sensors.nu |
|---|
| 520 | |
|---|
| 521 | Silicon Integrated Systems Corp. SiS5595 Sensor |
|---|
| 522 | CONFIG_SENSORS_SIS5595 |
|---|
| 523 | If you say yes here you get support for the integrated sensors in |
|---|
| 524 | SiS5595 South Bridges. This can also be built as a module |
|---|
| 525 | which can be inserted and removed while the kernel is running. |
|---|
| 526 | |
|---|
| 527 | You will also need the latest user-space utilties: you can find them |
|---|
| 528 | in the lm_sensors package, which you can download at |
|---|
| 529 | http://www.lm-sensors.nu |
|---|
| 530 | |
|---|
| 531 | SMSC47M1xx Super I/O Fan Support |
|---|
| 532 | CONFIG_SENSORS_SMSC47M1 |
|---|
| 533 | If you say yes here you get support for the integrated fan |
|---|
| 534 | monitoring and control in the SMSC 47M1xx Super I/O chips. |
|---|
| 535 | This can also be built as a module |
|---|
| 536 | which can be inserted and removed while the kernel is running. |
|---|
| 537 | |
|---|
| 538 | You will also need the latest user-space utilties: you can find them |
|---|
| 539 | in the lm_sensors package, which you can download at |
|---|
| 540 | http://www.lm-sensors.nu |
|---|
| 541 | |
|---|
| 542 | Texas Instruments THMC50 / Analog Devices ADM1022 |
|---|
| 543 | CONFIG_SENSORS_THMC50 |
|---|
| 544 | If you say yes here you get support for Texas Instruments THMC50 |
|---|
| 545 | sensor chips and clones: the Analog Devices ADM1022. |
|---|
| 546 | This can also be built as a module which |
|---|
| 547 | can be inserted and removed while the kernel is running. |
|---|
| 548 | |
|---|
| 549 | You will also need the latest user-space utilties: you can find them |
|---|
| 550 | in the lm_sensors package, which you can download at |
|---|
| 551 | http://www.lm-sensors.nu |
|---|
| 552 | |
|---|
| 553 | Via VT82C686A/B |
|---|
| 554 | CONFIG_SENSORS_VIA686A |
|---|
| 555 | If you say yes here you get support for the integrated sensors in |
|---|
| 556 | Via 686A/B South Bridges. This can also be built as a module |
|---|
| 557 | which can be inserted and removed while the kernel is running. |
|---|
| 558 | |
|---|
| 559 | You will also need the latest user-space utilties: you can find them |
|---|
| 560 | in the lm_sensors package, which you can download at |
|---|
| 561 | http://www.lm-sensors.nu |
|---|
| 562 | |
|---|
| 563 | Via VT1211 Sensors |
|---|
| 564 | CONFIG_SENSORS_VT1211 |
|---|
| 565 | If you say yes here you get support for the integrated sensors in |
|---|
| 566 | the Via VT1211 Super I/O device. This can also be built as a module |
|---|
| 567 | which can be inserted and removed while the kernel is running. |
|---|
| 568 | |
|---|
| 569 | You will also need the latest user-space utilties: you can find them |
|---|
| 570 | in the lm_sensors package, which you can download at |
|---|
| 571 | http://www.lm-sensors.nu |
|---|
| 572 | |
|---|
| 573 | Via VT8231 Sensors |
|---|
| 574 | CONFIG_SENSORS_VT8231 |
|---|
| 575 | If you say yes here you get support for the integrated sensors in |
|---|
| 576 | the Via VT8231 device. This can also be built as a module |
|---|
| 577 | which can be inserted and removed while the kernel is running. |
|---|
| 578 | |
|---|
| 579 | You will also need the latest user-space utilties: you can find them |
|---|
| 580 | in the lm_sensors package, which you can download at |
|---|
| 581 | http://www.lm-sensors.nu |
|---|
| 582 | |
|---|
| 583 | Winbond W83781D, W83782D, W83783S, W83627HF, AS99127F |
|---|
| 584 | CONFIG_SENSORS_W83781D |
|---|
| 585 | If you say yes here you get support for the Winbond W8378x series |
|---|
| 586 | of sensor chips: the W83781D, W83782D, W83783S and W83682HF, |
|---|
| 587 | and the similar Asus AS99127F. This |
|---|
| 588 | can also be built as a module which can be inserted and removed |
|---|
| 589 | while the kernel is running. |
|---|
| 590 | |
|---|
| 591 | You will also need the latest user-space utilties: you can find them |
|---|
| 592 | in the lm_sensors package, which you can download at |
|---|
| 593 | http://www.lm-sensors.nu |
|---|
| 594 | |
|---|
| 595 | Winbond W83L785TS-S |
|---|
| 596 | CONFIG_SENSORS_W83L785TS |
|---|
| 597 | If you say yes here you get support for the Winbond W83L785TS-S |
|---|
| 598 | sensor chip. This can also be built as a module. |
|---|
| 599 | |
|---|
| 600 | You will also need the latest user-space utilities: you can find |
|---|
| 601 | them in the lm_sensors package, which you can download at |
|---|
| 602 | http://www.lm-sensors.nu/ |
|---|
| 603 | |
|---|
| 604 | EEprom (DIMM) reader |
|---|
| 605 | CONFIG_SENSORS_EEPROM |
|---|
| 606 | If you say yes here you get read-only access to the EEPROM data |
|---|
| 607 | available on modern memory DIMMs, and which could theoretically |
|---|
| 608 | also be available on other devices. 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 utilties: you can find them |
|---|
| 613 | in the lm_sensors package, which you can download at |
|---|
| 614 | http://www.lm-sensors.nu |
|---|
| 615 | |
|---|
| 616 | EOF |
|---|
| 617 | } |
|---|
| 618 | print OUTPUT; |
|---|
| 619 | } |
|---|
| 620 | close INPUT; |
|---|
| 621 | close OUTPUT; |
|---|
| 622 | print_diff $package_root,$kernel_root,$kernel_file,$package_file; |
|---|
| 623 | } |
|---|
| 624 | |
|---|
| 625 | |
|---|
| 626 | # This generates diffs for the main Linux Makefile. |
|---|
| 627 | # Three lines which add drivers/sensors/sensors.a to the DRIVERS list are |
|---|
| 628 | # put just before the place where the architecture Makefile is included. |
|---|
| 629 | # Of course, care is taken old lines are removed. |
|---|
| 630 | # $_[0]: sensors package root (like /tmp/sensors) |
|---|
| 631 | # $_[1]: Linux kernel tree (like /usr/src/linux) |
|---|
| 632 | sub gen_Makefile |
|---|
| 633 | { |
|---|
| 634 | my ($package_root,$kernel_root) = @_; |
|---|
| 635 | my $kernel_file = "Makefile"; |
|---|
| 636 | my $package_file = $temp; |
|---|
| 637 | my $type = 0; |
|---|
| 638 | my $pr1 = 0; |
|---|
| 639 | |
|---|
| 640 | open INPUT,"$kernel_root/$kernel_file" |
|---|
| 641 | or die "Can't open `$kernel_root/$kernel_file'"; |
|---|
| 642 | open OUTPUT,">$package_root/$package_file" |
|---|
| 643 | or die "Can't open $package_root/$package_file"; |
|---|
| 644 | `grep -q -s 'i2c\.o' "$kernel_root/$kernel_file"`; |
|---|
| 645 | $type = 2 if ! $?; |
|---|
| 646 | MAIN: while(<INPUT>) { |
|---|
| 647 | $type = 1 if !$type and (m@^DRIVERS-\$@); |
|---|
| 648 | if (m@DRIVERS-\$\(CONFIG_SENSORS\)@) { |
|---|
| 649 | $_ = <INPUT>; |
|---|
| 650 | redo MAIN; |
|---|
| 651 | } elsif (m@CONFIG_SENSORS@) { |
|---|
| 652 | $_ = <INPUT> while not m@endif@; |
|---|
| 653 | $_ = <INPUT>; |
|---|
| 654 | $_ = <INPUT> if m@^$@; |
|---|
| 655 | redo MAIN; |
|---|
| 656 | } |
|---|
| 657 | if ($type == 1 and m@^DRIVERS \+= \$\(DRIVERS-y\)@) { |
|---|
| 658 | print OUTPUT <<'EOF'; |
|---|
| 659 | DRIVERS-$(CONFIG_SENSORS) += drivers/sensors/sensors.a |
|---|
| 660 | EOF |
|---|
| 661 | $pr1 = 1; |
|---|
| 662 | } |
|---|
| 663 | if ($type == 2 and m@^DRIVERS .*= \$\(DRIVERS-y\)@) { |
|---|
| 664 | print OUTPUT <<'EOF'; |
|---|
| 665 | DRIVERS-$(CONFIG_SENSORS) += drivers/sensors/sensor.o |
|---|
| 666 | EOF |
|---|
| 667 | $pr1 = 1; |
|---|
| 668 | } |
|---|
| 669 | if ($type == 0 and m@include arch/\$\(ARCH\)/Makefile@) { |
|---|
| 670 | print OUTPUT <<'EOF'; |
|---|
| 671 | ifeq ($(CONFIG_SENSORS),y) |
|---|
| 672 | DRIVERS := $(DRIVERS) drivers/sensors/sensors.a |
|---|
| 673 | endif |
|---|
| 674 | |
|---|
| 675 | EOF |
|---|
| 676 | $pr1 = 1; |
|---|
| 677 | } |
|---|
| 678 | print OUTPUT; |
|---|
| 679 | } |
|---|
| 680 | close INPUT; |
|---|
| 681 | close OUTPUT; |
|---|
| 682 | die "Automatic patch generation for main `Makefile' failed.\n". |
|---|
| 683 | "See our home page http://www.lm-sensors.nu for assistance!" if $pr1 == 0; |
|---|
| 684 | print_diff $package_root,$kernel_root,$kernel_file,$package_file; |
|---|
| 685 | } |
|---|
| 686 | |
|---|
| 687 | # This generates diffs for drivers/Makefile |
|---|
| 688 | # First, `sensors' is added to the ALL_SUB_DIRS list. Next, a couple of lines |
|---|
| 689 | # to add sensors to the SUB_DIRS and/or MOD_SUB_DIRS lists is put right before |
|---|
| 690 | # Rules.make is included. |
|---|
| 691 | # Of course, care is taken old lines are removed. |
|---|
| 692 | # $_[0]: sensors package root (like /tmp/sensors) |
|---|
| 693 | # $_[1]: Linux kernel tree (like /usr/src/linux) |
|---|
| 694 | sub gen_drivers_Makefile |
|---|
| 695 | { |
|---|
| 696 | my ($package_root,$kernel_root) = @_; |
|---|
| 697 | my $kernel_file = "drivers/Makefile"; |
|---|
| 698 | my $package_file = $temp; |
|---|
| 699 | my $sensors_present; |
|---|
| 700 | my $pr1 = 0; |
|---|
| 701 | my $pr2 = 0; |
|---|
| 702 | my $new_style = 0; |
|---|
| 703 | |
|---|
| 704 | open INPUT,"$kernel_root/$kernel_file" |
|---|
| 705 | or die "Can't open `$kernel_root/$kernel_file'"; |
|---|
| 706 | open OUTPUT,">$package_root/$package_file" |
|---|
| 707 | or die "Can't open $package_root/$package_file"; |
|---|
| 708 | MAIN: while(<INPUT>) { |
|---|
| 709 | if (m@^mod-subdirs\s*:=@) { |
|---|
| 710 | $new_style = 1; |
|---|
| 711 | } |
|---|
| 712 | if ((! $new_style and m@^ALL_SUB_DIRS\s*:=@) or m@^mod-subdirs\s*:=@) { |
|---|
| 713 | $pr1 = 1; |
|---|
| 714 | $sensors_present = 0; |
|---|
| 715 | while (m@\\$@) { |
|---|
| 716 | $sensors_present = 1 if m@sensors@; |
|---|
| 717 | print OUTPUT; |
|---|
| 718 | $_ = <INPUT>; |
|---|
| 719 | } |
|---|
| 720 | $sensors_present = 1 if m@sensors@; |
|---|
| 721 | s@$@ sensors@ if (not $sensors_present); |
|---|
| 722 | print OUTPUT; |
|---|
| 723 | $_ = <INPUT>; |
|---|
| 724 | redo MAIN; |
|---|
| 725 | } |
|---|
| 726 | if (m@^ifeq.*CONFIG_SENSORS@) { |
|---|
| 727 | $_ = <INPUT> while not m@^endif@; |
|---|
| 728 | $_ = <INPUT>; |
|---|
| 729 | $_ = <INPUT> if m@^$@; |
|---|
| 730 | redo MAIN; |
|---|
| 731 | } |
|---|
| 732 | if (m@^subdir.*CONFIG_SENSORS@) { |
|---|
| 733 | $_ = <INPUT>; |
|---|
| 734 | redo MAIN; |
|---|
| 735 | } |
|---|
| 736 | if (!$pr2 and (m@^include \$\(TOPDIR\)/Rules.make$@ or m@^subdir-\$\(CONFIG_ACPI@)) { |
|---|
| 737 | $pr2 = 1; |
|---|
| 738 | if ($new_style) { |
|---|
| 739 | print OUTPUT <<'EOF'; |
|---|
| 740 | subdir-$(CONFIG_SENSORS) += sensors |
|---|
| 741 | EOF |
|---|
| 742 | } else { |
|---|
| 743 | print OUTPUT <<'EOF'; |
|---|
| 744 | ifeq ($(CONFIG_SENSORS),y) |
|---|
| 745 | SUB_DIRS += sensors |
|---|
| 746 | MOD_SUB_DIRS += sensors |
|---|
| 747 | else |
|---|
| 748 | ifeq ($(CONFIG_SENSORS),m) |
|---|
| 749 | MOD_SUB_DIRS += sensors |
|---|
| 750 | endif |
|---|
| 751 | endif |
|---|
| 752 | |
|---|
| 753 | EOF |
|---|
| 754 | } |
|---|
| 755 | } |
|---|
| 756 | print OUTPUT; |
|---|
| 757 | } |
|---|
| 758 | close INPUT; |
|---|
| 759 | close OUTPUT; |
|---|
| 760 | die "Automatic patch generation for `drivers/Makefile' failed.\n". |
|---|
| 761 | "See our home page http://www.lm-sensors.nu for assistance!" if $pr1 == 0 or $pr2 == 0; |
|---|
| 762 | print_diff $package_root,$kernel_root,$kernel_file,$package_file; |
|---|
| 763 | } |
|---|
| 764 | |
|---|
| 765 | # This generates diffs for drivers/char/Config.in |
|---|
| 766 | # It adds a line just before CONFIG_APM or main_menu_option lines to include |
|---|
| 767 | # the sensors Config.in. |
|---|
| 768 | # Of course, care is taken old lines are removed. |
|---|
| 769 | # $_[0]: sensors package root (like /tmp/sensors) |
|---|
| 770 | # $_[1]: Linux kernel tree (like /usr/src/linux) |
|---|
| 771 | sub gen_drivers_char_Config_in |
|---|
| 772 | { |
|---|
| 773 | my ($package_root,$kernel_root) = @_; |
|---|
| 774 | my $kernel_file = "drivers/char/Config.in"; |
|---|
| 775 | my $package_file = $temp; |
|---|
| 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 | MAIN: while(<INPUT>) { |
|---|
| 783 | if (m@source drivers/i2c/Config.in@) { |
|---|
| 784 | $pr1 = 1; |
|---|
| 785 | print OUTPUT; |
|---|
| 786 | print OUTPUT "\nsource drivers/sensors/Config.in\n"; |
|---|
| 787 | $_ = <INPUT>; |
|---|
| 788 | redo MAIN; |
|---|
| 789 | } |
|---|
| 790 | if (m@sensors@) { |
|---|
| 791 | $_ = <INPUT>; |
|---|
| 792 | $_ = <INPUT> if m@^$@; |
|---|
| 793 | redo MAIN; |
|---|
| 794 | } |
|---|
| 795 | print OUTPUT; |
|---|
| 796 | } |
|---|
| 797 | close INPUT; |
|---|
| 798 | close OUTPUT; |
|---|
| 799 | die "Automatic patch generation for `drivers/char/Config.in' failed.\n". |
|---|
| 800 | "See our home page http://www.lm-sensors.nu for assistance!" if $pr1 == 0; |
|---|
| 801 | print_diff $package_root,$kernel_root,$kernel_file,$package_file; |
|---|
| 802 | } |
|---|
| 803 | |
|---|
| 804 | # This generates diffs for drivers/i2c/Config.in |
|---|
| 805 | # Several adapter drivers that are included in the lm_sensors package are |
|---|
| 806 | # added at the first and onlu sensors marker. |
|---|
| 807 | # Of course, care is taken old lines are removed. |
|---|
| 808 | # $_[0]: sensors package root (like /tmp/sensors) |
|---|
| 809 | # $_[1]: Linux kernel tree (like /usr/src/linux) |
|---|
| 810 | sub gen_drivers_i2c_Config_in |
|---|
| 811 | { |
|---|
| 812 | my ($package_root,$kernel_root) = @_; |
|---|
| 813 | my $kernel_file = "drivers/i2c/Config.in"; |
|---|
| 814 | my $package_file = "$temp"; |
|---|
| 815 | my $pr1 = 0; |
|---|
| 816 | |
|---|
| 817 | open INPUT,"$kernel_root/$kernel_file" |
|---|
| 818 | or die "Can't open `$kernel_root/$kernel_file'"; |
|---|
| 819 | open OUTPUT,">$package_root/$package_file" |
|---|
| 820 | or die "Can't open $package_root/$package_file"; |
|---|
| 821 | while(<INPUT>) { |
|---|
| 822 | if (m@sensors code starts here@) { |
|---|
| 823 | $pr1++; |
|---|
| 824 | print OUTPUT; |
|---|
| 825 | while (<INPUT>) { |
|---|
| 826 | last if m@sensors code ends here@; |
|---|
| 827 | } |
|---|
| 828 | print OUTPUT << 'EOF'; |
|---|
| 829 | bool 'I2C mainboard interfaces' CONFIG_I2C_MAINBOARD |
|---|
| 830 | if [ "$CONFIG_I2C_MAINBOARD" = "y" ]; then |
|---|
| 831 | dep_tristate ' Acer Labs ALI 1535' CONFIG_I2C_ALI1535 $CONFIG_I2C |
|---|
| 832 | dep_tristate ' Acer Labs ALI 1533 and 1543C' CONFIG_I2C_ALI15X3 $CONFIG_I2C |
|---|
| 833 | dep_tristate ' Apple Hydra Mac I/O' CONFIG_I2C_HYDRA $CONFIG_I2C_ALGOBIT |
|---|
| 834 | dep_tristate ' AMD 756/766/768/8111' CONFIG_I2C_AMD756 $CONFIG_I2C |
|---|
| 835 | dep_tristate ' AMD 8111 SMBus 2.0' CONFIG_I2C_AMD8111 $CONFIG_I2C |
|---|
| 836 | if [ "$CONFIG_ALPHA" = "y" ]; then |
|---|
| 837 | dep_tristate ' DEC Tsunami I2C interface' CONFIG_I2C_TSUNAMI $CONFIG_I2C_ALGOBIT |
|---|
| 838 | fi |
|---|
| 839 | dep_tristate ' Intel 82801AA, AB, BA, DB' CONFIG_I2C_I801 $CONFIG_I2C |
|---|
| 840 | dep_tristate ' Intel i810AA/AB/E and i815' CONFIG_I2C_I810 $CONFIG_I2C_ALGOBIT |
|---|
| 841 | dep_tristate ' Intel 82371AB PIIX4(E), 443MX, ServerWorks OSB4/CSB5, SMSC Victory66' CONFIG_I2C_PIIX4 $CONFIG_I2C |
|---|
| 842 | dep_tristate ' SiS 5595' CONFIG_I2C_SIS5595 $CONFIG_I2C |
|---|
| 843 | dep_tristate ' SiS 630/730' CONFIG_I2C_SIS630 $CONFIG_I2C |
|---|
| 844 | dep_tristate ' SiS 645/961,645DX/961,735' CONFIG_I2C_SIS645 $CONFIG_I2C $CONFIG_HOTPLUG |
|---|
| 845 | dep_tristate ' Savage 4' CONFIG_I2C_SAVAGE4 $CONFIG_I2C_ALGOBIT |
|---|
| 846 | dep_tristate ' VIA Technologies, Inc. VT82C586B' CONFIG_I2C_VIA $CONFIG_I2C_ALGOBIT |
|---|
| 847 | dep_tristate ' VIA Technologies, Inc. VT596A/B, 686A/B, 8231, 8233, 8233A, 8235' CONFIG_I2C_VIAPRO $CONFIG_I2C |
|---|
| 848 | dep_tristate ' Voodoo3 I2C interface' CONFIG_I2C_VOODOO3 $CONFIG_I2C_ALGOBIT |
|---|
| 849 | dep_tristate ' Pseudo ISA adapter (for some hardware sensors)' CONFIG_I2C_ISA $CONFIG_I2C |
|---|
| 850 | fi |
|---|
| 851 | |
|---|
| 852 | EOF |
|---|
| 853 | } |
|---|
| 854 | print OUTPUT; |
|---|
| 855 | } |
|---|
| 856 | close INPUT; |
|---|
| 857 | close OUTPUT; |
|---|
| 858 | die "Automatic patch generation for `drivers/i2c/Config.in' failed.\n". |
|---|
| 859 | "See our home page http://www.lm-sensors.nu for assistance!" if $pr1 != 1; |
|---|
| 860 | print_diff $package_root,$kernel_root,$kernel_file,$package_file; |
|---|
| 861 | } |
|---|
| 862 | |
|---|
| 863 | sub gen_drivers_sensors_Makefile |
|---|
| 864 | { |
|---|
| 865 | my ($package_root,$kernel_root) = @_; |
|---|
| 866 | my $kernel_file = "drivers/sensors/Makefile"; |
|---|
| 867 | my $package_file = $temp; |
|---|
| 868 | |
|---|
| 869 | open OUTPUT,">$package_root/$package_file" |
|---|
| 870 | or die "Can't open $package_root/$package_file"; |
|---|
| 871 | print OUTPUT <<'EOF'; |
|---|
| 872 | # |
|---|
| 873 | # Makefile for the kernel hardware sensors drivers. |
|---|
| 874 | # |
|---|
| 875 | |
|---|
| 876 | MOD_LIST_NAME := SENSORS_MODULES |
|---|
| 877 | O_TARGET := sensor.o |
|---|
| 878 | |
|---|
| 879 | obj-$(CONFIG_SENSORS_ADM1021) += adm1021.o |
|---|
| 880 | obj-$(CONFIG_SENSORS_ADM1024) += adm1024.o |
|---|
| 881 | obj-$(CONFIG_SENSORS_ADM1025) += adm1025.o |
|---|
| 882 | obj-$(CONFIG_SENSORS_ADM1026) += adm1026.o |
|---|
| 883 | obj-$(CONFIG_SENSORS_ADM9240) += adm9240.o |
|---|
| 884 | obj-$(CONFIG_SENSORS_ASB100) += asb100.o |
|---|
| 885 | obj-$(CONFIG_SENSORS_BT869) += bt869.o |
|---|
| 886 | obj-$(CONFIG_SENSORS_DDCMON) += ddcmon.o |
|---|
| 887 | obj-$(CONFIG_SENSORS_DS1621) += ds1621.o |
|---|
| 888 | obj-$(CONFIG_SENSORS_EEPROM) += eeprom.o |
|---|
| 889 | obj-$(CONFIG_SENSORS_FSCPOS) += fscpos.o |
|---|
| 890 | obj-$(CONFIG_SENSORS_FSCSCY) += fscscy.o |
|---|
| 891 | obj-$(CONFIG_SENSORS_GL518SM) += gl518sm.o |
|---|
| 892 | obj-$(CONFIG_SENSORS_GL520SM) += gl520sm.o |
|---|
| 893 | obj-$(CONFIG_SENSORS_IT87) += it87.o |
|---|
| 894 | obj-$(CONFIG_SENSORS_LM75) += lm75.o |
|---|
| 895 | obj-$(CONFIG_SENSORS_LM78) += lm78.o |
|---|
| 896 | obj-$(CONFIG_SENSORS_LM80) += lm80.o |
|---|
| 897 | obj-$(CONFIG_SENSORS_LM83) += lm83.o |
|---|
| 898 | obj-$(CONFIG_SENSORS_LM85) += lm85.o |
|---|
| 899 | obj-$(CONFIG_SENSORS_LM87) += lm87.o |
|---|
| 900 | obj-$(CONFIG_SENSORS_LM90) += lm90.o |
|---|
| 901 | obj-$(CONFIG_SENSORS_LM92) += lm92.o |
|---|
| 902 | obj-$(CONFIG_SENSORS_MAX6650) += max6650.o |
|---|
| 903 | obj-$(CONFIG_SENSORS_MAXILIFE) += maxilife.o |
|---|
| 904 | obj-$(CONFIG_SENSORS_MTP008) += mtp008.o |
|---|
| 905 | obj-$(CONFIG_SENSORS_PCF8574) += pcf8574.o |
|---|
| 906 | obj-$(CONFIG_SENSORS_PCF8591) += pcf8591.o |
|---|
| 907 | obj-$(CONFIG_SENSORS_SIS5595) += sis5595.o |
|---|
| 908 | obj-$(CONFIG_SENSORS_SMSC47M1) += smsc47m1.o |
|---|
| 909 | obj-$(CONFIG_SENSORS_THMC50) += thmc50.o |
|---|
| 910 | obj-$(CONFIG_SENSORS_VIA686A) += via686a.o |
|---|
| 911 | obj-$(CONFIG_SENSORS_VT1211) += vt1211.o |
|---|
| 912 | obj-$(CONFIG_SENSORS_VT8231) += vt8231.o |
|---|
| 913 | obj-$(CONFIG_SENSORS_W83781D) += w83781d.o |
|---|
| 914 | obj-$(CONFIG_SENSORS_W83L785TS) += w83l785ts.o |
|---|
| 915 | |
|---|
| 916 | include $(TOPDIR)/Rules.make |
|---|
| 917 | |
|---|
| 918 | EOF |
|---|
| 919 | close OUTPUT; |
|---|
| 920 | print_diff $package_root,$kernel_root,$kernel_file,$package_file; |
|---|
| 921 | } |
|---|
| 922 | |
|---|
| 923 | # This generates diffs for drivers/i2c/Makefile. |
|---|
| 924 | # Lines to add correct files to M_OBJS and/or L_OBJS are added just before |
|---|
| 925 | # Rules.make is included |
|---|
| 926 | # Of course, care is taken old lines are removed. |
|---|
| 927 | # $_[0]: sensors package root (like /tmp/sensors) |
|---|
| 928 | # $_[1]: Linux kernel tree (like /usr/src/linux) |
|---|
| 929 | sub gen_drivers_i2c_Makefile |
|---|
| 930 | { |
|---|
| 931 | my ($package_root,$kernel_root) = @_; |
|---|
| 932 | my $kernel_file = "drivers/i2c/Makefile"; |
|---|
| 933 | my $package_file = $temp; |
|---|
| 934 | my $pr1 = 0; |
|---|
| 935 | |
|---|
| 936 | open INPUT,"$kernel_root/$kernel_file" |
|---|
| 937 | or die "Can't open `$kernel_root/$kernel_file'"; |
|---|
| 938 | open OUTPUT,">$package_root/$package_file" |
|---|
| 939 | or die "Can't open $package_root/$package_file"; |
|---|
| 940 | while(<INPUT>) { |
|---|
| 941 | if (m@sensors code starts here@) { |
|---|
| 942 | $pr1 ++; |
|---|
| 943 | print OUTPUT; |
|---|
| 944 | while (<INPUT>) { |
|---|
| 945 | last if m@sensors code ends here@; |
|---|
| 946 | } |
|---|
| 947 | print OUTPUT <<'EOF'; |
|---|
| 948 | obj-$(CONFIG_I2C_ALI1535) += i2c-ali1535.o |
|---|
| 949 | obj-$(CONFIG_I2C_ALI15X3) += i2c-ali15x3.o |
|---|
| 950 | obj-$(CONFIG_I2C_AMD756) += i2c-amd756.o |
|---|
| 951 | obj-$(CONFIG_I2C_AMD8111) += i2c-amd8111.o |
|---|
| 952 | obj-$(CONFIG_I2C_HYDRA) += i2c-hydra.o |
|---|
| 953 | obj-$(CONFIG_I2C_I801) += i2c-i801.o |
|---|
| 954 | obj-$(CONFIG_I2C_I810) += i2c-i810.o |
|---|
| 955 | obj-$(CONFIG_I2C_ISA) += i2c-isa.o |
|---|
| 956 | obj-$(CONFIG_I2C_PIIX4) += i2c-piix4.o dmi_scan.o |
|---|
| 957 | obj-$(CONFIG_I2C_SIS5595) += i2c-sis5595.o |
|---|
| 958 | obj-$(CONFIG_I2C_SIS630) += i2c-sis630.o |
|---|
| 959 | obj-$(CONFIG_I2C_SIS645) += i2c-sis645.o |
|---|
| 960 | obj-$(CONFIG_I2C_SAVAGE4) += i2c-savage4.o |
|---|
| 961 | obj-$(CONFIG_I2C_TSUNAMI) += i2c-tsunami.o |
|---|
| 962 | obj-$(CONFIG_I2C_VIA) += i2c-via.o |
|---|
| 963 | obj-$(CONFIG_I2C_VIAPRO) += i2c-viapro.o |
|---|
| 964 | obj-$(CONFIG_I2C_VOODOO3) += i2c-voodoo3.o |
|---|
| 965 | export-objs += dmi_scan.o |
|---|
| 966 | EOF |
|---|
| 967 | } |
|---|
| 968 | print OUTPUT; |
|---|
| 969 | } |
|---|
| 970 | close INPUT; |
|---|
| 971 | close OUTPUT; |
|---|
| 972 | die "Automatic patch generation for `drivers/i2c/Makefile' failed.\n". |
|---|
| 973 | "See our home page http://www.lm-sensors.nu for assistance!" if $pr1 != 1; |
|---|
| 974 | print_diff $package_root,$kernel_root,$kernel_file,$package_file; |
|---|
| 975 | } |
|---|
| 976 | |
|---|
| 977 | # Generate the diffs for the list of MAINTAINERS |
|---|
| 978 | # $_[0]: i2c package root (like /tmp/i2c) |
|---|
| 979 | # $_[1]: Linux kernel tree (like /usr/src/linux) |
|---|
| 980 | sub gen_MAINTAINERS |
|---|
| 981 | { |
|---|
| 982 | my ($package_root,$kernel_root) = @_; |
|---|
| 983 | my $kernel_file = "MAINTAINERS"; |
|---|
| 984 | my $package_file = $temp; |
|---|
| 985 | my $done = 0; |
|---|
| 986 | |
|---|
| 987 | open INPUT,"$kernel_root/$kernel_file" |
|---|
| 988 | or die "Can't open `$kernel_root/$kernel_file'"; |
|---|
| 989 | open OUTPUT,">$package_root/$package_file" |
|---|
| 990 | or die "Can't open $package_root/$package_file"; |
|---|
| 991 | MAIN: while(<INPUT>) { |
|---|
| 992 | if (m@SENSORS DRIVERS@) { |
|---|
| 993 | $_=<INPUT> while not m@^$@; |
|---|
| 994 | $_=<INPUT>; |
|---|
| 995 | redo MAIN; |
|---|
| 996 | } |
|---|
| 997 | if (not $done and (m@SGI VISUAL WORKSTATION 320 AND 540@)) { |
|---|
| 998 | print OUTPUT <<'EOF'; |
|---|
| 999 | SENSORS DRIVERS |
|---|
| 1000 | P: Frodo Looijaard |
|---|
| 1001 | M: frodol@dds.nl |
|---|
| 1002 | P: Philip Edelbrock |
|---|
| 1003 | M: phil@netroedge.com |
|---|
| 1004 | L: sensors@stimpy.netroedge.com |
|---|
| 1005 | W: http://www.lm-sensors.nu/ |
|---|
| 1006 | S: Maintained |
|---|
| 1007 | |
|---|
| 1008 | EOF |
|---|
| 1009 | $done = 1; |
|---|
| 1010 | } |
|---|
| 1011 | print OUTPUT; |
|---|
| 1012 | } |
|---|
| 1013 | close INPUT; |
|---|
| 1014 | close OUTPUT; |
|---|
| 1015 | die "Automatic patch generation for `MAINTAINERS' failed.\n". |
|---|
| 1016 | "See our home page http://www.lm-sensors.nu for assistance!" if $done == 0; |
|---|
| 1017 | print_diff $package_root,$kernel_root,$kernel_file,$package_file; |
|---|
| 1018 | } |
|---|
| 1019 | |
|---|
| 1020 | |
|---|
| 1021 | # Main function |
|---|
| 1022 | sub main |
|---|
| 1023 | { |
|---|
| 1024 | my ($package_root,$kernel_root,%files,%includes,$package_file,$kernel_file); |
|---|
| 1025 | my ($diff_command,$dummy,$data0,$data1,$sedscript,$version_string); |
|---|
| 1026 | |
|---|
| 1027 | # --> Read the command-lineo |
|---|
| 1028 | $package_root = $ARGV[0]; |
|---|
| 1029 | die "Package root `$package_root' is not found\n" |
|---|
| 1030 | unless -d "$package_root/mkpatch"; |
|---|
| 1031 | $kernel_root = $ARGV[1]; |
|---|
| 1032 | die "Kernel root `$kernel_root' is not found\n" |
|---|
| 1033 | unless -f "$kernel_root/Rules.make"; |
|---|
| 1034 | |
|---|
| 1035 | # --> Read FILES |
|---|
| 1036 | open INPUT, "$package_root/mkpatch/FILES" |
|---|
| 1037 | or die "Can't open `$package_root/mkpatch/FILES'"; |
|---|
| 1038 | while (<INPUT>) { |
|---|
| 1039 | ($data0,$data1) = /(\S+)\s+(\S+)/; |
|---|
| 1040 | $files{$data0} = $data1; |
|---|
| 1041 | } |
|---|
| 1042 | close INPUT; |
|---|
| 1043 | |
|---|
| 1044 | # --> Read INCLUDES |
|---|
| 1045 | open INPUT, "$package_root/mkpatch/INCLUDES" |
|---|
| 1046 | or die "Can't open `$package_root/mkpatch/INCLUDES'"; |
|---|
| 1047 | while (<INPUT>) { |
|---|
| 1048 | ($data0,$data1) = /(\S+)\s+(\S+)/; |
|---|
| 1049 | $includes{$data0} = $data1; |
|---|
| 1050 | $sedscript .= 's,(#\s*include\s*)'.$data0.'(\s*),\1'."$data1".'\2, ; '; |
|---|
| 1051 | } |
|---|
| 1052 | close INPUT; |
|---|
| 1053 | |
|---|
| 1054 | die "First apply the i2c patches to `$kernel_root'!" |
|---|
| 1055 | if ! -d "$kernel_root/drivers/i2c"; |
|---|
| 1056 | |
|---|
| 1057 | # --> Read "version.h" |
|---|
| 1058 | open INPUT, "$package_root/version.h" |
|---|
| 1059 | or die "Can't open `$package_root/version.h'"; |
|---|
| 1060 | $version_string .= $_ while <INPUT>; |
|---|
| 1061 | close INPUT; |
|---|
| 1062 | |
|---|
| 1063 | # --> Start generating |
|---|
| 1064 | foreach $package_file (sort keys %files) { |
|---|
| 1065 | open INPUT,"$package_root/$package_file" |
|---|
| 1066 | or die "Can't open `$package_root/$package_file'"; |
|---|
| 1067 | open OUTPUT,">$package_root/$temp" |
|---|
| 1068 | or die "Can't open `$package_root/$temp'"; |
|---|
| 1069 | while (<INPUT>) { |
|---|
| 1070 | eval $sedscript; |
|---|
| 1071 | if (m@#\s*include\s*"version.h"@) { |
|---|
| 1072 | print OUTPUT $version_string; |
|---|
| 1073 | } else { |
|---|
| 1074 | print OUTPUT; |
|---|
| 1075 | } |
|---|
| 1076 | } |
|---|
| 1077 | close INPUT; |
|---|
| 1078 | close OUTPUT; |
|---|
| 1079 | |
|---|
| 1080 | $kernel_file = $files{$package_file}; |
|---|
| 1081 | print_diff $package_root,$kernel_root,$kernel_file,$temp; |
|---|
| 1082 | } |
|---|
| 1083 | |
|---|
| 1084 | gen_Makefile $package_root, $kernel_root; |
|---|
| 1085 | gen_drivers_Makefile $package_root, $kernel_root; |
|---|
| 1086 | gen_drivers_sensors_Makefile $package_root, $kernel_root; |
|---|
| 1087 | gen_drivers_char_Config_in $package_root, $kernel_root; |
|---|
| 1088 | gen_drivers_i2c_Config_in $package_root, $kernel_root; |
|---|
| 1089 | gen_drivers_i2c_Makefile $package_root, $kernel_root; |
|---|
| 1090 | gen_Documentation_Configure_help $package_root, $kernel_root; |
|---|
| 1091 | gen_MAINTAINERS $package_root, $kernel_root; |
|---|
| 1092 | } |
|---|
| 1093 | |
|---|
| 1094 | main; |
|---|
| 1095 | |
|---|