bus: mhi: core: Add helper API to return number of free TREs
[linux-2.6-microblaze.git] / include / linux / mhi.h
index 562862f..ece53a2 100644 (file)
@@ -598,6 +598,15 @@ void mhi_set_mhi_state(struct mhi_controller *mhi_cntrl,
  */
 void mhi_notify(struct mhi_device *mhi_dev, enum mhi_callback cb_reason);
 
+/**
+ * mhi_get_free_desc_count - Get transfer ring length
+ * Get # of TD available to queue buffers
+ * @mhi_dev: Device associated with the channels
+ * @dir: Direction of the channel
+ */
+int mhi_get_free_desc_count(struct mhi_device *mhi_dev,
+                               enum dma_data_direction dir);
+
 /**
  * mhi_prepare_for_power_up - Do pre-initialization before power up.
  *                            This is optional, call this before power up if