From patchwork Fri Dec 20 22:23:22 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sylwester Nawrocki X-Patchwork-Id: 3392111 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 B704FC0D4A for ; Fri, 20 Dec 2013 22:24:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B39A3206B1 for ; Fri, 20 Dec 2013 22:24:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DD2C020647 for ; Fri, 20 Dec 2013 22:24:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752692Ab3LTWYS (ORCPT ); Fri, 20 Dec 2013 17:24:18 -0500 Received: from mail-we0-f176.google.com ([74.125.82.176]:39629 "EHLO mail-we0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751797Ab3LTWYR (ORCPT ); Fri, 20 Dec 2013 17:24:17 -0500 Received: by mail-we0-f176.google.com with SMTP id p61so3022119wes.7 for ; Fri, 20 Dec 2013 14:24:16 -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=BSVVJ1G9RlqOyFztwcJCpqBUmFWJeVc7eYesT2/u6r8=; b=a3eiCN/+FXWx07jRzu3e7RGkQOlP73J2ApjKzcnW7dM6zXKpb66/DKZbiBXSQG2RbR ex3mjZoU9vEPav2pU15ZAU730YHA48/nGikvi8lgWkDwzmXh6fKfH/32pEmX6mOq+xN3 fYYXxw+c3MU+izq3SvoizU37znHwopEFtV39lMsN+P8BT5V0Q8OlEd+FxVDOQ/R1NLZo WlRfRTO2U0Q+H6QT6w6wSfGasDcag/nOkHqcd2o3XOlcjdmoNogOUSLIDIIPhI8j8vwk blzvNg8RV5N5BMthAToRpXqrKu941Amo8QO8DPBZXLbZ221x6VynWM+wqo/5+On63o9m l81Q== X-Received: by 10.180.206.41 with SMTP id ll9mr9357676wic.7.1387578256435; Fri, 20 Dec 2013 14:24:16 -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.14 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 20 Dec 2013 14:24:15 -0800 (PST) From: Sylwester Nawrocki To: linux-media@vger.kernel.org Cc: linux-samsung-soc@vger.kernel.org, Sylwester Nawrocki Subject: [PATCH 1/6] exynos4-is: Leave FIMC clocks enabled when runtime PM is disabled Date: Fri, 20 Dec 2013 23:23:22 +0100 Message-Id: <1387578207-17625-2-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 Driver should ensure a device can be also used normally when runtime PM is disabled. So enable the FIMC clock in probe() in such situation. Signed-off-by: Sylwester Nawrocki --- drivers/media/platform/exynos4-is/fimc-core.c | 29 +++++++++++++----------- 1 files changed, 16 insertions(+), 13 deletions(-) diff --git a/drivers/media/platform/exynos4-is/fimc-core.c b/drivers/media/platform/exynos4-is/fimc-core.c index f791569..a7dfd07 100644 --- a/drivers/media/platform/exynos4-is/fimc-core.c +++ b/drivers/media/platform/exynos4-is/fimc-core.c @@ -998,36 +998,39 @@ static int fimc_probe(struct platform_device *pdev) ret = devm_request_irq(dev, res->start, fimc_irq_handler, 0, dev_name(dev), fimc); - if (ret) { + if (ret < 0) { dev_err(dev, "failed to install irq (%d)\n", ret); - goto err_clk; + goto err_sclk; } ret = fimc_initialize_capture_subdev(fimc); - if (ret) - goto err_clk; + if (ret < 0) + goto err_sclk; 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[CLK_GATE]); + if (ret < 0) + goto err_sd; + } + /* Initialize contiguous memory allocator */ 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_gclk; } dev_dbg(dev, "FIMC.%d registered successfully\n", fimc->id); - - pm_runtime_put(dev); return 0; -err_pm: - pm_runtime_put(dev); + +err_gclk: + clk_disable(fimc->clock[CLK_GATE]); err_sd: fimc_unregister_capture_subdev(fimc); -err_clk: +err_sclk: clk_disable(fimc->clock[CLK_BUS]); fimc_clk_put(fimc); return ret;