Linux Framebuffer Layer development
 help / color / mirror / Atom feed
* Re: [PATCH V3 3/3] video: exynos_dp: Use the generic PHY driver
From: Kishon Vijay Abraham I @ 2013-07-01  6:39 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <005401ce761b$504d7090$f0e851b0$@samsung.com>

Hi,

On Monday 01 July 2013 10:54 AM, Jingoo Han wrote:
> Use the generic PHY API instead of the platform callback to control
> the DP PHY. The 'phy_label' field is added to the platform data
> structure to allow PHY lookup on non-dt platforms.
>
> Signed-off-by: Jingoo Han <jg1.han@samsung.com>
> Acked-by: Felipe Balbi <balbi@ti.com>
> ---
>   .../devicetree/bindings/video/exynos_dp.txt        |   23 +---
>   drivers/video/exynos/exynos_dp_core.c              |  118 ++------------------
>   drivers/video/exynos/exynos_dp_core.h              |    2 +
>   include/video/exynos_dp.h                          |    6 +-
>   4 files changed, 21 insertions(+), 128 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/video/exynos_dp.txt b/Documentation/devicetree/bindings/video/exynos_dp.txt
> index 84f10c1..71645dc 100644
> --- a/Documentation/devicetree/bindings/video/exynos_dp.txt
> +++ b/Documentation/devicetree/bindings/video/exynos_dp.txt
> @@ -1,17 +1,6 @@
>   The Exynos display port interface should be configured based on
>   the type of panel connected to it.
>
> -We use two nodes:
> -	-dp-controller node
> -	-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:
> -		Base address of DP PHY register.
> -	-samsung,enable-mask:
> -		The bit-mask used to enable/disable DP PHY.
> -
>   For the Panel initialization, we read data from dp-controller node.
>   Required properties for dp-controller:
>   	-compatible:
> @@ -25,6 +14,10 @@ Required properties for dp-controller:
>   		from common clock binding: handle to dp clock.
>   	-clock-names:
>   		from common clock binding: Shall be "dp".
> +	-phys:
> +		from general phy binding: the phandle for the PHY device.
> +	-phy-names:
> +		from general phy binding: Should be "dp".
>   	-interrupt-parent:
>   		phandle to Interrupt combiner node.
>   	-samsung,color-space:
> @@ -67,12 +60,8 @@ SOC specific portion:
>   		interrupt-parent = <&combiner>;
>   		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 12bbede..bac515b 100644
> --- a/drivers/video/exynos/exynos_dp_core.c
> +++ b/drivers/video/exynos/exynos_dp_core.c
> @@ -19,6 +19,7 @@
>   #include <linux/interrupt.h>
>   #include <linux/delay.h>
>   #include <linux/of.h>
> +#include <linux/phy/phy.h>
>
>   #include <video/exynos_dp.h>
>
> @@ -960,84 +961,15 @@ static struct exynos_dp_platdata *exynos_dp_dt_parse_pdata(struct device *dev)
>   		return ERR_PTR(-EINVAL);
>   	}
>
> -	return pd;
> -}
> -
> -static int exynos_dp_dt_parse_phydata(struct exynos_dp_device *dp)
> -{
> -	struct device_node *dp_phy_node = of_node_get(dp->dev->of_node);
> -	u32 phy_base;
> -	int ret = 0;
> -
> -	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;
> -	}
> -
> -	if (of_property_read_u32(dp_phy_node, "reg", &phy_base)) {
> -		dev_err(dp->dev, "failed to get reg for dptx-phy\n");
> -		ret = -EINVAL;
> -		goto err;
> -	}
> -
> -	if (of_property_read_u32(dp_phy_node, "samsung,enable-mask",
> -				&dp->enable_mask)) {
> -		dev_err(dp->dev, "failed to get enable-mask for dptx-phy\n");
> -		ret = -EINVAL;
> -		goto err;
> -	}
> -
> -	dp->phy_addr = ioremap(phy_base, SZ_4);
> -	if (!dp->phy_addr) {
> -		dev_err(dp->dev, "failed to ioremap dp-phy\n");
> -		ret = -ENOMEM;
> -		goto err;
> -	}
> -
> -err:
> -	of_node_put(dp_phy_node);
> -
> -	return ret;
> -}
> -
> -static void exynos_dp_phy_init(struct exynos_dp_device *dp)
> -{
> -	u32 reg;
> -
> -	reg = __raw_readl(dp->phy_addr);
> -	reg |= dp->enable_mask;
> -	__raw_writel(reg, dp->phy_addr);
> -}
> -
> -static void exynos_dp_phy_exit(struct exynos_dp_device *dp)
> -{
> -	u32 reg;
> +	pd->phy_label = "dp";

Felipe had a comment to change the label to *display-port* no?

Thanks
Kishon

^ permalink raw reply

* Re: [PATCH V3 3/3] video: exynos_dp: Use the generic PHY driver
From: Jingoo Han @ 2013-07-01  7:07 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <51D12164.6030507@ti.com>

On Monday, July 01, 2013 3:28 PM, Kishon Vijay Abraham I wrote:
> 
> Hi,
> 
> On Monday 01 July 2013 10:54 AM, Jingoo Han wrote:
> > Use the generic PHY API instead of the platform callback to control
> > the DP PHY. The 'phy_label' field is added to the platform data
> > structure to allow PHY lookup on non-dt platforms.
> >
> > Signed-off-by: Jingoo Han <jg1.han@samsung.com>
> > Acked-by: Felipe Balbi <balbi@ti.com>
> > ---
> >   .../devicetree/bindings/video/exynos_dp.txt        |   23 +---
> >   drivers/video/exynos/exynos_dp_core.c              |  118 ++------------------
> >   drivers/video/exynos/exynos_dp_core.h              |    2 +
> >   include/video/exynos_dp.h                          |    6 +-
> >   4 files changed, 21 insertions(+), 128 deletions(-)
> >
> > diff --git a/Documentation/devicetree/bindings/video/exynos_dp.txt
> b/Documentation/devicetree/bindings/video/exynos_dp.txt
> > index 84f10c1..71645dc 100644
> > --- a/Documentation/devicetree/bindings/video/exynos_dp.txt
> > +++ b/Documentation/devicetree/bindings/video/exynos_dp.txt
> > @@ -1,17 +1,6 @@
> >   The Exynos display port interface should be configured based on
> >   the type of panel connected to it.
> >
> > -We use two nodes:
> > -	-dp-controller node
> > -	-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:
> > -		Base address of DP PHY register.
> > -	-samsung,enable-mask:
> > -		The bit-mask used to enable/disable DP PHY.
> > -
> >   For the Panel initialization, we read data from dp-controller node.
> >   Required properties for dp-controller:
> >   	-compatible:
> > @@ -25,6 +14,10 @@ Required properties for dp-controller:
> >   		from common clock binding: handle to dp clock.
> >   	-clock-names:
> >   		from common clock binding: Shall be "dp".
> > +	-phys:
> > +		from general phy binding: the phandle for the PHY device.
> > +	-phy-names:
> > +		from general phy binding: Should be "dp".
> >   	-interrupt-parent:
> >   		phandle to Interrupt combiner node.
> >   	-samsung,color-space:
> > @@ -67,12 +60,8 @@ SOC specific portion:
> >   		interrupt-parent = <&combiner>;
> >   		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 12bbede..bac515b 100644
> > --- a/drivers/video/exynos/exynos_dp_core.c
> > +++ b/drivers/video/exynos/exynos_dp_core.c
> > @@ -19,6 +19,7 @@
> >   #include <linux/interrupt.h>
> >   #include <linux/delay.h>
> >   #include <linux/of.h>
> > +#include <linux/phy/phy.h>
> >
> >   #include <video/exynos_dp.h>
> >
> > @@ -960,84 +961,15 @@ static struct exynos_dp_platdata *exynos_dp_dt_parse_pdata(struct device *dev)
> >   		return ERR_PTR(-EINVAL);
> >   	}
> >
> > -	return pd;
> > -}
> > -
> > -static int exynos_dp_dt_parse_phydata(struct exynos_dp_device *dp)
> > -{
> > -	struct device_node *dp_phy_node = of_node_get(dp->dev->of_node);
> > -	u32 phy_base;
> > -	int ret = 0;
> > -
> > -	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;
> > -	}
> > -
> > -	if (of_property_read_u32(dp_phy_node, "reg", &phy_base)) {
> > -		dev_err(dp->dev, "failed to get reg for dptx-phy\n");
> > -		ret = -EINVAL;
> > -		goto err;
> > -	}
> > -
> > -	if (of_property_read_u32(dp_phy_node, "samsung,enable-mask",
> > -				&dp->enable_mask)) {
> > -		dev_err(dp->dev, "failed to get enable-mask for dptx-phy\n");
> > -		ret = -EINVAL;
> > -		goto err;
> > -	}
> > -
> > -	dp->phy_addr = ioremap(phy_base, SZ_4);
> > -	if (!dp->phy_addr) {
> > -		dev_err(dp->dev, "failed to ioremap dp-phy\n");
> > -		ret = -ENOMEM;
> > -		goto err;
> > -	}
> > -
> > -err:
> > -	of_node_put(dp_phy_node);
> > -
> > -	return ret;
> > -}
> > -
> > -static void exynos_dp_phy_init(struct exynos_dp_device *dp)
> > -{
> > -	u32 reg;
> > -
> > -	reg = __raw_readl(dp->phy_addr);
> > -	reg |= dp->enable_mask;
> > -	__raw_writel(reg, dp->phy_addr);
> > -}
> > -
> > -static void exynos_dp_phy_exit(struct exynos_dp_device *dp)
> > -{
> > -	u32 reg;
> > +	pd->phy_label = "dp";
> 
> Felipe had a comment to change the label to *display-port* no?

No, I don't think so. :)
I would like to use 'dp'.

Best regards,
Jingoo Han

> 
> Thanks
> Kishon


^ permalink raw reply

* Re: [RFC 2/6] x86: provide platform-devices for boot-framebuffers
From: Stephen Warren @ 2013-07-01 15:48 UTC (permalink / raw)
  To: David Herrmann
  Cc: dri-devel@lists.freedesktop.org, linux-kernel, Dave Airlie,
	linux-fbdev, Stephen Warren, Olof Johansson
In-Reply-To: <CANq1E4TJjmq2UFfarkdUF7s5KUPuzfUDiDU5BFfF-5QUsjpDwA@mail.gmail.com>

On 06/28/2013 04:11 AM, David Herrmann wrote:
> Hi
> 
> On Wed, Jun 26, 2013 at 10:49 PM, Stephen Warren <swarren@wwwdotorg.org> wrote:
>> On 06/24/2013 04:27 PM, David Herrmann wrote:
>>> The current situation regarding boot-framebuffers (VGA, VESA/VBE, EFI) on
>>> x86 causes troubles when loading multiple fbdev drivers. The global
>>> "struct screen_info" does not provide any state-tracking about which
>>> drivers use the FBs. request_mem_region() theoretically works, but
>>> unfortunately vesafb/efifb ignore it due to quirks for broken boards.
>>>
>>> Avoid this by creating a "platform-framebuffer" device with a pointer
>>> to the "struct screen_info" as platform-data. Drivers can now create
>>> platform-drivers and the driver-core will refuse multiple drivers being
>>> active simultaneously.
>>>
>>> We keep the screen_info available for backwards-compatibility. Drivers
>>> can be converted in follow-up patches.
>>>
>>> Apart from "platform-framebuffer" devices, this also introduces a
>>> compatibility option for "simple-framebuffer" drivers which recently got
>>> introduced for OF based systems. If CONFIG_X86_SYSFB is selected, we
>>> try to match the screen_info against a simple-framebuffer supported
>>> format. If we succeed, we create a "simple-framebuffer" device instead
>>> of a platform-framebuffer.
...

>>> diff --git a/arch/x86/kernel/sysfb.c b/arch/x86/kernel/sysfb.c
...
>>> +#else /* CONFIG_X86_SYSFB */
>>> +
>>> +static bool parse_mode(const struct screen_info *si,
>>> +                    struct simplefb_platform_data *mode)
>>> +{
>>> +     return false;
>>> +}
>>> +
>>> +static int create_simplefb(const struct screen_info *si,
>>> +                        const struct simplefb_platform_data *mode)
>>> +{
>>> +     return -EINVAL;
>>> +}
>>> +
>>> +#endif /* CONFIG_X86_SYSFB */
>>
>> Following on from my ifdef comment above, I believe those versions of
>> those functions will always cause add_sysfb() to return -ENODEV, so you
>> may as well provide a static inline for add_sysfb() instead.
> 
> No. add_sysfb() is supposed to always succeed. However, if
> parse_mode/create_simplefb fail, it creates a "platform-framebuffer"
> as fallback. I don't see any way to avoid these ifdefs. Considering
> the explanation above, could you elaborate how you think this should
> work?

Ah, I wasn't getting the fallback mechanism; that if creating a simplefb
wasn't possible or didn't succeed, a platformfb device would be created
instead.

Perhaps the following might be slightly clearer; there are certainly
fewer nesting levels:

static __init int add_sysfb(void)
{
	const struct screen_info *si = &screen_info;
	struct simplefb_platform_data mode;
	struct platform_device *pd;
	bool compatible = false;
	int ret;

	compatible = parse_mode(si, &mode);
	if (compatible) {
		ret = create_simplefb(si, &mode);
		if (!ret)
			return 0;
	}

	pd = platform_device_register_resndata(NULL,
					"platform-framebuffer", 0,
					NULL, 0, si, sizeof(*si));
	ret = IS_ERR(pd) ? PTR_ERR(pd) : 0;

	return ret;
}


^ permalink raw reply

* Re: [PATCH V3 3/3] video: exynos_dp: Use the generic PHY driver
From: Sylwester Nawrocki @ 2013-07-01 19:35 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <005401ce761b$504d7090$f0e851b0$@samsung.com>

Hi Jingoo,

On 07/01/2013 07:24 AM, Jingoo Han wrote:
> Use the generic PHY API instead of the platform callback to control
> the DP PHY. The 'phy_label' field is added to the platform data
> structure to allow PHY lookup on non-dt platforms.

Since Exynos is currently a dt-only platform upstream, how about
first making a pre-requisite patch that would remove support for
non-dt platforms from this driver ? I think you could now move the
content of file include/video/exynos_dp.h to e.g. drivers/video/
exynos/exynos_dp_core.h and remove the public exynos_dp.h file.
pdata->phy_init/exit could also be dropped and you wouldn't need
to care about non-dt support with the generic PHY API.

> Signed-off-by: Jingoo Han<jg1.han@samsung.com>
> Acked-by: Felipe Balbi<balbi@ti.com>
> ---
>   .../devicetree/bindings/video/exynos_dp.txt        |   23 +---
>   drivers/video/exynos/exynos_dp_core.c              |  118 ++------------------
>   drivers/video/exynos/exynos_dp_core.h              |    2 +
>   include/video/exynos_dp.h                          |    6 +-
>   4 files changed, 21 insertions(+), 128 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/video/exynos_dp.txt b/Documentation/devicetree/bindings/video/exynos_dp.txt
> index 84f10c1..71645dc 100644
> --- a/Documentation/devicetree/bindings/video/exynos_dp.txt
> +++ b/Documentation/devicetree/bindings/video/exynos_dp.txt
> @@ -1,17 +1,6 @@
>   The Exynos display port interface should be configured based on
>   the type of panel connected to it.
>
> -We use two nodes:
> -	-dp-controller node
> -	-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:
> -		Base address of DP PHY register.
> -	-samsung,enable-mask:
> -		The bit-mask used to enable/disable DP PHY.
> -
>   For the Panel initialization, we read data from dp-controller node.
>   Required properties for dp-controller:
>   	-compatible:
> @@ -25,6 +14,10 @@ Required properties for dp-controller:
>   		from common clock binding: handle to dp clock.
>   	-clock-names:
>   		from common clock binding: Shall be "dp".
> +	-phys:
> +		from general phy binding: the phandle for the PHY device.
> +	-phy-names:
> +		from general phy binding: Should be "dp".
>   	-interrupt-parent:
>   		phandle to Interrupt combiner node.
>   	-samsung,color-space:
> @@ -67,12 +60,8 @@ SOC specific portion:
>   		interrupt-parent =<&combiner>;
>   		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 12bbede..bac515b 100644
> --- a/drivers/video/exynos/exynos_dp_core.c
> +++ b/drivers/video/exynos/exynos_dp_core.c
> @@ -19,6 +19,7 @@
>   #include<linux/interrupt.h>
>   #include<linux/delay.h>
>   #include<linux/of.h>
> +#include<linux/phy/phy.h>
>
>   #include<video/exynos_dp.h>
>
> @@ -960,84 +961,15 @@ static struct exynos_dp_platdata *exynos_dp_dt_parse_pdata(struct device *dev)
>   		return ERR_PTR(-EINVAL);
>   	}
>
> -	return pd;
> -}
> -
> -static int exynos_dp_dt_parse_phydata(struct exynos_dp_device *dp)
> -{
> -	struct device_node *dp_phy_node = of_node_get(dp->dev->of_node);
> -	u32 phy_base;
> -	int ret = 0;
> -
> -	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;
> -	}
> -
> -	if (of_property_read_u32(dp_phy_node, "reg",&phy_base)) {
> -		dev_err(dp->dev, "failed to get reg for dptx-phy\n");
> -		ret = -EINVAL;
> -		goto err;
> -	}
> -
> -	if (of_property_read_u32(dp_phy_node, "samsung,enable-mask",
> -				&dp->enable_mask)) {
> -		dev_err(dp->dev, "failed to get enable-mask for dptx-phy\n");
> -		ret = -EINVAL;
> -		goto err;
> -	}
> -
> -	dp->phy_addr = ioremap(phy_base, SZ_4);
> -	if (!dp->phy_addr) {
> -		dev_err(dp->dev, "failed to ioremap dp-phy\n");
> -		ret = -ENOMEM;
> -		goto err;
> -	}
> -
> -err:
> -	of_node_put(dp_phy_node);
> -
> -	return ret;
> -}
> -
> -static void exynos_dp_phy_init(struct exynos_dp_device *dp)
> -{
> -	u32 reg;
> -
> -	reg = __raw_readl(dp->phy_addr);
> -	reg |= dp->enable_mask;
> -	__raw_writel(reg, dp->phy_addr);
> -}
> -
> -static void exynos_dp_phy_exit(struct exynos_dp_device *dp)
> -{
> -	u32 reg;
> +	pd->phy_label = "dp";
>
> -	reg = __raw_readl(dp->phy_addr);
> -	reg&= ~(dp->enable_mask);
> -	__raw_writel(reg, dp->phy_addr);
> +	return pd;
>   }

