diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2018-09-12 15:45:44 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2018-09-17 09:50:41 +0200 |
commit | 2d2daa3c65a08c201cbbbad772a93b1855709eb3 (patch) | |
tree | 036960362b7b1f20f058dafc894513b2e5cc714d /include | |
parent | 742ba2bf084c8d7f6db6af5ce02ebc4d848df013 (diff) | |
download | barebox-2d2daa3c65a08c201cbbbad772a93b1855709eb3.tar.gz barebox-2d2daa3c65a08c201cbbbad772a93b1855709eb3.tar.xz |
ratp: implement i2c read/write support
Introduce two new RATP commands that allow running i2c read/write
operations, very similar in format to the already existing md/mw
RATP commands.
The messages are defined with a fixed 16-bit long register field, but
it will only be treated as a 16-bit address if I2C_FLAG_WIDE_ADDRESS
is set in the message flags field. If this flag is unset, the start
register address is assumed 8-bit long.
If the message includes the I2C_FLAG_MASTER_MODE flag, the start
register field is ignored and a i2c master send/receive operation is
performed.
Signed-off-by: Aleksander Morgado <aleksander@aleksander.es>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/ratp_bb.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/ratp_bb.h b/include/ratp_bb.h index 3a80cf6aed..32b8040b6d 100644 --- a/include/ratp_bb.h +++ b/include/ratp_bb.h @@ -17,6 +17,10 @@ #define BB_RATP_TYPE_MW 12 #define BB_RATP_TYPE_MW_RETURN 13 #define BB_RATP_TYPE_RESET 14 +#define BB_RATP_TYPE_I2C_READ 15 +#define BB_RATP_TYPE_I2C_READ_RETURN 16 +#define BB_RATP_TYPE_I2C_WRITE 17 +#define BB_RATP_TYPE_I2C_WRITE_RETURN 18 struct ratp_bb { uint16_t type; |