Skip to content

Commit

Permalink
AUO-K190x: add runtime-pm calls to controller init functions
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Heiko Stübner authored and Tomi Valkeinen committed Apr 4, 2013
1 parent a165510 commit 70f1e28
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/video/auo_k1900fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,12 @@

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;
Expand All @@ -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,
Expand Down
6 changes: 6 additions & 0 deletions drivers/video/auo_k1901fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,12 @@

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);
Expand All @@ -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,
Expand Down

0 comments on commit 70f1e28

Please sign in to comment.