[Intel-gfx] [PATCH 1/9] drm: Improve drm_dp_aux DocBook.

Rodrigo Vivi rodrigo.vivi at intel.com
Wed Nov 25 16:03:57 PST 2015


This patch converts drm_dp_aux doc to new per-member comment layout
that 4.4 supports as suggested by Daniel.

But also:

1. to let the split text with sense this patch also
introduce a brief general AUX channel definition.

2. Remove .name and .dev duplications from the original text.

3. Improve .transfer() error code handler making more clear
   what is going on with each error code generated or handled

Cc: Daniel Vetter <daniel.vetter at ffwll.ch>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi at intel.com>
---
 include/drm/drm_dp_helper.h | 64 +++++++++++++++++++++++++++++----------------
 1 file changed, 42 insertions(+), 22 deletions(-)

diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h
index 1252108..ed7dbdc 100644
--- a/include/drm/drm_dp_helper.h
+++ b/include/drm/drm_dp_helper.h
@@ -703,26 +703,9 @@ struct drm_dp_aux_msg {
 
 /**
  * struct drm_dp_aux - DisplayPort AUX channel
- * @name: user-visible name of this AUX channel and the I2C-over-AUX adapter
- * @ddc: I2C adapter that can be used for I2C-over-AUX communication
- * @dev: pointer to struct device that is the parent for this AUX channel
- * @hw_mutex: internal mutex used for locking transfers
- * @transfer: transfers a message representing a single AUX transaction
  *
- * The .dev field should be set to a pointer to the device that implements
- * the AUX channel.
- *
- * The .name field may be used to specify the name of the I2C adapter. If set to
- * NULL, dev_name() of .dev will be used.
- *
- * Drivers provide a hardware-specific implementation of how transactions
- * are executed via the .transfer() function. A pointer to a drm_dp_aux_msg
- * structure describing the transaction is passed into this function. Upon
- * success, the implementation should return the number of payload bytes
- * that were transferred, or a negative error-code on failure. Helpers
- * propagate errors from the .transfer() function, with the exception of
- * the -EBUSY error, which causes a transaction to be retried. On a short,
- * helpers will return -EPROTO to make it simpler to check for failure.
+ * AUX channel is a half duplex channel used to transfer messages between
+ * source an sink. Mainly used for write and read sink DPCD registers.
  *
  * An AUX channel can also be used to transport I2C messages to a sink. A
  * typical application of that is to access an EDID that's present in the
@@ -734,15 +717,52 @@ struct drm_dp_aux_msg {
  * received, the adapter will drop down to the size given by the partial
  * response for this transaction only.
  *
- * Note that the aux helper code assumes that the .transfer() function
- * only modifies the reply field of the drm_dp_aux_msg structure.  The
- * retry logic and i2c helpers assume this is the case.
  */
 struct drm_dp_aux {
+	/**
+	 * @name: user-visible name of this AUX channel and the I2C-over-AUX
+	 *        adapter. If set to NULL, dev_name() of .dev will be used.
+	 */
 	const char *name;
+
+	/**
+	 * @ddc: I2C adapter that can be used for I2C-over-AUX communication
+	 */
 	struct i2c_adapter ddc;
+
+	/**
+	 * @dev: pointer to struct device that is the parent and implements
+	 *       this AUX channel
+	 */
 	struct device *dev;
+
+	/**
+	 * @hw_mutex: internal mutex used for locking transfers
+	 */
 	struct mutex hw_mutex;
+
+	/**
+	 * @transfer: transfers a message representing a single AUX transaction
+	 *
+	 * Drivers provide a hardware-specific implementation of how
+	 * transactions are executed via this function. A pointer to a
+	 * drm_dp_aux_msg structure describing the transaction is passed into
+	 * this function.
+	 *
+	 * Returns:
+	 * Upon success, the implementation should return the number of
+	 * payload bytes that were transferred.
+	 * Otherwise a negative error-code on failure. Helpers propagate errors
+	 * from the .transfer() function, with the exception of:
+	 * - -EPROTO: On a short, helpers will return -EPROTO to make it simpler
+	 *   to check for failure.
+	 * - -EBUSY: When BUSY helpers will attempt retries before propagating
+	 *   this error.
+	 *
+	 * Note that the aux helper code assumes that the .transfer() function
+	 * only modifies the reply field of the drm_dp_aux_msg structure.  The
+	 * retry logic and i2c helpers assume this is the case.
+	 */
 	ssize_t (*transfer)(struct drm_dp_aux *aux,
 			    struct drm_dp_aux_msg *msg);
 	unsigned i2c_nack_count, i2c_defer_count;
-- 
2.4.3



More information about the Intel-gfx mailing list