diff mbox

[v2,3/3] ARM: shmobile: marzen: Add Display Unit support

Message ID 1363271746-9806-4-git-send-email-laurent.pinchart+renesas@ideasonboard.com (mailing list archive)
State New, archived
Headers show

Commit Message

Laurent Pinchart March 14, 2013, 2:35 p.m. UTC
Only the DU0 VGA output is currently supported. Support for the DU0 LVDS
and DU1 LVDS outputs will require information about the panels that will
be connected to those outputs.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
---
 arch/arm/configs/marzen_defconfig     |  2 ++
 arch/arm/mach-shmobile/board-marzen.c | 65 +++++++++++++++++++++++++++++++++++
 2 files changed, 67 insertions(+)

Comments

Sergei Shtylyov March 14, 2013, 5:34 p.m. UTC | #1
Hello.

On 14-03-2013 18:35, Laurent Pinchart wrote:

> Only the DU0 VGA output is currently supported. Support for the DU0 LVDS
> and DU1 LVDS outputs will require information about the panels that will
> be connected to those outputs.

> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> ---
>   arch/arm/configs/marzen_defconfig     |  2 ++
>   arch/arm/mach-shmobile/board-marzen.c | 65 +++++++++++++++++++++++++++++++++++
>   2 files changed, 67 insertions(+)

> diff --git a/arch/arm/mach-shmobile/board-marzen.c b/arch/arm/mach-shmobile/board-marzen.c
> index cdcb799..0020506 100644
> --- a/arch/arm/mach-shmobile/board-marzen.c
> +++ b/arch/arm/mach-shmobile/board-marzen.c
[...]
> @@ -147,6 +148,38 @@ static struct platform_device hspi_device = {
>   	.num_resources	= ARRAY_SIZE(hspi_resources),
>   };
>
> +/* DU */
> +static struct resource rcar_du_resources[] = {
> +	[0] = {
> +		.name	= "Display Unit",
> +		.start	= 0xfff80000,
> +		.end	= 0xfffb1007,
> +		.flags	= IORESOURCE_MEM,
> +	},
> +	[1] = {
> +		.start	= gic_spi(31),
> +		.flags	= IORESOURCE_IRQ,
> +	},
> +};
> +
> +static struct rcar_du_platform_data rcar_du_pdata = {
> +	.encoders = {
> +		[0] = {
> +			.encoder = RCAR_DU_ENCODER_VGA,
> +		},
> +	},
> +};
> +
> +static struct platform_device rcar_du_device = {
> +	.name		= "rcar-du",
> +	.num_resources	= ARRAY_SIZE(rcar_du_resources),
> +	.resource	= rcar_du_resources,
> +	.dev	= {
> +		.platform_data = &rcar_du_pdata,
> +		.coherent_dma_mask = ~0,
> +	},
> +};
> +

    Are we seeing again SoC device declared in the board file? That simply 
doesn't scale...

WBR, Sergei
Sergei Shtylyov March 14, 2013, 10:11 p.m. UTC | #2
On 15.03.2013 0:11, Laurent Pinchart wrote:

>>> Only the DU0 VGA output is currently supported. Support for the DU0 LVDS
>>> and DU1 LVDS outputs will require information about the panels that will
>>> be connected to those outputs.

>>> Signed-off-by: Laurent Pinchart
>>> <laurent.pinchart+renesas@ideasonboard.com>
>>> ---

>>>    arch/arm/configs/marzen_defconfig     |  2 ++
>>>    arch/arm/mach-shmobile/board-marzen.c | 65 +++++++++++++++++++++++++++++
>>>    2 files changed, 67 insertions(+)

>>> diff --git a/arch/arm/mach-shmobile/board-marzen.c
>>> b/arch/arm/mach-shmobile/board-marzen.c index cdcb799..0020506 100644
>>> --- a/arch/arm/mach-shmobile/board-marzen.c
>>> +++ b/arch/arm/mach-shmobile/board-marzen.c

>> [...]