I'm afraid you cannot simply remove the above code, the original binding
still needs to be supported. As far as I can see Arndale and smdk5250 are
already users of that binding in mainline now.

Thus the benefits of adding the generic PHY support to this Display Port
controller driver are starting to be a bit questionable.

>   #else
>   static struct exynos_dp_platdata *exynos_dp_dt_parse_pdata(struct device *dev)
>   {
>   	return NULL;
>   }
> -
> -static int exynos_dp_dt_parse_phydata(struct exynos_dp_device *dp)
> -{
> -	return -EINVAL;
> -}
> -
> -static void exynos_dp_phy_init(struct exynos_dp_device *dp)
> -{
> -	return;
> -}
> -
> -static void exynos_dp_phy_exit(struct exynos_dp_device *dp)
> -{
> -	return;
> -}
>   #endif /* CONFIG_OF */

I think you could make the driver dependent on CONFIG_OF now and
related #ifdefs and !CONFIG_OF function stubs could be removed.

>   static int exynos_dp_probe(struct platform_device *pdev)
> @@ -1061,10 +993,6 @@ static int exynos_dp_probe(struct platform_device *pdev)
>   		pdata = exynos_dp_dt_parse_pdata(&pdev->dev);
>   		if (IS_ERR(pdata))
>   			return PTR_ERR(pdata);
> -
> -		ret = exynos_dp_dt_parse_phydata(dp);
> -		if (ret)
> -			return ret;
>   	} else {
>   		pdata = pdev->dev.platform_data;
>   		if (!pdata) {
> @@ -1073,6 +1001,10 @@ static int exynos_dp_probe(struct platform_device *pdev)
>   		}
>   	}
>
> +	dp->phy = devm_phy_get(&pdev->dev, pdata->phy_label);
> +	if (IS_ERR(dp->phy))
> +		return PTR_ERR(dp->phy);
> +
>   	dp->clock = devm_clk_get(&pdev->dev, "dp");
>   	if (IS_ERR(dp->clock)) {
>   		dev_err(&pdev->dev, "failed to get clock\n");
> @@ -1097,13 +1029,7 @@ static int exynos_dp_probe(struct platform_device *pdev)
>
>   	dp->video_info = pdata->video_info;
>
> -	if (pdev->dev.of_node) {
> -		if (dp->phy_addr)
> -			exynos_dp_phy_init(dp);
> -	} else {
> -		if (pdata->phy_init)
> -			pdata->phy_init();
> -	}
> +	phy_power_on(dp->phy);
>
>   	exynos_dp_init_dp(dp);
>
> @@ -1121,42 +1047,27 @@ static int exynos_dp_probe(struct platform_device *pdev)
>
>   static int exynos_dp_remove(struct platform_device *pdev)
>   {
> -	struct exynos_dp_platdata *pdata = pdev->dev.platform_data;
>   	struct exynos_dp_device *dp = platform_get_drvdata(pdev);
>
>   	flush_work(&dp->hotplug_work);
>
> -	if (pdev->dev.of_node) {
> -		if (dp->phy_addr)
> -			exynos_dp_phy_exit(dp);
> -	} else {
> -		if (pdata->phy_exit)
> -			pdata->phy_exit();
> -	}
> +	phy_power_off(dp->phy);
>
>   	clk_disable_unprepare(dp->clock);
>
> -
>   	return 0;
>   }
>
>   #ifdef CONFIG_PM_SLEEP
>   static int exynos_dp_suspend(struct device *dev)
>   {
> -	struct exynos_dp_platdata *pdata = dev->platform_data;
>   	struct exynos_dp_device *dp = dev_get_drvdata(dev);
>
>   	disable_irq(dp->irq);
>
>   	flush_work(&dp->hotplug_work);
>
> -	if (dev->of_node) {
> -		if (dp->phy_addr)
> -			exynos_dp_phy_exit(dp);
> -	} else {
> -		if (pdata->phy_exit)
> -			pdata->phy_exit();
> -	}
> +	phy_power_off(dp->phy);
>
>   	clk_disable_unprepare(dp->clock);
>
> @@ -1165,16 +1076,9 @@ static int exynos_dp_suspend(struct device *dev)
>
>   static int exynos_dp_resume(struct device *dev)
>   {
> -	struct exynos_dp_platdata *pdata = dev->platform_data;
>   	struct exynos_dp_device *dp = dev_get_drvdata(dev);
>
> -	if (dev->of_node) {
> -		if (dp->phy_addr)
> -			exynos_dp_phy_init(dp);
> -	} else {
> -		if (pdata->phy_init)
> -			pdata->phy_init();
> -	}
> +	phy_power_on(dp->phy);
>
>   	clk_prepare_enable(dp->clock);
>
> diff --git a/drivers/video/exynos/exynos_dp_core.h b/drivers/video/exynos/exynos_dp_core.h
> index 6c567bbf..b3d0328 100644
> --- a/drivers/video/exynos/exynos_dp_core.h
> +++ b/drivers/video/exynos/exynos_dp_core.h
> @@ -42,6 +42,8 @@ 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 */
> diff --git a/include/video/exynos_dp.h b/include/video/exynos_dp.h
> index bd8cabd..f38c9af 100644
> --- a/include/video/exynos_dp.h
> +++ b/include/video/exynos_dp.h
> @@ -122,10 +122,8 @@ struct video_info {
>   };
>
>   struct exynos_dp_platdata {

Since Exynos doesn't support non-dt boot now this platform data structure
is not used, is it ?

> -	struct video_info *video_info;
> -
> -	void (*phy_init)(void);
> -	void (*phy_exit)(void);
> +	struct video_info	*video_info;
> +	const char		*phy_label;
>   };
>
>   #endif /* _EXYNOS_DP_H */

Regards,
Sylwester

^ permalink raw reply

* Re: [PATCH V3 2/3] phy: Add driver for Exynos DP PHY
From: Sylwester Nawrocki @ 2013-07-01 19:48 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <005301ce761b$32adf960$9809ec20$@samsung.com>

On 07/01/2013 07:24 AM, Jingoo Han wrote:
> Add a PHY provider driver for the Samsung Exynos SoC DP PHY.
>
> Signed-off-by: Jingoo Han<jg1.han@samsung.com>
> Cc: Sylwester Nawrocki<s.nawrocki@samsung.com>
> Acked-by: Felipe Balbi<balbi@ti.com>
> ---
>   .../devicetree/bindings/phy/samsung-phy.txt        |    8 ++
>   drivers/phy/Kconfig                                |    5 +
>   drivers/phy/Makefile                               |    1 +
>   drivers/phy/phy-exynos-dp-video.c                  |  118 ++++++++++++++++++++
>   4 files changed, 132 insertions(+)
>   create mode 100644 drivers/phy/phy-exynos-dp-video.c
>
> diff --git a/Documentation/devicetree/bindings/phy/samsung-phy.txt b/Documentation/devicetree/bindings/phy/samsung-phy.txt
> index 5ff208c..3fb656a 100644
> --- a/Documentation/devicetree/bindings/phy/samsung-phy.txt
> +++ b/Documentation/devicetree/bindings/phy/samsung-phy.txt
> @@ -12,3 +12,11 @@ the PHY specifier identifies the PHY and its meaning is as follows:
>     1 - MIPI DSIM 0,
>     2 - MIPI CSIS 1,
>     3 - MIPI DSIM 1.
> +
> +Samsung EXYNOS SoC series DP PHY

I would make it "Samsung EXYNOS SoC series Display Port PHY"

> +-------------------------------------------------
> +
> +Required properties:
> +- compatible : should be "samsung,exynos5250-dp-video-phy";
> +- reg : offset and length of the DP PHY register set;
> +- #phy-cells : from the generic phy bindings, must be 0;

s/phy/PHY ?

> \ No newline at end of file

Missing new line character.

> diff --git a/drivers/phy/Kconfig b/drivers/phy/Kconfig
> index 6f446d0..760f55a 100644
> --- a/drivers/phy/Kconfig
> +++ b/drivers/phy/Kconfig
> @@ -19,4 +19,9 @@ config PHY_EXYNOS_MIPI_VIDEO
>   	help
>   	  Support for MIPI CSI-2 and MIPI DSI DPHY found on Samsung
>   	  S5P and EXYNOS SoCs.
> +
> +config PHY_EXYNOS_DP_VIDEO
> +	tristate "EXYNOS SoC series DP PHY driver"

"EXYNOS SoC series Display Port PHY driver" ?

> +	help
> +	  Support for DP PHY found on Samsung EXYNOS SoCs.

s/DP/Display Port ?

>   endif
> diff --git a/drivers/phy/Makefile b/drivers/phy/Makefile
> index 71d8841..0fd1340 100644
> --- a/drivers/phy/Makefile
> +++ b/drivers/phy/Makefile
> @@ -4,3 +4,4 @@
>
>   obj-$(CONFIG_GENERIC_PHY)		+= phy-core.o
>   obj-$(CONFIG_PHY_EXYNOS_MIPI_VIDEO)	+= phy-exynos-mipi-video.o
> +obj-$(CONFIG_PHY_EXYNOS_DP_VIDEO)	+= phy-exynos-dp-video.o
> diff --git a/drivers/phy/phy-exynos-dp-video.c b/drivers/phy/phy-exynos-dp-video.c
> new file mode 100644
> index 0000000..75e1d11
> --- /dev/null
> +++ b/drivers/phy/phy-exynos-dp-video.c
> @@ -0,0 +1,118 @@
> +/*
> + * Samsung EXYNOS SoC series DP PHY driver

s/DP/Display Port ?

> + *
> + * Copyright (C) 2013 Samsung Electronics Co., Ltd.
> + * Author: Jingoo Han<jg1.han@samsung.com>
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + */
> +
> +#include<linux/io.h>
> +#include<linux/kernel.h>
> +#include<linux/module.h>
> +#include<linux/of.h>
> +#include<linux/of_address.h>
> +#include<linux/phy/phy.h>
> +#include<linux/platform_device.h>
> +
> +/* DPTX_PHY_CONTROL register */
> +#define EXYNOS_DPTX_PHY_ENABLE		(1<<  0)
> +
> +struct exynos_dp_video_phy {
> +	void __iomem *regs;
> +};
> +
> +static int __set_phy_state(struct exynos_dp_video_phy *state, unsigned int on)
> +{
> +	void __iomem *addr;

How about just dropping this local variable ?

> +	u32 reg;
> +
> +	addr = state->regs;
> +
> +	reg = readl(addr);
> +	if (on)
> +		reg |= EXYNOS_DPTX_PHY_ENABLE;
> +	else
> +		reg&= ~EXYNOS_DPTX_PHY_ENABLE;
> +	writel(reg, addr);
> +
> +	return 0;
> +}
> +
> +static int exynos_dp_video_phy_power_on(struct phy *phy)
> +{
> +	struct exynos_dp_video_phy *state = phy_get_drvdata(phy);
> +
> +	return __set_phy_state(state, 1);
> +}
> +
> +static int exynos_dp_video_phy_power_off(struct phy *phy)
> +{
> +	struct exynos_dp_video_phy *state = phy_get_drvdata(phy);
> +
> +	return __set_phy_state(state, 0);
> +}
> +
> +static struct phy_ops exynos_dp_video_phy_ops = {
> +	.power_on	= exynos_dp_video_phy_power_on,
> +	.power_off	= exynos_dp_video_phy_power_off,
> +	.owner		= THIS_MODULE,
> +};
> +
> +static int exynos_dp_video_phy_probe(struct platform_device *pdev)
> +{
> +	struct exynos_dp_video_phy *state;
> +	struct device *dev =&pdev->dev;
> +	struct resource *res;
> +	struct phy_provider *phy_provider;
> +	struct phy *phy;
> +
> +	state = devm_kzalloc(dev, sizeof(*state), GFP_KERNEL);
> +	if (!state)
> +		return -ENOMEM;
> +
> +	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> +
> +	state->regs = devm_ioremap_resource(dev, res);
> +	if (IS_ERR(state->regs))
> +		return PTR_ERR(state->regs);
> +
> +	dev_set_drvdata(dev, state);

I can't see any corresponding dev_get_drvdata(), it should be safe
to remove this assignment.

> +	phy_provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate);
> +	if (IS_ERR(phy_provider))
> +		return PTR_ERR(phy_provider);
> +
> +	phy = devm_phy_create(dev, 0,&exynos_dp_video_phy_ops, "dp");

The label could be NULL, since there is no need to support non-dt config.

> +	if (IS_ERR(phy)) {
> +		dev_err(dev, "failed to create DP PHY\n");
> +		return PTR_ERR(phy);
> +	}
> +	phy_set_drvdata(phy, state);
> +
> +	return 0;
> +}
> +
> +#ifdef CONFIG_OF

You don't use of_match_ptr() macro to assign of_match_table to the driver
structure below. This means build with CONFIG_OF disabled is broken now.
I would just remove that #ifdef and would make the driver depends on
CONFIG_OF.

> +static const struct of_device_id exynos_dp_video_phy_of_match[] = {
> +	{ .compatible = "samsung,exynos5250-dp-video-phy" },
> +	{ },
> +};
> +MODULE_DEVICE_TABLE(of, exynos_dp_video_phy_of_match);
> +#endif
> +
> +static struct platform_driver exynos_dp_video_phy_driver = {
> +	.probe	= exynos_dp_video_phy_probe,
> +	.driver = {
> +		.name	= "exynos-dp-video-phy",
> +		.owner	= THIS_MODULE,
> +		.of_match_table	= exynos_dp_video_phy_of_match,
> +	}
> +};
> +module_platform_driver(exynos_dp_video_phy_driver);
> +
> +MODULE_AUTHOR("Jingoo Han<jg1.han@samsung.com>");
> +MODULE_DESCRIPTION("Samsung EXYNOS SoC DP PHY driver");
> +MODULE_LICENSE("GPL v2");

Thanks,
Sylwester

^ permalink raw reply

* [patch -next] fb: fix recent breakage in correct_chipset()
From: Dan Carpenter @ 2013-07-02  6:28 UTC (permalink / raw)
  To: linux-fbdev

The 6e36308a6f "fb: fix atyfb build warning" isn't right.  It makes all
the indexes off by one.  This patch reverts it and casts the
ARRAY_SIZE() to int to silence the build warning.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/video/aty/atyfb_base.c b/drivers/video/aty/atyfb_base.c
index a89c15d..9b0f12c 100644
--- a/drivers/video/aty/atyfb_base.c
+++ b/drivers/video/aty/atyfb_base.c
@@ -435,8 +435,8 @@ static int correct_chipset(struct atyfb_par *par)
 	const char *name;
 	int i;
 
-	for (i = ARRAY_SIZE(aty_chips); i > 0; i--)
-		if (par->pci_id = aty_chips[i - 1].pci_id)
+	for (i = (int)ARRAY_SIZE(aty_chips) - 1; i >= 0; i--)
+		if (par->pci_id = aty_chips[i].pci_id)
 			break;
 
 	if (i < 0)

^ permalink raw reply related

* Re: [PATCH V3 2/3] phy: Add driver for Exynos DP PHY
From: Jingoo Han @ 2013-07-02  6:58 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <51D1DCF0.50803@gmail.com>

On Tuesday, July 02, 2013 4:48 AM, Sylwester Nawrocki wrote:
> On 07/01/2013 07:24 AM, Jingoo Han wrote:
> > Add a PHY provider driver for the Samsung Exynos SoC DP PHY.
> >
> > Signed-off-by: Jingoo Han<jg1.han@samsung.com>
> > Cc: Sylwester Nawrocki<s.nawrocki@samsung.com>
> > Acked-by: Felipe Balbi<balbi@ti.com>
> > ---
> >   .../devicetree/bindings/phy/samsung-phy.txt        |    8 ++
> >   drivers/phy/Kconfig                                |    5 +
> >   drivers/phy/Makefile                               |    1 +
> >   drivers/phy/phy-exynos-dp-video.c                  |  118 ++++++++++++++++++++
> >   4 files changed, 132 insertions(+)
> >   create mode 100644 drivers/phy/phy-exynos-dp-video.c
> >
> > diff --git a/Documentation/devicetree/bindings/phy/samsung-phy.txt
> b/Documentation/devicetree/bindings/phy/samsung-phy.txt
> > index 5ff208c..3fb656a 100644
> > --- a/Documentation/devicetree/bindings/phy/samsung-phy.txt
> > +++ b/Documentation/devicetree/bindings/phy/samsung-phy.txt
> > @@ -12,3 +12,11 @@ the PHY specifier identifies the PHY and its meaning is as follows:
> >     1 - MIPI DSIM 0,
> >     2 - MIPI CSIS 1,
> >     3 - MIPI DSIM 1.
> > +
> > +Samsung EXYNOS SoC series DP PHY
> 
> I would make it "Samsung EXYNOS SoC series Display Port PHY"

OK.

> 
> > +-------------------------------------------------
> > +
> > +Required properties:
> > +- compatible : should be "samsung,exynos5250-dp-video-phy";
> > +- reg : offset and length of the DP PHY register set;
> > +- #phy-cells : from the generic phy bindings, must be 0;
> 
> s/phy/PHY ?

OK.

> 
> > \ No newline at end of file
> 
> Missing new line character.

OK.

> 
> > diff --git a/drivers/phy/Kconfig b/drivers/phy/Kconfig
> > index 6f446d0..760f55a 100644
> > --- a/drivers/phy/Kconfig
> > +++ b/drivers/phy/Kconfig
> > @@ -19,4 +19,9 @@ config PHY_EXYNOS_MIPI_VIDEO
> >   	help
> >   	  Support for MIPI CSI-2 and MIPI DSI DPHY found on Samsung
> >   	  S5P and EXYNOS SoCs.
> > +
> > +config PHY_EXYNOS_DP_VIDEO
> > +	tristate "EXYNOS SoC series DP PHY driver"
> 
> "EXYNOS SoC series Display Port PHY driver" ?
> 
> > +	help
> > +	  Support for DP PHY found on Samsung EXYNOS SoCs.
> 
> s/DP/Display Port ?

OK.

> 
> >   endif
> > diff --git a/drivers/phy/Makefile b/drivers/phy/Makefile
> > index 71d8841..0fd1340 100644
> > --- a/drivers/phy/Makefile
> > +++ b/drivers/phy/Makefile
> > @@ -4,3 +4,4 @@
> >
> >   obj-$(CONFIG_GENERIC_PHY)		+= phy-core.o
> >   obj-$(CONFIG_PHY_EXYNOS_MIPI_VIDEO)	+= phy-exynos-mipi-video.o
> > +obj-$(CONFIG_PHY_EXYNOS_DP_VIDEO)	+= phy-exynos-dp-video.o
> > diff --git a/drivers/phy/phy-exynos-dp-video.c b/drivers/phy/phy-exynos-dp-video.c
> > new file mode 100644
> > index 0000000..75e1d11
> > --- /dev/null
> > +++ b/drivers/phy/phy-exynos-dp-video.c
> > @@ -0,0 +1,118 @@
> > +/*
> > + * Samsung EXYNOS SoC series DP PHY driver
> 
> s/DP/Display Port ?

OK.

> 
> > + *
> > + * Copyright (C) 2013 Samsung Electronics Co., Ltd.
> > + * Author: Jingoo Han<jg1.han@samsung.com>
> > + *
> > + * This program is free software; you can redistribute it and/or modify
> > + * it under the terms of the GNU General Public License version 2 as
> > + * published by the Free Software Foundation.
> > + */
> > +
> > +#include<linux/io.h>
> > +#include<linux/kernel.h>
> > +#include<linux/module.h>
> > +#include<linux/of.h>
> > +#include<linux/of_address.h>
> > +#include<linux/phy/phy.h>
> > +#include<linux/platform_device.h>
> > +
> > +/* DPTX_PHY_CONTROL register */
> > +#define EXYNOS_DPTX_PHY_ENABLE		(1<<  0)
> > +
> > +struct exynos_dp_video_phy {
> > +	void __iomem *regs;
> > +};
> > +
> > +static int __set_phy_state(struct exynos_dp_video_phy *state, unsigned int on)
> > +{
> > +	void __iomem *addr;
> 
> How about just dropping this local variable ?

OK.
I will drop this local variable.

> 
> > +	u32 reg;
> > +
> > +	addr = state->regs;
> > +
> > +	reg = readl(addr);
> > +	if (on)
> > +		reg |= EXYNOS_DPTX_PHY_ENABLE;
> > +	else
> > +		reg&= ~EXYNOS_DPTX_PHY_ENABLE;
> > +	writel(reg, addr);
> > +
> > +	return 0;
> > +}
> > +
> > +static int exynos_dp_video_phy_power_on(struct phy *phy)
> > +{
> > +	struct exynos_dp_video_phy *state = phy_get_drvdata(phy);
> > +
> > +	return __set_phy_state(state, 1);
> > +}
> > +
> > +static int exynos_dp_video_phy_power_off(struct phy *phy)
> > +{
> > +	struct exynos_dp_video_phy *state = phy_get_drvdata(phy);
> > +
> > +	return __set_phy_state(state, 0);
> > +}
> > +
> > +static struct phy_ops exynos_dp_video_phy_ops = {
> > +	.power_on	= exynos_dp_video_phy_power_on,
> > +	.power_off	= exynos_dp_video_phy_power_off,
> > +	.owner		= THIS_MODULE,
> > +};
> > +
> > +static int exynos_dp_video_phy_probe(struct platform_device *pdev)
> > +{
> > +	struct exynos_dp_video_phy *state;
> > +	struct device *dev =&pdev->dev;
> > +	struct resource *res;
> > +	struct phy_provider *phy_provider;
> > +	struct phy *phy;
> > +
> > +	state = devm_kzalloc(dev, sizeof(*state), GFP_KERNEL);
> > +	if (!state)
> > +		return -ENOMEM;
> > +
> > +	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> > +
> > +	state->regs = devm_ioremap_resource(dev, res);
> > +	if (IS_ERR(state->regs))
> > +		return PTR_ERR(state->regs);
> > +
> > +	dev_set_drvdata(dev, state);
> 
> I can't see any corresponding dev_get_drvdata(), it should be safe
> to remove this assignment.

OK.
I will remove 'dev_set_drvdata(dev, state)'.

> 
> > +	phy_provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate);
> > +	if (IS_ERR(phy_provider))
> > +		return PTR_ERR(phy_provider);
> > +
> > +	phy = devm_phy_create(dev, 0,&exynos_dp_video_phy_ops, "dp");
> 
> The label could be NULL, since there is no need to support non-dt config.

OK.
I will replace "dp" with NULL.

> 
> > +	if (IS_ERR(phy)) {
> > +		dev_err(dev, "failed to create DP PHY\n");
> > +		return PTR_ERR(phy);
> > +	}
> > +	phy_set_drvdata(phy, state);
> > +
> > +	return 0;
> > +}
> > +
> > +#ifdef CONFIG_OF
> 
> You don't use of_match_ptr() macro to assign of_match_table to the driver
> structure below. This means build with CONFIG_OF disabled is broken now.
> I would just remove that #ifdef and would make the driver depends on
> CONFIG_OF.

OK.
I will add 'depends on OF', then remove '#ifdef CONFIG_OF'.

Thank you for your detailed comment. :)

