Skip to contentSkip to conversation

ARM: davinci: dm355: add support for vpbe display

PATCH Superseded Prabhakar lad 2 participants 5 messages Mar 16, 2013 – Mar 18, 2013

Subsystems (3)

v5 of 8 Superseded Latest is v8 →

lore
Share & tools
lore
#0 lore raw

v5 cover ARM: davinci: dm355: add support for vpbe display

From: Lad, Prabhakar <[email protected]>

This patch series enables VPBE display driver on DM355.

Changes for v5:
1: Rebased on 3.9, fix review comments pointed by Sekhar for DM365 series.

Changes for v4:
1: pass different platform names to handle different ip's.

Changes for v3:
1: Replaced obsolete preset API by timings API.

Changes for v2:
1: Removed VPSS clock alias for master and slave which was
sent for VPSS driver. since this patch was dependent on patch[1]. I will revist this patch once MC(captrure driver) goes into mainline.
[1] http://www.spinics.net/lists/linux-media/msg50562.html

Lad, Prabhakar (2):
ARM: davinci: dm355: add support for v4l2 video display
ARM: davinci: dm355 EVM: add support for VPBE display

 arch/arm/mach-davinci/board-dm355-evm.c |   71 +++++++++++-
 arch/arm/mach-davinci/davinci.h         |    2 +-
 arch/arm/mach-davinci/dm355.c           |  202 +++++++++++++++++++++++++++++--
 3 files changed, 264 insertions(+), 11 deletions(-)
Signature · 1 line
1.7.4.1
#1 lore raw

PATCH v5 1/2 ARM: davinci: dm355: add support for v4l2 video display

From: Lad, Prabhakar <[email protected]>

Create platform devices for various video modules like venc,osd, vpbe and v4l2 driver for dm355.

---
 arch/arm/mach-davinci/board-dm355-evm.c |    4 +-
 arch/arm/mach-davinci/davinci.h         |    2 +-
 arch/arm/mach-davinci/dm355.c           |  202 +++++++++++++++++++++++++++++--
 3 files changed, 197 insertions(+), 11 deletions(-)
