From patchwork Wed Nov 9 14:23:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 9419429 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 31D3D601C2 for ; Wed, 9 Nov 2016 14:24:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 25E1029350 for ; Wed, 9 Nov 2016 14:24:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1AA7A29352; Wed, 9 Nov 2016 14:24:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AC80729353 for ; Wed, 9 Nov 2016 14:24:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754103AbcKIOYQ (ORCPT ); Wed, 9 Nov 2016 09:24:16 -0500 Received: from mailout2.w1.samsung.com ([210.118.77.12]:10732 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753358AbcKIOYN (ORCPT ); Wed, 9 Nov 2016 09:24:13 -0500 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OGD0011PPC9B850@mailout2.w1.samsung.com>; Wed, 09 Nov 2016 14:24:09 +0000 (GMT) Received: from eusmges4.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20161109142408eucas1p28418eb029b25cb403c3f6db319e32198~FZyIdTmMX2944929449eucas1p2e; Wed, 9 Nov 2016 14:24:08 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges4.samsung.com (EUCPMTA) with SMTP id EC.31.28332.88133285; Wed, 9 Nov 2016 14:24:08 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20161109142408eucas1p1401c6b61321b52ea341a28ad063f4653~FZyHyPW4y1372713727eucas1p1s; Wed, 9 Nov 2016 14:24:08 +0000 (GMT) X-AuditID: cbfec7f4-f791c6d000006eac-e4-582331885b5b Received: from eusync2.samsung.com ( [203.254.199.212]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 93.AE.07726.88133285; Wed, 9 Nov 2016 14:24:08 +0000 (GMT) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OGD009LGPC36HB0@eusync2.samsung.com>; Wed, 09 Nov 2016 14:24:08 +0000 (GMT) From: Marek Szyprowski To: linux-media@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Sylwester Nawrocki , Krzysztof Kozlowski , Ulf Hansson , Bartlomiej Zolnierkiewicz , Javier Martinez Canillas Subject: [PATCH 03/12] exynos-gsc: Make driver functional when CONFIG_PM is unset Date: Wed, 09 Nov 2016 15:23:52 +0100 Message-id: <1478701441-29107-4-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1478701441-29107-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrLIsWRmVeSWpSXmKPExsWy7djPc7odhsoRBtu+q1psnLGe1eLN2zVM FufPb2C36NmwldVixvl9TBZrj9xltzj8pp3V4vjacAcOj02rOtk87lzb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CUe3n/OCOE0MUm8+zaVDaSKTcBQouttF5gtIuAksXDWX3aQImaBWUwSk/uWsIAkhAWC JW5u/whWxCKgKrGicxcriM0r4CGxtOkME8Q6OYmTxyaDxTkFPCVWHbkJZgsB1WxdPotxAiPv AkaGVYwiqaXFuem5xYZ6xYm5xaV56XrJ+bmbGIFhve3Yz807GC9tDD7EKMDBqMTD26GpHCHE mlhWXJl7iFGCg1lJhHemAVCINyWxsiq1KD++qDQntfgQoynQUROZpUST84Exl1cSb2hiaG5p aGRsYWFuZKQkzlvy4Uq4kEB6YklqdmpqQWoRTB8TB6dUA6OZ5HpNlm3Gv4+KCBaEKbSWa00/ OaXoyenPnSb6kgrVB97GFy05dOK+mmnv7a9zGuTMVt03sqs6o81xcvMM59wDdu+uTBe9PV3h C/filYZmcc/DQ109HXQ6dF4kSpVdEI3LbxJXEVKUvCVdy6l87+x5H8ZS5UzbJI2WWT7/mSa+ veSzdDKzthJLcUaioRZzUXEiAPh01++BAgAA X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20161109142408eucas1p1401c6b61321b52ea341a28ad063f4653 X-Msg-Generator: CA X-Sender-IP: 182.198.249.179 X-Local-Sender: =?UTF-8?B?TWFyZWsgU3p5cHJvd3NraRtTUlBPTC1LZXJuZWwgKFRQKRs=?= =?UTF-8?B?7IK87ISx7KCE7J6QG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Global-Sender: =?UTF-8?B?TWFyZWsgU3p5cHJvd3NraRtTUlBPTC1LZXJuZWwgKFRQKRtT?= =?UTF-8?B?YW1zdW5nIEVsZWN0cm9uaWNzG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Sender-Code: =?UTF-8?B?QzEwG0VIURtDMTBDRDAyQ0QwMjczOTI=?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20161109142408eucas1p1401c6b61321b52ea341a28ad063f4653 X-RootMTR: 20161109142408eucas1p1401c6b61321b52ea341a28ad063f4653 References: <1478701441-29107-1-git-send-email-m.szyprowski@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Ulf Hansson 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 [mszyprow: rebased onto v4.9-rc4] Signed-off-by: Marek Szyprowski --- drivers/media/platform/exynos-gsc/gsc-core.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/drivers/media/platform/exynos-gsc/gsc-core.c b/drivers/media/platform/exynos-gsc/gsc-core.c index cb4e8bd..b5a99af 100644 --- a/drivers/media/platform/exynos-gsc/gsc-core.c +++ b/drivers/media/platform/exynos-gsc/gsc-core.c @@ -1072,7 +1072,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); @@ -1095,24 +1095,23 @@ 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); vb2_dma_contig_set_max_seg_size(dev, DMA_BIT_MASK(32)); 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_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; }