Best regards,
Jingoo Han

> 
> > +static const struct of_device_id exynos_dp_video_phy_of_match[] = {
> > +	{ .compatible = "samsung,exynos5250-dp-video-phy" },
> > +	{ },
> > +};
> > +MODULE_DEVICE_TABLE(of, exynos_dp_video_phy_of_match);
> > +#endif
> > +
> > +static struct platform_driver exynos_dp_video_phy_driver = {
> > +	.probe	= exynos_dp_video_phy_probe,
> > +	.driver = {
> > +		.name	= "exynos-dp-video-phy",
> > +		.owner	= THIS_MODULE,
> > +		.of_match_table	= exynos_dp_video_phy_of_match,
> > +	}
> > +};
> > +module_platform_driver(exynos_dp_video_phy_driver);
> > +
> > +MODULE_AUTHOR("Jingoo Han<jg1.han@samsung.com>");
> > +MODULE_DESCRIPTION("Samsung EXYNOS SoC DP PHY driver");
> > +MODULE_LICENSE("GPL v2");
> 
> Thanks,
> Sylwester


^ permalink raw reply

* Re: [PATCH V3 3/3] video: exynos_dp: Use the generic PHY driver
From: Jingoo Han @ 2013-07-02  7:05 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <51D1DA07.3010803@gmail.com>

