Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 46e85f5f authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging:
  hwmon: (w83627ehf) Add support for the W83627UHG
  hwmon: (w83627ehf) Clean up probe function
  hwmon: (w83627ehf) Properly report PECI and AMD-SI sensor types
  hwmon: Use i2c_smbus_{read,write}_word_swapped
  hwmon: (smsc47b397) Fix checkpatch errors
  hwmon: (lm90) Make code more readable
  hwmon: (lm90) Fix warnings
  hwmon: (ibmaem) Avoid repeated memory allocations
  hwmon: (ibmaem) Make instance initializations independent
  hwmon: (ibmaem) Fix error paths
  hwmon: (lm73) Make detection less problematic
  hwmon: Avoid building drivers for powerpc that read/write ISA addresses
parents b2409fb6 eff7687d
Loading
Loading
Loading
Loading
+15 −13
Original line number Diff line number Diff line
@@ -14,6 +14,10 @@ Supported chips:
    Prefix: 'w83627dhg'
    Addresses scanned: ISA address retrieved from Super I/O registers
    Datasheet: not available
  * Winbond W83627UHG
    Prefix: 'w83627uhg'
    Addresses scanned: ISA address retrieved from Super I/O registers
    Datasheet: available from www.nuvoton.com
  * Winbond W83667HG
    Prefix: 'w83667hg'
    Addresses scanned: ISA address retrieved from Super I/O registers
@@ -42,14 +46,13 @@ Description
-----------

This driver implements support for the Winbond W83627EHF, W83627EHG,
W83627DHG, W83627DHG-P, W83667HG, W83667HG-B, W83667HG-I (NCT6775F),
and NCT6776F super I/O chips. We will refer to them collectively as
Winbond chips.

The chips implement three temperature sensors (up to four for 667HG-B, and nine
for NCT6775F and NCT6776F), five fan rotation speed sensors, ten analog voltage
sensors (only nine for the 627DHG), one VID (6 pins for the 627EHF/EHG, 8 pins
for the 627DHG and 667HG), alarms with beep warnings (control unimplemented),
W83627DHG, W83627DHG-P, W83627UHG, W83667HG, W83667HG-B, W83667HG-I
(NCT6775F), and NCT6776F super I/O chips. We will refer to them collectively
as Winbond chips.

The chips implement 2 to 4 temperature sensors (9 for NCT6775F and NCT6776F),
2 to 5 fan rotation speed sensors, 8 to 10 analog voltage sensors, one VID
(except for 627UHG), alarms with beep warnings (control unimplemented),
and some automatic fan regulation strategies (plus manual fan control mode).

The temperature sensor sources on W82677HG-B, NCT6775F, and NCT6776F are
@@ -86,17 +89,16 @@ follows:

temp1 -> pwm1
temp2 -> pwm2
temp3 -> pwm3
temp3 -> pwm3 (not on 627UHG)
prog  -> pwm4 (not on 667HG and 667HG-B; the programmable setting is not
	       supported by the driver)

/sys files
----------

name - this is a standard hwmon device entry. For the W83627EHF and W83627EHG,
       it is set to "w83627ehf", for the W83627DHG it is set to "w83627dhg",
       for the W83667HG and W83667HG-B it is set to "w83667hg", for NCT6775F it
       is set to "nct6775", and for NCT6776F it is set to "nct6776".
name - this is a standard hwmon device entry, it contains the name of
       the device (see the prefix in the list of supported devices at
       the top of this file)

pwm[1-4] - this file stores PWM duty cycle or DC value (fan speed) in range:
	   0 (stop) to 255 (full)
+16 −4
Original line number Diff line number Diff line
@@ -335,6 +335,7 @@ config SENSORS_I5K_AMB

config SENSORS_F71805F
	tristate "Fintek F71805F/FG, F71806F/FG and F71872F/FG"
	depends on !PPC
	help
	  If you say yes here you get support for hardware monitoring
	  features of the Fintek F71805F/FG, F71806F/FG and F71872F/FG
@@ -345,6 +346,7 @@ config SENSORS_F71805F

config SENSORS_F71882FG
	tristate "Fintek F71882FG and compatibles"
	depends on !PPC
	help
	  If you say yes here you get support for hardware monitoring
	  features of many Fintek Super-I/O (LPC) chips. The currently
@@ -468,6 +470,7 @@ config SENSORS_IBMPEX

config SENSORS_IT87
	tristate "ITE IT87xx and compatibles"
	depends on !PPC
	select HWMON_VID
	help
	  If you say yes here you get support for ITE IT8705F, IT8712F,
