mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-03 09:00:21 +00:00
Teach iic(4) the 'repeated start' I2C condition. This will be used by the
upcoming i2c(8) diag utility. Reviewed by: bms, stas Obtained from: Semihalf
This commit is contained in:
parent
8154af81ff
commit
1aef11be0e
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=187709
@ -45,13 +45,19 @@ In order to control I2C devices, use
|
||||
.Pa /dev/iic?
|
||||
with the
|
||||
following ioctls:
|
||||
.Bl -tag -width ".Dv I2CRSTCARD"
|
||||
.Bl -tag -width ".Dv I2CRPTSTART"
|
||||
.It Dv I2CSTART
|
||||
.Pq Vt "struct iiccmd"
|
||||
Sends the start condition to the slave specified by the
|
||||
.Va slave
|
||||
element to the bus.
|
||||
All other elements are ignored.
|
||||
.It Dv I2CRPTSTART
|
||||
.Pq Vt "struct iiccmd"
|
||||
Sends the repeated start condition to the slave specified by the
|
||||
.Va slave
|
||||
element to the bus.
|
||||
All other elements are ignored.
|
||||
.It Dv I2CSTOP
|
||||
No argument is passed.
|
||||
Sends the stop condition to the bus.
|
||||
|
@ -368,6 +368,11 @@ iicioctl(struct cdev *dev, u_long cmd, caddr_t data, int flags, struct thread *t
|
||||
}
|
||||
free(usrbufs, M_TEMP);
|
||||
break;
|
||||
|
||||
case I2CRPTSTART:
|
||||
error = iicbus_repeated_start(parent, s->slave, 0);
|
||||
break;
|
||||
|
||||
default:
|
||||
error = ENOTTY;
|
||||
}
|
||||
|
@ -60,5 +60,6 @@ struct iic_rdwr_data {
|
||||
#define I2CWRITE _IOW('i', 4, struct iiccmd) /* send data */
|
||||
#define I2CREAD _IOW('i', 5, struct iiccmd) /* receive data */
|
||||
#define I2CRDWR _IOW('i', 6, struct iic_rdwr_data) /* General read/write interface */
|
||||
#define I2CRPTSTART _IOW('i', 7, struct iiccmd) /* repeated start */
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user