From patchwork Fri Jun 14 17:45:50 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: 2722771 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 51D93C0AB1 for ; Fri, 14 Jun 2013 17:48:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 70A8720359 for ; Fri, 14 Jun 2013 17:48:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6A5A620366 for ; Fri, 14 Jun 2013 17:48:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753544Ab3FNRst (ORCPT ); Fri, 14 Jun 2013 13:48:49 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:40977 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753236Ab3FNRss (ORCPT ); Fri, 14 Jun 2013 13:48:48 -0400 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 <0MOE002S49H67N10@mailout1.samsung.com>; Sat, 15 Jun 2013 02:48:47 +0900 (KST) X-AuditID: cbfee61a-b7f3b6d000006edd-25-51bb577f09f3 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id C2.FC.28381.F775BB15; Sat, 15 Jun 2013 02:48:47 +0900 (KST) Received: from amdc1344.digital.local ([106.116.147.32]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MOE00L589D10O50@mmp2.samsung.com>; Sat, 15 Jun 2013 02:48:47 +0900 (KST) From: Sylwester Nawrocki To: kishon@ti.com Cc: linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, linux-samsung-soc@vger.kernel.org, kyungmin.park@samsung.com, sw0312.kim@samsung.com, devicetree-discuss@lists.ozlabs.org, kgene.kim@samsung.com, dh09.lee@samsung.com, jg1.han@samsung.com, linux-fbdev@vger.kernel.org, Sylwester Nawrocki Subject: [RFC PATCH 4/5] exynos4-is: Use generic MIPI CSIS PHY driver Date: Fri, 14 Jun 2013 19:45:50 +0200 Message-id: <1371231951-1969-5-git-send-email-s.nawrocki@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1371231951-1969-1-git-send-email-s.nawrocki@samsung.com> References: <1371231951-1969-1-git-send-email-s.nawrocki@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrFLMWRmVeSWpSXmKPExsVy+t9jQd368N2BBkcvcVscmP2Q1eL6eTuL ywsvsVr0LrjKZnHhaQ+bxdmmN+wWmx5fY7U40feB1aJnw1ZWixnn9zFZHH7TDmRNfsnmwOOx eUm9x/kZCxk9+rasYvQ4fmM7k8fnTXIBrFFcNimpOZllqUX6dglcGVe2f2MtuCFRsf3SLvYG xvUiXYycHBICJhKb5n9lhbDFJC7cW8/WxcjFISQwnVHi09YDTBBOB5PEv9YWJpAqNgFDid6j fYxdjBwcIgKCEp8+MYLUMAtcYZLourWBGaRGWMBV4sCeJkYQm0VAVaJ1+3OwXl6g+Mo1Z8F6 JQQUJOZMsgEJcwq4SaxvOsEOYgsBlTRuXMo8gZF3ASPDKkbR1ILkguKk9FxDveLE3OLSvHS9 5PzcTYzgEHwmtYNxZYPFIUYBDkYlHt4JarsDhVgTy4orcw8xSnAwK4nw3lUFCvGmJFZWpRbl xxeV5qQWH2KU5mBREuc90GodKCSQnliSmp2aWpBaBJNl4uCUamBs/HBO7cNNw9l7Jr1Y8z1x CXvixT9CjmK39i2YtfITt3DG3appvK4Fv06++PvhZkLkvYVbzmiGqm8WqjNfc81lh6LZ7ktb XkzdWdlVoLDPjmOOZkTDkhWLiieI6VrP+r74zBep5cl77vx8bC1zdv11hi/vtV+q5PS9vsJq epxt5bx9y5/7F6yRDFNiKc5INNRiLipOBAD74T5rPQIAAA== Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use the generic PHY API instead of the platform callback to control the MIPI CSIS DPHY. Signed-off-by: Sylwester Nawrocki Signed-off-by: Kyungmin Park --- drivers/media/platform/exynos4-is/mipi-csis.c | 11 +++++++++-- include/linux/platform_data/mipi-csis.h | 9 --------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/drivers/media/platform/exynos4-is/mipi-csis.c b/drivers/media/platform/exynos4-is/mipi-csis.c index 0fe80e3..88d0d61 100644 --- a/drivers/media/platform/exynos4-is/mipi-csis.c +++ b/drivers/media/platform/exynos4-is/mipi-csis.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -184,6 +185,7 @@ struct csis_drvdata { * @sd: v4l2_subdev associated with CSIS device instance * @index: the hardware instance index * @pdev: CSIS platform device + * @phy: pointer to the CSIS generic PHY * @regs: mmaped I/O registers memory * @supplies: CSIS regulator supplies * @clock: CSIS clocks @@ -207,6 +209,7 @@ struct csis_state { struct v4l2_subdev sd; u8 index; struct platform_device *pdev; + struct phy *phy; void __iomem *regs; struct regulator_bulk_data supplies[CSIS_NUM_SUPPLIES]; struct clk *clock[NUM_CSIS_CLOCKS]; @@ -861,6 +864,10 @@ static int s5pcsis_probe(struct platform_device *pdev) return -EINVAL; } + state->phy = devm_phy_get(dev, "csis"); + if (IS_ERR(state->phy)) + return PTR_ERR(state->phy); + mem_res = platform_get_resource(pdev, IORESOURCE_MEM, 0); state->regs = devm_ioremap_resource(dev, mem_res); if (IS_ERR(state->regs)) @@ -946,7 +953,7 @@ static int s5pcsis_pm_suspend(struct device *dev, bool runtime) mutex_lock(&state->lock); if (state->flags & ST_POWERED) { s5pcsis_stop_stream(state); - ret = s5p_csis_phy_enable(state->index, false); + ret = phy_power_off(state->phy); if (ret) goto unlock; ret = regulator_bulk_disable(CSIS_NUM_SUPPLIES, @@ -982,7 +989,7 @@ static int s5pcsis_pm_resume(struct device *dev, bool runtime) state->supplies); if (ret) goto unlock; - ret = s5p_csis_phy_enable(state->index, true); + ret = phy_power_on(state->phy); if (!ret) { state->flags |= ST_POWERED; } else { diff --git a/include/linux/platform_data/mipi-csis.h b/include/linux/platform_data/mipi-csis.h index bf34e17..c2fd902 100644 --- a/include/linux/platform_data/mipi-csis.h +++ b/include/linux/platform_data/mipi-csis.h @@ -25,13 +25,4 @@ struct s5p_platform_mipi_csis { u8 hs_settle; }; -/** - * s5p_csis_phy_enable - global MIPI-CSI receiver D-PHY control - * @id: MIPI-CSIS harware instance index (0...1) - * @on: true to enable D-PHY and deassert its reset - * false to disable D-PHY - * @return: 0 on success, or negative error code on failure - */ -int s5p_csis_phy_enable(int id, bool on); - #endif /* __PLAT_SAMSUNG_MIPI_CSIS_H_ */