From patchwork Mon Jan 19 13:22:35 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 5658841 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 5AF4BC058D for ; Mon, 19 Jan 2015 13:30:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 81EBC20389 for ; Mon, 19 Jan 2015 13:30:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id ABAA720394 for ; Mon, 19 Jan 2015 13:30:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751852AbbASNaN (ORCPT ); Mon, 19 Jan 2015 08:30:13 -0500 Received: from mail-la0-f54.google.com ([209.85.215.54]:59007 "EHLO mail-la0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751645AbbASNaM (ORCPT ); Mon, 19 Jan 2015 08:30:12 -0500 Received: by mail-la0-f54.google.com with SMTP id pv20so28838895lab.13 for ; Mon, 19 Jan 2015 05:30:11 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=nECWMEwRjSDdjSpsM5qW+G9P98oanqJS4kIATsi+Xh4=; b=h6YfWcLxbJZQTfTpXEf1Bc8eqLvK/BDtXstuHMrRrSM6m8E+I6H3XuPqHXPK1IcKWf oLt3dPiv6F6hT/sTjs/ux+P5r/PQHK7POjW0hSQmvEDrFlJPJXvgKibA8PW7LYF/N2nJ HvrHwKsNe5szLUZykbrT/bpYc7SvkhuJXvWKDDCNmLBfjLo4sOs1XQ7JXEIOXQl/yYWI T842Lt94lERsPCevPzmFGpMs5mM6oCEKgWvBylPo8XS16mbVvLQGBEzTLyiGyHPxtzjY 59raMOR4QV1X/IztIKBEdRv0JFXDx/Q/98exhXNzt4tbEwUCEsfyPtlCIcurvRvnm+xg vzxg== X-Gm-Message-State: ALoCoQnAOLsA8wZlYWFfZmAq0Q3MwBU5r5mQ9r2Iv6ZF1oY0TSxoNy8CtxbhfampPkNxKyVNJPCV X-Received: by 10.112.162.4 with SMTP id xw4mr30411051lbb.89.1421673780050; Mon, 19 Jan 2015 05:23:00 -0800 (PST) Received: from localhost.localdomain ([85.235.11.236]) by mx.google.com with ESMTPSA id v4sm3080344lbz.12.2015.01.19.05.22.57 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 19 Jan 2015 05:22:58 -0800 (PST) From: Ulf Hansson To: Mauro Carvalho Chehab , linux-media@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, Kukjin Kim , Sylwester Nawrocki , Kyungmin Park , Ulf Hansson Subject: [PATCH V2 3/8] [media] exynos-gsc: Make driver functional when CONFIG_PM is unset Date: Mon, 19 Jan 2015 14:22:35 +0100 Message-Id: <1421673760-2600-4-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1421673760-2600-1-git-send-email-ulf.hansson@linaro.org> References: <1421673760-2600-1-git-send-email-ulf.hansson@linaro.org> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, 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 The driver depended on CONFIG_PM to be functional. Let's remove that dependency, by enable the runtime PM resourses during ->probe() and update the device's runtime PM status to reflect this. Signed-off-by: Ulf Hansson --- drivers/media/platform/exynos-gsc/gsc-core.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/drivers/media/platform/exynos-gsc/gsc-core.c b/drivers/media/platform/exynos-gsc/gsc-core.c index 1865738..532daa8 100644 --- a/drivers/media/platform/exynos-gsc/gsc-core.c +++ b/drivers/media/platform/exynos-gsc/gsc-core.c @@ -1088,7 +1088,7 @@ static int gsc_probe(struct platform_device *pdev) return PTR_ERR(gsc->clock); } - ret = clk_prepare(gsc->clock); + ret = clk_prepare_enable(gsc->clock); if (ret) { dev_err(&gsc->pdev->dev, "clock prepare failed for clock: %s\n", GSC_CLOCK_GATE_NAME); @@ -1111,30 +1111,29 @@ static int gsc_probe(struct platform_device *pdev) goto err_v4l2; platform_set_drvdata(pdev, gsc); - pm_runtime_enable(dev); - ret = pm_runtime_get_sync(&pdev->dev); - if (ret < 0) - goto err_m2m; + + gsc_hw_set_sw_reset(gsc); + gsc_wait_reset(gsc); /* Initialize continious memory allocator */ gsc->alloc_ctx = vb2_dma_contig_init_ctx(dev); if (IS_ERR(gsc->alloc_ctx)) { ret = PTR_ERR(gsc->alloc_ctx); - goto err_pm; + goto err_m2m; } dev_dbg(dev, "gsc-%d registered successfully\n", gsc->id); - pm_runtime_put(dev); + pm_runtime_set_active(dev); + pm_runtime_enable(dev); + return 0; -err_pm: - pm_runtime_put(dev); err_m2m: gsc_unregister_m2m_device(gsc); err_v4l2: v4l2_device_unregister(&gsc->v4l2_dev); err_clk: - clk_unprepare(gsc->clock); + clk_disable_unprepare(gsc->clock); return ret; }