summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorOliver O'Halloran <oohall@gmail.com>2019-03-26 19:18:18 +1100
committerStewart Smith <stewart@linux.ibm.com>2019-03-28 15:24:13 +1100
commit319e7d935f1354f317f32816293ade0dfd827b81 (patch)
tree33062251a9fc4bace5264a068228b12873330e10 /include
parentd290b244efbc03c9a89e858a57b7a91186dcf364 (diff)
downloadtalos-skiboot-319e7d935f1354f317f32816293ade0dfd827b81.tar.gz
talos-skiboot-319e7d935f1354f317f32816293ade0dfd827b81.zip
core/i2c: split i2c_request_send()
Split the i2c_request_send() method into two methods: i2c_request_send() which allocates and populates and i2c_request structure, and i2c_request_sync() which take a request structure and blocks until it completes. This allows code that allocates a i2c_request structure elsewhere to make use of the existing busy-wait and request retry logic. Fix the return types to use int64_t while we're here since these are returning OPAL_API error codes. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
Diffstat (limited to 'include')
-rw-r--r--include/i2c.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/i2c.h b/include/i2c.h
index 484176f9..e5306837 100644
--- a/include/i2c.h
+++ b/include/i2c.h
@@ -98,7 +98,8 @@ static inline int i2c_check_quirk(struct i2c_request *req, int *rc)
}
/* I2C synchronous request API */
-int i2c_request_send(int bus_id, int dev_addr, int read_write,
+int64_t i2c_request_sync(struct i2c_request *req);
+int64_t i2c_request_send(int bus_id, int dev_addr, int read_write,
uint32_t offset, uint32_t offset_bytes, void* buf,
size_t buflen, int timeout);
OpenPOWER on IntegriCloud