summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Gray <jsg@jsg.id.au>2013-03-16 23:50:01 +1100
committerJonathan Gray <jsg@jsg.id.au>2013-03-16 23:50:01 +1100
commit9a4d9639ebcc120d7a01b11f5bda1bb11f83c8d8 (patch)
tree385c074f6f29e30ea6c2bda821be8edef3b273cb
parentb2afd31248107652f16cb3c6771ca495f5ad5e2b (diff)
enable a bit more dp code
-rw-r--r--sys/dev/pci/drm/drm_dp_helper.h6
-rw-r--r--sys/dev/pci/drm/i915/intel_dp.c14
-rw-r--r--sys/dev/pci/drm/i915/intel_drv.h1
3 files changed, 10 insertions, 11 deletions
diff --git a/sys/dev/pci/drm/drm_dp_helper.h b/sys/dev/pci/drm/drm_dp_helper.h
index ae246999eb6..12cd3728a3b 100644
--- a/sys/dev/pci/drm/drm_dp_helper.h
+++ b/sys/dev/pci/drm/drm_dp_helper.h
@@ -317,18 +317,16 @@
* @address: i2c target address for the currently ongoing transfer
* @aux_ch: driver callback to transfer a single byte of the i2c payload
*/
-#ifdef notyet
struct i2c_algo_dp_aux_data {
bool running;
u16 address;
- int (*aux_ch) (struct i2c_adapter *adapter,
+ int (*aux_ch) (struct i2c_controller *adapter,
int mode, uint8_t write_byte,
uint8_t *read_byte);
};
int
-i2c_dp_aux_add_bus(struct i2c_adapter *adapter);
-#endif
+i2c_dp_aux_add_bus(struct i2c_controller *adapter);
#define DP_LINK_STATUS_SIZE 6
diff --git a/sys/dev/pci/drm/i915/intel_dp.c b/sys/dev/pci/drm/i915/intel_dp.c
index b4e4b61b60d..2114601a32f 100644
--- a/sys/dev/pci/drm/i915/intel_dp.c
+++ b/sys/dev/pci/drm/i915/intel_dp.c
@@ -154,6 +154,7 @@ void intel_dp_init_panel_power_sequencer_registers(struct drm_device *,
struct intel_dp *, struct edp_power_seq *);
void ironlake_panel_vdd_tick(void *);
void ironlake_panel_vdd_work(void *, void *);
+int intel_dp_i2c_aux_ch(struct i2c_controller *, int, uint8_t, uint8_t *);
/**
* is_edp - is the given port attached to an eDP panel (either CPU or PCH)
@@ -688,11 +689,11 @@ intel_dp_aux_native_read(struct intel_dp *intel_dp,
}
}
-#ifdef notyet
int
intel_dp_i2c_aux_ch(struct i2c_controller *adapter, int mode,
uint8_t write_byte, uint8_t *read_byte)
{
+ struct i2c_algo_dp_aux_data *algo_data = adapter->ic_cookie;
struct intel_dp *intel_dp = container_of(adapter,
struct intel_dp,
adapter);
@@ -784,15 +785,11 @@ intel_dp_i2c_aux_ch(struct i2c_controller *adapter, int mode,
DRM_ERROR("too many retries, giving up\n");
return EIO;
}
-#endif
int
intel_dp_i2c_init(struct intel_dp *intel_dp,
struct intel_connector *intel_connector, const char *name)
{
- printf("%s stub\n", __func__);
- return EINVAL;
-#if 0
int ret;
DRM_DEBUG_KMS("i2c_init %s\n", name);
@@ -801,18 +798,21 @@ intel_dp_i2c_init(struct intel_dp *intel_dp,
intel_dp->algo.aux_ch = intel_dp_i2c_aux_ch;
memset(&intel_dp->adapter, '\0', sizeof(intel_dp->adapter));
+#if 0
intel_dp->adapter.owner = THIS_MODULE;
intel_dp->adapter.class = I2C_CLASS_DDC;
strncpy(intel_dp->adapter.name, name, sizeof(intel_dp->adapter.name) - 1);
intel_dp->adapter.name[sizeof(intel_dp->adapter.name) - 1] = '\0';
- intel_dp->adapter.algo_data = &intel_dp->algo;
+#endif
+ intel_dp->adapter.ic_cookie = &intel_dp->algo;
+#if 0
intel_dp->adapter.dev.parent = &intel_connector->base.kdev;
+#endif
ironlake_edp_panel_vdd_on(intel_dp);
ret = i2c_dp_aux_add_bus(&intel_dp->adapter);
ironlake_edp_panel_vdd_off(intel_dp, false);
return ret;
-#endif
}
bool
diff --git a/sys/dev/pci/drm/i915/intel_drv.h b/sys/dev/pci/drm/i915/intel_drv.h
index d9199496907..f13bfef682c 100644
--- a/sys/dev/pci/drm/i915/intel_drv.h
+++ b/sys/dev/pci/drm/i915/intel_drv.h
@@ -329,6 +329,7 @@ struct intel_dp {
uint8_t dpcd[DP_RECEIVER_CAP_SIZE];
uint8_t downstream_ports[DP_MAX_DOWNSTREAM_PORTS];
struct i2c_controller adapter;
+ struct i2c_algo_dp_aux_data algo;
bool is_pch_edp;
uint8_t train_set[4];
int panel_power_up_delay;