Rev 2997 | Rev 5078 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2997 | Rev 3192 | ||
---|---|---|---|
Line 37... | Line 37... | ||
37 | 37 | ||
38 | /** |
38 | /** |
39 | * radeon_ddc_probe |
39 | * radeon_ddc_probe |
40 | * |
40 | * |
41 | */ |
41 | */ |
42 | bool radeon_ddc_probe(struct radeon_connector *radeon_connector) |
42 | bool radeon_ddc_probe(struct radeon_connector *radeon_connector, bool use_aux) |
43 | { |
43 | { |
44 | u8 out = 0x0; |
44 | u8 out = 0x0; |
45 | u8 buf[8]; |
45 | u8 buf[8]; |
46 | int ret; |
46 | int ret; |
Line 61... | Line 61... | ||
61 | 61 | ||
62 | /* on hw with routers, select right port */ |
62 | /* on hw with routers, select right port */ |
63 | if (radeon_connector->router.ddc_valid) |
63 | if (radeon_connector->router.ddc_valid) |
Line -... | Line 64... | ||
- | 64 | radeon_router_select_ddc_port(radeon_connector); |
|
- | 65 | ||
- | 66 | if (use_aux) { |
|
- | 67 | struct radeon_connector_atom_dig *dig = radeon_connector->con_priv; |
|
64 | radeon_router_select_ddc_port(radeon_connector); |
68 | ret = i2c_transfer(&dig->dp_i2c_bus->adapter, msgs, 2); |
- | 69 | } else { |
|
- | 70 | ret = i2c_transfer(&radeon_connector->ddc_bus->adapter, msgs, 2); |
|
65 | 71 | } |
|
66 | ret = i2c_transfer(&radeon_connector->ddc_bus->adapter, msgs, 2); |
72 | |
67 | if (ret != 2) |
73 | if (ret != 2) |
68 | /* Couldn't find an accessible DDC on this connector */ |
74 | /* Couldn't find an accessible DDC on this connector */ |
69 | return false; |
75 | return false; |
Line 920... | Line 926... | ||
920 | ((rdev->family >= CHIP_RV515) && (rdev->family <= CHIP_R580))))) { |
926 | ((rdev->family >= CHIP_RV515) && (rdev->family <= CHIP_R580))))) { |
921 | /* set the radeon hw i2c adapter */ |
927 | /* set the radeon hw i2c adapter */ |
922 | snprintf(i2c->adapter.name, sizeof(i2c->adapter.name), |
928 | snprintf(i2c->adapter.name, sizeof(i2c->adapter.name), |
923 | "Radeon i2c hw bus %s", name); |
929 | "Radeon i2c hw bus %s", name); |
924 | i2c->adapter.algo = &radeon_i2c_algo; |
930 | i2c->adapter.algo = &radeon_i2c_algo; |
925 | // ret = i2c_add_adapter(&i2c->adapter); |
931 | ret = i2c_add_adapter(&i2c->adapter); |
926 | // if (ret) { |
932 | if (ret) { |
927 | // DRM_ERROR("Failed to register hw i2c %s\n", name); |
933 | DRM_ERROR("Failed to register hw i2c %s\n", name); |
928 | // goto out_free; |
934 | goto out_free; |
929 | // } |
935 | } |
930 | } else if (rec->hw_capable && |
936 | } else if (rec->hw_capable && |
931 | radeon_hw_i2c && |
937 | radeon_hw_i2c && |
932 | ASIC_IS_DCE3(rdev)) { |
938 | ASIC_IS_DCE3(rdev)) { |
933 | /* hw i2c using atom */ |
939 | /* hw i2c using atom */ |
934 | snprintf(i2c->adapter.name, sizeof(i2c->adapter.name), |
940 | snprintf(i2c->adapter.name, sizeof(i2c->adapter.name), |
935 | "Radeon i2c hw bus %s", name); |
941 | "Radeon i2c hw bus %s", name); |
936 | i2c->adapter.algo = &radeon_atom_i2c_algo; |
942 | i2c->adapter.algo = &radeon_atom_i2c_algo; |
937 | // ret = i2c_add_adapter(&i2c->adapter); |
943 | ret = i2c_add_adapter(&i2c->adapter); |
938 | // if (ret) { |
944 | if (ret) { |
939 | // DRM_ERROR("Failed to register hw i2c %s\n", name); |
945 | DRM_ERROR("Failed to register hw i2c %s\n", name); |
940 | // goto out_free; |
946 | goto out_free; |
941 | // } |
947 | } |
942 | } else { |
948 | } else { |
943 | /* set the radeon bit adapter */ |
949 | /* set the radeon bit adapter */ |
944 | snprintf(i2c->adapter.name, sizeof(i2c->adapter.name), |
950 | snprintf(i2c->adapter.name, sizeof(i2c->adapter.name), |
945 | "Radeon i2c bit bus %s", name); |
951 | "Radeon i2c bit bus %s", name); |
946 | i2c->adapter.algo_data = &i2c->algo.bit; |
952 | i2c->adapter.algo_data = &i2c->algo.bit; |
Line 1003... | Line 1009... | ||
1003 | 1009 | ||
1004 | void radeon_i2c_destroy(struct radeon_i2c_chan *i2c) |
1010 | void radeon_i2c_destroy(struct radeon_i2c_chan *i2c) |
1005 | { |
1011 | { |
1006 | if (!i2c) |
1012 | if (!i2c) |
1007 | return; |
1013 | return; |
1008 | // i2c_del_adapter(&i2c->adapter); |
1014 | i2c_del_adapter(&i2c->adapter); |
1009 | kfree(i2c); |
1015 | kfree(i2c); |
Line 1010... | Line 1016... | ||
1010 | } |
1016 | } |
1011 | 1017 |