diff options
author | Jean Delvare <khali@linux-fr.org> | 2007-11-28 19:21:35 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-11-29 12:24:52 -0500 |
commit | b64d70825abbf706bbe80be1b11b09514b71f45e (patch) | |
tree | 2e44dc590b4cbfb198294c85fe59a5023083bfb6 /drivers/video | |
parent | e482179d547ff250cab487859b6fc91995bbdbb5 (diff) |
fb_ddc: fix DDC lines quirk
The code in fb_ddc_read() is said to be based on the implementation of the
radeon driver:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=fc5891c8a3ba284f13994d7bc1f1bfa8283982de
However, comparing the old radeon driver code with the new fb_ddc code
reveals some differences. Most notably, the I2C bus lines are held at the
end of the function, while the original code was releasing them (as the
comment above correctly says.)
There are a few other differences, which appear to be responsible for read
failures on my system. While tracing low-level I2C code in i2c-algo-bit, I
noticed that the initial attempt to read the EDID always failed. It takes
one retry for the read to succeed. As we are about to remove this
automatic retry property from i2c-algo-bit, reading the EDID would really
fail.
As a summary, the I2C lines quirk which is supposedly needed to read EDID
on some older monitors is currently breaking the (first) read on all other
monitors (and might not even work with older ones - did anyone try since
October 2006?)
After applying the patch below, which makes the code in fb_ddc_read()
really similar to what the radeon driver used to have, the first EDID read
succeeds again.
On top of that, as it appears that this code has been broken for one year
now and nobody seems to have complained, I'm curious if it makes sense to
keep this quirk in place. It makes the code more complex and slower just
for the sake of monitors which I guess nobody uses anymore. Can't we just
get rid of it?
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Tested-by: Roger Leigh <rleigh@whinlatter.ukfsn.org>
Tested-by: Michael Buesch <mb@bu3sch.de>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/fb_ddc.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/video/fb_ddc.c b/drivers/video/fb_ddc.c index f836137a0eda..a0df63289b5f 100644 --- a/drivers/video/fb_ddc.c +++ b/drivers/video/fb_ddc.c | |||
@@ -56,13 +56,12 @@ unsigned char *fb_ddc_read(struct i2c_adapter *adapter) | |||
56 | int i, j; | 56 | int i, j; |
57 | 57 | ||
58 | algo_data->setscl(algo_data->data, 1); | 58 | algo_data->setscl(algo_data->data, 1); |
59 | algo_data->setscl(algo_data->data, 0); | ||
60 | 59 | ||
61 | for (i = 0; i < 3; i++) { | 60 | for (i = 0; i < 3; i++) { |
62 | /* For some old monitors we need the | 61 | /* For some old monitors we need the |
63 | * following process to initialize/stop DDC | 62 | * following process to initialize/stop DDC |
64 | */ | 63 | */ |
65 | algo_data->setsda(algo_data->data, 0); | 64 | algo_data->setsda(algo_data->data, 1); |
66 | msleep(13); | 65 | msleep(13); |
67 | 66 | ||
68 | algo_data->setscl(algo_data->data, 1); | 67 | algo_data->setscl(algo_data->data, 1); |
@@ -97,14 +96,15 @@ unsigned char *fb_ddc_read(struct i2c_adapter *adapter) | |||
97 | algo_data->setsda(algo_data->data, 1); | 96 | algo_data->setsda(algo_data->data, 1); |
98 | msleep(15); | 97 | msleep(15); |
99 | algo_data->setscl(algo_data->data, 0); | 98 | algo_data->setscl(algo_data->data, 0); |
99 | algo_data->setsda(algo_data->data, 0); | ||
100 | if (edid) | 100 | if (edid) |
101 | break; | 101 | break; |
102 | } | 102 | } |
103 | /* Release the DDC lines when done or the Apple Cinema HD display | 103 | /* Release the DDC lines when done or the Apple Cinema HD display |
104 | * will switch off | 104 | * will switch off |
105 | */ | 105 | */ |
106 | algo_data->setsda(algo_data->data, 0); | 106 | algo_data->setsda(algo_data->data, 1); |
107 | algo_data->setscl(algo_data->data, 0); | 107 | algo_data->setscl(algo_data->data, 1); |
108 | 108 | ||
109 | return edid; | 109 | return edid; |
110 | } | 110 | } |