package/kernel/hwmon-gsc/src/gsc.c
/* 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.
 */
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.
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 gsp_read(struct i2c_client *client, u8 reg)
{
	unsigned int adc = 0;
	if (reg == GSP_REG_TEMP_IN || reg > GSP_REG_CURRENT)
	{
		adc |= i2c_smbus_read_byte_data(client, reg);
		adc |= i2c_smbus_read_byte_data(client, reg + 1) << 8;
		return adc;
	}
	else
	{
		adc |= i2c_smbus_read_byte_data(client, reg);
		adc |= i2c_smbus_read_byte_data(client, reg + 1) << 8;
		adc |= i2c_smbus_read_byte_data(client, reg + 2) << 16;
		return adc;
	}
}
static inline int gsp_read ( struct i2c_client * client , u8 reg ) { unsigned int adc = 0 ; if ( reg == GSP_REG_TEMP_IN || reg > GSP_REG_CURRENT ) { adc |= i2c_smbus_read_byte_data ( client , reg ) ; adc |= i2c_smbus_read_byte_data ( client , reg + 1 ) << 8 ; return adc ; } else { adc |= i2c_smbus_read_byte_data ( client , reg ) ; adc |= i2c_smbus_read_byte_data ( client , reg + 1 ) << 8 ; adc |= i2c_smbus_read_byte_data ( client , reg + 2 ) << 16 ; return adc ; } }
All registers are word-sized, except for the configuration registers.
All registers are word - sized except for the configuration registers .