Commit Graph

202 Commits

Author SHA1 Message Date
Frank Crawford
79a4c239e0 hwmon: (it87) Remove tests nolonger required
Remove DMI tests for boards that are known to have issues with entering
configuration mode, as now we are testing the chips directly and no
longer need to rely on matching the board.

Leave the DMI table in place, for the nVIDIA board, and any future
expansions.

Signed-off-by: Frank Crawford <frank@crawford.emu.id.au>
Link: https://lore.kernel.org/r/20240428060653.2425296-5-frank@crawford.emu.id.au
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-04-30 10:32:14 -07:00
Frank Crawford
e58095cfc5 hwmon: (it87) Test for chipset before entering configuration mode
Major part of the change for the new method to avoid chipset issues.

The actual update does the following:

1) Lock the memory, but does not perform a SIO entry (previously it
would have performed an SIO entry).

2) Attempt to read the chipID.  This should be safe no matter which
chip we have.

3) If step (2) fails, then perform SIO entry and retry chipID read.  For
older chips and on failure it acts similarly to prior to this patch.

4) Set the sio_data->type, similar to previously.

5) If we have not performed an SIO entry, and this is not a chip type
with the NOCONF feature, then it will perform an SIO entry at this
point.

6) Proceed with setup as prior to this patch.

7) Any following access to the SIO registers will invoke the SIO entry
and SIO exit steps unless it is a chip with the NOCONF feature set.
This was set up in the previous patches in this patchset.

8) Update to the exit based on if it had performed a SIO entry or not.

Signed-off-by: Frank Crawford <frank@crawford.emu.id.au>
Link: https://lore.kernel.org/r/20240428060653.2425296-4-frank@crawford.emu.id.au
[groeck: s/intialised/initialized/]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-04-30 10:32:14 -07:00
Frank Crawford
e2e6a23f4b hwmon: (it87) Do not enter configuration mode for some chiptypes
Update the configuration mode entry code to allow conditional entry, and
apply to all calls.

Signed-off-by: Frank Crawford <frank@crawford.emu.id.au>
Link: https://lore.kernel.org/r/20240428060653.2425296-3-frank@crawford.emu.id.au
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-04-30 10:32:14 -07:00
Frank Crawford
f4f3e5de2e hwmon: (it87) Rename FEAT_CONF_NOEXIT to FEAT_NOCONF as more descriptive of requirement
Rename previous definitions to match the new information that they are
preinitialised as enabled and should not receive codes to enter or exit
configuration mode.

Signed-off-by: Frank Crawford <frank@crawford.emu.id.au>
Link: https://lore.kernel.org/r/20240428060653.2425296-2-frank@crawford.emu.id.au
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-04-30 10:32:14 -07:00
Frank Crawford
6593eac899 hwmon: (it87) Add support to detect sensor type AMDTSI
Add test for sensor type AMDTSI which is available on certain recent
chipsets.

Signed-off-by: Frank Crawford <frank@crawford.emu.id.au>
Link: https://lore.kernel.org/r/20230707123005.956415-4-frank@crawford.emu.id.au
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-08-21 06:04:29 -07:00
Frank Crawford
2f60e59329 hwmon: (it87) Improve temperature reporting support
Add test if thermistor sensor type attribute should be visible, i.e.
test if the attribute is defined.

Signed-off-by: Frank Crawford <frank@crawford.emu.id.au>
Link: https://lore.kernel.org/r/20230707123005.956415-3-frank@crawford.emu.id.au
[groeck: Dropped unnecessary 'type' variable in it87_temp_is_visible()]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-08-21 06:04:29 -07:00
Frank Crawford
4018e0a9c0 hwmon: (it87) Split temperature sensor detection to separate function
The temperature sensor type will need to be used in multiple places, so
split it out into its own function.

