Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 68596
b: refs/heads/master
c: 53be795
h: refs/heads/master
v: v3
  • Loading branch information
David Brownell authored and Jean Delvare committed Oct 13, 2007
1 parent 19b8839 commit 35d89c4
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 32 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: cdeec3cc79c7b1acfa89fb362b01e544ecfb285c
refs/heads/master: 53be79593452e568a856f8393985131848d59b72
22 changes: 0 additions & 22 deletions trunk/drivers/i2c/i2c-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -931,28 +931,6 @@ int i2c_master_recv(struct i2c_client *client, char *buf ,int count)
}
EXPORT_SYMBOL(i2c_master_recv);

int i2c_control(struct i2c_client *client,
unsigned int cmd, unsigned long arg)
{
int ret = 0;
struct i2c_adapter *adap = client->adapter;

dev_dbg(&client->adapter->dev, "i2c ioctl, cmd: 0x%x, arg: %#lx\n", cmd, arg);
switch (cmd) {
case I2C_RETRIES:
adap->retries = arg;
break;
case I2C_TIMEOUT:
adap->timeout = arg;
break;
default:
if (adap->algo->algo_control!=NULL)
ret = adap->algo->algo_control(adap,cmd,arg);
}
return ret;
}
EXPORT_SYMBOL(i2c_control);

/* ----------------------------------------------------
* the i2c address scanning function
* Will not work for 10-bit addresses!
Expand Down
14 changes: 12 additions & 2 deletions trunk/drivers/i2c/i2c-dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -354,9 +354,19 @@ static int i2cdev_ioctl(struct inode *inode, struct file *file,
return -EFAULT;
}
return res;

case I2C_RETRIES:
client->adapter->retries = arg;
break;
case I2C_TIMEOUT:
client->adapter->timeout = arg;
break;
default:
return i2c_control(client,cmd,arg);
/* NOTE: returning a fault code here could cause trouble
* in buggy userspace code. Some old kernel bugs returned
* zero in this case, and userspace code might accidentally
* have depended on that bug.
*/
return -ENOTTY;
}
return 0;
}
Expand Down
7 changes: 0 additions & 7 deletions trunk/include/linux/i2c.h
Original file line number Diff line number Diff line change
Expand Up @@ -290,9 +290,6 @@ struct i2c_algorithm {
unsigned short flags, char read_write,
u8 command, int size, union i2c_smbus_data * data);

/* --- ioctl like call to set div. parameters. */
int (*algo_control)(struct i2c_adapter *, unsigned int, unsigned long);

/* To determine what the adapter supports */
u32 (*functionality) (struct i2c_adapter *);
};
Expand Down Expand Up @@ -416,10 +413,6 @@ extern int i2c_probe(struct i2c_adapter *adapter,
struct i2c_client_address_data *address_data,
int (*found_proc) (struct i2c_adapter *, int, int));

/* An ioctl like call to set div. parameters of the adapter.
*/
extern int i2c_control(struct i2c_client *,unsigned int, unsigned long);

extern struct i2c_adapter* i2c_get_adapter(int id);
extern void i2c_put_adapter(struct i2c_adapter *adap);

Expand Down

0 comments on commit 35d89c4

Please sign in to comment.