- 10 3月, 2015 3 次提交
-
-
由 Guenter 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: NJean Delvare <jdelvare@suse.de> Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
-
由 Rasmus Villemoes 提交于
The only difference between the three power_sensor_name_templates is whether there is a suffix of "", "_lowest" or "_highest". We might as well pull those into an array and use a literal format string, allowing gcc to do type checking of the arguments to sprintf. Incidentially, the same three suffixes are used in the temp_sensor_name_templates case, so we end up eliminating one static array. Signed-off-by: NRasmus Villemoes <linux@rasmusvillemoes.dk> [Guenter Roeck: Fixed line length over 80 characters] Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
-
由 Rasmus Villemoes 提交于
By extracting the only part that differs we can allow static checking of the format string, and possibly save a little .rodata. Signed-off-by: NRasmus Villemoes <linux@rasmusvillemoes.dk> [Guenter Roeck: continuation line alignment] Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
-
- 23 2月, 2015 1 次提交
-
-
由 Axel Lin 提交于
devm_regmap_init_i2c() can fail, thus add return value checking. Signed-off-by: NAxel Lin <axel.lin@ingics.com> Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
-
- 04 2月, 2015 1 次提交
-
-
由 Grygorii Strashko 提交于
Setting a dev_pm_ops suspend/resume pair but not a set of hibernation functions means those pm functions will not be called upon hibernation. Fix this by using SIMPLE_DEV_PM_OPS, which appropriately assigns the suspend and hibernation handlers and move mp102_suspend/tmp102_resume under CONFIG_PM_SLEEP to avoid build warnings. Signed-off-by: NGrygorii Strashko <Grygorii.Strashko@linaro.org> [groeck: Declare tmp102_dev_pm_ops as static variable] Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
-
- 03 2月, 2015 2 次提交
-
-
由 Guenter Roeck 提交于
The variables diff_input, ext_vref, and vref_mv are only used in the probe function and therefore don't need to be kept in the device data structure. Reviewed-and-Tested-by: NRobert Rosengren <robert.rosengren@axis.com> Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
-
由 Guenter Roeck 提交于
Simplify code and reduce code size by using regmap to access i2c registers. Reviewed-and-Tested-by: NRobert Rosengren <robert.rosengren@axis.com> Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
-
- 26 1月, 2015 16 次提交
-
-
由 Jean Delvare 提交于
The driver supports negative high and critical limits, it can return negative hysteresis values, so there is no good reason to not let the user write negative hysteresis values. Signed-off-by: NJean Delvare <jdelvare@suse.de> Cc: Guenter Roeck <linux@roeck-us.net> Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
-
由 Rasmus Villemoes 提交于
data->temp[index] has type s16. Because of C's promotion rules, (data->temp[index] << 7) >> 7 is exactly the same as data->temp[index]. The intention was to use bit 8 as a sign bit, so do that using the existing API. Signed-off-by: NRasmus Villemoes <linux@rasmusvillemoes.dk> Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
-
由 Rasmus Villemoes 提交于
The comment above (data << 2) >> 2 explains what the intention is: To use bit 13 of the 14-bit value data as the sign bit. However, this doesn't work due to C's promotion rules. data has type s16, but data << 2 has type int. To get sign extension, that expression would have to be cast back to an s16 before being shifted (at which point C's promotion rules would then kick in again and promote the left operand to int). As it stands, both expressions are no-ops for any value of data. Avoid these subtleties by using the existing API for this. sign_extend32 works equally well for 8 and 16 bit types. Signed-off-by: NRasmus Villemoes <linux@rasmusvillemoes.dk> Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
-
由 Asaf Vertz 提交于
Fixed the following warnings (reported by cppcheck): [drivers/hwmon/abx500.c:224]: (warning) %ld in format string (no. 1) requires 'long' but the argument type is 'unsigned long'. [drivers/hwmon/abx500.c:233]: (warning) %ld in format string (no. 1) requires 'long' but the argument type is 'unsigned long'. [drivers/hwmon/abx500.c:242]: (warning) %ld in format string (no. 1) requires 'long' but the argument type is 'unsigned long'. Signed-off-by: NAsaf Vertz <asaf.vertz@tandemg.com> Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
-
由 Guenter Roeck 提交于
Subtracting an unsigned long from a signed value causes an overflow with large values. Use clamp_val() to reduce the number range prior to subtracting it from the temperature limit. Signed-off-by: NGuenter Roeck <linux@roeck-us.net> Reviewed-by: NJean Delvare <jdelvare@suse.de>
-
由 Guenter Roeck 提交于
Mixed use of long and int caused an integer overflow when writing large limits. Signed-off-by: NGuenter Roeck <linux@roeck-us.net> Reviewed-by: NJean Delvare <jdelvare@suse.de>
-
由 Guenter Roeck 提交于
Despite the name, sign_extend32 works just fine for 16 bit variables, so it is safe to use. Cc: Martin Kepplinger <martink@posteo.de> Reviewed-by: NJean Delvare <jdelvare@suse.de> Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
-
由 Kevin Hilman 提交于
Add support for "ina231" as compatible string, and update Documentation and Kconfig accordingly. Tested with the Exynos5422-based odroid-xu3 board which has on-board INA231 sensors. Signed-off-by: NKevin Hilman <khilman@linaro.org> Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
-
由 Bartosz Golaszewski 提交于
Use DIV_ROUND_CLOSEST() when dealing with the calibration values to make the calculations less error prone. Signed-off-by: NBartosz Golaszewski <bgolaszewski@baylibre.com> Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
-
由 Bartosz Golaszewski 提交于
Signed-off-by: NBartosz Golaszewski <bgolaszewski@baylibre.com> Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
-
由 Bartosz Golaszewski 提交于
This attribute allows to configure the update interval of ina226. Although the bus and shunt voltage conversion times remain hardcoded to 1.1 ms, we can now modify said interval by changing the averaging rate. While we're at it - add an additional variable to ina2xx_data, which holds the current configuration settings - this way we'll be able to restore the configuration in case of an unexpected chip reset. Signed-off-by: NBartosz Golaszewski <bgolaszewski@baylibre.com> Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
-
由 Bartosz Golaszewski 提交于
The shunt resistance can only be set via platform_data or device tree. This isn't suitable for devices in which the shunt resistance can change/isn't known at boot-time. Add a sysfs attribute that allows to read and set the shunt resistance. Signed-off-by: NBartosz Golaszewski <bgolaszewski@baylibre.com> Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
-
由 Bartosz Golaszewski 提交于
Shunt resistance values greater than the chip's calibration factor make no sense since the actual value written to the register equals: <calibration factor> / <shunt> Bail-out from ina2xx_probe() if the configured value is greater than the calibration factor. Signed-off-by: NBartosz Golaszewski <bgolaszewski@baylibre.com> Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
-
由 Bartosz Golaszewski 提交于
Signed-off-by: NBartosz Golaszewski <bgolaszewski@baylibre.com> Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
-
由 Bartosz Golaszewski 提交于
Chips from the ina family don't like to be uninitialized. In case the power is cut-off and restored again the calibration register will be reset to 0 and both the power and current registers will remain at 0. Check the calibration register in ina2xx_update_device() and reinitialize the chip if needed. Signed-off-by: NBartosz Golaszewski <bgolaszewski@baylibre.com> Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
-
由 Krzysztof Kozlowski 提交于
The regmap_config struct may be const because it is not modified by the driver and regmap_init() accepts pointer to const. Signed-off-by: NKrzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
-
- 24 1月, 2015 5 次提交
-
-
由 Axel Lin 提交于
Use ATTRIBUTE_GROUPS macro to simplify the code a bit. Signed-off-by: NAxel Lin <axel.lin@ingics.com> Signed-off-by: NJean Delvare <jdelvare@suse.de>
-
由 Axel Lin 提交于
Use module_pci_driver to simplify the code a bit. Signed-off-by: NAxel Lin <axel.lin@ingics.com> Reviewed-by: NGuenter Roeck <linux@roeck-us.net> Signed-off-by: NJean Delvare <jdelvare@suse.de>
-
由 Jean Delvare 提交于
On many motherboards, for an unknown reason, the thermal sensor seems to be disabled and will return a constant temperature value of 36.5 degrees Celsius. Don't bind to the device in that case, so that we don't report this bogus value to userspace. Signed-off-by: NJean Delvare <jdelvare@suse.de> Cc: Romain Dolbeau <romain@dolbeau.org> Reviewed-by: NGuenter Roeck <linux@roeck-us.net>
-
由 Jean Delvare 提交于
Use devm_hwmon_device_register_with_groups() to simplify the code a bit. Signed-off-by: NJean Delvare <jdelvare@suse.de> Cc: Romain Dolbeau <romain@dolbeau.org> Reviewed-by: NGuenter Roeck <linux@roeck-us.net>
-
由 Jean Delvare 提交于
The Intel 5500, 5520 and X58 chipsets embed a digital thermal sensor. This new driver supports it. Note that on many boards the sensor seems to be disabled and reports the minimum value (36.5 degrees Celsius) all the time. Signed-off-by: NJean Delvare <jdelvare@suse.de> Tested-by: NRomain Dolbeau <romain@dolbeau.org> Reviewed-by: NGuenter Roeck <linux@roeck-us.net>
-
- 07 1月, 2015 1 次提交
-
-
由 Christoph Jaeger 提交于
Support for keyword 'boolean' will be dropped later on. No functional change. Reference: http://lkml.kernel.org/r/cover.1418003065.git.cj@linux.comSigned-off-by: NChristoph Jaeger <cj@linux.com> Signed-off-by: NMichal Marek <mmarek@suse.cz>
-
- 08 12月, 2014 1 次提交
-
-
由 Guenter Roeck 提交于
TMP435 supports a range of I2C addresses, not just 0x4c. Cc: Patrick Titiano <ptitiano@baylibre.com> Cc: Bartosz Golaszewski <bgolaszewski@baylibre.com> Reviewed-by: NJean Delvare <jdelvare@suse.de> Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
-
- 06 12月, 2014 1 次提交
-
-
由 Guenter Roeck 提交于
A chip returning 0x00 in all registers is erroneously detected as LM75. Check hysteresis and temperature limit registers and abort if both are 0 to reduce the likelyhood for this to happen. Reviewed-by: NRob Coulson <rob.coulson@gmail.com> Reviewed-by: NJean Delvare <jdelvare@suse.de> Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
-
- 05 12月, 2014 4 次提交
-
-
由 Nishanth Menon 提交于
Poweroff the fans when shutting down the system. Else, echo '1' > /sys/class/hwmon/hwmon0/fan1_target; poweroff leaves the fan running if the System power off does not drive the gpio expander which might control the fan power supply. Signed-off-by: NNishanth Menon <nm@ti.com> Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
-
由 Nishanth Menon 提交于
Certain I2C based GPIO expanders could be used in sleepable context, this results in: [ 115.890569] ------------[ cut here ]------------ [ 115.895422] WARNING: CPU: 0 PID: 1115 at drivers/gpio/gpiolib.c:1370 gpiod_set_raw_value+0x40/0x4c() [ 115.905024] Modules linked in: [ 115.908229] CPU: 0 PID: 1115 Comm: sh Tainted: G W 3.18.0-rc7-next-20141203-dirty #1 [ 115.917461] Hardware name: Generic DRA74X (Flattened Device Tree) [ 115.923876] [<c0015368>] (unwind_backtrace) from [<c00119f4>] (show_stack+0x10/0x14) [ 115.932013] [<c00119f4>] (show_stack) from [<c05b78e8>] (dump_stack+0x78/0x94) [ 115.939594] [<c05b78e8>] (dump_stack) from [<c003de28>] (warn_slowpath_common+0x7c/0xb4) [ 115.948094] [<c003de28>] (warn_slowpath_common) from [<c003de7c>] (warn_slowpath_null+0x1c/0x24) [ 115.957315] [<c003de7c>] (warn_slowpath_null) from [<c03461e8>] (gpiod_set_raw_value+0x40/0x4c) [ 115.966457] [<c03461e8>] (gpiod_set_raw_value) from [<c04866f4>] (set_fan_speed+0x4c/0x64) [ 115.975145] [<c04866f4>] (set_fan_speed) from [<c04868a8>] (set_rpm+0x98/0xac) [ 115.982742] [<c04868a8>] (set_rpm) from [<c039fb4c>] (dev_attr_store+0x18/0x24) [ 115.990426] [<c039fb4c>] (dev_attr_store) from [<c01b0a28>] (sysfs_kf_write+0x4c/0x50) [ 115.998742] [<c01b0a28>] (sysfs_kf_write) from [<c01afe1c>] (kernfs_fop_write+0xbc/0x19c) [ 116.007333] [<c01afe1c>] (kernfs_fop_write) from [<c0148cc4>] (vfs_write+0xb0/0x1a0) [ 116.015461] [<c0148cc4>] (vfs_write) from [<c0148fbc>] (SyS_write+0x44/0x84) [ 116.022881] [<c0148fbc>] (SyS_write) from [<c000e5c0>] (ret_fast_syscall+0x0/0x48) [ 116.030833] ---[ end trace 3a0b636123acab82 ]--- So, switch over to sleepable GPIO operations as there is no mandatory need for non-sleepable gpio operations in the fan driver. This allows the fan driver to be used with i2c based gpio expanders such as palmas_gpio. Signed-off-by: NNishanth Menon <nm@ti.com> Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
-
由 Bartosz Golaszewski 提交于
The return value of i2c_smbus_read_byte_data() is checked in tmp401_init_client(), but only a warning is printed and the device is registered anyway. This leads to devices being registered even if they cannot be physically detected. Bail out from probe in case of write errors and notify the user. Signed-off-by: NBartosz Golaszewski <bgolaszewski@baylibre.com> Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
-
由 Patrick Titiano 提交于
Signed-off-by: NPatrick Titiano <ptitiano@baylibre.com> [Bartosz Golaszewski: prepared for submission, code review fixes] Signed-off-by: NBartosz Golaszewski <bgolaszewski@baylibre.com> [Guenter Roeck: Merged two patches into one] Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
-
- 02 12月, 2014 2 次提交
-
-
由 Guenter Roeck 提交于
LM95233 is similar to LM95234, but it only supports two instead of four external temperature sensors. Reviewed-by: NJean Delvare <jdelvare@suse.de> Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
-
由 Guenter Roeck 提交于
LM95235 is register compatible to LM95245. Also update link to LM95245 data sheet, and drop the link to the datasheet from the driver source to simplify code maintenance. Reviewed-by: NJean Delvare <jdelvare@suse.de> Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
-
- 01 12月, 2014 3 次提交
-
-
由 Bartosz Golaszewski 提交于
The return value of i2c_smbus_write_word_swapped() isn't checked in ina2xx_probe(). This leads to devices being registered even if they cannot be physically detected (e.g. device is not powered-up at boot-time). Even after restoring power to such device, it is left unconfigured as the configuration has never been actually written to the register. Error out in case of write errors in probe and notify the user. Signed-off-by: NBartosz Golaszewski <bgolaszewski@baylibre.com> [Guenter Roeck: Fixed multi-line comment style] Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
-
由 Guenter Roeck 提交于
checkpatch complains about WARNING: Missing a blank line after declarations Add missing blank lines. Also reorder variables length-wise where appropriate if a function header is touched anyway. Reviewed-by: NJean Delvare <jdelvare@suse.de> Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
-
由 Guenter Roeck 提交于
NCT6792D is similar to NCT6791D. Only beep control and temperature monitoring registers are different. Reviewed-by: NJean Delvare <jdelvare@suse.de> Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
-