From patchwork Tue Jul 9 08:05:48 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jingoo Han X-Patchwork-Id: 2825188 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 EC2EF9F7D6 for ; Tue, 9 Jul 2013 08:07:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A246B201BB for ; Tue, 9 Jul 2013 08:07:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 63590201BE for ; Tue, 9 Jul 2013 08:07:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753686Ab3GIIHH (ORCPT ); Tue, 9 Jul 2013 04:07:07 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:53350 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753846Ab3GIIFu (ORCPT ); Tue, 9 Jul 2013 04:05:50 -0400 Received: from epcpsbgr2.samsung.com (u142.gpu120.samsung.co.kr [203.254.230.142]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MPN002R1T57LZA0@mailout4.samsung.com>; Tue, 09 Jul 2013 17:05:49 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [203.254.230.51]) by epcpsbgr2.samsung.com (EPCPMTA) with SMTP id 8C.4C.08825.D54CBD15; Tue, 09 Jul 2013 17:05:49 +0900 (KST) X-AuditID: cbfee68e-b7f276d000002279-9d-51dbc45d53c4 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id A8.56.21068.C54CBD15; Tue, 09 Jul 2013 17:05:49 +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 <0MPN009WQT5O2E40@mmp1.samsung.com>; Tue, 09 Jul 2013 17:05:48 +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 V6 4/4] video: exynos_dp: Use the generic PHY driver Date: Tue, 09 Jul 2013 17:05:48 +0900 Message-id: <004101ce7c7b$1f306510$5d912f30$@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: Ac58exYAmIh6nAS5QfO+WCYfNHaR3g== Content-language: ko X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpnleLIzCtJLcpLzFFi42I5/e+ZsW7skduBBtc+81scvF9v8fKQpsWB 2Q9ZLa6ft7OYdH8Ci8WMpY9YLS4vvMRq0bvgKpvFhac9bBZnm96wW2x6fI3V4kTfB1aLng1b WS1mnN/HZLHu4Qsmi8Nv2lkt1s94zWKxfv4tNgchj52z7rJ7vLpwh8Vj85J6j/MzFjJ69G1Z xehx/MZ2Jo/Pm+QC2KO4bFJSczLLUov07RK4Ml7/e8NacF+mYu3O/4wNjDvFuxg5OSQETCRe NfUzQdhiEhfurWfrYuTiEBJYxiixsbONEabo9dYl7BCJRYwSaz89YoJwfjFKrHl4hB2kik1A TeLLl8NANge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jatYEJwhaU+DH5HguIzSygJbF+53EmCFteYvOat8wQBylI7Dj7GqxXREBPovVNKzNE jYjEvhfvGCcwCsxCMmoWklGzkIyahaRlASPLKkbR1ILkguKk9FwjveLE3OLSvHS95PzcTYzg NPNMegfjqgaLQ4wCHIxKPLwfLt8KFGJNLCuuzD3EKMHBrCTCu2jn7UAh3pTEyqrUovz4otKc 1OJDjMlAn05klhJNzgemwLySeENjEzMjSyMzCyMTc3PShJXEeQ+2WgcKCaQnlqRmp6YWpBbB bGHi4JRqYKy0/37D3zBKXS63oEaG6VVSeqYWk6i+1zbv+6FzdAofrzAPfd7Q1XanZMG9hH8Z j9fPlrd1sWR7d4Flmx3DjkRxlWKN0v0TT/S+/bT7S29R07OXzlJ+m8xu59VprlGX3dHA8i8u IHlzQLx52/TNAq0yAfJJAq0MczmPpx3gqVvc++1L+a4wJZbijERDLeai4kQAHEHwB3cDAAA= 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 c60da67..e2874ae 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. @@ -21,6 +21,10 @@ Required properties for dp-controller: of memory mapped region. -interrupts: interrupt combiner values. + -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: @@ -61,12 +65,8 @@ SOC specific portion: reg = <0x145b0000 0x10000>; interrupts = <10 3>; interrupt-parent = <&combiner>; - - 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 */