Skip to content

Commit 69b1044

Browse files
XenuIsWatchingDevansh0210
authored andcommitted
drivers: i3c: add ibi hj reponse api
Add an api to ack or nack ibi hj requests. Signed-off-by: Ryan McClelland <[email protected]>
1 parent e8082f0 commit 69b1044

File tree

1 file changed

+38
-0
lines changed
  • include/zephyr/drivers

1 file changed

+38
-0
lines changed

include/zephyr/drivers/i3c.h

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -769,6 +769,19 @@ __subsystem struct i3c_driver_api {
769769
struct i3c_device_desc *(*i3c_device_find)(const struct device *dev,
770770
const struct i3c_device_id *id);
771771

772+
/**
773+
* ACK or NACK IBI HJ Requests
774+
*
775+
* @see ibi_hj_response()
776+
*
777+
* @param dev Pointer to controller device driver instance.
778+
* @param ack True to ack, False to nack
779+
*
780+
* @return See ibi_hj_response()
781+
*/
782+
int (*ibi_hj_response)(const struct device *dev,
783+
bool ack);
784+
772785
/**
773786
* Raise In-Band Interrupt (IBI).
774787
*
@@ -1675,6 +1688,31 @@ struct i3c_device_desc *i3c_device_find(const struct device *dev,
16751688
* @{
16761689
*/
16771690

1691+
/**
1692+
* @brief ACK or NACK IBI HJ Requests
1693+
*
1694+
* This tells the controller to Acknowledge or Not Acknowledge
1695+
* In-Band Interrupt Hot-Join Requests.
1696+
*
1697+
* @param dev Pointer to controller device driver instance.
1698+
* @param ack True to ack, False to nack
1699+
*
1700+
* @retval 0 if operation is successful.
1701+
* @retval -EIO General input / output error.
1702+
*/
1703+
static inline int i3c_ibi_hj_response(const struct device *dev,
1704+
bool ack)
1705+
{
1706+
const struct i3c_driver_api *api =
1707+
(const struct i3c_driver_api *)dev->api;
1708+
1709+
if (api->ibi_hj_response == NULL) {
1710+
return -ENOSYS;
1711+
}
1712+
1713+
return api->ibi_hj_response(dev, ack);
1714+
}
1715+
16781716
/**
16791717
* @brief Raise an In-Band Interrupt (IBI).
16801718
*

0 commit comments

Comments
 (0)