This routine allows the user to check if neither ownership nor any
event notifications were requested for this line.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
return line->reserved_status == LINE_RESERVED;
}
+bool gpiod_line_is_free(struct gpiod_line *line)
+{
+ return line->reserved_status == LINE_FREE;
+}
+
static bool line_bulk_is_reserved(struct gpiod_line_bulk *line_bulk)
{
unsigned int i;
*/
bool gpiod_line_is_reserved(struct gpiod_line *line) GPIOD_API;
+/**
+ * @brief Check if the calling user has neither requested ownership of this
+ * line nor configured any event notifications.
+ * @param line GPIO line object.
+ * @return True if given line is free, false otherwise.
+ */
+bool gpiod_line_is_free(struct gpiod_line *line) GPIOD_API;
+
/**
* @brief Read current value of a single GPIO line.
* @param line GPIO line object.