>>> @@ -147,6 +148,38 @@ static struct platform_device hspi_device = {
>>>    	.num_resources	= ARRAY_SIZE(hspi_resources),
>>>    };
>>>
>>> +/* DU */
>>> +static struct resource rcar_du_resources[] = {
>>> +	[0] = {
>>> +		.name	= "Display Unit",
>>> +		.start	= 0xfff80000,
>>> +		.end	= 0xfffb1007,
>>> +		.flags	= IORESOURCE_MEM,
>>> +	},
>>> +	[1] = {
>>> +		.start	= gic_spi(31),
>>> +		.flags	= IORESOURCE_IRQ,
>>> +	},
>>> +};
>>> +
>>> +static struct rcar_du_platform_data rcar_du_pdata = {
>>> +	.encoders = {
>>> +		[0] = {
>>> +			.encoder = RCAR_DU_ENCODER_VGA,
>>> +		},
>>> +	},
>>> +};
>>> +
>>> +static struct platform_device rcar_du_device = {
>>> +	.name		= "rcar-du",
>>> +	.num_resources	= ARRAY_SIZE(rcar_du_resources),
>>> +	.resource	= rcar_du_resources,
>>> +	.dev	= {
>>> +		.platform_data = &rcar_du_pdata,
>>> +		.coherent_dma_mask = ~0,
>>> +	},
>>> +};
>>> +

>> Are we seeing again SoC device declared in the board file? That simply
>> doesn't scale...

> The goal is obviously to move all that to DT, but there's no DT bindings for
> the DU DRM driver yet.

    I don't see how it justifies dubious non-DT design. Let me tell/remind you 
about the LTSI-3.4 tree where all this stuff can be backported and which 
doesn't have DT support, AFAIR.

WBR, Sergei
Sergei Shtylyov March 15, 2013, 12:54 p.m. UTC | #3
Hello.

On 15-03-2013 5:36, Laurent Pinchart wrote:

>>>>> Only the DU0 VGA output is currently supported. Support for the DU0 LVDS
>>>>> and DU1 LVDS outputs will require information about the panels that will
>>>>> be connected to those outputs.

>>>>> Signed-off-by: Laurent Pinchart
>>>>> <laurent.pinchart+renesas@ideasonboard.com>
>>>>> ---

>>>>>     arch/arm/configs/marzen_defconfig     |  2 ++
>>>>>     arch/arm/mach-shmobile/board-marzen.c | 65
>>>>>     +++++++++++++++++++++++++++++
>>>>>     2 files changed, 67 insertions(+)

>>>>> diff --git a/arch/arm/mach-shmobile/board-marzen.c
>>>>> b/arch/arm/mach-shmobile/board-marzen.c index cdcb799..0020506 100644
>>>>> --- a/arch/arm/mach-shmobile/board-marzen.c
>>>>> +++ b/arch/arm/mach-shmobile/board-marzen.c

>>>> [...]

>>>>> @@ -147,6 +148,38 @@ static struct platform_device hspi_device = {
>>>>>     	.num_resources	= ARRAY_SIZE(hspi_resources),
>>>>>     };
>>>>>
>>>>> +/* DU */
>>>>> +static struct resource rcar_du_resources[] = {
>>>>> +	[0] = {
>>>>> +		.name	= "Display Unit",
>>>>> +		.start	= 0xfff80000,
>>>>> +		.end	= 0xfffb1007,
>>>>> +		.flags	= IORESOURCE_MEM,
>>>>> +	},
>>>>> +	[1] = {
>>>>> +		.start	= gic_spi(31),
>>>>> +		.flags	= IORESOURCE_IRQ,
>>>>> +	},
>>>>> +};
>>>>> +
>>>>> +static struct rcar_du_platform_data rcar_du_pdata = {
>>>>> +	.encoders = {
>>>>> +		[0] = {
>>>>> +			.encoder = RCAR_DU_ENCODER_VGA,
>>>>> +		},
>>>>> +	},
>>>>> +};
>>>>> +
>>>>> +static struct platform_device rcar_du_device = {
>>>>> +	.name		= "rcar-du",
>>>>> +	.num_resources	= ARRAY_SIZE(rcar_du_resources),
>>>>> +	.resource	= rcar_du_resources,
>>>>> +	.dev	= {
>>>>> +		.platform_data = &rcar_du_pdata,
>>>>> +		.coherent_dma_mask = ~0,
>>>>> +	},
>>>>> +};
>>>>> +

