From patchwork Mon Sep 17 10:51:39 2012 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: 1466571 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 A6415DF2D8 for ; Mon, 17 Sep 2012 10:55:30 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TDYwY-0003e9-Fz; Mon, 17 Sep 2012 10:52:46 +0000 Received: from mailout3.samsung.com ([203.254.224.33]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TDYwJ-0003Yv-3k for linux-arm-kernel@lists.infradead.org; Mon, 17 Sep 2012 10:52:32 +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 <0MAH008WJQ7BCGV0@mailout3.samsung.com> for linux-arm-kernel@lists.infradead.org; Mon, 17 Sep 2012 19:52:30 +0900 (KST) X-AuditID: cbfee61b-b7f2b6d000000f14-5a-505700ed7f83 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 9A.68.03860.DE007505; Mon, 17 Sep 2012 19:52:30 +0900 (KST) Received: from amdc248.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 <0MAH003D4Q6Z1L90@mmp1.samsung.com> for linux-arm-kernel@lists.infradead.org; Mon, 17 Sep 2012 19:52:29 +0900 (KST) From: Sylwester Nawrocki To: kgene.kim@samsung.com Subject: [PATCH 2/7] ARM: samsung: Change __s5p_mipi_phy_control() function signature Date: Mon, 17 Sep 2012 12:51:39 +0200 Message-id: <1347879100-30150-2-git-send-email-s.nawrocki@samsung.com> X-Mailer: git-send-email 1.7.11.3 In-reply-to: <1347879100-30150-1-git-send-email-s.nawrocki@samsung.com> References: <1347878888-30001-1-git-send-email-s.nawrocki@samsung.com> <1347879100-30150-1-git-send-email-s.nawrocki@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrMJMWRmVeSWpSXmKPExsVy+t9jAd13DOEBBj8WMVlsenyN1YHRY/OS +gDGKC6blNSczLLUIn27BK6Ms4flCu7wVbw+e5q5gXERTxcjJ4eEgInE3i/z2SBsMYkL99YD 2VwcQgKLGCXmvbvHBOFsYJKYceEsK0gVm4ChRO/RPkYQW0RAUqKp4Q8zSBGzwHpGia3zN7GA JIQFwiUub+1iArFZBFQlZrxoAWvgFXCTuNezhhFinaLEj+9rmEFsTgF3iY3bFkCtbmaU2Dl1 K+sERt4FjAyrGEVTC5ILipPSc430ihNzi0vz0vWS83M3MYK9/kx6B+OqBotDjAIcjEo8vBcu hwUIsSaWFVfmHmKU4GBWEuF98AYoxJuSWFmVWpQfX1Sak1p8iFGag0VJnFf4U2CAkEB6Yklq dmpqQWoRTJaJg1OqgVE+LKlujVSPoEBTxIJZPQxi76Ifzdy56c6fJSu0X7gfk+Rb4LoptWOD 6qWjLRxPGEpEa+rNe87PP+BxaNuc/bsE+o4XHdCvTnvG8mTDrprqCezvizYts5S7esj+qeg+ d5WonieairXXl/269sX+vc0P2/stu5Y1zn5WInXEK//Z6pq3PnoJ9T+UWIozEg21mIuKEwE9 O6mH9gEAAA== X-Spam-Note: CRM114 invocation failed X-Spam-Score: -7.4 (-------) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-7.4 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.5 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: kyungmin.park@samsung.com, linux-samsung-soc@vger.kernel.org, sw0312.kim@samsung.com, 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 Replace pdev argument __s5p_mipi_phy_control() helper with plain int so MIPI-CSIS hardware instance index can be passed directly making the function usable on platforms instantiated from device tree. Signed-off-by: Sylwester Nawrocki Signed-off-by: Kyungmin Park Acked-by: Kukjin --- arch/arm/plat-samsung/setup-mipiphy.c | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/arch/arm/plat-samsung/setup-mipiphy.c b/arch/arm/plat-samsung/setup-mipiphy.c index 683c466..1474593 100644 --- a/arch/arm/plat-samsung/setup-mipiphy.c +++ b/arch/arm/plat-samsung/setup-mipiphy.c @@ -14,24 +14,18 @@ #include #include -static int __s5p_mipi_phy_control(struct platform_device *pdev, - bool on, u32 reset) +static int __s5p_mipi_phy_control(int id, bool on, u32 reset) { static DEFINE_SPINLOCK(lock); void __iomem *addr; unsigned long flags; - int pid; u32 cfg; - if (!pdev) + id = max(0, id); + if (id > 1) return -EINVAL; - pid = (pdev->id == -1) ? 0 : pdev->id; - - if (pid != 0 && pid != 1) - return -EINVAL; - - addr = S5P_MIPI_DPHY_CONTROL(pid); + addr = S5P_MIPI_DPHY_CONTROL(id); spin_lock_irqsave(&lock, flags); @@ -52,12 +46,12 @@ static int __s5p_mipi_phy_control(struct platform_device *pdev, return 0; } -int s5p_csis_phy_enable(struct platform_device *pdev, bool on) +int s5p_csis_phy_enable(int id, bool on) { - return __s5p_mipi_phy_control(pdev, on, S5P_MIPI_DPHY_SRESETN); + return __s5p_mipi_phy_control(id, on, S5P_MIPI_DPHY_SRESETN); } int s5p_dsim_phy_enable(struct platform_device *pdev, bool on) { - return __s5p_mipi_phy_control(pdev, on, S5P_MIPI_DPHY_MRESETN); + return __s5p_mipi_phy_control(pdev->id, on, S5P_MIPI_DPHY_MRESETN); }