From patchwork Fri Feb 1 19:09:27 2013 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: 2082451 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id EF0ECDFE75 for ; Fri, 1 Feb 2013 19:13:25 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1U1M0n-00016m-Te; Fri, 01 Feb 2013 19:10:58 +0000 Received: from mailout3.samsung.com ([203.254.224.33]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1U1M02-0000my-Ul for linux-arm-kernel@lists.infradead.org; Fri, 01 Feb 2013 19:10:12 +0000 Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MHK00ICG2K9TH20@mailout3.samsung.com> for linux-arm-kernel@lists.infradead.org; Sat, 02 Feb 2013 04:10:10 +0900 (KST) X-AuditID: cbfee61b-b7fb06d000000f28-ee-510c13124a66 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 45.45.03880.2131C015; Sat, 02 Feb 2013 04:10:10 +0900 (KST) Received: from amdc1344.digital.local ([106.116.147.32]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MHK00AVD2JZ3YB0@mmp1.samsung.com> for linux-arm-kernel@lists.infradead.org; Sat, 02 Feb 2013 04:10:10 +0900 (KST) From: Sylwester Nawrocki To: linux-media@vger.kernel.org Subject: [PATCH v4 06/10] s5p-fimc: Use pinctrl API for camera ports configuration Date: Fri, 01 Feb 2013 20:09:27 +0100 Message-id: <1359745771-23684-7-git-send-email-s.nawrocki@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1359745771-23684-1-git-send-email-s.nawrocki@samsung.com> References: <1359745771-23684-1-git-send-email-s.nawrocki@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrIJMWRmVeSWpSXmKPExsVy+t9jAV0hYZ5Ag+WX2S02Pb7G6sDosXlJ fQBjFJdNSmpOZllqkb5dAlfGluOT2Ap+C1c8vnWGqYHxmkAXIweHhICJRPNs4S5GTiBTTOLC vfVsXYxcHEICixglrn2cC+VsZJJ4uf4xO0gVm4ChRO/RPkYQW0RAXuJJ7w2wImaBuUwSr450 MIMkhAVCJNatWsEEYrMIqEp8WnmNBcTmFXCTaDy1nxFis4LEnEk2IGFOAXeJH92T2EBsIaCS s41v2SYw8i5gZFjFKJpakFxQnJSea6RXnJhbXJqXrpecn7uJEezxZ9I7GFc1WBxiFOBgVOLh dfjJHSjEmlhWXJl7iFGCg1lJhNe2FijEm5JYWZValB9fVJqTWnyIUZqDRUmcl/HUkwAhgfTE ktTs1NSC1CKYLBMHp1QD49SWqwcMnZZP28v2LV48zFLC+9rVfIWejs7KB41yF3ZH1jrNFbBn urTuC4/WuowMc3bbY0vXWEjxLos/O/HV8hDVoqd1fLsuKctLdEUvZnYWnhmb5jBBafUXAaM7 4h0dQvZaOYv6DUVvRh/5/469fdUkoc0PDnq9tJE2+FQ1ZVGNp/SCjkwrJZbijERDLeai4kQA 2WBeDfQBAAA= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130201_141011_384594_35FB84F8 X-CRM114-Status: GOOD ( 11.94 ) X-Spam-Score: -7.6 (-------) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-7.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [203.254.224.33 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.7 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: kgene.kim@samsung.com, swarren@wwwdotorg.org, devicetree-discuss@lists.ozlabs.org, rob.herring@calxeda.com, prabhakar.lad@ti.com, kyungmin.park@samsung.com, linux-samsung-soc@vger.kernel.org, Sylwester Nawrocki , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Before the camera ports can be used the pinmux needs to be configured properly. This patch adds a function to set the camera ports pinctrl to a default state within the media driver's probe(). The camera port(s) are then configured for the video bus operation. Signed-off-by: Sylwester Nawrocki Signed-off-by: Kyungmin Park Changes since v3: - removed the "inactive" pinctrl state, it will be added later if required --- .../devicetree/bindings/media/soc/samsung-fimc.txt | 7 +++++++ drivers/media/platform/s5p-fimc/fimc-mdevice.c | 9 +++++++++ 2 files changed, 16 insertions(+) diff --git a/Documentation/devicetree/bindings/media/soc/samsung-fimc.txt b/Documentation/devicetree/bindings/media/soc/samsung-fimc.txt index 6b81ad1..3788305 100644 --- a/Documentation/devicetree/bindings/media/soc/samsung-fimc.txt +++ b/Documentation/devicetree/bindings/media/soc/samsung-fimc.txt @@ -18,6 +18,10 @@ Required properties: - compatible : must be "samsung,fimc", "simple-bus" +- pinctrl-names : pinctrl names for camera port pinmux control, at least + "default" needs to be specified. +- pinctrl-0...N : pinctrl properties corresponding to pinctrl-names + The 'camera' node must include at least one 'fimc' child node. @@ -133,6 +137,9 @@ Example: #size-cells = <1>; status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&cam_port_a_clk_active>; + /* parallel camera ports */ parallel-ports { /* camera A input */ diff --git a/drivers/media/platform/s5p-fimc/fimc-mdevice.c b/drivers/media/platform/s5p-fimc/fimc-mdevice.c index 2bb501f..6c2c9e3 100644 --- a/drivers/media/platform/s5p-fimc/fimc-mdevice.c +++ b/drivers/media/platform/s5p-fimc/fimc-mdevice.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -1197,6 +1198,14 @@ static int fimc_md_probe(struct platform_device *pdev) /* Protect the media graph while we're registering entities */ mutex_lock(&fmd->media_dev.graph_mutex); + if (dev->of_node) { + struct pinctrl *pctl = devm_pinctrl_get_select_default(dev); + if (IS_ERR(pctl)) { + ret = PTR_ERR(pctl); + goto err_unlock; + } + } + if (fmd->pdev->dev.of_node) ret = fimc_md_register_of_platform_entities(fmd, dev->of_node); else