Signed-off-by: Frank Crawford <frank@crawford.emu.id.au>
Link: https://lore.kernel.org/r/20230707123005.956415-2-frank@crawford.emu.id.au
[groeck: Dropped unnecessary 'type' variable in show_temp_type()]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-08-21 06:04:29 -07:00
Frank Crawford
317840cfd6 hwmon: (it87) Generalise support for FAN_CTL ON/OFF
Support for FAN_CTL ON/OFF is currently disabled only for IT8603E but
there are severl chips that don't support the configuration bits to turn
off fan control entirely.  Generalise this support for any chip.

Add feature flag FEAT_FANCTL_ONOFF for chips that support configuration
bits for management of fan control off and assign all chips that support
the configuration.

Signed-off-by: Frank Crawford <frank@crawford.emu.id.au>
Link: https://lore.kernel.org/r/20230527094756.3464256-1-frank@crawford.emu.id.au
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-06-08 06:44:14 -07:00
Frank Crawford
339c8f2484 hwmon: (it87) Allow for chips with only 4 temp sensors
Some chips are known to only have 4 temperature sensors and there is no
requirement to test for more.  Currently only the IT8622E fits this
category.

Signed-off-by: Frank Crawford <frank@crawford.emu.id.au>
Link: https://lore.kernel.org/r/20230430045032.1723288-1-frank@crawford.emu.id.au
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-06-08 06:41:17 -07:00
Frank Crawford
bd5940221b hwmon: (it87) Update IT8732F chip for 4 fans and PWMs
Add support for 4 fans and 4 PWMs to chipset IT8732F.

Signed-off-by: Frank Crawford <frank@crawford.emu.id.au>
Link: https://lore.kernel.org/r/20230429115205.1547251-4-frank@crawford.emu.id.au
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-06-08 06:41:17 -07:00
Frank Crawford
39a6dcf640 hwmon: (it87) Add controls for chips with only 4 PWMs
Add feature and support for chips with only 4 PWMs.

Signed-off-by: Frank Crawford <frank@crawford.emu.id.au>
Link: https://lore.kernel.org/r/20230429115205.1547251-3-frank@crawford.emu.id.au
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-06-08 06:41:17 -07:00
Frank Crawford
5a4417bc67 hwmon: (it87) Add controls for chips with only 4 fans
Add feature and support for chips with only 4 fans.

Reorder macro definitions to bring all fan definitions together.

Signed-off-by: Frank Crawford <frank@crawford.emu.id.au>
Link: https://lore.kernel.org/r/20230429115205.1547251-2-frank@crawford.emu.id.au
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-06-08 06:41:17 -07:00
Frank Crawford
0be1007717 hwmon: (it87) Disable/enable SMBus access for IT8622E chipset
Configure the IT8622E chip to disable/re-enable access via an SMBus when
reading or writing the chip's registers.

Signed-off-by: Frank Crawford <frank@crawford.emu.id.au>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-04-21 07:27:23 -07:00
Frank Crawford
376e1a937b hwmon: (it87) Add calls to smbus_enable/smbus_disable as required
Disable/re-enable access through SMBus for chip registers when they are
are being read or written.

For simple cases this is done at the same time as when a mutex is set,
however, within loops or during initialisation it is done separately.

Signed-off-by: Frank Crawford <frank@crawford.emu.id.au>
[groeck: Fixed multi-line alignment]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-04-21 07:27:23 -07:00
Frank Crawford
0282ba4a4f hwmon: (it87) Test for error in it87_update_device
Handle errors from it87_update_device(), which currently only occurs if
SMBus access locking fails.

Signed-off-by: Frank Crawford <frank@crawford.emu.id.au>
[groeck: Fixed handling in show_temp_type()]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-04-21 07:27:08 -07:00
Frank Crawford
9989b3c0ff hwmon: (it87) Disable SMBus access for environmental controller registers.
Add functions to disable and re-enable access by the SMBus for specific
chips.