arch/arm/mach-davinci/board-dm355-evm.c +2 -2
index 147b8e1..37d12cc 100644
@@ -253,8 +253,6 @@ static struct davinci_uart_config uart_config __initdata = {
 
 static void __init dm355_evm_map_io(void)
 {
-	/* setup input configuration for VPFE input devices */
-	dm355_set_vpfe_config(&vpfe_cfg);
 	dm355_init();
 }
 
@@ -344,6 +342,8 @@ static __init void dm355_evm_init(void)
 	davinci_setup_mmc(0, &dm355evm_mmc_config);
 	davinci_setup_mmc(1, &dm355evm_mmc_config);
 
+	dm355_init_video(&vpfe_cfg, NULL);
+
 	dm355_init_spi0(BIT(0), dm355_evm_spi_info,
 			ARRAY_SIZE(dm355_evm_spi_info));
 
arch/arm/mach-davinci/davinci.h +1 -1
index 1c2670f..acfe0bb 100644
@@ -74,7 +74,7 @@ void __init dm355_init(void);
 void dm355_init_spi0(unsigned chipselect_mask,
 		const struct spi_board_info *info, unsigned len);
 void __init dm355_init_asp1(u32 evt_enable, struct snd_platform_data *pdata);
-void dm355_set_vpfe_config(struct vpfe_config *cfg);
+int __init dm355_init_video(struct vpfe_config *, struct vpbe_config *);
 
 /* DM365 function declarations */
 void __init dm365_init(void);
arch/arm/mach-davinci/dm355.c +194 -8

230 lines not on this page · raw message

Signature · 1 line
1.7.4.1
#2 lore raw

Re: [PATCH v5 1/2] ARM: davinci: dm355: add support for v4l2 video display

Quoted 6 lines · Prabhakar lad

From: Lad, Prabhakar <[email protected]>

Create platform devices for various video modules like venc,osd, vpbe and v4l2 driver for dm355.

Comments on the DM365 series apply to this one too. In addition:

arch/arm/mach-davinci/dm355.c static struct platform_device vpfe_capture_dev = { · line 821

Quoted 12 lines
arch/arm/mach-davinci/dm355.c +10 -1
+static int dm355_vpbe_setup_pinmux(enum v4l2_mbus_pixelcode if_type,
+			    int field)
 {
-	vpfe_capture_dev.dev.platform_data = cfg;
+	switch (if_type) {
+	case V4L2_MBUS_FMT_SGRBG8_1X8:
+		davinci_cfg_reg(DM355_VOUT_FIELD_G70);
+		break;
+
+	case V4L2_MBUS_FMT_YUYV10_1X20:
+		/*
+		 * This was VPBE_DIGITAL_IF_YCC16. Replace the enum

"was VPBE_DIGITAL_IF_YCC16" when? This is the first time this code is getting in.

arch/arm/mach-davinci/dm355.c static struct platform_device vpfe_capture_dev = { · line 822

Quoted 1 line
arch/arm/mach-davinci/dm355.c +1 -0
+		 * accordingly when the right one gets into open source

What is the "right one"? And "open source" == kernel? Then may be just call it that.

Quoted 15 lines
arch/arm/mach-davinci/dm355.c +15 -0
+		 */
+		if (field)
+			davinci_cfg_reg(DM355_VOUT_FIELD);
+		else
+			davinci_cfg_reg(DM355_VOUT_FIELD_G70);
+		break;
+
+	default:
+		return -EINVAL;
+	}
+
+	davinci_cfg_reg(DM355_VOUT_COUTL_EN);
+	davinci_cfg_reg(DM355_VOUT_COUTH_EN);
+
+	return 0;

arch/arm/mach-davinci/dm355.c static struct platform_device vpfe_capture_dev = { · line 847

Quoted 10 lines
arch/arm/mach-davinci/dm355.c +8 -0
 }
 
+static inline u32 dm355_reg_modify(void *reg, u32 val, u32 mask)
+{
+	u32 new_val = (readl(reg) & ~mask) | (val & mask);
+
+	writel(new_val, reg);
+
+	return new_val;
+}

This function needs to be removed.

Thanks,
Sekhar

#3 lore raw

Re: [PATCH v5 1/2] ARM: davinci: dm355: add support for v4l2 video display

Sekhar,

Quoted 10 lines · Sekhar Nori
Quoted 6 lines · Prabhakar lad

From: Lad, Prabhakar <[email protected]>

Create platform devices for various video modules like venc,osd, vpbe and v4l2 driver for dm355.

Comments on the DM365 series apply to this one too. In addition:

OK.

Quoted 16 lines

arch/arm/mach-davinci/dm355.c static struct platform_device vpfe_capture_dev = { · line 821

Quoted 12 lines
arch/arm/mach-davinci/dm355.c +10 -1
+static int dm355_vpbe_setup_pinmux(enum v4l2_mbus_pixelcode if_type,
+                         int field)
 {
-     vpfe_capture_dev.dev.platform_data = cfg;
+     switch (if_type) {
+     case V4L2_MBUS_FMT_SGRBG8_1X8:
+             davinci_cfg_reg(DM355_VOUT_FIELD_G70);
+             break;
+
+     case V4L2_MBUS_FMT_YUYV10_1X20:
+             /*
+              * This was VPBE_DIGITAL_IF_YCC16. Replace the enum

"was VPBE_DIGITAL_IF_YCC16" when? This is the first time this code is getting in.

Quoted 5 lines
Quoted 1 line

+ * accordingly when the right one gets into open source

What is the "right one"? And "open source" == kernel? Then may be just call it that.

Ah this comment doesn't make any sense ' V4L2_MBUS_FMT_YUYV10_1X20' is the correct one itself. I'll remove this comment.

Quoted 17 lines
Quoted 17 lines
arch/arm/mach-davinci/dm355.c +15 -0
+              */
+             if (field)
+                     davinci_cfg_reg(DM355_VOUT_FIELD);
+             else
+                     davinci_cfg_reg(DM355_VOUT_FIELD_G70);
+             break;
+
+     default:
+             return -EINVAL;
+     }
+
+     davinci_cfg_reg(DM355_VOUT_COUTL_EN);
+     davinci_cfg_reg(DM355_VOUT_COUTH_EN);
+
+     return 0;
 }
Quoted 11 lines

arch/arm/mach-davinci/dm355.c static struct platform_device vpfe_capture_dev = { · line 847

Quoted 8 lines
arch/arm/mach-davinci/dm355.c +8 -0
+static inline u32 dm355_reg_modify(void *reg, u32 val, u32 mask)
+{
+     u32 new_val = (readl(reg) & ~mask) | (val & mask);
+
+     writel(new_val, reg);
+
+     return new_val;
+}

This function needs to be removed.

Ah missed, I wonder how the compiler didn't catch it!

Regards,
--Prabhakar

Quoted 2 lines

Thanks,
Sekhar

#4 lore raw

PATCH v5 2/2 ARM: davinci: dm355 EVM: add support for VPBE display

In reply to Prabhakar lad

From: Lad, Prabhakar <[email protected]>

add support for V4L2 video display to DM355 EVM. Support for SD modes is provided, along with Composite output

---
 arch/arm/mach-davinci/board-dm355-evm.c |   69 ++++++++++++++++++++++++++++++-
 1 files changed, 68 insertions(+), 1 deletions(-)
arch/arm/mach-davinci/board-dm355-evm.c +68 -1
index 37d12cc..1043506 100644
@@ -242,6 +242,73 @@ static struct vpfe_config vpfe_cfg = {
 	.ccdc = "DM355 CCDC",
 };
 
+/* venc standards timings */
+static struct vpbe_enc_mode_info dm355evm_enc_preset_timing[] = {
+	{
+		.name		= "ntsc",
+		.timings_type	= VPBE_ENC_STD,
+		.std_id		= V4L2_STD_525_60,
+		.interlaced	= 1,
+		.xres		= 720,
+		.yres		= 480,
+		.aspect		= {11, 10},
+		.fps		= {30000, 1001},
+		.left_margin	= 0x79,
+		.upper_margin	= 0x10,
+	},
+	{
+		.name		= "pal",
+		.timings_type	= VPBE_ENC_STD,
+		.std_id		= V4L2_STD_625_50,
+		.interlaced	= 1,
+		.xres		= 720,
+		.yres		= 576,
+		.aspect		= {54, 59},
+		.fps		= {25, 1},
+		.left_margin	= 0x7E,
+		.upper_margin	= 0x16
+	},
+};
+
+#define VENC_STD_ALL	(V4L2_STD_NTSC | V4L2_STD_PAL)
+
+/*
+ * The outputs available from VPBE + ecnoders. Keep the
+ * the order same as that of encoders. First those from venc followed by that
+ * from encoders. Index in the output refers to index on a particular encoder.
+ * Driver uses this index to pass it to encoder when it supports more than
+ * one output. Application uses index of the array to set an output.
+ */
+static struct vpbe_output dm355evm_vpbe_outputs[] = {
+	{
+		.output		= {
+			.index		= 0,
+			.name		= "Composite",
+			.type		= V4L2_OUTPUT_TYPE_ANALOG,
+			.std		= VENC_STD_ALL,
+			.capabilities	= V4L2_OUT_CAP_STD,
+		},
+		.subdev_name	= DM355_VPBE_VENC_SUBDEV_NAME,
+		.default_mode	= "ntsc",
+		.num_modes	= ARRAY_SIZE(dm355evm_enc_preset_timing),
+		.modes		= dm355evm_enc_preset_timing,
+		.if_params	= V4L2_MBUS_FMT_FIXED,
+	},
+};
+
+static struct vpbe_config dm355evm_display_cfg = {
+	.module_name	= "dm355-vpbe-display",
+	.i2c_adapter_id	= 1,
+	.osd		= {
+		.module_name	= DM355_VPBE_OSD_SUBDEV_NAME,
+	},
+	.venc		= {
+		.module_name	= DM355_VPBE_VENC_SUBDEV_NAME,
+	},
+	.num_outputs	= ARRAY_SIZE(dm355evm_vpbe_outputs),
+	.outputs	= dm355evm_vpbe_outputs,
+};
+
 static struct platform_device *davinci_evm_devices[] __initdata = {
 	&dm355evm_dm9000,
 	&davinci_nand_device,
@@ -342,7 +409,7 @@ static __init void dm355_evm_init(void)
 	davinci_setup_mmc(0, &dm355evm_mmc_config);
 	davinci_setup_mmc(1, &dm355evm_mmc_config);
 
-	dm355_init_video(&vpfe_cfg, NULL);
+	dm355_init_video(&vpfe_cfg, &dm355evm_display_cfg);
 
 	dm355_init_spi0(BIT(0), dm355_evm_spi_info,
 			ARRAY_SIZE(dm355_evm_spi_info));
Signature · 1 line
1.7.4.1