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: 2082311 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 83F74DFE75 for ; Fri, 1 Feb 2013 19:10:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757231Ab3BATKN (ORCPT ); Fri, 1 Feb 2013 14:10:13 -0500 Received: from mailout1.samsung.com ([203.254.224.24]:27971 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757171Ab3BATKL (ORCPT ); Fri, 1 Feb 2013 14:10:11 -0500 Received: from epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MHK007FB2KY3J60@mailout1.samsung.com>; Sat, 02 Feb 2013 04:10:10 +0900 (KST) X-AuditID: cbfee61a-b7f7d6d000000f4e-d1-510c1312d657 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 34.68.03918.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>; Sat, 02 Feb 2013 04:10:10 +0900 (KST) From: Sylwester Nawrocki To: linux-media@vger.kernel.org Cc: kyungmin.park@samsung.com, kgene.kim@samsung.com, swarren@wwwdotorg.org, rob.herring@calxeda.com, prabhakar.lad@ti.com, devicetree-discuss@lists.ozlabs.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Sylwester Nawrocki 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+NgFnrGJMWRmVeSWpSXmKPExsVy+t9jAV0hYZ5Ag823uCx6NmxltZhxfh+T A5PH501yAYxRXDYpqTmZZalF+nYJXBlbjk9iK/gtXPH41hmmBsZrAl2MHBwSAiYSj1fndzFy ApliEhfurWfrYuTiEBJYxCixpfU8E4TTwSQxd+5BVpAqNgFDid6jfYwgtoiAvMST3htgHcwC c5kkXh3pYAZJCAuESKxbtYIJxGYRUJX4tPIaC4jNK+Am0XhqPyPEZgWJOZNsQMKcAu4SP7on sYHYQkAlZxvfsk1g5F3AyLCKUTS1ILmgOCk911CvODG3uDQvXS85P3cTI9j3z6R2MK5ssDjE KMDBqMTD6/CTO1CINbGsuDL3EKMEB7OSCK9tLVCINyWxsiq1KD++qDQntfgQozQHi5I4L+Op JwFCAumJJanZqakFqUUwWSYOTqkGxsNF6yJTpxdNDdzrl/jgiZxNwaGrp085+599Nj/hlYCq pN2x5pmRjv3Nlw73C/L9U9BuCpl93k+e//Fr99wSbZf9cgp2nxnZElYwPVN9mMt/IlHq4Pdn Yet0WCeunXbocLGX55x3C988PRDwwfdb+4VnTMvv3WCZutCNwUFfNjLa9O2i5CVbOJVYijMS DbWYi4oTAUePl0j5AQAA Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.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