Signed-off-by: Frank Crawford <frank@crawford.emu.id.au>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-04-19 07:08:40 -07:00
Frank Crawford
dedbe4c149 hwmon: (it87) Use voltage scaling macro where appropriate
Apply scaling macro to match the labels for internal voltage sensors.

Signed-off-by: Frank Crawford <frank@crawford.emu.id.au>
Link: https://lore.kernel.org/r/20230318080543.1226700-3-frank@crawford.emu.id.au
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-04-19 07:08:33 -07:00
Frank Crawford
968b66ffeb hwmon (it87): Fix voltage scaling for chips with 10.9mV ADCs
Fix voltage scaling for chips that have 10.9mV ADCs, where scaling was
not performed.

Fixes: ead8080351 ("hwmon: (it87) Add support for IT8732F")
Signed-off-by: Frank Crawford <frank@crawford.emu.id.au>
Link: https://lore.kernel.org/r/20230318080543.1226700-2-frank@crawford.emu.id.au
[groeck: Update subject and description to focus on bug fix]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-03-21 19:14:55 -07:00
Frank Crawford
d44cb4cd74 hwmon: (it87) Add new chipset IT87952E
Add IT87952E, a new chip ID (DEV ID 0x8695), which appears to be an
updated version of the IT8792E and takes the same configuration.

The model name comes from the model name printed on the chip.

There is no datasheet publicly available.

Signed-off-by: Frank Crawford <frank@crawford.emu.id.au>
Link: https://lore.kernel.org/r/20230128060308.1549707-7-frank@crawford.emu.id.au
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-02-03 07:30:11 -08:00
Frank Crawford
2a64e9d445 hwmon: (it87) Allow multiple chip IDs for force_id
Extend the force_id module parameter to allow specifying one or both
chip IDs separately.  If only a single parameter is given it defaults
to using that value for all chips, similar to previous usage.

Signed-off-by: Frank Crawford <frank@crawford.emu.id.au>
Link: https://lore.kernel.org/r/20230128060308.1549707-6-frank@crawford.emu.id.au
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-02-03 07:30:11 -08:00
Frank Crawford
f09c796505 hwmon: (it87) Add chip_id in some info message
In cases where there are multiple chips, print out which chip is
referred to, in the informational message.

Signed-off-by: Frank Crawford <frank@crawford.emu.id.au>
Link: https://lore.kernel.org/r/20230128060308.1549707-5-frank@crawford.emu.id.au
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-02-03 07:30:11 -08:00
Frank Crawford
1f21531d4f hwmon: (it87) List full chip model name
ITE model names do not always match the chip ID.

Convert from just adding a suffix to specifying the full model name.

Signed-off-by: Frank Crawford <frank@crawford.emu.id.au>
Link: https://lore.kernel.org/r/20230128060308.1549707-4-frank@crawford.emu.id.au
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-02-03 07:30:11 -08:00
Frank Crawford
e114737850 hwmon: (it87) Disable configuration exit for certain chips
IT8790E and IT8792E/IT8795E have been identified as chips that can have
issues when disabling configuration mode.

Set to never exit configuration mode.

Signed-off-by: Frank Crawford <frank@crawford.emu.id.au>
Link: https://lore.kernel.org/r/20230128060308.1549707-3-frank@crawford.emu.id.au
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-02-03 07:30:11 -08:00
Frank Crawford
4119693bd2 hwmon: (it87) Allow disabling exiting of configuration mode
Disabling configuration mode on some chips can result in system
hang-ups and access failures to the Super-IO chip at the
second SIO address. Never exit configuration mode on these
chips to avoid the problem.

This patch should be applied in conjunction with a previous one to
initialise the second chip for certain mother boards.

Signed-off-by: Frank Crawford <frank@crawford.emu.id.au>
Link: https://lore.kernel.org/r/20230128060308.1549707-2-frank@crawford.emu.id.au
[groeck: Change feature bit from 28 to 19 to be continuous]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-02-03 07:30:11 -08:00
Frank Crawford
b361a1cf62 hwmon: (it87) Group all related MODULE_PARM definitions together
Group the MODULE_PARM definitions together to make them easier for
future maintenance, rather than having them spread across the file.

