1
0
Fork 0
Commit Graph

857129 Commits (ffd96868ac5d4c22bba1ba2175d124cb2775f3f7)

Author SHA1 Message Date
Dan Robertson ffd96868ac hwmon: (shtc1) add support for the SHTC3 sensor
Add support for the Sensirion SHTC3 humidity and temperature sensor to
the shtc1 module.

Signed-off-by: Dan Robertson <dan@dlrobertson.com>
Link: https://lore.kernel.org/r/20190905014554.21658-2-dan@dlrobertson.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-09-10 11:42:56 -07:00
Dan Robertson fdc7d8e829 hwmon: (shtc1) fix shtc1 and shtw1 id mask
Fix an error in the bitmaskfor the shtc1 and shtw1 bitmask used to
retrieve the chip ID from the ID register. See section 5.7 of the shtw1
or shtc1 datasheet for details.

Fixes: 1a539d372e ("hwmon: add support for Sensirion SHTC1 sensor")
Signed-off-by: Dan Robertson <dan@dlrobertson.com>
Link: https://lore.kernel.org/r/20190905014554.21658-3-dan@dlrobertson.com
[groeck: Reordered to be first in series and adjusted accordingly]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-09-10 11:42:22 -07:00
Iker Perez del Palomar Sustatxa 35cd180485 hwmon: (lm75) Aproximate sample times to data-sheet values
Current sample time values are over estimated, this patches applies
values closer to the ones defined in the data-sheets.

Signed-off-by: Iker Perez del Palomar Sustatxa <iker.perez@codethink.co.uk>
[groeck: resolved conflicts; use default conversion times]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-09-04 11:06:47 -07:00
Wolfram Sang cf48d17623 hwmon: (w83793d) convert to use devm_i2c_new_dummy_device
And simplify the error handling.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Link: https://lore.kernel.org/r/20190903181256.13450-4-wsa+renesas@sang-engineering.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-09-03 12:47:17 -07:00
Wolfram Sang f64211151d hwmon: (w83792d) convert to use devm_i2c_new_dummy_device
And simplify the error handling.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Link: https://lore.kernel.org/r/20190903181256.13450-3-wsa+renesas@sang-engineering.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-09-03 12:47:17 -07:00
Wolfram Sang 358d207110 hwmon: (w83791d) convert to use devm_i2c_new_dummy_device
And simplify the error handling.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Link: https://lore.kernel.org/r/20190903181256.13450-2-wsa+renesas@sang-engineering.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-09-03 12:47:17 -07:00
kbuild test robot 09fe787051 hwmon: (as370-hwmon) fix devm_platform_ioremap_resource.cocci warnings
Use devm_platform_ioremap_resource helper which wraps
 platform_get_resource() and devm_ioremap_resource() together.

Generated by: scripts/coccinelle/api/devm_platform_ioremap_resource.cocci

Fixes: 658e687b4218 ("hwmon: Add Synaptics AS370 PVT sensor driver")
CC: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
Signed-off-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
Reviewed-by: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
Link: https://lore.kernel.org/r/alpine.DEB.2.21.1909030646180.3228@hadrien
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-09-03 12:47:17 -07:00
Guenter Roeck d7a85cde90 hwmon: (lm75) Add support for writing sampling period on PCT2075
For PCT7027, the sampling period is configured using a dedicated
register.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-09-03 12:47:17 -07:00
Guenter Roeck cee04a013a hwmon: (lm75) Add support for writing conversion time for TMP112
TMP112 uses an uncommon method to write the conversion time: its
configuration register is 16 bit wide, and the conversion time is
configured in its second byte.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-09-03 12:47:17 -07:00
Guenter Roeck 040b106ff8 hwmon: (lm75) Move updating the sample interval to its own function
We'll need per-chip handling for updating the sample interval.
To prepare for it, separate the code implementing it into its own
function.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-09-03 12:47:17 -07:00
Guenter Roeck 7db0db3f6c hwmon: (lm75) Support configuring the sample time for various chips
The conversion (sample) time is configurable for several chips supported
by the lm75 driver. With the necessary infrastructure in place, enable
this support for all chips using the configuration register for this
purpose.

DS1775:
	Conversion time:	187.5, 375, 750, 1500 ms
	Sensor resolution: 	9, 10, 11, 12 bit
DS75, STDS75:
	Conversion time:	150, 300, 600, 1200 ms
	Sensor resolution: 	9, 10, 11, 12 bit
DS7505:
	Conversion time:	25, 50, 100, 200 ms
	Sensor resolution: 	9, 10, 11, 12 bit
MCP980[0123]:
	Conversion time:	75, 150, 300, 600 ms
	Sensor resolution: 	9, 10, 11, 12 bit
