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: 2811131 Return-Path: X-Original-To: patchwork-linux-media@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 23218C0AB2 for ; Tue, 2 Jul 2013 08:43:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 26CED2013C for ; Tue, 2 Jul 2013 08:43:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 247DB20136 for ; Tue, 2 Jul 2013 08:42:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932332Ab3GBIm4 (ORCPT ); Tue, 2 Jul 2013 04:42:56 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:16445 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932141Ab3GBImv (ORCPT ); Tue, 2 Jul 2013 04:42:51 -0400 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>; 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 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 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 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit 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 msSXL4eBbA4OE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CWhLrdx5ngrDlJTavecsMcZGCxI6zr8FmigjoSTy5sJkd okZEYt+Ld4wTGAVmIRk1C8moWUhGzULSsoCRZRWjaGpBckFxUnqukV5xYm5xaV66XnJ+7iZG cKJ5Jr2DcVWDxSFGAQ5GJR5ehXkXA4VYE8uKK3MPMUpwMCuJ8N70BgrxpiRWVqUW5ccXleak Fh9iTAb6dCKzlGhyPjAJ5pXEGxqbmBlZGplZGJmYm5MmrCTOe7DVOlBIID2xJDU7NbUgtQhm CxMHp1QDY/L5W7qfZ29iyTia75Tz9M2m9Rn3rVb95WD5lG26VWS2xG8GHrukORP6tfasfV7I tH/CxsDMkMhbVTqXrj3m0VTqNTE42/153dTde77xuDd/zrNev/fwxY6cyabh4v3v5EPe637K 60qR2zHli5v1rskyzY1LWzz3HtsiNbc7mmX5Vdk6js18jkosxRmJhlrMRcWJAL1VpK54AwAA DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-6.9 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 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 */