On Tuesday, July 02, 2013 4:36 AM, Sylwester Nawrocki wrote:
> 
> Hi Jingoo,
> 
> On 07/01/2013 07:24 AM, Jingoo Han wrote:
> > Use the generic PHY API instead of the platform callback to control
> > the DP PHY. The 'phy_label' field is added to the platform data
> > structure to allow PHY lookup on non-dt platforms.
> 
> Since Exynos is currently a dt-only platform upstream, how about
> first making a pre-requisite patch that would remove support for
> non-dt platforms from this driver ? I think you could now move the
> content of file include/video/exynos_dp.h to e.g. drivers/video/
> exynos/exynos_dp_core.h and remove the public exynos_dp.h file.
> pdata->phy_init/exit could also be dropped and you wouldn't need
> to care about non-dt support with the generic PHY API.

Yes, you're right.

I will make the pre-requisite patch that would remove support for
non-dt platforms from exynos_dp_core.c.
Then, I will move the content of file include/video/exynos_dp.h
and remove 'exynos_dp.h' file.

> 
> > Signed-off-by: Jingoo Han<jg1.han@samsung.com>
> > Acked-by: Felipe Balbi<balbi@ti.com>
> > ---
> >   .../devicetree/bindings/video/exynos_dp.txt        |   23 +---
> >   drivers/video/exynos/exynos_dp_core.c              |  118 ++------------------
> >   drivers/video/exynos/exynos_dp_core.h              |    2 +
> >   include/video/exynos_dp.h                          |    6 +-
> >   4 files changed, 21 insertions(+), 128 deletions(-)
> >
> > diff --git a/Documentation/devicetree/bindings/video/exynos_dp.txt
> b/Documentation/devicetree/bindings/video/exynos_dp.txt
> > index 84f10c1..71645dc 100644
> > --- a/Documentation/devicetree/bindings/video/exynos_dp.txt
> > +++ b/Documentation/devicetree/bindings/video/exynos_dp.txt
> > @@ -1,17 +1,6 @@
> >   The Exynos display port interface should be configured based on
> >   the type of panel connected to it.
> >
> > -We use two nodes:
> > -	-dp-controller node
> > -	-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:
> > -		Base address of DP PHY register.
> > -	-samsung,enable-mask:
> > -		The bit-mask used to enable/disable DP PHY.
> > -
> >   For the Panel initialization, we read data from dp-controller node.
> >   Required properties for dp-controller:
> >   	-compatible:
> > @@ -25,6 +14,10 @@ Required properties for dp-controller:
> >   		from common clock binding: handle to dp clock.
> >   	-clock-names:
> >   		from common clock binding: Shall be "dp".
> > +	-phys:
> > +		from general phy binding: the phandle for the PHY device.
> > +	-phy-names:
> > +		from general phy binding: Should be "dp".
> >   	-interrupt-parent:
> >   		phandle to Interrupt combiner node.
> >   	-samsung,color-space:
> > @@ -67,12 +60,8 @@ SOC specific portion:
> >   		interrupt-parent =<&combiner>;
> >   		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 12bbede..bac515b 100644
> > --- a/drivers/video/exynos/exynos_dp_core.c
> > +++ b/drivers/video/exynos/exynos_dp_core.c
> > @@ -19,6 +19,7 @@
> >   #include<linux/interrupt.h>
> >   #include<linux/delay.h>
> >   #include<linux/of.h>
> > +#include<linux/phy/phy.h>
> >
> >   #include<video/exynos_dp.h>
> >
> > @@ -960,84 +961,15 @@ static struct exynos_dp_platdata *exynos_dp_dt_parse_pdata(struct device *dev)
> >   		return ERR_PTR(-EINVAL);
> >   	}
> >
> > -	return pd;
> > -}
> > -
> > -static int exynos_dp_dt_parse_phydata(struct exynos_dp_device *dp)
> > -{
> > -	struct device_node *dp_phy_node = of_node_get(dp->dev->of_node);
> > -	u32 phy_base;
> > -	int ret = 0;
> > -
> > -	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;
> > -	}
> > -
> > -	if (of_property_read_u32(dp_phy_node, "reg",&phy_base)) {
> > -		dev_err(dp->dev, "failed to get reg for dptx-phy\n");
> > -		ret = -EINVAL;
> > -		goto err;
> > -	}
> > -
> > -	if (of_property_read_u32(dp_phy_node, "samsung,enable-mask",
> > -				&dp->enable_mask)) {
> > -		dev_err(dp->dev, "failed to get enable-mask for dptx-phy\n");
> > -		ret = -EINVAL;
> > -		goto err;
> > -	}
> > -
> > -	dp->phy_addr = ioremap(phy_base, SZ_4);
> > -	if (!dp->phy_addr) {
> > -		dev_err(dp->dev, "failed to ioremap dp-phy\n");
> > -		ret = -ENOMEM;
> > -		goto err;
> > -	}
> > -
> > -err:
> > -	of_node_put(dp_phy_node);
> > -
> > -	return ret;
> > -}
> > -
> > -static void exynos_dp_phy_init(struct exynos_dp_device *dp)
> > -{
> > -	u32 reg;
> > -
> > -	reg = __raw_readl(dp->phy_addr);
> > -	reg |= dp->enable_mask;
> > -	__raw_writel(reg, dp->phy_addr);
> > -}
> > -
> > -static void exynos_dp_phy_exit(struct exynos_dp_device *dp)
> > -{
> > -	u32 reg;
> > +	pd->phy_label = "dp";
> >
> > -	reg = __raw_readl(dp->phy_addr);
> > -	reg&= ~(dp->enable_mask);
> > -	__raw_writel(reg, dp->phy_addr);
> > +	return pd;
> >   }
> 
> I'm afraid you cannot simply remove the above code, the original binding
> still needs to be supported. As far as I can see Arndale and smdk5250 are
> already users of that binding in mainline now.
> 
> Thus the benefits of adding the generic PHY support to this Display Port
> controller driver are starting to be a bit questionable.

OK.
I will keep supporting this original DT binding.

> 
> >   #else
> >   static struct exynos_dp_platdata *exynos_dp_dt_parse_pdata(struct device *dev)
> >   {
> >   	return NULL;
> >   }
> > -
> > -static int exynos_dp_dt_parse_phydata(struct exynos_dp_device *dp)
> > -{
> > -	return -EINVAL;
> > -}
> > -
> > -static void exynos_dp_phy_init(struct exynos_dp_device *dp)
> > -{
> > -	return;
> > -}
> > -
> > -static void exynos_dp_phy_exit(struct exynos_dp_device *dp)
> > -{
> > -	return;
> > -}
> >   #endif /* CONFIG_OF */
> 
> I think you could make the driver dependent on CONFIG_OF now and
> related #ifdefs and !CONFIG_OF function stubs could be removed.

OK.
I will add 'depends on OF', then remove '#ifdef CONFIG_OF'
as well as !CONFIG_OF function stubs.

