diff --git a/[refs] b/[refs] index 5bb8ddd4f39a..33ceb4a30692 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: fc58fb180755cdeda3ce58776eef94a01b37a1c1 +refs/heads/master: 60641aa1f379820e99ac7f45a38b43795670c741 diff --git a/trunk/Documentation/hwmon/emc2103 b/trunk/Documentation/hwmon/emc2103 deleted file mode 100644 index a12b2c127140..000000000000 --- a/trunk/Documentation/hwmon/emc2103 +++ /dev/null @@ -1,33 +0,0 @@ -Kernel driver emc2103 -====================== - -Supported chips: - * SMSC EMC2103 - Addresses scanned: I2C 0x2e - Prefix: 'emc2103' - Datasheet: Not public - -Authors: - Steve Glendinning - -Description ------------ - -The Standard Microsystems Corporation (SMSC) EMC2103 chips -contain up to 4 temperature sensors and a single fan controller. - -Fan rotation speeds are reported in RPM (rotations per minute). An alarm is -triggered if the rotation speed has dropped below a programmable limit. Fan -readings can be divided by a programmable divider (1, 2, 4 or 8) to give -the readings more range or accuracy. Not all RPM values can accurately be -represented, so some rounding is done. With a divider of 1, the lowest -representable value is 480 RPM. - -This driver supports RPM based control, to use this a fan target -should be written to fan1_target and pwm1_enable should be set to 3. - -The 2103-2 and 2103-4 variants have a third temperature sensor, which can -be connected to two anti-parallel diodes. These values can be read -as temp3 and temp4. If only one diode is attached to this channel, temp4 -will show as "fault". The module parameter "apd=0" can be used to suppress -this 4th channel when anti-parallel diodes are not fitted. diff --git a/trunk/Documentation/hwmon/ltc4245 b/trunk/Documentation/hwmon/ltc4245 index b478b0864965..86b5880d8502 100644 --- a/trunk/Documentation/hwmon/ltc4245 +++ b/trunk/Documentation/hwmon/ltc4245 @@ -72,31 +72,9 @@ in6_min_alarm 5v output undervoltage alarm in7_min_alarm 3v output undervoltage alarm in8_min_alarm Vee (-12v) output undervoltage alarm -in9_input GPIO voltage data (see note 1) -in10_input GPIO voltage data (see note 1) -in11_input GPIO voltage data (see note 1) +in9_input GPIO voltage data power1_input 12v power usage (mW) power2_input 5v power usage (mW) power3_input 3v power usage (mW) power4_input Vee (-12v) power usage (mW) - - -Note 1 ------- - -If you have NOT configured the driver to sample all GPIO pins as analog -voltages, then the in10_input and in11_input sysfs attributes will not be -created. The driver will sample the GPIO pin that is currently connected to the -ADC as an analog voltage, and report the value in in9_input. - -If you have configured the driver to sample all GPIO pins as analog voltages, -then they will be sampled in round-robin fashion. If userspace reads too -slowly, -EAGAIN will be returned when you read the sysfs attribute containing -the sensor reading. - -The LTC4245 chip can be configured to sample all GPIO pins with two methods: -1) platform data -- see include/linux/i2c/ltc4245.h -2) OF device tree -- add the "ltc4245,use-extra-gpios" property to each chip - -The default mode of operation is to sample a single GPIO pin. diff --git a/trunk/Documentation/hwmon/pc87427 b/trunk/Documentation/hwmon/pc87427 index 8fdd08c9e48b..db5cc1227a83 100644 --- a/trunk/Documentation/hwmon/pc87427 +++ b/trunk/Documentation/hwmon/pc87427 @@ -18,11 +18,10 @@ Description The National Semiconductor Super I/O chip includes complete hardware monitoring capabilities. It can monitor up to 18 voltages, 8 fans and -6 temperature sensors. Only the fans and temperatures are supported at -the moment, voltages aren't. +6 temperature sensors. Only the fans are supported at the moment. -This chip also has fan controlling features (up to 4 PWM outputs), -which are partly supported by this driver. +This chip also has fan controlling features, which are not yet supported +by this driver either. The driver assumes that no more than one chip is present, which seems reasonable. @@ -37,23 +36,3 @@ signal. Speeds down to 83 RPM can be measured. An alarm is triggered if the rotation speed drops below a programmable limit. Another alarm is triggered if the speed is too low to be measured (including stalled or missing fan). - - -Fan Speed Control ------------------ - -Fan speed can be controlled by PWM outputs. There are 4 possible modes: -always off, always on, manual and automatic. The latter isn't supported -by the driver: you can only return to that mode if it was the original -setting, and the configuration interface is missing. - - -Temperature Monitoring ----------------------- - -The PC87427 relies on external sensors (following the SensorPath -standard), so the resolution and range depend on the type of sensor -connected. The integer part can be 8-bit or 9-bit, and can be signed or -not. I couldn't find a way to figure out the external sensor data -temperature format, so user-space adjustment (typically by a factor 2) -may be required. diff --git a/trunk/Documentation/hwmon/sysfs-interface b/trunk/Documentation/hwmon/sysfs-interface index ff45d1f837c8..d4e2917c6f18 100644 --- a/trunk/Documentation/hwmon/sysfs-interface +++ b/trunk/Documentation/hwmon/sysfs-interface @@ -107,24 +107,10 @@ in[0-*]_min Voltage min value. Unit: millivolt RW -in[0-*]_lcrit Voltage critical min value. - Unit: millivolt - RW - If voltage drops to or below this limit, the system may - take drastic action such as power down or reset. At the very - least, it should report a fault. - in[0-*]_max Voltage max value. Unit: millivolt RW -in[0-*]_crit Voltage critical max value. - Unit: millivolt - RW - If voltage reaches or exceeds this limit, the system may - take drastic action such as power down or reset. At the very - least, it should report a fault. - in[0-*]_input Voltage input value. Unit: millivolt RO @@ -298,7 +284,7 @@ temp[1-*]_input Temperature input value. Unit: millidegree Celsius RO -temp[1-*]_crit Temperature critical max value, typically greater than +temp[1-*]_crit Temperature critical value, typically greater than corresponding temp_max values. Unit: millidegree Celsius RW @@ -310,11 +296,6 @@ temp[1-*]_crit_hyst from the critical value. RW -temp[1-*]_lcrit Temperature critical min value, typically lower than - corresponding temp_min values. - Unit: millidegree Celsius - RW - temp[1-*]_offset Temperature offset which is added to the temperature reading by the chip. @@ -363,6 +344,9 @@ Also see the Alarms section for status flags associated with temperatures. * Currents * ************ +Note that no known chip provides current measurements as of writing, +so this part is theoretical, so to say. + curr[1-*]_max Current max value Unit: milliampere RW @@ -487,7 +471,6 @@ limit-related alarms, not both. The driver should just reflect the hardware implementation. in[0-*]_alarm -curr[1-*]_alarm fan[1-*]_alarm temp[1-*]_alarm Channel alarm @@ -499,8 +482,6 @@ OR in[0-*]_min_alarm in[0-*]_max_alarm -curr[1-*]_min_alarm -curr[1-*]_max_alarm fan[1-*]_min_alarm fan[1-*]_max_alarm temp[1-*]_min_alarm @@ -516,6 +497,7 @@ to notify open diodes, unconnected fans etc. where the hardware supports it. When this boolean has value 1, the measurement for that channel should not be trusted. +in[0-*]_fault fan[1-*]_fault temp[1-*]_fault Input fault condition @@ -531,7 +513,6 @@ beep_enable Master beep enable RW in[0-*]_beep -curr[1-*]_beep fan[1-*]_beep temp[1-*]_beep Channel beep diff --git a/trunk/Documentation/hwmon/w83627ehf b/trunk/Documentation/hwmon/w83627ehf index 13d556112fc0..b7e42ec4b26b 100644 --- a/trunk/Documentation/hwmon/w83627ehf +++ b/trunk/Documentation/hwmon/w83627ehf @@ -20,10 +20,6 @@ Supported chips: Prefix: 'w83667hg' Addresses scanned: ISA address retrieved from Super I/O registers Datasheet: not available - * Winbond W83667HG-B - Prefix: 'w83667hg' - Addresses scanned: ISA address retrieved from Super I/O registers - Datasheet: Available from Nuvoton upon request Authors: Jean Delvare @@ -36,8 +32,8 @@ Description ----------- This driver implements support for the Winbond W83627EHF, W83627EHG, -W83627DHG, W83627DHG-P, W83667HG and W83667HG-B super I/O chips. -We will refer to them collectively as Winbond chips. +W83627DHG, W83627DHG-P and W83667HG super I/O chips. We will refer to them +collectively as Winbond chips. The chips implement three temperature sensors, five fan rotation speed sensors, ten analog voltage sensors (only nine for the 627DHG), one @@ -72,15 +68,14 @@ follows: temp1 -> pwm1 temp2 -> pwm2 temp3 -> pwm3 -prog -> pwm4 (not on 667HG and 667HG-B; the programmable setting is not - supported by the driver) +prog -> pwm4 (not on 667HG; the programmable setting is not supported by + the driver) /sys files ---------- name - this is a standard hwmon device entry. For the W83627EHF and W83627EHG, - it is set to "w83627ehf", for the W83627DHG it is set to "w83627dhg", - and for the W83667HG it is set to "w83667hg". + it is set to "w83627ehf" and for the W83627DHG it is set to "w83627dhg" pwm[1-4] - this file stores PWM duty cycle or DC value (fan speed) in range: 0 (stop) to 255 (full) diff --git a/trunk/Documentation/kernel-parameters.txt b/trunk/Documentation/kernel-parameters.txt index 4956686f99bf..873b68090098 100644 --- a/trunk/Documentation/kernel-parameters.txt +++ b/trunk/Documentation/kernel-parameters.txt @@ -88,8 +88,8 @@ parameter is applicable: RAM RAM disk support is enabled. S390 S390 architecture is enabled. SCSI Appropriate SCSI support is enabled. - A lot of drivers have their options described inside - the Documentation/scsi/ sub-directory. + A lot of drivers has their options described inside of + Documentation/scsi/. SECURITY Different security models are enabled. SELINUX SELinux support is enabled. APPARMOR AppArmor support is enabled. @@ -284,12 +284,27 @@ and is between 256 and 4096 characters. It is defined in the file add_efi_memmap [EFI; X86] Include EFI memory map in kernel's map of available physical RAM. + advansys= [HW,SCSI] + See header of drivers/scsi/advansys.c. + agp= [AGP] { off | try_unsupported } off: disable AGP support try_unsupported: try to drive unsupported chipsets (may crash computer or cause data corruption) + aha152x= [HW,SCSI] + See Documentation/scsi/aha152x.txt. + + aha1542= [HW,SCSI] + Format: [,,[,]] + + aic7xxx= [HW,SCSI] + See Documentation/scsi/aic7xxx.txt. + + aic79xx= [HW,SCSI] + See Documentation/scsi/aic79xx.txt. + ALSA [HW,ALSA] See Documentation/sound/alsa/alsa-parameters.txt @@ -353,6 +368,8 @@ and is between 256 and 4096 characters. It is defined in the file atarimouse= [HW,MOUSE] Atari Mouse + atascsi= [HW,SCSI] Atari SCSI + atkbd.extra= [HW] Enable extra LEDs and keys on IBM RapidAccess, EzKey and similar keyboards @@ -402,6 +419,10 @@ and is between 256 and 4096 characters. It is defined in the file bttv.pll= See Documentation/video4linux/bttv/Insmod-options bttv.tuner= and Documentation/video4linux/bttv/CARDLIST + BusLogic= [HW,SCSI] + See drivers/scsi/BusLogic.c, comment before function + BusLogic_ParseDriverOptions(). + c101= [NET] Moxa C101 synchronous serial card cachesize= [BUGS=X86-32] Override level 2 CPU cache size detection. @@ -650,6 +671,8 @@ and is between 256 and 4096 characters. It is defined in the file dscc4.setup= [NET] + dtc3181e= [HW,SCSI] + dynamic_printk Enables pr_debug()/dev_dbg() calls if CONFIG_DYNAMIC_PRINTK_DEBUG has been enabled. These can also be switched on/off via @@ -690,6 +713,8 @@ and is between 256 and 4096 characters. It is defined in the file This is desgined to be used in conjunction with the boot argument: earlyprintk=vga + eata= [HW,SCSI] + edd= [EDD] Format: {"off" | "on" | "skip[mbr]"} @@ -745,6 +770,12 @@ and is between 256 and 4096 characters. It is defined in the file Format: ,,, See also /Documentation/fault-injection/. + fd_mcs= [HW,SCSI] + See header of drivers/scsi/fd_mcs.c. + + fdomain= [HW,SCSI] + See header of drivers/scsi/fdomain.c. + floppy= [HW] See Documentation/blockdev/floppy.txt. @@ -804,9 +835,14 @@ and is between 256 and 4096 characters. It is defined in the file When zero, profiling data is discarded and associated debugfs files are removed at module unload time. + gdth= [HW,SCSI] + See header of drivers/scsi/gdth.c. + gpt [EFI] Forces disk with valid GPT signature but invalid Protective MBR to be treated as GPT. + gvp11= [HW,SCSI] + hashdist= [KNL,NUMA] Large hashes allocated during boot are distributed across NUMA nodes. Defaults on for 64bit NUMA, off otherwise. @@ -895,6 +931,9 @@ and is between 256 and 4096 characters. It is defined in the file i8k.restricted [HW] Allow controlling fans only if SYS_ADMIN capability is set. + ibmmcascsi= [HW,MCA,SCSI] IBM MicroChannel SCSI adapter + See Documentation/mca.txt. + icn= [HW,ISDN] Format: [,[,[,]]] @@ -944,6 +983,9 @@ and is between 256 and 4096 characters. It is defined in the file programs exec'd, files mmap'd for exec, and all files opened for read by uid=0. + in2000= [HW,SCSI] + See header of drivers/scsi/in2000.c. + init= [KNL] Format: Run specified binary instead of /sbin/init as init @@ -1021,6 +1063,9 @@ and is between 256 and 4096 characters. It is defined in the file See comment before ip2_setup() in drivers/char/ip2/ip2base.c. + ips= [HW,SCSI] Adaptec / IBM ServeRAID controller + See header of drivers/scsi/ips.c. + irqfixup [HW] When an interrupt is not handled search all handlers for it. Intended to get systems with badly broken @@ -1296,6 +1341,9 @@ and is between 256 and 4096 characters. It is defined in the file ltpc= [NET] Format: ,, + mac5380= [HW,SCSI] Format: + ,,,, + machvec= [IA64] Force the use of a particular machine-vector (machvec) in a generic kernel. Example: machvec=hpzx1_swiotlb @@ -1317,6 +1365,13 @@ and is between 256 and 4096 characters. It is defined in the file be mounted Format: <1-256> + max_luns= [SCSI] Maximum number of LUNs to probe. + Should be between 1 and 2^32-1. + + max_report_luns= + [SCSI] Maximum number of LUNs received. + Should be between 1 and 16384. + mcatest= [IA-64] mce [X86-32] Machine Check Exception @@ -1513,6 +1568,19 @@ and is between 256 and 4096 characters. It is defined in the file n2= [NET] SDL Inc. RISCom/N2 synchronous serial card + NCR_D700= [HW,SCSI] + See header of drivers/scsi/NCR_D700.c. + + ncr5380= [HW,SCSI] + + ncr53c400= [HW,SCSI] + + ncr53c400a= [HW,SCSI] + + ncr53c406a= [HW,SCSI] + + ncr53c8xx= [HW,SCSI] + netdev= [NET] Network devices parameters Format: ,,,, Note that mem_start is often overloaded to mean @@ -1791,6 +1859,10 @@ and is between 256 and 4096 characters. It is defined in the file OSS [HW,OSS] See Documentation/sound/oss/oss-parameters.txt + osst= [HW,SCSI] SCSI Tape Driver + Format: , + See also Documentation/scsi/st.txt. + panic= [KNL] Kernel behaviour on panic Format: @@ -1823,6 +1895,9 @@ and is between 256 and 4096 characters. It is defined in the file Currently this function knows 686a and 8231 chips. Format: [spp|ps2|epp|ecp|ecpepp] + pas16= [HW,SCSI] + See header of drivers/scsi/pas16.c. + pause_on_oops= Halt all CPUs after the first oops has been printed for the specified number of seconds. This is to be used if @@ -2189,6 +2264,30 @@ and is between 256 and 4096 characters. It is defined in the file sched_debug [KNL] Enables verbose scheduler debug messages. + scsi_debug_*= [SCSI] + See drivers/scsi/scsi_debug.c. + + scsi_default_dev_flags= + [SCSI] SCSI default device flags + Format: + + scsi_dev_flags= [SCSI] Black/white list entry for vendor and model + Format: :: + (flags are integer value) + + scsi_logging_level= [SCSI] a bit mask of logging levels + See drivers/scsi/scsi_logging.h for bits. Also + settable via sysctl at dev.scsi.logging_level + (/proc/sys/dev/scsi/logging_level). + There is also a nice 'scsi_logging_level' script in the + S390-tools package, available for download at + http://www-128.ibm.com/developerworks/linux/linux390/s390-tools-1.5.4.html + + scsi_mod.scan= [SCSI] sync (default) scans SCSI busses as they are + discovered. async scans them in kernel threads, + allowing boot to proceed. none ignores them, expecting + user space to do the scan. + security= [SECURITY] Choose a security module to enable at boot. If this boot parameter is not specified, only the first security module asking for security registration will be @@ -2222,6 +2321,9 @@ and is between 256 and 4096 characters. It is defined in the file The parameter means the number of CPUs to show, for example 1 means boot CPU only. + sim710= [SCSI,HW] + See header of drivers/scsi/sim710.c. + simeth= [IA-64] simscsi= @@ -2293,6 +2395,9 @@ and is between 256 and 4096 characters. It is defined in the file spia_pedr= spia_peddr= + st= [HW,SCSI] SCSI tape parameters (buffers, etc.) + See Documentation/scsi/st.txt. + stacktrace [FTRACE] Enabled the stack tracer on boot up. @@ -2350,12 +2455,18 @@ and is between 256 and 4096 characters. It is defined in the file switches= [HW,M68k] + sym53c416= [HW,SCSI] + See header of drivers/scsi/sym53c416.c. + sysrq_always_enabled [KNL] Ignore sysrq setting - this boot parameter will neutralize any effect of /proc/sys/kernel/sysrq. Useful for debugging. + t128= [HW,SCSI] + See header of drivers/scsi/t128.c. + tdfx= [HW,DRM] test_suspend= [SUSPEND] @@ -2392,6 +2503,10 @@ and is between 256 and 4096 characters. It is defined in the file : poll all this frequency 0: no polling (default) + tmscsim= [HW,SCSI] + See comment before function dc390_setup() in + drivers/scsi/tmscsim.c. + topology= [S390] Format: {off | on} Specify if the kernel should make use of the cpu @@ -2432,6 +2547,9 @@ and is between 256 and 4096 characters. It is defined in the file ,,,,,,, See also Documentation/input/joystick-parport.txt + u14-34f= [HW,SCSI] UltraStor 14F/34F SCSI host adapter + See header of drivers/scsi/u14-34f.c. + uhash_entries= [KNL,NET] Set number of hash buckets for UDP/UDP-Lite connections @@ -2597,6 +2715,12 @@ and is between 256 and 4096 characters. It is defined in the file overridden by individual drivers. 0 will hide cursors, 1 will display them. + wd33c93= [HW,SCSI] + See header of drivers/scsi/wd33c93.c. + + wd7000= [HW,SCSI] + See header of drivers/scsi/wd7000.c. + watchdog timers [HW,WDT] For information on watchdog timers, see Documentation/watchdog/watchdog-parameters.txt or other driver-specific files in the diff --git a/trunk/Documentation/scsi/scsi-parameters.txt b/trunk/Documentation/scsi/scsi-parameters.txt deleted file mode 100644 index 21e5798526ee..000000000000 --- a/trunk/Documentation/scsi/scsi-parameters.txt +++ /dev/null @@ -1,139 +0,0 @@ - SCSI Kernel Parameters - ~~~~~~~~~~~~~~~~~~~~~~ - -See Documentation/kernel-parameters.txt for general information on -specifying module parameters. - -This document may not be entirely up to date and comprehensive. The command -"modinfo -p ${modulename}" shows a current list of all parameters of a loadable -module. Loadable modules, after being loaded into the running kernel, also -reveal their parameters in /sys/module/${modulename}/parameters/. Some of these -parameters may be changed at runtime by the command -"echo -n ${value} > /sys/module/${modulename}/parameters/${parm}". - - - advansys= [HW,SCSI] - See header of drivers/scsi/advansys.c. - - aha152x= [HW,SCSI] - See Documentation/scsi/aha152x.txt. - - aha1542= [HW,SCSI] - Format: [,,[,]] - - aic7xxx= [HW,SCSI] - See Documentation/scsi/aic7xxx.txt. - - aic79xx= [HW,SCSI] - See Documentation/scsi/aic79xx.txt. - - atascsi= [HW,SCSI] Atari SCSI - - BusLogic= [HW,SCSI] - See drivers/scsi/BusLogic.c, comment before function - BusLogic_ParseDriverOptions(). - - dtc3181e= [HW,SCSI] - - eata= [HW,SCSI] - - fd_mcs= [HW,SCSI] - See header of drivers/scsi/fd_mcs.c. - - fdomain= [HW,SCSI] - See header of drivers/scsi/fdomain.c. - - gdth= [HW,SCSI] - See header of drivers/scsi/gdth.c. - - gvp11= [HW,SCSI] - - ibmmcascsi= [HW,MCA,SCSI] IBM MicroChannel SCSI adapter - See Documentation/mca.txt. - - in2000= [HW,SCSI] - See header of drivers/scsi/in2000.c. - - ips= [HW,SCSI] Adaptec / IBM ServeRAID controller - See header of drivers/scsi/ips.c. - - mac5380= [HW,SCSI] Format: - ,,,, - - max_luns= [SCSI] Maximum number of LUNs to probe. - Should be between 1 and 2^32-1. - - max_report_luns= - [SCSI] Maximum number of LUNs received. - Should be between 1 and 16384. - - NCR_D700= [HW,SCSI] - See header of drivers/scsi/NCR_D700.c. - - ncr5380= [HW,SCSI] - - ncr53c400= [HW,SCSI] - - ncr53c400a= [HW,SCSI] - - ncr53c406a= [HW,SCSI] - - ncr53c8xx= [HW,SCSI] - - nodisconnect [HW,SCSI,M68K] Disables SCSI disconnects. - - osst= [HW,SCSI] SCSI Tape Driver - Format: , - See also Documentation/scsi/st.txt. - - pas16= [HW,SCSI] - See header of drivers/scsi/pas16.c. - - scsi_debug_*= [SCSI] - See drivers/scsi/scsi_debug.c. - - scsi_default_dev_flags= - [SCSI] SCSI default device flags - Format: - - scsi_dev_flags= [SCSI] Black/white list entry for vendor and model - Format: :: - (flags are integer value) - - scsi_logging_level= [SCSI] a bit mask of logging levels - See drivers/scsi/scsi_logging.h for bits. Also - settable via sysctl at dev.scsi.logging_level - (/proc/sys/dev/scsi/logging_level). - There is also a nice 'scsi_logging_level' script in the - S390-tools package, available for download at - http://www-128.ibm.com/developerworks/linux/linux390/s390-tools-1.5.4.html - - scsi_mod.scan= [SCSI] sync (default) scans SCSI busses as they are - discovered. async scans them in kernel threads, - allowing boot to proceed. none ignores them, expecting - user space to do the scan. - - sim710= [SCSI,HW] - See header of drivers/scsi/sim710.c. - - st= [HW,SCSI] SCSI tape parameters (buffers, etc.) - See Documentation/scsi/st.txt. - - sym53c416= [HW,SCSI] - See header of drivers/scsi/sym53c416.c. - - t128= [HW,SCSI] - See header of drivers/scsi/t128.c. - - tmscsim= [HW,SCSI] - See comment before function dc390_setup() in - drivers/scsi/tmscsim.c. - - u14-34f= [HW,SCSI] UltraStor 14F/34F SCSI host adapter - See header of drivers/scsi/u14-34f.c. - - wd33c93= [HW,SCSI] - See header of drivers/scsi/wd33c93.c. - - wd7000= [HW,SCSI] - See header of drivers/scsi/wd7000.c. diff --git a/trunk/MAINTAINERS b/trunk/MAINTAINERS index 99b6f8203a50..39d8c5ce9913 100644 --- a/trunk/MAINTAINERS +++ b/trunk/MAINTAINERS @@ -4402,13 +4402,6 @@ M: Jim Cromie S: Maintained F: drivers/char/pc8736x_gpio.c -PC87427 HARDWARE MONITORING DRIVER -M: Jean Delvare -L: lm-sensors@lm-sensors.org -S: Maintained -F: Documentation/hwmon/pc87427 -F: drivers/hwmon/pc87427.c - PCA9532 LED DRIVER M: Riku Voipio S: Maintained @@ -5286,13 +5279,6 @@ S: Maintained F: Documentation/hwmon/smm665 F: drivers/hwmon/smm665.c -SMSC EMC2103 HARDWARE MONITOR DRIVER -M: Steve Glendinning -L: lm-sensors@lm-sensors.org -S: Supported -F: Documentation/hwmon/emc2103 -F: drivers/hwmon/emc2103.c - SMSC47B397 HARDWARE MONITOR DRIVER M: "Mark M. Hoffman" L: lm-sensors@lm-sensors.org diff --git a/trunk/drivers/hwmon/Kconfig b/trunk/drivers/hwmon/Kconfig index 0fba82943125..f3adf18bfa05 100644 --- a/trunk/drivers/hwmon/Kconfig +++ b/trunk/drivers/hwmon/Kconfig @@ -465,7 +465,6 @@ config SENSORS_JZ4740 config SENSORS_JC42 tristate "JEDEC JC42.4 compliant temperature sensors" - depends on I2C help If you say yes here you get support for Jedec JC42.4 compliant temperature sensors. Support will include, but not be limited to, @@ -712,8 +711,7 @@ config SENSORS_PC87427 functions of the National Semiconductor PC87427 Super-I/O chip. The chip has two distinct logical devices, one for fan speed monitoring and control, and one for voltage and temperature - monitoring. Fan speed monitoring and control are supported, as - well as temperature monitoring. Voltages aren't supported yet. + monitoring. Only fan speed monitoring is supported right now. This driver can also be built as a module. If so, the module will be called pc87427. @@ -806,16 +804,6 @@ config SENSORS_EMC1403 Threshold values can be configured using sysfs. Data from the different diodes are accessible via sysfs. -config SENSORS_EMC2103 - tristate "SMSC EMC2103" - depends on I2C - help - If you say yes here you get support for the temperature - and fan sensors of the SMSC EMC2103 chips. - - This driver can also be built as a module. If so, the module - will be called emc2103. - config SENSORS_SMSC47M1 tristate "SMSC LPC47M10x and compatibles" help diff --git a/trunk/drivers/hwmon/Makefile b/trunk/drivers/hwmon/Makefile index e3c2484f6c5f..13d913e34dbf 100644 --- a/trunk/drivers/hwmon/Makefile +++ b/trunk/drivers/hwmon/Makefile @@ -43,7 +43,6 @@ obj-$(CONFIG_SENSORS_PKGTEMP) += pkgtemp.o obj-$(CONFIG_SENSORS_DME1737) += dme1737.o obj-$(CONFIG_SENSORS_DS1621) += ds1621.o obj-$(CONFIG_SENSORS_EMC1403) += emc1403.o -obj-$(CONFIG_SENSORS_EMC2103) += emc2103.o obj-$(CONFIG_SENSORS_F71805F) += f71805f.o obj-$(CONFIG_SENSORS_F71882FG) += f71882fg.o obj-$(CONFIG_SENSORS_F75375S) += f75375s.o diff --git a/trunk/drivers/hwmon/asc7621.c b/trunk/drivers/hwmon/asc7621.c index 89b4f3babe87..3b973f30b1f6 100644 --- a/trunk/drivers/hwmon/asc7621.c +++ b/trunk/drivers/hwmon/asc7621.c @@ -1150,6 +1150,9 @@ static int asc7621_detect(struct i2c_client *client, { struct i2c_adapter *adapter = client->adapter; int company, verstep, chip_index; + struct device *dev; + + dev = &client->dev; if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) return -ENODEV; @@ -1166,11 +1169,13 @@ static int asc7621_detect(struct i2c_client *client, if (company == asc7621_chips[chip_index].company_id && verstep == asc7621_chips[chip_index].verstep_id) { + strlcpy(client->name, asc7621_chips[chip_index].name, + I2C_NAME_SIZE); strlcpy(info->type, asc7621_chips[chip_index].name, I2C_NAME_SIZE); - dev_info(&adapter->dev, "Matched %s at 0x%02x\n", - asc7621_chips[chip_index].name, client->addr); + dev_info(&adapter->dev, "Matched %s\n", + asc7621_chips[chip_index].name); return 0; } } diff --git a/trunk/drivers/hwmon/emc1403.c b/trunk/drivers/hwmon/emc1403.c index 5b58b20dead1..0e4b5642638d 100644 --- a/trunk/drivers/hwmon/emc1403.c +++ b/trunk/drivers/hwmon/emc1403.c @@ -89,35 +89,6 @@ static ssize_t store_temp(struct device *dev, return count; } -static ssize_t store_bit(struct device *dev, - struct device_attribute *attr, const char *buf, size_t count) -{ - struct i2c_client *client = to_i2c_client(dev); - struct thermal_data *data = i2c_get_clientdata(client); - struct sensor_device_attribute_2 *sda = to_sensor_dev_attr_2(attr); - unsigned long val; - int retval; - - if (strict_strtoul(buf, 10, &val)) - return -EINVAL; - - mutex_lock(&data->mutex); - retval = i2c_smbus_read_byte_data(client, sda->nr); - if (retval < 0) - goto fail; - - retval &= ~sda->index; - if (val) - retval |= sda->index; - - retval = i2c_smbus_write_byte_data(client, sda->index, retval); - if (retval == 0) - retval = count; -fail: - mutex_unlock(&data->mutex); - return retval; -} - static ssize_t show_hyst(struct device *dev, struct device_attribute *attr, char *buf) { @@ -229,9 +200,6 @@ static SENSOR_DEVICE_ATTR_2(temp3_crit_alarm, S_IRUGO, static SENSOR_DEVICE_ATTR(temp3_crit_hyst, S_IRUGO | S_IWUSR, show_hyst, store_hyst, 0x1A); -static SENSOR_DEVICE_ATTR_2(power_state, S_IRUGO | S_IWUSR, - show_bit, store_bit, 0x03, 0x40); - static struct attribute *mid_att_thermal[] = { &sensor_dev_attr_temp1_min.dev_attr.attr, &sensor_dev_attr_temp1_max.dev_attr.attr, @@ -257,7 +225,6 @@ static struct attribute *mid_att_thermal[] = { &sensor_dev_attr_temp3_max_alarm.dev_attr.attr, &sensor_dev_attr_temp3_crit_alarm.dev_attr.attr, &sensor_dev_attr_temp3_crit_hyst.dev_attr.attr, - &sensor_dev_attr_power_state.dev_attr.attr, NULL }; diff --git a/trunk/drivers/hwmon/emc2103.c b/trunk/drivers/hwmon/emc2103.c deleted file mode 100644 index af914ad93ece..000000000000 --- a/trunk/drivers/hwmon/emc2103.c +++ /dev/null @@ -1,740 +0,0 @@ -/* - emc2103.c - Support for SMSC EMC2103 - Copyright (c) 2010 SMSC - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/* Addresses scanned */ -static const unsigned short normal_i2c[] = { 0x2E, I2C_CLIENT_END }; - -static const u8 REG_TEMP[4] = { 0x00, 0x02, 0x04, 0x06 }; -static const u8 REG_TEMP_MIN[4] = { 0x3c, 0x38, 0x39, 0x3a }; -static const u8 REG_TEMP_MAX[4] = { 0x34, 0x30, 0x31, 0x32 }; - -#define REG_CONF1 0x20 -#define REG_TEMP_MAX_ALARM 0x24 -#define REG_TEMP_MIN_ALARM 0x25 -#define REG_FAN_CONF1 0x42 -#define REG_FAN_TARGET_LO 0x4c -#define REG_FAN_TARGET_HI 0x4d -#define REG_FAN_TACH_HI 0x4e -#define REG_FAN_TACH_LO 0x4f -#define REG_PRODUCT_ID 0xfd -#define REG_MFG_ID 0xfe - -/* equation 4 from datasheet: rpm = (3932160 * multipler) / count */ -#define FAN_RPM_FACTOR 3932160 - -/* 2103-2 and 2103-4's 3rd temperature sensor can be connected to two diodes - * in anti-parallel mode, and in this configuration both can be read - * independently (so we have 4 temperature inputs). The device can't - * detect if it's connected in this mode, so we have to manually enable - * it. Default is to leave the device in the state it's already in (-1). - * This parameter allows APD mode to be optionally forced on or off */ -static int apd = -1; -module_param(apd, bool, 0); -MODULE_PARM_DESC(init, "Set to zero to disable anti-parallel diode mode"); - -struct temperature { - s8 degrees; - u8 fraction; /* 0-7 multiples of 0.125 */ -}; - -struct emc2103_data { - struct device *hwmon_dev; - struct mutex update_lock; - bool valid; /* registers are valid */ - bool fan_rpm_control; - int temp_count; /* num of temp sensors */ - unsigned long last_updated; /* in jiffies */ - struct temperature temp[4]; /* internal + 3 external */ - s8 temp_min[4]; /* no fractional part */ - s8 temp_max[4]; /* no fractional part */ - u8 temp_min_alarm; - u8 temp_max_alarm; - u8 fan_multiplier; - u16 fan_tach; - u16 fan_target; -}; - -static int read_u8_from_i2c(struct i2c_client *client, u8 i2c_reg, u8 *output) -{ - int status = i2c_smbus_read_byte_data(client, i2c_reg); - if (status < 0) { - dev_warn(&client->dev, "reg 0x%02x, err %d\n", - i2c_reg, status); - } else { - *output = status; - } - return status; -} - -static void read_temp_from_i2c(struct i2c_client *client, u8 i2c_reg, - struct temperature *temp) -{ - u8 degrees, fractional; - - if (read_u8_from_i2c(client, i2c_reg, °rees) < 0) - return; - - if (read_u8_from_i2c(client, i2c_reg + 1, &fractional) < 0) - return; - - temp->degrees = degrees; - temp->fraction = (fractional & 0xe0) >> 5; -} - -static void read_fan_from_i2c(struct i2c_client *client, u16 *output, - u8 hi_addr, u8 lo_addr) -{ - u8 high_byte, lo_byte; - - if (read_u8_from_i2c(client, hi_addr, &high_byte) < 0) - return; - - if (read_u8_from_i2c(client, lo_addr, &lo_byte) < 0) - return; - - *output = ((u16)high_byte << 5) | (lo_byte >> 3); -} - -static void write_fan_target_to_i2c(struct i2c_client *client, u16 new_target) -{ - u8 high_byte = (new_target & 0x1fe0) >> 5; - u8 low_byte = (new_target & 0x001f) << 3; - i2c_smbus_write_byte_data(client, REG_FAN_TARGET_LO, low_byte); - i2c_smbus_write_byte_data(client, REG_FAN_TARGET_HI, high_byte); -} - -static void read_fan_config_from_i2c(struct i2c_client *client) - -{ - struct emc2103_data *data = i2c_get_clientdata(client); - u8 conf1; - - if (read_u8_from_i2c(client, REG_FAN_CONF1, &conf1) < 0) - return; - - data->fan_multiplier = 1 << ((conf1 & 0x60) >> 5); - data->fan_rpm_control = (conf1 & 0x80) != 0; -} - -static struct emc2103_data *emc2103_update_device(struct device *dev) -{ - struct i2c_client *client = to_i2c_client(dev); - struct emc2103_data *data = i2c_get_clientdata(client); - - mutex_lock(&data->update_lock); - - if (time_after(jiffies, data->last_updated + HZ + HZ / 2) - || !data->valid) { - int i; - - for (i = 0; i < data->temp_count; i++) { - read_temp_from_i2c(client, REG_TEMP[i], &data->temp[i]); - read_u8_from_i2c(client, REG_TEMP_MIN[i], - &data->temp_min[i]); - read_u8_from_i2c(client, REG_TEMP_MAX[i], - &data->temp_max[i]); - } - - read_u8_from_i2c(client, REG_TEMP_MIN_ALARM, - &data->temp_min_alarm); - read_u8_from_i2c(client, REG_TEMP_MAX_ALARM, - &data->temp_max_alarm); - - read_fan_from_i2c(client, &data->fan_tach, - REG_FAN_TACH_HI, REG_FAN_TACH_LO); - read_fan_from_i2c(client, &data->fan_target, - REG_FAN_TARGET_HI, REG_FAN_TARGET_LO); - read_fan_config_from_i2c(client); - - data->last_updated = jiffies; - data->valid = true; - } - - mutex_unlock(&data->update_lock); - - return data; -} - -static ssize_t -show_temp(struct device *dev, struct device_attribute *da, char *buf) -{ - int nr = to_sensor_dev_attr(da)->index; - struct emc2103_data *data = emc2103_update_device(dev); - int millidegrees = data->temp[nr].degrees * 1000 - + data->temp[nr].fraction * 125; - return sprintf(buf, "%d\n", millidegrees); -} - -static ssize_t -show_temp_min(struct device *dev, struct device_attribute *da, char *buf) -{ - int nr = to_sensor_dev_attr(da)->index; - struct emc2103_data *data = emc2103_update_device(dev); - int millidegrees = data->temp_min[nr] * 1000; - return sprintf(buf, "%d\n", millidegrees); -} - -static ssize_t -show_temp_max(struct device *dev, struct device_attribute *da, char *buf) -{ - int nr = to_sensor_dev_attr(da)->index; - struct emc2103_data *data = emc2103_update_device(dev); - int millidegrees = data->temp_max[nr] * 1000; - return sprintf(buf, "%d\n", millidegrees); -} - -static ssize_t -show_temp_fault(struct device *dev, struct device_attribute *da, char *buf) -{ - int nr = to_sensor_dev_attr(da)->index; - struct emc2103_data *data = emc2103_update_device(dev); - bool fault = (data->temp[nr].degrees == -128); - return sprintf(buf, "%d\n", fault ? 1 : 0); -} - -static ssize_t -show_temp_min_alarm(struct device *dev, struct device_attribute *da, char *buf) -{ - int nr = to_sensor_dev_attr(da)->index; - struct emc2103_data *data = emc2103_update_device(dev); - bool alarm = data->temp_min_alarm & (1 << nr); - return sprintf(buf, "%d\n", alarm ? 1 : 0); -} - -static ssize_t -show_temp_max_alarm(struct device *dev, struct device_attribute *da, char *buf) -{ - int nr = to_sensor_dev_attr(da)->index; - struct emc2103_data *data = emc2103_update_device(dev); - bool alarm = data->temp_max_alarm & (1 << nr); - return sprintf(buf, "%d\n", alarm ? 1 : 0); -} - -static ssize_t set_temp_min(struct device *dev, struct device_attribute *da, - const char *buf, size_t count) -{ - int nr = to_sensor_dev_attr(da)->index; - struct i2c_client *client = to_i2c_client(dev); - struct emc2103_data *data = i2c_get_clientdata(client); - long val; - - int result = strict_strtol(buf, 10, &val); - if (result < 0) - return -EINVAL; - - val = DIV_ROUND_CLOSEST(val, 1000); - if ((val < -63) || (val > 127)) - return -EINVAL; - - mutex_lock(&data->update_lock); - data->temp_min[nr] = val; - i2c_smbus_write_byte_data(client, REG_TEMP_MIN[nr], val); - mutex_unlock(&data->update_lock); - - return count; -} - -static ssize_t set_temp_max(struct device *dev, struct device_attribute *da, - const char *buf, size_t count) -{ - int nr = to_sensor_dev_attr(da)->index; - struct i2c_client *client = to_i2c_client(dev); - struct emc2103_data *data = i2c_get_clientdata(client); - long val; - - int result = strict_strtol(buf, 10, &val); - if (result < 0) - return -EINVAL; - - val = DIV_ROUND_CLOSEST(val, 1000); - if ((val < -63) || (val > 127)) - return -EINVAL; - - mutex_lock(&data->update_lock); - data->temp_max[nr] = val; - i2c_smbus_write_byte_data(client, REG_TEMP_MAX[nr], val); - mutex_unlock(&data->update_lock); - - return count; -} - -static ssize_t -show_fan(struct device *dev, struct device_attribute *da, char *buf) -{ - struct emc2103_data *data = emc2103_update_device(dev); - int rpm = 0; - if (data->fan_tach != 0) - rpm = (FAN_RPM_FACTOR * data->fan_multiplier) / data->fan_tach; - return sprintf(buf, "%d\n", rpm); -} - -static ssize_t -show_fan_div(struct device *dev, struct device_attribute *da, char *buf) -{ - struct emc2103_data *data = emc2103_update_device(dev); - int fan_div = 8 / data->fan_multiplier; - return sprintf(buf, "%d\n", fan_div); -} - -/* Note: we also update the fan target here, because its value is - determined in part by the fan clock divider. This follows the principle - of least surprise; the user doesn't expect the fan target to change just - because the divider changed. */ -static ssize_t set_fan_div(struct device *dev, struct device_attribute *da, - const char *buf, size_t count) -{ - struct emc2103_data *data = emc2103_update_device(dev); - struct i2c_client *client = to_i2c_client(dev); - int new_range_bits, old_div = 8 / data->fan_multiplier; - long new_div; - - int status = strict_strtol(buf, 10, &new_div); - if (status < 0) - return -EINVAL; - - if (new_div == old_div) /* No change */ - return count; - - switch (new_div) { - case 1: - new_range_bits = 3; - break; - case 2: - new_range_bits = 2; - break; - case 4: - new_range_bits = 1; - break; - case 8: - new_range_bits = 0; - break; - default: - return -EINVAL; - } - - mutex_lock(&data->update_lock); - - status = i2c_smbus_read_byte_data(client, REG_FAN_CONF1); - if (status < 0) { - dev_dbg(&client->dev, "reg 0x%02x, err %d\n", - REG_FAN_CONF1, status); - mutex_unlock(&data->update_lock); - return -EIO; - } - status &= 0x9F; - status |= (new_range_bits << 5); - i2c_smbus_write_byte_data(client, REG_FAN_CONF1, status); - - data->fan_multiplier = 8 / new_div; - - /* update fan target if high byte is not disabled */ - if ((data->fan_target & 0x1fe0) != 0x1fe0) { - u16 new_target = (data->fan_target * old_div) / new_div; - data->fan_target = min(new_target, (u16)0x1fff); - write_fan_target_to_i2c(client, data->fan_target); - } - - /* invalidate data to force re-read from hardware */ - data->valid = false; - - mutex_unlock(&data->update_lock); - return count; -} - -static ssize_t -show_fan_target(struct device *dev, struct device_attribute *da, char *buf) -{ - struct emc2103_data *data = emc2103_update_device(dev); - int rpm = 0; - - /* high byte of 0xff indicates disabled so return 0 */ - if ((data->fan_target != 0) && ((data->fan_target & 0x1fe0) != 0x1fe0)) - rpm = (FAN_RPM_FACTOR * data->fan_multiplier) - / data->fan_target; - - return sprintf(buf, "%d\n", rpm); -} - -static ssize_t set_fan_target(struct device *dev, struct device_attribute *da, - const char *buf, size_t count) -{ - struct emc2103_data *data = emc2103_update_device(dev); - struct i2c_client *client = to_i2c_client(dev); - long rpm_target; - - int result = strict_strtol(buf, 10, &rpm_target); - if (result < 0) - return -EINVAL; - - /* Datasheet states 16384 as maximum RPM target (table 3.2) */ - if ((rpm_target < 0) || (rpm_target > 16384)) - return -EINVAL; - - mutex_lock(&data->update_lock); - - if (rpm_target == 0) - data->fan_target = 0x1fff; - else - data->fan_target = SENSORS_LIMIT( - (FAN_RPM_FACTOR * data->fan_multiplier) / rpm_target, - 0, 0x1fff); - - write_fan_target_to_i2c(client, data->fan_target); - - mutex_unlock(&data->update_lock); - return count; -} - -static ssize_t -show_fan_fault(struct device *dev, struct device_attribute *da, char *buf) -{ - struct emc2103_data *data = emc2103_update_device(dev); - bool fault = ((data->fan_tach & 0x1fe0) == 0x1fe0); - return sprintf(buf, "%d\n", fault ? 1 : 0); -} - -static ssize_t -show_pwm_enable(struct device *dev, struct device_attribute *da, char *buf) -{ - struct emc2103_data *data = emc2103_update_device(dev); - return sprintf(buf, "%d\n", data->fan_rpm_control ? 3 : 0); -} - -static ssize_t set_pwm_enable(struct device *dev, struct device_attribute *da, - const char *buf, size_t count) -{ - struct i2c_client *client = to_i2c_client(dev); - struct emc2103_data *data = i2c_get_clientdata(client); - long new_value; - u8 conf_reg; - - int result = strict_strtol(buf, 10, &new_value); - if (result < 0) - return -EINVAL; - - mutex_lock(&data->update_lock); - switch (new_value) { - case 0: - data->fan_rpm_control = false; - break; - case 3: - data->fan_rpm_control = true; - break; - default: - mutex_unlock(&data->update_lock); - return -EINVAL; - } - - read_u8_from_i2c(client, REG_FAN_CONF1, &conf_reg); - - if (data->fan_rpm_control) - conf_reg |= 0x80; - else - conf_reg &= ~0x80; - - i2c_smbus_write_byte_data(client, REG_FAN_CONF1, conf_reg); - - mutex_unlock(&data->update_lock); - return count; -} - -static SENSOR_DEVICE_ATTR(temp1_input, S_IRUGO, show_temp, NULL, 0); -static SENSOR_DEVICE_ATTR(temp1_min, S_IRUGO | S_IWUSR, show_temp_min, - set_temp_min, 0); -static SENSOR_DEVICE_ATTR(temp1_max, S_IRUGO | S_IWUSR, show_temp_max, - set_temp_max, 0); -static SENSOR_DEVICE_ATTR(temp1_fault, S_IRUGO, show_temp_fault, NULL, 0); -static SENSOR_DEVICE_ATTR(temp1_min_alarm, S_IRUGO, show_temp_min_alarm, - NULL, 0); -static SENSOR_DEVICE_ATTR(temp1_max_alarm, S_IRUGO, show_temp_max_alarm, - NULL, 0); - -static SENSOR_DEVICE_ATTR(temp2_input, S_IRUGO, show_temp, NULL, 1); -static SENSOR_DEVICE_ATTR(temp2_min, S_IRUGO | S_IWUSR, show_temp_min, - set_temp_min, 1); -static SENSOR_DEVICE_ATTR(temp2_max, S_IRUGO | S_IWUSR, show_temp_max, - set_temp_max, 1); -static SENSOR_DEVICE_ATTR(temp2_fault, S_IRUGO, show_temp_fault, NULL, 1); -static SENSOR_DEVICE_ATTR(temp2_min_alarm, S_IRUGO, show_temp_min_alarm, - NULL, 1); -static SENSOR_DEVICE_ATTR(temp2_max_alarm, S_IRUGO, show_temp_max_alarm, - NULL, 1); - -static SENSOR_DEVICE_ATTR(temp3_input, S_IRUGO, show_temp, NULL, 2); -static SENSOR_DEVICE_ATTR(temp3_min, S_IRUGO | S_IWUSR, show_temp_min, - set_temp_min, 2); -static SENSOR_DEVICE_ATTR(temp3_max, S_IRUGO | S_IWUSR, show_temp_max, - set_temp_max, 2); -static SENSOR_DEVICE_ATTR(temp3_fault, S_IRUGO, show_temp_fault, NULL, 2); -static SENSOR_DEVICE_ATTR(temp3_min_alarm, S_IRUGO, show_temp_min_alarm, - NULL, 2); -static SENSOR_DEVICE_ATTR(temp3_max_alarm, S_IRUGO, show_temp_max_alarm, - NULL, 2); - -static SENSOR_DEVICE_ATTR(temp4_input, S_IRUGO, show_temp, NULL, 3); -static SENSOR_DEVICE_ATTR(temp4_min, S_IRUGO | S_IWUSR, show_temp_min, - set_temp_min, 3); -static SENSOR_DEVICE_ATTR(temp4_max, S_IRUGO | S_IWUSR, show_temp_max, - set_temp_max, 3); -static SENSOR_DEVICE_ATTR(temp4_fault, S_IRUGO, show_temp_fault, NULL, 3); -static SENSOR_DEVICE_ATTR(temp4_min_alarm, S_IRUGO, show_temp_min_alarm, - NULL, 3); -static SENSOR_DEVICE_ATTR(temp4_max_alarm, S_IRUGO, show_temp_max_alarm, - NULL, 3); - -static DEVICE_ATTR(fan1_input, S_IRUGO, show_fan, NULL); -static DEVICE_ATTR(fan1_div, S_IRUGO | S_IWUSR, show_fan_div, set_fan_div); -static DEVICE_ATTR(fan1_target, S_IRUGO | S_IWUSR, show_fan_target, - set_fan_target); -static DEVICE_ATTR(fan1_fault, S_IRUGO, show_fan_fault, NULL); - -static DEVICE_ATTR(pwm1_enable, S_IRUGO | S_IWUSR, show_pwm_enable, - set_pwm_enable); - -/* sensors present on all models */ -static struct attribute *emc2103_attributes[] = { - &sensor_dev_attr_temp1_input.dev_attr.attr, - &sensor_dev_attr_temp1_min.dev_attr.attr, - &sensor_dev_attr_temp1_max.dev_attr.attr, - &sensor_dev_attr_temp1_fault.dev_attr.attr, - &sensor_dev_attr_temp1_min_alarm.dev_attr.attr, - &sensor_dev_attr_temp1_max_alarm.dev_attr.attr, - &sensor_dev_attr_temp2_input.dev_attr.attr, - &sensor_dev_attr_temp2_min.dev_attr.attr, - &sensor_dev_attr_temp2_max.dev_attr.attr, - &sensor_dev_attr_temp2_fault.dev_attr.attr, - &sensor_dev_attr_temp2_min_alarm.dev_attr.attr, - &sensor_dev_attr_temp2_max_alarm.dev_attr.attr, - &dev_attr_fan1_input.attr, - &dev_attr_fan1_div.attr, - &dev_attr_fan1_target.attr, - &dev_attr_fan1_fault.attr, - &dev_attr_pwm1_enable.attr, - NULL -}; - -/* extra temperature sensors only present on 2103-2 and 2103-4 */ -static struct attribute *emc2103_attributes_temp3[] = { - &sensor_dev_attr_temp3_input.dev_attr.attr, - &sensor_dev_attr_temp3_min.dev_attr.attr, - &sensor_dev_attr_temp3_max.dev_attr.attr, - &sensor_dev_attr_temp3_fault.dev_attr.attr, - &sensor_dev_attr_temp3_min_alarm.dev_attr.attr, - &sensor_dev_attr_temp3_max_alarm.dev_attr.attr, - NULL -}; - -/* extra temperature sensors only present on 2103-2 and 2103-4 in APD mode */ -static struct attribute *emc2103_attributes_temp4[] = { - &sensor_dev_attr_temp4_input.dev_attr.attr, - &sensor_dev_attr_temp4_min.dev_attr.attr, - &sensor_dev_attr_temp4_max.dev_attr.attr, - &sensor_dev_attr_temp4_fault.dev_attr.attr, - &sensor_dev_attr_temp4_min_alarm.dev_attr.attr, - &sensor_dev_attr_temp4_max_alarm.dev_attr.attr, - NULL -}; - -static const struct attribute_group emc2103_group = { - .attrs = emc2103_attributes, -}; - -static const struct attribute_group emc2103_temp3_group = { - .attrs = emc2103_attributes_temp3, -}; - -static const struct attribute_group emc2103_temp4_group = { - .attrs = emc2103_attributes_temp4, -}; - -static int -emc2103_probe(struct i2c_client *client, const struct i2c_device_id *id) -{ - struct emc2103_data *data; - int status; - - if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA)) - return -EIO; - - data = kzalloc(sizeof(struct emc2103_data), GFP_KERNEL); - if (!data) - return -ENOMEM; - - i2c_set_clientdata(client, data); - mutex_init(&data->update_lock); - - /* 2103-2 and 2103-4 have 3 external diodes, 2103-1 has 1 */ - status = i2c_smbus_read_byte_data(client, REG_PRODUCT_ID); - if (status == 0x24) { - /* 2103-1 only has 1 external diode */ - data->temp_count = 2; - } else { - /* 2103-2 and 2103-4 have 3 or 4 external diodes */ - status = i2c_smbus_read_byte_data(client, REG_CONF1); - if (status < 0) { - dev_dbg(&client->dev, "reg 0x%02x, err %d\n", REG_CONF1, - status); - goto exit_free; - } - - /* detect current state of hardware */ - data->temp_count = (status & 0x01) ? 4 : 3; - - /* force APD state if module parameter is set */ - if (apd == 0) { - /* force APD mode off */ - data->temp_count = 3; - status &= ~(0x01); - i2c_smbus_write_byte_data(client, REG_CONF1, status); - } else if (apd == 1) { - /* force APD mode on */ - data->temp_count = 4; - status |= 0x01; - i2c_smbus_write_byte_data(client, REG_CONF1, status); - } - } - - /* Register sysfs hooks */ - status = sysfs_create_group(&client->dev.kobj, &emc2103_group); - if (status) - goto exit_free; - - if (data->temp_count >= 3) { - status = sysfs_create_group(&client->dev.kobj, - &emc2103_temp3_group); - if (status) - goto exit_remove; - } - - if (data->temp_count == 4) { - status = sysfs_create_group(&client->dev.kobj, - &emc2103_temp4_group); - if (status) - goto exit_remove_temp3; - } - - data->hwmon_dev = hwmon_device_register(&client->dev); - if (IS_ERR(data->hwmon_dev)) { - status = PTR_ERR(data->hwmon_dev); - goto exit_remove_temp4; - } - - dev_info(&client->dev, "%s: sensor '%s'\n", - dev_name(data->hwmon_dev), client->name); - - return 0; - -exit_remove_temp4: - if (data->temp_count == 4) - sysfs_remove_group(&client->dev.kobj, &emc2103_temp4_group); -exit_remove_temp3: - if (data->temp_count >= 3) - sysfs_remove_group(&client->dev.kobj, &emc2103_temp3_group); -exit_remove: - sysfs_remove_group(&client->dev.kobj, &emc2103_group); -exit_free: - kfree(data); - return status; -} - -static int emc2103_remove(struct i2c_client *client) -{ - struct emc2103_data *data = i2c_get_clientdata(client); - - hwmon_device_unregister(data->hwmon_dev); - - if (data->temp_count == 4) - sysfs_remove_group(&client->dev.kobj, &emc2103_temp4_group); - - if (data->temp_count >= 3) - sysfs_remove_group(&client->dev.kobj, &emc2103_temp3_group); - - sysfs_remove_group(&client->dev.kobj, &emc2103_group); - - kfree(data); - return 0; -} - -static const struct i2c_device_id emc2103_ids[] = { - { "emc2103", 0, }, - { /* LIST END */ } -}; -MODULE_DEVICE_TABLE(i2c, emc2103_ids); - -/* Return 0 if detection is successful, -ENODEV otherwise */ -static int -emc2103_detect(struct i2c_client *new_client, struct i2c_board_info *info) -{ - struct i2c_adapter *adapter = new_client->adapter; - int manufacturer, product; - - if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) - return -ENODEV; - - manufacturer = i2c_smbus_read_byte_data(new_client, REG_MFG_ID); - if (manufacturer != 0x5D) - return -ENODEV; - - product = i2c_smbus_read_byte_data(new_client, REG_PRODUCT_ID); - if ((product != 0x24) && (product != 0x26)) - return -ENODEV; - - strlcpy(info->type, "emc2103", I2C_NAME_SIZE); - - return 0; -} - -static struct i2c_driver emc2103_driver = { - .class = I2C_CLASS_HWMON, - .driver = { - .name = "emc2103", - }, - .probe = emc2103_probe, - .remove = emc2103_remove, - .id_table = emc2103_ids, - .detect = emc2103_detect, - .address_list = normal_i2c, -}; - -static int __init sensors_emc2103_init(void) -{ - return i2c_add_driver(&emc2103_driver); -} - -static void __exit sensors_emc2103_exit(void) -{ - i2c_del_driver(&emc2103_driver); -} - -MODULE_AUTHOR("Steve Glendinning "); -MODULE_DESCRIPTION("SMSC EMC2103 hwmon driver"); -MODULE_LICENSE("GPL"); - -module_init(sensors_emc2103_init); -module_exit(sensors_emc2103_exit); diff --git a/trunk/drivers/hwmon/it87.c b/trunk/drivers/hwmon/it87.c index f7701295937d..25763d2223b6 100644 --- a/trunk/drivers/hwmon/it87.c +++ b/trunk/drivers/hwmon/it87.c @@ -259,7 +259,6 @@ struct it87_sio_data { u8 revision; u8 vid_value; u8 beep_pin; - u8 internal; /* Internal sensors can be labeled */ /* Features skipped based on config or DMI */ u8 skip_vid; u8 skip_fan; @@ -1195,22 +1194,6 @@ static ssize_t show_vid_reg(struct device *dev, struct device_attribute *attr, } static DEVICE_ATTR(cpu0_vid, S_IRUGO, show_vid_reg, NULL); -static ssize_t show_label(struct device *dev, struct device_attribute *attr, - char *buf) -{ - static const char *labels[] = { - "+5V", - "5VSB", - "Vbat", - }; - int nr = to_sensor_dev_attr(attr)->index; - - return sprintf(buf, "%s\n", labels[nr]); -} -static SENSOR_DEVICE_ATTR(in3_label, S_IRUGO, show_label, NULL, 0); -static SENSOR_DEVICE_ATTR(in7_label, S_IRUGO, show_label, NULL, 1); -static SENSOR_DEVICE_ATTR(in8_label, S_IRUGO, show_label, NULL, 2); - static ssize_t show_name(struct device *dev, struct device_attribute *devattr, char *buf) { @@ -1451,17 +1434,6 @@ static const struct attribute_group it87_group_vid = { .attrs = it87_attributes_vid, }; -static struct attribute *it87_attributes_label[] = { - &sensor_dev_attr_in3_label.dev_attr.attr, - &sensor_dev_attr_in7_label.dev_attr.attr, - &sensor_dev_attr_in8_label.dev_attr.attr, - NULL -}; - -static const struct attribute_group it87_group_label = { - .attrs = it87_attributes_vid, -}; - /* SuperIO detection - will change isa_address if a chip is found */ static int __init it87_find(unsigned short *address, struct it87_sio_data *sio_data) @@ -1515,9 +1487,6 @@ static int __init it87_find(unsigned short *address, pr_info("it87: Found IT%04xF chip at 0x%x, revision %d\n", chip_type, *address, sio_data->revision); - /* in8 (Vbat) is always internal */ - sio_data->internal = (1 << 2); - /* Read GPIO config and VID value from LDN 7 (GPIO) */ if (sio_data->type == it87) { /* The IT8705F doesn't have VID pins at all */ @@ -1571,9 +1540,9 @@ static int __init it87_find(unsigned short *address, pr_notice("it87: Routing internal VCCH to in7\n"); } if (reg & (1 << 0)) - sio_data->internal |= (1 << 0); + pr_info("it87: in3 is VCC (+5V)\n"); if (reg & (1 << 1)) - sio_data->internal |= (1 << 1); + pr_info("it87: in7 is VCCH (+5V Stand-By)\n"); sio_data->beep_pin = superio_inb(IT87_SIO_BEEP_PIN_REG) & 0x3f; } @@ -1631,7 +1600,6 @@ static void it87_remove_files(struct device *dev) } if (!sio_data->skip_vid) sysfs_remove_group(&dev->kobj, &it87_group_vid); - sysfs_remove_group(&dev->kobj, &it87_group_label); } static int __devinit it87_probe(struct platform_device *pdev) @@ -1757,16 +1725,6 @@ static int __devinit it87_probe(struct platform_device *pdev) goto ERROR4; } - /* Export labels for internal sensors */ - for (i = 0; i < 3; i++) { - if (!(sio_data->internal & (1 << i))) - continue; - err = sysfs_create_file(&dev->kobj, - it87_attributes_label[i]); - if (err) - goto ERROR4; - } - data->hwmon_dev = hwmon_device_register(dev); if (IS_ERR(data->hwmon_dev)) { err = PTR_ERR(data->hwmon_dev); diff --git a/trunk/drivers/hwmon/k8temp.c b/trunk/drivers/hwmon/k8temp.c index b9bb3e0ca530..8bdf80d91598 100644 --- a/trunk/drivers/hwmon/k8temp.c +++ b/trunk/drivers/hwmon/k8temp.c @@ -252,13 +252,12 @@ static int __devinit k8temp_probe(struct pci_dev *pdev, &sensor_dev_attr_temp3_input.dev_attr); if (err) goto exit_remove; - if (data->sensorsp & SEL_PLACE) { + if (data->sensorsp & SEL_PLACE) err = device_create_file(&pdev->dev, &sensor_dev_attr_temp4_input. dev_attr); if (err) goto exit_remove; - } } err = device_create_file(&pdev->dev, &dev_attr_name); diff --git a/trunk/drivers/hwmon/lm75.c b/trunk/drivers/hwmon/lm75.c index ab5b87a81677..393f354f92a4 100644 --- a/trunk/drivers/hwmon/lm75.c +++ b/trunk/drivers/hwmon/lm75.c @@ -280,49 +280,10 @@ static int lm75_detect(struct i2c_client *new_client, return 0; } -#ifdef CONFIG_PM -static int lm75_suspend(struct device *dev) -{ - int status; - struct i2c_client *client = to_i2c_client(dev); - status = lm75_read_value(client, LM75_REG_CONF); - if (status < 0) { - dev_dbg(&client->dev, "Can't read config? %d\n", status); - return status; - } - status = status | LM75_SHUTDOWN; - lm75_write_value(client, LM75_REG_CONF, status); - return 0; -} - -static int lm75_resume(struct device *dev) -{ - int status; - struct i2c_client *client = to_i2c_client(dev); - status = lm75_read_value(client, LM75_REG_CONF); - if (status < 0) { - dev_dbg(&client->dev, "Can't read config? %d\n", status); - return status; - } - status = status & ~LM75_SHUTDOWN; - lm75_write_value(client, LM75_REG_CONF, status); - return 0; -} - -static const struct dev_pm_ops lm75_dev_pm_ops = { - .suspend = lm75_suspend, - .resume = lm75_resume, -}; -#define LM75_DEV_PM_OPS (&lm75_dev_pm_ops) -#else -#define LM75_DEV_PM_OPS NULL -#endif /* CONFIG_PM */ - static struct i2c_driver lm75_driver = { .class = I2C_CLASS_HWMON, .driver = { .name = "lm75", - .pm = LM75_DEV_PM_OPS, }, .probe = lm75_probe, .remove = lm75_remove, diff --git a/trunk/drivers/hwmon/lm75.h b/trunk/drivers/hwmon/lm75.h index e547a3eb4de3..7c93454bb4e3 100644 --- a/trunk/drivers/hwmon/lm75.h +++ b/trunk/drivers/hwmon/lm75.h @@ -30,7 +30,6 @@ /* straight from the datasheet */ #define LM75_TEMP_MIN (-55000) #define LM75_TEMP_MAX 125000 -#define LM75_SHUTDOWN 0x01 /* TEMP: 0.001C/bit (-55C to +125C) REG: (0.5C/bit, two's complement) << 7 */ diff --git a/trunk/drivers/hwmon/ltc4245.c b/trunk/drivers/hwmon/ltc4245.c index 659308329308..21d201befc2c 100644 --- a/trunk/drivers/hwmon/ltc4245.c +++ b/trunk/drivers/hwmon/ltc4245.c @@ -21,7 +21,6 @@ #include #include #include -#include /* Here are names of the chip's registers (a.k.a. commands) */ enum ltc4245_cmd { @@ -61,72 +60,8 @@ struct ltc4245_data { /* Voltage registers */ u8 vregs[0x0d]; - - /* GPIO ADC registers */ - bool use_extra_gpios; - int gpios[3]; }; -/* - * Update the readings from the GPIO pins. If the driver has been configured to - * sample all GPIO's as analog voltages, a round-robin sampling method is used. - * Otherwise, only the configured GPIO pin is sampled. - * - * LOCKING: must hold data->update_lock - */ -static void ltc4245_update_gpios(struct device *dev) -{ - struct i2c_client *client = to_i2c_client(dev); - struct ltc4245_data *data = i2c_get_clientdata(client); - u8 gpio_curr, gpio_next, gpio_reg; - int i; - - /* no extra gpio support, we're basically done */ - if (!data->use_extra_gpios) { - data->gpios[0] = data->vregs[LTC4245_GPIOADC - 0x10]; - return; - } - - /* - * If the last reading was too long ago, then we mark all old GPIO - * readings as stale by setting them to -EAGAIN - */ - if (time_after(jiffies, data->last_updated + 5 * HZ)) { - dev_dbg(&client->dev, "Marking GPIOs invalid\n"); - for (i = 0; i < ARRAY_SIZE(data->gpios); i++) - data->gpios[i] = -EAGAIN; - } - - /* - * Get the current GPIO pin - * - * The datasheet calls these GPIO[1-3], but we'll calculate the zero - * based array index instead, and call them GPIO[0-2]. This is much - * easier to think about. - */ - gpio_curr = (data->cregs[LTC4245_GPIO] & 0xc0) >> 6; - if (gpio_curr > 0) - gpio_curr -= 1; - - /* Read the GPIO voltage from the GPIOADC register */ - data->gpios[gpio_curr] = data->vregs[LTC4245_GPIOADC - 0x10]; - - /* Find the next GPIO pin to read */ - gpio_next = (gpio_curr + 1) % ARRAY_SIZE(data->gpios); - - /* - * Calculate the correct setting for the GPIO register so it will - * sample the next GPIO pin - */ - gpio_reg = (data->cregs[LTC4245_GPIO] & 0x3f) | ((gpio_next + 1) << 6); - - /* Update the GPIO register */ - i2c_smbus_write_byte_data(client, LTC4245_GPIO, gpio_reg); - - /* Update saved data */ - data->cregs[LTC4245_GPIO] = gpio_reg; -} - static struct ltc4245_data *ltc4245_update_device(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); @@ -158,9 +93,6 @@ static struct ltc4245_data *ltc4245_update_device(struct device *dev) data->vregs[i] = val; } - /* Update GPIO readings */ - ltc4245_update_gpios(dev); - data->last_updated = jiffies; data->valid = 1; } @@ -301,22 +233,6 @@ static ssize_t ltc4245_show_alarm(struct device *dev, return snprintf(buf, PAGE_SIZE, "%u\n", (reg & mask) ? 1 : 0); } -static ssize_t ltc4245_show_gpio(struct device *dev, - struct device_attribute *da, - char *buf) -{ - struct sensor_device_attribute *attr = to_sensor_dev_attr(da); - struct ltc4245_data *data = ltc4245_update_device(dev); - int val = data->gpios[attr->index]; - - /* handle stale GPIO's */ - if (val < 0) - return val; - - /* Convert to millivolts and print */ - return snprintf(buf, PAGE_SIZE, "%u\n", val * 10); -} - /* These macros are used below in constructing device attribute objects * for use with sysfs_create_group() to make a sysfs device file * for each register. @@ -338,10 +254,6 @@ static ssize_t ltc4245_show_gpio(struct device *dev, static SENSOR_DEVICE_ATTR_2(name, S_IRUGO, \ ltc4245_show_alarm, NULL, (mask), reg) -#define LTC4245_GPIO_VOLTAGE(name, gpio_num) \ - static SENSOR_DEVICE_ATTR(name, S_IRUGO, \ - ltc4245_show_gpio, NULL, gpio_num) - /* Construct a sensor_device_attribute structure for each register */ /* Input voltages */ @@ -381,9 +293,7 @@ LTC4245_ALARM(in7_min_alarm, (1 << 2), LTC4245_FAULT2); LTC4245_ALARM(in8_min_alarm, (1 << 3), LTC4245_FAULT2); /* GPIO voltages */ -LTC4245_GPIO_VOLTAGE(in9_input, 0); -LTC4245_GPIO_VOLTAGE(in10_input, 1); -LTC4245_GPIO_VOLTAGE(in11_input, 2); +LTC4245_VOLTAGE(in9_input, LTC4245_GPIOADC); /* Power Consumption (virtual) */ LTC4245_POWER(power1_input, LTC4245_12VSENSE); @@ -394,7 +304,7 @@ LTC4245_POWER(power4_input, LTC4245_VEESENSE); /* Finally, construct an array of pointers to members of the above objects, * as required for sysfs_create_group() */ -static struct attribute *ltc4245_std_attributes[] = { +static struct attribute *ltc4245_attributes[] = { &sensor_dev_attr_in1_input.dev_attr.attr, &sensor_dev_attr_in2_input.dev_attr.attr, &sensor_dev_attr_in3_input.dev_attr.attr, @@ -435,77 +345,10 @@ static struct attribute *ltc4245_std_attributes[] = { NULL, }; -static struct attribute *ltc4245_gpio_attributes[] = { - &sensor_dev_attr_in10_input.dev_attr.attr, - &sensor_dev_attr_in11_input.dev_attr.attr, - NULL, -}; - -static const struct attribute_group ltc4245_std_group = { - .attrs = ltc4245_std_attributes, -}; - -static const struct attribute_group ltc4245_gpio_group = { - .attrs = ltc4245_gpio_attributes, +static const struct attribute_group ltc4245_group = { + .attrs = ltc4245_attributes, }; -static int ltc4245_sysfs_create_groups(struct i2c_client *client) -{ - struct ltc4245_data *data = i2c_get_clientdata(client); - struct device *dev = &client->dev; - int ret; - - /* register the standard sysfs attributes */ - ret = sysfs_create_group(&dev->kobj, <c4245_std_group); - if (ret) { - dev_err(dev, "unable to register standard attributes\n"); - return ret; - } - - /* if we're using the extra gpio support, register it's attributes */ - if (data->use_extra_gpios) { - ret = sysfs_create_group(&dev->kobj, <c4245_gpio_group); - if (ret) { - dev_err(dev, "unable to register gpio attributes\n"); - sysfs_remove_group(&dev->kobj, <c4245_std_group); - return ret; - } - } - - return 0; -} - -static void ltc4245_sysfs_remove_groups(struct i2c_client *client) -{ - struct ltc4245_data *data = i2c_get_clientdata(client); - struct device *dev = &client->dev; - - if (data->use_extra_gpios) - sysfs_remove_group(&dev->kobj, <c4245_gpio_group); - - sysfs_remove_group(&dev->kobj, <c4245_std_group); -} - -static bool ltc4245_use_extra_gpios(struct i2c_client *client) -{ - struct ltc4245_platform_data *pdata = dev_get_platdata(&client->dev); -#ifdef CONFIG_OF - struct device_node *np = client->dev.of_node; -#endif - - /* prefer platform data */ - if (pdata) - return pdata->use_extra_gpios; - -#ifdef CONFIG_OF - /* fallback on OF */ - if (of_find_property(np, "ltc4245,use-extra-gpios", NULL)) - return true; -#endif - - return false; -} - static int ltc4245_probe(struct i2c_client *client, const struct i2c_device_id *id) { @@ -524,16 +367,15 @@ static int ltc4245_probe(struct i2c_client *client, i2c_set_clientdata(client, data); mutex_init(&data->update_lock); - data->use_extra_gpios = ltc4245_use_extra_gpios(client); /* Initialize the LTC4245 chip */ i2c_smbus_write_byte_data(client, LTC4245_FAULT1, 0x00); i2c_smbus_write_byte_data(client, LTC4245_FAULT2, 0x00); /* Register sysfs hooks */ - ret = ltc4245_sysfs_create_groups(client); + ret = sysfs_create_group(&client->dev.kobj, <c4245_group); if (ret) - goto out_sysfs_create_groups; + goto out_sysfs_create_group; data->hwmon_dev = hwmon_device_register(&client->dev); if (IS_ERR(data->hwmon_dev)) { @@ -544,8 +386,8 @@ static int ltc4245_probe(struct i2c_client *client, return 0; out_hwmon_device_register: - ltc4245_sysfs_remove_groups(client); -out_sysfs_create_groups: + sysfs_remove_group(&client->dev.kobj, <c4245_group); +out_sysfs_create_group: kfree(data); out_kzalloc: return ret; @@ -556,7 +398,8 @@ static int ltc4245_remove(struct i2c_client *client) struct ltc4245_data *data = i2c_get_clientdata(client); hwmon_device_unregister(data->hwmon_dev); - ltc4245_sysfs_remove_groups(client); + sysfs_remove_group(&client->dev.kobj, <c4245_group); + kfree(data); return 0; diff --git a/trunk/drivers/hwmon/pc87360.c b/trunk/drivers/hwmon/pc87360.c index 68e69a49633c..4a64b85d4ec9 100644 --- a/trunk/drivers/hwmon/pc87360.c +++ b/trunk/drivers/hwmon/pc87360.c @@ -1610,8 +1610,11 @@ static struct pc87360_data *pc87360_update_device(struct device *dev) static int __init pc87360_device_add(unsigned short address) { - struct resource res[3]; - int err, i, res_count; + struct resource res = { + .name = "pc87360", + .flags = IORESOURCE_IO, + }; + int err, i; pdev = platform_device_alloc("pc87360", address); if (!pdev) { @@ -1620,28 +1623,22 @@ static int __init pc87360_device_add(unsigned short address) goto exit; } - memset(res, 0, 3 * sizeof(struct resource)); - res_count = 0; for (i = 0; i < 3; i++) { if (!extra_isa[i]) continue; - res[res_count].start = extra_isa[i]; - res[res_count].end = extra_isa[i] + PC87360_EXTENT - 1; - res[res_count].name = "pc87360", - res[res_count].flags = IORESOURCE_IO, + res.start = extra_isa[i]; + res.end = extra_isa[i] + PC87360_EXTENT - 1; - err = acpi_check_resource_conflict(&res[res_count]); + err = acpi_check_resource_conflict(&res); if (err) goto exit_device_put; - res_count++; - } - - err = platform_device_add_resources(pdev, res, res_count); - if (err) { - printk(KERN_ERR "pc87360: Device resources addition failed " - "(%d)\n", err); - goto exit_device_put; + err = platform_device_add_resources(pdev, &res, 1); + if (err) { + printk(KERN_ERR "pc87360: Device resource[%d] " + "addition failed (%d)\n", i, err); + goto exit_device_put; + } } err = platform_device_add(pdev); diff --git a/trunk/drivers/hwmon/pc87427.c b/trunk/drivers/hwmon/pc87427.c index 9ec4daaf6ca6..3170b26d2443 100644 --- a/trunk/drivers/hwmon/pc87427.c +++ b/trunk/drivers/hwmon/pc87427.c @@ -1,7 +1,7 @@ /* * pc87427.c - hardware monitoring driver for the * National Semiconductor PC87427 Super-I/O chip - * Copyright (C) 2006, 2008, 2010 Jean Delvare + * Copyright (C) 2006 Jean Delvare * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -15,11 +15,10 @@ * Supports the following chips: * * Chip #vin #fan #pwm #temp devid - * PC87427 - 8 4 6 0xF2 + * PC87427 - 8 - - 0xF2 * * This driver assumes that no more than one chip is present. - * Only fans are fully supported so far. Temperatures are in read-only - * mode, and voltages aren't supported at all. + * Only fan inputs are supported so far, although the chip can do much more. */ #include @@ -58,25 +57,6 @@ struct pc87427_data { u16 fan[8]; /* register values */ u16 fan_min[8]; /* register values */ u8 fan_status[8]; /* register values */ - - u8 pwm_enabled; /* bit vector */ - u8 pwm_auto_ok; /* bit vector */ - u8 pwm_enable[4]; /* register values */ - u8 pwm[4]; /* register values */ - - u8 temp_enabled; /* bit vector */ - s16 temp[6]; /* register values */ - s8 temp_min[6]; /* register values */ - s8 temp_max[6]; /* register values */ - s8 temp_crit[6]; /* register values */ - u8 temp_status[6]; /* register values */ - u8 temp_type[6]; /* register values */ -}; - -struct pc87427_sio_data { - unsigned short address[2]; - u8 has_fanin; - u8 has_fanout; }; /* @@ -85,13 +65,6 @@ struct pc87427_sio_data { #define SIOREG_LDSEL 0x07 /* Logical device select */ #define SIOREG_DEVID 0x20 /* Device ID */ -#define SIOREG_CF2 0x22 /* Configuration 2 */ -#define SIOREG_CF3 0x23 /* Configuration 3 */ -#define SIOREG_CF4 0x24 /* Configuration 4 */ -#define SIOREG_CF5 0x25 /* Configuration 5 */ -#define SIOREG_CFB 0x2B /* Configuration B */ -#define SIOREG_CFC 0x2C /* Configuration C */ -#define SIOREG_CFD 0x2D /* Configuration D */ #define SIOREG_ACT 0x30 /* Device activation */ #define SIOREG_MAP 0x50 /* I/O or memory mapping */ #define SIOREG_IOBASE 0x60 /* I/O base address */ @@ -129,8 +102,6 @@ static inline void superio_exit(int sioaddr) #define BANK_FM(nr) (nr) #define BANK_FT(nr) (0x08 + (nr)) #define BANK_FC(nr) (0x10 + (nr) * 2) -#define BANK_TM(nr) (nr) -#define BANK_VM(nr) (0x08 + (nr)) /* * I/O access functions @@ -207,127 +178,6 @@ static inline u16 fan_to_reg(unsigned long val) return ((1350000UL + val / 2) / val) << 2; } -/* - * PWM registers and conversions - */ - -#define PC87427_REG_PWM_ENABLE 0x10 -#define PC87427_REG_PWM_DUTY 0x12 - -#define PWM_ENABLE_MODE_MASK (7 << 4) -#define PWM_ENABLE_CTLEN (1 << 0) - -#define PWM_MODE_MANUAL (0 << 4) -#define PWM_MODE_AUTO (1 << 4) -#define PWM_MODE_OFF (2 << 4) -#define PWM_MODE_ON (7 << 4) - -/* Dedicated function to read all registers related to a given PWM output. - This saves us quite a few locks and bank selections. - Must be called with data->lock held. - nr is from 0 to 3 */ -static void pc87427_readall_pwm(struct pc87427_data *data, u8 nr) -{ - int iobase = data->address[LD_FAN]; - - outb(BANK_FC(nr), iobase + PC87427_REG_BANK); - data->pwm_enable[nr] = inb(iobase + PC87427_REG_PWM_ENABLE); - data->pwm[nr] = inb(iobase + PC87427_REG_PWM_DUTY); -} - -static inline int pwm_enable_from_reg(u8 reg) -{ - switch (reg & PWM_ENABLE_MODE_MASK) { - case PWM_MODE_ON: - return 0; - case PWM_MODE_MANUAL: - case PWM_MODE_OFF: - return 1; - case PWM_MODE_AUTO: - return 2; - default: - return -EPROTO; - } -} - -static inline u8 pwm_enable_to_reg(unsigned long val, u8 pwmval) -{ - switch (val) { - default: - return PWM_MODE_ON; - case 1: - return pwmval ? PWM_MODE_MANUAL : PWM_MODE_OFF; - case 2: - return PWM_MODE_AUTO; - } -} - -/* - * Temperature registers and conversions - */ - -#define PC87427_REG_TEMP_STATUS 0x10 -#define PC87427_REG_TEMP 0x14 -#define PC87427_REG_TEMP_MAX 0x18 -#define PC87427_REG_TEMP_MIN 0x19 -#define PC87427_REG_TEMP_CRIT 0x1a -#define PC87427_REG_TEMP_TYPE 0x1d - -#define TEMP_STATUS_CHANEN (1 << 0) -#define TEMP_STATUS_LOWFLG (1 << 1) -#define TEMP_STATUS_HIGHFLG (1 << 2) -#define TEMP_STATUS_CRITFLG (1 << 3) -#define TEMP_STATUS_SENSERR (1 << 5) -#define TEMP_TYPE_MASK (3 << 5) - -#define TEMP_TYPE_THERMISTOR (1 << 5) -#define TEMP_TYPE_REMOTE_DIODE (2 << 5) -#define TEMP_TYPE_LOCAL_DIODE (3 << 5) - -/* Dedicated function to read all registers related to a given temperature - input. This saves us quite a few locks and bank selections. - Must be called with data->lock held. - nr is from 0 to 5 */ -static void pc87427_readall_temp(struct pc87427_data *data, u8 nr) -{ - int iobase = data->address[LD_TEMP]; - - outb(BANK_TM(nr), iobase + PC87427_REG_BANK); - data->temp[nr] = le16_to_cpu(inw(iobase + PC87427_REG_TEMP)); - data->temp_max[nr] = inb(iobase + PC87427_REG_TEMP_MAX); - data->temp_min[nr] = inb(iobase + PC87427_REG_TEMP_MIN); - data->temp_crit[nr] = inb(iobase + PC87427_REG_TEMP_CRIT); - data->temp_type[nr] = inb(iobase + PC87427_REG_TEMP_TYPE); - data->temp_status[nr] = inb(iobase + PC87427_REG_TEMP_STATUS); - /* Clear fan alarm bits */ - outb(data->temp_status[nr], iobase + PC87427_REG_TEMP_STATUS); -} - -static inline unsigned int temp_type_from_reg(u8 reg) -{ - switch (reg & TEMP_TYPE_MASK) { - case TEMP_TYPE_THERMISTOR: - return 4; - case TEMP_TYPE_REMOTE_DIODE: - case TEMP_TYPE_LOCAL_DIODE: - return 3; - default: - return 0; - } -} - -/* We assume 8-bit thermal sensors; 9-bit thermal sensors are possible - too, but I have no idea how to figure out when they are used. */ -static inline long temp_from_reg(s16 reg) -{ - return reg * 1000 / 256; -} - -static inline long temp_from_reg8(s8 reg) -{ - return reg * 1000; -} - /* * Data interface */ @@ -348,21 +198,6 @@ static struct pc87427_data *pc87427_update_device(struct device *dev) continue; pc87427_readall_fan(data, i); } - - /* PWM outputs */ - for (i = 0; i < 4; i++) { - if (!(data->pwm_enabled & (1 << i))) - continue; - pc87427_readall_pwm(data, i); - } - - /* Temperature channels */ - for (i = 0; i < 6; i++) { - if (!(data->temp_enabled & (1 << i))) - continue; - pc87427_readall_temp(data, i); - } - data->last_updated = jiffies; done: @@ -373,8 +208,9 @@ static struct pc87427_data *pc87427_update_device(struct device *dev) static ssize_t show_fan_input(struct device *dev, struct device_attribute *devattr, char *buf) { + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); struct pc87427_data *data = pc87427_update_device(dev); - int nr = to_sensor_dev_attr(devattr)->index; + int nr = attr->index; return sprintf(buf, "%lu\n", fan_from_reg(data->fan[nr])); } @@ -382,8 +218,9 @@ static ssize_t show_fan_input(struct device *dev, struct device_attribute static ssize_t show_fan_min(struct device *dev, struct device_attribute *devattr, char *buf) { + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); struct pc87427_data *data = pc87427_update_device(dev); - int nr = to_sensor_dev_attr(devattr)->index; + int nr = attr->index; return sprintf(buf, "%lu\n", fan_from_reg(data->fan_min[nr])); } @@ -391,8 +228,9 @@ static ssize_t show_fan_min(struct device *dev, struct device_attribute static ssize_t show_fan_alarm(struct device *dev, struct device_attribute *devattr, char *buf) { + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); struct pc87427_data *data = pc87427_update_device(dev); - int nr = to_sensor_dev_attr(devattr)->index; + int nr = attr->index; return sprintf(buf, "%d\n", !!(data->fan_status[nr] & FAN_STATUS_LOSPD)); @@ -401,8 +239,9 @@ static ssize_t show_fan_alarm(struct device *dev, struct device_attribute static ssize_t show_fan_fault(struct device *dev, struct device_attribute *devattr, char *buf) { + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); struct pc87427_data *data = pc87427_update_device(dev); - int nr = to_sensor_dev_attr(devattr)->index; + int nr = attr->index; return sprintf(buf, "%d\n", !!(data->fan_status[nr] & FAN_STATUS_STALL)); @@ -412,13 +251,11 @@ static ssize_t set_fan_min(struct device *dev, struct device_attribute *devattr, const char *buf, size_t count) { struct pc87427_data *data = dev_get_drvdata(dev); - int nr = to_sensor_dev_attr(devattr)->index; - unsigned long val; + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + int nr = attr->index; + unsigned long val = simple_strtoul(buf, NULL, 10); int iobase = data->address[LD_FAN]; - if (strict_strtoul(buf, 10, &val) < 0) - return -EINVAL; - mutex_lock(&data->lock); outb(BANK_FM(nr), iobase + PC87427_REG_BANK); /* The low speed limit registers are read-only while monitoring @@ -540,390 +377,6 @@ static const struct attribute_group pc87427_group_fan[8] = { { .attrs = pc87427_attributes_fan[7] }, }; -/* Must be called with data->lock held and pc87427_readall_pwm() freshly - called */ -static void update_pwm_enable(struct pc87427_data *data, int nr, u8 mode) -{ - int iobase = data->address[LD_FAN]; - data->pwm_enable[nr] &= ~PWM_ENABLE_MODE_MASK; - data->pwm_enable[nr] |= mode; - outb(data->pwm_enable[nr], iobase + PC87427_REG_PWM_ENABLE); -} - -static ssize_t show_pwm_enable(struct device *dev, struct device_attribute - *devattr, char *buf) -{ - struct pc87427_data *data = pc87427_update_device(dev); - int nr = to_sensor_dev_attr(devattr)->index; - int pwm_enable; - - pwm_enable = pwm_enable_from_reg(data->pwm_enable[nr]); - if (pwm_enable < 0) - return pwm_enable; - return sprintf(buf, "%d\n", pwm_enable); -} - -static ssize_t set_pwm_enable(struct device *dev, struct device_attribute - *devattr, const char *buf, size_t count) -{ - struct pc87427_data *data = dev_get_drvdata(dev); - int nr = to_sensor_dev_attr(devattr)->index; - unsigned long val; - - if (strict_strtoul(buf, 10, &val) < 0 || val > 2) - return -EINVAL; - /* Can't go to automatic mode if it isn't configured */ - if (val == 2 && !(data->pwm_auto_ok & (1 << nr))) - return -EINVAL; - - mutex_lock(&data->lock); - pc87427_readall_pwm(data, nr); - update_pwm_enable(data, nr, pwm_enable_to_reg(val, data->pwm[nr])); - mutex_unlock(&data->lock); - - return count; -} - -static ssize_t show_pwm(struct device *dev, struct device_attribute - *devattr, char *buf) -{ - struct pc87427_data *data = pc87427_update_device(dev); - int nr = to_sensor_dev_attr(devattr)->index; - - return sprintf(buf, "%d\n", (int)data->pwm[nr]); -} - -static ssize_t set_pwm(struct device *dev, struct device_attribute - *devattr, const char *buf, size_t count) -{ - struct pc87427_data *data = dev_get_drvdata(dev); - int nr = to_sensor_dev_attr(devattr)->index; - unsigned long val; - int iobase = data->address[LD_FAN]; - u8 mode; - - if (strict_strtoul(buf, 10, &val) < 0 || val > 0xff) - return -EINVAL; - - mutex_lock(&data->lock); - pc87427_readall_pwm(data, nr); - mode = data->pwm_enable[nr] & PWM_ENABLE_MODE_MASK; - if (mode != PWM_MODE_MANUAL && mode != PWM_MODE_OFF) { - dev_notice(dev, "Can't set PWM%d duty cycle while not in " - "manual mode\n", nr + 1); - mutex_unlock(&data->lock); - return -EPERM; - } - - /* We may have to change the mode */ - if (mode == PWM_MODE_MANUAL && val == 0) { - /* Transition from Manual to Off */ - update_pwm_enable(data, nr, PWM_MODE_OFF); - mode = PWM_MODE_OFF; - dev_dbg(dev, "Switching PWM%d from %s to %s\n", nr + 1, - "manual", "off"); - } else if (mode == PWM_MODE_OFF && val != 0) { - /* Transition from Off to Manual */ - update_pwm_enable(data, nr, PWM_MODE_MANUAL); - mode = PWM_MODE_MANUAL; - dev_dbg(dev, "Switching PWM%d from %s to %s\n", nr + 1, - "off", "manual"); - } - - data->pwm[nr] = val; - if (mode == PWM_MODE_MANUAL) - outb(val, iobase + PC87427_REG_PWM_DUTY); - mutex_unlock(&data->lock); - - return count; -} - -static SENSOR_DEVICE_ATTR(pwm1_enable, S_IWUSR | S_IRUGO, - show_pwm_enable, set_pwm_enable, 0); -static SENSOR_DEVICE_ATTR(pwm2_enable, S_IWUSR | S_IRUGO, - show_pwm_enable, set_pwm_enable, 1); -static SENSOR_DEVICE_ATTR(pwm3_enable, S_IWUSR | S_IRUGO, - show_pwm_enable, set_pwm_enable, 2); -static SENSOR_DEVICE_ATTR(pwm4_enable, S_IWUSR | S_IRUGO, - show_pwm_enable, set_pwm_enable, 3); - -static SENSOR_DEVICE_ATTR(pwm1, S_IWUSR | S_IRUGO, show_pwm, set_pwm, 0); -static SENSOR_DEVICE_ATTR(pwm2, S_IWUSR | S_IRUGO, show_pwm, set_pwm, 1); -static SENSOR_DEVICE_ATTR(pwm3, S_IWUSR | S_IRUGO, show_pwm, set_pwm, 2); -static SENSOR_DEVICE_ATTR(pwm4, S_IWUSR | S_IRUGO, show_pwm, set_pwm, 3); - -static struct attribute *pc87427_attributes_pwm[4][3] = { - { - &sensor_dev_attr_pwm1_enable.dev_attr.attr, - &sensor_dev_attr_pwm1.dev_attr.attr, - NULL - }, { - &sensor_dev_attr_pwm2_enable.dev_attr.attr, - &sensor_dev_attr_pwm2.dev_attr.attr, - NULL - }, { - &sensor_dev_attr_pwm3_enable.dev_attr.attr, - &sensor_dev_attr_pwm3.dev_attr.attr, - NULL - }, { - &sensor_dev_attr_pwm4_enable.dev_attr.attr, - &sensor_dev_attr_pwm4.dev_attr.attr, - NULL - } -}; - -static const struct attribute_group pc87427_group_pwm[4] = { - { .attrs = pc87427_attributes_pwm[0] }, - { .attrs = pc87427_attributes_pwm[1] }, - { .attrs = pc87427_attributes_pwm[2] }, - { .attrs = pc87427_attributes_pwm[3] }, -}; - -static ssize_t show_temp_input(struct device *dev, struct device_attribute - *devattr, char *buf) -{ - struct pc87427_data *data = pc87427_update_device(dev); - int nr = to_sensor_dev_attr(devattr)->index; - - return sprintf(buf, "%ld\n", temp_from_reg(data->temp[nr])); -} - -static ssize_t show_temp_min(struct device *dev, struct device_attribute - *devattr, char *buf) -{ - struct pc87427_data *data = pc87427_update_device(dev); - int nr = to_sensor_dev_attr(devattr)->index; - - return sprintf(buf, "%ld\n", temp_from_reg8(data->temp_min[nr])); -} - -static ssize_t show_temp_max(struct device *dev, struct device_attribute - *devattr, char *buf) -{ - struct pc87427_data *data = pc87427_update_device(dev); - int nr = to_sensor_dev_attr(devattr)->index; - - return sprintf(buf, "%ld\n", temp_from_reg8(data->temp_max[nr])); -} - -static ssize_t show_temp_crit(struct device *dev, struct device_attribute - *devattr, char *buf) -{ - struct pc87427_data *data = pc87427_update_device(dev); - int nr = to_sensor_dev_attr(devattr)->index; - - return sprintf(buf, "%ld\n", temp_from_reg8(data->temp_crit[nr])); -} - -static ssize_t show_temp_type(struct device *dev, struct device_attribute - *devattr, char *buf) -{ - struct pc87427_data *data = pc87427_update_device(dev); - int nr = to_sensor_dev_attr(devattr)->index; - - return sprintf(buf, "%u\n", temp_type_from_reg(data->temp_type[nr])); -} - -static ssize_t show_temp_min_alarm(struct device *dev, struct device_attribute - *devattr, char *buf) -{ - struct pc87427_data *data = pc87427_update_device(dev); - int nr = to_sensor_dev_attr(devattr)->index; - - return sprintf(buf, "%d\n", !!(data->temp_status[nr] - & TEMP_STATUS_LOWFLG)); -} - -static ssize_t show_temp_max_alarm(struct device *dev, struct device_attribute - *devattr, char *buf) -{ - struct pc87427_data *data = pc87427_update_device(dev); - int nr = to_sensor_dev_attr(devattr)->index; - - return sprintf(buf, "%d\n", !!(data->temp_status[nr] - & TEMP_STATUS_HIGHFLG)); -} - -static ssize_t show_temp_crit_alarm(struct device *dev, struct device_attribute - *devattr, char *buf) -{ - struct pc87427_data *data = pc87427_update_device(dev); - int nr = to_sensor_dev_attr(devattr)->index; - - return sprintf(buf, "%d\n", !!(data->temp_status[nr] - & TEMP_STATUS_CRITFLG)); -} - -static ssize_t show_temp_fault(struct device *dev, struct device_attribute - *devattr, char *buf) -{ - struct pc87427_data *data = pc87427_update_device(dev); - int nr = to_sensor_dev_attr(devattr)->index; - - return sprintf(buf, "%d\n", !!(data->temp_status[nr] - & TEMP_STATUS_SENSERR)); -} - -static SENSOR_DEVICE_ATTR(temp1_input, S_IRUGO, show_temp_input, NULL, 0); -static SENSOR_DEVICE_ATTR(temp2_input, S_IRUGO, show_temp_input, NULL, 1); -static SENSOR_DEVICE_ATTR(temp3_input, S_IRUGO, show_temp_input, NULL, 2); -static SENSOR_DEVICE_ATTR(temp4_input, S_IRUGO, show_temp_input, NULL, 3); -static SENSOR_DEVICE_ATTR(temp5_input, S_IRUGO, show_temp_input, NULL, 4); -static SENSOR_DEVICE_ATTR(temp6_input, S_IRUGO, show_temp_input, NULL, 5); - -static SENSOR_DEVICE_ATTR(temp1_min, S_IRUGO, show_temp_min, NULL, 0); -static SENSOR_DEVICE_ATTR(temp2_min, S_IRUGO, show_temp_min, NULL, 1); -static SENSOR_DEVICE_ATTR(temp3_min, S_IRUGO, show_temp_min, NULL, 2); -static SENSOR_DEVICE_ATTR(temp4_min, S_IRUGO, show_temp_min, NULL, 3); -static SENSOR_DEVICE_ATTR(temp5_min, S_IRUGO, show_temp_min, NULL, 4); -static SENSOR_DEVICE_ATTR(temp6_min, S_IRUGO, show_temp_min, NULL, 5); - -static SENSOR_DEVICE_ATTR(temp1_max, S_IRUGO, show_temp_max, NULL, 0); -static SENSOR_DEVICE_ATTR(temp2_max, S_IRUGO, show_temp_max, NULL, 1); -static SENSOR_DEVICE_ATTR(temp3_max, S_IRUGO, show_temp_max, NULL, 2); -static SENSOR_DEVICE_ATTR(temp4_max, S_IRUGO, show_temp_max, NULL, 3); -static SENSOR_DEVICE_ATTR(temp5_max, S_IRUGO, show_temp_max, NULL, 4); -static SENSOR_DEVICE_ATTR(temp6_max, S_IRUGO, show_temp_max, NULL, 5); - -static SENSOR_DEVICE_ATTR(temp1_crit, S_IRUGO, show_temp_crit, NULL, 0); -static SENSOR_DEVICE_ATTR(temp2_crit, S_IRUGO, show_temp_crit, NULL, 1); -static SENSOR_DEVICE_ATTR(temp3_crit, S_IRUGO, show_temp_crit, NULL, 2); -static SENSOR_DEVICE_ATTR(temp4_crit, S_IRUGO, show_temp_crit, NULL, 3); -static SENSOR_DEVICE_ATTR(temp5_crit, S_IRUGO, show_temp_crit, NULL, 4); -static SENSOR_DEVICE_ATTR(temp6_crit, S_IRUGO, show_temp_crit, NULL, 5); - -static SENSOR_DEVICE_ATTR(temp1_type, S_IRUGO, show_temp_type, NULL, 0); -static SENSOR_DEVICE_ATTR(temp2_type, S_IRUGO, show_temp_type, NULL, 1); -static SENSOR_DEVICE_ATTR(temp3_type, S_IRUGO, show_temp_type, NULL, 2); -static SENSOR_DEVICE_ATTR(temp4_type, S_IRUGO, show_temp_type, NULL, 3); -static SENSOR_DEVICE_ATTR(temp5_type, S_IRUGO, show_temp_type, NULL, 4); -static SENSOR_DEVICE_ATTR(temp6_type, S_IRUGO, show_temp_type, NULL, 5); - -static SENSOR_DEVICE_ATTR(temp1_min_alarm, S_IRUGO, - show_temp_min_alarm, NULL, 0); -static SENSOR_DEVICE_ATTR(temp2_min_alarm, S_IRUGO, - show_temp_min_alarm, NULL, 1); -static SENSOR_DEVICE_ATTR(temp3_min_alarm, S_IRUGO, - show_temp_min_alarm, NULL, 2); -static SENSOR_DEVICE_ATTR(temp4_min_alarm, S_IRUGO, - show_temp_min_alarm, NULL, 3); -static SENSOR_DEVICE_ATTR(temp5_min_alarm, S_IRUGO, - show_temp_min_alarm, NULL, 4); -static SENSOR_DEVICE_ATTR(temp6_min_alarm, S_IRUGO, - show_temp_min_alarm, NULL, 5); - -static SENSOR_DEVICE_ATTR(temp1_max_alarm, S_IRUGO, - show_temp_max_alarm, NULL, 0); -static SENSOR_DEVICE_ATTR(temp2_max_alarm, S_IRUGO, - show_temp_max_alarm, NULL, 1); -static SENSOR_DEVICE_ATTR(temp3_max_alarm, S_IRUGO, - show_temp_max_alarm, NULL, 2); -static SENSOR_DEVICE_ATTR(temp4_max_alarm, S_IRUGO, - show_temp_max_alarm, NULL, 3); -static SENSOR_DEVICE_ATTR(temp5_max_alarm, S_IRUGO, - show_temp_max_alarm, NULL, 4); -static SENSOR_DEVICE_ATTR(temp6_max_alarm, S_IRUGO, - show_temp_max_alarm, NULL, 5); - -static SENSOR_DEVICE_ATTR(temp1_crit_alarm, S_IRUGO, - show_temp_crit_alarm, NULL, 0); -static SENSOR_DEVICE_ATTR(temp2_crit_alarm, S_IRUGO, - show_temp_crit_alarm, NULL, 1); -static SENSOR_DEVICE_ATTR(temp3_crit_alarm, S_IRUGO, - show_temp_crit_alarm, NULL, 2); -static SENSOR_DEVICE_ATTR(temp4_crit_alarm, S_IRUGO, - show_temp_crit_alarm, NULL, 3); -static SENSOR_DEVICE_ATTR(temp5_crit_alarm, S_IRUGO, - show_temp_crit_alarm, NULL, 4); -static SENSOR_DEVICE_ATTR(temp6_crit_alarm, S_IRUGO, - show_temp_crit_alarm, NULL, 5); - -static SENSOR_DEVICE_ATTR(temp1_fault, S_IRUGO, show_temp_fault, NULL, 0); -static SENSOR_DEVICE_ATTR(temp2_fault, S_IRUGO, show_temp_fault, NULL, 1); -static SENSOR_DEVICE_ATTR(temp3_fault, S_IRUGO, show_temp_fault, NULL, 2); -static SENSOR_DEVICE_ATTR(temp4_fault, S_IRUGO, show_temp_fault, NULL, 3); -static SENSOR_DEVICE_ATTR(temp5_fault, S_IRUGO, show_temp_fault, NULL, 4); -static SENSOR_DEVICE_ATTR(temp6_fault, S_IRUGO, show_temp_fault, NULL, 5); - -static struct attribute *pc87427_attributes_temp[6][10] = { - { - &sensor_dev_attr_temp1_input.dev_attr.attr, - &sensor_dev_attr_temp1_min.dev_attr.attr, - &sensor_dev_attr_temp1_max.dev_attr.attr, - &sensor_dev_attr_temp1_crit.dev_attr.attr, - &sensor_dev_attr_temp1_type.dev_attr.attr, - &sensor_dev_attr_temp1_min_alarm.dev_attr.attr, - &sensor_dev_attr_temp1_max_alarm.dev_attr.attr, - &sensor_dev_attr_temp1_crit_alarm.dev_attr.attr, - &sensor_dev_attr_temp1_fault.dev_attr.attr, - NULL - }, { - &sensor_dev_attr_temp2_input.dev_attr.attr, - &sensor_dev_attr_temp2_min.dev_attr.attr, - &sensor_dev_attr_temp2_max.dev_attr.attr, - &sensor_dev_attr_temp2_crit.dev_attr.attr, - &sensor_dev_attr_temp2_type.dev_attr.attr, - &sensor_dev_attr_temp2_min_alarm.dev_attr.attr, - &sensor_dev_attr_temp2_max_alarm.dev_attr.attr, - &sensor_dev_attr_temp2_crit_alarm.dev_attr.attr, - &sensor_dev_attr_temp2_fault.dev_attr.attr, - NULL - }, { - &sensor_dev_attr_temp3_input.dev_attr.attr, - &sensor_dev_attr_temp3_min.dev_attr.attr, - &sensor_dev_attr_temp3_max.dev_attr.attr, - &sensor_dev_attr_temp3_crit.dev_attr.attr, - &sensor_dev_attr_temp3_type.dev_attr.attr, - &sensor_dev_attr_temp3_min_alarm.dev_attr.attr, - &sensor_dev_attr_temp3_max_alarm.dev_attr.attr, - &sensor_dev_attr_temp3_crit_alarm.dev_attr.attr, - &sensor_dev_attr_temp3_fault.dev_attr.attr, - NULL - }, { - &sensor_dev_attr_temp4_input.dev_attr.attr, - &sensor_dev_attr_temp4_min.dev_attr.attr, - &sensor_dev_attr_temp4_max.dev_attr.attr, - &sensor_dev_attr_temp4_crit.dev_attr.attr, - &sensor_dev_attr_temp4_type.dev_attr.attr, - &sensor_dev_attr_temp4_min_alarm.dev_attr.attr, - &sensor_dev_attr_temp4_max_alarm.dev_attr.attr, - &sensor_dev_attr_temp4_crit_alarm.dev_attr.attr, - &sensor_dev_attr_temp4_fault.dev_attr.attr, - NULL - }, { - &sensor_dev_attr_temp5_input.dev_attr.attr, - &sensor_dev_attr_temp5_min.dev_attr.attr, - &sensor_dev_attr_temp5_max.dev_attr.attr, - &sensor_dev_attr_temp5_crit.dev_attr.attr, - &sensor_dev_attr_temp5_type.dev_attr.attr, - &sensor_dev_attr_temp5_min_alarm.dev_attr.attr, - &sensor_dev_attr_temp5_max_alarm.dev_attr.attr, - &sensor_dev_attr_temp5_crit_alarm.dev_attr.attr, - &sensor_dev_attr_temp5_fault.dev_attr.attr, - NULL - }, { - &sensor_dev_attr_temp6_input.dev_attr.attr, - &sensor_dev_attr_temp6_min.dev_attr.attr, - &sensor_dev_attr_temp6_max.dev_attr.attr, - &sensor_dev_attr_temp6_crit.dev_attr.attr, - &sensor_dev_attr_temp6_type.dev_attr.attr, - &sensor_dev_attr_temp6_min_alarm.dev_attr.attr, - &sensor_dev_attr_temp6_max_alarm.dev_attr.attr, - &sensor_dev_attr_temp6_crit_alarm.dev_attr.attr, - &sensor_dev_attr_temp6_fault.dev_attr.attr, - NULL - } -}; - -static const struct attribute_group pc87427_group_temp[6] = { - { .attrs = pc87427_attributes_temp[0] }, - { .attrs = pc87427_attributes_temp[1] }, - { .attrs = pc87427_attributes_temp[2] }, - { .attrs = pc87427_attributes_temp[3] }, - { .attrs = pc87427_attributes_temp[4] }, - { .attrs = pc87427_attributes_temp[5] }, -}; - static ssize_t show_name(struct device *dev, struct device_attribute *devattr, char *buf) { @@ -938,49 +391,8 @@ static DEVICE_ATTR(name, S_IRUGO, show_name, NULL); * Device detection, attach and detach */ -static void pc87427_release_regions(struct platform_device *pdev, int count) -{ - struct resource *res; - int i; - - for (i = 0; i < count; i++) { - res = platform_get_resource(pdev, IORESOURCE_IO, i); - release_region(res->start, resource_size(res)); - } -} - -static int __devinit pc87427_request_regions(struct platform_device *pdev, - int count) -{ - struct resource *res; - int i, err = 0; - - for (i = 0; i < count; i++) { - res = platform_get_resource(pdev, IORESOURCE_IO, i); - if (!res) { - err = -ENOENT; - dev_err(&pdev->dev, "Missing resource #%d\n", i); - break; - } - if (!request_region(res->start, resource_size(res), DRVNAME)) { - err = -EBUSY; - dev_err(&pdev->dev, - "Failed to request region 0x%lx-0x%lx\n", - (unsigned long)res->start, - (unsigned long)res->end); - break; - } - } - - if (err && i) - pc87427_release_regions(pdev, i); - - return err; -} - static void __devinit pc87427_init_device(struct device *dev) { - struct pc87427_sio_data *sio_data = dev->platform_data; struct pc87427_data *data = dev_get_drvdata(dev); int i; u8 reg; @@ -988,12 +400,10 @@ static void __devinit pc87427_init_device(struct device *dev) /* The FMC module should be ready */ reg = pc87427_read8(data, LD_FAN, PC87427_REG_BANK); if (!(reg & 0x80)) - dev_warn(dev, "%s module not ready!\n", "FMC"); + dev_warn(dev, "FMC module not ready!\n"); /* Check which fans are enabled */ for (i = 0; i < 8; i++) { - if (!(sio_data->has_fanin & (1 << i))) /* Not wired */ - continue; reg = pc87427_read8_bank(data, LD_FAN, BANK_FM(i), PC87427_REG_FAN_STATUS); if (reg & FAN_STATUS_MONEN) @@ -1001,93 +411,37 @@ static void __devinit pc87427_init_device(struct device *dev) } if (!data->fan_enabled) { - dev_dbg(dev, "Enabling monitoring of all fans\n"); - for (i = 0; i < 8; i++) { - if (!(sio_data->has_fanin & (1 << i))) /* Not wired */ - continue; + dev_dbg(dev, "Enabling all fan inputs\n"); + for (i = 0; i < 8; i++) pc87427_write8_bank(data, LD_FAN, BANK_FM(i), PC87427_REG_FAN_STATUS, FAN_STATUS_MONEN); - } - data->fan_enabled = sio_data->has_fanin; - } - - /* Check which PWM outputs are enabled */ - for (i = 0; i < 4; i++) { - if (!(sio_data->has_fanout & (1 << i))) /* Not wired */ - continue; - reg = pc87427_read8_bank(data, LD_FAN, BANK_FC(i), - PC87427_REG_PWM_ENABLE); - if (reg & PWM_ENABLE_CTLEN) - data->pwm_enabled |= (1 << i); - - /* We don't expose an interface to reconfigure the automatic - fan control mode, so only allow to return to this mode if - it was originally set. */ - if ((reg & PWM_ENABLE_MODE_MASK) == PWM_MODE_AUTO) { - dev_dbg(dev, "PWM%d is in automatic control mode\n", - i + 1); - data->pwm_auto_ok |= (1 << i); - } - } - - /* The HMC module should be ready */ - reg = pc87427_read8(data, LD_TEMP, PC87427_REG_BANK); - if (!(reg & 0x80)) - dev_warn(dev, "%s module not ready!\n", "HMC"); - - /* Check which temperature channels are enabled */ - for (i = 0; i < 6; i++) { - reg = pc87427_read8_bank(data, LD_TEMP, BANK_TM(i), - PC87427_REG_TEMP_STATUS); - if (reg & TEMP_STATUS_CHANEN) - data->temp_enabled |= (1 << i); - } -} - -static void pc87427_remove_files(struct device *dev) -{ - struct pc87427_data *data = dev_get_drvdata(dev); - int i; - - device_remove_file(dev, &dev_attr_name); - for (i = 0; i < 8; i++) { - if (!(data->fan_enabled & (1 << i))) - continue; - sysfs_remove_group(&dev->kobj, &pc87427_group_fan[i]); - } - for (i = 0; i < 4; i++) { - if (!(data->pwm_enabled & (1 << i))) - continue; - sysfs_remove_group(&dev->kobj, &pc87427_group_pwm[i]); - } - for (i = 0; i < 6; i++) { - if (!(data->temp_enabled & (1 << i))) - continue; - sysfs_remove_group(&dev->kobj, &pc87427_group_temp[i]); + data->fan_enabled = 0xff; } } static int __devinit pc87427_probe(struct platform_device *pdev) { - struct pc87427_sio_data *sio_data = pdev->dev.platform_data; struct pc87427_data *data; - int i, err, res_count; + struct resource *res; + int i, err; - data = kzalloc(sizeof(struct pc87427_data), GFP_KERNEL); - if (!data) { + if (!(data = kzalloc(sizeof(struct pc87427_data), GFP_KERNEL))) { err = -ENOMEM; printk(KERN_ERR DRVNAME ": Out of memory\n"); goto exit; } - data->address[0] = sio_data->address[0]; - data->address[1] = sio_data->address[1]; - res_count = (data->address[0] != 0) + (data->address[1] != 0); - - err = pc87427_request_regions(pdev, res_count); - if (err) + /* This will need to be revisited when we add support for + temperature and voltage monitoring. */ + res = platform_get_resource(pdev, IORESOURCE_IO, 0); + if (!request_region(res->start, resource_size(res), DRVNAME)) { + err = -EBUSY; + dev_err(&pdev->dev, "Failed to request region 0x%lx-0x%lx\n", + (unsigned long)res->start, (unsigned long)res->end); goto exit_kfree; + } + data->address[0] = res->start; mutex_init(&data->lock); data->name = "pc87427"; @@ -1095,31 +449,13 @@ static int __devinit pc87427_probe(struct platform_device *pdev) pc87427_init_device(&pdev->dev); /* Register sysfs hooks */ - err = device_create_file(&pdev->dev, &dev_attr_name); - if (err) + if ((err = device_create_file(&pdev->dev, &dev_attr_name))) goto exit_release_region; for (i = 0; i < 8; i++) { if (!(data->fan_enabled & (1 << i))) continue; - err = sysfs_create_group(&pdev->dev.kobj, - &pc87427_group_fan[i]); - if (err) - goto exit_remove_files; - } - for (i = 0; i < 4; i++) { - if (!(data->pwm_enabled & (1 << i))) - continue; - err = sysfs_create_group(&pdev->dev.kobj, - &pc87427_group_pwm[i]); - if (err) - goto exit_remove_files; - } - for (i = 0; i < 6; i++) { - if (!(data->temp_enabled & (1 << i))) - continue; - err = sysfs_create_group(&pdev->dev.kobj, - &pc87427_group_temp[i]); - if (err) + if ((err = sysfs_create_group(&pdev->dev.kobj, + &pc87427_group_fan[i]))) goto exit_remove_files; } @@ -1133,9 +469,13 @@ static int __devinit pc87427_probe(struct platform_device *pdev) return 0; exit_remove_files: - pc87427_remove_files(&pdev->dev); + for (i = 0; i < 8; i++) { + if (!(data->fan_enabled & (1 << i))) + continue; + sysfs_remove_group(&pdev->dev.kobj, &pc87427_group_fan[i]); + } exit_release_region: - pc87427_release_regions(pdev, res_count); + release_region(res->start, resource_size(res)); exit_kfree: platform_set_drvdata(pdev, NULL); kfree(data); @@ -1146,16 +486,21 @@ static int __devinit pc87427_probe(struct platform_device *pdev) static int __devexit pc87427_remove(struct platform_device *pdev) { struct pc87427_data *data = platform_get_drvdata(pdev); - int res_count; - - res_count = (data->address[0] != 0) + (data->address[1] != 0); + struct resource *res; + int i; hwmon_device_unregister(data->hwmon_dev); - pc87427_remove_files(&pdev->dev); + device_remove_file(&pdev->dev, &dev_attr_name); + for (i = 0; i < 8; i++) { + if (!(data->fan_enabled & (1 << i))) + continue; + sysfs_remove_group(&pdev->dev.kobj, &pc87427_group_fan[i]); + } platform_set_drvdata(pdev, NULL); kfree(data); - pc87427_release_regions(pdev, res_count); + res = platform_get_resource(pdev, IORESOURCE_IO, 0); + release_region(res->start, resource_size(res)); return 0; } @@ -1170,50 +515,34 @@ static struct platform_driver pc87427_driver = { .remove = __devexit_p(pc87427_remove), }; -static int __init pc87427_device_add(const struct pc87427_sio_data *sio_data) +static int __init pc87427_device_add(unsigned short address) { - struct resource res[2] = { - { .flags = IORESOURCE_IO }, - { .flags = IORESOURCE_IO }, + struct resource res = { + .start = address, + .end = address + REGION_LENGTH - 1, + .name = logdev_str[0], + .flags = IORESOURCE_IO, }; - int err, i, res_count; - - res_count = 0; - for (i = 0; i < 2; i++) { - if (!sio_data->address[i]) - continue; - res[res_count].start = sio_data->address[i]; - res[res_count].end = sio_data->address[i] + REGION_LENGTH - 1; - res[res_count].name = logdev_str[i]; - - err = acpi_check_resource_conflict(&res[res_count]); - if (err) - goto exit; + int err; - res_count++; - } + err = acpi_check_resource_conflict(&res); + if (err) + goto exit; - pdev = platform_device_alloc(DRVNAME, res[0].start); + pdev = platform_device_alloc(DRVNAME, address); if (!pdev) { err = -ENOMEM; printk(KERN_ERR DRVNAME ": Device allocation failed\n"); goto exit; } - err = platform_device_add_resources(pdev, res, res_count); + err = platform_device_add_resources(pdev, &res, 1); if (err) { printk(KERN_ERR DRVNAME ": Device resource addition failed " "(%d)\n", err); goto exit_device_put; } - err = platform_device_add_data(pdev, sio_data, - sizeof(struct pc87427_sio_data)); - if (err) { - printk(KERN_ERR DRVNAME ": Platform data allocation failed\n"); - goto exit_device_put; - } - err = platform_device_add(pdev); if (err) { printk(KERN_ERR DRVNAME ": Device addition failed (%d)\n", @@ -1229,10 +558,9 @@ static int __init pc87427_device_add(const struct pc87427_sio_data *sio_data) return err; } -static int __init pc87427_find(int sioaddr, struct pc87427_sio_data *sio_data) +static int __init pc87427_find(int sioaddr, unsigned short *address) { u16 val; - u8 cfg, cfg_b; int i, err = 0; /* Identify device */ @@ -1243,7 +571,7 @@ static int __init pc87427_find(int sioaddr, struct pc87427_sio_data *sio_data) } for (i = 0; i < 2; i++) { - sio_data->address[i] = 0; + address[i] = 0; /* Select logical device */ superio_outb(sioaddr, SIOREG_LDSEL, logdev[i]); @@ -1268,58 +596,9 @@ static int __init pc87427_find(int sioaddr, struct pc87427_sio_data *sio_data) "for logical device 0x%02x\n", logdev[i]); continue; } - sio_data->address[i] = val; + address[i] = val; } - /* No point in loading the driver if everything is disabled */ - if (!sio_data->address[0] && !sio_data->address[1]) { - err = -ENODEV; - goto exit; - } - - /* Check which fan inputs are wired */ - sio_data->has_fanin = (1 << 2) | (1 << 3); /* FANIN2, FANIN3 */ - - cfg = superio_inb(sioaddr, SIOREG_CF2); - if (!(cfg & (1 << 3))) - sio_data->has_fanin |= (1 << 0); /* FANIN0 */ - if (!(cfg & (1 << 2))) - sio_data->has_fanin |= (1 << 4); /* FANIN4 */ - - cfg = superio_inb(sioaddr, SIOREG_CFD); - if (!(cfg & (1 << 0))) - sio_data->has_fanin |= (1 << 1); /* FANIN1 */ - - cfg = superio_inb(sioaddr, SIOREG_CF4); - if (!(cfg & (1 << 0))) - sio_data->has_fanin |= (1 << 7); /* FANIN7 */ - cfg_b = superio_inb(sioaddr, SIOREG_CFB); - if (!(cfg & (1 << 1)) && (cfg_b & (1 << 3))) - sio_data->has_fanin |= (1 << 5); /* FANIN5 */ - cfg = superio_inb(sioaddr, SIOREG_CF3); - if ((cfg & (1 << 3)) && !(cfg_b & (1 << 5))) - sio_data->has_fanin |= (1 << 6); /* FANIN6 */ - - /* Check which fan outputs are wired */ - sio_data->has_fanout = (1 << 0); /* FANOUT0 */ - if (cfg_b & (1 << 0)) - sio_data->has_fanout |= (1 << 3); /* FANOUT3 */ - - cfg = superio_inb(sioaddr, SIOREG_CFC); - if (!(cfg & (1 << 4))) { - if (cfg_b & (1 << 1)) - sio_data->has_fanout |= (1 << 1); /* FANOUT1 */ - if (cfg_b & (1 << 2)) - sio_data->has_fanout |= (1 << 2); /* FANOUT2 */ - } - - /* FANOUT1 and FANOUT2 can each be routed to 2 different pins */ - cfg = superio_inb(sioaddr, SIOREG_CF5); - if (cfg & (1 << 6)) - sio_data->has_fanout |= (1 << 1); /* FANOUT1 */ - if (cfg & (1 << 5)) - sio_data->has_fanout |= (1 << 2); /* FANOUT2 */ - exit: superio_exit(sioaddr); return err; @@ -1328,10 +607,15 @@ static int __init pc87427_find(int sioaddr, struct pc87427_sio_data *sio_data) static int __init pc87427_init(void) { int err; - struct pc87427_sio_data sio_data; + unsigned short address[2]; + + if (pc87427_find(0x2e, address) + && pc87427_find(0x4e, address)) + return -ENODEV; - if (pc87427_find(0x2e, &sio_data) - && pc87427_find(0x4e, &sio_data)) + /* For now the driver only handles fans so we only care about the + first address. */ + if (!address[0]) return -ENODEV; err = platform_driver_register(&pc87427_driver); @@ -1339,7 +623,7 @@ static int __init pc87427_init(void) goto exit; /* Sets global pdev as a side effect */ - err = pc87427_device_add(&sio_data); + err = pc87427_device_add(address[0]); if (err) goto exit_driver; diff --git a/trunk/drivers/hwmon/via-cputemp.c b/trunk/drivers/hwmon/via-cputemp.c index ffb793af680b..7442cf754856 100644 --- a/trunk/drivers/hwmon/via-cputemp.c +++ b/trunk/drivers/hwmon/via-cputemp.c @@ -39,7 +39,7 @@ #define DRVNAME "via_cputemp" -enum { SHOW_TEMP, SHOW_LABEL, SHOW_NAME }; +enum { SHOW_TEMP, SHOW_LABEL, SHOW_NAME } SHOW; /* * Functions declaration diff --git a/trunk/drivers/hwmon/w83627ehf.c b/trunk/drivers/hwmon/w83627ehf.c index e96e69dd36fb..0dcaba9b7189 100644 --- a/trunk/drivers/hwmon/w83627ehf.c +++ b/trunk/drivers/hwmon/w83627ehf.c @@ -39,7 +39,6 @@ w83627dhg 9 5 4 3 0xa020 0xc1 0x5ca3 w83627dhg-p 9 5 4 3 0xb070 0xc1 0x5ca3 w83667hg 9 5 3 3 0xa510 0xc1 0x5ca3 - w83667hg-b 9 5 3 3 0xb350 0xc1 0x5ca3 */ #include @@ -56,7 +55,7 @@ #include #include "lm75.h" -enum kinds { w83627ehf, w83627dhg, w83627dhg_p, w83667hg, w83667hg_b }; +enum kinds { w83627ehf, w83627dhg, w83627dhg_p, w83667hg }; /* used to set data->name = w83627ehf_device_names[data->sio_kind] */ static const char * w83627ehf_device_names[] = { @@ -64,7 +63,6 @@ static const char * w83627ehf_device_names[] = { "w83627dhg", "w83627dhg", "w83667hg", - "w83667hg", }; static unsigned short force_id; @@ -93,7 +91,6 @@ MODULE_PARM_DESC(force_id, "Override the detected device ID"); #define SIO_W83627DHG_ID 0xa020 #define SIO_W83627DHG_P_ID 0xb070 #define SIO_W83667HG_ID 0xa510 -#define SIO_W83667HG_B_ID 0xb350 #define SIO_ID_MASK 0xFFF0 static inline void @@ -204,14 +201,8 @@ static const u8 W83627EHF_REG_TOLERANCE[] = { 0x07, 0x07, 0x14, 0x62 }; static const u8 W83627EHF_REG_FAN_START_OUTPUT[] = { 0x0a, 0x0b, 0x16, 0x65 }; static const u8 W83627EHF_REG_FAN_STOP_OUTPUT[] = { 0x08, 0x09, 0x15, 0x64 }; static const u8 W83627EHF_REG_FAN_STOP_TIME[] = { 0x0c, 0x0d, 0x17, 0x66 }; - -static const u8 W83627EHF_REG_FAN_MAX_OUTPUT_COMMON[] - = { 0xff, 0x67, 0xff, 0x69 }; -static const u8 W83627EHF_REG_FAN_STEP_OUTPUT_COMMON[] - = { 0xff, 0x68, 0xff, 0x6a }; - -static const u8 W83627EHF_REG_FAN_MAX_OUTPUT_W83667_B[] = { 0x67, 0x69, 0x6b }; -static const u8 W83627EHF_REG_FAN_STEP_OUTPUT_W83667_B[] = { 0x68, 0x6a, 0x6c }; +static const u8 W83627EHF_REG_FAN_MAX_OUTPUT[] = { 0xff, 0x67, 0xff, 0x69 }; +static const u8 W83627EHF_REG_FAN_STEP_OUTPUT[] = { 0xff, 0x68, 0xff, 0x6a }; /* * Conversions @@ -286,11 +277,6 @@ struct w83627ehf_data { struct device *hwmon_dev; struct mutex lock; - const u8 *REG_FAN_START_OUTPUT; - const u8 *REG_FAN_STOP_OUTPUT; - const u8 *REG_FAN_MAX_OUTPUT; - const u8 *REG_FAN_STEP_OUTPUT; - struct mutex update_lock; char valid; /* !=0 if following fields are valid */ unsigned long last_updated; /* In jiffies */ @@ -538,10 +524,7 @@ static struct w83627ehf_data *w83627ehf_update_device(struct device *dev) } } - for (i = 0; i < data->pwm_num; i++) { - if (!(data->has_fan & (1 << i))) - continue; - + for (i = 0; i < 4; i++) { /* pwmcfg, tolerance mapped for i=0, i=1 to same reg */ if (i != 1) { pwmcfg = w83627ehf_read_value(data, @@ -563,17 +546,6 @@ static struct w83627ehf_data *w83627ehf_update_device(struct device *dev) W83627EHF_REG_FAN_STOP_OUTPUT[i]); data->fan_stop_time[i] = w83627ehf_read_value(data, W83627EHF_REG_FAN_STOP_TIME[i]); - - if (data->REG_FAN_MAX_OUTPUT[i] != 0xff) - data->fan_max_output[i] = - w83627ehf_read_value(data, - data->REG_FAN_MAX_OUTPUT[i]); - - if (data->REG_FAN_STEP_OUTPUT[i] != 0xff) - data->fan_step_output[i] = - w83627ehf_read_value(data, - data->REG_FAN_STEP_OUTPUT[i]); - data->target_temp[i] = w83627ehf_read_value(data, W83627EHF_REG_TARGET[i]) & @@ -1154,7 +1126,7 @@ store_##reg(struct device *dev, struct device_attribute *attr, \ u32 val = SENSORS_LIMIT(simple_strtoul(buf, NULL, 10), 1, 255); \ mutex_lock(&data->update_lock); \ data->reg[nr] = val; \ - w83627ehf_write_value(data, data->REG_##REG[nr], val); \ + w83627ehf_write_value(data, W83627EHF_REG_##REG[nr], val); \ mutex_unlock(&data->update_lock); \ return count; \ } @@ -1234,26 +1206,12 @@ static struct sensor_device_attribute sda_sf3_arrays[] = { store_fan_stop_output, 1), SENSOR_ATTR(pwm3_stop_output, S_IWUSR | S_IRUGO, show_fan_stop_output, store_fan_stop_output, 2), -}; - -/* - * pwm1 and pwm3 don't support max and step settings on all chips. - * Need to check support while generating/removing attribute files. - */ -static struct sensor_device_attribute sda_sf3_max_step_arrays[] = { - SENSOR_ATTR(pwm1_max_output, S_IWUSR | S_IRUGO, show_fan_max_output, - store_fan_max_output, 0), - SENSOR_ATTR(pwm1_step_output, S_IWUSR | S_IRUGO, show_fan_step_output, - store_fan_step_output, 0), + /* pwm1 and pwm3 don't support max and step settings */ SENSOR_ATTR(pwm2_max_output, S_IWUSR | S_IRUGO, show_fan_max_output, store_fan_max_output, 1), SENSOR_ATTR(pwm2_step_output, S_IWUSR | S_IRUGO, show_fan_step_output, store_fan_step_output, 1), - SENSOR_ATTR(pwm3_max_output, S_IWUSR | S_IRUGO, show_fan_max_output, - store_fan_max_output, 2), - SENSOR_ATTR(pwm3_step_output, S_IWUSR | S_IRUGO, show_fan_step_output, - store_fan_step_output, 2), }; static ssize_t @@ -1277,12 +1235,6 @@ static void w83627ehf_device_remove_files(struct device *dev) for (i = 0; i < ARRAY_SIZE(sda_sf3_arrays); i++) device_remove_file(dev, &sda_sf3_arrays[i].dev_attr); - for (i = 0; i < ARRAY_SIZE(sda_sf3_max_step_arrays); i++) { - struct sensor_device_attribute *attr = - &sda_sf3_max_step_arrays[i]; - if (data->REG_FAN_STEP_OUTPUT[attr->index] != 0xff) - device_remove_file(dev, &attr->dev_attr); - } for (i = 0; i < ARRAY_SIZE(sda_sf3_arrays_fan4); i++) device_remove_file(dev, &sda_sf3_arrays_fan4[i].dev_attr); for (i = 0; i < data->in_num; i++) { @@ -1391,37 +1343,22 @@ static int __devinit w83627ehf_probe(struct platform_device *pdev) /* 627EHG and 627EHF have 10 voltage inputs; 627DHG and 667HG have 9 */ data->in_num = (sio_data->kind == w83627ehf) ? 10 : 9; /* 667HG has 3 pwms */ - data->pwm_num = (sio_data->kind == w83667hg - || sio_data->kind == w83667hg_b) ? 3 : 4; + data->pwm_num = (sio_data->kind == w83667hg) ? 3 : 4; /* Check temp3 configuration bit for 667HG */ - if (sio_data->kind == w83667hg || sio_data->kind == w83667hg_b) { + if (sio_data->kind == w83667hg) { data->temp3_disable = w83627ehf_read_value(data, W83627EHF_REG_TEMP_CONFIG[1]) & 0x01; data->in6_skip = !data->temp3_disable; } - data->REG_FAN_START_OUTPUT = W83627EHF_REG_FAN_START_OUTPUT; - data->REG_FAN_STOP_OUTPUT = W83627EHF_REG_FAN_STOP_OUTPUT; - if (sio_data->kind == w83667hg_b) { - data->REG_FAN_MAX_OUTPUT = - W83627EHF_REG_FAN_MAX_OUTPUT_W83667_B; - data->REG_FAN_STEP_OUTPUT = - W83627EHF_REG_FAN_STEP_OUTPUT_W83667_B; - } else { - data->REG_FAN_MAX_OUTPUT = - W83627EHF_REG_FAN_MAX_OUTPUT_COMMON; - data->REG_FAN_STEP_OUTPUT = - W83627EHF_REG_FAN_STEP_OUTPUT_COMMON; - } - /* Initialize the chip */ w83627ehf_init_device(data); data->vrm = vid_which_vrm(); superio_enter(sio_data->sioreg); /* Read VID value */ - if (sio_data->kind == w83667hg || sio_data->kind == w83667hg_b) { + if (sio_data->kind == w83667hg) { /* W83667HG has different pins for VID input and output, so we can get the VID input values directly at logical device D 0xe3. */ @@ -1472,7 +1409,7 @@ static int __devinit w83627ehf_probe(struct platform_device *pdev) } /* fan4 and fan5 share some pins with the GPIO and serial flash */ - if (sio_data->kind == w83667hg || sio_data->kind == w83667hg_b) { + if (sio_data->kind == w83667hg) { fan5pin = superio_inb(sio_data->sioreg, 0x27) & 0x20; fan4pin = superio_inb(sio_data->sioreg, 0x27) & 0x40; } else { @@ -1503,15 +1440,6 @@ static int __devinit w83627ehf_probe(struct platform_device *pdev) &sda_sf3_arrays[i].dev_attr))) goto exit_remove; - for (i = 0; i < ARRAY_SIZE(sda_sf3_max_step_arrays); i++) { - struct sensor_device_attribute *attr = - &sda_sf3_max_step_arrays[i]; - if (data->REG_FAN_STEP_OUTPUT[attr->index] != 0xff) { - err = device_create_file(dev, &attr->dev_attr); - if (err) - goto exit_remove; - } - } /* if fan4 is enabled create the sf3 files for it */ if ((data->has_fan & (1 << 3)) && data->pwm_num >= 4) for (i = 0; i < ARRAY_SIZE(sda_sf3_arrays_fan4); i++) { @@ -1628,7 +1556,6 @@ static int __init w83627ehf_find(int sioaddr, unsigned short *addr, static const char __initdata sio_name_W83627DHG[] = "W83627DHG"; static const char __initdata sio_name_W83627DHG_P[] = "W83627DHG-P"; static const char __initdata sio_name_W83667HG[] = "W83667HG"; - static const char __initdata sio_name_W83667HG_B[] = "W83667HG-B"; u16 val; const char *sio_name; @@ -1661,10 +1588,6 @@ static int __init w83627ehf_find(int sioaddr, unsigned short *addr, sio_data->kind = w83667hg; sio_name = sio_name_W83667HG; break; - case SIO_W83667HG_B_ID: - sio_data->kind = w83667hg_b; - sio_name = sio_name_W83667HG_B; - break; default: if (val != 0xffff) pr_debug(DRVNAME ": unsupported chip ID: 0x%04x\n", diff --git a/trunk/drivers/message/fusion/mptbase.c b/trunk/drivers/message/fusion/mptbase.c index 6837a8ef9371..c425681a1503 100644 --- a/trunk/drivers/message/fusion/mptbase.c +++ b/trunk/drivers/message/fusion/mptbase.c @@ -626,7 +626,6 @@ mptbase_reply(MPT_ADAPTER *ioc, MPT_FRAME_HDR *req, MPT_FRAME_HDR *reply) * mpt_register - Register protocol-specific main callback handler. * @cbfunc: callback function pointer * @dclass: Protocol driver's class (%MPT_DRIVER_CLASS enum value) - * @func_name: call function's name * * This routine is called by a protocol-specific driver (SCSI host, * LAN, SCSI target) to register its reply callback routine. Each @@ -6560,7 +6559,7 @@ procmpt_destroy(void) } /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ -/* +/** * Handles read request from /proc/mpt/summary or /proc/mpt/iocN/summary. */ static void seq_mpt_print_ioc_summary(MPT_ADAPTER *ioc, struct seq_file *m, int showlan); @@ -8004,7 +8003,6 @@ mpt_spi_log_info(MPT_ADAPTER *ioc, u32 log_info) * mpt_sas_log_info - Log information returned from SAS IOC. * @ioc: Pointer to MPT_ADAPTER structure * @log_info: U32 LogInfo reply word from the IOC - * @cb_idx: callback function's handle * * Refer to lsi/mpi_log_sas.h. **/ diff --git a/trunk/fs/dcache.c b/trunk/fs/dcache.c index 4d13bf50b7b1..166d35d56868 100644 --- a/trunk/fs/dcache.c +++ b/trunk/fs/dcache.c @@ -1976,7 +1976,7 @@ static int prepend_path(const struct path *path, struct path *root, * __d_path - return the path of a dentry * @path: the dentry/vfsmount to report * @root: root vfsmnt/dentry (may be modified by this function) - * @buf: buffer to return value in + * @buffer: buffer to return value in * @buflen: buffer length * * Convert a dentry into an ASCII path name. diff --git a/trunk/include/asm-generic/Kbuild b/trunk/include/asm-generic/Kbuild index eb62334cda29..53f91b1ae53a 100644 --- a/trunk/include/asm-generic/Kbuild +++ b/trunk/include/asm-generic/Kbuild @@ -3,6 +3,8 @@ header-y += bitsperlong.h header-y += errno-base.h header-y += errno.h header-y += fcntl.h +header-y += int-l64.h +header-y += int-ll64.h header-y += ioctl.h header-y += ioctls.h header-y += ipcbuf.h @@ -12,10 +14,12 @@ header-y += msgbuf.h header-y += param.h header-y += poll.h header-y += posix_types.h +header-y += resource.h header-y += sembuf.h header-y += setup.h header-y += shmbuf.h header-y += shmparam.h +header-y += siginfo.h header-y += signal-defs.h header-y += signal.h header-y += socket.h @@ -28,8 +32,3 @@ header-y += termios.h header-y += types.h header-y += ucontext.h header-y += unistd.h - -unifdef-y += int-l64.h -unifdef-y += int-ll64.h -unifdef-y += resource.h -unifdef-y += siginfo.h diff --git a/trunk/include/asm-generic/Kbuild.asm b/trunk/include/asm-generic/Kbuild.asm index 96d7c9804dc1..c5d2e5dd871b 100644 --- a/trunk/include/asm-generic/Kbuild.asm +++ b/trunk/include/asm-generic/Kbuild.asm @@ -1,5 +1,5 @@ ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/kvm.h \ - $(srctree)/include/asm-$(SRCARCH)/kvm.h),) + $(srctree)/include/asm-$(SRCARCH)/kvm.h),) header-y += kvm.h endif @@ -9,36 +9,37 @@ header-y += kvm_para.h endif ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/a.out.h \ - $(srctree)/include/asm-$(SRCARCH)/a.out.h),) -unifdef-y += a.out.h + $(srctree)/include/asm-$(SRCARCH)/a.out.h),) +header-y += a.out.h endif -unifdef-y += auxvec.h -unifdef-y += byteorder.h -unifdef-y += bitsperlong.h -unifdef-y += errno.h -unifdef-y += fcntl.h -unifdef-y += ioctl.h -unifdef-y += ioctls.h -unifdef-y += ipcbuf.h -unifdef-y += mman.h -unifdef-y += msgbuf.h -unifdef-y += param.h -unifdef-y += poll.h -unifdef-y += posix_types.h -unifdef-y += ptrace.h -unifdef-y += resource.h -unifdef-y += sembuf.h -unifdef-y += setup.h -unifdef-y += shmbuf.h -unifdef-y += sigcontext.h -unifdef-y += siginfo.h -unifdef-y += signal.h -unifdef-y += socket.h -unifdef-y += sockios.h -unifdef-y += stat.h -unifdef-y += statfs.h -unifdef-y += swab.h -unifdef-y += termbits.h -unifdef-y += termios.h -unifdef-y += types.h -unifdef-y += unistd.h + +header-y += auxvec.h +header-y += bitsperlong.h +header-y += byteorder.h +header-y += errno.h +header-y += fcntl.h +header-y += ioctl.h +header-y += ioctls.h +header-y += ipcbuf.h +header-y += mman.h +header-y += msgbuf.h +header-y += param.h +header-y += poll.h +header-y += posix_types.h +header-y += ptrace.h +header-y += resource.h +header-y += sembuf.h +header-y += setup.h +header-y += shmbuf.h +header-y += sigcontext.h +header-y += siginfo.h +header-y += signal.h +header-y += socket.h +header-y += sockios.h +header-y += stat.h +header-y += statfs.h +header-y += swab.h +header-y += termbits.h +header-y += termios.h +header-y += types.h +header-y += unistd.h diff --git a/trunk/include/drm/Kbuild b/trunk/include/drm/Kbuild index bd3a1c2fbdb4..ffec177f3481 100644 --- a/trunk/include/drm/Kbuild +++ b/trunk/include/drm/Kbuild @@ -1,12 +1,14 @@ -unifdef-y += drm.h drm_sarea.h drm_mode.h -unifdef-y += i810_drm.h -unifdef-y += i830_drm.h -unifdef-y += i915_drm.h -unifdef-y += mga_drm.h -unifdef-y += r128_drm.h -unifdef-y += radeon_drm.h -unifdef-y += sis_drm.h -unifdef-y += savage_drm.h -unifdef-y += vmwgfx_drm.h -unifdef-y += via_drm.h -unifdef-y += nouveau_drm.h +header-y += drm.h +header-y += drm_mode.h +header-y += drm_sarea.h +header-y += i810_drm.h +header-y += i830_drm.h +header-y += i915_drm.h +header-y += mga_drm.h +header-y += nouveau_drm.h +header-y += r128_drm.h +header-y += radeon_drm.h +header-y += savage_drm.h +header-y += sis_drm.h +header-y += via_drm.h +header-y += vmwgfx_drm.h diff --git a/trunk/include/linux/Kbuild b/trunk/include/linux/Kbuild index 9d65d4d0bd9c..626b629429ff 100644 --- a/trunk/include/linux/Kbuild +++ b/trunk/include/linux/Kbuild @@ -15,380 +15,380 @@ header-y += netfilter_bridge/ header-y += netfilter_ipv4/ header-y += netfilter_ipv6/ header-y += usb/ +header-y += wimax/ + +objhdr-y += version.h + +ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/a.out.h \ + $(srctree)/include/asm-$(SRCARCH)/a.out.h),) +header-y += a.out.h +endif +ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/kvm.h \ + $(srctree)/include/asm-$(SRCARCH)/kvm.h),) +header-y += kvm.h +endif +ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/kvm_para.h \ + $(srctree)/include/asm-$(SRCARCH)/kvm_para.h),) +header-y += kvm_para.h +endif +header-y += acct.h +header-y += adb.h +header-y += adfs_fs.h header-y += affs_hardblocks.h +header-y += agpgart.h header-y += aio_abi.h +header-y += apm_bios.h header-y += arcfb.h +header-y += atalk.h +header-y += atm.h +header-y += atm_eni.h +header-y += atm_he.h +header-y += atm_idt77105.h +header-y += atm_nicstar.h +header-y += atm_tcp.h +header-y += atm_zatm.h header-y += atmapi.h header-y += atmarp.h header-y += atmbr2684.h header-y += atmclip.h -header-y += atm_eni.h -header-y += atm_he.h -header-y += atm_idt77105.h +header-y += atmdev.h header-y += atmioc.h header-y += atmlec.h header-y += atmmpc.h -header-y += atm_nicstar.h header-y += atmppp.h header-y += atmsap.h header-y += atmsvc.h -header-y += atm_zatm.h +header-y += audit.h +header-y += auto_fs.h header-y += auto_fs4.h +header-y += auxvec.h header-y += ax25.h header-y += b1lli.h header-y += baycom.h header-y += bfs_fs.h +header-y += binfmts.h header-y += blk_types.h header-y += blkpg.h +header-y += blktrace_api.h header-y += bpqether.h header-y += bsg.h header-y += can.h +header-y += capability.h +header-y += capi.h header-y += cciss_defs.h +header-y += cciss_ioctl.h header-y += cdk.h +header-y += cdrom.h +header-y += cgroupstats.h header-y += chio.h +header-y += cm4000_cs.h +header-y += cn_proc.h +header-y += coda.h header-y += coda_psdev.h header-y += coff.h header-y += comstats.h +header-y += connector.h header-y += const.h -header-y += cgroupstats.h header-y += cramfs_fs.h +header-y += cuda.h +header-y += cyclades.h header-y += cycx_cfm.h header-y += dcbnl.h -header-y += dlmconstants.h +header-y += dccp.h +header-y += dlm.h header-y += dlm_device.h header-y += dlm_netlink.h +header-y += dlm_plock.h +header-y += dlmconstants.h header-y += dm-ioctl.h header-y += dm-log-userspace.h header-y += dn.h header-y += dqblk_xfs.h +header-y += edd.h header-y += efs_fs_sb.h -header-y += elf-fdpic.h header-y += elf-em.h +header-y += elf-fdpic.h +header-y += elf.h +header-y += elfcore.h +header-y += errno.h +header-y += errqueue.h +header-y += ethtool.h +header-y += eventpoll.h +header-y += ext2_fs.h header-y += fadvise.h header-y += falloc.h +header-y += fanotify.h +header-y += fb.h +header-y += fcntl.h header-y += fd.h header-y += fdreg.h header-y += fib_rules.h header-y += fiemap.h +header-y += filter.h header-y += firewire-cdev.h header-y += firewire-constants.h +header-y += flat.h +header-y += fs.h header-y += fuse.h -header-y += genetlink.h +header-y += futex.h +header-y += gameport.h header-y += gen_stats.h +header-y += generic_serial.h +header-y += genetlink.h header-y += gfs2_ondisk.h header-y += gigaset_dev.h +header-y += hdlc.h +header-y += hdlcdrv.h +header-y += hdreg.h +header-y += hid.h +header-y += hiddev.h +header-y += hidraw.h +header-y += hpet.h header-y += hysdn_if.h +header-y += i2c-dev.h +header-y += i2c.h header-y += i2o-dev.h header-y += i8k.h +header-y += icmp.h +header-y += icmpv6.h +header-y += if.h +header-y += if_addr.h header-y += if_addrlabel.h header-y += if_arcnet.h +header-y += if_arp.h header-y += if_bonding.h +header-y += if_bridge.h header-y += if_cablemodem.h +header-y += if_ec.h +header-y += if_eql.h +header-y += if_ether.h header-y += if_fc.h -header-y += if.h +header-y += if_fddi.h +header-y += if_frad.h header-y += if_hippi.h header-y += if_infiniband.h +header-y += if_link.h +header-y += if_ltalk.h header-y += if_packet.h +header-y += if_phonet.h header-y += if_plip.h header-y += if_ppp.h +header-y += if_pppol2tp.h +header-y += if_pppox.h header-y += if_slip.h header-y += if_strip.h +header-y += if_tr.h header-y += if_tun.h +header-y += if_tunnel.h +header-y += if_vlan.h header-y += if_x25.h +header-y += igmp.h +header-y += in.h +header-y += in6.h header-y += in_route.h +header-y += inet_diag.h +header-y += inotify.h +header-y += input.h header-y += ioctl.h +header-y += ip.h header-y += ip6_tunnel.h +header-y += ip_vs.h +header-y += ipc.h +header-y += ipmi.h header-y += ipmi_msgdefs.h header-y += ipsec.h -header-y += ip_vs.h +header-y += ipv6.h +header-y += ipv6_route.h header-y += ipx.h header-y += irda.h +header-y += irqnr.h +header-y += isdn.h +header-y += isdn_divertif.h +header-y += isdn_ppp.h +header-y += isdnif.h header-y += iso_fs.h +header-y += ivtv.h +header-y += ivtvfb.h header-y += ixjuser.h header-y += jffs2.h +header-y += joystick.h +header-y += kd.h +header-y += kdev_t.h +header-y += kernel.h +header-y += kernelcapi.h +header-y += keyboard.h header-y += keyctl.h +header-y += l2tp.h header-y += limits.h +header-y += llc.h +header-y += loop.h +header-y += lp.h header-y += magic.h header-y += major.h header-y += map_to_7segment.h header-y += matroxfb.h +header-y += mempolicy.h header-y += meye.h +header-y += mii.h header-y += minix_fs.h +header-y += mman.h header-y += mmtimer.h header-y += mqueue.h +header-y += mroute.h +header-y += mroute6.h +header-y += msdos_fs.h +header-y += msg.h header-y += mtio.h +header-y += n_r3964.h +header-y += nbd.h +header-y += ncp.h +header-y += ncp_fs.h +header-y += ncp_mount.h header-y += ncp_no.h header-y += neighbour.h +header-y += net.h header-y += net_dropmon.h header-y += net_tstamp.h +header-y += netdevice.h +header-y += netfilter.h header-y += netfilter_arp.h +header-y += netfilter_bridge.h +header-y += netfilter_decnet.h +header-y += netfilter_ipv4.h +header-y += netfilter_ipv6.h +header-y += netlink.h header-y += netrom.h +header-y += nfs.h header-y += nfs2.h +header-y += nfs3.h +header-y += nfs4.h header-y += nfs4_mount.h +header-y += nfs_fs.h +header-y += nfs_idmap.h header-y += nfs_mount.h +header-y += nfsacl.h header-y += nl80211.h +header-y += nubus.h +header-y += nvram.h header-y += omapfb.h +header-y += oom.h header-y += param.h +header-y += parport.h +header-y += patchkey.h +header-y += pci.h header-y += pci_regs.h header-y += perf_event.h +header-y += personality.h header-y += pfkeyv2.h header-y += pg.h header-y += phantom.h header-y += phonet.h header-y += pkt_cls.h header-y += pkt_sched.h +header-y += pktcdvd.h +header-y += pmu.h +header-y += poll.h header-y += posix_types.h header-y += ppdev.h +header-y += ppp-comp.h +header-y += ppp_defs.h +header-y += pps.h header-y += prctl.h -header-y += qnxtypes.h +header-y += ptrace.h header-y += qnx4_fs.h +header-y += qnxtypes.h +header-y += quota.h header-y += radeonfb.h +header-y += random.h header-y += raw.h +header-y += reboot.h +header-y += reiserfs_fs.h +header-y += reiserfs_xattr.h header-y += resource.h +header-y += rfkill.h header-y += romfs_fs.h header-y += rose.h +header-y += route.h +header-y += rtc.h +header-y += rtnetlink.h +header-y += scc.h +header-y += sched.h +header-y += screen_info.h +header-y += sdla.h +header-y += securebits.h +header-y += selinux_netlink.h +header-y += sem.h +header-y += serial.h +header-y += serial_core.h header-y += serial_reg.h +header-y += serio.h +header-y += shm.h +header-y += signal.h +header-y += signalfd.h +header-y += smb.h +header-y += smb_fs.h +header-y += smb_mount.h header-y += smbno.h header-y += snmp.h +header-y += socket.h header-y += sockios.h header-y += som.h +header-y += sonet.h +header-y += sonypi.h header-y += sound.h +header-y += soundcard.h +header-y += stat.h +header-y += stddef.h +header-y += string.h header-y += suspend_ioctls.h +header-y += swab.h +header-y += synclink.h +header-y += sysctl.h header-y += taskstats.h +header-y += tcp.h header-y += telephony.h header-y += termios.h +header-y += time.h header-y += times.h +header-y += timex.h header-y += tiocl.h header-y += tipc.h header-y += tipc_config.h header-y += toshiba.h +header-y += tty.h +header-y += types.h header-y += udf_fs_i.h +header-y += udp.h +header-y += uinput.h +header-y += uio.h header-y += ultrasound.h header-y += un.h +header-y += unistd.h +header-y += usbdevice_fs.h header-y += utime.h +header-y += utsname.h header-y += veth.h +header-y += vhost.h +header-y += videodev.h +header-y += videodev2.h header-y += videotext.h -header-y += x25.h - -unifdef-y += acct.h -unifdef-y += adb.h -unifdef-y += adfs_fs.h -unifdef-y += agpgart.h -ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/a.out.h \ - $(srctree)/include/asm-$(SRCARCH)/a.out.h),) -unifdef-y += a.out.h -endif -unifdef-y += apm_bios.h -unifdef-y += atalk.h -unifdef-y += atmdev.h -unifdef-y += atm.h -unifdef-y += atm_tcp.h -unifdef-y += audit.h -unifdef-y += auto_fs.h -unifdef-y += auxvec.h -unifdef-y += binfmts.h -unifdef-y += blktrace_api.h -unifdef-y += capability.h -unifdef-y += capi.h -unifdef-y += cciss_ioctl.h -unifdef-y += cdrom.h -unifdef-y += cm4000_cs.h -unifdef-y += cn_proc.h -unifdef-y += coda.h -unifdef-y += connector.h -unifdef-y += cuda.h -unifdef-y += cyclades.h -unifdef-y += dccp.h -unifdef-y += dlm.h -unifdef-y += dlm_plock.h -unifdef-y += edd.h -unifdef-y += elf.h -unifdef-y += elfcore.h -unifdef-y += errno.h -unifdef-y += errqueue.h -unifdef-y += ethtool.h -unifdef-y += eventpoll.h -unifdef-y += signalfd.h -unifdef-y += ext2_fs.h -unifdef-y += fanotify.h -unifdef-y += fb.h -unifdef-y += fcntl.h -unifdef-y += filter.h -unifdef-y += flat.h -unifdef-y += futex.h -unifdef-y += fs.h -unifdef-y += gameport.h -unifdef-y += generic_serial.h -unifdef-y += hdlcdrv.h -unifdef-y += hdlc.h -unifdef-y += hdreg.h -unifdef-y += hid.h -unifdef-y += hiddev.h -unifdef-y += hidraw.h -unifdef-y += hpet.h -unifdef-y += i2c.h -unifdef-y += i2c-dev.h -unifdef-y += icmp.h -unifdef-y += icmpv6.h -unifdef-y += if_addr.h -unifdef-y += if_arp.h -unifdef-y += if_bridge.h -unifdef-y += if_ec.h -unifdef-y += if_eql.h -unifdef-y += if_ether.h -unifdef-y += if_fddi.h -unifdef-y += if_frad.h -unifdef-y += if_ltalk.h -unifdef-y += if_link.h -unifdef-y += if_phonet.h -unifdef-y += if_pppol2tp.h -unifdef-y += if_pppox.h -unifdef-y += if_tr.h -unifdef-y += if_tunnel.h -unifdef-y += if_vlan.h -unifdef-y += igmp.h -unifdef-y += inet_diag.h -unifdef-y += in.h -unifdef-y += in6.h -unifdef-y += inotify.h -unifdef-y += input.h -unifdef-y += ip.h -unifdef-y += ipc.h -unifdef-y += ipmi.h -unifdef-y += ipv6.h -unifdef-y += ipv6_route.h -unifdef-y += isdn.h -unifdef-y += isdnif.h -unifdef-y += isdn_divertif.h -unifdef-y += isdn_ppp.h -unifdef-y += ivtv.h -unifdef-y += ivtvfb.h -unifdef-y += joystick.h -unifdef-y += kdev_t.h -unifdef-y += kd.h -unifdef-y += kernelcapi.h -unifdef-y += kernel.h -unifdef-y += keyboard.h -ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/kvm.h \ - $(srctree)/include/asm-$(SRCARCH)/kvm.h),) -unifdef-y += kvm.h -endif -ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/kvm_para.h \ - $(srctree)/include/asm-$(SRCARCH)/kvm_para.h),) -unifdef-y += kvm_para.h -endif -unifdef-y += l2tp.h -unifdef-y += llc.h -unifdef-y += loop.h -unifdef-y += lp.h -unifdef-y += mempolicy.h -unifdef-y += mii.h -unifdef-y += mman.h -unifdef-y += mroute.h -unifdef-y += mroute6.h -unifdef-y += msdos_fs.h -unifdef-y += msg.h -unifdef-y += nbd.h -unifdef-y += ncp_fs.h -unifdef-y += ncp.h -unifdef-y += ncp_mount.h -unifdef-y += netdevice.h -unifdef-y += netfilter_bridge.h -unifdef-y += netfilter_decnet.h -unifdef-y += netfilter.h -unifdef-y += netfilter_ipv4.h -unifdef-y += netfilter_ipv6.h -unifdef-y += net.h -unifdef-y += netlink.h -unifdef-y += nfs3.h -unifdef-y += nfs4.h -unifdef-y += nfsacl.h -unifdef-y += nfs_fs.h -unifdef-y += nfs.h -unifdef-y += nfs_idmap.h -unifdef-y += n_r3964.h -unifdef-y += nubus.h -unifdef-y += nvram.h -unifdef-y += oom.h -unifdef-y += parport.h -unifdef-y += patchkey.h -unifdef-y += pci.h -unifdef-y += personality.h -unifdef-y += pktcdvd.h -unifdef-y += pmu.h -unifdef-y += poll.h -unifdef-y += ppp_defs.h -unifdef-y += ppp-comp.h -unifdef-y += pps.h -unifdef-y += ptrace.h -unifdef-y += quota.h -unifdef-y += random.h -unifdef-y += rfkill.h -unifdef-y += irqnr.h -unifdef-y += reboot.h -unifdef-y += reiserfs_fs.h -unifdef-y += reiserfs_xattr.h -unifdef-y += route.h -unifdef-y += rtc.h -unifdef-y += rtnetlink.h -unifdef-y += scc.h -unifdef-y += sched.h -unifdef-y += screen_info.h -unifdef-y += sdla.h -unifdef-y += securebits.h -unifdef-y += selinux_netlink.h -unifdef-y += sem.h -unifdef-y += serial_core.h -unifdef-y += serial.h -unifdef-y += serio.h -unifdef-y += shm.h -unifdef-y += signal.h -unifdef-y += smb_fs.h -unifdef-y += smb.h -unifdef-y += smb_mount.h -unifdef-y += socket.h -unifdef-y += sonet.h -unifdef-y += sonypi.h -unifdef-y += soundcard.h -unifdef-y += stat.h -unifdef-y += stddef.h -unifdef-y += string.h -unifdef-y += swab.h -unifdef-y += synclink.h -unifdef-y += sysctl.h -unifdef-y += tcp.h -unifdef-y += time.h -unifdef-y += timex.h -unifdef-y += tty.h -unifdef-y += types.h -unifdef-y += udp.h -unifdef-y += uinput.h -unifdef-y += uio.h -unifdef-y += unistd.h -unifdef-y += usbdevice_fs.h -unifdef-y += utsname.h -unifdef-y += vhost.h -unifdef-y += videodev2.h -unifdef-y += videodev.h -unifdef-y += virtio_config.h -unifdef-y += virtio_ids.h -unifdef-y += virtio_blk.h -unifdef-y += virtio_net.h -unifdef-y += virtio_9p.h -unifdef-y += virtio_balloon.h -unifdef-y += virtio_console.h -unifdef-y += virtio_pci.h -unifdef-y += virtio_ring.h -unifdef-y += virtio_rng.h -unifdef-y += vt.h -unifdef-y += wait.h -unifdef-y += wanrouter.h -unifdef-y += watchdog.h -unifdef-y += wireless.h -unifdef-y += xattr.h -unifdef-y += xfrm.h - -objhdr-y += version.h +header-y += virtio_9p.h +header-y += virtio_balloon.h +header-y += virtio_blk.h +header-y += virtio_config.h +header-y += virtio_console.h +header-y += virtio_ids.h +header-y += virtio_net.h +header-y += virtio_pci.h +header-y += virtio_ring.h +header-y += virtio_rng.h +header-y += vt.h +header-y += wait.h +header-y += wanrouter.h +header-y += watchdog.h header-y += wimax.h -header-y += wimax/ +header-y += wireless.h +header-y += x25.h +header-y += xattr.h +header-y += xfrm.h diff --git a/trunk/include/linux/byteorder/Kbuild b/trunk/include/linux/byteorder/Kbuild index 38437225b092..5896e344ba6c 100644 --- a/trunk/include/linux/byteorder/Kbuild +++ b/trunk/include/linux/byteorder/Kbuild @@ -1,2 +1,2 @@ -unifdef-y += big_endian.h -unifdef-y += little_endian.h +header-y += big_endian.h +header-y += little_endian.h diff --git a/trunk/include/linux/dvb/Kbuild b/trunk/include/linux/dvb/Kbuild index d97b3a51e227..f4dba8637f98 100644 --- a/trunk/include/linux/dvb/Kbuild +++ b/trunk/include/linux/dvb/Kbuild @@ -1,9 +1,8 @@ +header-y += audio.h header-y += ca.h +header-y += dmx.h header-y += frontend.h header-y += net.h header-y += osd.h header-y += version.h - -unifdef-y += audio.h -unifdef-y += dmx.h -unifdef-y += video.h +header-y += video.h diff --git a/trunk/include/linux/i2c/ltc4245.h b/trunk/include/linux/i2c/ltc4245.h deleted file mode 100644 index 56bda4be0016..000000000000 --- a/trunk/include/linux/i2c/ltc4245.h +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Platform Data for LTC4245 hardware monitor chip - * - * Copyright (c) 2010 Ira W. Snyder - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - */ - -#ifndef LINUX_LTC4245_H -#define LINUX_LTC4245_H - -#include - -struct ltc4245_platform_data { - bool use_extra_gpios; -}; - -#endif /* LINUX_LTC4245_H */ diff --git a/trunk/include/linux/netfilter/Kbuild b/trunk/include/linux/netfilter/Kbuild index edeeabdc1500..9d40effe7ca7 100644 --- a/trunk/include/linux/netfilter/Kbuild +++ b/trunk/include/linux/netfilter/Kbuild @@ -1,8 +1,14 @@ +header-y += nf_conntrack_common.h +header-y += nf_conntrack_ftp.h header-y += nf_conntrack_sctp.h +header-y += nf_conntrack_tcp.h header-y += nf_conntrack_tuple_common.h +header-y += nfnetlink.h +header-y += nfnetlink_compat.h header-y += nfnetlink_conntrack.h header-y += nfnetlink_log.h header-y += nfnetlink_queue.h +header-y += x_tables.h header-y += xt_CHECKSUM.h header-y += xt_CLASSIFY.h header-y += xt_CONNMARK.h @@ -31,9 +37,9 @@ header-y += xt_dccp.h header-y += xt_dscp.h header-y += xt_esp.h header-y += xt_hashlimit.h +header-y += xt_helper.h header-y += xt_iprange.h header-y += xt_ipvs.h -header-y += xt_helper.h header-y += xt_length.h header-y += xt_limit.h header-y += xt_mac.h @@ -41,7 +47,9 @@ header-y += xt_mark.h header-y += xt_multiport.h header-y += xt_osf.h header-y += xt_owner.h +header-y += xt_physdev.h header-y += xt_pkttype.h +header-y += xt_policy.h header-y += xt_quota.h header-y += xt_rateest.h header-y += xt_realm.h @@ -54,12 +62,3 @@ header-y += xt_tcpmss.h header-y += xt_tcpudp.h header-y += xt_time.h header-y += xt_u32.h - -unifdef-y += nf_conntrack_common.h -unifdef-y += nf_conntrack_ftp.h -unifdef-y += nf_conntrack_tcp.h -unifdef-y += nfnetlink.h -unifdef-y += nfnetlink_compat.h -unifdef-y += x_tables.h -unifdef-y += xt_physdev.h -unifdef-y += xt_policy.h diff --git a/trunk/include/linux/netfilter_arp/Kbuild b/trunk/include/linux/netfilter_arp/Kbuild index 4f13dfcb92ea..b27439c71037 100644 --- a/trunk/include/linux/netfilter_arp/Kbuild +++ b/trunk/include/linux/netfilter_arp/Kbuild @@ -1,3 +1,2 @@ +header-y += arp_tables.h header-y += arpt_mangle.h - -unifdef-y += arp_tables.h diff --git a/trunk/include/linux/netfilter_bridge/Kbuild b/trunk/include/linux/netfilter_bridge/Kbuild index 76ff4c47d8c4..d4d78672873e 100644 --- a/trunk/include/linux/netfilter_bridge/Kbuild +++ b/trunk/include/linux/netfilter_bridge/Kbuild @@ -1,3 +1,4 @@ +header-y += ebt_802_3.h header-y += ebt_among.h header-y += ebt_arp.h header-y += ebt_arpreply.h @@ -12,6 +13,4 @@ header-y += ebt_redirect.h header-y += ebt_stp.h header-y += ebt_ulog.h header-y += ebt_vlan.h - -unifdef-y += ebtables.h -unifdef-y += ebt_802_3.h +header-y += ebtables.h diff --git a/trunk/include/linux/netfilter_ipv4/Kbuild b/trunk/include/linux/netfilter_ipv4/Kbuild index 431b40761920..f9930c87fff3 100644 --- a/trunk/include/linux/netfilter_ipv4/Kbuild +++ b/trunk/include/linux/netfilter_ipv4/Kbuild @@ -1,3 +1,5 @@ +header-y += ip_queue.h +header-y += ip_tables.h header-y += ipt_CLUSTERIP.h header-y += ipt_ECN.h header-y += ipt_LOG.h @@ -10,6 +12,3 @@ header-y += ipt_ah.h header-y += ipt_ecn.h header-y += ipt_realm.h header-y += ipt_ttl.h - -unifdef-y += ip_queue.h -unifdef-y += ip_tables.h diff --git a/trunk/include/linux/netfilter_ipv6/Kbuild b/trunk/include/linux/netfilter_ipv6/Kbuild index e864eaee9e5e..bd095bc075e9 100644 --- a/trunk/include/linux/netfilter_ipv6/Kbuild +++ b/trunk/include/linux/netfilter_ipv6/Kbuild @@ -1,12 +1,11 @@ +header-y += ip6_tables.h header-y += ip6t_HL.h header-y += ip6t_LOG.h header-y += ip6t_REJECT.h header-y += ip6t_ah.h header-y += ip6t_frag.h -header-y += ip6t_ipv6header.h header-y += ip6t_hl.h +header-y += ip6t_ipv6header.h header-y += ip6t_mh.h header-y += ip6t_opts.h header-y += ip6t_rt.h - -unifdef-y += ip6_tables.h diff --git a/trunk/include/linux/nfsd/Kbuild b/trunk/include/linux/nfsd/Kbuild index fc972048e572..55d1467de3c1 100644 --- a/trunk/include/linux/nfsd/Kbuild +++ b/trunk/include/linux/nfsd/Kbuild @@ -1,6 +1,6 @@ -unifdef-y += const.h -unifdef-y += debug.h -unifdef-y += export.h -unifdef-y += nfsfh.h -unifdef-y += stats.h -unifdef-y += syscall.h +header-y += const.h +header-y += debug.h +header-y += export.h +header-y += nfsfh.h +header-y += stats.h +header-y += syscall.h diff --git a/trunk/include/linux/sunrpc/Kbuild b/trunk/include/linux/sunrpc/Kbuild index fb438f158eee..98df21164a86 100644 --- a/trunk/include/linux/sunrpc/Kbuild +++ b/trunk/include/linux/sunrpc/Kbuild @@ -1 +1 @@ -unifdef-y += debug.h +header-y += debug.h diff --git a/trunk/include/sound/Kbuild b/trunk/include/sound/Kbuild index e9dd9369ecb9..802947f60915 100644 --- a/trunk/include/sound/Kbuild +++ b/trunk/include/sound/Kbuild @@ -1,9 +1,8 @@ +header-y += asequencer.h +header-y += asound.h header-y += asound_fm.h +header-y += emu10k1.h header-y += hdsp.h header-y += hdspm.h +header-y += sb16_csp.h header-y += sfnt_info.h - -unifdef-y += asequencer.h -unifdef-y += asound.h -unifdef-y += emu10k1.h -unifdef-y += sb16_csp.h diff --git a/trunk/include/video/Kbuild b/trunk/include/video/Kbuild index 0e406f730c2f..ad3e622c5339 100644 --- a/trunk/include/video/Kbuild +++ b/trunk/include/video/Kbuild @@ -1,2 +1,3 @@ -unifdef-y += sisfb.h uvesafb.h -unifdef-y += edid.h +header-y += edid.h +header-y += sisfb.h +header-y += uvesafb.h diff --git a/trunk/mm/page-writeback.c b/trunk/mm/page-writeback.c index 7262aacea8a2..20890d80c7ef 100644 --- a/trunk/mm/page-writeback.c +++ b/trunk/mm/page-writeback.c @@ -397,7 +397,7 @@ unsigned long determine_dirtyable_memory(void) return x + 1; /* Ensure that we never return 0 */ } -/* +/** * global_dirty_limits - background-writeback and dirty-throttling thresholds * * Calculate the dirty thresholds based on sysctl parameters @@ -440,7 +440,7 @@ void global_dirty_limits(unsigned long *pbackground, unsigned long *pdirty) *pdirty = dirty; } -/* +/** * bdi_dirty_limit - @bdi's share of dirty throttling threshold * * Allocate high/low dirty limits to fast/slow devices, in order to prevent