@@ -824,6 +827,7 @@ config SENSORS_NTC_THERMISTOR

config SENSORS_PC87360
	tristate "National Semiconductor PC87360 family"
	depends on !PPC
	select HWMON_VID
	help
	  If you say yes here you get access to the hardware monitoring
@@ -837,6 +841,7 @@ config SENSORS_PC87360

config SENSORS_PC87427
	tristate "National Semiconductor PC87427"
	depends on !PPC
	help
	  If you say yes here you get access to the hardware monitoring
	  functions of the National Semiconductor PC87427 Super-I/O chip.
@@ -928,7 +933,7 @@ config SENSORS_SMM665

config SENSORS_DME1737
	tristate "SMSC DME1737, SCH311x and compatibles"
	depends on I2C && EXPERIMENTAL
	depends on I2C && EXPERIMENTAL && !PPC
	select HWMON_VID
	help
	  If you say yes here you get support for the hardware monitoring
@@ -970,6 +975,7 @@ config SENSORS_EMC6W201

config SENSORS_SMSC47M1
	tristate "SMSC LPC47M10x and compatibles"
	depends on !PPC
	help
	  If you say yes here you get support for the integrated fan
	  monitoring and control capabilities of the SMSC LPC47B27x,
@@ -1003,7 +1009,7 @@ config SENSORS_SMSC47M192

config SENSORS_SMSC47B397
	tristate "SMSC LPC47B397-NC"
	depends on EXPERIMENTAL
	depends on EXPERIMENTAL && !PPC
	help
	  If you say yes here you get support for the SMSC LPC47B397-NC
	  sensor chip.
@@ -1017,6 +1023,7 @@ config SENSORS_SCH56XX_COMMON

config SENSORS_SCH5627
	tristate "SMSC SCH5627"
	depends on !PPC
	select SENSORS_SCH56XX_COMMON
	help
	  If you say yes here you get support for the hardware monitoring
@@ -1027,6 +1034,7 @@ config SENSORS_SCH5627

config SENSORS_SCH5636
	tristate "SMSC SCH5636"
	depends on !PPC
	select SENSORS_SCH56XX_COMMON
	help
	  SMSC SCH5636 Super I/O chips include an embedded microcontroller for
@@ -1150,6 +1158,7 @@ config SENSORS_VIA686A

config SENSORS_VT1211
	tristate "VIA VT1211"
	depends on !PPC
	select HWMON_VID
	help
	  If you say yes here then you get support for hardware monitoring
@@ -1262,6 +1271,7 @@ config SENSORS_W83L786NG

config SENSORS_W83627HF
	tristate "Winbond W83627HF, W83627THF, W83637HF, W83687THF, W83697HF"
	depends on !PPC
	select HWMON_VID
	help
	  If you say yes here you get support for the Winbond W836X7 series
@@ -1272,7 +1282,8 @@ config SENSORS_W83627HF
	  will be called w83627hf.

config SENSORS_W83627EHF
	tristate "Winbond W83627EHF/EHG/DHG, W83667HG, NCT6775F, NCT6776F"
	tristate "Winbond W83627EHF/EHG/DHG/UHG, W83667HG, NCT6775F, NCT6776F"
	depends on !PPC
	select HWMON_VID
	help
	  If you say yes here you get support for the hardware
@@ -1281,7 +1292,8 @@ config SENSORS_W83627EHF
	  This driver also supports the W83627EHG, which is the lead-free
	  version of the W83627EHF, and the W83627DHG, which is a similar
	  chip suited for specific Intel processors that use PECI such as
	  the Core 2 Duo.
	  the Core 2 Duo. And also the W83627UHG, which is a stripped down
	  version of the W83627DHG (as far as hardware monitoring goes.)

	  This driver also supports Nuvoton W83667HG, W83667HG-B, NCT6775F
	  (also known as W83667HG-I), and NCT6776F.
+3 −4
Original line number Diff line number Diff line
@@ -58,10 +58,9 @@ static inline int ad7414_temp_from_reg(s16 reg)

static inline int ad7414_read(struct i2c_client *client, u8 reg)
{
	if (reg == AD7414_REG_TEMP) {
		int value = i2c_smbus_read_word_data(client, reg);
		return (value < 0) ? value : swab16(value);
	} else
	if (reg == AD7414_REG_TEMP)
		return i2c_smbus_read_word_swapped(client, reg);
	else
		return i2c_smbus_read_byte_data(client, reg);
}