TMP100, TMP101:
	Conversion time:	75, 150, 300, 600 ms
	Sensor resolution: 	9, 10, 11, 12 bit
TMP75, TMP105, TMP175, TMP275:
	Conversion time:	38, 75, 150, 300 ms
	Sensor resolution: 	9, 10, 11, 12 bit

While doing this, it became obvious that the masks and values to set
the converion (sample) time is similar for all those chips, and that
other chips with configurable sample times will need separate code anyway.
For that reason, replace the sample_set_masks and sample_clr_mask
configuration parameters with a single array and with a constant.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-09-03 12:47:17 -07:00
amy.shih 4a2d78822f hwmon: (nct7904) Fix incorrect temperature limitation register setting of LTD.
According to kernel hwmon sysfs-interface documentation, temperature
critical max value, typically greater than corresponding temp_max values.
Thus, reads the LTD_HV_HL (LTD HIGH VALUE HIGH LIMITATION) and LTD_LV_HL
(LTD LOW VALUE HIGH LIMITATION) for case hwmon_temp_crit and
hwmon_temp_crit_hyst. Reads the LTD_HV_LL (HIGH VALUE LOW LIMITATION)
and LTD_LV_LL (LOW VALUE LOW LIMITATION) for case hwmon_temp_max
and hwmon_temp_max_hyst.

Signed-off-by: amy.shih <amy.shih@advantech.com.tw>
Link: https://lore.kernel.org/r/20850618155720.24857-1-Amy.Shih@advantech.com.tw
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-09-03 12:47:17 -07:00
Jisheng Zhang 7b1b68f013 hwmon: (as370-hwmon) Add DT bindings for Synaptics AS370 PVT
Add device tree bindings for Synaptics AS370 PVT sensors.

Signed-off-by: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20190827113337.384457f6@xhacker.debian
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-09-03 12:47:17 -07:00
Jisheng Zhang 7548666e6f hwmon: Add Synaptics AS370 PVT sensor driver
Add a new driver for Synaptics AS370 PVT sensors. Currently, only
temperature is supported.

Signed-off-by: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20190827113259.4fb64a17@xhacker.debian
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-09-03 12:47:17 -07:00
Eddie James 2f8a855efe pmbus: (ibm-cffps) Add support for version 2 of the PSU
Version 2 of the PSU supports a second page of data and changes the
format of the FW version. Use the devicetree binding to differentiate
between the version the driver should use.

Signed-off-by: Eddie James <eajames@linux.ibm.com>
Link: https://lore.kernel.org/r/1567192263-15065-4-git-send-email-eajames@linux.ibm.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-09-03 12:47:17 -07:00
Eddie James d600981d80 dt-bindings: hwmon: Document ibm,cffps2 compatible string
Document the compatible string for version 2 of the IBM CFFPS PSU.

Signed-off-by: Eddie James <eajames@linux.ibm.com>
Link: https://lore.kernel.org/r/1567192263-15065-2-git-send-email-eajames@linux.ibm.com
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-09-03 12:47:17 -07:00
Michal Simek bc34301b10 hwmon: (iio_hwmon) Enable power exporting from IIO
There is no reason why power channel shouldn't be exported as is done for
voltage, current, temperature and humidity.

Power channel is available on iio ina226 driver.

Sysfs IIO documentation for power attribute added by commit 7c6d5c7ee8
("iio: Documentation: Add missing documentation for power attribute")
is declaring that value is in mili-Watts but hwmon interface is expecting
value in micro-Watts that's why there is a need for mili-Watts to
micro-Watts conversion.

Tested on Xilinx ZCU102 board.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Link: https://lore.kernel.org/r/db71f5ae87e4521a2856a1be5544de0b6cede575.1566483741.git.michal.simek@xilinx.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-09-03 12:47:17 -07:00
John Wang be7ec9196b dt-bindings: Add ipsps1 as a trivial device
The ipsps1 is an Inspur Power System power supply unit

Signed-off-by: John Wang <wangzqbj@inspur.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-09-03 12:47:17 -07:00
John Wang edd2a4d660 hwmon: pmbus: Add Inspur Power System power supply driver
Add the driver to monitor Inspur Power System power supplies
with hwmon over pmbus.

This driver adds sysfs attributes for additional power supply data,
including vendor, model, part_number, serial number,
firmware revision, hardware revision, and psu mode(active/standby).

Signed-off-by: John Wang <wangzqbj@inspur.com>
Reviewed-by: Joel Stanley <joel@jms.id.au>
Link: https://lore.kernel.org/r/20190819091509.29276-1-wangzqbj@inspur.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-09-03 12:47:17 -07:00
Max Staudt 06a1c69cf5 hwmon/ltc2990: Generalise DT to fwnode support
ltc2990 will now use device_property_read_u32_array() instead of
of_property_read_u32_array() - allowing the use of software nodes
via fwnode_create_software_node().

