Commit f5a5e833 authored by Hector Martin's avatar Hector Martin Committed by Arnd Bergmann

soc: apple: rtkit: Add apple_rtkit_poll

This allows a client to receive messages in atomic context, by polling.
Signed-off-by: default avatarHector Martin <marcan@marcan.st>
Signed-off-by: default avatarRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Reviewed-by: default avatarSven Peter <sven@svenpeter.dev>
Reviewed-by: default avatarEric Curtin <ecurtin@redhat.com>
Reviewed-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
parent 387969b7
......@@ -660,6 +660,12 @@ int apple_rtkit_send_message_wait(struct apple_rtkit *rtk, u8 ep, u64 message,
}
EXPORT_SYMBOL_GPL(apple_rtkit_send_message_wait);
int apple_rtkit_poll(struct apple_rtkit *rtk)
{
return mbox_client_peek_data(rtk->mbox_chan);
}
EXPORT_SYMBOL_GPL(apple_rtkit_poll);
int apple_rtkit_start_ep(struct apple_rtkit *rtk, u8 endpoint)
{
u64 msg;
......
......@@ -152,4 +152,16 @@ int apple_rtkit_send_message(struct apple_rtkit *rtk, u8 ep, u64 message,
int apple_rtkit_send_message_wait(struct apple_rtkit *rtk, u8 ep, u64 message,
unsigned long timeout, bool atomic);
/*
* Process incoming messages in atomic context.
* This only guarantees that messages arrive as far as the recv_message_early
* callback; drivers expecting to handle incoming messages synchronously
* by calling this function must do it that way.
* Will return 1 if some data was processed, 0 if none was, or a
* negative error code on failure.
*
* @rtk: RTKit reference
*/
int apple_rtkit_poll(struct apple_rtkit *rtk);
#endif /* _LINUX_APPLE_RTKIT_H_ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment