From patchwork Mon Jul 8 02:58:28 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jingoo Han X-Patchwork-Id: 2824689 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 790E19F7D6 for ; Mon, 8 Jul 2013 02:58:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 71C4F2012F for ; Mon, 8 Jul 2013 02:58:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 52F9720121 for ; Mon, 8 Jul 2013 02:58:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753360Ab3GHC6b (ORCPT ); Sun, 7 Jul 2013 22:58:31 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:24979 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753357Ab3GHC6a (ORCPT ); Sun, 7 Jul 2013 22:58:30 -0400 Received: from epcpsbgr2.samsung.com (u142.gpu120.samsung.co.kr [203.254.230.142]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MPL00LNIK9BRDE0@mailout3.samsung.com>; Mon, 08 Jul 2013 11:58:29 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [203.254.230.50]) by epcpsbgr2.samsung.com (EPCPMTA) with SMTP id 41.9B.08825.5DA2AD15; Mon, 08 Jul 2013 11:58:29 +0900 (KST) X-AuditID: cbfee68e-b7f276d000002279-e6-51da2ad51383 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 65.A8.21068.4DA2AD15; Mon, 08 Jul 2013 11:58:29 +0900 (KST) Received: from DOJG1HAN03 ([12.23.120.99]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MPL00GFKK9GB950@mmp1.samsung.com>; Mon, 08 Jul 2013 11:58:28 +0900 (KST) From: Jingoo Han To: linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org Cc: 'Kishon Vijay Abraham I' , linux-media@vger.kernel.org, 'Kukjin Kim' , 'Sylwester Nawrocki' , 'Felipe Balbi' , 'Tomasz Figa' , devicetree-discuss@lists.ozlabs.org, 'Inki Dae' , 'Donghwa Lee' , 'Kyungmin Park' , 'Jean-Christophe PLAGNIOL-VILLARD' , 'Tomi Valkeinen' , linux-fbdev@vger.kernel.org, 'Hui Wang' , Jingoo Han Subject: [PATCH V5 4/4] video: exynos_dp: Use the generic PHY driver Date: Mon, 08 Jul 2013 11:58:28 +0900 Message-id: <001f01ce7b87$05c6f750$1154e5f0$@samsung.com> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-index: Ac57hwMWHPsi1esqQEOLyNAOV6teng== Content-language: ko X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmphleLIzCtJLcpLzFFi42I5/e+Zke5VrVuBBttX8lgcvF9v8fKQpsWB 2Q9ZLa6ft7OYdH8Ci8WMpY9YLS4vvMRq0bvgKpvFhac9bBZnm96wW2x6fI3V4kTfB1aLng1b WS1mnN/HZLHu4Qsmi8Nv2lkt1s94zWKxfv4tNgchj52z7rJ7vLpwh8Vj85J6j/MzFjJ69G1Z xehx/MZ2Jo/Pm+QC2KO4bFJSczLLUov07RK4MpouShT8l6k4u/ggSwPjJfEuRg4OCQETicNX croYOYFMMYkL99azdTFycQgJLGOU6Ni1nQUiYSKxe8stdhBbSGARo8Sqo6oQRb8YJT4e6GcE SbAJqEl8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CFpT4MfkeC4jNLKAlsX7ncSYIW15i85q3zBD3KEjsOPsabKSIgJ7EqQNfoOpF JPa9eMc4gVFgFpJRs5CMmoVk1CwkLQsYWVYxiqYWJBcUJ6XnGukVJ+YWl+al6yXn525iBKeY Z9I7GFc1WBxiFOBgVOLhlTh9M1CINbGsuDL3EKMEB7OSCK84661AId6UxMqq1KL8+KLSnNTi Q4zJQI9OZJYSTc4Hpr+8knhDYxMzI0sjMwsjE3Nz0oSVxHkPtloHCgmkJ5akZqemFqQWwWxh 4uCUamCcMqVedU/kySCBO/0G2lvfajxoyfbt/NmUcCy8gmub3/znk6MWn97Xovh19rY9EwJq grx7PoXbeTBsYPZ7eVnG/oXgzt0bi5ZPuVtQEvX/Rvzbgrtb3Jnfdy4QNei5e4FnkWXFidA3 i4XYr17naJsycf15tfaEHx/b27IvbzyYvl5UcunmLL4EJZbijERDLeai4kQAv8FyEXUDAAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@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 to control the DP PHY. Signed-off-by: Jingoo Han Reviewed-by: Tomasz Figa --- .../devicetree/bindings/video/exynos_dp.txt | 18 +++++++++--------- drivers/video/exynos/exynos_dp_core.c | 16 ++++++++++++---- drivers/video/exynos/exynos_dp_core.h | 1 + 3 files changed, 22 insertions(+), 13 deletions(-) diff --git a/Documentation/devicetree/bindings/video/exynos_dp.txt b/Documentation/devicetree/bindings/video/exynos_dp.txt index 84f10c1..2f56376 100644 --- a/Documentation/devicetree/bindings/video/exynos_dp.txt +++ b/Documentation/devicetree/bindings/video/exynos_dp.txt @@ -6,10 +6,10 @@ We use two nodes: -dptx-phy node(defined inside dp-controller node) For the DP-PHY initialization, we use the dptx-phy node. -Required properties for dptx-phy: - -reg: +Required properties for dptx-phy: deprecated, use phys and phy-names + -reg: deprecated Base address of DP PHY register. - -samsung,enable-mask: + -samsung,enable-mask: deprecated The bit-mask used to enable/disable DP PHY. For the Panel initialization, we read data from dp-controller node. @@ -25,6 +25,10 @@ Required properties for dp-controller: from common clock binding: handle to dp clock. -clock-names: from common clock binding: Shall be "dp". + -phys: + from general PHY binding: the phandle for the PHY device. + -phy-names: + from general PHY binding: Should be "dp". -interrupt-parent: phandle to Interrupt combiner node. -samsung,color-space: @@ -67,12 +71,8 @@ SOC specific portion: interrupt-parent = <&combiner>; clocks = <&clock 342>; clock-names = "dp"; - - dptx-phy { - reg = <0x10040720>; - samsung,enable-mask = <1>; - }; - + phys = <&dp_phy>; + phy-names = "dp"; }; Board Specific portion: diff --git a/drivers/video/exynos/exynos_dp_core.c b/drivers/video/exynos/exynos_dp_core.c index 05fed7d..5e1a715 100644 --- a/drivers/video/exynos/exynos_dp_core.c +++ b/drivers/video/exynos/exynos_dp_core.c @@ -19,6 +19,7 @@ #include #include #include +#include #include "exynos_dp_core.h" @@ -960,8 +961,11 @@ static int exynos_dp_dt_parse_phydata(struct exynos_dp_device *dp) dp_phy_node = of_find_node_by_name(dp_phy_node, "dptx-phy"); if (!dp_phy_node) { - dev_err(dp->dev, "could not find dptx-phy node\n"); - return -ENODEV; + dp->phy = devm_phy_get(dp->dev, "dp"); + if (IS_ERR(dp->phy)) + return PTR_ERR(dp->phy); + else + return 0; } if (of_property_read_u32(dp_phy_node, "reg", &phy_base)) { @@ -992,7 +996,9 @@ err: static void exynos_dp_phy_init(struct exynos_dp_device *dp) { - if (dp->phy_addr) { + if (dp->phy) { + phy_power_on(dp->phy); + } else if (dp->phy_addr) { u32 reg; reg = __raw_readl(dp->phy_addr); @@ -1003,7 +1009,9 @@ static void exynos_dp_phy_init(struct exynos_dp_device *dp) static void exynos_dp_phy_exit(struct exynos_dp_device *dp) { - if (dp->phy_addr) { + if (dp->phy) { + phy_power_off(dp->phy); + } else if (dp->phy_addr) { u32 reg; reg = __raw_readl(dp->phy_addr); diff --git a/drivers/video/exynos/exynos_dp_core.h b/drivers/video/exynos/exynos_dp_core.h index 56cfec8..607e36d 100644 --- a/drivers/video/exynos/exynos_dp_core.h +++ b/drivers/video/exynos/exynos_dp_core.h @@ -151,6 +151,7 @@ struct exynos_dp_device { struct video_info *video_info; struct link_train link_train; struct work_struct hotplug_work; + struct phy *phy; }; /* exynos_dp_reg.c */