This allows code using i2c_new_device() to specify a default
measurement mode for the LTC2990 via fwnode_create_software_node().

Signed-off-by: Max Staudt <max@enpas.org>
Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
Link: https://lore.kernel.org/r/20190819121618.16557-2-max@enpas.org
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-09-03 12:47:17 -07:00
Stefan Wahren 10b1f2a9d4 hwmon: (raspberrypi) update MODULE_AUTHOR() email address
The email address listed in MODULE_AUTHOR() will be disabled in the
near future. Replace it with my private one.

Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
Link: https://lore.kernel.org/r/1565720249-6549-2-git-send-email-wahrenst@gmx.net
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-09-03 12:47:17 -07:00
Iker Perez del Palomar Sustatxa 4b5be3c173 hwmon: (lm75) Modularize lm75_write and make hwmon_chip writable
* Create two separate functions to write into hwmon_temp and hwmon_chip.
* Call the functions from lm75_write.
* Make hwm_chip writable if the chip supports more than one sample time.

Signed-off-by: Iker Perez del Palomar Sustatxa <iker.perez@codethink.co.uk>
Link: https://lore.kernel.org/r/20190808080246.8371-5-iker.perez@codethink.co.uk
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-09-03 12:47:17 -07:00
Iker Perez del Palomar Sustatxa 7f1a300f8a hwmon: (lm75) Add new fields into lm75_params_
The new fields are included to prepare the driver for next patch. The
fields are:

* *resolutions: Stores all the supported resolutions by the device.
* num_sample_times: Stores the number of possible sample times.
* *sample_times: Stores all the possible sample times to be set.
* sample_set_masks: The set_masks for the possible sample times
* sample_clr_mask: Clear mask to set the default sample time.

Signed-off-by: Iker Perez del Palomar Sustatxa <iker.perez@codethink.co.uk>
Link: https://lore.kernel.org/r/20190808080246.8371-4-iker.perez@codethink.co.uk
[groeck: Minor structure documentation fixes]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-09-03 12:47:17 -07:00
Iker Perez del Palomar Sustatxa 58608cfee8 hwmon: (lm75) Create function from code to write into registers
Wrap the existing code to write configurations into registers in
a function.

Added error handling to the function.

Signed-off-by: Iker Perez del Palomar Sustatxa <iker.perez@codethink.co.uk>
Link: https://lore.kernel.org/r/20190808080246.8371-3-iker.perez@codethink.co.uk
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-09-03 12:47:17 -07:00
Iker Perez del Palomar Sustatxa dcb1265387 hwmon: (lm75) Create structure to save all the configuration parameters.
* Add to lm75_data kind field to store the kind of device the driver is
  working with.
* Add an structure to store the configuration parameters of all the
  supported devices.
* Delete resolution_limits from lm75_data and include them in the structure
  described above.
* Add a pointer to the configuration parameters structure to be used as a
  reference to obtain the parameters.
* Delete switch-case approach to get the device configuration parameters.
* The structure is cleaner and easier to maintain.

Signed-off-by: Iker Perez del Palomar Sustatxa <iker.perez@codethink.co.uk>
Link: https://lore.kernel.org/r/20190808080246.8371-2-iker.perez@codethink.co.uk
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-09-03 12:47:17 -07:00
amy.shih 486842db3b hwmon: (nct7904) Add extra sysfs support for fan, voltage and temperature.
NCT-7904D also supports reading of channel limitation registers as well
as SMI status registers for fan, voltage and temperature monitoring.
It also supports reading the temperature sensor type (thermal diode,
thermistor, AMD SB-TSI or Intel PECI).

Add the following sysfs nodes:

-fan[1-*]_min
-fan[1-*]_alarm
-in[1-*]_min
-in[1-*]_max
-in[1-*]_alarm
-temp[1-*]_max
-temp[1-*]_max_hyst
-temp[1-*]_emergency
-temp[1-*]_emergency_hyst
-temp[1-*]_alarm
-temp[1-*]_type

Signed-off-by: Amy Shih <amy.shih@advantech.com.tw>
Link: https://lore.kernel.org/r/20190807013842.24451-1-Amy.Shih@advantech.com.tw
[groeck: Clarified description]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-09-03 12:47:17 -07:00
Jean Delvare dbf5520511 hwmon: w83795: Fan control option isn't that dangerous
I have been using SENSORS_W83795_FANCTRL for several years and never
had any problem. When the driver was added, I had not tested that
part of the driver yet so I wanted to be super cautious, but time has
shown that it works just fine.

