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: 5658821 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.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 78F7DC058D for ; Mon, 19 Jan 2015 13:30:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2C1D82038F for ; Mon, 19 Jan 2015 13:30:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4379F20386 for ; Mon, 19 Jan 2015 13:30:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751781AbbASNaD (ORCPT ); Mon, 19 Jan 2015 08:30:03 -0500 Received: from mail-la0-f42.google.com ([209.85.215.42]:52021 "EHLO mail-la0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751642AbbASNaC (ORCPT ); Mon, 19 Jan 2015 08:30:02 -0500 Received: by mail-la0-f42.google.com with SMTP id ms9so6552511lab.1 for ; Mon, 19 Jan 2015 05:30:01 -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=dH0l6b0qwnHxHnwF2N0INfitfa/zRrREO7kH3kFrEFHju6q5eHZYtN3o0bJrBvDQng Ve2K4s501oDePeFHfNjUMyMwVoOybJ3vOFWb4qa00ZFHyoJsPtfDk7lhcFunqc5zl39K 4PcP52fOeGDXcLcQMSWawDRT71/T8y5m7YJVcGl67lf/iSzWM3erXZE1BsP0PIGXx2A3 h1XuMFqcOe7rxJR6mVBm1gGsYS5XsGe2JJ/OEaRUaMc6WAu3+tMJgGNDH9TPSEHO/RCK pIO9mE7SNGLVJCJ3fp6iK1hKS3UmhCE+1aN1ZzdfEs1cWYMTv2xcrfv8uzB+2arJXy7w ADrg== X-Gm-Message-State: ALoCoQkqbTmP/Y7HpsdMho9r359x74VLGrvTj/BS0yBB8N6sVRxfV1dOqqOlu6KCNXIOEh8CPdJa 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-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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=unavailable 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; }