AUO-K190x: add runtime-pm calls to controller init functions
authorHeiko Stübner <heiko@sntech.de>
Fri, 22 Mar 2013 14:13:37 +0000 (15:13 +0100)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Thu, 4 Apr 2013 10:08:06 +0000 (13:08 +0300)
The controller init may be called from a context where the device
is runtime suspended, leading to a deadlock, as the controllers only
accepts the wakeup command when suspended.

Signed-off-by: Heiko Stübner <heiko@sntech.de>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
drivers/video/auo_k1900fb.c
drivers/video/auo_k1901fb.c

index d572d3e9c502076487568aa5a30c04b73a5d7d51..f5b668e77af32e8b4c7306f64032938da453dd33 100644 (file)
 
 static void auok1900_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 |= AUOK1900_INIT_TEMP_AVERAGE;
        init_param |= AUOK1900_INIT_ROTATE(par->rotation);
        init_param |= AUOK190X_INIT_INVERSE_WHITE;
@@ -74,6 +77,9 @@ static void auok1900_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 auok1900_update_region(struct auok190xfb_par *par, int mode,
index 9efbe2763447317904961fc56dd6b63c695c5ea2..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,