In the long run I even believe that we should drop the option and
enable the feature unconditionally. It doesn't do anything until the
user explicitly starts twiddling with sysfs attributes anyway.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
Link: https://lore.kernel.org/r/20190806102123.3118bcc5@endymion
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-09-03 12:47:17 -07:00
Stephen Boyd f2ff7ceaa4 hwmon: (npcm750-pwm-fan) Remove dev_err() usage after platform_get_irq()
We don't need dev_err() messages when platform_get_irq() fails now that
platform_get_irq() prints an error message itself when something goes
wrong. Let's remove these prints with a simple semantic patch.

// <smpl>
@@
expression ret;
struct platform_device *E;
@@

ret =
(
platform_get_irq(E, ...)
|
platform_get_irq_byname(E, ...)
);

if ( \( ret < 0 \| ret <= 0 \) )
{
(
-if (ret != -EPROBE_DEFER)
-{ ...
-dev_err(...);
-... }
|
...
-dev_err(...);
)
...
}
// </smpl>

While we're here, remove braces on if statements that only have one
statement (manually).

Cc: Jean Delvare <jdelvare@suse.com>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: linux-hwmon@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
[groeck: Dropped jz4740-hwmon.c (driver is being removed)]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-09-03 12:47:17 -07:00
Wang Shenran 6e4d91aa07 hwmon: (acpi_power_meter) Change log level for 'unsafe software power cap'
At boot time, the acpi_power_meter driver logs the following error level
message: "Ignoring unsafe software power cap". Having read about it from
a few sources, it seems that the error message can be quite misleading.

While the message can imply that Linux is ignoring the fact that the
system is operating in potentially dangerous conditions, the truth is
the driver found an ACPI_PMC object that supports software power
capping. The driver simply decides not to use it, perhaps because it
doesn't support the object.

The best solution is probably changing the log level from error to warning.
All sources I have found, regarding the error, have downplayed its
significance. There is not much of a reason for it to be on error level,
while causing potential confusions or misinterpretations.

Signed-off-by: Wang Shenran <shenran268@gmail.com>
Link: https://lore.kernel.org/r/20190724080110.6952-1-shenran268@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-09-03 12:47:17 -07:00
Björn Gerhart 29c7cb485b hwmon: (nct6775) Integrate new model nct6116
Add support for NCT6116D to nct6775 driver.

Signed-off-by: Bjoern Gerhart <gerhart@posteo.de>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-09-03 12:47:17 -07:00
Grant McEwan c64fce7f2a hwmon: (adt7475) Convert to use hwmon_device_register_with_groups()
hwmon_device_register() is a deprecated function and produces a warning.

Converting the driver to use the hwmon_device_register_with_groups()
instead.

Signed-off-by: Grant McEwan <grant.mcewan@alliedtelesis.co.nz>
Link: https://lore.kernel.org/r/20190721225530.28799-2-grant.mcewan@alliedtelesis.co.nz
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-09-03 12:47:17 -07:00
Wolfram Sang 22e96ce318 hwmon: (w83781d) convert to i2c_new_dummy_device
Move from i2c_new_dummy() to i2c_new_dummy_device(), so we now get an
ERRPTR which we use in error handling.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Link: https://lore.kernel.org/r/20190722172611.3797-4-wsa+renesas@sang-engineering.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-09-03 12:47:17 -07:00
Wolfram Sang 25d4016464 hwmon: (smm665) convert to i2c_new_dummy_device
Move from i2c_new_dummy() to i2c_new_dummy_device(), so we now get an
ERRPTR which we use in error handling.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Link: https://lore.kernel.org/r/20190722172611.3797-3-wsa+renesas@sang-engineering.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-09-03 12:47:17 -07:00
Wolfram Sang 8f9508ebbf hwmon: (asb100) convert to i2c_new_dummy_device
Move from i2c_new_dummy() to i2c_new_dummy_device(), so we now get an
ERRPTR which we use in error handling.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Link: https://lore.kernel.org/r/20190722172611.3797-2-wsa+renesas@sang-engineering.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-09-03 12:47:17 -07:00
Marcel Bocu 12163cfbfc hwmon: (k10temp) Add support for AMD family 17h, model 70h CPUs
It would seem like model 70h is behaving in the same way as model 30h,
so let's just add the new F3 PCI ID to the list of compatible devices.

Unlike previous Ryzen/Threadripper, Ryzen gen 3 processors do not need
temperature offsets anymore. This has been reported in the press and
verified on my Ryzen 3700X by checking that the idle temperature
reported by k10temp is matching the temperature reported by the
firmware.

Vicki Pfau sent an identical patch after I checked that no-one had
written this patch. I would have been happy about dropping my patch but
unlike for his patch series, I had already Cc:ed the x86 people and
they already reviewed the changes. Since Vicki has not answered to
any email after his initial series, let's assume she is on vacation
and let's avoid duplication of reviews from the maintainers and merge
my series. To acknowledge Vicki's anteriority, I added her S-o-b to
the patch.

