From patchwork Wed Oct 16 16:28:12 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kishon Vijay Abraham I X-Patchwork-Id: 3054641 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 C7CFFBF924 for ; Wed, 16 Oct 2013 16:30:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 96552204AD for ; Wed, 16 Oct 2013 16:30:56 +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 B7410203FB for ; Wed, 16 Oct 2013 16:30:51 +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 1VWTyZ-0003jp-4R; Wed, 16 Oct 2013 16:29:35 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VWTyG-00063f-TZ; Wed, 16 Oct 2013 16:29:16 +0000 Received: from arroyo.ext.ti.com ([192.94.94.40]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VWTxo-0005xz-CE for linux-arm-kernel@lists.infradead.org; Wed, 16 Oct 2013 16:28:51 +0000 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id r9GGSQcf032296; Wed, 16 Oct 2013 11:28:26 -0500 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id r9GGSQLI022390; Wed, 16 Oct 2013 11:28:26 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.2.342.3; Wed, 16 Oct 2013 11:28:26 -0500 Received: from a0393678ub.apr.dhcp.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id r9GGSHw3031445; Wed, 16 Oct 2013 11:28:24 -0500 From: Kishon Vijay Abraham I To: Subject: [PATCH 3/7] video: exynos_mipi_dsim: Use the generic PHY driver Date: Wed, 16 Oct 2013 21:58:12 +0530 Message-ID: <1381940896-9355-4-git-send-email-kishon@ti.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1381940896-9355-1-git-send-email-kishon@ti.com> References: <1381940896-9355-1-git-send-email-kishon@ti.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131016_122848_651624_84C73454 X-CRM114-Status: GOOD ( 11.97 ) X-Spam-Score: -7.4 (-------) Cc: kishon@ti.com, linux-fbdev@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.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.7 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 From: Sylwester Nawrocki Use the generic PHY API instead of the platform callback for the MIPI DSIM DPHY enable/reset control. Signed-off-by: Sylwester Nawrocki Signed-off-by: Kyungmin Park Acked-by: Felipe Balbi Acked-by: Donghwa Lee Acked-by: Tomi Valkeinen Signed-off-by: Kishon Vijay Abraham I --- drivers/video/exynos/Kconfig | 1 + drivers/video/exynos/exynos_mipi_dsi.c | 19 ++++++++++--------- include/video/exynos_mipi_dsim.h | 5 ++--- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/drivers/video/exynos/Kconfig b/drivers/video/exynos/Kconfig index 1b035b2..976594d 100644 --- a/drivers/video/exynos/Kconfig +++ b/drivers/video/exynos/Kconfig @@ -16,6 +16,7 @@ if EXYNOS_VIDEO config EXYNOS_MIPI_DSI bool "EXYNOS MIPI DSI driver support." depends on ARCH_S5PV210 || ARCH_EXYNOS + select GENERIC_PHY help This enables support for MIPI-DSI device. diff --git a/drivers/video/exynos/exynos_mipi_dsi.c b/drivers/video/exynos/exynos_mipi_dsi.c index 32e5406..00b3a52 100644 --- a/drivers/video/exynos/exynos_mipi_dsi.c +++ b/drivers/video/exynos/exynos_mipi_dsi.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -156,8 +157,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 +373,10 @@ static int exynos_mipi_dsi_probe(struct platform_device *pdev) return ret; } + dsim->phy = devm_phy_get(&pdev->dev, "dsim"); + 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 +443,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 +507,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 +538,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..6a578f8 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 MIPI-DSI 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,6 @@ 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 */ struct mipi_dsim_platform_data { char lcd_panel_name[PANEL_NAME_SIZE]; @@ -256,8 +257,6 @@ struct mipi_dsim_platform_data { struct mipi_dsim_config *dsim_config; unsigned int enabled; void *lcd_panel_info; - - int (*phy_enable)(struct platform_device *pdev, bool on); }; /*