From patchwork Fri Dec 20 22:23:24 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sylwester Nawrocki X-Patchwork-Id: 3392141 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 12A41C0D4A for ; Fri, 20 Dec 2013 22:24:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 416C4206B1 for ; Fri, 20 Dec 2013 22:24:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 67DFB20647 for ; Fri, 20 Dec 2013 22:24:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753574Ab3LTWYV (ORCPT ); Fri, 20 Dec 2013 17:24:21 -0500 Received: from mail-wg0-f52.google.com ([74.125.82.52]:61162 "EHLO mail-wg0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751797Ab3LTWYU (ORCPT ); Fri, 20 Dec 2013 17:24:20 -0500 Received: by mail-wg0-f52.google.com with SMTP id x13so3080616wgg.7 for ; Fri, 20 Dec 2013 14:24:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=nnjYK1ZVfPhdWLENqcfFHYAII/6yk8ADLHG4edd4X8M=; b=b1Jp4iSP90ZqicNao85s5xof/9TOy1juni2pzo0NzL2d5jUOAVgYiMjYcOQksL5Ouf mcCtx6j0tSYOKvZfsVrrheKD1WCpuvWo14KxbecBLZ/gNH8f9MJg48uFH4UPm8xcFWGJ /1z3WsunC3mvK1mNenLKyL8wAK74G2DqcI5nB2VUweyVCnihqvdINpjZuflqbxcnnzWo FuzrToecjmyEM7KwRxr9bXit7nChEr/39aNzinBf0zBLpOL3oYOoeF9xs6rfpwwJdZwj 14mzLjDtZs+KGRiLtDY9sNVL6nPEqL51cg4j2wD7cHY2khlba+2OwS9E+uOfJv7qD/+9 DLAQ== X-Received: by 10.180.100.70 with SMTP id ew6mr9887054wib.9.1387578259464; Fri, 20 Dec 2013 14:24:19 -0800 (PST) Received: from localhost.localdomain (093105185086.warszawa.vectranet.pl. [93.105.185.86]) by mx.google.com with ESMTPSA id xl18sm19612162wib.9.2013.12.20.14.24.17 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 20 Dec 2013 14:24:18 -0800 (PST) From: Sylwester Nawrocki To: linux-media@vger.kernel.org Cc: linux-samsung-soc@vger.kernel.org, Sylwester Nawrocki Subject: [PATCH 3/6] exynos4-is: Enable FIMC-LITE clock if runtime PM is not used Date: Fri, 20 Dec 2013 23:23:24 +0100 Message-Id: <1387578207-17625-4-git-send-email-s.nawrocki@samsung.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1387578207-17625-1-git-send-email-s.nawrocki@samsung.com> References: <1387578207-17625-1-git-send-email-s.nawrocki@samsung.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Ensure the device also works when runtime PM is disabled. Signed-off-by: Sylwester Nawrocki --- drivers/media/platform/exynos4-is/fimc-lite.c | 24 +++++++++++++----------- 1 files changed, 13 insertions(+), 11 deletions(-) diff --git a/drivers/media/platform/exynos4-is/fimc-lite.c b/drivers/media/platform/exynos4-is/fimc-lite.c index d3b32b6..1234734 100644 --- a/drivers/media/platform/exynos4-is/fimc-lite.c +++ b/drivers/media/platform/exynos4-is/fimc-lite.c @@ -1549,38 +1549,40 @@ static int fimc_lite_probe(struct platform_device *pdev) 0, dev_name(dev), fimc); if (ret) { dev_err(dev, "Failed to install irq (%d)\n", ret); - goto err_clk; + goto err_clk_put; } /* The video node will be created within the subdev's registered() op */ ret = fimc_lite_create_capture_subdev(fimc); if (ret) - goto err_clk; + goto err_clk_put; platform_set_drvdata(pdev, fimc); pm_runtime_enable(dev); - ret = pm_runtime_get_sync(dev); - if (ret < 0) - goto err_sd; + + if (!pm_runtime_enabled(dev)) { + ret = clk_enable(fimc->clock); + if (ret < 0) + goto err_clk_put; + } fimc->alloc_ctx = vb2_dma_contig_init_ctx(dev); if (IS_ERR(fimc->alloc_ctx)) { ret = PTR_ERR(fimc->alloc_ctx); - goto err_pm; + goto err_clk_dis; } - pm_runtime_put(dev); - fimc_lite_set_default_config(fimc); dev_dbg(dev, "FIMC-LITE.%d registered successfully\n", fimc->index); return 0; -err_pm: - pm_runtime_put(dev); + +err_clk_dis: + clk_disable(fimc->clock); err_sd: fimc_lite_unregister_capture_subdev(fimc); -err_clk: +err_clk_put: fimc_lite_clk_put(fimc); return ret; }