- 04 Oct, 2020 2 commits
-
-
Naveen Krishna Chatradhi authored
Update the documentation with the newly added features * Set the accumulation interval based on resolution Signed-off-by: Naveen Krishna Chatradhi <nchatrad@amd.com> Link: https://lore.kernel.org/r/20200929105322.8919-5-nchatrad@amd.comSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
Naveen Krishna Chatradhi authored
Factor out the common code in the accumulation functions for core and socket accumulation. While at it, handle the return value of the amd_create_sensor() function. Signed-off-by: Naveen Krishna Chatradhi <nchatrad@amd.com> Link: https://lore.kernel.org/r/20200929105322.8919-4-nchatrad@amd.comSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
- 30 Sep, 2020 2 commits
-
-
Naveen Krishna Chatradhi authored
On a system with course grain resolution of energy unit (milli J) the accumulation thread can be executed less frequently than on the system with fine grain resolution(micro J). This patch sets the accumulation thread interval to an optimum value calculated based on the (energy unit) resolution supported by the hardware (assuming a peak wattage of 240W). Signed-off-by: Naveen Krishna Chatradhi <nchatrad@amd.com> Link: https://lore.kernel.org/r/20200929105322.8919-3-nchatrad@amd.comSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
Akshay Gupta authored
At present, core & socket labels are defined in struct sensor_accumulator This patch moves it to the amd_energy_data structure, which will help in calling memset on struct sensor_accumulator to optimize the code. Signed-off-by: Akshay Gupta <Akshay.Gupta@amd.com> Link: https://lore.kernel.org/r/20200929105322.8919-2-nchatrad@amd.comSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
- 24 Sep, 2020 3 commits
-
-
Chris Packham authored
Convert the adm9240 driver to using regmap and add error handling. Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz> Link: https://lore.kernel.org/r/20200924085102.15219-4-chris.packham@alliedtelesis.co.nz [groeck: Fixed context conflict against 'hwmon: use simple i2c probe function'] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
-
Chris Packham authored
Split the body of adm9240_update_device() into two helper functions adm9240_update_measure() and adm9240_update_config(). Although neither of the new helpers returns an error yet lay the groundwork for propagating failures through to the sysfs readers. Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz> Link: https://lore.kernel.org/r/20200924085102.15219-3-chris.packham@alliedtelesis.co.nzSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
Chris Packham authored
Use loops for reading temp_max and initialising FAN_MIN/TEMP_MAX rather than duplicating code. Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz> Link: https://lore.kernel.org/r/20200924085102.15219-2-chris.packham@alliedtelesis.co.nzSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
- 23 Sep, 2020 33 commits
-
-
Wei Huang authored
Zen3 thermal info is supported via a new PCI device ID. Also the voltage telemetry registers and the current factors need to be defined. k10temp driver then searches for CPU family 0x19 and configures k10temp_data accordingly. Signed-off-by: Wei Huang <wei.huang2@amd.com> Link: https://lore.kernel.org/r/20200914200715.1997757-1-wei.huang2@amd.comSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
Guenter Roeck authored
0-day rightfully complains about a sometimes uninitialized variable in pmbus_get_boolean(). drivers/hwmon/pmbus/pmbus_core.c:903:13: warning: variable 'ret' is used uninitialized whenever 'if' condition is true } else if (!s1 || !s2) { While that is technically true, it won't be hit in the field since the condition indicates a programming error. Move the check of that condition into the code generating the attribute entry, and refuse generating the attribute if the condition is true. Swap the condition check in pmbus_get_boolean() to ensure that static analyzers don't get a hiccup (because we check if s1 and s2 are NULL, static analyzers may believe that they can be NULL independently of each other). Reported-by: kernel test robot <lkp@intel.com> Cc: Alex Qiu <xqiu@google.com> Reviewed-by: Alex Qiu <xqiu@google.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
-
Andrew Jeffery authored
Enable runtime debug control of whether the PEC byte is exchanged with the PMBus device. Some manufacturers have asked for the PEC to be disabled as part of debugging driver communication issues with devices. Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Link: https://lore.kernel.org/r/20200910021106.2958382-1-andrew@aj.id.au [groeck: Replace %1llu with %llu] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
-
Guenter Roeck authored
Caching register values can be very expensive for PMBus chips. Some modern chips may have 10 or more pages, with several sensors supported per page. For example, MAX16601 creates more than 90 sysfs attributes. Register caching for such chips is time consuming, especially if only a few attributes are read on a regular basis. For MAX16601, it was observed that it can take up to two seconds to read all attributes on a slow I2C bus. In this situation, register caching results in the opposite of its intention: It increases the number of I2C operations, in some cases substantially, and it results in large latency when trying to access individual sensor data. Drop all register caching to solve the problem. Since it is no longer necessary, drop status register mapping as part of the change, and specify status registers directly. Cc: Alex Qiu <xqiu@google.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Reviewed-by: Alex Qiu <xqiu@google.com> Tested-by: Alex Qiu <xqiu@google.com> Link: https://lore.kernel.org/r/20200904163314.259087-1-linux@roeck-us.netSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
Guenter Roeck authored
The debugfs code was intended to aid figuring out functionality of undocumented registers. Turns out that wasn't very helpful, since register locations change too much between AMD chip revisions, and the data isn't really valuable for chips where it isn't already supported. On top of that, its existence has been used as argument for providing pseudo-API debugfs functions in other drivers. So let's just take it out. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
-
Tim Harvey authored
Add a fan sensor to report RPM's from a fan tach input. Signed-off-by: Tim Harvey <tharvey@gateworks.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
-
Wei Huang authored
The voltage telemetry registers for Zen2 are different from Zen1. Also the factors of CPU current values are changed on Zen2. Add new definitions for these register. Signed-off-by: Wei Huang <wei.huang2@amd.com> Link: https://lore.kernel.org/r/20200827054242.2347-2-wei.huang2@amd.comSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
Wei Huang authored
Many SMN thermal registers in Zen CPU families are common across different generations. For long-term code maintenance, it is better to rename these macro and function names to Zen. Signed-off-by: Wei Huang <wei.huang2@amd.com> Link: https://lore.kernel.org/r/20200827054242.2347-1-wei.huang2@amd.comSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
Joe Perches authored
Use semicolons and braces. Signed-off-by: Joe Perches <joe@perches.com> Link: https://lore.kernel.org/r/5e1ca60df261e3bfd0e6510e388581a1d1f52c77.1598331149.git.joe@perches.comSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
Alexandru Tachici authored
Add bindings for the Analog Devices ADM1266 sequencer. Signed-off-by: Alexandru Tachici <alexandru.tachici@analog.com> Reviewed-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20200812142055.9213-7-alexandru.tachici@analog.comSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
Alexandru Tachici authored
Use the nvmem kernel api to expose the black box chip functionality to userspace. Using this feature, the device is capable of recording to nonvolatile flash memory the vital data about the system status that caused the system to perform a black box write. A blackbox is 64 bytes of data containing all the status registers, last two states of the sequencer, timestamp and counters. The mapping of this data is described in the adm1266 datasheet. On power-up the driver sets the unix time to the adm1266 using the SET_RTC command. This value is incremented by an internal clock and it is used as timestamp for the black box feature. Signed-off-by: Alexandru Tachici <alexandru.tachici@analog.com> Link: https://lore.kernel.org/r/20200812142055.9213-6-alexandru.tachici@analog.comSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
Alexandru Tachici authored
Add a debugfs entry which prints the current state of the adm1266 sequencer. Signed-off-by: Alexandru Tachici <alexandru.tachici@analog.com> Link: https://lore.kernel.org/r/20200812142055.9213-5-alexandru.tachici@analog.comSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
Alexandru Tachici authored
Adm1266 exposes 9 GPIOs and 16 PDIOs which are currently read-only. They are controlled by the internal sequencing engine. This patch makes adm1266 driver expose GPIOs and PDIOs to user-space using GPIO provider kernel api. Signed-off-by: Alexandru Tachici <alexandru.tachici@analog.com> Link: https://lore.kernel.org/r/20200812142055.9213-4-alexandru.tachici@analog.comSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
Alexandru Tachici authored
PmBus devices support Block Write-Block Read Process Call described in SMBus specification v 2.0 with the exception that Block writes and reads are permitted to have up 255 data bytes instead of max 32 bytes (SMBus). This patch adds Block WR process call support for ADM1266. Signed-off-by: Alexandru Tachici <alexandru.tachici@analog.com> Link: https://lore.kernel.org/r/20200812142055.9213-3-alexandru.tachici@analog.comSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
Alexandru Tachici authored
Add pmbus probing driver for the adm1266 Cascadable Super Sequencer with Margin Control and Fault Recording. Driver is using the pmbus_core, creating sysfs files under hwmon for inputs: vh1->vh4 and vp1->vp13. Signed-off-by: Alexandru Tachici <alexandru.tachici@analog.com> Link: https://lore.kernel.org/r/20200812142055.9213-2-alexandru.tachici@analog.com [groeck: Use .probe_new function, adjust for changed pmbus_do_probe API] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
-
Chris Ruehl authored
Add documentation for the newly added DTS support in the shtc1 driver. To align with the drivers logic to have high precision by default a boolean sensirion,low-precision is used to switch to low precision. Signed-off-by: Chris Ruehl <chris.ruehl@gtsys.com.hk> Reviewed-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20200815012227.32538-3-chris.ruehl@gtsys.com.hkSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
Chris Ruehl authored
Add support for DTS bindings for the sensirion shtc1,shtw1 and shtc3. Signed-off-by: Chris Ruehl <chris.ruehl@gtsys.com.hk> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20200815012227.32538-2-chris.ruehl@gtsys.com.hk [groeck: Resolved conflicts] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
-
Anson Huang authored
dev_err_probe() can reduce code size, uniform error handling and record the defer probe reason etc., use it to simplify the code. Signed-off-by: Anson Huang <Anson.Huang@nxp.com> Link: https://lore.kernel.org/r/1597649673-22329-1-git-send-email-Anson.Huang@nxp.comSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
Stephen Kitt authored
As part of the ongoing i2c transition to the simple probe ("probe_new"), this patch uses i2c_match_id to retrieve the driver_data for the probed device. The id parameter is thus no longer necessary and the simple probe can be used instead. Signed-off-by: Stephen Kitt <steve@sk2.org> Link: https://lore.kernel.org/r/20200821160035.590142-1-steve@sk2.orgSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
Stephen Kitt authored
As part of the ongoing i2c transition to the simple probe ("probe_new"), this patch uses i2c_match_id to retrieve the driver_data for the probed device. The id parameter is thus no longer necessary and the simple probe can be used instead. Signed-off-by: Stephen Kitt <steve@sk2.org> Link: https://lore.kernel.org/r/20200821160159.591293-1-steve@sk2.orgSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
Stephen Kitt authored
As part of the ongoing i2c transition to the simple probe ("probe_new"), this patch uses i2c_match_id to retrieve the driver_data for the probed device. The id parameter is thus no longer necessary and the simple probe can be used instead. Signed-off-by: Stephen Kitt <steve@sk2.org> Link: https://lore.kernel.org/r/20200821160231.592571-1-steve@sk2.orgSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
Stephen Kitt authored
Many hwmon drivers don't use the id information provided by the old i2c probe function, and the remainder can easily be adapted to the new form ("probe_new") by calling i2c_match_id explicitly. This avoids scanning the identifier tables during probes. Drivers which didn't use the id are converted as-is; drivers which did are modified to call i2c_match_id() with the same level of error-handling (if any) as before. This patch wraps up the transition for hwmon, with four stragglers not included in the previous large patch. Signed-off-by: Stephen Kitt <steve@sk2.org> Link: https://lore.kernel.org/r/20200821160354.594715-1-steve@sk2.orgSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
Stephen Kitt authored
This driver doesn't use the id information provided by the old i2c probe function, so it can trivially be converted to the simple ("probe_new") form. Signed-off-by: Stephen Kitt <steve@sk2.org> Link: https://lore.kernel.org/r/20200813162851.1519546-1-steve@sk2.orgSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
Stephen Kitt authored
This driver doesn't use the id information provided by the old i2c probe function, so it can trivially be converted to the simple ("probe_new") form. Signed-off-by: Stephen Kitt <steve@sk2.org> Link: https://lore.kernel.org/r/20200813162704.1517951-1-steve@sk2.orgSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
Stephen Kitt authored
This driver doesn't use the id information provided by the old i2c probe function, so it can trivially be converted to the simple ("probe_new") form. Signed-off-by: Stephen Kitt <steve@sk2.org> Link: https://lore.kernel.org/r/20200813162544.1516647-1-steve@sk2.orgSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
Stephen Kitt authored
This driver doesn't use the id information provided by the old i2c probe function, so it can trivially be converted to the simple ("probe_new") form. Signed-off-by: Stephen Kitt <steve@sk2.org> Link: https://lore.kernel.org/r/20200813162300.1514695-1-steve@sk2.orgSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
Stephen Kitt authored
This driver doesn't use the id information provided by the old i2c probe function, so it can trivially be converted to the simple ("probe_new") form. Signed-off-by: Stephen Kitt <steve@sk2.org> Link: https://lore.kernel.org/r/20200813162026.1512242-1-steve@sk2.orgSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
Stephen Kitt authored
This driver doesn't use the id information provided by the old i2c probe function, so it can trivially be converted to the simple ("probe_new") form. Signed-off-by: Stephen Kitt <steve@sk2.org> Link: https://lore.kernel.org/r/20200813161845.1511261-1-steve@sk2.orgSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
Stephen Kitt authored
This driver doesn't use the id information provided by the old i2c probe function, so it can trivially be converted to the simple ("probe_new") form. Signed-off-by: Stephen Kitt <steve@sk2.org> Acked-by: Corentin LABBE <clabbe.montjoie@gmail.com> Tested-by: Corentin Labbe <clabbe.montjoie@gmail.com> Link: https://lore.kernel.org/r/20200813161129.1507599-1-steve@sk2.orgSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
Stephen Kitt authored
This driver doesn't use the id information provided by the old i2c probe function, so it can trivially be converted to the simple ("probe_new") form. Signed-off-by: Stephen Kitt <steve@sk2.org> Link: https://lore.kernel.org/r/20200813160958.1506536-1-steve@sk2.orgSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
Stephen Kitt authored
Many hwmon drivers don't use the id information provided by the old i2c probe function, and the remainder can easily be adapted to the new form ("probe_new") by calling i2c_match_id explicitly. This avoids scanning the identifier tables during probes. Drivers which didn't use the id are converted as-is; drivers which did are modified as follows: * if the information in i2c_client is sufficient, that's used instead (client->name); * anything else is handled by calling i2c_match_id() with the same level of error-handling (if any) as before. A few drivers aren't included in this patch because they have a different set of maintainers. They will be covered by other patches. Signed-off-by: Stephen Kitt <steve@sk2.org> Link: https://lore.kernel.org/r/20200813160222.1503401-1-steve@sk2.orgSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
Stephen Kitt authored
pmbus_do_probe doesn't use the id information provided in its second argument, so this can be removed, which then allows using the single-parameter i2c probe function ("probe_new") for probes. This avoids scanning the identifier tables during probes. Drivers which didn't use the id are converted as-is; drivers which did are modified as follows: * if the information in i2c_client is sufficient, that's used instead (client->name); * configured v. probed comparisons are performed by comparing the configured name to the detected name, instead of the ids; this involves strcmp but is still cheaper than comparing all the device names when scanning the tables; * anything else is handled by calling i2c_match_id() with the same level of error-handling (if any) as before. Additionally, the mismatch message in the ltc2978 driver is adjusted so that it no longer assumes that the driver_data is an index into ltc2978_id. Signed-off-by: Stephen Kitt <steve@sk2.org> Acked-by: Wolfram Sang <wsa@kernel.org> Link: https://lore.kernel.org/r/20200808210004.30880-1-steve@sk2.orgSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
Guenter Roeck authored
On some drives, reading the drive temperature resets the drive's spin-down timer. If the drive temperature is read too often, affected drives will never spin down. Add this information as usage note to the driver documentation. Reported-by: Peter Sulyok <peter@sulyok.net> Cc: Peter Sulyok <peter@sulyok.net> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
-