> 
> >   static int exynos_dp_probe(struct platform_device *pdev)
> > @@ -1061,10 +993,6 @@ static int exynos_dp_probe(struct platform_device *pdev)
> >   		pdata = exynos_dp_dt_parse_pdata(&pdev->dev);
> >   		if (IS_ERR(pdata))
> >   			return PTR_ERR(pdata);
> > -
> > -		ret = exynos_dp_dt_parse_phydata(dp);
> > -		if (ret)
> > -			return ret;
> >   	} else {
> >   		pdata = pdev->dev.platform_data;
> >   		if (!pdata) {
> > @@ -1073,6 +1001,10 @@ static int exynos_dp_probe(struct platform_device *pdev)
> >   		}
> >   	}
> >
> > +	dp->phy = devm_phy_get(&pdev->dev, pdata->phy_label);
> > +	if (IS_ERR(dp->phy))
> > +		return PTR_ERR(dp->phy);
> > +
> >   	dp->clock = devm_clk_get(&pdev->dev, "dp");
> >   	if (IS_ERR(dp->clock)) {
> >   		dev_err(&pdev->dev, "failed to get clock\n");
> > @@ -1097,13 +1029,7 @@ static int exynos_dp_probe(struct platform_device *pdev)
> >
> >   	dp->video_info = pdata->video_info;
> >
> > -	if (pdev->dev.of_node) {
> > -		if (dp->phy_addr)
> > -			exynos_dp_phy_init(dp);
> > -	} else {
> > -		if (pdata->phy_init)
> > -			pdata->phy_init();
> > -	}
> > +	phy_power_on(dp->phy);
> >
> >   	exynos_dp_init_dp(dp);
> >
> > @@ -1121,42 +1047,27 @@ static int exynos_dp_probe(struct platform_device *pdev)
> >
> >   static int exynos_dp_remove(struct platform_device *pdev)
> >   {
> > -	struct exynos_dp_platdata *pdata = pdev->dev.platform_data;
> >   	struct exynos_dp_device *dp = platform_get_drvdata(pdev);
> >
> >   	flush_work(&dp->hotplug_work);
> >
> > -	if (pdev->dev.of_node) {
> > -		if (dp->phy_addr)
> > -			exynos_dp_phy_exit(dp);
> > -	} else {
> > -		if (pdata->phy_exit)
> > -			pdata->phy_exit();
> > -	}
> > +	phy_power_off(dp->phy);
> >
> >   	clk_disable_unprepare(dp->clock);
> >
> > -
> >   	return 0;
> >   }
> >
> >   #ifdef CONFIG_PM_SLEEP
> >   static int exynos_dp_suspend(struct device *dev)
> >   {
> > -	struct exynos_dp_platdata *pdata = dev->platform_data;
> >   	struct exynos_dp_device *dp = dev_get_drvdata(dev);
> >
> >   	disable_irq(dp->irq);
> >
> >   	flush_work(&dp->hotplug_work);
> >
> > -	if (dev->of_node) {
> > -		if (dp->phy_addr)
> > -			exynos_dp_phy_exit(dp);
> > -	} else {
> > -		if (pdata->phy_exit)
> > -			pdata->phy_exit();
> > -	}
> > +	phy_power_off(dp->phy);
> >
> >   	clk_disable_unprepare(dp->clock);
> >
> > @@ -1165,16 +1076,9 @@ static int exynos_dp_suspend(struct device *dev)
> >
> >   static int exynos_dp_resume(struct device *dev)
> >   {
> > -	struct exynos_dp_platdata *pdata = dev->platform_data;
> >   	struct exynos_dp_device *dp = dev_get_drvdata(dev);
> >
> > -	if (dev->of_node) {
> > -		if (dp->phy_addr)
> > -			exynos_dp_phy_init(dp);
> > -	} else {
> > -		if (pdata->phy_init)
> > -			pdata->phy_init();
> > -	}
> > +	phy_power_on(dp->phy);
> >
> >   	clk_prepare_enable(dp->clock);
> >
> > diff --git a/drivers/video/exynos/exynos_dp_core.h b/drivers/video/exynos/exynos_dp_core.h
> > index 6c567bbf..b3d0328 100644
> > --- a/drivers/video/exynos/exynos_dp_core.h
> > +++ b/drivers/video/exynos/exynos_dp_core.h
> > @@ -42,6 +42,8 @@ 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 */
> > diff --git a/include/video/exynos_dp.h b/include/video/exynos_dp.h
> > index bd8cabd..f38c9af 100644
> > --- a/include/video/exynos_dp.h
> > +++ b/include/video/exynos_dp.h
> > @@ -122,10 +122,8 @@ struct video_info {
> >   };
> >
> >   struct exynos_dp_platdata {
> 
> Since Exynos doesn't support non-dt boot now this platform data structure
> is not used, is it ?

You're right.
It can be removed, if Exynos DP driver does not non-DT.

Best regards,
Jingoo Han

> 
> > -	struct video_info *video_info;
> > -
> > -	void (*phy_init)(void);
> > -	void (*phy_exit)(void);
> > +	struct video_info	*video_info;
> > +	const char		*phy_label;
> >   };
> >
> >   #endif /* _EXYNOS_DP_H */
> 
> Regards,
> Sylwester


^ permalink raw reply

* [PATCH V4 0/4] Generic PHY driver for the Exynos SoC DP PHY
From: Jingoo Han @ 2013-07-02  8:38 UTC (permalink / raw)
  To: linux-arm-kernel

This patch series adds a simple driver for the Samsung Exynos SoC
series DP transmitter PHY, using the generic PHY framework [1].
Previously the DP PHY used an internal DT node to control the PHY
power enable bit.

These patches was tested on Exynos5250.

This PATCH v4 follows:
 * PATCH v3, sent on July, 1st 2013
 * PATCH v2, sent on June, 28th 2013
 * PATCH v1, sent on June, 28th 2013

Changes between v3 and v4:
  * Added OF dependancy.
  * Removed redundant local variable 'void __iomem *addr'.
  * Removed unnecessary dev_set_drvdata().
  * Added a patch that remove non-DT support for Exynos
    Display Port driver.
  * Removed unnecessary 'struct exynos_dp_platdata'.
  * Kept supporting the original bindings for DT compatibility.

Changes between v2 and v3:
  * Removed redundant spinlock
  * Removed 'struct phy' from 'struct exynos_dp_video_phy'
  * Updated 'samsung-phy.txt', instead of creating
    'samsung,exynos5250-dp-video-phy.txt'.
  * Removed unnecessary additional specifier from 'phys'
    DT property.
  * Added 'phys', 'phy-names' properties to 'exynos_dp.txt' file.
  * Added Felipe Balbi's Acked-by.

Changes between v1 and v2:
  * Replaced exynos_dp_video_phy_xlate() with of_phy_simple_xlate(),
    as Kishon Vijay Abraham I guided.
  * Set the value of phy-cells as 0, because the phy_provider implements
    only one PHY.
  * Removed unnecessary header include.
  * Added '#ifdef CONFIG_OF' and of_match_ptr macro.

This series depends on the generic PHY framework [1]. These patches
refer to Sylwester Nawrocki's patches about Exynos MIPI [2].

[1] https://lkml.org/lkml/2013/6/26/259
[2] http://www.spinics.net/lists/linux-samsung-soc/msg20098.html

Jingoo Han (4):
  ARM: dts: Add DP PHY node to exynos5250.dtsi
  phy: Add driver for Exynos DP PHY
  video: exynos_dp: remove non-DT support for Exynos Display Port
  video: exynos_dp: Use the generic PHY driver

 .../devicetree/bindings/phy/samsung-phy.txt        |    8 ++
 .../devicetree/bindings/video/exynos_dp.txt        |   23 +++++---------------
 arch/arm/boot/dts/exynos5250.dtsi                  |   13 ++++++++-----
 drivers/phy/Kconfig                                |    6 ++
 drivers/phy/Makefile                               |    1 +
 drivers/phy/phy-exynos-dp-video.c                  |  111 ++++++++++++++++++++
 drivers/video/exynos/Kconfig                       |    2 +-
 drivers/video/exynos/exynos_dp_core.c              |  132 +++++++----------------------
 drivers/video/exynos/exynos_dp_core.h              |  111 +++++++++++++++++++++++++++
 drivers/video/exynos/exynos_dp_reg.c               |    2 -
 include/video/exynos_dp.h                          |  131 ---------------------------------
 11 files changed, 289 insertions(+), 251 deletions(-)
 create mode 100644 drivers/phy/phy-exynos-dp-video.c
 delete mode 100644 include/video/exynos_dp.h
 
--
1.7.10.4


^ permalink raw reply

* [PATCH V4 1/4] ARM: dts: Add DP PHY node to exynos5250.dtsi
From: Jingoo Han @ 2013-07-02  8:39 UTC (permalink / raw)
  To: linux-arm-kernel

Add PHY provider node for the DP PHY.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Felipe Balbi <balbi@ti.com>
---
 arch/arm/boot/dts/exynos5250.dtsi |   13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/arch/arm/boot/dts/exynos5250.dtsi b/arch/arm/boot/dts/exynos5250.dtsi
index 41cd625..7e397c6 100644
--- a/arch/arm/boot/dts/exynos5250.dtsi
+++ b/arch/arm/boot/dts/exynos5250.dtsi
@@ -614,6 +614,12 @@
 		interrupts = <0 94 0>;
 	};
 
+	dp_phy: video-phy@10040720 {
+		compatible = "samsung,exynos5250-dp-video-phy";
+		reg = <0x10040720 4>;
+		#phy-cells = <0>;
+	};
+
 	dp-controller {
 		compatible = "samsung,exynos5-dp";
 		reg = <0x145b0000 0x1000>;
@@ -623,11 +629,8 @@
 		clock-names = "dp";
 		#address-cells = <1>;
 		#size-cells = <0>;
-
-		dptx-phy {
-			reg = <0x10040720>;
-			samsung,enable-mask = <1>;
-		};
+		phys = <&dp_phy>;
+		phy-names = "dp";
 	};
 
 	fimd {
-- 
1.7.10.4



^ permalink raw reply related

* [PATCH V4 2/4] phy: Add driver for Exynos DP PHY
From: Jingoo Han @ 2013-07-02  8:40 UTC (permalink / raw)
  To: linux-arm-kernel

Add a PHY provider driver for the Samsung Exynos SoC DP PHY.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Cc: Sylwester Nawrocki <s.nawrocki@samsung.com>
Acked-by: Felipe Balbi <balbi@ti.com>
---
 .../devicetree/bindings/phy/samsung-phy.txt        |    8 ++
 drivers/phy/Kconfig                                |    6 ++
 drivers/phy/Makefile                               |    1 +
 drivers/phy/phy-exynos-dp-video.c                  |  111 ++++++++++++++++++++
 4 files changed, 126 insertions(+)
 create mode 100644 drivers/phy/phy-exynos-dp-video.c

diff --git a/Documentation/devicetree/bindings/phy/samsung-phy.txt b/Documentation/devicetree/bindings/phy/samsung-phy.txt
index 5ff208c..c0fccaa 100644
--- a/Documentation/devicetree/bindings/phy/samsung-phy.txt
+++ b/Documentation/devicetree/bindings/phy/samsung-phy.txt
@@ -12,3 +12,11 @@ the PHY specifier identifies the PHY and its meaning is as follows:
   1 - MIPI DSIM 0,
   2 - MIPI CSIS 1,
   3 - MIPI DSIM 1.
+
+Samsung EXYNOS SoC series Display Port PHY
+-------------------------------------------------
+
+Required properties:
+- compatible : should be "samsung,exynos5250-dp-video-phy";
+- reg : offset and length of the Display Port PHY register set;
+- #phy-cells : from the generic PHY bindings, must be 0;
diff --git a/drivers/phy/Kconfig b/drivers/phy/Kconfig
index 6f446d0..ed0b1b8 100644
--- a/drivers/phy/Kconfig
+++ b/drivers/phy/Kconfig
@@ -19,4 +19,10 @@ config PHY_EXYNOS_MIPI_VIDEO
 	help
 	  Support for MIPI CSI-2 and MIPI DSI DPHY found on Samsung
 	  S5P and EXYNOS SoCs.
+
+config PHY_EXYNOS_DP_VIDEO
+	tristate "EXYNOS SoC series Display Port PHY driver"
+	depends on OF
+	help
+	  Support for Display Port PHY found on Samsung EXYNOS SoCs.
 endif
diff --git a/drivers/phy/Makefile b/drivers/phy/Makefile
index 71d8841..0fd1340 100644
--- a/drivers/phy/Makefile
+++ b/drivers/phy/Makefile
@@ -4,3 +4,4 @@
 
 obj-$(CONFIG_GENERIC_PHY)		+= phy-core.o
 obj-$(CONFIG_PHY_EXYNOS_MIPI_VIDEO)	+= phy-exynos-mipi-video.o
+obj-$(CONFIG_PHY_EXYNOS_DP_VIDEO)	+= phy-exynos-dp-video.o
diff --git a/drivers/phy/phy-exynos-dp-video.c b/drivers/phy/phy-exynos-dp-video.c
new file mode 100644
index 0000000..3c8e247
--- /dev/null
+++ b/drivers/phy/phy-exynos-dp-video.c
@@ -0,0 +1,111 @@
+/*
+ * Samsung EXYNOS SoC series Display Port PHY driver
+ *
+ * Copyright (C) 2013 Samsung Electronics Co., Ltd.
+ * Author: Jingoo Han <jg1.han@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/io.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/of_address.h>
+#include <linux/phy/phy.h>
+#include <linux/platform_device.h>
+
+/* DPTX_PHY_CONTROL register */
+#define EXYNOS_DPTX_PHY_ENABLE		(1 << 0)
+
+struct exynos_dp_video_phy {
+	void __iomem *regs;
+};
+
+static int __set_phy_state(struct exynos_dp_video_phy *state, unsigned int on)
+{
+	u32 reg;
+
+	reg = readl(state->regs);
+	if (on)
+		reg |= EXYNOS_DPTX_PHY_ENABLE;
+	else
+		reg &= ~EXYNOS_DPTX_PHY_ENABLE;
+	writel(reg, state->regs);
+
+	return 0;
+}
+
+static int exynos_dp_video_phy_power_on(struct phy *phy)
+{
+	struct exynos_dp_video_phy *state = phy_get_drvdata(phy);
+
+	return __set_phy_state(state, 1);
+}
+
+static int exynos_dp_video_phy_power_off(struct phy *phy)
+{
+	struct exynos_dp_video_phy *state = phy_get_drvdata(phy);
+
+	return __set_phy_state(state, 0);
+}
+
+static struct phy_ops exynos_dp_video_phy_ops = {
+	.power_on	= exynos_dp_video_phy_power_on,
+	.power_off	= exynos_dp_video_phy_power_off,
+	.owner		= THIS_MODULE,
+};
+
+static int exynos_dp_video_phy_probe(struct platform_device *pdev)
+{
+	struct exynos_dp_video_phy *state;
+	struct device *dev = &pdev->dev;
+	struct resource *res;
+	struct phy_provider *phy_provider;
+	struct phy *phy;
+
+	state = devm_kzalloc(dev, sizeof(*state), GFP_KERNEL);
+	if (!state)
+		return -ENOMEM;
+
+	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+
+	state->regs = devm_ioremap_resource(dev, res);
+	if (IS_ERR(state->regs))
+		return PTR_ERR(state->regs);
+
+	phy_provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate);
+	if (IS_ERR(phy_provider))
+		return PTR_ERR(phy_provider);
+
+	phy = devm_phy_create(dev, 0, &exynos_dp_video_phy_ops, NULL);
+	if (IS_ERR(phy)) {
+		dev_err(dev, "failed to create Display Port PHY\n");
+		return PTR_ERR(phy);
+	}
+	phy_set_drvdata(phy, state);
+
+	return 0;
+}
+
+static const struct of_device_id exynos_dp_video_phy_of_match[] = {
+	{ .compatible = "samsung,exynos5250-dp-video-phy" },
+	{ },
+};
+MODULE_DEVICE_TABLE(of, exynos_dp_video_phy_of_match);
+
+static struct platform_driver exynos_dp_video_phy_driver = {
+	.probe	= exynos_dp_video_phy_probe,
+	.driver = {
+		.name	= "exynos-dp-video-phy",
+		.owner	= THIS_MODULE,
+		.of_match_table	= exynos_dp_video_phy_of_match,
+	}
+};
+module_platform_driver(exynos_dp_video_phy_driver);
+
+MODULE_AUTHOR("Jingoo Han <jg1.han@samsung.com>");
+MODULE_DESCRIPTION("Samsung EXYNOS SoC DP PHY driver");
+MODULE_LICENSE("GPL v2");
-- 
1.7.10.4



^ permalink raw reply related

* [PATCH V4 3/4] video: exynos_dp: remove non-DT support for Exynos Display Port
From: Jingoo Han @ 2013-07-02  8:41 UTC (permalink / raw)
  To: linux-arm-kernel

Exynos Display Port can be used only for Exynos SoCs. In addition,
non-DT for EXYNOS SoCs is be supported from v3.11; thus, there is
no need to support non-DT for Exynos Display Port.

The 'include/video/exynos_dp.h' file has been used for non-DT
support and the content of file include/video/exynos_dp.h is moved
to drivers/video/exynos/exynos_dp_core.h. Thus, the 'exynos_dp.h'
file is removed. Also, 'struct exynos_dp_platdata' is removed,
because it is not used any more.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
 drivers/video/exynos/Kconfig          |    2 +-
 drivers/video/exynos/exynos_dp_core.c |  116 +++++++----------------------
 drivers/video/exynos/exynos_dp_core.h |  109 +++++++++++++++++++++++++++
 drivers/video/exynos/exynos_dp_reg.c  |    2 -
 include/video/exynos_dp.h             |  131 ---------------------------------
 5 files changed, 135 insertions(+), 225 deletions(-)
 delete mode 100644 include/video/exynos_dp.h

diff --git a/drivers/video/exynos/Kconfig b/drivers/video/exynos/Kconfig
index 1b035b2..fab9019 100644
--- a/drivers/video/exynos/Kconfig
+++ b/drivers/video/exynos/Kconfig
@@ -29,7 +29,7 @@ config EXYNOS_LCD_S6E8AX0
 
 config EXYNOS_DP
 	bool "EXYNOS DP driver support"
-	depends on ARCH_EXYNOS
+	depends on OF && ARCH_EXYNOS
 	default n
 	help
 	  This enables support for DP device.
diff --git a/drivers/video/exynos/exynos_dp_core.c b/drivers/video/exynos/exynos_dp_core.c
index 12bbede..05fed7d 100644
--- a/drivers/video/exynos/exynos_dp_core.c
+++ b/drivers/video/exynos/exynos_dp_core.c
@@ -20,8 +20,6 @@
 #include <linux/delay.h>
 #include <linux/of.h>
 
-#include <video/exynos_dp.h>
-
 #include "exynos_dp_core.h"
 
 static int exynos_dp_init_dp(struct exynos_dp_device *dp)
@@ -894,26 +892,17 @@ static void exynos_dp_hotplug(struct work_struct *work)
 		dev_err(dp->dev, "unable to config video\n");
 }
 
-#ifdef CONFIG_OF
-static struct exynos_dp_platdata *exynos_dp_dt_parse_pdata(struct device *dev)
+static struct video_info *exynos_dp_dt_parse_pdata(struct device *dev)
 {
 	struct device_node *dp_node = dev->of_node;
-	struct exynos_dp_platdata *pd;
 	struct video_info *dp_video_config;
 
-	pd = devm_kzalloc(dev, sizeof(*pd), GFP_KERNEL);
-	if (!pd) {
-		dev_err(dev, "memory allocation for pdata failed\n");
-		return ERR_PTR(-ENOMEM);
-	}
 	dp_video_config = devm_kzalloc(dev,
 				sizeof(*dp_video_config), GFP_KERNEL);
-
 	if (!dp_video_config) {
 		dev_err(dev, "memory allocation for video config failed\n");
 		return ERR_PTR(-ENOMEM);
 	}
-	pd->video_info = dp_video_config;
 
 	dp_video_config->h_sync_polarity  		of_property_read_bool(dp_node, "hsync-active-high");
@@ -960,7 +949,7 @@ static struct exynos_dp_platdata *exynos_dp_dt_parse_pdata(struct device *dev)
 		return ERR_PTR(-EINVAL);
 	}
 
-	return pd;
+	return dp_video_config;
 }
 
 static int exynos_dp_dt_parse_phydata(struct exynos_dp_device *dp)