v2, suggested by Guenter Roeck and Brian Woods:
  - rename from 71h to 70h

Signed-off-by: Vicki Pfau <vi@endrift.com>
Signed-off-by: Marcel Bocu <marcel.p.bocu@gmail.com>
Tested-by: Marcel Bocu <marcel.p.bocu@gmail.com>

Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: x86@kernel.org
Cc: "Woods, Brian" <Brian.Woods@amd.com>
Cc: Clemens Ladisch <clemens@ladisch.de>
Cc: Jean Delvare <jdelvare@suse.com>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: linux-hwmon@vger.kernel.org
Link: https://lore.kernel.org/r/20190722174653.2391-1-marcel.p.bocu@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-09-03 12:47:17 -07:00
Marcel Bocu af4e1c5eca x86/amd_nb: Add PCI device IDs for family 17h, model 70h
The AMD Ryzen gen 3 processors came with a different PCI IDs for the
function 3 & 4 which are used to access the SMN interface. The root
PCI address however remained at the same address as the model 30h.

Adding the F3/F4 PCI IDs respectively to the misc and link ids appear
to be sufficient for k10temp, so let's add them and follow up on the
patch if other functions need more tweaking.

Vicki Pfau sent an identical patch after I checked that no-one had
written this patch. I would have been happy about dropping my patch but
unlike for his patch series, I had already Cc:ed the x86 people and
they already reviewed the changes. Since Vicki has not answered to
any email after his initial series, let's assume she is on vacation
and let's avoid duplication of reviews from the maintainers and merge
my series. To acknowledge Vicki's anteriority, I added her S-o-b to
the patch.

v2, suggested by Guenter Roeck and Brian Woods:
 - rename from 71h to 70h

Signed-off-by: Vicki Pfau <vi@endrift.com>
Signed-off-by: Marcel Bocu <marcel.p.bocu@gmail.com>
Tested-by: Marcel Bocu <marcel.p.bocu@gmail.com>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Brian Woods <brian.woods@amd.com>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>	# pci_ids.h

Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: x86@kernel.org
Cc: "Woods, Brian" <Brian.Woods@amd.com>
Cc: Clemens Ladisch <clemens@ladisch.de>
Cc: Jean Delvare <jdelvare@suse.com>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: linux-hwmon@vger.kernel.org
Link: https://lore.kernel.org/r/20190722174510.2179-1-marcel.p.bocu@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-09-03 12:47:17 -07:00
Mauro Carvalho Chehab 899df7b41c docs: hwmon: pxe1610: convert to ReST format and add to the index
This document was recently introduced. Convert it to ReST
just like the other hwmon documents, adding it to the hwmon index.

Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Link: https://lore.kernel.org/r/657bf022625e0888d3becf10c78d162eeb864608.1563792334.git.mchehab+samsung@kernel.org
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-09-03 12:47:17 -07:00
Robert Karszniewicz 3b07a702cc hwmon: (k8temp) update to use new hwmon registration API
Removes:
- hwmon_dev from k8temp_data struct, as that is now passed
  to callbacks, anyway.
- other k8temp_data struct fields, too.
- k8temp_update_device()

Also reduces binary size:
   text    data     bss     dec     hex filename
   4139    1448       0    5587    15d3 drivers/hwmon/k8temp.ko.bak
   3103    1220       0    4323    10e3 drivers/hwmon/k8temp.ko

Signed-off-by: Robert Karszniewicz <avoidr@firemail.cc>
Signed-off-by: Robert Karszniewicz <avoidr@riseup.net>
Link: https://lore.kernel.org/r/20190721120051.28064-1-avoidr@riseup.net
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-09-03 12:47:17 -07:00
Christophe JAILLET 59eedefbba hwmon: (pmbus/max31785) Remove a useless #define
There is a typo in MAX37185_NUM_FAN_PAGES. To be consistent, it should be
MAX31785_NUM_FAN_PAGES (1 and 7 switched).

At line 24, we already have:
   #define MAX31785_NR_FAN_PAGES		6
and MAX37185_NUM_FAN_PAGES seems to be unused.

It is likely that it is only a typo and/or a left-over.
So, axe it.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/20190721101553.20911-1-christophe.jaillet@wanadoo.fr
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-09-03 12:47:17 -07:00
Daniel Mack 557c7ffa2f hwmon: (lm75) add support for PCT2075
The NXP PCT2075 is largely compatible with other chips already supported
by the LM75 driver. It uses an 11-bit resolution and defaults to 100 ms
sampling period. The datasheet is here:

  https://www.nxp.com/docs/en/data-sheet/PCT2075.pdf

