From patchwork Mon Aug 10 15:32:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Sylwester Nawrocki/Kernel \\(PLT\\) /SRPOL/Staff Engineer/Samsung Electronics" X-Patchwork-Id: 11707575 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B8FE6618 for ; Mon, 10 Aug 2020 15:33:20 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 925BA207FF for ; Mon, 10 Aug 2020 15:33:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Lafnc0Jt"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="uI5x7w77" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 925BA207FF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=samsung.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:References:In-Reply-To:Message-Id:Date:Subject:To: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=RSgGogwZAHooywwl1FZlQxtaoWX/CpNlxZtfkEP77bA=; b=Lafnc0JtHKKhfp3WDt9KenihoR Cdnt0akLkpp4HV2/KNo2yG62VvsqIDhLeP6LcDxzIVK6iiYk1xW2HrucX6hdjVWMrpSkdkT7oHLlg jkVPamAJNO1LRMlrrxBJWukqPIcSX1g21qLV0YO9N7NFiEbLi68KB95Qzzse3YUKke1Usyh89V0BT o99gXlV8IaeiIJicsg/L3IqwHhZvZ9YkQUhaZ+vgLNU3qKXZs5YaBXkud9oi7mXGTWRJHXfaUrTYn Xx7KneAAQF4Q5wvYTYLHzHz9zZ42aKszcOn0QtEvWCh8+8ydZNKas775gnYaCZvDiHRbFJ/trvG5Q MMz6gnTQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k59nS-00053N-Dh; Mon, 10 Aug 2020 15:33:10 +0000 Received: from mailout2.w1.samsung.com ([210.118.77.12]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1k59nO-00052o-VB for linux-arm-kernel@lists.infradead.org; Mon, 10 Aug 2020 15:33:08 +0000 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20200810153306euoutp028ef64d0b0fa51108fc76212a84fe50b4~p8fcDx0VA1821618216euoutp02i for ; Mon, 10 Aug 2020 15:33:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200810153306euoutp028ef64d0b0fa51108fc76212a84fe50b4~p8fcDx0VA1821618216euoutp02i DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1597073586; bh=dcuOjA1HpR3QZxk+5y9E1beTjB3I0OMJo34ZTTvNx74=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uI5x7w77V0hlEiLCla0KH1IQoSmGmbYuC4fAz6ZsFgnyW3sXx7rQHIh86xOB47Mf3 dJ9pJLsqpk0VKDRxhOatLItyzEvIwsl+NTgbPhzHnlmyZy6N0trosS6fA7spQ/Sjhq kFz6YvU4cXA8hDKvZCp3t0XpezLKcZmnAR4dMK2Q= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20200810153305eucas1p273be5417e848f874295c32d64362b8f4~p8fb4tnVd0872108721eucas1p28; Mon, 10 Aug 2020 15:33:05 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 78.FE.06318.1B8613F5; Mon, 10 Aug 2020 16:33:05 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20200810153305eucas1p2246d0e265d6548789cd24557fcd0d6f4~p8fbj793P0868908689eucas1p2E; Mon, 10 Aug 2020 15:33:05 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200810153305eusmtrp25510ee1efc4bf1ed22997012ea49e917~p8fbjYGyE0085100851eusmtrp2Z; Mon, 10 Aug 2020 15:33:05 +0000 (GMT) X-AuditID: cbfec7f5-38bff700000018ae-bd-5f3168b10773 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id BE.C2.06314.1B8613F5; Mon, 10 Aug 2020 16:33:05 +0100 (BST) Received: from AMDC3061.digital.local (unknown [106.120.51.75]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20200810153305eusmtip2ae761a2d74747ddc4303c2fdffbfb64e~p8fbIb6WA2897228972eusmtip2O; Mon, 10 Aug 2020 15:33:05 +0000 (GMT) From: Sylwester Nawrocki To: linux-media@vger.kernel.org Subject: [PATCH 2/2] media: exynos4-is: Simplify the pinctrl code Date: Mon, 10 Aug 2020 17:32:40 +0200 Message-Id: <20200810153240.23827-2-s.nawrocki@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200810153240.23827-1-s.nawrocki@samsung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32PT4GqvF5V1z2Cx6NmxltZhxfh+Txdojd9ktDr9pZ3Xg9Ng56y67x6ZVnWwem5fU e/RtWcXo8XmTXABrlJ5NUX5pSapCRn5xia1StKGFkZ6hpYWekYmlnqGxeayVkamSvp1NSmpO Zllqkb5dgl7Gya/fWQuWylfMeDCXpYFxmlQXIyeHhICJxKRPO5i7GLk4hASWMko0PJ7M1MXI AZSQkpjfogRRIyzx51oXG0TNJ0aJg3PWsYMk2AQMJXqP9jGC2CIC8hJPem+AFTEL/GeU2Djz BjNIQljAUeL2qkssIDaLgKrErJ032UBsXgFriTNXDzBCbJCXWL3hADPIYk4BG4nFl/lBTCGg kvvb/SYw8i1gZFjFKJJaWpybnltsqFecmFtcmpeul5yfu4kRGMLbjv3cvIPx0sbgQ4wCHIxK PLwF1obxQqyJZcWVuYcYJTiYlUR4nc6ejhPiTUmsrEotyo8vKs1JLT7EaAp00kRmKdHkfGB8 5ZXEG5oamltYGpobmxubWSiJ83YIHIwREkhPLEnNTk0tSC2C6WPi4JRqYOyP3G3Uvt1119Yq BeUApj9Fu8JCkzl81stN4udnFFi+6c6Vj7xth1q/dF18Jvi+657Xtr8vq/PDSs0yD8RF/C6x 710qtrVyx18vw93v31ivy57a9Xndy59fLh1oUqrgveBxXs25RmarwxfDDQGzXl8znX3RLTVs mpGzT9ndhI/tsiHrWA6X8yixFGckGmoxFxUnAgCVk/EUdwIAAA== X-CMS-MailID: 20200810153305eucas1p2246d0e265d6548789cd24557fcd0d6f4 X-Msg-Generator: CA X-RootMTR: 20200810153305eucas1p2246d0e265d6548789cd24557fcd0d6f4 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200810153305eucas1p2246d0e265d6548789cd24557fcd0d6f4 References: <20200810153240.23827-1-s.nawrocki@samsung.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200810_113307_144957_E4B60F6E X-CRM114-Status: GOOD ( 23.11 ) X-Spam-Score: -5.2 (-----) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-5.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [210.118.77.12 listed in wl.mailspike.net] -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at https://www.dnswl.org/, high trust [210.118.77.12 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders -0.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-samsung-soc@vger.kernel.org, b.zolnierkie@samsung.com, hslester96@gmail.com, linux-kernel@vger.kernel.org, krzk@kernel.org, Sylwester Nawrocki , linux-arm-kernel@lists.infradead.org, m.szyprowski@samsung.com MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org There is no need to request the "idle" pinctrl state in the driver as that is implemented in the driver core and the pinctrl_pm_* API can be used for switching between the default and the idle state. Simplify the pinctrl code to only request and check for the mandatory "default" pinctrl state. Switching between the default/idle pinctrl state is not yet implemented in the driver and this patch doesn't change that. Signed-off-by: Sylwester Nawrocki --- drivers/media/platform/exynos4-is/media-dev.c | 27 +++++---------------------- drivers/media/platform/exynos4-is/media-dev.h | 11 ----------- 2 files changed, 5 insertions(+), 33 deletions(-) diff --git a/drivers/media/platform/exynos4-is/media-dev.c b/drivers/media/platform/exynos4-is/media-dev.c index 9a57523..6df2796 100644 --- a/drivers/media/platform/exynos4-is/media-dev.c +++ b/drivers/media/platform/exynos4-is/media-dev.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -1254,26 +1255,6 @@ static ssize_t fimc_md_sysfs_store(struct device *dev, static DEVICE_ATTR(subdev_conf_mode, S_IWUSR | S_IRUGO, fimc_md_sysfs_show, fimc_md_sysfs_store); -static int fimc_md_get_pinctrl(struct fimc_md *fmd) -{ - struct device *dev = &fmd->pdev->dev; - struct fimc_pinctrl *pctl = &fmd->pinctl; - - pctl->pinctrl = devm_pinctrl_get(dev); - if (IS_ERR(pctl->pinctrl)) - return PTR_ERR(pctl->pinctrl); - - pctl->state_default = pinctrl_lookup_state(pctl->pinctrl, - PINCTRL_STATE_DEFAULT); - if (IS_ERR(pctl->state_default)) - return PTR_ERR(pctl->state_default); - - /* PINCTRL_STATE_IDLE is optional */ - pctl->state_idle = pinctrl_lookup_state(pctl->pinctrl, - PINCTRL_STATE_IDLE); - return 0; -} - static int cam_clk_prepare(struct clk_hw *hw) { struct cam_clk *camclk = to_cam_clk(hw); @@ -1429,6 +1410,7 @@ static int fimc_md_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct v4l2_device *v4l2_dev; + struct pinctrl *pinctrl; struct fimc_md *fmd; int ret; @@ -1465,8 +1447,9 @@ static int fimc_md_probe(struct platform_device *pdev) if (ret) goto err_v4l2dev; - ret = fimc_md_get_pinctrl(fmd); - if (ret < 0) { + pinctrl = devm_pinctrl_get(dev); + if (IS_ERR(pinctrl)) { + ret = PTR_ERR(pinctrl); if (ret != EPROBE_DEFER) dev_err(dev, "Failed to get pinctrl: %d\n", ret); goto err_clk; diff --git a/drivers/media/platform/exynos4-is/media-dev.h b/drivers/media/platform/exynos4-is/media-dev.h index 4b8f9ac..9447faf 100644 --- a/drivers/media/platform/exynos4-is/media-dev.h +++ b/drivers/media/platform/exynos4-is/media-dev.h @@ -27,8 +27,6 @@ #define FIMC_IS_OF_NODE_NAME "fimc-is" #define CSIS_OF_NODE_NAME "csis" -#define PINCTRL_STATE_IDLE "idle" - #define FIMC_MAX_SENSORS 4 #define FIMC_MAX_CAMCLKS 2 #define DEFAULT_SENSOR_CLK_FREQ 24000000U @@ -109,9 +107,6 @@ struct cam_clk { * @media_dev: top level media device * @v4l2_dev: top level v4l2_device holding up the subdevs * @pdev: platform device this media device is hooked up into - * @pinctrl: camera port pinctrl handle - * @state_default: pinctrl default state handle - * @state_idle: pinctrl idle state handle * @cam_clk_provider: CAMCLK clock provider structure * @user_subdev_api: true if subdevs are not configured by the host driver * @slock: spinlock protecting @sensor array @@ -131,12 +126,6 @@ struct fimc_md { struct v4l2_device v4l2_dev; struct platform_device *pdev; - struct fimc_pinctrl { - struct pinctrl *pinctrl; - struct pinctrl_state *state_default; - struct pinctrl_state *state_idle; - } pinctl; - struct cam_clk_provider { struct clk *clks[FIMC_MAX_CAMCLKS]; struct clk_onecell_data clk_data;