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: 2825202 Return-Path: X-Original-To: patchwork-linux-arm@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 E9724C0AB2 for ; Tue, 9 Jul 2013 08:57:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E37472018E for ; Tue, 9 Jul 2013 08:57:57 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BA6142018A for ; Tue, 9 Jul 2013 08:57:54 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UwSxN-0000Hz-S2; Tue, 09 Jul 2013 08:07:33 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UwSw9-0001Ll-Jz; Tue, 09 Jul 2013 08:06:13 +0000 Received: from mailout4.samsung.com ([203.254.224.34]) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UwSw6-0001K1-6U for linux-arm-kernel@lists.infradead.org; Tue, 09 Jul 2013 08:06:11 +0000 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> for linux-arm-kernel@lists.infradead.org; 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 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 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 TeLLl8NANgeHiIC3xPJriiA1zALXWCR6Xr1nBIkLC7hITG1VBilnEVAF2nwcbAGv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PovVNKzNE 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130709_040610_686110_573218D2 X-CRM114-Status: GOOD ( 13.27 ) X-Spam-Score: -6.7 (------) Cc: linux-fbdev@vger.kernel.org, 'Kukjin Kim' , 'Hui Wang' , 'Tomasz Figa' , Jingoo Han , 'Donghwa Lee' , 'Felipe Balbi' , 'Kishon Vijay Abraham I' , 'Inki Dae' , 'Kyungmin Park' , 'Tomi Valkeinen' , 'Sylwester Nawrocki' , 'Jean-Christophe PLAGNIOL-VILLARD' , devicetree-discuss@lists.ozlabs.org, linux-media@vger.kernel.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 */