@@ -1003,48 +992,30 @@ err:
 
 static void exynos_dp_phy_init(struct exynos_dp_device *dp)
 {
-	u32 reg;
+	if (dp->phy_addr) {
+		u32 reg;
 
-	reg = __raw_readl(dp->phy_addr);
-	reg |= dp->enable_mask;
-	__raw_writel(reg, dp->phy_addr);
+		reg = __raw_readl(dp->phy_addr);
+		reg |= dp->enable_mask;
+		__raw_writel(reg, dp->phy_addr);
+	}
 }
 
 static void exynos_dp_phy_exit(struct exynos_dp_device *dp)
 {
-	u32 reg;
-
-	reg = __raw_readl(dp->phy_addr);
-	reg &= ~(dp->enable_mask);
-	__raw_writel(reg, dp->phy_addr);
-}
-#else
-static struct exynos_dp_platdata *exynos_dp_dt_parse_pdata(struct device *dev)
-{
-	return NULL;
-}
-
-static int exynos_dp_dt_parse_phydata(struct exynos_dp_device *dp)
-{
-	return -EINVAL;
-}
-
-static void exynos_dp_phy_init(struct exynos_dp_device *dp)
-{
-	return;
-}
+	if (dp->phy_addr) {
+		u32 reg;
 
-static void exynos_dp_phy_exit(struct exynos_dp_device *dp)
-{
-	return;
+		reg = __raw_readl(dp->phy_addr);
+		reg &= ~(dp->enable_mask);
+		__raw_writel(reg, dp->phy_addr);
+	}
 }
