backlight: Fix tdo24m crash on kmalloc
[pandora-kernel.git] / drivers / video / fb_ddc.c
index f836137..0cf96eb 100644 (file)
@@ -56,13 +56,12 @@ unsigned char *fb_ddc_read(struct i2c_adapter *adapter)
        int i, j;
 
        algo_data->setscl(algo_data->data, 1);
-       algo_data->setscl(algo_data->data, 0);
 
        for (i = 0; i < 3; i++) {
                /* For some old monitors we need the
                 * following process to initialize/stop DDC
                 */
-               algo_data->setsda(algo_data->data, 0);
+               algo_data->setsda(algo_data->data, 1);
                msleep(13);
 
                algo_data->setscl(algo_data->data, 1);
@@ -97,15 +96,17 @@ unsigned char *fb_ddc_read(struct i2c_adapter *adapter)
                algo_data->setsda(algo_data->data, 1);
                msleep(15);
                algo_data->setscl(algo_data->data, 0);
+               algo_data->setsda(algo_data->data, 0);
                if (edid)
                        break;
        }
        /* Release the DDC lines when done or the Apple Cinema HD display
         * will switch off
         */
-       algo_data->setsda(algo_data->data, 0);
-       algo_data->setscl(algo_data->data, 0);
+       algo_data->setsda(algo_data->data, 1);
+       algo_data->setscl(algo_data->data, 1);
 
+       adapter->class |= I2C_CLASS_DDC;
        return edid;
 }