Signed-off-by: Frank Crawford <frank@crawford.emu.id.au>
Link: https://lore.kernel.org/r/20230121085754.1693336-2-frank@crawford.emu.id.au
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-02-03 07:30:10 -08:00
Frank Crawford
ff9dedd2da hwmon: (it87) Set second Super-IO chip in configuration mode
On various Gigabyte AM4 boards (AB350, AX370), the second Super-IO chip
(IT8792E) needs to be in configuration mode before accessing the first
due to a bug in IT8792E which otherwise results in LPC bus access errors.
This needs to be done before accessing the first Super-IO chip since
the second chip may have been accessed prior to loading this driver.

The problem is also reported to affect IT8795E, which is used on X299
boards and has the same chip ID as IT8792E (0x8733). It also appears
to affect systems with IT8790E, which is used on some Z97X-Gaming boards
as well as Z87X-OC, and other more recent Gigabyte boards.

Signed-off-by: Frank Crawford <frank@crawford.emu.id.au>
Link: https://lore.kernel.org/r/20230104060926.619686-3-frank@crawford.emu.id.au
[groeck: Made description pass checkpatch]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-02-03 07:30:10 -08:00
Frank Crawford
d47e377c7b hwmon: (it87) Allow calling __superio_enter outside muxed region
Allow for superio_enter to be called without requesting the muxed memory
region, in particular for initialisation of the second chipset, which must
be put into configuration mode, but without an associated call to leave
configuration mode.

Signed-off-by: Frank Crawford <frank@crawford.emu.id.au>
Link: https://lore.kernel.org/r/20230104060926.619686-2-frank@crawford.emu.id.au
[groeck: Clarified subject]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-02-03 07:30:10 -08:00
Frank Crawford
a1bedbcc1c hwmon: (it87) Add DMI table for future extensions
Add in DMI matching table to match various board quirks and settings.
This will be useful for future extentions, but will start with the
existing definition of the Shuttle SN68PT.

Signed-off-by: Frank Crawford <frank@crawford.emu.id.au>
Link: https://lore.kernel.org/r/20221105232531.1619387-1-frank@crawford.emu.id.au
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2022-12-04 16:45:02 -08:00
Ahmad Khalifa
b3b19931a5 hwmon: (it87) Check for a valid chip before using force_id
Check there is a chip before using force_id parameter as there
is no value in registering a non-existent chip

Signed-off-by: Ahmad Khalifa <ahmad@khalifa.ws>
Link: https://lore.kernel.org/r/20221004210100.540120-3-ahmad@khalifa.ws
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2022-12-04 16:45:02 -08:00
Ahmad Khalifa
12c44ab8b4 hwmon: (it87) Add param to ignore ACPI resource conflicts
Add parameter to ignore ACPI resource conflicts as an alternate to using
'acpi_enforce_resources=lax'.

Some BIOSes reserve resources and don't use them and the system wide
parameter may result in failures to certain drivers.

Signed-off-by: Ahmad Khalifa <ahmad@khalifa.ws>
Link: https://lore.kernel.org/r/20221004210100.540120-2-ahmad@khalifa.ws
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2022-12-04 16:45:01 -08:00
Jonathan Cameron
31b34d6208 hwmon: (it87) Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
These newer PM macros allow the compiler to see what code it can remove
if !CONFIG_PM_SLEEP. This allows the removal of __maybe_unused markings
whilst achieving the same result.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Link: https://lore.kernel.org/r/20220925172759.3573439-7-jic23@kernel.org
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2022-09-25 14:22:12 -07:00
Paul Fertser
952a11ca32 hwmon: cleanup non-bool "valid" data fields
We have bool so use it consistently in all the drivers.

