All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 4/5] ARM: shmobile: marzen: Add Display Unit support
@ 2013-08-07 16:19 Laurent Pinchart
  2013-08-07 17:21 ` Sergei Shtylyov
  0 siblings, 1 reply; 2+ messages in thread
From: Laurent Pinchart @ 2013-08-07 16:19 UTC (permalink / raw)
  To: linux-sh

Support the DU0 VGA and DU1 LVDS outputs. DU1 is connected to a
Mitsubishi AA104XD12 panel (10.4" XGA).

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

diff --git a/arch/arm/configs/marzen_defconfig b/arch/arm/configs/marzen_defconfig
index 82e4040..26f30be 100644
--- a/arch/arm/configs/marzen_defconfig
+++ b/arch/arm/configs/marzen_defconfig
@@ -85,6 +85,8 @@ CONFIG_GPIO_RCAR=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 3551b54..325cd0e 100644
--- a/arch/arm/mach-shmobile/board-marzen.c
+++ b/arch/arm/mach-shmobile/board-marzen.c
@@ -29,6 +29,7 @@
 #include <linux/dma-mapping.h>
 #include <linux/pinctrl/machine.h>
 #include <linux/platform_data/gpio-rcar.h>
+#include <linux/platform_data/rcar-du.h>
 #include <linux/platform_data/usb-rcar-phy.h>
 #include <linux/regulator/fixed.h>
 #include <linux/regulator/machine.h>
@@ -167,6 +168,42 @@ static struct platform_device hspi_device = {
 	.num_resources	= ARRAY_SIZE(hspi_resources),
 };
 
+/* DU
+ *
+ * The panel only specifies the [hv]display and [hv]total values. The position
+ * and width of the sync pulses don't matter, they're copied from VESA timings.
+ */
+static struct rcar_du_encoder_data du_encoders[] = {
+	{
+		.type = RCAR_DU_ENCODER_VGA,
+		.output = RCAR_DU_OUTPUT_DPAD0,
+	}, {
+		.type = RCAR_DU_ENCODER_LVDS,
+		.output = RCAR_DU_OUTPUT_DPAD1,
+		.connector.lvds.panel = {
+			.width_mm = 210,
+			.height_mm = 158,
+			.mode = {
+				.clock = 65000,
+				.hdisplay = 1024,
+				.hsync_start = 1048,
+				.hsync_end = 1184,
+				.htotal = 1344,
+				.vdisplay = 768,
+				.vsync_start = 771,
+				.vsync_end = 777,
+				.vtotal = 806,
+				.flags = 0,
+			},
+		},
+	},
+};
+
+static struct rcar_du_platform_data du_pdata = {
+	.encoders = du_encoders,
+	.num_encoders = ARRAY_SIZE(du_encoders),
+};
+
 /* LEDS */
 static struct gpio_led marzen_leds[] = {
 	{
@@ -207,6 +244,19 @@ static struct platform_device *marzen_devices[] __initdata = {
 };
 
 static const struct pinctrl_map marzen_pinctrl_map[] = {
+	/* DU (CN10: ARGB0, CN13: LVDS) */
+	PIN_MAP_MUX_GROUP_DEFAULT("rcar-du", "pfc-r8a7779",
+				  "du0_rgb888", "du0"),
+	PIN_MAP_MUX_GROUP_DEFAULT("rcar-du", "pfc-r8a7779",
+				  "du0_sync_1", "du0"),
+	PIN_MAP_MUX_GROUP_DEFAULT("rcar-du", "pfc-r8a7779",
+				  "du0_clk_out_0", "du0"),
+	PIN_MAP_MUX_GROUP_DEFAULT("rcar-du", "pfc-r8a7779",
+				  "du1_rgb666", "du1"),
+	PIN_MAP_MUX_GROUP_DEFAULT("rcar-du", "pfc-r8a7779",
+				  "du1_sync_1", "du1"),
+	PIN_MAP_MUX_GROUP_DEFAULT("rcar-du", "pfc-r8a7779",
+				  "du1_clk_out", "du1"),
 	/* HSPI0 */
 	PIN_MAP_MUX_GROUP_DEFAULT("sh-hspi.0", "pfc-r8a7779",
 				  "hspi0", "hspi0"),
@@ -255,6 +305,7 @@ static void __init marzen_init(void)
 
 	r8a7779_add_standard_devices();
 	platform_add_devices(marzen_devices, ARRAY_SIZE(marzen_devices));
+	r8a7779_add_du_device(&du_pdata);
 }
 
 static const char *marzen_boards_compat_dt[] __initdata = {
-- 
1.8.1.5


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 4/5] ARM: shmobile: marzen: Add Display Unit support
  2013-08-07 16:19 [PATCH 4/5] ARM: shmobile: marzen: Add Display Unit support Laurent Pinchart
@ 2013-08-07 17:21 ` Sergei Shtylyov
  0 siblings, 0 replies; 2+ messages in thread
From: Sergei Shtylyov @ 2013-08-07 17:21 UTC (permalink / raw)
  To: linux-sh

Hello.

On 08/07/2013 08:19 PM, Laurent Pinchart wrote:

> Support the DU0 VGA and DU1 LVDS outputs. DU1 is connected to a
> Mitsubishi AA104XD12 panel (10.4" XGA).

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

> diff --git a/arch/arm/configs/marzen_defconfig b/arch/arm/configs/marzen_defconfig
> index 82e4040..26f30be 100644
> --- a/arch/arm/configs/marzen_defconfig
> +++ b/arch/arm/configs/marzen_defconfig
> @@ -85,6 +85,8 @@ CONFIG_GPIO_RCAR=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

    Should be in a separate patch.

> diff --git a/arch/arm/mach-shmobile/board-marzen.c b/arch/arm/mach-shmobile/board-marzen.c
> index 3551b54..325cd0e 100644
> --- a/arch/arm/mach-shmobile/board-marzen.c
> +++ b/arch/arm/mach-shmobile/board-marzen.c
[...]
> +static struct rcar_du_platform_data du_pdata = {

    Should be annotated with '__initdata'.

> +	.encoders = du_encoders,
> +	.num_encoders = ARRAY_SIZE(du_encoders),
> +};
> +

WBR, Sergei


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-08-07 17:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-07 16:19 [PATCH 4/5] ARM: shmobile: marzen: Add Display Unit support Laurent Pinchart
2013-08-07 17:21 ` Sergei Shtylyov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.