aboutsummaryrefslogtreecommitdiffstats
path: root/include/drm/drm_dp_helper.h
diff options
context:
space:
mode:
authorThierry Reding <treding@nvidia.com>2013-12-12 03:57:53 -0500
committerThierry Reding <treding@nvidia.com>2014-02-26 11:21:34 -0500
commit88759686c702f1fbbb8e737e6231b64a9880db73 (patch)
treeb803c33c31865165a95de0a7bfe68fb42082c1e3 /include/drm/drm_dp_helper.h
parent516c0f7c0a608833cc01d3f5b2a357ee806b78a1 (diff)
drm/dp: Allow registering AUX channels as I2C busses
Implements an I2C-over-AUX I2C adapter on top of the generic drm_dp_aux infrastructure. It extracts the retry logic from existing drivers, which should help in porting those drivers to this new helper. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Thierry Reding <treding@nvidia.com> --- Changes in v5: - move comments partially to to header file - keep MOT set between I2C messages - return -EPROTO on short reads Changes in v4: - fix typo "bitrate" -> "bit rate" Changes in v3: - add back DRM_DEBUG_KMS and DRM_ERROR messages - embed i2c_adapter within struct drm_dp_aux - fix typo in comment
Diffstat (limited to 'include/drm/drm_dp_helper.h')
-rw-r--r--include/drm/drm_dp_helper.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h
index 28ab6f4e3b09..b7488c9849ad 100644
--- a/include/drm/drm_dp_helper.h
+++ b/include/drm/drm_dp_helper.h
@@ -421,6 +421,7 @@ struct drm_dp_aux_msg {
421 421
422/** 422/**
423 * struct drm_dp_aux - DisplayPort AUX channel 423 * struct drm_dp_aux - DisplayPort AUX channel
424 * @ddc: I2C adapter that can be used for I2C-over-AUX communication
424 * @dev: pointer to struct device that is the parent for this AUX channel 425 * @dev: pointer to struct device that is the parent for this AUX channel
425 * @transfer: transfers a message representing a single AUX transaction 426 * @transfer: transfers a message representing a single AUX transaction
426 * 427 *
@@ -435,8 +436,16 @@ struct drm_dp_aux_msg {
435 * propagate errors from the .transfer() function, with the exception of 436 * propagate errors from the .transfer() function, with the exception of
436 * the -EBUSY error, which causes a transaction to be retried. On a short, 437 * the -EBUSY error, which causes a transaction to be retried. On a short,
437 * helpers will return -EPROTO to make it simpler to check for failure. 438 * helpers will return -EPROTO to make it simpler to check for failure.
439 *
440 * An AUX channel can also be used to transport I2C messages to a sink. A
441 * typical application of that is to access an EDID that's present in the
442 * sink device. The .transfer() function can also be used to execute such
443 * transactions. The drm_dp_aux_register_i2c_bus() function registers an
444 * I2C adapter that can be passed to drm_probe_ddc(). Upon removal, drivers
445 * should call drm_dp_aux_unregister_i2c_bus() to remove the I2C adapter.
438 */ 446 */
439struct drm_dp_aux { 447struct drm_dp_aux {
448 struct i2c_adapter ddc;
440 struct device *dev; 449 struct device *dev;
441 450
442 ssize_t (*transfer)(struct drm_dp_aux *aux, 451 ssize_t (*transfer)(struct drm_dp_aux *aux,
@@ -497,4 +506,7 @@ int drm_dp_link_probe(struct drm_dp_aux *aux, struct drm_dp_link *link);
497int drm_dp_link_power_up(struct drm_dp_aux *aux, struct drm_dp_link *link); 506int drm_dp_link_power_up(struct drm_dp_aux *aux, struct drm_dp_link *link);
498int drm_dp_link_configure(struct drm_dp_aux *aux, struct drm_dp_link *link); 507int drm_dp_link_configure(struct drm_dp_aux *aux, struct drm_dp_link *link);
499 508
509int drm_dp_aux_register_i2c_bus(struct drm_dp_aux *aux);
510void drm_dp_aux_unregister_i2c_bus(struct drm_dp_aux *aux);
511
500#endif /* _DRM_DP_HELPER_H_ */ 512#endif /* _DRM_DP_HELPER_H_ */