From patchwork Wed Jun 26 15:02:24 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Sylwester Nawrocki/Kernel \\(PLT\\) /SRPOL/Staff Engineer/Samsung Electronics" X-Patchwork-Id: 2786051 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 D26AF9F245 for ; Wed, 26 Jun 2013 15:05:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 21D04205A8 for ; Wed, 26 Jun 2013 15:05:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AA99A205A2 for ; Wed, 26 Jun 2013 15:05:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752050Ab3FZPFj (ORCPT ); Wed, 26 Jun 2013 11:05:39 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:26790 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751729Ab3FZPFc (ORCPT ); Wed, 26 Jun 2013 11:05:32 -0400 Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MP0006E69X0GT30@mailout3.samsung.com>; Thu, 27 Jun 2013 00:05:31 +0900 (KST) X-AuditID: cbfee61b-b7f8e6d00000524c-07-51cb033b0735 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 2F.45.21068.B330BC15; Thu, 27 Jun 2013 00:05:31 +0900 (KST) Received: from amdc1344.digital.local ([106.116.147.32]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MP000KGO9S4RV50@mmp1.samsung.com>; Thu, 27 Jun 2013 00:05:31 +0900 (KST) From: Sylwester Nawrocki To: linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org Cc: kishon@ti.com, linux-media@vger.kernel.org, kyungmin.park@samsung.com, balbi@ti.com, t.figa@samsung.com, devicetree-discuss@lists.ozlabs.org, kgene.kim@samsung.com, dh09.lee@samsung.com, jg1.han@samsung.com, inki.dae@samsung.com, plagnioj@jcrosoft.com, linux-fbdev@vger.kernel.org, Sylwester Nawrocki Subject: [PATCH v3 3/5] video: exynos_mipi_dsim: Use the generic PHY driver Date: Wed, 26 Jun 2013 17:02:24 +0200 Message-id: <1372258946-15607-4-git-send-email-s.nawrocki@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1372258946-15607-1-git-send-email-s.nawrocki@samsung.com> References: <1372258946-15607-1-git-send-email-s.nawrocki@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrDLMWRmVeSWpSXmKPExsVy+t9jAV1r5tOBBm8PGFscvF9vcWD2Q1aL 6+ftLCbdn8BicXnhJVaL3gVX2SwuPO1hszjb9IbdYtPja6wWJ/o+sFr0bNjKajHj/D4mi3UP XzBZHH7TzmqxfsZrFgd+j1cX7rB4bF5S73F+xkJGj74tqxg9jt/YzuTxeZNcAFsUl01Kak5m WWqRvl0CV8bKg5PZC9bJVPTcv8fSwLhZvIuRg0NCwESic5Z/FyMnkCkmceHeerYuRi4OIYFF jBKHm9axQzgdTBLnlixkAqliEzCU6D3axwjSLCLgLbH8miJIDbPARSaJ03vfsYHUCAPFT2/d zQhiswioSjyYvJEFxOYVcJM4920ZI8RiBYk5k2xAwpwC7hLXe06zg9hCQCVzGs8yT2DkXcDI sIpRNLUguaA4KT3XSK84Mbe4NC9dLzk/dxMjOEyfSe9gXNVgcYhRgINRiYf3A+PpQCHWxLLi ytxDjBIczEoivG/mnwoU4k1JrKxKLcqPLyrNSS0+xCjNwaIkznuw1TpQSCA9sSQ1OzW1ILUI JsvEwSnVwGgjPWd906yj63mKLn1PT1lrEdnkcmzqofNbT+7jXVhvGPz6hJDqv+5DFl/eeiqz 1Ih9X74pxFxIbM3vS7M1TisEXGL5qB5wpnHJz3nabULT+eazRL9bm/5750aDS7IM7TcVs69F Lbig9lNw2tfcrjTnD893q2kmLRV4eG2u7L0N7m/CTVTUOtcrsRRnJBpqMRcVJwIAOS5jfU8C AAA= 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=-8.2 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 MIPI DSIM DPHY. The 'phy_label' field is added to the platform data structure to allow PHY lookup on non-dt platforms. Signed-off-by: Sylwester Nawrocki Signed-off-by: Kyungmin Park Acked-by: Felipe Balbi Acked-by: Donghwa Lee --- drivers/video/exynos/exynos_mipi_dsi.c | 18 +++++++++--------- include/video/exynos_mipi_dsim.h | 6 ++++-- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/drivers/video/exynos/exynos_mipi_dsi.c b/drivers/video/exynos/exynos_mipi_dsi.c index 32e5406..1f96004 100644 --- a/drivers/video/exynos/exynos_mipi_dsi.c +++ b/drivers/video/exynos/exynos_mipi_dsi.c @@ -156,8 +156,7 @@ static int exynos_mipi_dsi_blank_mode(struct mipi_dsim_device *dsim, int power) exynos_mipi_regulator_enable(dsim); /* enable MIPI-DSI PHY. */ - if (dsim->pd->phy_enable) - dsim->pd->phy_enable(pdev, true); + phy_power_on(dsim->phy); clk_enable(dsim->clock); @@ -373,6 +372,10 @@ static int exynos_mipi_dsi_probe(struct platform_device *pdev) return ret; } + dsim->phy = devm_phy_get(&pdev->dev, dsim_pd->phy_label); + if (IS_ERR(dsim->phy)) + return PTR_ERR(dsim->phy); + dsim->clock = devm_clk_get(&pdev->dev, "dsim0"); if (IS_ERR(dsim->clock)) { dev_err(&pdev->dev, "failed to get dsim clock source\n"); @@ -439,8 +442,7 @@ static int exynos_mipi_dsi_probe(struct platform_device *pdev) exynos_mipi_regulator_enable(dsim); /* enable MIPI-DSI PHY. */ - if (dsim->pd->phy_enable) - dsim->pd->phy_enable(pdev, true); + phy_power_on(dsim->phy); exynos_mipi_update_cfg(dsim); @@ -504,9 +506,8 @@ static int exynos_mipi_dsi_suspend(struct device *dev) if (client_drv && client_drv->suspend) client_drv->suspend(client_dev); - /* enable MIPI-DSI PHY. */ - if (dsim->pd->phy_enable) - dsim->pd->phy_enable(pdev, false); + /* disable MIPI-DSI PHY. */ + phy_power_off(dsim->phy); clk_disable(dsim->clock); @@ -536,8 +537,7 @@ static int exynos_mipi_dsi_resume(struct device *dev) exynos_mipi_regulator_enable(dsim); /* enable MIPI-DSI PHY. */ - if (dsim->pd->phy_enable) - dsim->pd->phy_enable(pdev, true); + phy_power_on(dsim->phy); clk_enable(dsim->clock); diff --git a/include/video/exynos_mipi_dsim.h b/include/video/exynos_mipi_dsim.h index 89dc88a..fd69beb 100644 --- a/include/video/exynos_mipi_dsim.h +++ b/include/video/exynos_mipi_dsim.h @@ -216,6 +216,7 @@ struct mipi_dsim_config { * automatically. * @e_clk_src: select byte clock source. * @pd: pointer to MIPI-DSI driver platform data. + * @phy: pointer to the generic PHY */ struct mipi_dsim_device { struct device *dev; @@ -236,6 +237,7 @@ struct mipi_dsim_device { bool suspended; struct mipi_dsim_platform_data *pd; + struct phy *phy; }; /* @@ -248,7 +250,7 @@ struct mipi_dsim_device { * @enabled: indicate whether mipi controller got enabled or not. * @lcd_panel_info: pointer for lcd panel specific structure. * this structure specifies width, height, timing and polarity and so on. - * @phy_enable: pointer to a callback controlling D-PHY enable/reset + * @phy_label: the generic PHY label */ struct mipi_dsim_platform_data { char lcd_panel_name[PANEL_NAME_SIZE]; @@ -257,7 +259,7 @@ struct mipi_dsim_platform_data { unsigned int enabled; void *lcd_panel_info; - int (*phy_enable)(struct platform_device *pdev, bool on); + const char *phy_label; }; /*