api: ipm: Pass the ipm device as first parameter to callback

Let's normalize the callback like it is done in other APIs.
This will avoid the need to do not so nice code (storing the ipm device
pointer as global, or else) and more importantly will help to move all
device instance to constant.

Fixes #26923

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This commit is contained in:
Tomasz Bursztyka 2020-07-08 19:10:50 +02:00 committed by Carles Cufí
commit e4479f907f

View file

@ -35,14 +35,16 @@ extern "C" {
* interrupt-safe APIS. Registration of callbacks is done via
* @a ipm_register_callback
*
* @param "void *context" Arbitrary context pointer provided at
* @param ipmdev Driver instance
* @param context Arbitrary context pointer provided at
* registration time.
* @param "uint32_t id" Message type identifier.
* @param "volatile void *data" Message data pointer. The correct
* @param id Message type identifier.
* @param data Message data pointer. The correct
* amount of data to read out
* must be inferred using the message id/upper level protocol.
*/
typedef void (*ipm_callback_t)(void *context, uint32_t id, volatile void *data);
typedef void (*ipm_callback_t)(struct device *ipmdev, void *context,
uint32_t id, volatile void *data);
/**
* @typedef ipm_send_t