From patchwork Fri Mar 22 14:13:37 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Heiko Stuebner X-Patchwork-Id: 2320441 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id C4879400E6 for ; Fri, 22 Mar 2013 14:13:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754447Ab3CVONl (ORCPT ); Fri, 22 Mar 2013 10:13:41 -0400 Received: from gloria.sntech.de ([95.129.55.99]:40314 "EHLO gloria.sntech.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753962Ab3CVONk (ORCPT ); Fri, 22 Mar 2013 10:13:40 -0400 Received: from 146-52-57-5-dynip.superkabel.de ([146.52.57.5] helo=marty.localnet) by gloria.sntech.de with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from ) id 1UJ2ix-00080L-H4; Fri, 22 Mar 2013 15:13:39 +0100 From: Heiko =?utf-8?q?St=C3=BCbner?= To: Florian Tobias Schandinat Subject: [PATCH 2/9] AUO-K190x: add runtime-pm calls to controller init functions Date: Fri, 22 Mar 2013 15:13:37 +0100 User-Agent: KMail/1.13.7 (Linux/3.2.0-3-686-pae; KDE/4.8.4; i686; ; ) Cc: Tomi Valkeinen , "linux-fbdev" References: <201303221512.28604.heiko@sntech.de> In-Reply-To: <201303221512.28604.heiko@sntech.de> MIME-Version: 1.0 Message-Id: <201303221513.38091.heiko@sntech.de> Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org 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 --- drivers/video/auo_k1900fb.c | 6 ++++++ drivers/video/auo_k1901fb.c | 6 ++++++ 2 files changed, 12 insertions(+), 0 deletions(-) diff --git a/drivers/video/auo_k1900fb.c b/drivers/video/auo_k1900fb.c index b02fab5d..8cf4847 100644 --- a/drivers/video/auo_k1900fb.c +++ b/drivers/video/auo_k1900fb.c @@ -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; @@ -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, diff --git a/drivers/video/auo_k1901fb.c b/drivers/video/auo_k1901fb.c index ece99b8..98aa222 100644 --- a/drivers/video/auo_k1901fb.c +++ b/drivers/video/auo_k1901fb.c @@ -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); @@ -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,