>>>> Are we seeing again SoC device declared in the board file? That simply
>>>> doesn't scale...

>>> The goal is obviously to move all that to DT, but there's no DT bindings
>>> for the DU DRM driver yet.

>> I don't see how it justifies dubious non-DT design. Let me tell/remind you
>> about the LTSI-3.4 tree where all this stuff can be backported and which
>> doesn't have DT support, AFAIR.

> This patch is an example only, I should have marked it as such. If I need to
> push something similar to mainline I will keep your comment in mind and see
> how I can move the platform device to setup-r8a7779.c. Platform data, however,
> need to be provided on a per-board basis.

    Yes, it's the usual case of their usage.
    Thanks for heeding to my comment.

WBR, Sergei
Sergei Shtylyov March 15, 2013, 12:55 p.m. UTC | #4
Hello.

On 14-03-2013 18:35, Laurent Pinchart wrote:

> Only the DU0 VGA output is currently supported. Support for the DU0 LVDS
> and DU1 LVDS outputs will require information about the panels that will
> be connected to those outputs.

> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
[...]

> diff --git a/arch/arm/mach-shmobile/board-marzen.c b/arch/arm/mach-shmobile/board-marzen.c
> index cdcb799..0020506 100644
> --- a/arch/arm/mach-shmobile/board-marzen.c
> +++ b/arch/arm/mach-shmobile/board-marzen.c
[...]
> @@ -147,6 +148,38 @@ static struct platform_device hspi_device = {
>   	.num_resources	= ARRAY_SIZE(hspi_resources),
>   };
>
> +/* DU */
> +static struct resource rcar_du_resources[] = {
> +	[0] = {
> +		.name	= "Display Unit",
> +		.start	= 0xfff80000,
> +		.end	= 0xfffb1007,
> +		.flags	= IORESOURCE_MEM,
> +	},
> +	[1] = {
> +		.start	= gic_spi(31),

    Forgot to add: we're supoosed to use the new gic_iid() macro instead.

WBR, Sergei
Laurent Pinchart March 15, 2013, 1:04 p.m. UTC | #5
Hi Sergei,

On Friday 15 March 2013 16:55:58 Sergei Shtylyov wrote:
> On 14-03-2013 18:35, Laurent Pinchart wrote:
> > Only the DU0 VGA output is currently supported. Support for the DU0 LVDS
> > and DU1 LVDS outputs will require information about the panels that will
> > be connected to those outputs.
> > 
> > Signed-off-by: Laurent Pinchart
> > <laurent.pinchart+renesas@ideasonboard.com>
> 
> [...]
> 
> > diff --git a/arch/arm/mach-shmobile/board-marzen.c
> > b/arch/arm/mach-shmobile/board-marzen.c index cdcb799..0020506 100644
> > --- a/arch/arm/mach-shmobile/board-marzen.c
> > +++ b/arch/arm/mach-shmobile/board-marzen.c
> 
> [...]
> 
> > @@ -147,6 +148,38 @@ static struct platform_device hspi_device = {
> >   	.num_resources	= ARRAY_SIZE(hspi_resources),
> >   };
> > 
> > +/* DU */
> > +static struct resource rcar_du_resources[] = {
> > +	[0] = {
> > +		.name	= "Display Unit",
> > +		.start	= 0xfff80000,
> > +		.end	= 0xfffb1007,
> > +		.flags	= IORESOURCE_MEM,
> > +	},
> > +	[1] = {
> > +		.start	= gic_spi(31),
> 
> Forgot to add: we're supoosed to use the new gic_iid() macro instead.

Thanks for pointing this out. I've based this patch on mainline where 
gic_iid() isn't available yet. I'll make sure to rebase on Simon's tree before 
sending a pull request.
Simon Horman March 27, 2013, 4:01 a.m. UTC | #6
On Thu, Mar 14, 2013 at 03:35:46PM +0100, Laurent Pinchart wrote:
> Only the DU0 VGA output is currently supported. Support for the DU0 LVDS
> and DU1 LVDS outputs will require information about the panels that will
> be connected to those outputs.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> ---
>  arch/arm/configs/marzen_defconfig     |  2 ++
>  arch/arm/mach-shmobile/board-marzen.c | 65 +++++++++++++++++++++++++++++++++++
>  2 files changed, 67 insertions(+)
> 
> diff --git a/arch/arm/configs/marzen_defconfig b/arch/arm/configs/marzen_defconfig
> index afb17d6..76f9402 100644
> --- a/arch/arm/configs/marzen_defconfig
> +++ b/arch/arm/configs/marzen_defconfig
> @@ -79,6 +79,8 @@ CONFIG_GPIO_SYSFS=y
>  CONFIG_THERMAL=y
>  CONFIG_RCAR_THERMAL=y
>  CONFIG_SSB=y
> +CONFIG_DRM=y
> +CONFIG_DRM_RCAR_DU=y
>  CONFIG_USB=y
>  CONFIG_USB_RCAR_PHY=y
>  CONFIG_MMC=y
> diff --git a/arch/arm/mach-shmobile/board-marzen.c b/arch/arm/mach-shmobile/board-marzen.c
> index cdcb799..0020506 100644
> --- a/arch/arm/mach-shmobile/board-marzen.c
> +++ b/arch/arm/mach-shmobile/board-marzen.c
> @@ -38,6 +38,7 @@
>  #include <linux/usb/ehci_pdriver.h>
>  #include <linux/usb/ohci_pdriver.h>
>  #include <linux/pm_runtime.h>
> +#include <linux/platform_data/rcar-du.h>
>  #include <mach/hardware.h>
>  #include <mach/r8a7779.h>
>  #include <mach/common.h>
> @@ -147,6 +148,38 @@ static struct platform_device hspi_device = {
>  	.num_resources	= ARRAY_SIZE(hspi_resources),
>  };
>  
> +/* DU */
> +static struct resource rcar_du_resources[] = {
> +	[0] = {
> +		.name	= "Display Unit",
> +		.start	= 0xfff80000,
> +		.end	= 0xfffb1007,
> +		.flags	= IORESOURCE_MEM,
> +	},
> +	[1] = {
> +		.start	= gic_spi(31),
> +		.flags	= IORESOURCE_IRQ,
> +	},
> +};
> +
> +static struct rcar_du_platform_data rcar_du_pdata = {
> +	.encoders = {
> +		[0] = {
> +			.encoder = RCAR_DU_ENCODER_VGA,
> +		},
> +	},
> +};
> +
> +static struct platform_device rcar_du_device = {
> +	.name		= "rcar-du",
> +	.num_resources	= ARRAY_SIZE(rcar_du_resources),
> +	.resource	= rcar_du_resources,
> +	.dev	= {
> +		.platform_data = &rcar_du_pdata,
> +		.coherent_dma_mask = ~0,
> +	},
> +};
> +
>  /* USB PHY */
>  static struct resource usb_phy_resources[] = {
>  	[0] = {
> @@ -173,6 +206,7 @@ static struct platform_device *marzen_devices[] __initdata = {
>  	&thermal_device,
>  	&hspi_device,
>  	&usb_phy_device,
> +	&rcar_du_device,
>  };
>  
>  /* USB */
> @@ -363,6 +397,37 @@ static void __init marzen_init(void)
>  	gpio_request(GPIO_FN_HSPI_TX0,	NULL);
>  	gpio_request(GPIO_FN_HSPI_RX0,	NULL);
>  
> +	/* Display Unit 0 (CN10: ARGB0) */
> +	gpio_request(GPIO_FN_DU0_DR7, NULL);
> +	gpio_request(GPIO_FN_DU0_DR6, NULL);
> +	gpio_request(GPIO_FN_DU0_DR5, NULL);
> +	gpio_request(GPIO_FN_DU0_DR4, NULL);
> +	gpio_request(GPIO_FN_DU0_DR3, NULL);
> +	gpio_request(GPIO_FN_DU0_DR2, NULL);
> +	gpio_request(GPIO_FN_DU0_DR1, NULL);
> +	gpio_request(GPIO_FN_DU0_DR0, NULL);
> +	gpio_request(GPIO_FN_DU0_DG7, NULL);
> +	gpio_request(GPIO_FN_DU0_DG6, NULL);
> +	gpio_request(GPIO_FN_DU0_DG5, NULL);
> +	gpio_request(GPIO_FN_DU0_DG4, NULL);
> +	gpio_request(GPIO_FN_DU0_DG3, NULL);
> +	gpio_request(GPIO_FN_DU0_DG2, NULL);
> +	gpio_request(GPIO_FN_DU0_DG1, NULL);
> +	gpio_request(GPIO_FN_DU0_DG0, NULL);
> +	gpio_request(GPIO_FN_DU0_DB7, NULL);
> +	gpio_request(GPIO_FN_DU0_DB6, NULL);
> +	gpio_request(GPIO_FN_DU0_DB5, NULL);
> +	gpio_request(GPIO_FN_DU0_DB4, NULL);
> +	gpio_request(GPIO_FN_DU0_DB3, NULL);
> +	gpio_request(GPIO_FN_DU0_DB2, NULL);
> +	gpio_request(GPIO_FN_DU0_DB1, NULL);
> +	gpio_request(GPIO_FN_DU0_DB0, NULL);
> +	gpio_request(GPIO_FN_DU0_EXVSYNC_DU0_VSYNC, NULL);
> +	gpio_request(GPIO_FN_DU0_EXHSYNC_DU0_HSYNC, NULL);
> +	gpio_request(GPIO_FN_DU0_DOTCLKOUT0, NULL);
> +	gpio_request(GPIO_FN_DU0_DOTCLKOUT1, NULL);
> +	gpio_request(GPIO_FN_DU0_DISP, NULL);
> +
>  	/* USB (CN21) */
>  	gpio_request(GPIO_FN_USB_OVC0, NULL);
>  	gpio_request(GPIO_FN_USB_OVC1, NULL);

Hi Laurent,

do you have a version of this patch that will work in conjunction with
recent pinctrl changes and adds an entry/entries to marzen_pinctrl_map[]
instead of calling gpio_request?
Laurent Pinchart March 27, 2013, 9:49 a.m. UTC | #7
Hi Simon,

On Wednesday 27 March 2013 13:01:43 Simon Horman wrote:
> On Thu, Mar 14, 2013 at 03:35:46PM +0100, Laurent Pinchart wrote:
> > Only the DU0 VGA output is currently supported. Support for the DU0 LVDS
> > and DU1 LVDS outputs will require information about the panels that will
> > be connected to those outputs.
> > 
> > Signed-off-by: Laurent Pinchart 
> > <laurent.pinchart+renesas@ideasonboard.com>
> > ---
> > 
> >  arch/arm/configs/marzen_defconfig     |  2 ++
> >  arch/arm/mach-shmobile/board-marzen.c | 65 ++++++++++++++++++++++++++++++
> >  2 files changed, 67 insertions(+)

[snip]

> > diff --git a/arch/arm/mach-shmobile/board-marzen.c
> > b/arch/arm/mach-shmobile/board-marzen.c index cdcb799..0020506 100644
> > --- a/arch/arm/mach-shmobile/board-marzen.c
> > +++ b/arch/arm/mach-shmobile/board-marzen.c

[snip]

> > @@ -363,6 +397,37 @@ static void __init marzen_init(void)
> >  	gpio_request(GPIO_FN_HSPI_TX0,	NULL);
> >  	gpio_request(GPIO_FN_HSPI_RX0,	NULL);
> > 
> > +	/* Display Unit 0 (CN10: ARGB0) */
> > +	gpio_request(GPIO_FN_DU0_DR7, NULL);
> > +	gpio_request(GPIO_FN_DU0_DR6, NULL);
> > +	gpio_request(GPIO_FN_DU0_DR5, NULL);
> > +	gpio_request(GPIO_FN_DU0_DR4, NULL);
> > +	gpio_request(GPIO_FN_DU0_DR3, NULL);
> > +	gpio_request(GPIO_FN_DU0_DR2, NULL);
> > +	gpio_request(GPIO_FN_DU0_DR1, NULL);
> > +	gpio_request(GPIO_FN_DU0_DR0, NULL);
> > +	gpio_request(GPIO_FN_DU0_DG7, NULL);
> > +	gpio_request(GPIO_FN_DU0_DG6, NULL);
> > +	gpio_request(GPIO_FN_DU0_DG5, NULL);
> > +	gpio_request(GPIO_FN_DU0_DG4, NULL);
> > +	gpio_request(GPIO_FN_DU0_DG3, NULL);
> > +	gpio_request(GPIO_FN_DU0_DG2, NULL);
> > +	gpio_request(GPIO_FN_DU0_DG1, NULL);
> > +	gpio_request(GPIO_FN_DU0_DG0, NULL);
> > +	gpio_request(GPIO_FN_DU0_DB7, NULL);
> > +	gpio_request(GPIO_FN_DU0_DB6, NULL);
> > +	gpio_request(GPIO_FN_DU0_DB5, NULL);
> > +	gpio_request(GPIO_FN_DU0_DB4, NULL);
> > +	gpio_request(GPIO_FN_DU0_DB3, NULL);
> > +	gpio_request(GPIO_FN_DU0_DB2, NULL);
> > +	gpio_request(GPIO_FN_DU0_DB1, NULL);
> > +	gpio_request(GPIO_FN_DU0_DB0, NULL);
> > +	gpio_request(GPIO_FN_DU0_EXVSYNC_DU0_VSYNC, NULL);
> > +	gpio_request(GPIO_FN_DU0_EXHSYNC_DU0_HSYNC, NULL);
> > +	gpio_request(GPIO_FN_DU0_DOTCLKOUT0, NULL);
> > +	gpio_request(GPIO_FN_DU0_DOTCLKOUT1, NULL);
> > +	gpio_request(GPIO_FN_DU0_DISP, NULL);
> > +
> >  	/* USB (CN21) */
> >  	gpio_request(GPIO_FN_USB_OVC0, NULL);
> >  	gpio_request(GPIO_FN_USB_OVC1, NULL);
> 
> Hi Laurent,
> 
> do you have a version of this patch that will work in conjunction with
> recent pinctrl changes and adds an entry/entries to marzen_pinctrl_map[]
> instead of calling gpio_request?

I'm working on that, the next version will use the pinctrl API. Do you need an 
early patch ?
Simon Horman March 27, 2013, 10:44 a.m. UTC | #8
On Wed, Mar 27, 2013 at 10:49:10AM +0100, Laurent Pinchart wrote:
> Hi Simon,
> 
> On Wednesday 27 March 2013 13:01:43 Simon Horman wrote:
> > On Thu, Mar 14, 2013 at 03:35:46PM +0100, Laurent Pinchart wrote:
> > > Only the DU0 VGA output is currently supported. Support for the DU0 LVDS
> > > and DU1 LVDS outputs will require information about the panels that will
> > > be connected to those outputs.
> > > 
> > > Signed-off-by: Laurent Pinchart 
> > > <laurent.pinchart+renesas@ideasonboard.com>
> > > ---
> > > 
> > >  arch/arm/configs/marzen_defconfig     |  2 ++
> > >  arch/arm/mach-shmobile/board-marzen.c | 65 ++++++++++++++++++++++++++++++
> > >  2 files changed, 67 insertions(+)
> 
> [snip]
> 
> > > diff --git a/arch/arm/mach-shmobile/board-marzen.c
> > > b/arch/arm/mach-shmobile/board-marzen.c index cdcb799..0020506 100644
> > > --- a/arch/arm/mach-shmobile/board-marzen.c
> > > +++ b/arch/arm/mach-shmobile/board-marzen.c
> 
> [snip]
> 
> > > @@ -363,6 +397,37 @@ static void __init marzen_init(void)
> > >  	gpio_request(GPIO_FN_HSPI_TX0,	NULL);
> > >  	gpio_request(GPIO_FN_HSPI_RX0,	NULL);
> > > 
> > > +	/* Display Unit 0 (CN10: ARGB0) */
> > > +	gpio_request(GPIO_FN_DU0_DR7, NULL);
> > > +	gpio_request(GPIO_FN_DU0_DR6, NULL);
> > > +	gpio_request(GPIO_FN_DU0_DR5, NULL);
> > > +	gpio_request(GPIO_FN_DU0_DR4, NULL);
> > > +	gpio_request(GPIO_FN_DU0_DR3, NULL);
> > > +	gpio_request(GPIO_FN_DU0_DR2, NULL);
> > > +	gpio_request(GPIO_FN_DU0_DR1, NULL);
> > > +	gpio_request(GPIO_FN_DU0_DR0, NULL);
> > > +	gpio_request(GPIO_FN_DU0_DG7, NULL);
> > > +	gpio_request(GPIO_FN_DU0_DG6, NULL);
> > > +	gpio_request(GPIO_FN_DU0_DG5, NULL);
> > > +	gpio_request(GPIO_FN_DU0_DG4, NULL);
> > > +	gpio_request(GPIO_FN_DU0_DG3, NULL);
> > > +	gpio_request(GPIO_FN_DU0_DG2, NULL);
> > > +	gpio_request(GPIO_FN_DU0_DG1, NULL);
> > > +	gpio_request(GPIO_FN_DU0_DG0, NULL);
> > > +	gpio_request(GPIO_FN_DU0_DB7, NULL);
> > > +	gpio_request(GPIO_FN_DU0_DB6, NULL);
> > > +	gpio_request(GPIO_FN_DU0_DB5, NULL);
> > > +	gpio_request(GPIO_FN_DU0_DB4, NULL);
> > > +	gpio_request(GPIO_FN_DU0_DB3, NULL);
> > > +	gpio_request(GPIO_FN_DU0_DB2, NULL);
> > > +	gpio_request(GPIO_FN_DU0_DB1, NULL);
> > > +	gpio_request(GPIO_FN_DU0_DB0, NULL);
> > > +	gpio_request(GPIO_FN_DU0_EXVSYNC_DU0_VSYNC, NULL);
> > > +	gpio_request(GPIO_FN_DU0_EXHSYNC_DU0_HSYNC, NULL);
> > > +	gpio_request(GPIO_FN_DU0_DOTCLKOUT0, NULL);
> > > +	gpio_request(GPIO_FN_DU0_DOTCLKOUT1, NULL);
> > > +	gpio_request(GPIO_FN_DU0_DISP, NULL);
> > > +
> > >  	/* USB (CN21) */
> > >  	gpio_request(GPIO_FN_USB_OVC0, NULL);
> > >  	gpio_request(GPIO_FN_USB_OVC1, NULL);
> > 
> > Hi Laurent,
> > 
> > do you have a version of this patch that will work in conjunction with
> > recent pinctrl changes and adds an entry/entries to marzen_pinctrl_map[]
> > instead of calling gpio_request?
> 
> I'm working on that, the next version will use the pinctrl API. Do you need an 
> early patch ?

If possible that would be very helpful.
diff mbox

Patch

diff --git a/arch/arm/configs/marzen_defconfig b/arch/arm/configs/marzen_defconfig
index afb17d6..76f9402 100644
--- a/arch/arm/configs/marzen_defconfig
+++ b/arch/arm/configs/marzen_defconfig
@@ -79,6 +79,8 @@  CONFIG_GPIO_SYSFS=y
 CONFIG_THERMAL=y
 CONFIG_RCAR_THERMAL=y
 CONFIG_SSB=y
+CONFIG_DRM=y
+CONFIG_DRM_RCAR_DU=y
 CONFIG_USB=y
 CONFIG_USB_RCAR_PHY=y
 CONFIG_MMC=y
diff --git a/arch/arm/mach-shmobile/board-marzen.c b/arch/arm/mach-shmobile/board-marzen.c
index cdcb799..0020506 100644
--- a/arch/arm/mach-shmobile/board-marzen.c
+++ b/arch/arm/mach-shmobile/board-marzen.c
@@ -38,6 +38,7 @@ 
 #include <linux/usb/ehci_pdriver.h>
 #include <linux/usb/ohci_pdriver.h>
 #include <linux/pm_runtime.h>
+#include <linux/platform_data/rcar-du.h>
 #include <mach/hardware.h>
 #include <mach/r8a7779.h>
 #include <mach/common.h>
@@ -147,6 +148,38 @@  static struct platform_device hspi_device = {
 	.num_resources	= ARRAY_SIZE(hspi_resources),
 };
 
+/* DU */
+static struct resource rcar_du_resources[] = {
+	[0] = {
+		.name	= "Display Unit",
+		.start	= 0xfff80000,
+		.end	= 0xfffb1007,
+		.flags	= IORESOURCE_MEM,
+	},
+	[1] = {
+		.start	= gic_spi(31),
+		.flags	= IORESOURCE_IRQ,
+	},
+};
+
+static struct rcar_du_platform_data rcar_du_pdata = {
+	.encoders = {
+		[0] = {
+			.encoder = RCAR_DU_ENCODER_VGA,
+		},
+	},
+};
+
+static struct platform_device rcar_du_device = {
+	.name		= "rcar-du",
+	.num_resources	= ARRAY_SIZE(rcar_du_resources),
+	.resource	= rcar_du_resources,
+	.dev	= {
+		.platform_data = &rcar_du_pdata,
+		.coherent_dma_mask = ~0,
+	},
+};
+
 /* USB PHY */
 static struct resource usb_phy_resources[] = {
 	[0] = {
@@ -173,6 +206,7 @@  static struct platform_device *marzen_devices[] __initdata = {
 	&thermal_device,
 	&hspi_device,
 	&usb_phy_device,
+	&rcar_du_device,
 };
 
 /* USB */
@@ -363,6 +397,37 @@  static void __init marzen_init(void)
 	gpio_request(GPIO_FN_HSPI_TX0,	NULL);
 	gpio_request(GPIO_FN_HSPI_RX0,	NULL);
 
+	/* Display Unit 0 (CN10: ARGB0) */
+	gpio_request(GPIO_FN_DU0_DR7, NULL);
+	gpio_request(GPIO_FN_DU0_DR6, NULL);
+	gpio_request(GPIO_FN_DU0_DR5, NULL);
+	gpio_request(GPIO_FN_DU0_DR4, NULL);
+	gpio_request(GPIO_FN_DU0_DR3, NULL);
+	gpio_request(GPIO_FN_DU0_DR2, NULL);
+	gpio_request(GPIO_FN_DU0_DR1, NULL);
+	gpio_request(GPIO_FN_DU0_DR0, NULL);
+	gpio_request(GPIO_FN_DU0_DG7, NULL);
+	gpio_request(GPIO_FN_DU0_DG6, NULL);
+	gpio_request(GPIO_FN_DU0_DG5, NULL);
+	gpio_request(GPIO_FN_DU0_DG4, NULL);
+	gpio_request(GPIO_FN_DU0_DG3, NULL);
+	gpio_request(GPIO_FN_DU0_DG2, NULL);
+	gpio_request(GPIO_FN_DU0_DG1, NULL);
+	gpio_request(GPIO_FN_DU0_DG0, NULL);
+	gpio_request(GPIO_FN_DU0_DB7, NULL);
+	gpio_request(GPIO_FN_DU0_DB6, NULL);
+	gpio_request(GPIO_FN_DU0_DB5, NULL);
+	gpio_request(GPIO_FN_DU0_DB4, NULL);
+	gpio_request(GPIO_FN_DU0_DB3, NULL);
+	gpio_request(GPIO_FN_DU0_DB2, NULL);
+	gpio_request(GPIO_FN_DU0_DB1, NULL);
+	gpio_request(GPIO_FN_DU0_DB0, NULL);
+	gpio_request(GPIO_FN_DU0_EXVSYNC_DU0_VSYNC, NULL);
+	gpio_request(GPIO_FN_DU0_EXHSYNC_DU0_HSYNC, NULL);
+	gpio_request(GPIO_FN_DU0_DOTCLKOUT0, NULL);
+	gpio_request(GPIO_FN_DU0_DOTCLKOUT1, NULL);
+	gpio_request(GPIO_FN_DU0_DISP, NULL);
+
 	/* USB (CN21) */
 	gpio_request(GPIO_FN_USB_OVC0, NULL);
 	gpio_request(GPIO_FN_USB_OVC1, NULL);