Signed-off-by: Daniel Mack <daniel@zonque.org>
Link: https://lore.kernel.org/r/20190711124504.7580-2-daniel@zonque.org
[groeck: Documentation update]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-09-03 12:47:17 -07:00
Daniel Mack 5ac6badc5a device-tree: bindinds: add NXP PCT2075 as compatible device to LM75
The PCT2075 is compatible to other chips that are already handled by
the LM75 driver.

Signed-off-by: Daniel Mack <daniel@zonque.org>
Link: https://lore.kernel.org/r/20190711124504.7580-1-daniel@zonque.org
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-09-03 12:47:17 -07:00
Guenter Roeck 2c9d5b5e32 hwmon: Remove ads1015 driver
A driver for ADS1015 with more functionality is available in the iio
subsystem.

Remove the hwmon driver as duplicate. If the chip is used for hardware
monitoring, the iio->hwmon bridge should be used.

Cc: Dirk Eibach <eibach@gdsys.de>
Link: https://lore.kernel.org/r/1562004758-13025-1-git-send-email-linux@roeck-us.net
Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-09-03 12:47:17 -07:00
Wenwen Wang e027a2dea5 hwmon (coretemp) Fix a memory leak bug
In coretemp_init(), 'zone_devices' is allocated through kcalloc().
However, it is not deallocated in the following execution if
platform_driver_register() fails, leading to a memory leak. To fix this
issue, introduce the 'outzone' label to free 'zone_devices' before
returning the error.

Signed-off-by: Wenwen Wang <wenwen@cs.uga.edu>
Link: https://lore.kernel.org/r/1566248402-6538-1-git-send-email-wenwen@cs.uga.edu
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-08-31 08:04:57 -07:00
Guenter Roeck 7d82fcc9d9 hwmon: (lm75) Fix write operations for negative temperatures
Writes into limit registers fail if the temperature written is negative.
The regmap write operation checks the value range, regmap_write accepts
an unsigned int as parameter, and the temperature value passed to
regmap_write is kept in a variable declared as long. Negative values
are converted large unsigned integers, which fails the range check.
Fix by type casting the temperature to u16 when calling regmap_write().

