From patchwork Sat Sep 28 19:27:46 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sylwester Nawrocki X-Patchwork-Id: 20251 X-Patchwork-Delegate: sylvester.nawrocki@gmail.com Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1VQ0Dz-00075b-Dk; Sat, 28 Sep 2013 21:30:43 +0200 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.72/mailfrontend-8) with esmtp id 1VQ0Dx-0007zl-kq; Sat, 28 Sep 2013 21:30:43 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754694Ab3I1Taj (ORCPT + 1 other); Sat, 28 Sep 2013 15:30:39 -0400 Received: from mail-ea0-f178.google.com ([209.85.215.178]:38610 "EHLO mail-ea0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752977Ab3I1Tah (ORCPT ); Sat, 28 Sep 2013 15:30:37 -0400 Received: by mail-ea0-f178.google.com with SMTP id a15so1815502eae.23 for ; Sat, 28 Sep 2013 12:30:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=R9dLr30p+EAac9iBPaMwp86PB80rS+b7J1sV6fgCIvc=; b=PuRp+Q9fAIscaqmTO9TKXW428wB7t45XPG8O1HCZ75gOzRFvsNlOLgZKY+5J09J/hJ KV25r+5rLBP1U+6/c64iNPcIkw9aXtZ2v+ePuADDKyKmkGSJkNbzLlGYI+Ixi/Pp6pPw ax26HW++Olc832Au+KWwE9Q6ZhO3GgJ1o89AB+KRg9aWNGAJI1cMFfbMWLCDm+jAqNHE nEwyaDPqLvjQP33vioowSy6ngWW4zW7X1UPrfg/2qwSKK693y1aAfT330xE+96QVOaul YQ66Mqma5/Djk94c2OWmlVvsg3mzM0ZF0W0k8JL8M/k6uvawwO9QTMDJ7H3kim9LuinP zidw== X-Received: by 10.15.99.72 with SMTP id bk48mr22276928eeb.22.1380396636321; Sat, 28 Sep 2013 12:30:36 -0700 (PDT) Received: from localhost.localdomain (093105185086.warszawa.vectranet.pl. [93.105.185.86]) by mx.google.com with ESMTPSA id f49sm30969241eec.7.1969.12.31.16.00.00 (version=TLSv1 cipher=RC4-SHA bits=128/128); Sat, 28 Sep 2013 12:30:35 -0700 (PDT) From: Sylwester Nawrocki To: kishon@ti.com Cc: gregkh@linuxfoundation.org, linux-media@vger.kernel.org, kyungmin.park@samsung.com, linux-arm-kernel@lists.infradead.org, kgene.kim@samsung.com, dh09.lee@samsung.com, jg1.han@samsung.com, tomi.valkeinen@ti.com, plagnioj@jcrosoft.com, linux-fbdev@vger.kernel.org, linux-samsung-soc@vger.kernel.org, Sylwester Nawrocki Subject: [PATCH V5 4/5] video: exynos_mipi_dsim: Use the generic PHY driver Date: Sat, 28 Sep 2013 21:27:46 +0200 Message-Id: <1380396467-29278-5-git-send-email-s.nawrocki@samsung.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1380396467-29278-1-git-send-email-s.nawrocki@samsung.com> References: <1380396467-29278-1-git-send-email-s.nawrocki@samsung.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 6.0.0.2142326, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2013.9.28.192048 X-PMX-Spam: Gauge=IIIIIIIII, Probability=9%, Report=' FORGED_FROM_GMAIL 0.1, MULTIPLE_RCPTS 0.1, HTML_00_01 0.05, HTML_00_10 0.05, BODY_SIZE_4000_4999 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, DKIM_SIGNATURE 0, URI_ENDS_IN_HTML 0, __ANY_URI 0, __CP_MEDIA_BODY 0, __CP_NOT_1 0, __CP_URI_IN_BODY 0, __FRAUD_WEBMAIL 0, __FRAUD_WEBMAIL_FROM 0, __FROM_GMAIL 0, __HAS_FROM 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __HAS_X_MAILING_LIST 0, __IN_REP_TO 0, __MIME_TEXT_ONLY 0, __MULTIPLE_RCPTS_CC_X2 0, __PHISH_SPEAR_STRUCTURE_1 0, __SANE_MSGID 0, __SUBJ_ALPHA_END 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_NO_WWW 0, __URI_NS , __YOUTUBE_RCVD 0' 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 --- Changes since v4: - PHY label removed from the platform data structure. --- 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(-) -- 1.7.4.1 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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); }; /*