-#endif /* CONFIG_OF */
 
 static int exynos_dp_probe(struct platform_device *pdev)
 {
 	struct resource *res;
 	struct exynos_dp_device *dp;
-	struct exynos_dp_platdata *pdata;
 
 	int ret = 0;
 
@@ -1057,21 +1028,13 @@ static int exynos_dp_probe(struct platform_device *pdev)
 
 	dp->dev = &pdev->dev;
 
-	if (pdev->dev.of_node) {
-		pdata = exynos_dp_dt_parse_pdata(&pdev->dev);
-		if (IS_ERR(pdata))
-			return PTR_ERR(pdata);
+	dp->video_info = exynos_dp_dt_parse_pdata(&pdev->dev);
+	if (IS_ERR(dp->video_info))
+		return PTR_ERR(dp->video_info);
 
-		ret = exynos_dp_dt_parse_phydata(dp);
-		if (ret)
-			return ret;
-	} else {
-		pdata = pdev->dev.platform_data;
-		if (!pdata) {
-			dev_err(&pdev->dev, "no platform data\n");
-			return -EINVAL;
-		}
-	}
+	ret = exynos_dp_dt_parse_phydata(dp);
+	if (ret)
+		return ret;
 
 	dp->clock = devm_clk_get(&pdev->dev, "dp");
 	if (IS_ERR(dp->clock)) {
@@ -1095,15 +1058,7 @@ static int exynos_dp_probe(struct platform_device *pdev)
 
 	INIT_WORK(&dp->hotplug_work, exynos_dp_hotplug);
 
-	dp->video_info = pdata->video_info;
-
-	if (pdev->dev.of_node) {
-		if (dp->phy_addr)
-			exynos_dp_phy_init(dp);
-	} else {
-		if (pdata->phy_init)
-			pdata->phy_init();
-	}
+	exynos_dp_phy_init(dp);
 
 	exynos_dp_init_dp(dp);
 
@@ -1121,18 +1076,11 @@ static int exynos_dp_probe(struct platform_device *pdev)
 
 static int exynos_dp_remove(struct platform_device *pdev)
 {
-	struct exynos_dp_platdata *pdata = pdev->dev.platform_data;
 	struct exynos_dp_device *dp = platform_get_drvdata(pdev);
 
 	flush_work(&dp->hotplug_work);
 
-	if (pdev->dev.of_node) {
-		if (dp->phy_addr)
-			exynos_dp_phy_exit(dp);
-	} else {
-		if (pdata->phy_exit)
-			pdata->phy_exit();
-	}
+	exynos_dp_phy_exit(dp);
 
 	clk_disable_unprepare(dp->clock);
 
@@ -1143,20 +1091,13 @@ static int exynos_dp_remove(struct platform_device *pdev)
 #ifdef CONFIG_PM_SLEEP
 static int exynos_dp_suspend(struct device *dev)
 {
-	struct exynos_dp_platdata *pdata = dev->platform_data;
 	struct exynos_dp_device *dp = dev_get_drvdata(dev);
 
 	disable_irq(dp->irq);
 
 	flush_work(&dp->hotplug_work);
 
-	if (dev->of_node) {
-		if (dp->phy_addr)
-			exynos_dp_phy_exit(dp);
-	} else {
-		if (pdata->phy_exit)
-			pdata->phy_exit();
-	}
+	exynos_dp_phy_exit(dp);
 
 	clk_disable_unprepare(dp->clock);
 
@@ -1165,16 +1106,9 @@ static int exynos_dp_suspend(struct device *dev)
 
 static int exynos_dp_resume(struct device *dev)
 {
-	struct exynos_dp_platdata *pdata = dev->platform_data;
 	struct exynos_dp_device *dp = dev_get_drvdata(dev);
 
-	if (dev->of_node) {
-		if (dp->phy_addr)
-			exynos_dp_phy_init(dp);
-	} else {
-		if (pdata->phy_init)
-			pdata->phy_init();
-	}
+	exynos_dp_phy_init(dp);
 
 	clk_prepare_enable(dp->clock);
 
@@ -1203,7 +1137,7 @@ static struct platform_driver exynos_dp_driver = {
 		.name	= "exynos-dp",
 		.owner	= THIS_MODULE,
 		.pm	= &exynos_dp_pm_ops,
-		.of_match_table = of_match_ptr(exynos_dp_match),
+		.of_match_table = exynos_dp_match,
 	},
 };
 
diff --git a/drivers/video/exynos/exynos_dp_core.h b/drivers/video/exynos/exynos_dp_core.h
index 6c567bbf..56cfec8 100644
--- a/drivers/video/exynos/exynos_dp_core.h
+++ b/drivers/video/exynos/exynos_dp_core.h
@@ -13,6 +13,99 @@
 #ifndef _EXYNOS_DP_CORE_H
 #define _EXYNOS_DP_CORE_H
 
+#define DP_TIMEOUT_LOOP_COUNT 100
+#define MAX_CR_LOOP 5
+#define MAX_EQ_LOOP 5
+
+enum link_rate_type {
+	LINK_RATE_1_62GBPS = 0x06,
+	LINK_RATE_2_70GBPS = 0x0a
+};
+
+enum link_lane_count_type {
+	LANE_COUNT1 = 1,
+	LANE_COUNT2 = 2,
+	LANE_COUNT4 = 4
+};
+
+enum link_training_state {
+	START,
+	CLOCK_RECOVERY,
+	EQUALIZER_TRAINING,
+	FINISHED,
+	FAILED
+};
+
+enum voltage_swing_level {
+	VOLTAGE_LEVEL_0,
+	VOLTAGE_LEVEL_1,
+	VOLTAGE_LEVEL_2,
+	VOLTAGE_LEVEL_3,
+};
+
+enum pre_emphasis_level {
+	PRE_EMPHASIS_LEVEL_0,
+	PRE_EMPHASIS_LEVEL_1,
+	PRE_EMPHASIS_LEVEL_2,
+	PRE_EMPHASIS_LEVEL_3,
+};
+
+enum pattern_set {
+	PRBS7,
+	D10_2,
+	TRAINING_PTN1,
+	TRAINING_PTN2,
+	DP_NONE
+};
+
+enum color_space {
+	COLOR_RGB,
+	COLOR_YCBCR422,
+	COLOR_YCBCR444
+};
+
+enum color_depth {
+	COLOR_6,
+	COLOR_8,
+	COLOR_10,
+	COLOR_12
+};
+
+enum color_coefficient {
+	COLOR_YCBCR601,
+	COLOR_YCBCR709
+};
+
+enum dynamic_range {
+	VESA,
+	CEA
+};
+
+enum pll_status {
+	PLL_UNLOCKED,
+	PLL_LOCKED
+};
+
+enum clock_recovery_m_value_type {
+	CALCULATED_M,
+	REGISTER_M
+};
+
+enum video_timing_recognition_type {
+	VIDEO_TIMING_FROM_CAPTURE,
+	VIDEO_TIMING_FROM_REGISTER
+};
+
+enum analog_power_block {
+	AUX_BLOCK,
+	CH0_BLOCK,
+	CH1_BLOCK,
+	CH2_BLOCK,
+	CH3_BLOCK,
+	ANALOG_TOTAL,
+	POWER_ALL
+};
+
 enum dp_irq_type {
 	DP_IRQ_TYPE_HP_CABLE_IN,
 	DP_IRQ_TYPE_HP_CABLE_OUT,
@@ -20,6 +113,22 @@ enum dp_irq_type {
 	DP_IRQ_TYPE_UNKNOWN,
 };
 
+struct video_info {
+	char *name;
+
+	bool h_sync_polarity;
+	bool v_sync_polarity;
+	bool interlaced;
+
+	enum color_space color_space;
+	enum dynamic_range dynamic_range;
+	enum color_coefficient ycbcr_coeff;
+	enum color_depth color_depth;
+
+	enum link_rate_type link_rate;
+	enum link_lane_count_type lane_count;
+};
+
 struct link_train {
 	int eq_loop;
 	int cr_loop[4];
diff --git a/drivers/video/exynos/exynos_dp_reg.c b/drivers/video/exynos/exynos_dp_reg.c
index 29d9d03..b70da50 100644
--- a/drivers/video/exynos/exynos_dp_reg.c
+++ b/drivers/video/exynos/exynos_dp_reg.c
@@ -14,8 +14,6 @@
 #include <linux/io.h>
 #include <linux/delay.h>
 
-#include <video/exynos_dp.h>
-
 #include "exynos_dp_core.h"
 #include "exynos_dp_reg.h"
 
diff --git a/include/video/exynos_dp.h b/include/video/exynos_dp.h
deleted file mode 100644
index bd8cabd..0000000
--- a/include/video/exynos_dp.h
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * Samsung SoC DP device support
- *
- * Copyright (C) 2012 Samsung Electronics Co., Ltd.
- * Author: Jingoo Han <jg1.han@samsung.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-#ifndef _EXYNOS_DP_H
-#define _EXYNOS_DP_H
-
-#define DP_TIMEOUT_LOOP_COUNT 100
-#define MAX_CR_LOOP 5
-#define MAX_EQ_LOOP 5
-
-enum link_rate_type {
-	LINK_RATE_1_62GBPS = 0x06,
-	LINK_RATE_2_70GBPS = 0x0a
-};
-
-enum link_lane_count_type {
-	LANE_COUNT1 = 1,
-	LANE_COUNT2 = 2,
-	LANE_COUNT4 = 4
-};
-
-enum link_training_state {
-	START,
-	CLOCK_RECOVERY,
-	EQUALIZER_TRAINING,
-	FINISHED,
-	FAILED
-};
-
-enum voltage_swing_level {
-	VOLTAGE_LEVEL_0,
-	VOLTAGE_LEVEL_1,
-	VOLTAGE_LEVEL_2,
-	VOLTAGE_LEVEL_3,
-};
-
-enum pre_emphasis_level {
-	PRE_EMPHASIS_LEVEL_0,
-	PRE_EMPHASIS_LEVEL_1,
-	PRE_EMPHASIS_LEVEL_2,
-	PRE_EMPHASIS_LEVEL_3,
-};
-
-enum pattern_set {
-	PRBS7,
-	D10_2,
-	TRAINING_PTN1,
-	TRAINING_PTN2,
-	DP_NONE
-};
-
-enum color_space {
-	COLOR_RGB,
-	COLOR_YCBCR422,
-	COLOR_YCBCR444
-};
-
-enum color_depth {
-	COLOR_6,
-	COLOR_8,
-	COLOR_10,
-	COLOR_12
-};
-
-enum color_coefficient {
-	COLOR_YCBCR601,
-	COLOR_YCBCR709
-};
-
-enum dynamic_range {
-	VESA,
-	CEA
-};
-
-enum pll_status {
-	PLL_UNLOCKED,
-	PLL_LOCKED
-};
-
-enum clock_recovery_m_value_type {
-	CALCULATED_M,
-	REGISTER_M
-};
-
-enum video_timing_recognition_type {
-	VIDEO_TIMING_FROM_CAPTURE,
-	VIDEO_TIMING_FROM_REGISTER
-};
-
-enum analog_power_block {
-	AUX_BLOCK,
-	CH0_BLOCK,
-	CH1_BLOCK,
-	CH2_BLOCK,
-	CH3_BLOCK,
-	ANALOG_TOTAL,
-	POWER_ALL
-};
-
-struct video_info {
-	char *name;
-
-	bool h_sync_polarity;
-	bool v_sync_polarity;
-	bool interlaced;
-
-	enum color_space color_space;
-	enum dynamic_range dynamic_range;
-	enum color_coefficient ycbcr_coeff;
-	enum color_depth color_depth;
-
-	enum link_rate_type link_rate;
-	enum link_lane_count_type lane_count;
-};
-
-struct exynos_dp_platdata {
-	struct video_info *video_info;
-
-	void (*phy_init)(void);
-	void (*phy_exit)(void);
-};
-
-#endif /* _EXYNOS_DP_H */
-- 
1.7.10.4



^ permalink raw reply related

* [PATCH V4 4/4] video: exynos_dp: Use the generic PHY driver
From: Jingoo Han @ 2013-07-02  8:42 UTC (permalink / raw)
  To: linux-arm-kernel

Use the generic PHY API instead of the platform callback to control
the DP PHY.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
 .../devicetree/bindings/video/exynos_dp.txt        |   23 +++++---------------
 drivers/video/exynos/exynos_dp_core.c              |   16 ++++++++++----
 drivers/video/exynos/exynos_dp_core.h              |    2 ++
 3 files changed, 20 insertions(+), 21 deletions(-)

diff --git a/Documentation/devicetree/bindings/video/exynos_dp.txt b/Documentation/devicetree/bindings/video/exynos_dp.txt
index 84f10c1..022f4b6 100644
--- a/Documentation/devicetree/bindings/video/exynos_dp.txt
+++ b/Documentation/devicetree/bindings/video/exynos_dp.txt
@@ -1,17 +1,6 @@
 The Exynos display port interface should be configured based on
 the type of panel connected to it.
 
-We use two nodes:
-	-dp-controller node
-	-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:
-		Base address of DP PHY register.
-	-samsung,enable-mask:
-		The bit-mask used to enable/disable DP PHY.
-
 For the Panel initialization, we read data from dp-controller node.
 Required properties for dp-controller:
 	-compatible:
@@ -25,6 +14,10 @@ Required properties for dp-controller:
 		from common clock binding: handle to dp clock.
 	-clock-names:
 		from common clock binding: Shall be "dp".
+	-phys:
+		from general PHY binding: the phandle for the PHY device.
+	-phy-names:
+		from general PHY binding: Should be "dp".
 	-interrupt-parent:
 		phandle to Interrupt combiner node.
 	-samsung,color-space:
@@ -67,12 +60,8 @@ SOC specific portion:
 		interrupt-parent = <&combiner>;
 		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 <linux/interrupt.h>
 #include <linux/delay.h>
 #include <linux/of.h>
+#include <linux/phy/phy.h>
 
 #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..87804b6 100644
--- a/drivers/video/exynos/exynos_dp_core.h
+++ b/drivers/video/exynos/exynos_dp_core.h
@@ -151,6 +151,8 @@ 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 */
-- 
1.7.10.4



^ permalink raw reply related

* Re: [PATCH 2/2] video:da8xx-fb: Convert to devm_* api
From: Prabhakar Lad @ 2013-07-02  9:27 UTC (permalink / raw)
  To: Etheridge, Darren
  Cc: Tomi Valkeinen, DLOS, LFBDEV, Florian Tobias Schandinat, LKML
In-Reply-To: <51CADA58.2030602@ti.com>

Hi Darren,

On Wed, Jun 26, 2013 at 5:41 PM, Tomi Valkeinen <tomi.valkeinen@ti.com> wrote:
> On 26/06/13 15:06, Prabhakar Lad wrote:
>> Hi Tomi,
>>
>> On Wed, Jun 26, 2013 at 5:30 PM, Tomi Valkeinen <tomi.valkeinen@ti.com> wrote:
>>> On 26/06/13 14:56, Prabhakar Lad wrote:
>>>> Hi Tomi,
>>>>
>>>> On Wed, Jun 26, 2013 at 5:09 PM, Tomi Valkeinen <tomi.valkeinen@ti.com> wrote:
>>>>> On 16/05/13 10:10, Lad Prabhakar wrote:
>>>>>> From: Lad, Prabhakar <prabhakar.csengg@gmail.com>
>>>>>>
>>>>>> Use devm_ioremap_resource instead of reques_mem_region()/ioremap() and
>>>>>> devm_request_irq() instead of request_irq().
>>>>>>
>>>>>> This ensures more consistent error values and simplifies error paths.
>>>>>>
>>>>>> Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
>>>>>> ---
>>>>>>  drivers/video/da8xx-fb.c |   39 +++++++--------------------------------
>>>>>>  1 files changed, 7 insertions(+), 32 deletions(-)
>>>>>
>>>>> There's something similar in Darren's da8xx-fb series. Can you check if
>>>>> there are differences?
>>>>>
>>>> I don't see similar changes in his patch series.
>>>
>>> [PATCH 14/23] video: da8xx-fb: use devres
>>>
>> Oops missed it out :), patch is almost similar except
>> for following block,
>>
>> -       fb_clk = clk_get(&device->dev, "fck");
>> +       fb_clk = devm_clk_get(&device->dev, "fck");
>>         if (IS_ERR(fb_clk)) {
>>                 dev_err(&device->dev, "Can not get device clock\n");
>> -               ret = -ENODEV;
>> -               goto err_ioremap;
>> +               return -ENODEV;
>>         }
>>
>> How do you suggest to handle it ?
>
> I think it's easiest if Darren handles the da8xx-fb series for 3.11. So
> if there's something missing from Darren's series, please discuss with him.
>
Either you merge this patch with yours or rebase your patch on top of my patch.
Let me know how you would like to handle it ?

Regards,
--Prabhakar Lad

^ permalink raw reply

* [PATCH] video: exynos: Ensure definitions match prototypes
From: Mark Brown @ 2013-07-02 11:26 UTC (permalink / raw)
  To: Tomi Valkeinen, Jingoo Han
  Cc: linux-fbdev, linux-samsung-soc, linaro-kernel, Mark Brown

From: Mark Brown <broonie@linaro.org>

Ensure that the definitions of functions match the prototypes used by
other modules by including the header with the prototypes in the files
with the definitions.

Signed-off-by: Mark Brown <broonie@linaro.org>
---
 drivers/video/exynos/exynos_mipi_dsi_lowlevel.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/video/exynos/exynos_mipi_dsi_lowlevel.c b/drivers/video/exynos/exynos_mipi_dsi_lowlevel.c
index 15c5abd..c148d06 100644
--- a/drivers/video/exynos/exynos_mipi_dsi_lowlevel.c
+++ b/drivers/video/exynos/exynos_mipi_dsi_lowlevel.c
@@ -27,6 +27,7 @@
 #include <video/exynos_mipi_dsim.h>
 
 #include "exynos_mipi_dsi_regs.h"
+#include "exynos_mipi_dsi_lowlevel.h"
 
 void exynos_mipi_dsi_func_reset(struct mipi_dsim_device *dsim)
 {
-- 
1.8.3.1


^ permalink raw reply related

* [PATCH] backlight: lp855x: set zero brightness at FBBLANK
From: Oskar Andero @ 2013-07-02 12:15 UTC (permalink / raw)
  To: linux-kernel, linux-fbdev
  Cc: Jean-Christophe Plagniol-Villard, Tomi Valkeinen,
	Radovan Lekanovic, Shingo Nakao, Milo Kim, Richard Purdie,
	Oskar Andero

From: Shingo Nakao <shingo.x.nakao@sonymobile.com>

When backlight turns on early from display, a white line can be
seen on the screen. Therefore make sure backlight is off when we
are under an fb blank event.

Signed-off-by: Shingo Nakao <shingo.x.nakao@sonymobile.com>
Cc: Milo Kim <milo.kim@ti.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Oskar Andero <oskar.andero@sonymobile.com>
---
 drivers/video/backlight/lp855x_bl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/backlight/lp855x_bl.c b/drivers/video/backlight/lp855x_bl.c
index a0e1e02..c0b41f1 100644
--- a/drivers/video/backlight/lp855x_bl.c
+++ b/drivers/video/backlight/lp855x_bl.c
@@ -246,7 +246,7 @@ static int lp855x_bl_update_status(struct backlight_device *bl)
 {
 	struct lp855x *lp = bl_get_data(bl);
 
-	if (bl->props.state & BL_CORE_SUSPENDED)
+	if (bl->props.state & (BL_CORE_SUSPENDED | BL_CORE_FBBLANK))
 		bl->props.brightness = 0;
 
 	if (lp->mode = PWM_BASED) {
-- 
1.8.1.5


^ permalink raw reply related

* RE: [PATCH] video: exynos: Ensure definitions match prototypes
From: Inki Dae @ 2013-07-02 12:30 UTC (permalink / raw)
  To: linux-fbdev
In-Reply-To: <1372764414-9102-1-git-send-email-broonie@kernel.org>



> -----Original Message-----
> From: linux-fbdev-owner@vger.kernel.org [mailto:linux-fbdev-
> owner@vger.kernel.org] On Behalf Of Mark Brown
> Sent: Tuesday, July 02, 2013 8:27 PM
> To: Tomi Valkeinen; Jingoo Han
> Cc: linux-fbdev@vger.kernel.org; linux-samsung-soc@vger.kernel.org;
> linaro-kernel@lists.linaro.org; Mark Brown
> Subject: [PATCH] video: exynos: Ensure definitions match prototypes
> 
> From: Mark Brown <broonie@linaro.org>
> 
> Ensure that the definitions of functions match the prototypes used by
> other modules by including the header with the prototypes in the files
> with the definitions.
> 

Is there some functions being used by other modules? And what problem can be
incurred without this patch?

Thanks,
Inki Dae

> Signed-off-by: Mark Brown <broonie@linaro.org>
> ---
>  drivers/video/exynos/exynos_mipi_dsi_lowlevel.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/video/exynos/exynos_mipi_dsi_lowlevel.c
> b/drivers/video/exynos/exynos_mipi_dsi_lowlevel.c
> index 15c5abd..c148d06 100644
> --- a/drivers/video/exynos/exynos_mipi_dsi_lowlevel.c
> +++ b/drivers/video/exynos/exynos_mipi_dsi_lowlevel.c
> @@ -27,6 +27,7 @@
>  #include <video/exynos_mipi_dsim.h>
> 
>  #include "exynos_mipi_dsi_regs.h"
> +#include "exynos_mipi_dsi_lowlevel.h"
> 
>  void exynos_mipi_dsi_func_reset(struct mipi_dsim_device *dsim)
>  {
> --
> 1.8.3.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


^ permalink raw reply

* Re: [PATCH] video: exynos: Ensure definitions match prototypes
From: Mark Brown @ 2013-07-02 15:07 UTC (permalink / raw)
  To: Inki Dae
  Cc: 'Tomi Valkeinen', 'Jingoo Han', linux-fbdev,
	linux-samsung-soc, linaro-kernel
In-Reply-To: <008b01ce771f$f15082c0$d3f18840$%dae@samsung.com>

[-- Attachment #1: Type: text/plain, Size: 643 bytes --]

On Tue, Jul 02, 2013 at 09:30:31PM +0900, Inki Dae wrote:

> > Ensure that the definitions of functions match the prototypes used by
> > other modules by including the header with the prototypes in the files
> > with the definitions.

> Is there some functions being used by other modules? And what problem can be
> incurred without this patch?

Well, aside from it being basic good practice and allowing the compiler 
to check for errors in the prototypes this is also something that sparse 
warns about.  There do seem to be references to the functions in other
modules, in some cases this is every single function in the file.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply

* Re: [patch -next] fb: fix recent breakage in correct_chipset()
From: Randy Dunlap @ 2013-07-02 15:50 UTC (permalink / raw)
  To: linux-fbdev
In-Reply-To: <20130702062821.GC24410@elgon.mountain>

On 07/01/13 23:28, Dan Carpenter wrote:
> The 6e36308a6f "fb: fix atyfb build warning" isn't right.  It makes all
> the indexes off by one.  This patch reverts it and casts the
> ARRAY_SIZE() to int to silence the build warning.

Argh.  Thanks.

> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/drivers/video/aty/atyfb_base.c b/drivers/video/aty/atyfb_base.c
> index a89c15d..9b0f12c 100644
> --- a/drivers/video/aty/atyfb_base.c
> +++ b/drivers/video/aty/atyfb_base.c
> @@ -435,8 +435,8 @@ static int correct_chipset(struct atyfb_par *par)
>  	const char *name;
>  	int i;
>  
> -	for (i = ARRAY_SIZE(aty_chips); i > 0; i--)
> -		if (par->pci_id = aty_chips[i - 1].pci_id)
> +	for (i = (int)ARRAY_SIZE(aty_chips) - 1; i >= 0; i--)
> +		if (par->pci_id = aty_chips[i].pci_id)
>  			break;
>  
>  	if (i < 0)
> 


-- 
~Randy

^ permalink raw reply

* RE: [PATCH 2/2] video:da8xx-fb: Convert to devm_* api
From: Etheridge, Darren @ 2013-07-02 22:31 UTC (permalink / raw)
  To: Prabhakar Lad
  Cc: Valkeinen, Tomi, DLOS, LFBDEV, Florian Tobias Schandinat, LKML
In-Reply-To: <CA+V-a8vij-4s1FsePmSZrdUTBZJPWZV6Wq9s=uurOHh2k47JNA@mail.gmail.com>

> >> How do you suggest to handle it ?
> >
> > I think it's easiest if Darren handles the da8xx-fb series for 3.11.
> > So if there's something missing from Darren's series, please discuss
> with him.
> >
> Either you merge this patch with yours or rebase your patch on top of
> my patch.
> Let me know how you would like to handle it ?
Prabhakar,

I will include your change with the next version of this patch series that will address Tomi's review comments.  

Darren

^ permalink raw reply

* Re: [PATCH] backlight: lp855x: set zero brightness at FBBLANK
From: Kim, Milo @ 2013-07-02 23:24 UTC (permalink / raw)
  To: Oskar Andero, Shingo Nakao
  Cc: Jean-Christophe Plagniol-Villard, Valkeinen, Tomi,
	Radovan Lekanovic, Richard Purdie, linux-kernel@vger.kernel.org,
	linux-fbdev@vger.kernel.org, akpm@linux-foundation.org
In-Reply-To: <1372767354-16499-1-git-send-email-oskar.andero@sonymobile.com>

> From: Shingo Nakao <shingo.x.nakao@sonymobile.com>
> 
> When backlight turns on early from display, a white line can be
> seen on the screen. Therefore make sure backlight is off when we
> are under an fb blank event.
> 
> Signed-off-by: Shingo Nakao <shingo.x.nakao@sonymobile.com>
> Cc: Milo Kim <milo.kim@ti.com>
> Cc: Richard Purdie <rpurdie@rpsys.net>
> Signed-off-by: Oskar Andero <oskar.andero@sonymobile.com>

Acked-by: Milo Kim <milo.kim@ti.com>

> ---
>  drivers/video/backlight/lp855x_bl.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/video/backlight/lp855x_bl.c b/drivers/video/backlight/lp855x_bl.c
> index a0e1e02..c0b41f1 100644
> --- a/drivers/video/backlight/lp855x_bl.c
> +++ b/drivers/video/backlight/lp855x_bl.c
> @@ -246,7 +246,7 @@ static int lp855x_bl_update_status(struct backlight_device *bl)
>  {
>         struct lp855x *lp = bl_get_data(bl);
> 
> -       if (bl->props.state & BL_CORE_SUSPENDED)
> +       if (bl->props.state & (BL_CORE_SUSPENDED | BL_CORE_FBBLANK))
>                 bl->props.brightness = 0;
> 
>         if (lp->mode = PWM_BASED) {
> --
> 1.8.1.5


^ permalink raw reply

* Re: [PATCH] backlight: lp855x: set zero brightness at FBBLANK
From: Jingoo Han @ 2013-07-03  1:52 UTC (permalink / raw)
  To: 'Oskar Andero', linux-kernel, linux-fbdev
  Cc: 'Jean-Christophe Plagniol-Villard',
	'Tomi Valkeinen', 'Radovan Lekanovic',
	'Shingo Nakao', 'Milo Kim',
	'Richard Purdie', Jingoo Han
In-Reply-To: <1372767354-16499-1-git-send-email-oskar.andero@sonymobile.com>

On Tuesday, July 02, 2013 9:16 PM, Oskar Andero wrote:
> 
> From: Shingo Nakao <shingo.x.nakao@sonymobile.com>
> 
> When backlight turns on early from display, a white line can be
> seen on the screen. Therefore make sure backlight is off when we
> are under an fb blank event.
> 
> Signed-off-by: Shingo Nakao <shingo.x.nakao@sonymobile.com>
> Cc: Milo Kim <milo.kim@ti.com>
> Cc: Richard Purdie <rpurdie@rpsys.net>
> Signed-off-by: Oskar Andero <oskar.andero@sonymobile.com>

Acked-by: Jingoo Han <jg1.han@samsung.com>

Best regards,
Jingoo Han

> ---
>  drivers/video/backlight/lp855x_bl.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/video/backlight/lp855x_bl.c b/drivers/video/backlight/lp855x_bl.c
> index a0e1e02..c0b41f1 100644
> --- a/drivers/video/backlight/lp855x_bl.c
> +++ b/drivers/video/backlight/lp855x_bl.c
> @@ -246,7 +246,7 @@ static int lp855x_bl_update_status(struct backlight_device *bl)
>  {
>  	struct lp855x *lp = bl_get_data(bl);
> 
> -	if (bl->props.state & BL_CORE_SUSPENDED)
> +	if (bl->props.state & (BL_CORE_SUSPENDED | BL_CORE_FBBLANK))
>  		bl->props.brightness = 0;
> 
>  	if (lp->mode = PWM_BASED) {
> --
> 1.8.1.5
> 



^ permalink raw reply

* Re: [PATCH RESEND] video: mxsfb: fix color settings for 18bit data bus and 32bpp
From: maxime.ripard @ 2013-07-03  8:55 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <51C01DE1.8030300@digi.com>

[-- Attachment #1: Type: text/plain, Size: 1223 bytes --]

Hi Jean-Christophe,

On Tue, Jun 18, 2013 at 10:44:17AM +0200, Hector Palacios wrote:
> For a combination of 18bit LCD data bus width and a color
> mode of 32bpp, the driver was setting the color mapping to
> rgb666, which is wrong, as the color in memory realy has an
> rgb888 layout.
> 
> This patch also removes the setting of flag CTRL_DF24 that
> makes the driver dimiss the upper 2 bits when handling 32/24bpp
> colors in a diplay with 18bit data bus width. This flag made
> true color images display wrong in such configurations.
> 
> Finally, the color mapping rgb666 has also been removed as nobody
> is using it and high level applications like Qt5 cannot work
> with it either.
> 
> Reference: https://lkml.org/lkml/2013/5/23/220
> Signed-off-by: Hector Palacios <hector.palacios@digi.com>
> Acked-by: Juergen Beisert <jbe@pengutronix.de>
> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>

I don't see this patch in your for-next branch.

It would be really great to have it for 3.11 if possible.

Could you take a look at this patch please?

Thanks,
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply

* [ANNOUNCE] I'm just back
From: Jean-Christophe PLAGNIOL-VILLARD @ 2013-07-03 11:06 UTC (permalink / raw)
  To: linux-fbdev

HI,

	I'm sorry if the fbdev handling was slow those days

	I get sick for 2 weeks and just back to Shanghai

	I'm going through the ML the following days

	And will send the pull to Linus

	Sorry for the delay

Best Regards,
J.

^ permalink raw reply

* Re: [PATCH v2 4/4] at91/avr32/atmel_lcdfb: prepare clk before calling enable
From: Jean-Christophe PLAGNIOL-VILLARD @ 2013-07-03 11:10 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <51C951C2.8090901@atmel.com>

On 10:16 Tue 25 Jun     , Nicolas Ferre wrote:
> On 25/06/2013 10:14, Boris BREZILLON :
> >Replace clk_enable/disable with clk_prepare_enable/disable_unprepare to
> >avoid common clk framework warnings.
> >
> >Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>
> 
> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
> 
> Jean-Christophe, can you take this one?

Yes I'll

Best Regards,
J.
> 
> Thanks, best regards,
> 
> >---
> >  drivers/video/atmel_lcdfb.c |    8 ++++----
> >  1 file changed, 4 insertions(+), 4 deletions(-)
> >
> >diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c
> >index 540909d..8525457 100644
> >--- a/drivers/video/atmel_lcdfb.c
> >+++ b/drivers/video/atmel_lcdfb.c
> >@@ -893,14 +893,14 @@ static int __init atmel_lcdfb_init_fbinfo(struct atmel_lcdfb_info *sinfo)
> >
> >  static void atmel_lcdfb_start_clock(struct atmel_lcdfb_info *sinfo)
> >  {
> >-	clk_enable(sinfo->bus_clk);
> >-	clk_enable(sinfo->lcdc_clk);
> >+	clk_prepare_enable(sinfo->bus_clk);
> >+	clk_prepare_enable(sinfo->lcdc_clk);
> >  }
> >
> >  static void atmel_lcdfb_stop_clock(struct atmel_lcdfb_info *sinfo)
> >  {
> >-	clk_disable(sinfo->bus_clk);
> >-	clk_disable(sinfo->lcdc_clk);
> >+	clk_disable_unprepare(sinfo->bus_clk);
> >+	clk_disable_unprepare(sinfo->lcdc_clk);
> >  }
> >
> >
> >
> 
> 
> -- 
> Nicolas Ferre

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox