aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJani Nikula <jani.nikula@intel.com>2014-04-07 05:37:25 -0400
committerChristian König <christian.koenig@amd.com>2014-04-08 10:12:37 -0400
commita6c8aff022d4d06e4b41455ae9b2a5d3d503bf76 (patch)
tree946b20aac20bef14af46b26d1ccb343d53673ced
parent1ca2030563534bc0b057df9fddd30fb6257826cb (diff)
drm/i915: support address only i2c-over-aux transactions
To support bare address requests used by the drm dp helpers. Signed-off-by: Jani Nikula <jani.nikula@intel.com>
-rw-r--r--drivers/gpu/drm/i915/intel_dp.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index a0dad1a2f819..d2a55884ad52 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -575,7 +575,8 @@ out:
575 return ret; 575 return ret;
576} 576}
577 577
578#define HEADER_SIZE 4 578#define BARE_ADDRESS_SIZE 3
579#define HEADER_SIZE (BARE_ADDRESS_SIZE + 1)
579static ssize_t 580static ssize_t
580intel_dp_aux_transfer(struct drm_dp_aux *aux, struct drm_dp_aux_msg *msg) 581intel_dp_aux_transfer(struct drm_dp_aux *aux, struct drm_dp_aux_msg *msg)
581{ 582{
@@ -592,7 +593,7 @@ intel_dp_aux_transfer(struct drm_dp_aux *aux, struct drm_dp_aux_msg *msg)
592 switch (msg->request & ~DP_AUX_I2C_MOT) { 593 switch (msg->request & ~DP_AUX_I2C_MOT) {
593 case DP_AUX_NATIVE_WRITE: 594 case DP_AUX_NATIVE_WRITE:
594 case DP_AUX_I2C_WRITE: 595 case DP_AUX_I2C_WRITE:
595 txsize = HEADER_SIZE + msg->size; 596 txsize = msg->size ? HEADER_SIZE + msg->size : BARE_ADDRESS_SIZE;
596 rxsize = 1; 597 rxsize = 1;
597 598
598 if (WARN_ON(txsize > 20)) 599 if (WARN_ON(txsize > 20))
@@ -611,7 +612,7 @@ intel_dp_aux_transfer(struct drm_dp_aux *aux, struct drm_dp_aux_msg *msg)
611 612
612 case DP_AUX_NATIVE_READ: 613 case DP_AUX_NATIVE_READ:
613 case DP_AUX_I2C_READ: 614 case DP_AUX_I2C_READ:
614 txsize = HEADER_SIZE; 615 txsize = msg->size ? HEADER_SIZE : BARE_ADDRESS_SIZE;
615 rxsize = msg->size + 1; 616 rxsize = msg->size + 1;
616 617
617 if (WARN_ON(rxsize > 20)) 618 if (WARN_ON(rxsize > 20))