From patchwork Mon Aug 26 08:57:34 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jingoo Han X-Patchwork-Id: 2849465 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 B9CE39F271 for ; Mon, 26 Aug 2013 08:57:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D62C9202E6 for ; Mon, 26 Aug 2013 08:57:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D579E20308 for ; Mon, 26 Aug 2013 08:57:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756422Ab3HZI5i (ORCPT ); Mon, 26 Aug 2013 04:57:38 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:26447 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751706Ab3HZI5g (ORCPT ); Mon, 26 Aug 2013 04:57:36 -0400 Received: from epcpsbgr5.samsung.com (u145.gpu120.samsung.co.kr [203.254.230.145]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MS4005CBRJ8M4X0@mailout4.samsung.com>; Mon, 26 Aug 2013 17:57:35 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [203.254.230.48]) by epcpsbgr5.samsung.com (EPCPMTA) with SMTP id 6D.EF.29948.F781B125; Mon, 26 Aug 2013 17:57:35 +0900 (KST) X-AuditID: cbfee691-b7f4a6d0000074fc-d9-521b187fe26c Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 2C.46.09055.E781B125; Mon, 26 Aug 2013 17:57:35 +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 <0MS400381RJYVJG0@mmp1.samsung.com>; Mon, 26 Aug 2013 17:57:34 +0900 (KST) From: Jingoo Han To: 'Kishon Vijay Abraham I' Cc: 'Greg Kroah-Hartman' , linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-fbdev@vger.kernel.org, 'devicetree' , 'Kukjin Kim' , 'Sylwester Nawrocki' , 'Felipe Balbi' , 'Tomasz Figa' , 'Jean-Christophe PLAGNIOL-VILLARD' , 'Tomi Valkeinen' , 'Jingoo Han' References: <003e01cea23a$03aac850$0b0058f0$%han@samsung.com> In-reply-to: <003e01cea23a$03aac850$0b0058f0$%han@samsung.com> Subject: [PATCH 3/3] video: exynos_dp: Use the generic PHY driver Date: Mon, 26 Aug 2013 17:57:34 +0900 Message-id: <004201cea23a$4e2c44d0$ea84ce70$%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: Ac6iOgN7MgvkoL3hRgS3gzfXOa2c2AAADlHg Content-language: ko X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpmleLIzCtJLcpLzFFi42I5/e+ZgW69hHSQwbeDXBYH79dbvDykaTH/ yDlWi+bF69ksLi+8xGrRu+Aqm8WFpz1sFif6PrBaXN41h81ixvl9TBbrHr5gsjj8pp3VYv2M 1ywW6+ffYnPg83h14Q6Lx/65a9g9+rasYvQ4fmM7k8fnTXIBrFFcNimpOZllqUX6dglcGR0X 1zIWfJSpeHY2voHxtHgXIyeHhICJxNsFf9khbDGJC/fWs3UxcnEICSxjlGg/e4QdpmjVw8Us EIlFjBKX+3YyQji/GCUm/z3LClLFJqAm8eXLYbAOEQEdiYWn1zODFDELvGOWuHV8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LKAlsXlbEyuELS+xec1boPkcQKeqSzz6qwtxg5HEjJOPocpFJPa9eMc4gVFoFpJJ s5BMmoVk0iwkLQsYWVYxiqYWJBcUJ6XnGuoVJ+YWl+al6yXn525iBKeXZ1I7GFc2WBxiFOBg VOLhDSyQChJiTSwrrsw9xCjBwawkwmsuKh0kxJuSWFmVWpQfX1Sak1p8iDEZ6NGJzFKiyfnA 1JdXEm9obGJmZGlkZmFkYm5OmrCSOO+BVutAIYH0xJLU7NTUgtQimC1MHJxSDYw+3urHTmQ4 uIn9fh+Quc8tlHHV7odmMrNfNPuttXNva9rxSGr9sX8xdqqC84/vctqwwFg4vvfqXunLr9Wn /tvo2D2rPSqazz3rToNsibGO5ZNsm/2uiaxzX4v/VNpZ9cXUizdWu0X1vXTr99s/5yltK7jL ZDLrwxI1Vr/UA//fezlMrzMy3arEUpyRaKjFXFScCAAVSQVjcwMAAA== 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=-9.3 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 */