From patchwork Mon Sep 30 08:00: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: 2962831 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 E506D9F288 for ; Mon, 30 Sep 2013 08:00:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 71087201A4 for ; Mon, 30 Sep 2013 08:00:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2F03720173 for ; Mon, 30 Sep 2013 08:00:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752368Ab3I3IAb (ORCPT ); Mon, 30 Sep 2013 04:00:31 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:30757 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752041Ab3I3IAa (ORCPT ); Mon, 30 Sep 2013 04:00:30 -0400 Received: from epcpsbgr1.samsung.com (u141.gpu120.samsung.co.kr [203.254.230.141]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MTX0048PI8BAJN0@mailout1.samsung.com>; Mon, 30 Sep 2013 17:00:29 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [203.254.230.51]) by epcpsbgr1.samsung.com (EPCPMTA) with SMTP id 27.F5.30629.C9F29425; Mon, 30 Sep 2013 17:00:28 +0900 (KST) X-AuditID: cbfee68d-b7fe86d0000077a5-c3-52492f9cd520 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 6D.FC.05832.C9F29425; Mon, 30 Sep 2013 17:00:28 +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 <0MTX006M0I8SIZ00@mmp2.samsung.com>; Mon, 30 Sep 2013 17:00:28 +0900 (KST) From: Jingoo Han To: 'Kishon Vijay Abraham I' Cc: 'Greg Kroah-Hartman' , linux-fbdev@vger.kernel.org, linux-samsung-soc@vger.kernel.org, 'Kukjin Kim' , 'Tomi Valkeinen' , 'Jean-Christophe Plagniol-Villard' , 'Sylwester Nawrocki' , 'Jingoo Han' References: <000f01cebdb2$d1a20e10$74e62a30$%han@samsung.com> In-reply-to: <000f01cebdb2$d1a20e10$74e62a30$%han@samsung.com> Subject: [PATCH V8 3/3] video: exynos_dp: Use the generic PHY driver Date: Mon, 30 Sep 2013 17:00:28 +0900 Message-id: <001b01cebdb3$209e3d40$61dab7c0$%han@samsung.com> MIME-version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-index: Ac69stGDJcNGlmTjTaOadWBk38OXaAAAECfA Content-language: ko X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrFIsWRmVeSWpSXmKPExsVy+t8zY905+p5BBr+fmlk0L17PZnF54SVW i94FV9ksLjztYbM40feB1WLG+X1MFusevmCyOPymndVi/fxbbA6cHq8u3GHx2D93DbtH35ZV jB7Hb2xn8vi8SS6ANYrLJiU1J7MstUjfLoEro+PiWsaCjzIVz87GNzCeFu9i5OSQEDCRaL71 jxHCFpO4cG89G4gtJLCMUaJ3VghMTeeCrUxdjFxA8emMEhsunmOBKPrFKPF9ZwKIzSagJvHl y2F2EFtEQEdi4en1zCANzAIPmCROnVvMDtFgKzHj72mwbZwCdhJ/551lBbGFBVwkHh25AFbD IqAq8WHtNrAreIHqd255zwJhC0r8mHwPzGYW0JLYvK2JFcKWl9i85i3Q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4eC2WegQJsSaWFVfmHmKU4GBWEuH9 yucZJMSbklhZlVqUH19UmpNafIgxGejRicxSosn5wFSWVxJvaGxiZmRpZGZhZGJuTpqwkjjv wVbrQCGB9MSS1OzU1ILUIpgtTBycUg2MxrsYZn9Zq7X60MTeTFatg6mONuKKeq1Ceyy2+ucH NkanGhdImZ44u+ZDxvm+65yHInu/aIg9cQ5POtfSU+4t0rFakmu/tvzO4un3OUSzQ7mDXE80 bHvedcPBbXnN9f6MZ25RK9sOhods9K17YZW1UHfObv5X1y0mVhd+3ZuxKczer/ZoeJcSS3FG oqEWc1FxIgDWj4hdWwMAAA== 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.5 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 --- Documentation/devicetree/bindings/video/exynos_dp.txt | 17 +++++++++-------- drivers/video/exynos/exynos_dp_core.c | 16 ++++++++++++---- drivers/video/exynos/exynos_dp_core.h | 1 + 3 files changed, 22 insertions(+), 12 deletions(-) diff --git a/Documentation/devicetree/bindings/video/exynos_dp.txt b/Documentation/devicetree/bindings/video/exynos_dp.txt index 84f10c1..3289d76 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. @@ -27,6 +27,10 @@ Required properties for dp-controller: from common clock binding: Shall be "dp". -interrupt-parent: phandle to Interrupt combiner node. + -phys: + from general PHY binding: the phandle for the PHY device. + -phy-names: + from general PHY binding: Should be "dp". -samsung,color-space: input video data format. COLOR_RGB = 0, COLOR_YCBCR422 = 1, COLOR_YCBCR444 = 2 @@ -68,11 +72,8 @@ SOC specific portion: 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 */