diff options
author | Alex Deucher <alexdeucher@gmail.com> | 2010-08-05 21:21:18 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2010-08-09 20:46:50 -0400 |
commit | 26b5bc986423cf3887e09188cb662ed651c5374d (patch) | |
tree | 568934e975f31029460b8e90f22580bdb84b19ec /drivers/gpu/drm/radeon/radeon_i2c.c | |
parent | 179e8078a768be8c18539bebe44dd94447142ccf (diff) |
drm/radeon/kms: add support for router objects
router objects are found on systems that use a mux to control
ddc line to connector routing or to control the actual clock and data
routing from the chip to the connectors. This patch implements ddc line
routing.
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_i2c.c')
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_i2c.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_i2c.c b/drivers/gpu/drm/radeon/radeon_i2c.c index e71f2eb02ee2..bfd2ce5f5372 100644 --- a/drivers/gpu/drm/radeon/radeon_i2c.c +++ b/drivers/gpu/drm/radeon/radeon_i2c.c | |||
@@ -52,6 +52,10 @@ bool radeon_ddc_probe(struct radeon_connector *radeon_connector) | |||
52 | } | 52 | } |
53 | }; | 53 | }; |
54 | 54 | ||
55 | /* on hw with routers, select right port */ | ||
56 | if (radeon_connector->router.valid) | ||
57 | radeon_router_select_port(radeon_connector); | ||
58 | |||
55 | ret = i2c_transfer(&radeon_connector->ddc_bus->adapter, msgs, 2); | 59 | ret = i2c_transfer(&radeon_connector->ddc_bus->adapter, msgs, 2); |
56 | if (ret == 2) | 60 | if (ret == 2) |
57 | return true; | 61 | return true; |
@@ -1073,3 +1077,28 @@ void radeon_i2c_put_byte(struct radeon_i2c_chan *i2c_bus, | |||
1073 | addr, val); | 1077 | addr, val); |
1074 | } | 1078 | } |
1075 | 1079 | ||
1080 | /* router switching */ | ||
1081 | void radeon_router_select_port(struct radeon_connector *radeon_connector) | ||
1082 | { | ||
1083 | u8 val; | ||
1084 | |||
1085 | if (!radeon_connector->router.valid) | ||
1086 | return; | ||
1087 | |||
1088 | radeon_i2c_get_byte(radeon_connector->router_bus, | ||
1089 | radeon_connector->router.i2c_addr, | ||
1090 | 0x3, &val); | ||
1091 | val &= radeon_connector->router.mux_control_pin; | ||
1092 | radeon_i2c_put_byte(radeon_connector->router_bus, | ||
1093 | radeon_connector->router.i2c_addr, | ||
1094 | 0x3, val); | ||
1095 | radeon_i2c_get_byte(radeon_connector->router_bus, | ||
1096 | radeon_connector->router.i2c_addr, | ||
1097 | 0x1, &val); | ||
1098 | val &= radeon_connector->router.mux_control_pin; | ||
1099 | val |= radeon_connector->router.mux_state; | ||
1100 | radeon_i2c_put_byte(radeon_connector->router_bus, | ||
1101 | radeon_connector->router.i2c_addr, | ||
1102 | 0x1, val); | ||
1103 | } | ||
1104 | |||