devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Donghwa Lee <dh09.lee@samsung.com>
To: Sylwester Nawrocki <s.nawrocki@samsung.com>
Cc: linux-arm-kernel@lists.infradead.org,
	linux-samsung-soc@vger.kernel.org, linux-fbdev@vger.kernel.org,
	kgene.kim@samsung.com, devicetree-discuss@lists.ozlabs.org,
	jg1.han@samsung.com, balbi@ti.com, kishon@ti.com,
	inki.dae@samsung.com, kyungmin.park@samsung.com,
	plagnioj@jcrosoft.com, t.figa@samsung.com,
	linux-media@vger.kernel.org, dh09.lee@samsung.com
Subject: Re: [PATCH v3 3/5] video: exynos_mipi_dsim: Use the generic PHY driver
Date: Fri, 28 Jun 2013 15:18:50 +0900	[thread overview]
Message-ID: <51CD2ACA.1000109@samsung.com> (raw)
In-Reply-To: <1372258946-15607-4-git-send-email-s.nawrocki@samsung.com>

On 06/28/2013 00:02, Sylwester Nawrocki wrote:
> 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 <s.nawrocki@samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> Acked-by: Felipe Balbi <balbi@ti.com>
> ---
>   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;
>   };
>   
>   /*
I confirmed that this patch operates well. It looks good to me.

Acked-by: Donghwa Lee <dh09.lee@samsung.com>

Thank you,
Donghwa Lee

  reply	other threads:[~2013-06-28  6:18 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-26 15:02 [PATCH v3 0/5] Generic PHY driver for the Exynos SoC MIPI CSI-2/DSI DPHYs Sylwester Nawrocki
2013-06-26 15:02 ` [PATCH v3 1/5] phy: Add driver for Exynos MIPI CSIS/DSIM DPHYs Sylwester Nawrocki
2013-06-27  7:52   ` Felipe Balbi
2013-06-27  8:37     ` Sylwester Nawrocki
2013-06-27  8:40       ` Felipe Balbi
2013-06-28  8:17   ` Hui Wang
2013-06-28 10:11     ` Sylwester Nawrocki
2013-06-29  8:57       ` Kishon Vijay Abraham I
2013-06-29 19:34         ` Sylwester Nawrocki
2013-07-01  5:24           ` Kishon Vijay Abraham I
2013-06-26 15:02 ` [PATCH v3 2/5] ARM: dts: Add MIPI PHY node to exynos4.dtsi Sylwester Nawrocki
2013-06-27  7:52   ` Felipe Balbi
2013-06-26 15:02 ` [PATCH v3 3/5] video: exynos_mipi_dsim: Use the generic PHY driver Sylwester Nawrocki
2013-06-28  6:18   ` Donghwa Lee [this message]
2013-06-26 15:02 ` [PATCH v3 4/5] exynos4-is: Use the generic MIPI CSIS " Sylwester Nawrocki
2013-06-26 15:02 ` [PATCH v3 5/5] ARM: Samsung: Remove the MIPI PHY setup code Sylwester Nawrocki
     [not found]   ` <1372258946-15607-6-git-send-email-s.nawrocki-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2013-06-27  9:34     ` Kukjin Kim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51CD2ACA.1000109@samsung.com \
    --to=dh09.lee@samsung.com \
    --cc=balbi@ti.com \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=inki.dae@samsung.com \
    --cc=jg1.han@samsung.com \
    --cc=kgene.kim@samsung.com \
    --cc=kishon@ti.com \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=plagnioj@jcrosoft.com \
    --cc=s.nawrocki@samsung.com \
    --cc=t.figa@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).