The following Coccinelle script was used:

@@
identifier T;
type t = { char, int };
@@
struct T {
...
-	t valid;
+	bool valid;
...
}

@@
identifier v;
@@
(
- v->valid = 0
+ v->valid = false
|
- v->valid = 1
+ v->valid = true
)

followed by sed to fixup the comments:
sed '/bool valid;/{s/!=0/true/;s/zero/false/}'

Few whitespace changes were fixed manually. All modified drivers were
compile-tested.

Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Link: https://lore.kernel.org/r/20210924195202.27917-1-fercerpav@gmail.com
[groeck: Fixed up 'u8 valid' to 'boool valid' in atxp1.c]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2021-10-12 07:22:41 -07:00
Guenter Roeck
9d2227bb9b hwmon: Use kobj_to_dev()
coccinelle complains about

WARNING opportunity for kobj_to_dev()

in several files, resulting in one-by-one patch submissions.
Handle all remaining instances in one go.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2021-04-20 06:50:14 -07:00
Thomas Gleixner
c942fddf87 treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157
Based on 3 normalized pattern(s):

  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

  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 [author] [kishon] [vijay] [abraham]
  [i] [kishon]@[ti] [com] 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

  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 [author] [graeme] [gregory]
  [gg]@[slimlogic] [co] [uk] [author] [kishon] [vijay] [abraham] [i]
  [kishon]@[ti] [com] [based] [on] [twl6030]_[usb] [c] [author] [hema]
  [hk] [hemahk]@[ti] [com] 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

extracted by the scancode license scanner the SPDX license identifier

  GPL-2.0-or-later

has been chosen to replace the boilerplate/reference in 1105 file(s).

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Allison Randal <allison@lohutok.net>
Reviewed-by: Richard Fontana <rfontana@redhat.com>
Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org>
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190527070033.202006027@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-05-30 11:26:37 -07:00
Maciej S. Szmigiero
384548e569 hwmon: (it87) Reapply probe path chip registers settings after resume
After a suspend / resume cycle we possibly need to reapply chip registers
settings that we had set or fixed in a probe path, since they might have
been reset to default values or set incorrectly by a BIOS again.

Tested on a Gigabyte M720-US3 board, which requires routing internal VCCH5V
to in7 (and had it wrong again on resume from S3).

Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
[groeck: Return value from it87_resume_sio() is unused; make it void]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-08-13 08:24:38 -07:00
Maciej S. Szmigiero
557cbf49d2 hwmon: (it87) Split out chip registers setting code on probe path
This commit splits out chip registers setting code on probe path to
separate functions so they can be reused for setting the device properly
again when system resumes from suspend.

While we are at it let's also make clear that on IT8720 and IT8782 it's
the VCCH5V line that is (possibly) routed to in7.
This will make it consistent with a similar message that it printed on
IT8783.

Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-08-13 08:24:38 -07:00
Guenter Roeck
8358378b22 hwmon: (it87) Avoid registering the same chip on both SIO addresses
IT8705F is known to respond on both SIO addresses. Registering it twice
may result in system lockups.

Reported-by: Russell King <linux@armlinux.org.uk>
Fixes: e84bd9535e ("hwmon: (it87) Add support for second Super-IO chip")
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-03-22 00:18:21 -07:00
Guenter Roeck
e531ffc0ff hwmon: (it87) Add support for IT8792E
The chip is similar to IT8732E, but supports only three fans
and pwm outputs instead of four (the driver currently does not
support the 4th fan and pwm output of IT8732E).

Note that the chip ID is 0x8733, not 0x8792 as one would expect.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-02-10 21:35:08 -08:00
Guenter Roeck
4c7b8ca1ae hwmon: (it87) Do not overwrite bit 2..6 of pwm control registers
In IT8620E, after setting pwm control to manual, it was observed that
pwm values for fan 4..6 have reversed results (writing 0 results in fans
running at full speed, writing 255 results in fans turned off).