+9 −18
Original line number Diff line number Diff line
@@ -76,20 +76,6 @@ static struct i2c_driver ad7418_driver = {
	.id_table	= ad7418_id,
};

/* All registers are word-sized, except for the configuration registers.
 * AD7418 uses a high-byte first convention. Do NOT use those functions to
 * access the configuration registers CONF and CONF2, as they are byte-sized.
 */
static inline int ad7418_read(struct i2c_client *client, u8 reg)
{
	return swab16(i2c_smbus_read_word_data(client, reg));
}

static inline int ad7418_write(struct i2c_client *client, u8 reg, u16 value)
{
	return i2c_smbus_write_word_data(client, reg, swab16(value));
}

static void ad7418_init_client(struct i2c_client *client)
{
	struct ad7418_data *data = i2c_get_clientdata(client);
@@ -128,7 +114,9 @@ static struct ad7418_data *ad7418_update_device(struct device *dev)
		udelay(30);

		for (i = 0; i < 3; i++) {
			data->temp[i] = ad7418_read(client, AD7418_REG_TEMP[i]);
			data->temp[i] =
				i2c_smbus_read_word_swapped(client,
						AD7418_REG_TEMP[i]);
		}

		for (i = 0, ch = 4; i < data->adc_max; i++, ch--) {
@@ -138,11 +126,12 @@ static struct ad7418_data *ad7418_update_device(struct device *dev)

			udelay(15);
			data->in[data->adc_max - 1 - i] =
				ad7418_read(client, AD7418_REG_ADC);
				i2c_smbus_read_word_swapped(client,
						AD7418_REG_ADC);
		}

		/* restore old configuration value */
		ad7418_write(client, AD7418_REG_CONF, cfg);
		i2c_smbus_write_word_swapped(client, AD7418_REG_CONF, cfg);

		data->last_updated = jiffies;
		data->valid = 1;
@@ -182,7 +171,9 @@ static ssize_t set_temp(struct device *dev, struct device_attribute *devattr,

	mutex_lock(&data->lock);
	data->temp[attr->index] = LM75_TEMP_TO_REG(temp);
	ad7418_write(client, AD7418_REG_TEMP[attr->index], data->temp[attr->index]);
	i2c_smbus_write_word_swapped(client,
				     AD7418_REG_TEMP[attr->index],
				     data->temp[attr->index]);
	mutex_unlock(&data->lock);
	return count;
}
+4 −17
Original line number Diff line number Diff line
@@ -59,19 +59,6 @@ struct ads1015_data {
	struct ads1015_channel_data channel_data[ADS1015_CHANNELS];
};

static s32 ads1015_read_reg(struct i2c_client *client, unsigned int reg)
{
	s32 data = i2c_smbus_read_word_data(client, reg);

	return (data < 0) ? data : swab16(data);
}

static s32 ads1015_write_reg(struct i2c_client *client, unsigned int reg,
			     u16 val)
{
	return i2c_smbus_write_word_data(client, reg, swab16(val));
}

static int ads1015_read_value(struct i2c_client *client, unsigned int channel,
			      int *value)
{
@@ -87,7 +74,7 @@ static int ads1015_read_value(struct i2c_client *client, unsigned int channel,
	mutex_lock(&data->update_lock);

	/* get channel parameters */
	res = ads1015_read_reg(client, ADS1015_CONFIG);
	res = i2c_smbus_read_word_swapped(client, ADS1015_CONFIG);
	if (res < 0)
		goto err_unlock;
	config = res;
@@ -101,13 +88,13 @@ static int ads1015_read_value(struct i2c_client *client, unsigned int channel,
	config |= (pga & 0x0007) << 9;
	config |= (data_rate & 0x0007) << 5;

	res = ads1015_write_reg(client, ADS1015_CONFIG, config);
	res = i2c_smbus_write_word_swapped(client, ADS1015_CONFIG, config);
	if (res < 0)
		goto err_unlock;

	/* wait until conversion finished */
	msleep(conversion_time_ms);
	res = ads1015_read_reg(client, ADS1015_CONFIG);
	res = i2c_smbus_read_word_swapped(client, ADS1015_CONFIG);
	if (res < 0)
		goto err_unlock;
	config = res;
@@ -117,7 +104,7 @@ static int ads1015_read_value(struct i2c_client *client, unsigned int channel,
		goto err_unlock;
	}

	res = ads1015_read_reg(client, ADS1015_CONVERSION);
	res = i2c_smbus_read_word_swapped(client, ADS1015_CONVERSION);
	if (res < 0)
		goto err_unlock;
	conversion = res;
Loading