From patchwork Tue Jul 2 08:42:49 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jingoo Han X-Patchwork-Id: 2811151 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 DD653BF4A1 for ; Tue, 2 Jul 2013 08:44:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E835520137 for ; Tue, 2 Jul 2013 08:44:43 +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 1CBDA20136 for ; Tue, 2 Jul 2013 08:44:42 +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 1UtwBd-0005gb-Gy; Tue, 02 Jul 2013 08:43:46 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UtwB9-0001mK-0Y; Tue, 02 Jul 2013 08:43:15 +0000 Received: from mailout2.samsung.com ([203.254.224.25]) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UtwB5-0001ln-UR for linux-arm-kernel@lists.infradead.org; Tue, 02 Jul 2013 08:43:12 +0000 Received: from epcpsbgr2.samsung.com (u142.gpu120.samsung.co.kr [203.254.230.142]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MPA00IORW6JEZX0@mailout2.samsung.com> for linux-arm-kernel@lists.infradead.org; Tue, 02 Jul 2013 17:42:50 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [203.254.230.49]) by epcpsbgr2.samsung.com (EPCPMTA) with SMTP id E8.BE.08825.A8292D15; Tue, 02 Jul 2013 17:42:50 +0900 (KST) X-AuditID: cbfee68e-b7f276d000002279-b1-51d2928a85a6 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 4F.CF.21068.98292D15; Tue, 02 Jul 2013 17:42:50 +0900 (KST) Received: from DOJG1HAN03 ([12.23.120.99]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MPA002D5W7DFPV0@mmp2.samsung.com>; Tue, 02 Jul 2013 17:42:49 +0900 (KST) From: Jingoo Han To: linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org Subject: [PATCH V4 4/4] video: exynos_dp: Use the generic PHY driver Date: Tue, 02 Jul 2013 17:42:49 +0900 Message-id: <000d01ce7700$222a35a0$667ea0e0$@samsung.com> MIME-version: 1.0 X-Mailer: Microsoft Outlook 14.0 Thread-index: Ac53ABsyycqfsd1AQ+u3yLFmryroEw== Content-language: ko X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpjleLIzCtJLcpLzFFi42I5/e+ZoW7XpEuBBscmiFgcvF9v8fKQpsWB 2Q9ZLa6ft7OYdH8Ci8WMpY9YLS4vvMRq0bvgKpvFhac9bBZnm96wW2x6fI3V4kTfB1aLng1b WS1mnN/HZLHu4Qsmi8Nv2lkt1s94zWKxfv4tNgchj52z7rJ7vLpwh8Vj85J6j/MzFjJ69G1Z xehx/MZ2Jo/Pm+QC2KO4bFJSczLLUov07RK4MmbsmMpcsEa24s/6rcwNjJ/Fuxg5OSQETCR+ 7NvDDGGLSVy4t54NxBYSWMYocXQdL0zN+mn7GLsYuYDi0xklTu17zwTh/GKU2Pj1JDtIFZuA msSXL4eBbA4OEQFvieXXFEFqmAWusUj0vHrPCFIjLOAi8X7vSiYQm0VA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d okZEYt+Ld4wTGAVmIRk1C8moWUhGzULSsoCRZRWjaGpBckFxUnqukV5xYm5xaV66XnJ+7iZG cKJ5Jr2DcVWDxSFGAQ5GJR5ehXkXA4VYE8uKK3MPMUpwMCuJ8N70BgrxpiRWVqUW5ccXleak Fh9iTAb6dCKzlGhyPjAJ5pXEGxqbmBlZGplZGJmYm5MmrCTOe7DVOlBIID2xJDU7NbUgtQhm CxMHp1QDY/L5W7qfZ29iyTia75Tz9M2m9Rn3rVb95WD5lG26VWS2xG8GHrukORP6tfasfV7I tH/CxsDMkMhbVTqXrj3m0VTqNTE42/153dTde77xuDd/zrNev/fwxY6cyabh4v3v5EPe637K 60qR2zHli5v1rskyzY1LWzz3HtsiNbc7mmX5Vdk6js18jkosxRmJhlrMRcWJAL1VpK54AwAA 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-20130702_044312_401183_C6C885DF X-CRM114-Status: GOOD ( 13.70 ) X-Spam-Score: -6.9 (------) 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.2 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 instead of the platform callback to control the DP PHY. Signed-off-by: Jingoo Han Reviewed-by: Tomasz Figa --- .../devicetree/bindings/video/exynos_dp.txt | 23 +++++--------------- drivers/video/exynos/exynos_dp_core.c | 16 ++++++++++---- drivers/video/exynos/exynos_dp_core.h | 2 ++ 3 files changed, 20 insertions(+), 21 deletions(-) diff --git a/Documentation/devicetree/bindings/video/exynos_dp.txt b/Documentation/devicetree/bindings/video/exynos_dp.txt index 84f10c1..022f4b6 100644 --- a/Documentation/devicetree/bindings/video/exynos_dp.txt +++ b/Documentation/devicetree/bindings/video/exynos_dp.txt @@ -1,17 +1,6 @@ The Exynos display port interface should be configured based on the type of panel connected to it. -We use two nodes: - -dp-controller node - -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: - Base address of DP PHY register. - -samsung,enable-mask: - The bit-mask used to enable/disable DP PHY. - For the Panel initialization, we read data from dp-controller node. Required properties for dp-controller: -compatible: @@ -25,6 +14,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 +60,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..87804b6 100644 --- a/drivers/video/exynos/exynos_dp_core.h +++ b/drivers/video/exynos/exynos_dp_core.h @@ -151,6 +151,8 @@ 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 */