Cc: Iker Perez del Palomar Sustatxa <iker.perez@codethink.co.uk>
Fixes: e65365fed8 ("hwmon: (lm75) Convert to use regmap")
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-08-31 08:04:57 -07:00
Bartosz Golaszewski 6f8c8f3c31 hwmon: pmbus: ucd9000: remove unneeded include
Build bot reports the following build issue after commit 9091373ab7
("gpio: remove less important #ifdef around declarations):

   In file included from drivers/hwmon/pmbus/ucd9000.c:19:0:
>> include/linux/gpio/driver.h:576:1: error: redefinition of 'gpiochip_add_pin_range'
    gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name,
    ^~~~~~~~~~~~~~~~~~~~~~
   In file included from drivers/hwmon/pmbus/ucd9000.c:18:0:
   include/linux/gpio.h:245:1: note: previous definition of 'gpiochip_add_pin_range' was here
    gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name,
    ^~~~~~~~~~~~~~~~~~~~~~
   In file included from drivers/hwmon/pmbus/ucd9000.c:19:0:
>> include/linux/gpio/driver.h:583:1: error: redefinition of 'gpiochip_add_pingroup_range'
    gpiochip_add_pingroup_range(struct gpio_chip *chip,
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   In file included from drivers/hwmon/pmbus/ucd9000.c:18:0:
   include/linux/gpio.h:254:1: note: previous definition of 'gpiochip_add_pingroup_range' was here
    gpiochip_add_pingroup_range(struct gpio_chip *chip,
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   In file included from drivers/hwmon/pmbus/ucd9000.c:19:0:
>> include/linux/gpio/driver.h:591:1: error: redefinition of 'gpiochip_remove_pin_ranges'
    gpiochip_remove_pin_ranges(struct gpio_chip *chip)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~
   In file included from drivers/hwmon/pmbus/ucd9000.c:18:0:
   include/linux/gpio.h:263:1: note: previous definition of 'gpiochip_remove_pin_ranges' was here
    gpiochip_remove_pin_ranges(struct gpio_chip *chip)

This is caused by conflicting defines from linux/gpio.h and
linux/gpio/driver.h. Drivers should not include both the legacy and
the new API headers. This driver doesn't even use linux/gpio.h so
remove it.

Reported-by: kbuild test robot <lkp@intel.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Link: https://lore.kernel.org/r/20190808080144.6183-1-brgl@bgdev.pl
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-08-31 08:04:57 -07:00
Linus Torvalds a55aa89aab Linux 5.3-rc6 2019-08-25 12:01:23 -07:00
Linus Torvalds c749088f25 A minor auxdisplay improvement:
- ht16k33: Make ht16k33_fb_fix and ht16k33_fb_var constant (Nishka Dasgupta)
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEPjU5OPd5QIZ9jqqOGXyLc2htIW0FAl1ixpEACgkQGXyLc2ht
 IW3Alg//f7+tOooILnDsxByF6T3bD5ObZFuMAW01jnHER8q93sBAuddY28OjiSrI
 MZrwZLbz43Ek9zF+Q2A8RIVYD79vFUZbD33ZbQHJ1CJmD/urapVE13rmQMo+EsiB
 PsCgIKjRByj/WfUexRdJTZ7gbKb+l6l/gvLO9tqLbb0rD/CMEny7rLEzmC5uLwYE
 koM6A74AhXBEQMYR2Vn7HpLF9U3vzo7O0QuDLUlvaSv5TJgpdpZuLDJHXbBOcnRU
 qrD7ruPOXxwo6b218TaIeCP6IDIEOdHz/4XxcZ0rFjiTxF0nLx4OjDHlCYfsxlEw
 6kujamc8kJmdUwHk3xQM2kxUlR/mMSmvpW5bRdUEBk2+Cqe4S5c2OFSxYoHMBiI/
 SpmUJbkLgzQSo33k0rNKiZL49arlrsNN94EV9+QHSHbmTq/HlPWuPleUUfA0Ep46
 mN7wbQkE1FAniwoOu3Tx4T1Kw+L2gTqAmqxNCFf6HoihnkFjf/RAYEGPLBP9mKAN
 o2W9icMSREeM9pKy4NYr0Fcq7eD1vcYGkSY1gpFfNDDEt7TTH7M3L85ty0ky+JvU
 jHRayXNRg/SGtx3CBhDw3iiq4Dj5t2YJ0NTNF2XyzHTkass4dGfE8duHoDDnaFP5
 GphEAjf3kV+f+j9f7Kj8Y5cCeCMxctWp3bv6eZGK+LMiPUzPqC0=
 =qxac
 -----END PGP SIGNATURE-----

Merge tag 'auxdisplay-for-linus-v5.3-rc7' of git://github.com/ojeda/linux

Pull auxdisplay cleanup from Miguel Ojeda:
 "Make ht16k33_fb_fix and ht16k33_fb_var constant (Nishka Dasgupta)"

* tag 'auxdisplay-for-linus-v5.3-rc7' of git://github.com/ojeda/linux:
  auxdisplay: ht16k33: Make ht16k33_fb_fix and ht16k33_fb_var constant
2019-08-25 11:43:17 -07:00
Linus Torvalds 32ae83ffec This pull request contains a single bug fix for UML:
- Fix time travel mode
 -----BEGIN PGP SIGNATURE-----
 
 iQJKBAABCAA0FiEEdgfidid8lnn52cLTZvlZhesYu8EFAl1ikVwWHHJpY2hhcmRA
 c2lnbWEtc3Rhci5hdAAKCRBm+VmF6xi7waNYEADaqyJu+2UAp2hZGkwric9dqh4l
 IibXY0bPKokDIAt/gGmh5CX8cqBWKjWJSny91mqrINm1SBv4iTm0GLrSq7ZmQmYH
 1JRZSk3QtxRfVMVKizp2L/K22lPSMIViYoAsTGYTbRAmNyjBGJNSZrgCs3BBi/1F
 mxINtpyg2MyWOg9aNIzil6ZfwcPEazt9US6XM/2Tcs3z9wDO5bfRIgD3ILoWcT7D
 RPwLbtMi242Uak+Eyi44QCfwB5UjC1UvDdKjgr3paHiTVm7LS0dCEnBhaDhtGeb8
 bqEnSVH9oHA0XQhUAYdFNMQN0n1+bEDbqnbz9JLg4iJt6jXpvY8oL9xi7k/FglSu
 zXlhRRE4G7AYpBoCvQp/Anh85aCAcsZ9nP4aSN8GXLi7IqyaZ7KRTBHrAFxYi/WP
 dXVaqR984w5bEBDLRUsGosKHlHXHMnAwPDthQhuRrCqqmE/YyzpOaCsG46Wzpriy
 Jg302QmlTOMfx0uUoCVsiEq6rwar6LGTP7raihaR8j9g0EzFr7f4FpzmWxQpvJqG
 YpE3jVwp3OOKJjOETIW6ko2lzai3GOP9rPqoPfOhtqeALHLtORlg7XAhBj7n3Tji
 rLHKmVIxiiAmkfQItMdRjJbu9gFAiW+ZR7nEnDnhMjer1iPkJX+DtCLEZFpui7Me
 WrrQx4ypeO4RFemQCQ==
 =bDrL
 -----END PGP SIGNATURE-----

Merge tag 'for-linus-5.3-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml

Pull UML fix from Richard Weinberger:
 "Fix time travel mode"

* tag 'for-linus-5.3-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml:
  um: fix time travel mode
2019-08-25 11:40:24 -07:00
Linus Torvalds 94a76d9b52 This pull request contains the following fixes for UBIFS and JFFS2:
UBIFS:
 
 - Don't block too long in writeback_inodes_sb()
 - Fix for a possible overrun of the log head
 - Fix double unlock in orphan_delete()
 
 JFFS2:
 
 - Remove C++ style from UAPI header and unbreak picky toolchains
 -----BEGIN PGP SIGNATURE-----
 
 iQJKBAABCAA0FiEEdgfidid8lnn52cLTZvlZhesYu8EFAl1ik14WHHJpY2hhcmRA
 c2lnbWEtc3Rhci5hdAAKCRBm+VmF6xi7wbP2D/4xVW7YP5Yyt6YrABJuclfoib30
 2LI6eOz0+5OojQKUbOzXCN9N7Dv4TLJKrCjRc9qKYTIB1DiQXuBDqtYKg6CTBhHb
 MjiftEDiBQ6j3jVmRxkQRXZEB9I3Uu9CkA8s65+UmL8peJfgNElpH34omsU1fzup
 y0NhZhj77P5jsAG6r7yXvuaofCOTlZIZVPya9FX17J0Ra+3rMOCtVEqnaHk2E5RB
 EQPAEByqXUIx7+9mOi1Krw7B7fesB7oOVbCykE5knX1pZQCTURP64yNr35WxN+7Z
 crcpdEQtf54qWMCKf4ClIBHiPmmsDIHYJy3JXjgJKOwIYvrB3dZ5E170qPr3JixY
 nS+l8x69IYZhWUzHg8gxDizk92iFYKbO1h5vBwI7NUFHkHLzylsgonBK0KdaUnol
 OvI5oCO/rdJEMBPr5LEFpOjZJIEptPtXpDvQCpm5tWd5tuW+8edNpI38lDO9LThC
 O0diZZUQfsuzD1XrvKRORPU+4lskzGV5b1UA0DWXdGKALqM5VrQZo1XftvA74Zkv
 oZQcHNK5wdecQX81Oadfb/0a5SN7FGGtTUCKTpOyBIu0adarGIasC6TQr2aDiiNh
 7jLjBoV2XEGhXZQrK2lm8G+6rJ7Mp11B6aoTFgDELzt+SB7htp6dARR2+4aGWXh9
 iXgme0n9HXDDeuosag==
 =Bsgx
 -----END PGP SIGNATURE-----

Merge tag 'for-linus-5.3-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/ubifs

Pull UBIFS and JFFS2 fixes from Richard Weinberger:
 "UBIFS:
   - Don't block too long in writeback_inodes_sb()
   - Fix for a possible overrun of the log head
   - Fix double unlock in orphan_delete()

  JFFS2:
   - Remove C++ style from UAPI header and unbreak picky toolchains"

* tag 'for-linus-5.3-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/ubifs:
  ubifs: Limit the number of pages in shrink_liability
  ubifs: Correctly initialize c->min_log_bytes
  ubifs: Fix double unlock around orphan_delete()
  jffs2: Remove C++ style comments from uapi header
2019-08-25 11:29:27 -07:00
Linus Torvalds 146c3d3220 Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 fixes from Thomas Gleixner:
 "A few fixes for x86:

   - Fix a boot regression caused by the recent bootparam sanitizing
     change, which escaped the attention of all people who reviewed that
     code.

   - Address a boot problem on machines with broken E820 tables caused
     by an underflow which ended up placing the trampoline start at
     physical address 0.

   - Handle machines which do not advertise a legacy timer of any form,
     but need calibration of the local APIC timer gracefully by making
     the calibration routine independent from the tick interrupt. Marked
     for stable as well as there seems to be quite some new laptops
     rolled out which expose this.

   - Clear the RDRAND CPUID bit on AMD family 15h and 16h CPUs which are
     affected by broken firmware which does not initialize RDRAND
     correctly after resume. Add a command line parameter to override
     this for machine which either do not use suspend/resume or have a
     fixed BIOS. Unfortunately there is no way to detect this on boot,
     so the only safe decision is to turn it off by default.

   - Prevent RFLAGS from being clobbers in CALL_NOSPEC on 32bit which
     caused fast KVM instruction emulation to break.

   - Explain the Intel CPU model naming convention so that the repeating
     discussions come to an end"

* 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/retpoline: Don't clobber RFLAGS during CALL_NOSPEC on i386
  x86/boot: Fix boot regression caused by bootparam sanitizing
  x86/CPU/AMD: Clear RDRAND CPUID bit on AMD family 15h/16h
  x86/boot/compressed/64: Fix boot on machines with broken E820 table
  x86/apic: Handle missing global clockevent gracefully
  x86/cpu: Explain Intel model naming convention
2019-08-25 10:10:15 -07:00