2
0
mirror of https://github.com/lm-sensors/lm-sensors synced 2025-08-31 14:25:39 +00:00

Drop unused I2C/SMBus low-level definitions and code. In

particular, we really don't want to use SMBus write functions in this
script.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@3289 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Jean Delvare
2006-04-22 09:06:21 +00:00
parent 2beecd912c
commit 561eb551be

View File

@@ -2312,14 +2312,11 @@ sub find_adapter_driver
# This should really go into a separate module/package.
# These are copied from <linux/i2c.h> and <linux/smbus.h>
# These are copied from <linux/i2c-dev.h>
use constant IOCTL_I2C_SLAVE => 0x0703;
use constant IOCTL_I2C_TENBIT => 0x0704;
use constant IOCTL_I2C_SMBUS => 0x0720;
# These are copied from <linux/smbus.h>
use constant SMBUS_READ => 1;
use constant SMBUS_WRITE => 0;
@@ -2327,8 +2324,6 @@ use constant SMBUS_QUICK => 0;
use constant SMBUS_BYTE => 1;
use constant SMBUS_BYTE_DATA => 2;
use constant SMBUS_WORD_DATA => 3;
use constant SMBUS_PROC_CALL => 4;
use constant SMBUS_BLOCK_DATA => 5;
# Select the device to communicate with through its address.
# $_[0]: Reference to an opened filehandle
@@ -2387,18 +2382,6 @@ sub i2c_smbus_read_byte
return $data[0];
}
# $_[0]: Reference to an opened filehandle
# $_[1]: Byte to write
# Returns: -1 on failure, 0 on success.
sub i2c_smbus_write_byte
{
my ($file,$command) = @_;
my @data = ($command);
i2c_smbus_access $file, SMBUS_WRITE, 0, SMBUS_BYTE, \@data
or return -1;
return 0;
}
# $_[0]: Reference to an opened filehandle
# $_[1]: Command byte (usually register number)
# Returns: -1 on failure, the read byte on success.
@@ -2411,19 +2394,6 @@ sub i2c_smbus_read_byte_data
return $data[0];
}
# $_[0]: Reference to an opened filehandle
# $_[1]: Command byte (usually register number)
# $_[2]: Byte to write
# Returns: -1 on failure, 0 on success.
sub i2c_smbus_write_byte_data
{
my ($file,$command,$value) = @_;
my @data = ($value);
i2c_smbus_access $file, SMBUS_WRITE, $command, SMBUS_BYTE_DATA, \@data
or return -1;
return 0;
}
# $_[0]: Reference to an opened filehandle
# $_[1]: Command byte (usually register number)
# Returns: -1 on failure, the read word on success.
@@ -2438,21 +2408,6 @@ sub i2c_smbus_read_word_data
return $data[0] + 256 * $data[1];
}
# $_[0]: Reference to an opened filehandle
# $_[1]: Command byte (usually register number)
# $_[2]: Byte to write
# Returns: -1 on failure, 0 on success.
# Note: some devices use the wrong endiannes; use swap_bytes to correct for
# this.
sub i2c_smbus_write_word_data
{
my ($file,$command,$value) = @_;
my @data = ($value & 0xff, $value >> 8);
i2c_smbus_access $file, SMBUS_WRITE, $command, SMBUS_WORD_DATA, \@data
or return -1;
return 0;
}
# $_[0]: Reference to an opened filehandle
# $_[1]: Address
# Returns: 1 on successful probing, 0 else.