With the new PWM control, pwm polarity for pwm control 4..6 is specified
in its pwm control registers. Those registers are overwritten when setting
the pwm mode or the temperature mapping. Do not touch bit 2..6 of pwm
control registers on register writes to fix the problem.

Cc: stable@vger.kernel.org # 4.9+
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-02-10 21:35:08 -08:00
Guenter Roeck
d66777caa5 hwmon: (it87) Fix pwm4 detection for IT8620 and IT8628
pwm4 is enabled if bit 2 of GPIO control register 4 is disabled,
not when it is enabled. Since the check is for the skip condition,
it is reversed. This applies to both IT8620 and IT8628.

Fixes: 36c4d98a78 ("hwmon: (it87) Add support for all pwm channels ...")
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-02-10 21:35:08 -08:00
Guenter Roeck
82dbe987b7 hwmon: (it87) Ensure that pwm control cache is current before updating values
If sensor attributes were never read, the pwm control data has not been
initiialized, which can cause wrong driver behavior. Ensure that cached
data is current before acting on it.

Cc: stable@vger.kernel.org # 4.4+
Reported-by: Kevin Folz <kfolz@evertz.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-02-10 21:35:08 -08:00
Guenter Roeck
638c1c07f9 hwmon: (it87) Improve IT8622 support
Configuration registers on ITE8622 are different to 8620 and 8628 and
require special handling. Also, the chip supports up to 5 pwm controls.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-02-10 21:35:08 -08:00
Guenter Roeck
8af1abae72 hwmon: (it87) Add support for IT8622E
IT8622E is similar to IT8620E, but only supports five pwm controls and
five fan tachometers.

Originally-from: Kevin Folz <kfolz@evertz.com>.
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-02-10 21:35:08 -08:00
Guenter Roeck
a9eebd4f28 hwmon: (it87) Add feature flag indicating that VIN3 is connected to 5V
On IT8622E and IT8628E, VIN3 is expected to be connected to +5V.
Add feature flag and reflect in input label.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-02-10 21:35:08 -08:00
Julia Lawall
ddc64ae839 hwmon: (it87) use permission-specific DEVICE_ATTR variants
Use DEVICE_ATTR_RO for read only attributes and DEVICE_ATTR_RW for
read/write attributes. This simplifies the source code, improves
readbility, and reduces the chance of inconsistencies.

The conversion was done automatically using coccinelle. It was validated
by compiling both the old and the new source code and comparing its text,
data, and bss size.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
[groeck: Updated description]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-01-02 10:19:45 -08:00
Jean Delvare
d5f3f6c812 hwmon: (it87) Drop useless comments
Remove the index comments at the end of it87_attributes_in. They
serve no purpose (as there is no reference to them in
it87_in_is_visible) and some of them were obviously wrong.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
Cc: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Cc: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2016-09-08 21:34:17 -07:00
Jean Delvare
3c3292634f hwmon: (it87) Add missing sysfs attribute group terminator
Attribute array it87_attributes_in lacks its NULL terminator,
causing random behavior when operating on the attribute group.

Fixes: 5292971563 ("hwmon: (it87) Use is_visible for voltage sensors")
Signed-off-by: Jean Delvare <jdelvare@suse.de>
Cc: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: stable@vger.kernel.org
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2016-08-29 05:31:31 -07:00
Guenter Roeck
aa8b187eea hwmon: (it87) Features mask must be 32 bit wide
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: cc18da79d9 ("hwmon: (it87) Support up to 6 temperature sensors ... ");
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2016-08-11 18:35:47 -07:00
Guenter Roeck
71a9c23246 hwmon: (it87) Add support for IT8628E
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-19 06:32:38 -07:00
Guenter Roeck
0624d86198 hwmon: (it87) Fix pwm_temp_map for system with 6 pwm channels
Tested-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2016-04-19 06:32:37 -07:00