From 21b01cd4b54781cfab038016c2d644069d522787 Mon Sep 17 00:00:00 2001 From: Jerome Glisse Date: Thu, 20 Dec 2007 12:35:54 +0100 Subject: radeon_ms: update to follow lastest modesetting change --- shared-core/radeon_ms.h | 15 +-------------- shared-core/radeon_ms_dac.c | 4 ++-- shared-core/radeon_ms_family.c | 10 ++++------ shared-core/radeon_ms_i2c.c | 15 ++++++++++++--- shared-core/radeon_ms_output.c | 4 ++-- 5 files changed, 21 insertions(+), 27 deletions(-) (limited to 'shared-core') diff --git a/shared-core/radeon_ms.h b/shared-core/radeon_ms.h index ee795f3a..d86c40b9 100644 --- a/shared-core/radeon_ms.h +++ b/shared-core/radeon_ms.h @@ -87,17 +87,6 @@ enum radeon_monitor_type { MT_STV = 5 }; -enum radeon_connector_type { - CONNECTOR_NONE, - CONNECTOR_PROPRIETARY, - CONNECTOR_VGA, - CONNECTOR_DVI_I, - CONNECTOR_DVI_D, - CONNECTOR_CTV, - CONNECTOR_STV, - CONNECTOR_UNSUPPORTED -}; - enum radeon_output_type { OUTPUT_NONE, OUTPUT_DAC1, @@ -131,7 +120,6 @@ struct radeon_ms_connector { int crtc; uint32_t i2c_reg; char outputs[RADEON_MAX_OUTPUTS]; - char name[32]; }; struct radeon_ms_output { @@ -459,8 +447,7 @@ int radeon_ms_wait_for_idle(struct drm_device *dev); /* radeon_ms_i2c.c */ void radeon_ms_i2c_destroy(struct radeon_ms_i2c *i2c); struct radeon_ms_i2c *radeon_ms_i2c_create(struct drm_device *dev, - const uint32_t reg, - const char *name); + const uint32_t reg, int type); /* radeon_ms_irq.c */ void radeon_ms_irq_emit(struct drm_device *dev); diff --git a/shared-core/radeon_ms_dac.c b/shared-core/radeon_ms_dac.c index 297623a0..2483eab8 100644 --- a/shared-core/radeon_ms_dac.c +++ b/shared-core/radeon_ms_dac.c @@ -369,8 +369,8 @@ int radeon_ms_dac2_mode_set(struct radeon_ms_output *output, case CHIP_R420: case CHIP_R430: case CHIP_R480: - if (connector->type != CONNECTOR_CTV && - connector->type != CONNECTOR_STV) { + if (connector->type != ConnectorComposite && + connector->type != ConnectorSVIDEO) { state->dac_cntl2 |= DAC_CNTL2__DAC2_CLK_SEL; } } diff --git a/shared-core/radeon_ms_family.c b/shared-core/radeon_ms_family.c index 779595d6..fcfec799 100644 --- a/shared-core/radeon_ms_family.c +++ b/shared-core/radeon_ms_family.c @@ -58,19 +58,17 @@ static struct radeon_ms_output radeon_ms_dac2 = { }; static struct radeon_ms_connector radeon_ms_vga = { - NULL, NULL, NULL, CONNECTOR_VGA, MT_NONE, 0, GPIO_DDC1, + NULL, NULL, NULL, ConnectorVGA, MT_NONE, 0, GPIO_DDC1, { 0, -1, -1, -1, -1, -1, -1, -1 - }, - "VGA" + } }; static struct radeon_ms_connector radeon_ms_dvi_i_2 = { - NULL, NULL, NULL, CONNECTOR_DVI_I, MT_NONE, 0, GPIO_DDC2, + NULL, NULL, NULL, ConnectorDVII, MT_NONE, 0, GPIO_DDC2, { 1, -1, -1, -1, -1, -1, -1, -1 - }, - "DVI-I" + } }; static struct radeon_ms_properties properties[] = { diff --git a/shared-core/radeon_ms_i2c.c b/shared-core/radeon_ms_i2c.c index 1801c496..f8730702 100644 --- a/shared-core/radeon_ms_i2c.c +++ b/shared-core/radeon_ms_i2c.c @@ -219,8 +219,7 @@ static void set_data(void *i2c_priv, int data) * */ struct radeon_ms_i2c *radeon_ms_i2c_create(struct drm_device *dev, - const uint32_t reg, - const char *name) + const uint32_t reg, int type) { struct radeon_ms_i2c *i2c; int ret; @@ -233,7 +232,17 @@ struct radeon_ms_i2c *radeon_ms_i2c_create(struct drm_device *dev, i2c->drm_dev = dev; i2c->reg = reg; - snprintf(i2c->adapter.name, I2C_NAME_SIZE, "radeon-%s", name); + switch (type) { + case ConnectorVGA: + snprintf(i2c->adapter.name, I2C_NAME_SIZE, "radeon-VGA"); + break; + case ConnectorDVII: + snprintf(i2c->adapter.name, I2C_NAME_SIZE, "radeon-DVII"); + break; + default: + snprintf(i2c->adapter.name, I2C_NAME_SIZE, "radeon-UNKNOWN"); + break; + } i2c->adapter.owner = THIS_MODULE; /* fixme need to take a look at what its needed for */ i2c->adapter.id = I2C_HW_B_RADEON; diff --git a/shared-core/radeon_ms_output.c b/shared-core/radeon_ms_output.c index 35e5c376..a1ed29cb 100644 --- a/shared-core/radeon_ms_output.c +++ b/shared-core/radeon_ms_output.c @@ -249,14 +249,14 @@ int radeon_ms_connectors_from_properties(struct drm_device *dev) dev_priv->properties->connectors[i], sizeof(struct radeon_ms_connector)); connector->i2c = radeon_ms_i2c_create(dev, - connector->i2c_reg, connector->name); + connector->i2c_reg, connector->type); if (connector->i2c == NULL) { radeon_ms_connectors_destroy(dev); return -ENOMEM; } output = drm_output_create(dev, &radeon_ms_output_funcs, - connector->name); + connector->type); if (output == NULL) { radeon_ms_connectors_destroy(dev); return -EINVAL; -- cgit v1.2.3