summaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/it87.c
AgeCommit message (Collapse)Author
2016-08-11hwmon: (it87) Features mask must be 32 bit wideGuenter Roeck
Coverity reports: result_independent_of_operands: data->features & (65536UL /* 1UL << 16 */) is always 0 regardless of the values of its operands. This occurs as the logical operand of if. data->features needs to be 32 bit wide since there are more than 16 features. Fixes: cc18da79d9b7 ("hwmon: (it87) Support up to 6 temperature sensors ... "); Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2016-04-19hwmon: (it87) Add support for IT8628EGuenter Roeck
IT8628E is functionally identical to IT8620E. Tested-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2016-04-19hwmon: (it87) Fix pwm_temp_map for system with 6 pwm channelsGuenter Roeck
Tested-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2016-04-19hwmon: (it87) Support automatic pwm control on newer chipsGuenter Roeck
Tested-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2016-04-19hwmon: (it87) Enhance validation for fan4 and fan5Guenter Roeck
Several of the chips supported by this driver have a configuration register to enable fan4 and fan5. Use those registers to determine if fan4 and fan5 tachometers are supported. Tested-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2016-04-19hwmon: (it87) Support disabling fan control for all pwm control and chipsGuenter Roeck
On/Off mode is only supported for pwm controls 0-2, and not supported at all for IT8603E/IT8623E. For pwm controls 3-6 and for IT8603E/IT8623E, SmartGuardian mode is always enabled. Use it and set the pwm value to the maximum if fan control is disabled. Tested-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2016-04-19hwmon: (it87) Formatting cleanupGuenter Roeck
Fix various checkpatch complaints to clean up the code and make it easier to read. CHECK: Do not include the paragraph about writing to the FSF CHECK: Alignment should match open parenthesis CHECK: Logical continuations should be on the previous line CHECK: No space is necessary after a cast CHECK: Please don't use multiple blank lines CHECK: Please use a blank line after function/struct/union/enum declarations CHECK: spaces preferred around that '+' (ctx:VxV) WARNING: Missing a blank line after declarations No functional change. Tested-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2016-04-19hwmon: (it87) Use defines for array sizes and sensor countsGuenter Roeck
Using array size defines makes it much easier to find errors in index values and loop counts. Tested-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2016-04-19hwmon: (it87) Use BIT macroGuenter Roeck
Using the BIT macro makes the code a little easier to read and has the added benefit of making checkpatch happy. Tested-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2016-04-19hwmon: (it87) Add support for VIN7 to VIN10 on IT8620EGuenter Roeck
IT8620E supports three additional voltage sensors. Tested-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2016-04-19hwmon: (it87) Simplify reading voltage registersGuenter Roeck
Voltage registers are non-sequential. Use a register array instead of a macro to map sensor index to register to simplify the code and to make it easier to add additional voltage sensors. Tested-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2016-04-19hwmon: (it87) Support up to 6 temperature sensors on IT8620EGuenter Roeck
Add support for the additional temperature sensors on IT8620E. Tested-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2016-04-19hwmon: (it87) Convert to use new hwmon APIGuenter Roeck
Convert to use devm_hwmon_device_register_with_groups to simplify code and reduce code size. This also attaches sysfs attributes to the hwmon device and no longer to the platform device. Tested-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2016-04-19hwmon: (it87) Use single group and is_visible for miscellaneous attributesGuenter Roeck
Use is_visible to determine if attributes should be generated or not. This simplifies the code and reduces object size by about 120 bytes on x86_64. Tested-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2016-04-19hwmon: (it87) Use is_visible for pwm attributesGuenter Roeck
Simplify code and reduce object size by about 250 bytes on x86_64. Tested-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2016-04-19hwmon: (it87) Use is_visible for fan attributesGuenter Roeck
Simplify code and reduce object size by almost 500 bytes on x86_64. Tested-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2016-04-19hwmon: (it87) Use is_visible for temperature sensorsGuenter Roeck
Simplify code and reduce object size by more than 200 bytes on x86_64. Tested-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2016-04-19hwmon: (it87) Use is_visible for voltage sensorsGuenter Roeck
Simplify code and reduce object size by more than 300 bytes on x86_64. Tested-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2016-04-19hwmon: (it87) Rearrange code to avoid forward declarationsGuenter Roeck
Cleanup only, no functional change. Tested-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2016-04-19hwmon: (it87) Add support for second Super-IO chipGuenter Roeck
The Super-IO chip can also reside at SIO address 0x4e, and there can be two Super-IO chips in the system. Add support for it. Tested-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2016-04-19hwmon: (it87) Pass SIO base address as parameter to superio functionsGuenter Roeck
This will let us support more than one chip on different SIO addresses with the same driver. Tested-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2016-04-19hwmon: (it87) Don't use pdev as static driver variableGuenter Roeck
Using the same varible name for function names and as static variable invites misuse and prevents us from adding support for a second chip. Rename pdev to it87_pdev and limit its use to where it is needed. Tested-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2016-04-19hwmon: (it87) Simplify error return in it87_device_addGuenter Roeck
Return directly on errors if there is no cleanup necessary. Don't create an error message on memory allocation errors. Tested-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2016-04-19hwmon: (it87) Add support for second pwm frequency registerGuenter Roeck
Recent chips have a separate register to select the pwm2 frequency. Tested-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2016-04-19hwmon: (it87) Add support for all pwm channels on IT8620EGuenter Roeck
IT8620E supports up to 6 pwm channels. Add support for it. Also check if fan tachometers 4..6 are enabled before instantiating the respective sysfs attributes. Tested-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2016-04-19hwmon: (it87) Add feature flag for AVCC3 supportGuenter Roeck
AVCC3 is supported on IT8620E, similar to IT8603E. Add feature flag to indicate AVCC3 support. Don't enable it for now on IT8620E since it is unclear if this chip supports it correctly. Tested-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2015-08-09hwmon: (it87) Add support for IT8732FJustin Maggard
Add support for the IT8732F. This chip is pretty similar to IT8721F, with the main difference being that the ADC LSB is 10.9 mV instead of 12 mV. Signed-off-by: Justin Maggard <jmaggard@netgear.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2015-04-09hwmon: (it87) Use feature macros on sio_dataGuenter Roeck
Feature macros work on sio_data as well, so use them there. Reviewed-by: Jean Delvare <jdelvare@suse.de> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2015-04-05hwmon: (it87) Add support for 6th fan of IT8620EGuenter Roeck
IT8620E supports up to 6 fan tachometers. Reviewed-by: Jean Delvare <jdelvare@suse.de> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2015-04-05hwmon: (it87) Add support for IT8620EGuenter Roeck
IT8620E is mostly compatible to IT7828F. Add generic support for it. IT8620E supports up to 6 fan tachometers and 6 pwm controls. Support for the 6th tachometer and for the additional pwm controls are addded in separate patches. Reviewed-by: Jean Delvare <jdelvare@suse.de> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2015-04-05hwmon: (it87) Add support for IT8790EGuenter Roeck
IT8790E is a super-IO chip with three fan tachometers. It is mostly compatible to IT8728F, but only supports three fan tachometers instead of five. Reviewed-by: Jean Delvare <jdelvare@suse.de> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2015-04-05hwmon: (it87) Introduce feature flag to reflect internal in7 sensorGuenter Roeck
On some chips, in7 is always an internal voltage sensor. Introduce feature flag to reflect this condition to simplify adding support for new chips. Reviewed-by: Jean Delvare <jdelvare@suse.de> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2015-04-05hwmon: (it87) Introduce configuration field for chip suffixGuenter Roeck
ITE chips may have 'E', 'F', or both 'E' and 'F' suffixes. Introduce suffic configuration to the it87_devices structure to simplify adding new chips. Reviewed-by: Jean Delvare <jdelvare@suse.de> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2015-04-05hwmon: (it87) Fix PWM frequency display for chips with newer PWM controlGuenter Roeck
On chips with newer PWM control, the PWM frequency divider is 256 instead of 128. Since the base PWM frequency remained the same, the actual PWM frequency is half of what it used to be with the older PWM control mechanism. Reviewed-by: Jean Delvare <jdelvare@suse.de> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2015-03-30hwmon: (it87) Fix pwm sysfs attribute removalGuenter Roeck
Detection if a pwm channel is supported was wrong on removal, causing the code to try removing non-existing sysfs attributes. That didn't matter much because sysfs attribute removal of non-existing files fails silently, and because the wrong evaluation always returned false, but should nevertheless be fixed. Reviewed-by: Jean Delvare <jdelvare@suse.de> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2015-03-09hwmon: (it87) No need to skip fan4 for IT8603Guenter Roeck
IT8603 only supports three fans, so it is not necessary to skip fan4. Reviewed-by: Jean Delvare <jdelvare@suse.de> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2015-03-09hwmon: (it87) Add support for IT8786EThomas Lorblanches
IT8786E is mostly compatible with IT8771 / IT8772. Parameters determined by testing various combinations. Reviewed-by: Jean Delvare <jdelvare@suse.de> Signed-off-by: Thomas Lorblanches <zlika_ese@hotmail.com> [Guenter Roeck: merged from github, addressed review comments] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2015-03-09hwmon: (it87) Add feature flag for VID supportGuenter Roeck
Newer chips don't typically support VID inputs or control. Add a feature flag for VID support to simplify adding support for new chips. Reviewed-by: Jean Delvare <jdelvare@suse.de> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2015-03-09hwmon: (it87) Add feature flags for fans count and 16-bit fan configurationGuenter Roeck
Fans 4-5 are not supported on all chips and revisions. Also, 16-bit fan counters are always enabled on some chips. Provide feature flags to simplify adding support for new chips. Reviewed-by: Jean Delvare <jdelvare@suse.de> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2015-03-09hwmon: (it87) Don't configure 16 bit fan counters it not necessaryGuenter Roeck
On IT8728F, IT8771E, and IT8772E, fans counters are always 16 bit and don't need to be configured for it. Reviewed-by: Jean Delvare <jdelvare@suse.de> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2015-03-09hwmon: (it87) Add support for IT8781FGuenter Roeck
IT8781F is mostly compatible to IT8782F. Major difference is that it only supports four instead of six UART channels, and therefore does not share the uart6 pins. Reviewed-by: Jean Delvare <jdelvare@suse.de> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2014-10-20hwmon: drop owner assignment from platform_driversWolfram Sang
A platform_driver does not need to set an owner, it will be populated by the driver core. Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2014-04-04hwmon: (it87) Add support for IT8623ERudolf Marek
Add support for the IT8623E found on Asus motherboards. It has same hardware monitoring block as IT8603E. Signed-off-by: Rudolf Marek <r.marek@assembler.cz> Signed-off-by: Jean Delvare <jdelvare@suse.de>
2014-04-04hwmon: (it87) Fix IT8603E define nameRudolf Marek
Fix small typo in the define name for IT8603E. Signed-off-by: Rudolf Marek <r.marek@assembler.cz> Signed-off-by: Jean Delvare <jdelvare@suse.de>
2014-01-29Update Jean Delvare's e-mail addressJean Delvare
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2014-01-29hwmon: (it87) Print proper names for the IT8771E and IT8772EJean Delvare
The driver prints IT8771F and IT8772F instead of IT8771E and IT8772E respectively when the driver is loaded. This is a cosmetic only bug but let's fix it. Signed-off-by: Jean Delvare <khali@linux-fr.org>
2014-01-29hwmon: (it87) Add support for the ITE IT8603ERudolf Marek
Add support for IT8603E. This closes bug #57861: https://bugzilla.kernel.org/show_bug.cgi?id=57861 [JD: Fixes and clean-ups.] Signed-off-by: Rudolf Marek <r.marek@assembler.cz> Signed-off-by: Jean Delvare <khali@linux-fr.org>
2013-08-11hwmon: use dev_get_platdata()Jingoo Han
Use the wrapper function for retrieving the platform data instead of accessing dev->platform_data directly. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-04-07hwmon: Fix CamelCase checkpatch warningsGuenter Roeck
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-02-06hwmon: (it87) Add support for IT8771E and IT8772EGuenter Roeck
Assume that IT8771E and IT8772E are fully compatible with IT8728F. IT8771E support contributed by Kelly Anderson. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Reviewed-by: Jean Delvare <khali@linux-fr.org>