adt7475.c (5cf943ede4af95313665ea81f224533d2aa272bb) | adt7475.c (b36fb17159adad16a724f0d298a5b50269839ead) |
---|---|
1/* 2 * adt7475 - Thermal sensor driver for the ADT7475 chip and derivatives 3 * Copyright (C) 2007-2008, Advanced Micro Devices, Inc. 4 * Copyright (C) 2008 Jordan Crouse <jordan@cosmicpenguin.net> 5 * Copyright (C) 2008 Hans de Goede <hdegoede@redhat.com> 6 * Copyright (C) 2009 Jean Delvare <jdelvare@suse.de> 7 * 8 * Derived from the lm83 driver by Jean Delvare --- 180 unchanged lines hidden (view full) --- 189}; 190MODULE_DEVICE_TABLE(of, adt7475_of_match); 191 192struct adt7475_data { 193 struct device *hwmon_dev; 194 struct mutex lock; 195 196 unsigned long measure_updated; | 1/* 2 * adt7475 - Thermal sensor driver for the ADT7475 chip and derivatives 3 * Copyright (C) 2007-2008, Advanced Micro Devices, Inc. 4 * Copyright (C) 2008 Jordan Crouse <jordan@cosmicpenguin.net> 5 * Copyright (C) 2008 Hans de Goede <hdegoede@redhat.com> 6 * Copyright (C) 2009 Jean Delvare <jdelvare@suse.de> 7 * 8 * Derived from the lm83 driver by Jean Delvare --- 180 unchanged lines hidden (view full) --- 189}; 190MODULE_DEVICE_TABLE(of, adt7475_of_match); 191 192struct adt7475_data { 193 struct device *hwmon_dev; 194 struct mutex lock; 195 196 unsigned long measure_updated; |
197 char valid; | 197 bool valid; |
198 199 u8 config4; 200 u8 config5; 201 u8 has_voltage; 202 u8 bypass_attn; /* Bypass voltage attenuator */ 203 u8 has_pwm2:1; 204 u8 has_fan4:1; 205 u8 has_vid:1; --- 1570 unchanged lines hidden (view full) --- 1776 1777 mutex_lock(&data->lock); 1778 1779 /* Measurement values update every 2 seconds */ 1780 if (time_after(jiffies, data->measure_updated + HZ * 2) || 1781 !data->valid) { 1782 adt7475_update_measure(dev); 1783 data->measure_updated = jiffies; | 198 199 u8 config4; 200 u8 config5; 201 u8 has_voltage; 202 u8 bypass_attn; /* Bypass voltage attenuator */ 203 u8 has_pwm2:1; 204 u8 has_fan4:1; 205 u8 has_vid:1; --- 1570 unchanged lines hidden (view full) --- 1776 1777 mutex_lock(&data->lock); 1778 1779 /* Measurement values update every 2 seconds */ 1780 if (time_after(jiffies, data->measure_updated + HZ * 2) || 1781 !data->valid) { 1782 adt7475_update_measure(dev); 1783 data->measure_updated = jiffies; |
1784 data->valid = true; |
|
1784 } 1785 1786 mutex_unlock(&data->lock); 1787 1788 return data; 1789} 1790 1791module_i2c_driver(adt7475_driver); 1792 1793MODULE_AUTHOR("Advanced Micro Devices, Inc"); 1794MODULE_DESCRIPTION("adt7475 driver"); 1795MODULE_LICENSE("GPL"); | 1785 } 1786 1787 mutex_unlock(&data->lock); 1788 1789 return data; 1790} 1791 1792module_i2c_driver(adt7475_driver); 1793 1794MODULE_AUTHOR("Advanced Micro Devices, Inc"); 1795MODULE_DESCRIPTION("adt7475 driver"); 1796MODULE_LICENSE("GPL"); |