Merge tag 'v3.10.87' into update
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / drivers / video / auo_k1901fb.c
index d1db1653cd88546bb0855786093c367ad3887c37..12b9adcb75c54757155509ed2734ced2a6218c00 100644 (file)
 
 static void auok1901_init(struct auok190xfb_par *par)
 {
+       struct device *dev = par->info->device;
        struct auok190x_board *board = par->board;
        u16 init_param = 0;
 
+       pm_runtime_get_sync(dev);
+
        init_param |= AUOK190X_INIT_INVERSE_WHITE;
        init_param |= AUOK190X_INIT_FORMAT0;
        init_param |= AUOK1901_INIT_RESOLUTION(par->resolution);
@@ -113,6 +116,9 @@ static void auok1901_init(struct auok190xfb_par *par)
 
        /* let the controller finish */
        board->wait_for_rdy(par);
+
+       pm_runtime_mark_last_busy(dev);
+       pm_runtime_put_autosuspend(dev);
 }
 
 static void auok1901_update_region(struct auok190xfb_par *par, int mode,
@@ -121,6 +127,7 @@ static void auok1901_update_region(struct auok190xfb_par *par, int mode,
        struct device *dev = par->info->device;
        unsigned char *buf = (unsigned char *)par->info->screen_base;
        int xres = par->info->var.xres;
+       int line_length = par->info->fix.line_length;
        u16 args[5];
 
        pm_runtime_get_sync(dev);
@@ -139,9 +146,9 @@ static void auok1901_update_region(struct auok190xfb_par *par, int mode,
        args[1] = y1 + 1;
        args[2] = xres;
        args[3] = y2 - y1;
-       buf += y1 * xres;
+       buf += y1 * line_length;
        auok190x_send_cmdargs_pixels_nowait(par, AUOK1901_CMD_DMA_START, 4,
-                                           args, ((y2 - y1) * xres)/2,
+                                           args, ((y2 - y1) * line_length)/2,
                                            (u16 *) buf);
        auok190x_send_command_nowait(par, AUOK190X_CMD_DATA_STOP);