Skip to content

Commit 5da0590

Browse files
WhatAmISupposedToPutHerejannau
authored andcommitted
soc: apple: rtkit: Add apple_rtkit_has_endpoint()
To be used by RTKit consumers to check if an endpoint is present and should be enabled. Signed-off-by: Sasha Finkelstein <fnkl.kernel@gmail.com>
1 parent d1d53ef commit 5da0590

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

drivers/soc/apple/rtkit.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -639,6 +639,12 @@ int apple_rtkit_poll(struct apple_rtkit *rtk)
639639
}
640640
EXPORT_SYMBOL_GPL(apple_rtkit_poll);
641641

642+
bool apple_rtkit_has_endpoint(struct apple_rtkit *rtk, u8 ep)
643+
{
644+
return test_bit(ep, rtk->endpoints);
645+
}
646+
EXPORT_SYMBOL_GPL(apple_rtkit_has_endpoint);
647+
642648
int apple_rtkit_start_ep(struct apple_rtkit *rtk, u8 endpoint)
643649
{
644650
u64 msg;

include/linux/soc/apple/rtkit.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,4 +172,12 @@ int apple_rtkit_send_message(struct apple_rtkit *rtk, u8 ep, u64 message,
172172
*/
173173
int apple_rtkit_poll(struct apple_rtkit *rtk);
174174

175+
/*
176+
* Checks if an endpoint with a given index exists
177+
*
178+
* @rtk: RTKit reference
179+
* @ep: endpoint to check for
180+
*/
181+
bool apple_rtkit_has_endpoint(struct apple_rtkit *rtk, u8 ep);
182+
175183
#endif /* _LINUX_APPLE_RTKIT_H_ */

0 commit comments

Comments
 (0)