[GIT PULL for v3.2] OMAP_VOUT: Few cleaups and feature addition

2011-10-22 Thread hvaibhav
Hi Mauro,

The following changes since commit 35a912455ff5640dc410e91279b03e04045265b2:
  Mauro Carvalho Chehab (1):
Merge branch 'v4l_for_linus' into staging/for_v3.2

are available in the git repository at:

  git://arago-project.org/git/people/vaibhav/ti-psp-omap-video.git 
for-linux-media

Archit Taneja (5):
  OMAP_VOUT: Fix check in reqbuf for buf_size allocation
  OMAP_VOUT: CLEANUP: Remove redundant code from omap_vout_isr
  OMAP_VOUT: Fix VSYNC IRQ handling in omap_vout_isr
  OMAP_VOUT: Add support for DSI panels
  OMAP_VOUT: Increase MAX_DISPLAYS to a larger value

 drivers/media/video/omap/omap_vout.c|  187 ---
 drivers/media/video/omap/omap_voutdef.h |2 +-
 2 files changed, 97 insertions(+), 92 deletions(-)
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GIT PULL for v3.1-rc] OMAP_VOUT: Fix build failure

2011-08-29 Thread hvaibhav
Hi Mauro,

I missed this patch for last rc release, can you please queue up for
next rc.


The following changes since commit 55f9c40ff632d03c527d6a6ceddcda0a224587a6:
  Linus Torvalds (1):
Merge git://git.kernel.org/.../davem/sparc

are available in the git repository at:

  git://arago-project.org/git/people/vaibhav/ti-psp-omap-video.git 
for-linux-media-rc

Archit Taneja (1):
  OMAP_VOUT: Fix build break caused by update_mode removal in DSS2

 drivers/media/video/omap/omap_vout.c |   13 -
 1 files changed, 0 insertions(+), 13 deletions(-)
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GIT PULL for v3.1] OMAP_VOUT code cleanup

2011-07-18 Thread hvaibhav
Hi Mauro,

The following changes since commit 5dcd07b9f39ca3e9be5bcc387d193fc0674e1c81:
  Linus Torvalds (1):
Merge git://git.kernel.org/.../steve/gfs2-2.6-fixes

are available in the git repository at:

  git://arago-project.org/git/people/vaibhav/ti-psp-omap-video.git 
for-linux-media

Amber Jain (5):
  V4L2: omap_vout: Remove GFP_DMA allocation as ZONE_DMA is not configured 
on OMAP
  OMAP2: V4L2: Remove GFP_DMA allocation as ZONE_DMA is not configured on 
OMAP
  V4L2: OMAP: VOUT: isr handling extended for DPI and HDMI interface
  V4L2: OMAP: VOUT: dma map and unmap v4l2 buffers in qbuf and dqbuf
  V4l2: OMAP: VOUT: Minor Cleanup, removing the unnecessary code.

Archit Taneja (3):
  OMAP_VOUT: CLEANUP: Move generic functions and macros to common files
  OMAP_VOUT: CLEANUP: Make rotation related helper functions more 
descriptive
  OMAP_VOUT: Create separate file for VRFB related API's

 drivers/media/video/omap/Kconfig  |7 +-
 drivers/media/video/omap/Makefile |1 +
 drivers/media/video/omap/omap_vout.c  |  645 +++--
 drivers/media/video/omap/omap_vout_vrfb.c |  390 +
 drivers/media/video/omap/omap_vout_vrfb.h |   40 ++
 drivers/media/video/omap/omap_voutdef.h   |   78 
 drivers/media/video/omap/omap_voutlib.c   |   46 ++
 drivers/media/video/omap/omap_voutlib.h   |   12 +-
 drivers/media/video/omap24xxcam.c |4 +-
 9 files changed, 710 insertions(+), 513 deletions(-)
 create mode 100644 drivers/media/video/omap/omap_vout_vrfb.c
 create mode 100644 drivers/media/video/omap/omap_vout_vrfb.h
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GIT PULL for v3.0] OMAP_VOUT bug fixes and code cleanup

2011-06-22 Thread hvaibhav
The following changes since commit af0d6a0a3a30946f7df69c764791f1b0643f7cd6:
  Linus Torvalds (1):
Merge branch 'x86-urgent-for-linus' of 
git://git.kernel.org/.../tip/linux-2.6-tip

are available in the git repository at:

  git://arago-project.org/git/people/vaibhav/ti-psp-omap-video.git 
for-linux-media

Amber Jain (2):
  V4L2: omap_vout: Remove GFP_DMA allocation as ZONE_DMA is not configured 
on OMAP
  OMAP2: V4L2: Remove GFP_DMA allocation as ZONE_DMA is not configured on 
OMAP

Archit Taneja (3):
  OMAP_VOUT: CLEANUP: Move generic functions and macros to common files
  OMAP_VOUT: CLEANUP: Make rotation related helper functions more 
descriptive
  OMAP_VOUT: Create separate file for VRFB related API's

Vaibhav Hiremath (2):
  OMAP_VOUT: Change hardcoded device node number to -1
  omap_vout: Added check in reqbuf  mmap for buf_size allocation

Vladimir Pantelic (1):
  OMAP_VOUTLIB: Fix wrong resizer calculation

 drivers/media/video/omap/Kconfig  |7 +-
 drivers/media/video/omap/Makefile |1 +
 drivers/media/video/omap/omap_vout.c  |  602 ++---
 drivers/media/video/omap/omap_vout_vrfb.c |  390 +++
 drivers/media/video/omap/omap_vout_vrfb.h |   40 ++
 drivers/media/video/omap/omap_voutdef.h   |   78 
 drivers/media/video/omap/omap_voutlib.c   |   52 +++-
 drivers/media/video/omap/omap_voutlib.h   |   12 +-
 drivers/media/video/omap24xxcam.c |4 +-
 9 files changed, 684 insertions(+), 502 deletions(-)
 create mode 100644 drivers/media/video/omap/omap_vout_vrfb.c
 create mode 100644 drivers/imedia/video/omap/omap_vout_vrfb.h


 These patches include bug fixes and code cleanup.
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] OMAP_VOUT: Change hardcoded device node number to -1

2011-06-16 Thread hvaibhav
From: Vaibhav Hiremath hvaib...@ti.com

With addition of media-controller framework, now we have various
device nodes (/dev/videoX) getting created, so hardcoding
minor number in video_register_device() is not recommended.

So let V4L2 framework choose free minor number for the device.

Signed-off-by: Vaibhav Hiremath hvaib...@ti.com
---
 drivers/media/video/omap/omap_vout.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/media/video/omap/omap_vout.c 
b/drivers/media/video/omap/omap_vout.c
index 0bc776c..3bc909a 100644
--- a/drivers/media/video/omap/omap_vout.c
+++ b/drivers/media/video/omap/omap_vout.c
@@ -1993,7 +1993,7 @@ static int __init omap_vout_create_video_devices(struct 
platform_device *pdev)
/* Register the Video device with V4L2
 */
vfd = vout-vfd;
-   if (video_register_device(vfd, VFL_TYPE_GRABBER, k + 1)  0) {
+   if (video_register_device(vfd, VFL_TYPE_GRABBER, -1)  0) {
dev_err(pdev-dev, : Could not register 
Video for Linux device\n);
vfd-minor = -1;
-- 
1.6.2.4

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] omap_vout: Added check in reqbuf mmap for buf_size allocation

2011-06-16 Thread hvaibhav
From: Vaibhav Hiremath hvaib...@ti.com

The usecase where, user allocates small size of buffer
through bootargs (video1_bufsize/video2_bufsize) and later from application
tries to set the format which requires larger buffer size, driver doesn't
check for insufficient buffer size and allows application to map extra buffer.
This leads to kernel crash, when user application tries to access memory
beyond the allocation size.

Added check in both mmap and reqbuf call back function,
and return error if the size of the buffer allocated by user through
bootargs is less than the S_FMT size.

Signed-off-by: Vaibhav Hiremath hvaib...@ti.com
---
 drivers/media/video/omap/omap_vout.c |   16 
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/drivers/media/video/omap/omap_vout.c 
b/drivers/media/video/omap/omap_vout.c
index 3bc909a..343b50c 100644
--- a/drivers/media/video/omap/omap_vout.c
+++ b/drivers/media/video/omap/omap_vout.c
@@ -678,6 +678,14 @@ static int omap_vout_buffer_setup(struct videobuf_queue 
*q, unsigned int *count,
startindex = (vout-vid == OMAP_VIDEO1) ?
video1_numbuffers : video2_numbuffers;

+   /* Check the size of the buffer */
+   if (*size  vout-buffer_size) {
+   v4l2_err(vout-vid_dev-v4l2_dev,
+   buffer allocation mismatch [%u] [%u]\n,
+   *size, vout-buffer_size);
+   return -ENOMEM;
+   }
+
for (i = startindex; i  *count; i++) {
vout-buffer_size = *size;

@@ -856,6 +864,14 @@ static int omap_vout_mmap(struct file *file, struct 
vm_area_struct *vma)
(vma-vm_pgoff  PAGE_SHIFT));
return -EINVAL;
}
+   /* Check the size of the buffer */
+   if (size  vout-buffer_size) {
+   v4l2_err(vout-vid_dev-v4l2_dev,
+   insufficient memory [%lu] [%u]\n,
+   size, vout-buffer_size);
+   return -ENOMEM;
+   }
+
q-bufs[i]-baddr = vma-vm_start;

vma-vm_flags |= VM_RESERVED;
--
1.6.2.4

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH-V1 2/2] AM3517: Add VPFE Capture driver support to board file

2010-06-03 Thread hvaibhav
From: Vaibhav Hiremath hvaib...@ti.com

Also created vpfe master/slave clock aliases, since naming
convention is different in both Davinci and AM3517 devices.

Signed-off-by: Vaibhav Hiremath hvaib...@ti.com
---
 arch/arm/mach-omap2/board-am3517evm.c |  161 +
 1 files changed, 161 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/board-am3517evm.c 
b/arch/arm/mach-omap2/board-am3517evm.c
index c1c4389..f2ff751 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -30,15 +30,168 @@

 #include plat/board.h
 #include plat/common.h
+#include plat/control.h
 #include plat/usb.h
 #include plat/display.h

+#include media/tvp514x.h
+#include media/davinci/vpfe_capture.h
+
 #include mux.h

 #define LCD_PANEL_PWR  176
 #define LCD_PANEL_BKLIGHT_PWR  182
 #define LCD_PANEL_PWM  181

+/*
+ * VPFE - Video Decoder interface
+ */
+#define TVP514X_STD_ALL(V4L2_STD_NTSC | V4L2_STD_PAL)
+
+/* Inputs available at the TVP5146 */
+static struct v4l2_input tvp5146_inputs[] = {
+   {
+   .index  = 0,
+   .name   = Composite,
+   .type   = V4L2_INPUT_TYPE_CAMERA,
+   .std= TVP514X_STD_ALL,
+   },
+   {
+   .index  = 1,
+   .name   = S-Video,
+   .type   = V4L2_INPUT_TYPE_CAMERA,
+   .std= TVP514X_STD_ALL,
+   },
+};
+
+static struct tvp514x_platform_data tvp5146_pdata = {
+   .clk_polarity   = 0,
+   .hs_polarity= 1,
+   .vs_polarity= 1
+};
+
+static struct vpfe_route tvp5146_routes[] = {
+   {
+   .input  = INPUT_CVBS_VI1A,
+   .output = OUTPUT_10BIT_422_EMBEDDED_SYNC,
+   },
+   {
+   .input  = INPUT_SVIDEO_VI2C_VI1C,
+   .output = OUTPUT_10BIT_422_EMBEDDED_SYNC,
+   },
+};
+
+static struct vpfe_subdev_info vpfe_sub_devs[] = {
+   {
+   .name   = tvp5146,
+   .grp_id = 0,
+   .num_inputs = ARRAY_SIZE(tvp5146_inputs),
+   .inputs = tvp5146_inputs,
+   .routes = tvp5146_routes,
+   .can_route  = 1,
+   .ccdc_if_params = {
+   .if_type = VPFE_BT656,
+   .hdpol  = VPFE_PINPOL_POSITIVE,
+   .vdpol  = VPFE_PINPOL_POSITIVE,
+   },
+   .board_info = {
+   I2C_BOARD_INFO(tvp5146, 0x5C),
+   .platform_data = tvp5146_pdata,
+   },
+   },
+};
+
+static void am3517_evm_clear_vpfe_intr(int vdint)
+{
+   unsigned int vpfe_int_clr;
+
+   vpfe_int_clr = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR);
+
+   switch (vdint) {
+   /* VD0 interrrupt */
+   case INT_35XX_CCDC_VD0_IRQ:
+   vpfe_int_clr = ~AM35XX_VPFE_CCDC_VD0_INT_CLR;
+   vpfe_int_clr |= AM35XX_VPFE_CCDC_VD0_INT_CLR;
+   break;
+   /* VD1 interrrupt */
+   case INT_35XX_CCDC_VD1_IRQ:
+   vpfe_int_clr = ~AM35XX_VPFE_CCDC_VD1_INT_CLR;
+   vpfe_int_clr |= AM35XX_VPFE_CCDC_VD1_INT_CLR;
+   break;
+   /* VD2 interrrupt */
+   case INT_35XX_CCDC_VD2_IRQ:
+   vpfe_int_clr = ~AM35XX_VPFE_CCDC_VD2_INT_CLR;
+   vpfe_int_clr |= AM35XX_VPFE_CCDC_VD2_INT_CLR;
+   break;
+   /* Clear all interrrupts */
+   default:
+   vpfe_int_clr = ~(AM35XX_VPFE_CCDC_VD0_INT_CLR |
+   AM35XX_VPFE_CCDC_VD1_INT_CLR |
+   AM35XX_VPFE_CCDC_VD2_INT_CLR);
+   vpfe_int_clr |= (AM35XX_VPFE_CCDC_VD0_INT_CLR |
+   AM35XX_VPFE_CCDC_VD1_INT_CLR |
+   AM35XX_VPFE_CCDC_VD2_INT_CLR);
+   break;
+   }
+   omap_ctrl_writel(vpfe_int_clr, AM35XX_CONTROL_LVL_INTR_CLEAR);
+   vpfe_int_clr = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR);
+}
+
+static struct vpfe_config vpfe_cfg = {
+   .num_subdevs= ARRAY_SIZE(vpfe_sub_devs),
+   .i2c_adapter_id = 3,
+   .sub_devs   = vpfe_sub_devs,
+   .clr_intr   = am3517_evm_clear_vpfe_intr,
+   .card_name  = AM3517 EVM,
+   .ccdc   = DM6446 CCDC,
+};
+
+static struct resource vpfe_resources[] = {
+   {
+   .start  = INT_35XX_CCDC_VD0_IRQ,
+   .end= INT_35XX_CCDC_VD0_IRQ,
+   .flags  = IORESOURCE_IRQ,
+   },
+   {
+   .start  = INT_35XX_CCDC_VD1_IRQ,
+   .end= INT_35XX_CCDC_VD1_IRQ,
+   .flags  = IORESOURCE_IRQ,
+   },
+};
+
+static u64 vpfe_capture_dma_mask = DMA_BIT_MASK(32);
+static struct platform_device vpfe_capture_dev = {
+   .name   = CAPTURE_DRV_NAME,
+   .id = -1,
+   .num_resources  = ARRAY_SIZE(vpfe_resources),
+   

[PATCH-V1 0/2] Add support for AM3517 VPFE Capture module

2010-06-03 Thread hvaibhav
From: Vaibhav Hiremath hvaib...@ti.com

AM3517 uses similar VPFE-CCDC hardware IP as in Davinci, so reusing the driver.
Currently the davinci driver is hardly tied with ARCH_DAVINCI, which was
limiting AM3517 to reuse the driver. So created seperate Kconfig file for
davinci and added AM3517 to dependancy.

Also added board hook up code to board-am3517evm.c file.

Changes from last version:
- Typo mistake in board-am3517evm.c file fixed
- Added DM365 platform support in Kconfig help option

Vaibhav Hiremath (2):
  Davinci: Create seperate Kconfig file for davinci devices
  AM3517: Add VPFE Capture driver support to board file

 arch/arm/mach-omap2/board-am3517evm.c |  161 +
 drivers/media/video/Kconfig   |   61 +
 drivers/media/video/Makefile  |2 +-
 drivers/media/video/davinci/Kconfig   |   93 +++
 4 files changed, 256 insertions(+), 61 deletions(-)
 create mode 100644 drivers/media/video/davinci/Kconfig

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH-V1 1/2] Davinci: Create seperate Kconfig file for davinci devices

2010-06-03 Thread hvaibhav
From: Vaibhav Hiremath hvaib...@ti.com

Currently VPFE Capture driver and DM6446 CCDC driver is being
reused for AM3517. So this patch is preparing the Kconfig/makefile
for re-use of such IP's.

Signed-off-by: Vaibhav Hiremath hvaib...@ti.com
---
 drivers/media/video/Kconfig |   61 +--
 drivers/media/video/Makefile|2 +-
 drivers/media/video/davinci/Kconfig |   93 +++
 3 files changed, 95 insertions(+), 61 deletions(-)
 create mode 100644 drivers/media/video/davinci/Kconfig

diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig
index bdbc9d3..fcdb224 100644
--- a/drivers/media/video/Kconfig
+++ b/drivers/media/video/Kconfig
@@ -570,66 +570,7 @@ config VIDEO_VIVI
  Say Y here if you want to test video apps or debug V4L devices.
  In doubt, say N.

-config VIDEO_VPSS_SYSTEM
-   tristate VPSS System module driver
-   depends on ARCH_DAVINCI
-   help
- Support for vpss system module for video driver
-
-config VIDEO_VPFE_CAPTURE
-   tristate VPFE Video Capture Driver
-   depends on VIDEO_V4L2  ARCH_DAVINCI
-   select VIDEOBUF_DMA_CONTIG
-   help
- Support for DM VPFE based frame grabber. This is the
- common V4L2 module for following DMXXX SoCs from Texas
- Instruments:- DM6446  DM355.
-
- To compile this driver as a module, choose M here: the
- module will be called vpfe-capture.
-
-config VIDEO_DM6446_CCDC
-   tristate DM6446 CCDC HW module
-   depends on ARCH_DAVINCI_DM644x  VIDEO_VPFE_CAPTURE
-   select VIDEO_VPSS_SYSTEM
-   default y
-   help
-  Enables DaVinci CCD hw module. DaVinci CCDC hw interfaces
-  with decoder modules such as TVP5146 over BT656 or
-  sensor module such as MT9T001 over a raw interface. This
-  module configures the interface and CCDC/ISIF to do
-  video frame capture from slave decoders.
-
-  To compile this driver as a module, choose M here: the
-  module will be called vpfe.
-
-config VIDEO_DM355_CCDC
-   tristate DM355 CCDC HW module
-   depends on ARCH_DAVINCI_DM355  VIDEO_VPFE_CAPTURE
-   select VIDEO_VPSS_SYSTEM
-   default y
-   help
-  Enables DM355 CCD hw module. DM355 CCDC hw interfaces
-  with decoder modules such as TVP5146 over BT656 or
-  sensor module such as MT9T001 over a raw interface. This
-  module configures the interface and CCDC/ISIF to do
-  video frame capture from a slave decoders
-
-  To compile this driver as a module, choose M here: the
-  module will be called vpfe.
-
-config VIDEO_ISIF
-   tristate ISIF HW module
-   depends on ARCH_DAVINCI_DM365  VIDEO_VPFE_CAPTURE
-   select VIDEO_VPSS_SYSTEM
-   default y
-   help
-  Enables ISIF hw module. This is the hardware module for
-  configuring ISIF in VPFE to capture Raw Bayer RGB data  from
-  a image sensor or YUV data from a YUV source.
-
-  To compile this driver as a module, choose M here: the
-  module will be called vpfe.
+source drivers/media/video/davinci/Kconfig

 source drivers/media/video/omap/Kconfig

diff --git a/drivers/media/video/Makefile b/drivers/media/video/Makefile
index cc93859..aa1ea2f 100644
--- a/drivers/media/video/Makefile
+++ b/drivers/media/video/Makefile
@@ -177,7 +177,7 @@ obj-$(CONFIG_VIDEO_SAA7164) += saa7164/

 obj-$(CONFIG_VIDEO_IR_I2C)  += ir-kbd-i2c.o

-obj-$(CONFIG_ARCH_DAVINCI) += davinci/
+obj-y  += davinci/

 obj-$(CONFIG_ARCH_OMAP)+= omap/

diff --git a/drivers/media/video/davinci/Kconfig 
b/drivers/media/video/davinci/Kconfig
new file mode 100644
index 000..6b19540
--- /dev/null
+++ b/drivers/media/video/davinci/Kconfig
@@ -0,0 +1,93 @@
+config DISPLAY_DAVINCI_DM646X_EVM
+   tristate DM646x EVM Video Display
+   depends on VIDEO_DEV  MACH_DAVINCI_DM6467_EVM
+   select VIDEOBUF_DMA_CONTIG
+   select VIDEO_DAVINCI_VPIF
+   select VIDEO_ADV7343
+   select VIDEO_THS7303
+   help
+ Support for DM6467 based display device.
+
+ To compile this driver as a module, choose M here: the
+ module will be called vpif_display.
+
+config CAPTURE_DAVINCI_DM646X_EVM
+   tristate DM646x EVM Video Capture
+   depends on VIDEO_DEV  MACH_DAVINCI_DM6467_EVM
+   select VIDEOBUF_DMA_CONTIG
+   select VIDEO_DAVINCI_VPIF
+   help
+ Support for DM6467 based capture device.
+
+ To compile this driver as a module, choose M here: the
+ module will be called vpif_capture.
+
+config VIDEO_DAVINCI_VPIF
+   tristate DaVinci VPIF Driver
+   depends on DISPLAY_DAVINCI_DM646X_EVM
+   help
+ Support for DaVinci VPIF Driver.
+
+ To compile this driver as a module, choose M here: the
+ module will be called vpif.
+
+config VIDEO_VPSS_SYSTEM
+   tristate VPSS 

[PATCH 2/3] OMAP_VOUT:FIX:Replaced dma-sg with dma-contig

2010-05-27 Thread hvaibhav
From: Vaibhav Hiremath hvaib...@ti.com

Actually OMAP doesn't support scatter-gather DMA for
Display subsystem but due to legacy coding it has been overlooked
till now.

Signed-off-by: Vaibhav Hiremath hvaib...@ti.com
---
 drivers/media/video/omap/Kconfig |2 +-
 drivers/media/video/omap/omap_vout.c |   46 +++---
 2 files changed, 16 insertions(+), 32 deletions(-)

diff --git a/drivers/media/video/omap/Kconfig b/drivers/media/video/omap/Kconfig
index c1d1933..e63233f 100644
--- a/drivers/media/video/omap/Kconfig
+++ b/drivers/media/video/omap/Kconfig
@@ -2,7 +2,7 @@ config VIDEO_OMAP2_VOUT
tristate OMAP2/OMAP3 V4L2-Display driver
depends on ARCH_OMAP2 || ARCH_OMAP3
select VIDEOBUF_GEN
-   select VIDEOBUF_DMA_SG
+   select VIDEOBUF_DMA_CONTIG
select OMAP2_DSS
select OMAP2_VRAM
select OMAP2_VRFB
diff --git a/drivers/media/video/omap/omap_vout.c 
b/drivers/media/video/omap/omap_vout.c
index 08b2fb8..6914221 100644
--- a/drivers/media/video/omap/omap_vout.c
+++ b/drivers/media/video/omap/omap_vout.c
@@ -40,7 +40,7 @@
 #include linux/videodev2.h
 #include linux/slab.h
 
-#include media/videobuf-dma-sg.h
+#include media/videobuf-dma-contig.h
 #include media/v4l2-device.h
 #include media/v4l2-ioctl.h
 
@@ -1054,9 +1054,9 @@ static int omap_vout_buffer_prepare(struct videobuf_queue 
*q,
struct videobuf_buffer *vb,
enum v4l2_field field)
 {
+   dma_addr_t dmabuf;
struct vid_vrfb_dma *tx;
enum dss_rotation rotation;
-   struct videobuf_dmabuf *dmabuf = NULL;
struct omap_vout_device *vout = q-priv_data;
u32 dest_frame_index = 0, src_element_index = 0;
u32 dest_element_index = 0, src_frame_index = 0;
@@ -1075,24 +1075,17 @@ static int omap_vout_buffer_prepare(struct 
videobuf_queue *q,
if (V4L2_MEMORY_USERPTR == vb-memory) {
if (0 == vb-baddr)
return -EINVAL;
-   /* Virtual address */
-   /* priv points to struct videobuf_pci_sg_memory. But we went
-* pointer to videobuf_dmabuf, which is member of
-* videobuf_pci_sg_memory */
-   dmabuf = videobuf_to_dma(q-bufs[vb-i]);
-   dmabuf-vmalloc = (void *) vb-baddr;
-
/* Physical address */
-   dmabuf-bus_addr =
-   (dma_addr_t) omap_vout_uservirt_to_phys(vb-baddr);
+   vout-queued_buf_addr[vb-i] = (u8 *)
+   omap_vout_uservirt_to_phys(vb-baddr);
+   } else {
+   vout-queued_buf_addr[vb-i] = (u8 *)vout-buf_phy_addr[vb-i];
}
 
-   if (!rotation_enabled(vout)) {
-   dmabuf = videobuf_to_dma(q-bufs[vb-i]);
-   vout-queued_buf_addr[vb-i] = (u8 *) dmabuf-bus_addr;
+   if (!rotation_enabled(vout))
return 0;
-   }
-   dmabuf = videobuf_to_dma(q-bufs[vb-i]);
+
+   dmabuf = vout-buf_phy_addr[vb-i];
/* If rotation is enabled, copy input buffer into VRFB
 * memory space using DMA. We are copying input buffer
 * into VRFB memory space of desired angle and DSS will
@@ -1121,7 +1114,7 @@ static int omap_vout_buffer_prepare(struct videobuf_queue 
*q,
tx-dev_id, 0x0);
/* src_port required only for OMAP1 */
omap_set_dma_src_params(tx-dma_ch, 0, OMAP_DMA_AMODE_POST_INC,
-   dmabuf-bus_addr, src_element_index, src_frame_index);
+   dmabuf, src_element_index, src_frame_index);
/*set dma source burst mode for VRFB */
omap_set_dma_src_burst_mode(tx-dma_ch, OMAP_DMA_DATA_BURST_16);
rotation = calc_rotation(vout);
@@ -1212,7 +1205,6 @@ static int omap_vout_mmap(struct file *file, struct 
vm_area_struct *vma)
void *pos;
unsigned long start = vma-vm_start;
unsigned long size = (vma-vm_end - vma-vm_start);
-   struct videobuf_dmabuf *dmabuf = NULL;
struct omap_vout_device *vout = file-private_data;
struct videobuf_queue *q = vout-vbq;
 
@@ -1242,8 +1234,7 @@ static int omap_vout_mmap(struct file *file, struct 
vm_area_struct *vma)
vma-vm_page_prot = pgprot_writecombine(vma-vm_page_prot);
vma-vm_ops = omap_vout_vm_ops;
vma-vm_private_data = (void *) vout;
-   dmabuf = videobuf_to_dma(q-bufs[i]);
-   pos = dmabuf-vmalloc;
+   pos = (void *)vout-buf_virt_addr[i];
vma-vm_pgoff = virt_to_phys((void *)pos)  PAGE_SHIFT;
while (size  0) {
unsigned long pfn;
@@ -1348,8 +1339,8 @@ static int omap_vout_open(struct file *file)
video_vbq_ops.buf_queue = omap_vout_buffer_queue;
spin_lock_init(vout-vbq_lock);
 
-   videobuf_queue_sg_init(q, video_vbq_ops, NULL, vout-vbq_lock,
-   vout-type, V4L2_FIELD_NONE,
+   videobuf_queue_dma_contig_init(q, video_vbq_ops, 

[PATCH 3/3] OMAP_VOUT:FIX: Module params were not working through bootargs

2010-05-27 Thread hvaibhav
From: Vaibhav Hiremath hvaib...@ti.com


Signed-off-by: Vaibhav Hiremath hvaib...@ti.com
---
 drivers/media/video/omap/Makefile |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/video/omap/Makefile 
b/drivers/media/video/omap/Makefile
index b8bab00..b287880 100644
--- a/drivers/media/video/omap/Makefile
+++ b/drivers/media/video/omap/Makefile
@@ -3,5 +3,5 @@
 #
 
 # OMAP2/3 Display driver
-omap-vout-mod-objs := omap_vout.o omap_voutlib.o
-obj-$(CONFIG_VIDEO_OMAP2_VOUT) += omap-vout-mod.o
+omap-vout-y := omap_vout.o omap_voutlib.o
+obj-$(CONFIG_VIDEO_OMAP2_VOUT) += omap-vout.o
-- 
1.6.2.4

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/3] OMAP_VOUT: Fixes for OMAP2/3 V4L2 Display Driver

2010-05-27 Thread hvaibhav
From: Vaibhav Hiremath hvaib...@ti.com

Fixes required either due to changes in OMAP DSS library or driver
implementation bug.

Vaibhav Hiremath (3):
  OMAP_VOUT:Build FIX: Rebased against latest DSS2 changes
  OMAP_VOUT:FIX:Replaced dma-sg with dma-contig
  OMAP_VOUT:FIX: Module params were not working through bootargs

 drivers/media/video/omap/Kconfig |4 +-
 drivers/media/video/omap/Makefile|4 +-
 drivers/media/video/omap/omap_vout.c |   81 ++---
 3 files changed, 38 insertions(+), 51 deletions(-)

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/3] OMAP_VOUT:Build FIX: Rebased against latest DSS2 changes

2010-05-27 Thread hvaibhav
From: Vaibhav Hiremath hvaib...@ti.com

Changes -
- Kconfig option dependancy changed to ARCH_OMAP2/3 from
ARCH_OMAP24XX/34XX
- There are some moments of function from omap_dss_device
to omap_dss_driver. Incorporated changes for the same.

Signed-off-by: Vaibhav Hiremath hvaib...@ti.com
---
 drivers/media/video/omap/Kconfig |2 +-
 drivers/media/video/omap/omap_vout.c |   35 ++---
 2 files changed, 20 insertions(+), 17 deletions(-)

diff --git a/drivers/media/video/omap/Kconfig b/drivers/media/video/omap/Kconfig
index 97c5394..c1d1933 100644
--- a/drivers/media/video/omap/Kconfig
+++ b/drivers/media/video/omap/Kconfig
@@ -1,6 +1,6 @@
 config VIDEO_OMAP2_VOUT
tristate OMAP2/OMAP3 V4L2-Display driver
-   depends on ARCH_OMAP24XX || ARCH_OMAP34XX
+   depends on ARCH_OMAP2 || ARCH_OMAP3
select VIDEOBUF_GEN
select VIDEOBUF_DMA_SG
select OMAP2_DSS
diff --git a/drivers/media/video/omap/omap_vout.c 
b/drivers/media/video/omap/omap_vout.c
index 4c0ab49..08b2fb8 100644
--- a/drivers/media/video/omap/omap_vout.c
+++ b/drivers/media/video/omap/omap_vout.c
@@ -38,6 +38,7 @@
 #include linux/dma-mapping.h
 #include linux/irq.h
 #include linux/videodev2.h
+#include linux/slab.h
 
 #include media/videobuf-dma-sg.h
 #include media/v4l2-device.h
@@ -2489,7 +2490,7 @@ static int omap_vout_remove(struct platform_device *pdev)
 
for (k = 0; k  vid_dev-num_displays; k++) {
if (vid_dev-displays[k]-state != OMAP_DSS_DISPLAY_DISABLED)
-   vid_dev-displays[k]-disable(vid_dev-displays[k]);
+   
vid_dev-displays[k]-driver-disable(vid_dev-displays[k]);
 
omap_dss_put_device(vid_dev-displays[k]);
}
@@ -2546,7 +2547,9 @@ static int __init omap_vout_probe(struct platform_device 
*pdev)
def_display = NULL;
}
if (def_display) {
-   ret = def_display-enable(def_display);
+   struct omap_dss_driver *dssdrv = def_display-driver;
+
+   ret = dssdrv-enable(def_display);
if (ret) {
/* Here we are not considering a error
 *  as display may be enabled by frame
@@ -2560,21 +2563,21 @@ static int __init omap_vout_probe(struct 
platform_device *pdev)
if (def_display-caps 
OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE) {
 #ifdef CONFIG_FB_OMAP2_FORCE_AUTO_UPDATE
-   if (def_display-enable_te)
-   def_display-enable_te(def_display, 1);
-   if (def_display-set_update_mode)
-   
def_display-set_update_mode(def_display,
+   if (dssdrv-enable_te)
+   dssdrv-enable_te(def_display, 1);
+   if (dssdrv-set_update_mode)
+   dssdrv-set_update_mode(def_display,
OMAP_DSS_UPDATE_AUTO);
 #else  /* MANUAL_UPDATE */
-   if (def_display-enable_te)
-   def_display-enable_te(def_display, 0);
-   if (def_display-set_update_mode)
-   
def_display-set_update_mode(def_display,
+   if (dssdrv-enable_te)
+   dssdrv-enable_te(def_display, 0);
+   if (dssdrv-set_update_mode)
+   dssdrv-set_update_mode(def_display,
OMAP_DSS_UPDATE_MANUAL);
 #endif
} else {
-   if (def_display-set_update_mode)
-   
def_display-set_update_mode(def_display,
+   if (dssdrv-set_update_mode)
+   dssdrv-set_update_mode(def_display,
OMAP_DSS_UPDATE_AUTO);
}
}
@@ -2593,8 +2596,8 @@ static int __init omap_vout_probe(struct platform_device 
*pdev)
for (i = 0; i  vid_dev-num_displays; i++) {
struct omap_dss_device *display = vid_dev-displays[i];
 
-   if (display-update)
-   display-update(display, 0, 0,
+   if (display-driver-update)
+   display-driver-update(display, 0, 0,
display-panel.timings.x_res,
display-panel.timings.y_res);
}
@@ -2609,8 +2612,8 @@ probe_err1:
if (ovl-manager  ovl-manager-device)
  

[PATCH 2/2] AM3517: Add VPFE Capture driver support to board file

2010-05-27 Thread hvaibhav
From: Vaibhav Hiremath hvaib...@ti.com

Also created vpfe master/slave clock aliases, since naming
convention is different in both Davinci and AM3517 devices.

Signed-off-by: Vaibhav Hiremath hvaib...@ti.com
---
 arch/arm/mach-omap2/board-am3517evm.c |  161 +
 1 files changed, 161 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/board-am3517evm.c 
b/arch/arm/mach-omap2/board-am3517evm.c
index c1c4389..edcb6db 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -30,15 +30,168 @@
 
 #include plat/board.h
 #include plat/common.h
+#include plat/control.h
 #include plat/usb.h
 #include plat/display.h
 
+#include media/tvp514x.h
+#include media/davinci/vpfe_capture.h
+
 #include mux.h
 
 #define LCD_PANEL_PWR  176
 #define LCD_PANEL_BKLIGHT_PWR  182
 #define LCD_PANEL_PWM  181
 
+/*
+ * VPFE - Video Decoder interface
+ */
+#define TVP514X_STD_ALL(V4L2_STD_NTSC | V4L2_STD_PAL)
+
+/* Inputs available at the TVP5146 */
+static struct v4l2_input tvp5146_inputs[] = {
+   {
+   .index  = 0,
+   .name   = Composite,
+   .type   = V4L2_INPUT_TYPE_CAMERA,
+   .std= TVP514X_STD_ALL,
+   },
+   {
+   .index  = 1,
+   .name   = S-Video,
+   .type   = V4L2_INPUT_TYPE_CAMERA,
+   .std= TVP514X_STD_ALL,
+   },
+};
+
+static struct tvp514x_platform_data tvp5146_pdata = {
+   .clk_polarity   = 0,
+   .hs_polarity= 1,
+   .vs_polarity= 1
+};
+
+static struct vpfe_route tvp5146_routes[] = {
+   {
+   .input  = INPUT_CVBS_VI1A,
+   .output = OUTPUT_10BIT_422_EMBEDDED_SYNC,
+   },
+   {
+   .input  = INPUT_SVIDEO_VI2C_VI1C,
+   .output = OUTPUT_10BIT_422_EMBEDDED_SYNC,
+   },
+};
+
+static struct vpfe_subdev_info vpfe_sub_devs[] = {
+   {
+   .name   = tvp5146,
+   .grp_id = 0,
+   .num_inputs = ARRAY_SIZE(tvp5146_inputs),
+   .inputs = tvp5146_inputs,
+   .routes = tvp5146_routes,
+   .can_route  = 1,
+   .ccdc_if_params = {
+   .if_type = VPFE_BT656,
+   .hdpol  = VPFE_PINPOL_POSITIVE,
+   .vdpol  = VPFE_PINPOL_POSITIVE,
+   },
+   .board_info = {
+   I2C_BOARD_INFO(tvp5146, 0x5C),
+   .platform_data = tvp5146_pdata,
+   },
+   },
+};
+
+static void am3517_evm_clear_vpfe_intr(int vdint)
+{
+   unsigned int vpfe_int_clr;
+
+   vpfe_int_clr = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR);
+
+   switch (vdint) {
+   /* VD0 interrrupt */
+   case INT_35XX_CCDC_VD0_IRQ:
+   vpfe_int_clr = ~AM35XX_VPFE_CCDC_VD0_INT_CLR;
+   vpfe_int_clr |= AM35XX_VPFE_CCDC_VD0_INT_CLR;
+   break;
+   /* VD1 interrrupt */
+   case INT_35XX_CCDC_VD1_IRQ:
+   vpfe_int_clr = ~AM35XX_VPFE_CCDC_VD1_INT_CLR;
+   vpfe_int_clr |= AM35XX_VPFE_CCDC_VD1_INT_CLR;
+   break;
+   /* VD2 interrrupt */
+   case INT_35XX_CCDC_VD2_IRQ:
+   vpfe_int_clr = ~AM35XX_VPFE_CCDC_VD2_INT_CLR;
+   vpfe_int_clr |= AM35XX_VPFE_CCDC_VD2_INT_CLR;
+   break;
+   /* Clear all interrrupts */
+   default:
+   vpfe_int_clr = ~(AM35XX_VPFE_CCDC_VD0_INT_CLR |
+   AM35XX_VPFE_CCDC_VD1_INT_CLR |
+   AM35XX_VPFE_CCDC_VD2_INT_CLR);
+   vpfe_int_clr |= (AM35XX_VPFE_CCDC_VD0_INT_CLR |
+   AM35XX_VPFE_CCDC_VD1_INT_CLR |
+   AM35XX_VPFE_CCDC_VD2_INT_CLR);
+   break;
+   }
+   omap_ctrl_writel(vpfe_int_clr, AM35XX_CONTROL_LVL_INTR_CLEAR);
+   vpfe_int_clr = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR);
+}
+
+static struct vpfe_config vpfe_cfg = {
+   .num_subdevs= ARRAY_SIZE(vpfe_sub_devs),
+   .i2c_adapter_id = 3,
+   .sub_devs   = vpfe_sub_devs,
+   .clr_intr   = am3517_evm_clear_vpfe_intr,
+   .card_name  = DM6446 EVM,
+   .ccdc   = DM6446 CCDC,
+};
+
+static struct resource vpfe_resources[] = {
+   {
+   .start  = INT_35XX_CCDC_VD0_IRQ,
+   .end= INT_35XX_CCDC_VD0_IRQ,
+   .flags  = IORESOURCE_IRQ,
+   },
+   {
+   .start  = INT_35XX_CCDC_VD1_IRQ,
+   .end= INT_35XX_CCDC_VD1_IRQ,
+   .flags  = IORESOURCE_IRQ,
+   },
+};
+
+static u64 vpfe_capture_dma_mask = DMA_BIT_MASK(32);
+static struct platform_device vpfe_capture_dev = {
+   .name   = CAPTURE_DRV_NAME,
+   .id = -1,
+   .num_resources  = ARRAY_SIZE(vpfe_resources),
+

[PATCH 1/2] Davinci: Create seperate Kconfig file for davinci devices

2010-05-27 Thread hvaibhav
From: Vaibhav Hiremath hvaib...@ti.com

Currently VPFE Capture driver and DM6446 CCDC driver is being
reused for AM3517. So this patch is preparing the Kconfig/makefile
for re-use of such IP's.

Signed-off-by: Vaibhav Hiremath hvaib...@ti.com
---
 drivers/media/video/Kconfig |   61 +--
 drivers/media/video/Makefile|2 +-
 drivers/media/video/davinci/Kconfig |   93 +++
 3 files changed, 95 insertions(+), 61 deletions(-)
 create mode 100644 drivers/media/video/davinci/Kconfig

diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig
index ad9e6f9..e5d74ae 100644
--- a/drivers/media/video/Kconfig
+++ b/drivers/media/video/Kconfig
@@ -570,66 +570,7 @@ config VIDEO_VIVI
  Say Y here if you want to test video apps or debug V4L devices.
  In doubt, say N.
 
-config VIDEO_VPSS_SYSTEM
-   tristate VPSS System module driver
-   depends on ARCH_DAVINCI
-   help
- Support for vpss system module for video driver
-
-config VIDEO_VPFE_CAPTURE
-   tristate VPFE Video Capture Driver
-   depends on VIDEO_V4L2  ARCH_DAVINCI
-   select VIDEOBUF_DMA_CONTIG
-   help
- Support for DM VPFE based frame grabber. This is the
- common V4L2 module for following DMXXX SoCs from Texas
- Instruments:- DM6446  DM355.
-
- To compile this driver as a module, choose M here: the
- module will be called vpfe-capture.
-
-config VIDEO_DM6446_CCDC
-   tristate DM6446 CCDC HW module
-   depends on ARCH_DAVINCI_DM644x  VIDEO_VPFE_CAPTURE
-   select VIDEO_VPSS_SYSTEM
-   default y
-   help
-  Enables DaVinci CCD hw module. DaVinci CCDC hw interfaces
-  with decoder modules such as TVP5146 over BT656 or
-  sensor module such as MT9T001 over a raw interface. This
-  module configures the interface and CCDC/ISIF to do
-  video frame capture from slave decoders.
-
-  To compile this driver as a module, choose M here: the
-  module will be called vpfe.
-
-config VIDEO_DM355_CCDC
-   tristate DM355 CCDC HW module
-   depends on ARCH_DAVINCI_DM355  VIDEO_VPFE_CAPTURE
-   select VIDEO_VPSS_SYSTEM
-   default y
-   help
-  Enables DM355 CCD hw module. DM355 CCDC hw interfaces
-  with decoder modules such as TVP5146 over BT656 or
-  sensor module such as MT9T001 over a raw interface. This
-  module configures the interface and CCDC/ISIF to do
-  video frame capture from a slave decoders
-
-  To compile this driver as a module, choose M here: the
-  module will be called vpfe.
-
-config VIDEO_ISIF
-   tristate ISIF HW module
-   depends on ARCH_DAVINCI_DM365  VIDEO_VPFE_CAPTURE
-   select VIDEO_VPSS_SYSTEM
-   default y
-   help
-  Enables ISIF hw module. This is the hardware module for
-  configuring ISIF in VPFE to capture Raw Bayer RGB data  from
-  a image sensor or YUV data from a YUV source.
-
-  To compile this driver as a module, choose M here: the
-  module will be called vpfe.
+source drivers/media/video/davinci/Kconfig
 
 source drivers/media/video/omap/Kconfig
 
diff --git a/drivers/media/video/Makefile b/drivers/media/video/Makefile
index cc93859..aa1ea2f 100644
--- a/drivers/media/video/Makefile
+++ b/drivers/media/video/Makefile
@@ -177,7 +177,7 @@ obj-$(CONFIG_VIDEO_SAA7164) += saa7164/
 
 obj-$(CONFIG_VIDEO_IR_I2C)  += ir-kbd-i2c.o
 
-obj-$(CONFIG_ARCH_DAVINCI) += davinci/
+obj-y  += davinci/
 
 obj-$(CONFIG_ARCH_OMAP)+= omap/
 
diff --git a/drivers/media/video/davinci/Kconfig 
b/drivers/media/video/davinci/Kconfig
new file mode 100644
index 000..97f889d
--- /dev/null
+++ b/drivers/media/video/davinci/Kconfig
@@ -0,0 +1,93 @@
+config DISPLAY_DAVINCI_DM646X_EVM
+   tristate DM646x EVM Video Display
+   depends on VIDEO_DEV  MACH_DAVINCI_DM6467_EVM
+   select VIDEOBUF_DMA_CONTIG
+   select VIDEO_DAVINCI_VPIF
+   select VIDEO_ADV7343
+   select VIDEO_THS7303
+   help
+ Support for DM6467 based display device.
+
+ To compile this driver as a module, choose M here: the
+ module will be called vpif_display.
+
+config CAPTURE_DAVINCI_DM646X_EVM
+   tristate DM646x EVM Video Capture
+   depends on VIDEO_DEV  MACH_DAVINCI_DM6467_EVM
+   select VIDEOBUF_DMA_CONTIG
+   select VIDEO_DAVINCI_VPIF
+   help
+ Support for DM6467 based capture device.
+
+ To compile this driver as a module, choose M here: the
+ module will be called vpif_capture.
+
+config VIDEO_DAVINCI_VPIF
+   tristate DaVinci VPIF Driver
+   depends on DISPLAY_DAVINCI_DM646X_EVM
+   help
+ Support for DaVinci VPIF Driver.
+
+ To compile this driver as a module, choose M here: the
+ module will be called vpif.
+
+config VIDEO_VPSS_SYSTEM
+   tristate 

[PATCH 0/2] Add support for AM3517 VPFE Capture module

2010-05-27 Thread hvaibhav
From: Vaibhav Hiremath hvaib...@ti.com

AM3517 uses similar VPFE-CCDC hardware IP as in Davinci, so reusing
the driver.
Currently the davinci driver is hardly tied with ARCH_DAVINCI, which
was limiting AM3517 to reuse the driver. So created seperate Kconfig
file for davinci and added AM3517 to dependancy.

Also added board hook up code to board-am3517evm.c file.

Vaibhav Hiremath (2):
  Davinci: Create seperate Kconfig file for davinci devices
  AM3517: Add VPFE Capture driver support to board file

 arch/arm/mach-omap2/board-am3517evm.c |  161 +
 drivers/media/video/Kconfig   |   61 +
 drivers/media/video/Makefile  |2 +-
 drivers/media/video/davinci/Kconfig   |   93 +++
 4 files changed, 256 insertions(+), 61 deletions(-)
 create mode 100644 drivers/media/video/davinci/Kconfig

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH-V7] OMAP2/3: Add V4L2 display driver support

2010-04-07 Thread hvaibhav
From: Vaibhav Hiremath hvaib...@ti.com

Changes from last version (V6):
- Fixed comments from Murali, Hans and Vladimir.
- Also dropped board hook-up patch, since we can add it
  once this patch goes in.
  (Actually unnecessarily that patch is floating all
   around with this patch.)
  And anyway it has to go through linux-omap list.

 Tested-on:
- OMAP3EVM
- AM3517EVM

Vaibhav Hiremath (1):
  OMAP2/3 V4L2: Add support for OMAP2/3 V4L2 driver on top of DSS2

 drivers/media/video/Kconfig |2 +
 drivers/media/video/Makefile|2 +
 drivers/media/video/omap/Kconfig|   11 +
 drivers/media/video/omap/Makefile   |7 +
 drivers/media/video/omap/omap_vout.c| 2644 +++
 drivers/media/video/omap/omap_voutdef.h |  147 ++
 drivers/media/video/omap/omap_voutlib.c |  293 
 drivers/media/video/omap/omap_voutlib.h |   34 +
 8 files changed, 3140 insertions(+), 0 deletions(-)
 create mode 100644 drivers/media/video/omap/Kconfig
 create mode 100644 drivers/media/video/omap/Makefile
 create mode 100644 drivers/media/video/omap/omap_vout.c
 create mode 100644 drivers/media/video/omap/omap_voutdef.h
 create mode 100644 drivers/media/video/omap/omap_voutlib.c
 create mode 100644 drivers/media/video/omap/omap_voutlib.h

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/2] v4l2-mem2mem: Code cleanup

2010-04-01 Thread hvaibhav
From: Vaibhav Hiremath hvaib...@ti.com


Signed-off-by: Vaibhav Hiremath hvaib...@ti.com
---
 drivers/media/video/v4l2-mem2mem.c |   40 ++-
 1 files changed, 16 insertions(+), 24 deletions(-)

diff --git a/drivers/media/video/v4l2-mem2mem.c 
b/drivers/media/video/v4l2-mem2mem.c
index a78157f..4cd79ba 100644
--- a/drivers/media/video/v4l2-mem2mem.c
+++ b/drivers/media/video/v4l2-mem2mem.c
@@ -23,12 +23,12 @@ MODULE_DESCRIPTION(Mem to mem device framework for 
videobuf);
 MODULE_AUTHOR(Pawel Osciak, p.osc...@samsung.com);
 MODULE_LICENSE(GPL);
 
-static int debug;
-module_param(debug, int, 0644);
+static bool debug;
+module_param(debug, bool, 0644);
 
 #define dprintk(fmt, arg...)   \
do {\
-   if (debug = 1) \
+   if (debug)  \
printk(KERN_DEBUG %s:  fmt, __func__, ## arg);\
} while (0)
 
@@ -215,12 +215,10 @@ EXPORT_SYMBOL(v4l2_m2m_dst_buf_remove);
 void *v4l2_m2m_get_curr_priv(struct v4l2_m2m_dev *m2m_dev)
 {
unsigned long flags;
-   void *ret;
+   void *ret = NULL;
 
spin_lock_irqsave(m2m_dev-job_spinlock, flags);
-   if (!m2m_dev-curr_ctx)
-   ret = NULL;
-   else
+   if (m2m_dev-curr_ctx)
ret = m2m_dev-curr_ctx-priv;
spin_unlock_irqrestore(m2m_dev-job_spinlock, flags);
 
@@ -319,10 +317,9 @@ static void v4l2_m2m_try_schedule(struct v4l2_m2m_ctx 
*m2m_ctx)
return;
}
 
-   if (!(m2m_ctx-job_flags  TRANS_QUEUED)) {
-   list_add_tail(m2m_ctx-queue, m2m_dev-jobqueue);
-   m2m_ctx-job_flags |= TRANS_QUEUED;
-   }
+   list_add_tail(m2m_ctx-queue, m2m_dev-jobqueue);
+   m2m_ctx-job_flags |= TRANS_QUEUED;
+
spin_unlock_irqrestore(m2m_dev-job_spinlock, flags_job);
 
v4l2_m2m_try_run(m2m_dev);
@@ -414,12 +411,10 @@ int v4l2_m2m_qbuf(struct file *file, struct v4l2_m2m_ctx 
*m2m_ctx,
 
vq = v4l2_m2m_get_vq(m2m_ctx, buf-type);
ret = videobuf_qbuf(vq, buf);
-   if (ret)
-   return ret;
-
-   v4l2_m2m_try_schedule(m2m_ctx);
+   if (!ret)
+   v4l2_m2m_try_schedule(m2m_ctx);
 
-   return 0;
+   return ret;
 }
 EXPORT_SYMBOL_GPL(v4l2_m2m_qbuf);
 
@@ -448,12 +443,10 @@ int v4l2_m2m_streamon(struct file *file, struct 
v4l2_m2m_ctx *m2m_ctx,
 
vq = v4l2_m2m_get_vq(m2m_ctx, type);
ret = videobuf_streamon(vq);
-   if (ret)
-   return ret;
-
-   v4l2_m2m_try_schedule(m2m_ctx);
+   if (!ret)
+   v4l2_m2m_try_schedule(m2m_ctx);
 
-   return 0;
+   return ret;
 }
 EXPORT_SYMBOL_GPL(v4l2_m2m_streamon);
 
@@ -587,8 +580,7 @@ struct v4l2_m2m_ctx *v4l2_m2m_ctx_init(void *priv, struct 
v4l2_m2m_dev *m2m_dev,
enum v4l2_buf_type))
 {
struct v4l2_m2m_ctx *m2m_ctx;
-   struct v4l2_m2m_queue_ctx *out_q_ctx;
-   struct v4l2_m2m_queue_ctx *cap_q_ctx;
+   struct v4l2_m2m_queue_ctx *out_q_ctx, *cap_q_ctx;
 
if (!vq_init)
return ERR_PTR(-EINVAL);
@@ -662,7 +654,7 @@ EXPORT_SYMBOL_GPL(v4l2_m2m_ctx_release);
 /**
  * v4l2_m2m_buf_queue() - add a buffer to the proper ready buffers list.
  *
- * Call from withing buf_queue() videobuf_queue_ops callback.
+ * Call from buf_queue(), videobuf_queue_ops callback.
  *
  * Locking: Caller holds q-irqlock (taken by videobuf before calling buf_queue
  * callback in the driver).
-- 
1.6.2.4

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/2] mem2mem_testdev: Code cleanup

2010-04-01 Thread hvaibhav
From: Vaibhav Hiremath hvaib...@ti.com


Signed-off-by: Vaibhav Hiremath hvaib...@ti.com
---
 drivers/media/video/mem2mem_testdev.c |   58 ++--
 1 files changed, 25 insertions(+), 33 deletions(-)

diff --git a/drivers/media/video/mem2mem_testdev.c 
b/drivers/media/video/mem2mem_testdev.c
index 05630e3..1f35b7e 100644
--- a/drivers/media/video/mem2mem_testdev.c
+++ b/drivers/media/video/mem2mem_testdev.c
@@ -98,11 +98,10 @@ static struct m2mtest_fmt formats[] = {
 };
 
 /* Per-queue, driver-specific private data */
-struct m2mtest_q_data
-{
-   unsigned intwidth;
-   unsigned intheight;
-   unsigned intsizeimage;
+struct m2mtest_q_data {
+   u32 width;
+   u32 height;
+   u32 sizeimage;
struct m2mtest_fmt  *fmt;
 };
 
@@ -123,11 +122,10 @@ static struct m2mtest_q_data *get_q_data(enum 
v4l2_buf_type type)
return q_data[V4L2_M2M_DST];
default:
BUG();
-   return NULL;
}
+   return NULL;
 }
 
-
 #define V4L2_CID_TRANS_TIME_MSEC   V4L2_CID_PRIVATE_BASE
 #define V4L2_CID_TRANS_NUM_BUFS(V4L2_CID_PRIVATE_BASE + 1)
 
@@ -158,7 +156,7 @@ static struct v4l2_queryctrl m2mtest_ctrls[] = {
 static struct m2mtest_fmt *find_format(struct v4l2_format *f)
 {
struct m2mtest_fmt *fmt;
-   unsigned int k;
+   u32 k;
 
for (k = 0; k  NUM_FORMATS; k++) {
fmt = formats[k];
@@ -237,12 +235,12 @@ static int device_process(struct m2mtest_ctx *ctx,
if (!p_in || !p_out) {
v4l2_err(dev-v4l2_dev,
 Acquiring kernel pointers to buffers failed\n);
-   return 1;
+   return -EFAULT;
}
 
if (in_buf-vb.size  out_buf-vb.size) {
v4l2_err(dev-v4l2_dev, Output buffer is too small\n);
-   return 1;
+   return -EINVAL;
}
 
tile_w = (in_buf-vb.width * (q_data[V4L2_M2M_DST].fmt-depth  3))
@@ -361,8 +359,6 @@ static void device_isr(unsigned long priv)
spin_unlock_irqrestore(m2mtest_dev-irqlock, flags);
device_run(curr_ctx);
}
-
-   return;
 }
 
 
@@ -384,10 +380,7 @@ static int vidioc_querycap(struct file *file, void *priv,
 
 static int enum_fmt(struct v4l2_fmtdesc *f, u32 type)
 {
-   int i, num;
-   struct m2mtest_fmt *fmt;
-
-   num = 0;
+   int i, num = 0;
 
for (i = 0; i  NUM_FORMATS; ++i) {
if (formats[i].types  type) {
@@ -402,9 +395,9 @@ static int enum_fmt(struct v4l2_fmtdesc *f, u32 type)
 
if (i  NUM_FORMATS) {
/* Format found */
-   fmt = formats[i];
-   strncpy(f-description, fmt-name, sizeof(f-description) - 1);
-   f-pixelformat = fmt-fourcc;
+   strncpy(f-description, formats[i].name,
+   sizeof(f-description) - 1);
+   f-pixelformat = formats[i].fourcc;
return 0;
}
 
@@ -430,6 +423,9 @@ static int vidioc_g_fmt(struct m2mtest_ctx *ctx, struct 
v4l2_format *f)
struct m2mtest_q_data *q_data;
 
vq = v4l2_m2m_get_vq(ctx-m2m_ctx, f-type);
+   if (!vq)
+   return -EINVAL;
+
q_data = get_q_data(f-type);
 
f-fmt.pix.width= q_data-width;
@@ -524,9 +520,10 @@ static int vidioc_s_fmt(struct m2mtest_ctx *ctx, struct 
v4l2_format *f)
 {
struct m2mtest_q_data *q_data;
struct videobuf_queue *vq;
-   int ret = 0;
 
vq = v4l2_m2m_get_vq(ctx-m2m_ctx, f-type);
+   if (!vq)
+   return -EINVAL;
q_data = get_q_data(f-type);
if (!q_data)
return -EINVAL;
@@ -535,8 +532,8 @@ static int vidioc_s_fmt(struct m2mtest_ctx *ctx, struct 
v4l2_format *f)
 
if (videobuf_queue_is_busy(vq)) {
v4l2_err(ctx-dev-v4l2_dev, %s queue busy\n, __func__);
-   ret = -EBUSY;
-   goto out;
+   mutex_unlock(vq-vb_lock);
+   return -EBUSY;
}
 
q_data-fmt = find_format(f);
@@ -550,9 +547,7 @@ static int vidioc_s_fmt(struct m2mtest_ctx *ctx, struct 
v4l2_format *f)
Setting format for type %d, wxh: %dx%d, fmt: %d\n,
f-type, q_data-width, q_data-height, q_data-fmt-fourcc);
 
-out:
-   mutex_unlock(vq-vb_lock);
-   return ret;
+   return 0;
 }
 
 static int vidioc_s_fmt_vid_cap(struct file *file, void *priv,
@@ -857,13 +852,9 @@ static int m2mtest_open(struct file *file)
struct m2mtest_dev *dev = video_drvdata(file);
struct m2mtest_ctx *ctx = NULL;
 
-   atomic_inc(dev-num_inst);
-
ctx = kzalloc(sizeof *ctx, GFP_KERNEL);
-   if (!ctx) {
-   atomic_dec(dev-num_inst);
+   if (!ctx)
return -ENOMEM;
-   }
 

[RESEND: PATCH-V6 0/2] OMAP2/3: Add V4L2 display driver support

2010-04-01 Thread hvaibhav
From: Vaibhav Hiremath hvaib...@ti.com

The previous patch submission had a dependancy on ti-media directory patch,
and since we were not having any conclusion on that patch, I have created
omap directory (device specific name) and moved V4L2 driver
(as of now applicable to OMAP2/3 devices) to this new
directory so that atleast v4l2 display driver can be unblocked and get
merged to main-line.

Vaibhav Hiremath (2):
  OMAP2/3 V4L2: Add support for OMAP2/3 V4L2 driver on top of DSS2
  OMAP2/3: Add V4L2 DSS driver support in device.c

 arch/arm/mach-omap2/devices.c   |   28 +
 drivers/media/video/Kconfig |2 +
 drivers/media/video/Makefile|2 +
 drivers/media/video/omap/Kconfig|   11 +
 drivers/media/video/omap/Makefile   |7 +
 drivers/media/video/omap/omap_vout.c| 2655 +++
 drivers/media/video/omap/omap_voutdef.h |  148 ++
 drivers/media/video/omap/omap_voutlib.c |  258 +++
 drivers/media/video/omap/omap_voutlib.h |   34 +
 9 files changed, 3145 insertions(+), 0 deletions(-)
 create mode 100644 drivers/media/video/omap/Kconfig
 create mode 100644 drivers/media/video/omap/Makefile
 create mode 100644 drivers/media/video/omap/omap_vout.c
 create mode 100644 drivers/media/video/omap/omap_voutdef.h
 create mode 100644 drivers/media/video/omap/omap_voutlib.c
 create mode 100644 drivers/media/video/omap/omap_voutlib.h

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/2] OMAP2/3: Add V4L2 DSS driver support in device.c

2010-04-01 Thread hvaibhav
From: Vaibhav Hiremath hvaib...@ti.com


Signed-off-by: Vaibhav Hiremath hvaib...@ti.com
---
 arch/arm/mach-omap2/devices.c |   28 
 1 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index 18ad931..7aaffe7 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -763,6 +763,33 @@ static inline void omap_hdq_init(void)
 static inline void omap_hdq_init(void) {}
 #endif
 
+/*---*/
+
+#if defined(CONFIG_VIDEO_OMAP2_VOUT) || \
+   defined(CONFIG_VIDEO_OMAP2_VOUT_MODULE)
+#if defined(CONFIG_FB_OMAP2) || defined(CONFIG_FB_OMAP2_MODULE)
+static struct resource omap_vout_resource[3 - CONFIG_FB_OMAP2_NUM_FBS] = {
+};
+#else
+static struct resource omap_vout_resource[2] = {
+};
+#endif
+
+static struct platform_device omap_vout_device = {
+   .name   = omap_vout,
+   .num_resources  = ARRAY_SIZE(omap_vout_resource),
+   .resource   = omap_vout_resource[0],
+   .id = -1,
+};
+static void omap_init_vout(void)
+{
+   if (platform_device_register(omap_vout_device)  0)
+   printk(KERN_ERR Unable to register OMAP-VOUT device\n);
+}
+#else
+static inline void omap_init_vout(void) {}
+#endif
+
 /*-*/
 
 static int __init omap2_init_devices(void)
@@ -777,6 +804,7 @@ static int __init omap2_init_devices(void)
omap_hdq_init();
omap_init_sti();
omap_init_sha1_md5();
+   omap_init_vout();
 
return 0;
 }
-- 
1.6.2.4

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH-V2 1/7] AM3517 CCDC: Debug register read prints removed

2010-03-19 Thread hvaibhav
From: Vaibhav Hiremath hvaib...@ti.com


Signed-off-by: Vaibhav Hiremath hvaib...@ti.com
---
 drivers/media/video/davinci/dm644x_ccdc.c |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/media/video/davinci/dm644x_ccdc.c 
b/drivers/media/video/davinci/dm644x_ccdc.c
index 0c394ca..840eee9 100644
--- a/drivers/media/video/davinci/dm644x_ccdc.c
+++ b/drivers/media/video/davinci/dm644x_ccdc.c
@@ -434,7 +434,6 @@ void ccdc_config_ycbcr(void)

ccdc_sbl_reset();
dev_dbg(ccdc_cfg.dev, \nEnd of ccdc_config_ycbcr...\n);
-   ccdc_readregs();
 }

 static void ccdc_config_black_clamp(struct ccdc_black_clamp *bclamp)
--
1.6.2.4

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH-V2 6/7] VPFE Capture: Add support for USERPTR mode of operation

2010-03-19 Thread hvaibhav
From: Vaibhav Hiremath hvaib...@ti.com


Signed-off-by: Vaibhav Hiremath hvaib...@ti.com
Signed-off-by: Muralidharan Karicheri m-kariche...@ti.com
---
 drivers/media/video/davinci/vpfe_capture.c |   42 ++-
 1 files changed, 28 insertions(+), 14 deletions(-)

diff --git a/drivers/media/video/davinci/vpfe_capture.c 
b/drivers/media/video/davinci/vpfe_capture.c
index 3946a70..51f6213 100644
--- a/drivers/media/video/davinci/vpfe_capture.c
+++ b/drivers/media/video/davinci/vpfe_capture.c
@@ -539,6 +539,16 @@ static void vpfe_schedule_next_buffer(struct vpfe_device 
*vpfe_dev)
list_del(vpfe_dev-next_frm-queue);
vpfe_dev-next_frm-state = VIDEOBUF_ACTIVE;
addr = videobuf_to_dma_contig(vpfe_dev-next_frm);
+
+   ccdc_dev-hw_ops.setfbaddr(addr);
+}
+
+static void vpfe_schedule_bottom_field(struct vpfe_device *vpfe_dev)
+{
+   unsigned long addr;
+
+   addr = videobuf_to_dma_contig(vpfe_dev-cur_frm);
+   addr += vpfe_dev-field_off;
ccdc_dev-hw_ops.setfbaddr(addr);
 }

@@ -559,7 +569,6 @@ static irqreturn_t vpfe_isr(int irq, void *dev_id)
 {
struct vpfe_device *vpfe_dev = dev_id;
enum v4l2_field field;
-   unsigned long addr;
int fid;

v4l2_dbg(1, debug, vpfe_dev-v4l2_dev, \nStarting vpfe_isr...\n);
@@ -604,10 +613,7 @@ static irqreturn_t vpfe_isr(int irq, void *dev_id)
 * the CCDC memory address
 */
if (field == V4L2_FIELD_SEQ_TB) {
-   addr =
- videobuf_to_dma_contig(vpfe_dev-cur_frm);
-   addr += vpfe_dev-field_off;
-   ccdc_dev-hw_ops.setfbaddr(addr);
+   vpfe_schedule_bottom_field(vpfe_dev);
}
goto clear_intr;
}
@@ -1234,7 +1240,10 @@ static int vpfe_videobuf_setup(struct videobuf_queue *vq,
struct vpfe_device *vpfe_dev = fh-vpfe_dev;

v4l2_dbg(1, debug, vpfe_dev-v4l2_dev, vpfe_buffer_setup\n);
-   *size = config_params.device_bufsize;
+   *size = vpfe_dev-fmt.fmt.pix.sizeimage;
+   if (vpfe_dev-memory == V4L2_MEMORY_MMAP 
+   vpfe_dev-fmt.fmt.pix.sizeimage  config_params.device_bufsize)
+   *size = config_params.device_bufsize;

if (*count  config_params.min_numbuffers)
*count = config_params.min_numbuffers;
@@ -1249,6 +1258,8 @@ static int vpfe_videobuf_prepare(struct videobuf_queue 
*vq,
 {
struct vpfe_fh *fh = vq-priv_data;
struct vpfe_device *vpfe_dev = fh-vpfe_dev;
+   unsigned long addr;
+   int ret;

v4l2_dbg(1, debug, vpfe_dev-v4l2_dev, vpfe_buffer_prepare\n);

@@ -1258,8 +1269,18 @@ static int vpfe_videobuf_prepare(struct videobuf_queue 
*vq,
vb-height = vpfe_dev-fmt.fmt.pix.height;
vb-size = vpfe_dev-fmt.fmt.pix.sizeimage;
vb-field = field;
+
+   ret = videobuf_iolock(vq, vb, NULL);;
+   if (ret  0)
+   return ret;
+
+   addr = videobuf_to_dma_contig(vb);
+   /* Make sure user addresses are aligned to 32 bytes */
+   if (!ALIGN(addr, 32))
+   return -EINVAL;
+
+   vb-state = VIDEOBUF_PREPARED;
}
-   vb-state = VIDEOBUF_PREPARED;
return 0;
 }

@@ -1327,13 +1348,6 @@ static int vpfe_reqbufs(struct file *file, void *priv,
return -EINVAL;
}

-   if (V4L2_MEMORY_USERPTR == req_buf-memory) {
-   /* we don't support user ptr IO */
-   v4l2_dbg(1, debug, vpfe_dev-v4l2_dev, vpfe_reqbufs:
- USERPTR IO not supported\n);
-   return  -EINVAL;
-   }
-
ret = mutex_lock_interruptible(vpfe_dev-lock);
if (ret)
return ret;
--
1.6.2.4

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH-V2 7/7] TVP514x: Add Powerup sequence during s_input to lock the signal properly

2010-03-19 Thread hvaibhav
From: Vaibhav Hiremath hvaib...@ti.com

For the sequence streamon - streamoff and again s_input, it fails
to lock the signal, since streamoff puts TVP514x into power off state
which leads to failure in sub-sequent s_input.

So add powerup sequence in s_routing (if disabled), since it is
important to lock the signal at this stage.

Signed-off-by: Vaibhav Hiremath hvaib...@ti.com
Signed-off-by: Sudhakar Rajashekhara sudhakar@ti.com
---
 drivers/media/video/tvp514x.c |   13 +
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/drivers/media/video/tvp514x.c b/drivers/media/video/tvp514x.c
index 26b4e71..97b7db5 100644
--- a/drivers/media/video/tvp514x.c
+++ b/drivers/media/video/tvp514x.c
@@ -78,6 +78,8 @@ struct tvp514x_std_info {
 };

 static struct tvp514x_reg tvp514x_reg_list_default[0x40];
+
+static int tvp514x_s_stream(struct v4l2_subdev *sd, int enable);
 /**
  * struct tvp514x_decoder - TVP5146/47 decoder object
  * @sd: Subdevice Slave handle
@@ -643,6 +645,17 @@ static int tvp514x_s_routing(struct v4l2_subdev *sd,
/* Index out of bound */
return -EINVAL;

+   /*
+* For the sequence streamon - streamoff and again s_input
+* it fails to lock the signal, since streamoff puts TVP514x
+* into power off state which leads to failure in sub-sequent s_input.
+*
+* So power up the TVP514x device here, since it is important to lock
+* the signal at this stage.
+*/
+   if (!decoder-streaming)
+   tvp514x_s_stream(sd, 1);
+
input_sel = input;
output_sel = output;

--
1.6.2.4

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH-V2 4/7] Davinci VPFE Capture:Return 0 from suspend/resume

2010-03-19 Thread hvaibhav
From: Vaibhav Hiremath hvaib...@ti.com

Now Suspend/Resume functionality is being handled by respective CCDC
code, so return true (0) from bridge suspend/resume function.

Signed-off-by: Vaibhav Hiremath hvaib...@ti.com
---
 drivers/media/video/davinci/vpfe_capture.c |   12 
 1 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/media/video/davinci/vpfe_capture.c 
b/drivers/media/video/davinci/vpfe_capture.c
index 2219460..3946a70 100644
--- a/drivers/media/video/davinci/vpfe_capture.c
+++ b/drivers/media/video/davinci/vpfe_capture.c
@@ -2022,18 +2022,14 @@ static int __devexit vpfe_remove(struct platform_device 
*pdev)
return 0;
 }

-static int
-vpfe_suspend(struct device *dev)
+static int vpfe_suspend(struct device *dev)
 {
-   /* add suspend code here later */
-   return -1;
+   return 0;
 }

-static int
-vpfe_resume(struct device *dev)
+static int vpfe_resume(struct device *dev)
 {
-   /* add resume code here later */
-   return -1;
+   return 0;
 }

 static const struct dev_pm_ops vpfe_dev_pm_ops = {
--
1.6.2.4

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH-V2 3/7] DM644x CCDC: Add 10bit BT support

2010-03-19 Thread hvaibhav
From: Vaibhav Hiremath hvaib...@ti.com


Signed-off-by: Vaibhav Hiremath hvaib...@ti.com
---
 drivers/media/video/davinci/dm644x_ccdc.c  |   16 +---
 drivers/media/video/davinci/dm644x_ccdc_regs.h |8 
 2 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/drivers/media/video/davinci/dm644x_ccdc.c 
b/drivers/media/video/davinci/dm644x_ccdc.c
index 840eee9..0ea7ea2 100644
--- a/drivers/media/video/davinci/dm644x_ccdc.c
+++ b/drivers/media/video/davinci/dm644x_ccdc.c
@@ -399,7 +399,11 @@ void ccdc_config_ycbcr(void)
 * configure the FID, VD, HD pin polarity,
 * fld,hd pol positive, vd negative, 8-bit data
 */
-   syn_mode |= CCDC_SYN_MODE_VD_POL_NEGATIVE | CCDC_SYN_MODE_8BITS;
+   syn_mode |= CCDC_SYN_MODE_VD_POL_NEGATIVE;
+   if (ccdc_cfg.if_type == VPFE_BT656_10BIT)
+   syn_mode |= CCDC_SYN_MODE_10BITS;
+   else
+   syn_mode |= CCDC_SYN_MODE_8BITS;
} else {
/* y/c external sync mode */
syn_mode |= (((params-fid_pol  CCDC_FID_POL_MASK) 
@@ -418,8 +422,13 @@ void ccdc_config_ycbcr(void)
 * configure the order of y cb cr in SDRAM, and disable latch
 * internal register on vsync
 */
-   regw((params-pix_order  CCDC_CCDCFG_Y8POS_SHIFT) |
-CCDC_LATCH_ON_VSYNC_DISABLE, CCDC_CCDCFG);
+   if (ccdc_cfg.if_type == VPFE_BT656_10BIT)
+   regw((params-pix_order  CCDC_CCDCFG_Y8POS_SHIFT) |
+   CCDC_LATCH_ON_VSYNC_DISABLE | CCDC_CCDCFG_BW656_10BIT,
+   CCDC_CCDCFG);
+   else
+   regw((params-pix_order  CCDC_CCDCFG_Y8POS_SHIFT) |
+   CCDC_LATCH_ON_VSYNC_DISABLE, CCDC_CCDCFG);

/*
 * configure the horizontal line offset. This should be a
@@ -825,6 +834,7 @@ static int ccdc_set_hw_if_params(struct vpfe_hw_if_param 
*params)
case VPFE_BT656:
case VPFE_YCBCR_SYNC_16:
case VPFE_YCBCR_SYNC_8:
+   case VPFE_BT656_10BIT:
ccdc_cfg.ycbcr.vd_pol = params-vdpol;
ccdc_cfg.ycbcr.hd_pol = params-hdpol;
break;
diff --git a/drivers/media/video/davinci/dm644x_ccdc_regs.h 
b/drivers/media/video/davinci/dm644x_ccdc_regs.h
index 6e5d053..b18d166 100644
--- a/drivers/media/video/davinci/dm644x_ccdc_regs.h
+++ b/drivers/media/video/davinci/dm644x_ccdc_regs.h
@@ -135,11 +135,19 @@
 #define CCDC_SYN_MODE_INPMOD_SHIFT 12
 #define CCDC_SYN_MODE_INPMOD_MASK  3
 #define CCDC_SYN_MODE_8BITS(7  8)
+#define CCDC_SYN_MODE_10BITS   (6  8)
+#define CCDC_SYN_MODE_11BITS   (5  8)
+#define CCDC_SYN_MODE_12BITS   (4  8)
+#define CCDC_SYN_MODE_13BITS   (3  8)
+#define CCDC_SYN_MODE_14BITS   (2  8)
+#define CCDC_SYN_MODE_15BITS   (1  8)
+#define CCDC_SYN_MODE_16BITS   (0  8)
 #define CCDC_SYN_FLDMODE_MASK  1
 #define CCDC_SYN_FLDMODE_SHIFT 7
 #define CCDC_REC656IF_BT656_EN 3
 #define CCDC_SYN_MODE_VD_POL_NEGATIVE  (1  2)
 #define CCDC_CCDCFG_Y8POS_SHIFT11
+#define CCDC_CCDCFG_BW656_10BIT(1  5)
 #define CCDC_SDOFST_FIELD_INTERLEAVED  0x249
 #define CCDC_NO_CULLING0x00ff
 #endif
--
1.6.2.4

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH-V2 2/7] VPFE Capture: Add call back function for interrupt clear to vpfe_cfg

2010-03-19 Thread hvaibhav
From: Vaibhav Hiremath hvaib...@ti.com

For the devices like AM3517, it is expected that driver clears the
interrupt in ISR. Since this is device spcific, callback function
added to the platform_data.

Signed-off-by: Vaibhav Hiremath hvaib...@ti.com
---
 drivers/media/video/davinci/vpfe_capture.c |   24 
 include/media/davinci/vpfe_capture.h   |2 ++
 2 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/drivers/media/video/davinci/vpfe_capture.c 
b/drivers/media/video/davinci/vpfe_capture.c
index 885cd54..2219460 100644
--- a/drivers/media/video/davinci/vpfe_capture.c
+++ b/drivers/media/video/davinci/vpfe_capture.c
@@ -475,6 +475,11 @@ static int vpfe_initialize_device(struct vpfe_device 
*vpfe_dev)
ret = ccdc_dev-hw_ops.open(vpfe_dev-pdev);
if (!ret)
vpfe_dev-initialized = 1;
+
+   /* Clear all VPFE/CCDC interrupts */
+   if (vpfe_dev-cfg-clr_intr)
+   vpfe_dev-cfg-clr_intr(-1);
+
 unlock:
mutex_unlock(ccdc_lock);
return ret;
@@ -562,7 +567,7 @@ static irqreturn_t vpfe_isr(int irq, void *dev_id)

/* if streaming not started, don't do anything */
if (!vpfe_dev-started)
-   return IRQ_HANDLED;
+   goto clear_intr;

/* only for 6446 this will be applicable */
if (NULL != ccdc_dev-hw_ops.reset)
@@ -574,7 +579,7 @@ static irqreturn_t vpfe_isr(int irq, void *dev_id)
frame format is progressive...\n);
if (vpfe_dev-cur_frm != vpfe_dev-next_frm)
vpfe_process_buffer_complete(vpfe_dev);
-   return IRQ_HANDLED;
+   goto clear_intr;
}

/* interlaced or TB capture check which field we are in hardware */
@@ -604,7 +609,7 @@ static irqreturn_t vpfe_isr(int irq, void *dev_id)
addr += vpfe_dev-field_off;
ccdc_dev-hw_ops.setfbaddr(addr);
}
-   return IRQ_HANDLED;
+   goto clear_intr;
}
/*
 * if one field is just being captured configure
@@ -624,6 +629,10 @@ static irqreturn_t vpfe_isr(int irq, void *dev_id)
 */
vpfe_dev-field_id = fid;
}
+clear_intr:
+   if (vpfe_dev-cfg-clr_intr)
+   vpfe_dev-cfg-clr_intr(irq);
+
return IRQ_HANDLED;
 }

@@ -635,8 +644,11 @@ static irqreturn_t vdint1_isr(int irq, void *dev_id)
v4l2_dbg(1, debug, vpfe_dev-v4l2_dev, \nInside vdint1_isr...\n);

/* if streaming not started, don't do anything */
-   if (!vpfe_dev-started)
+   if (!vpfe_dev-started) {
+   if (vpfe_dev-cfg-clr_intr)
+   vpfe_dev-cfg-clr_intr(irq);
return IRQ_HANDLED;
+   }

spin_lock(vpfe_dev-dma_queue_lock);
if ((vpfe_dev-fmt.fmt.pix.field == V4L2_FIELD_NONE) 
@@ -644,6 +656,10 @@ static irqreturn_t vdint1_isr(int irq, void *dev_id)
vpfe_dev-cur_frm == vpfe_dev-next_frm)
vpfe_schedule_next_buffer(vpfe_dev);
spin_unlock(vpfe_dev-dma_queue_lock);
+
+   if (vpfe_dev-cfg-clr_intr)
+   vpfe_dev-cfg-clr_intr(irq);
+
return IRQ_HANDLED;
 }

diff --git a/include/media/davinci/vpfe_capture.h 
b/include/media/davinci/vpfe_capture.h
index d863e5e..dc0dd5b 100644
--- a/include/media/davinci/vpfe_capture.h
+++ b/include/media/davinci/vpfe_capture.h
@@ -94,6 +94,8 @@ struct vpfe_config {
/* vpfe clock */
struct clk *vpssclk;
struct clk *slaveclk;
+   /* Function for Clearing the interrupt */
+   void (*clr_intr)(int vdint);
 };

 struct vpfe_device {
--
1.6.2.4

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Resubmit: PATCH-V2] AM3517: Add VPFE Capture driver support

2010-03-19 Thread hvaibhav
From: Vaibhav Hiremath hvaib...@ti.com

AM3517 and DM644x uses same CCDC IP, so reusing the driver
for AM3517.

Signed-off-by: Vaibhav Hiremath hvaib...@ti.com
---
 arch/arm/mach-omap2/board-am3517evm.c |  160 +
 1 files changed, 160 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/board-am3517evm.c 
b/arch/arm/mach-omap2/board-am3517evm.c
index f04311f..d2d2ced 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -30,11 +30,164 @@

 #include plat/board.h
 #include plat/common.h
+#include plat/control.h
 #include plat/usb.h
 #include plat/display.h

+#include media/tvp514x.h
+#include media/ti-media/vpfe_capture.h
+
 #include mux.h

+/*
+ * VPFE - Video Decoder interface
+ */
+#define TVP514X_STD_ALL(V4L2_STD_NTSC | V4L2_STD_PAL)
+
+/* Inputs available at the TVP5146 */
+static struct v4l2_input tvp5146_inputs[] = {
+   {
+   .index  = 0,
+   .name   = Composite,
+   .type   = V4L2_INPUT_TYPE_CAMERA,
+   .std= TVP514X_STD_ALL,
+   },
+   {
+   .index  = 1,
+   .name   = S-Video,
+   .type   = V4L2_INPUT_TYPE_CAMERA,
+   .std= TVP514X_STD_ALL,
+   },
+};
+
+static struct tvp514x_platform_data tvp5146_pdata = {
+   .clk_polarity   = 0,
+   .hs_polarity= 1,
+   .vs_polarity= 1
+};
+
+static struct vpfe_route tvp5146_routes[] = {
+   {
+   .input  = INPUT_CVBS_VI1A,
+   .output = OUTPUT_10BIT_422_EMBEDDED_SYNC,
+   },
+   {
+   .input  = INPUT_SVIDEO_VI2C_VI1C,
+   .output = OUTPUT_10BIT_422_EMBEDDED_SYNC,
+   },
+};
+
+static struct vpfe_subdev_info vpfe_sub_devs[] = {
+   {
+   .name   = tvp5146,
+   .grp_id = 0,
+   .num_inputs = ARRAY_SIZE(tvp5146_inputs),
+   .inputs = tvp5146_inputs,
+   .routes = tvp5146_routes,
+   .can_route  = 1,
+   .ccdc_if_params = {
+   .if_type = VPFE_BT656,
+   .hdpol  = VPFE_PINPOL_POSITIVE,
+   .vdpol  = VPFE_PINPOL_POSITIVE,
+   },
+   .board_info = {
+   I2C_BOARD_INFO(tvp5146, 0x5C),
+   .platform_data = tvp5146_pdata,
+   },
+   },
+};
+
+static void am3517_evm_clear_vpfe_intr(int vdint)
+{
+   unsigned int vpfe_int_clr;
+
+   vpfe_int_clr = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR);
+
+   switch (vdint) {
+   /* VD0 interrrupt */
+   case INT_35XX_CCDC_VD0_IRQ:
+   vpfe_int_clr = ~AM35XX_VPFE_CCDC_VD0_INT_CLR;
+   vpfe_int_clr |= AM35XX_VPFE_CCDC_VD0_INT_CLR;
+   break;
+   /* VD1 interrrupt */
+   case INT_35XX_CCDC_VD1_IRQ:
+   vpfe_int_clr = ~AM35XX_VPFE_CCDC_VD1_INT_CLR;
+   vpfe_int_clr |= AM35XX_VPFE_CCDC_VD1_INT_CLR;
+   break;
+   /* VD2 interrrupt */
+   case INT_35XX_CCDC_VD2_IRQ:
+   vpfe_int_clr = ~AM35XX_VPFE_CCDC_VD2_INT_CLR;
+   vpfe_int_clr |= AM35XX_VPFE_CCDC_VD2_INT_CLR;
+   break;
+   /* Clear all interrrupts */
+   default:
+   vpfe_int_clr = ~(AM35XX_VPFE_CCDC_VD0_INT_CLR |
+   AM35XX_VPFE_CCDC_VD1_INT_CLR |
+   AM35XX_VPFE_CCDC_VD2_INT_CLR);
+   vpfe_int_clr |= (AM35XX_VPFE_CCDC_VD0_INT_CLR |
+   AM35XX_VPFE_CCDC_VD1_INT_CLR |
+   AM35XX_VPFE_CCDC_VD2_INT_CLR);
+   break;
+   }
+   omap_ctrl_writel(vpfe_int_clr, AM35XX_CONTROL_LVL_INTR_CLEAR);
+   vpfe_int_clr = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR);
+}
+
+static struct vpfe_config vpfe_cfg = {
+   .num_subdevs= ARRAY_SIZE(vpfe_sub_devs),
+   .i2c_adapter_id = 3,
+   .sub_devs   = vpfe_sub_devs,
+   .clr_intr   = am3517_evm_clear_vpfe_intr,
+   .card_name  = DM6446 EVM,
+   .ccdc   = DM6446 CCDC,
+};
+
+static struct resource vpfe_resources[] = {
+   {
+   .start  = INT_35XX_CCDC_VD0_IRQ,
+   .end= INT_35XX_CCDC_VD0_IRQ,
+   .flags  = IORESOURCE_IRQ,
+   },
+   {
+   .start  = INT_35XX_CCDC_VD1_IRQ,
+   .end= INT_35XX_CCDC_VD1_IRQ,
+   .flags  = IORESOURCE_IRQ,
+   },
+};
+
+static u64 vpfe_capture_dma_mask = DMA_BIT_MASK(32);
+static struct platform_device vpfe_capture_dev = {
+   .name   = CAPTURE_DRV_NAME,
+   .id = -1,
+   .num_resources  = ARRAY_SIZE(vpfe_resources),
+   .resource   = vpfe_resources,
+   .dev = {
+   .dma_mask   = vpfe_capture_dma_mask,
+   .coherent_dma_mask  

[Resubmit: PATCH-V6 0/2] OMAP3: Add V4L2 display driver support

2010-03-19 Thread hvaibhav
From: Vaibhav Hiremath hvaib...@ti.com

Refreshed on top of latest linuxtv/master repository and
resubmitting the patch series again.

Please note that this patch is dependent on patch which add ti-media
directory (submitted earlier to this patch series).

Vaibhav Hiremath (2):
  OMAP2/3 V4L2: Add support for OMAP2/3 V4L2 driver on top of DSS2
  OMAP2/3: Add V4L2 DSS driver support in device.c

 arch/arm/mach-omap2/devices.c   |   28 +
 drivers/media/video/ti-media/Kconfig|   12 +
 drivers/media/video/ti-media/Makefile   |4 +
 drivers/media/video/ti-media/omap_vout.c| 2655 +++
 drivers/media/video/ti-media/omap_voutdef.h |  148 ++
 drivers/media/video/ti-media/omap_voutlib.c |  258 +++
 drivers/media/video/ti-media/omap_voutlib.h |   34 +
 7 files changed, 3139 insertions(+), 0 deletions(-)
 create mode 100644 drivers/media/video/ti-media/omap_vout.c
 create mode 100644 drivers/media/video/ti-media/omap_voutdef.h
 create mode 100644 drivers/media/video/ti-media/omap_voutlib.c
 create mode 100644 drivers/media/video/ti-media/omap_voutlib.h

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Resubmit: PATCH-V6 2/2] OMAP2/3: Add V4L2 DSS driver support in device.c

2010-03-19 Thread hvaibhav
From: Vaibhav Hiremath hvaib...@ti.com


Signed-off-by: Vaibhav Hiremath hvaib...@ti.com
---
 arch/arm/mach-omap2/devices.c |   28 
 1 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index 18ad931..83c92cd 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -763,6 +763,33 @@ static inline void omap_hdq_init(void)
 static inline void omap_hdq_init(void) {}
 #endif

+/*---*/
+
+#if defined(CONFIG_VIDEO_OMAP2_VOUT) || \
+   defined(CONFIG_VIDEO_OMAP2_VOUT_MODULE)
+#if defined (CONFIG_FB_OMAP2) || defined (CONFIG_FB_OMAP2_MODULE)
+static struct resource omap_vout_resource[3 - CONFIG_FB_OMAP2_NUM_FBS] = {
+};
+#else
+static struct resource omap_vout_resource[2] = {
+};
+#endif
+
+static struct platform_device omap_vout_device = {
+   .name   = omap_vout,
+   .num_resources  = ARRAY_SIZE(omap_vout_resource),
+   .resource   = omap_vout_resource[0],
+   .id = -1,
+};
+static void omap_init_vout(void)
+{
+   if (platform_device_register(omap_vout_device)  0)
+   printk(KERN_ERR Unable to register OMAP-VOUT device\n);
+}
+#else
+static inline void omap_init_vout(void) {}
+#endif
+
 /*-*/

 static int __init omap2_init_devices(void)
@@ -777,6 +804,7 @@ static int __init omap2_init_devices(void)
omap_hdq_init();
omap_init_sti();
omap_init_sha1_md5();
+   omap_init_vout();

return 0;
 }
--
1.6.2.4

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH-V1 00/10] VPFE Capture Bug Fixes and feature enhancement

2010-02-23 Thread hvaibhav
From: Vaibhav Hiremath hvaib...@ti.com

This is second version of patch series fixing few bugs and adds
some feature enhancements - 

Changes:
- Introduce t-media directory
- Add YUYV support to tvp514x.c
- Add UserPtr support to vpfe_capture
- Call-back function for interrupt clear (required for AM3517)
- VPFE Capture support for AM3517
- Suspend Resume support

Changes from last version - 
- Merge board specific changes to patch introduce ti-media directory
(comment from Hans)

Vaibhav Hiremath (10):
  Makfile:Removed duplicate entry of davinci
  tvp514x: add YUYV format support
  Introducing ti-media directory
  AM3517 CCDC: Debug register read prints removed
  VPFE Capture: Add call back function for interrupt clear to vpfe_cfg
  DM644x CCDC: Add 10bit BT support
  Davinci VPFE Capture:Return 0 from suspend/resume
  DM644x CCDC : Add Suspend/Resume Support
  VPFE Capture: Add support for USERPTR mode of operation
  AM3517: Add VPFE Capture driver support

 arch/arm/mach-davinci/include/mach/dm355.h  |2 +-
 arch/arm/mach-davinci/include/mach/dm644x.h |2 +-
 arch/arm/mach-omap2/board-am3517evm.c   |  160 ++
 drivers/media/video/Kconfig |   84 +-
 drivers/media/video/Makefile|4 +-
 drivers/media/video/davinci/Makefile|   17 -
 drivers/media/video/davinci/ccdc_hw_device.h|  110 --
 drivers/media/video/davinci/dm355_ccdc.c| 1082 ---
 drivers/media/video/davinci/dm355_ccdc_regs.h   |  310 
 drivers/media/video/davinci/dm644x_ccdc.c   |  967 --
 drivers/media/video/davinci/dm644x_ccdc_regs.h  |  145 --
 drivers/media/video/davinci/vpfe_capture.c  | 2054 -
 drivers/media/video/davinci/vpif.c  |  296 ---
 drivers/media/video/davinci/vpif.h  |  642 ---
 drivers/media/video/davinci/vpif_capture.c  | 2168 ---
 drivers/media/video/davinci/vpif_capture.h  |  165 --
 drivers/media/video/davinci/vpif_display.c  | 1654 -
 drivers/media/video/davinci/vpif_display.h  |  175 --
 drivers/media/video/davinci/vpss.c  |  301 
 drivers/media/video/ti-media/Kconfig|   88 +
 drivers/media/video/ti-media/Makefile   |   17 +
 drivers/media/video/ti-media/ccdc_hw_device.h   |  110 ++
 drivers/media/video/ti-media/dm355_ccdc.c   | 1082 +++
 drivers/media/video/ti-media/dm355_ccdc_regs.h  |  310 
 drivers/media/video/ti-media/dm644x_ccdc.c  | 1090 
 drivers/media/video/ti-media/dm644x_ccdc_regs.h |  153 ++
 drivers/media/video/ti-media/vpfe_capture.c | 2130 ++
 drivers/media/video/ti-media/vpif.c |  296 +++
 drivers/media/video/ti-media/vpif.h |  642 +++
 drivers/media/video/ti-media/vpif_capture.c | 2168 +++
 drivers/media/video/ti-media/vpif_capture.h |  165 ++
 drivers/media/video/ti-media/vpif_display.c | 1654 +
 drivers/media/video/ti-media/vpif_display.h |  175 ++
 drivers/media/video/ti-media/vpss.c |  301 
 drivers/media/video/tvp514x.c   |7 +
 include/media/davinci/ccdc_types.h  |   43 -
 include/media/davinci/dm355_ccdc.h  |  321 
 include/media/davinci/dm644x_ccdc.h |  184 --
 include/media/davinci/vpfe_capture.h|  200 ---
 include/media/davinci/vpfe_types.h  |   51 -
 include/media/davinci/vpss.h|   69 -
 include/media/ti-media/ccdc_types.h |   43 +
 include/media/ti-media/dm355_ccdc.h |  321 
 include/media/ti-media/dm644x_ccdc.h|  184 ++
 include/media/ti-media/vpfe_capture.h   |  202 +++
 include/media/ti-media/vpfe_types.h |   51 +
 include/media/ti-media/vpss.h   |   69 +
 47 files changed, 11423 insertions(+), 11041 deletions(-)
 delete mode 100644 drivers/media/video/davinci/Makefile
 delete mode 100644 drivers/media/video/davinci/ccdc_hw_device.h
 delete mode 100644 drivers/media/video/davinci/dm355_ccdc.c
 delete mode 100644 drivers/media/video/davinci/dm355_ccdc_regs.h
 delete mode 100644 drivers/media/video/davinci/dm644x_ccdc.c
 delete mode 100644 drivers/media/video/davinci/dm644x_ccdc_regs.h
 delete mode 100644 drivers/media/video/davinci/vpfe_capture.c
 delete mode 100644 drivers/media/video/davinci/vpif.c
 delete mode 100644 drivers/media/video/davinci/vpif.h
 delete mode 100644 drivers/media/video/davinci/vpif_capture.c
 delete mode 100644 drivers/media/video/davinci/vpif_capture.h
 delete mode 100644 drivers/media/video/davinci/vpif_display.c
 delete mode 100644 drivers/media/video/davinci/vpif_display.h
 delete mode 100644 drivers/media/video/davinci/vpss.c
 create mode 100644 drivers/media/video/ti-media/Kconfig
 create mode 100644 

[PATCH-V1 04/10] AM3517 CCDC: Debug register read prints removed

2010-02-23 Thread hvaibhav
From: Vaibhav Hiremath hvaib...@ti.com


Signed-off-by: Vaibhav Hiremath hvaib...@ti.com
---
 drivers/media/video/ti-media/dm644x_ccdc.c |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/media/video/ti-media/dm644x_ccdc.c 
b/drivers/media/video/ti-media/dm644x_ccdc.c
index 727f7e1..a011d40 100644
--- a/drivers/media/video/ti-media/dm644x_ccdc.c
+++ b/drivers/media/video/ti-media/dm644x_ccdc.c
@@ -434,7 +434,6 @@ void ccdc_config_ycbcr(void)

ccdc_sbl_reset();
dev_dbg(ccdc_cfg.dev, \nEnd of ccdc_config_ycbcr...\n);
-   ccdc_readregs();
 }

 static void ccdc_config_black_clamp(struct ccdc_black_clamp *bclamp)
--
1.6.2.4

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH-V1 05/10] VPFE Capture: Add call back function for interrupt clear to vpfe_cfg

2010-02-23 Thread hvaibhav
From: Vaibhav Hiremath hvaib...@ti.com

For the devices like AM3517, it is expected that driver clears the
interrupt in ISR. Since this is device spcific, callback function
added to the platform_data.

Signed-off-by: Vaibhav Hiremath hvaib...@ti.com
---
 drivers/media/video/ti-media/vpfe_capture.c |   24 
 include/media/ti-media/vpfe_capture.h   |2 ++
 2 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/drivers/media/video/ti-media/vpfe_capture.c 
b/drivers/media/video/ti-media/vpfe_capture.c
index 2f9d3bb..3ffd636 100644
--- a/drivers/media/video/ti-media/vpfe_capture.c
+++ b/drivers/media/video/ti-media/vpfe_capture.c
@@ -475,6 +475,11 @@ static int vpfe_initialize_device(struct vpfe_device 
*vpfe_dev)
ret = ccdc_dev-hw_ops.open(vpfe_dev-pdev);
if (!ret)
vpfe_dev-initialized = 1;
+
+   /* Clear all VPFE/CCDC interrupts */
+   if (vpfe_dev-cfg-clr_intr)
+   vpfe_dev-cfg-clr_intr(-1);
+
 unlock:
mutex_unlock(ccdc_lock);
return ret;
@@ -562,7 +567,7 @@ static irqreturn_t vpfe_isr(int irq, void *dev_id)

/* if streaming not started, don't do anything */
if (!vpfe_dev-started)
-   return IRQ_HANDLED;
+   goto clear_intr;

/* only for 6446 this will be applicable */
if (NULL != ccdc_dev-hw_ops.reset)
@@ -574,7 +579,7 @@ static irqreturn_t vpfe_isr(int irq, void *dev_id)
frame format is progressive...\n);
if (vpfe_dev-cur_frm != vpfe_dev-next_frm)
vpfe_process_buffer_complete(vpfe_dev);
-   return IRQ_HANDLED;
+   goto clear_intr;
}

/* interlaced or TB capture check which field we are in hardware */
@@ -604,7 +609,7 @@ static irqreturn_t vpfe_isr(int irq, void *dev_id)
addr += vpfe_dev-field_off;
ccdc_dev-hw_ops.setfbaddr(addr);
}
-   return IRQ_HANDLED;
+   goto clear_intr;
}
/*
 * if one field is just being captured configure
@@ -624,6 +629,10 @@ static irqreturn_t vpfe_isr(int irq, void *dev_id)
 */
vpfe_dev-field_id = fid;
}
+clear_intr:
+   if (vpfe_dev-cfg-clr_intr)
+   vpfe_dev-cfg-clr_intr(irq);
+
return IRQ_HANDLED;
 }

@@ -635,8 +644,11 @@ static irqreturn_t vdint1_isr(int irq, void *dev_id)
v4l2_dbg(1, debug, vpfe_dev-v4l2_dev, \nInside vdint1_isr...\n);

/* if streaming not started, don't do anything */
-   if (!vpfe_dev-started)
+   if (!vpfe_dev-started) {
+   if (vpfe_dev-cfg-clr_intr)
+   vpfe_dev-cfg-clr_intr(irq);
return IRQ_HANDLED;
+   }

spin_lock(vpfe_dev-dma_queue_lock);
if ((vpfe_dev-fmt.fmt.pix.field == V4L2_FIELD_NONE) 
@@ -644,6 +656,10 @@ static irqreturn_t vdint1_isr(int irq, void *dev_id)
vpfe_dev-cur_frm == vpfe_dev-next_frm)
vpfe_schedule_next_buffer(vpfe_dev);
spin_unlock(vpfe_dev-dma_queue_lock);
+
+   if (vpfe_dev-cfg-clr_intr)
+   vpfe_dev-cfg-clr_intr(irq);
+
return IRQ_HANDLED;
 }

diff --git a/include/media/ti-media/vpfe_capture.h 
b/include/media/ti-media/vpfe_capture.h
index 5287368..f0a7b7a 100644
--- a/include/media/ti-media/vpfe_capture.h
+++ b/include/media/ti-media/vpfe_capture.h
@@ -94,6 +94,8 @@ struct vpfe_config {
/* vpfe clock */
struct clk *vpssclk;
struct clk *slaveclk;
+   /* Function for Clearing the interrupt */
+   void (*clr_intr)(int vdint);
 };

 struct vpfe_device {
--
1.6.2.4

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH-V1 06/10] DM644x CCDC: Add 10bit BT support

2010-02-23 Thread hvaibhav
From: Vaibhav Hiremath hvaib...@ti.com


Signed-off-by: Vaibhav Hiremath hvaib...@ti.com
---
 drivers/media/video/ti-media/dm644x_ccdc.c  |   16 +---
 drivers/media/video/ti-media/dm644x_ccdc_regs.h |8 
 2 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/drivers/media/video/ti-media/dm644x_ccdc.c 
b/drivers/media/video/ti-media/dm644x_ccdc.c
index a011d40..506bbf5 100644
--- a/drivers/media/video/ti-media/dm644x_ccdc.c
+++ b/drivers/media/video/ti-media/dm644x_ccdc.c
@@ -399,7 +399,11 @@ void ccdc_config_ycbcr(void)
 * configure the FID, VD, HD pin polarity,
 * fld,hd pol positive, vd negative, 8-bit data
 */
-   syn_mode |= CCDC_SYN_MODE_VD_POL_NEGATIVE | CCDC_SYN_MODE_8BITS;
+   syn_mode |= CCDC_SYN_MODE_VD_POL_NEGATIVE;
+   if (ccdc_cfg.if_type == VPFE_BT656_10BIT)
+   syn_mode |= CCDC_SYN_MODE_10BITS;
+   else
+   syn_mode |= CCDC_SYN_MODE_8BITS;
} else {
/* y/c external sync mode */
syn_mode |= (((params-fid_pol  CCDC_FID_POL_MASK) 
@@ -418,8 +422,13 @@ void ccdc_config_ycbcr(void)
 * configure the order of y cb cr in SDRAM, and disable latch
 * internal register on vsync
 */
-   regw((params-pix_order  CCDC_CCDCFG_Y8POS_SHIFT) |
-CCDC_LATCH_ON_VSYNC_DISABLE, CCDC_CCDCFG);
+   if (ccdc_cfg.if_type == VPFE_BT656_10BIT)
+   regw((params-pix_order  CCDC_CCDCFG_Y8POS_SHIFT) |
+   CCDC_LATCH_ON_VSYNC_DISABLE | CCDC_CCDCFG_BW656_10BIT,
+   CCDC_CCDCFG);
+   else
+   regw((params-pix_order  CCDC_CCDCFG_Y8POS_SHIFT) |
+   CCDC_LATCH_ON_VSYNC_DISABLE, CCDC_CCDCFG);

/*
 * configure the horizontal line offset. This should be a
@@ -825,6 +834,7 @@ static int ccdc_set_hw_if_params(struct vpfe_hw_if_param 
*params)
case VPFE_BT656:
case VPFE_YCBCR_SYNC_16:
case VPFE_YCBCR_SYNC_8:
+   case VPFE_BT656_10BIT:
ccdc_cfg.ycbcr.vd_pol = params-vdpol;
ccdc_cfg.ycbcr.hd_pol = params-hdpol;
break;
diff --git a/drivers/media/video/ti-media/dm644x_ccdc_regs.h 
b/drivers/media/video/ti-media/dm644x_ccdc_regs.h
index 6e5d053..b18d166 100644
--- a/drivers/media/video/ti-media/dm644x_ccdc_regs.h
+++ b/drivers/media/video/ti-media/dm644x_ccdc_regs.h
@@ -135,11 +135,19 @@
 #define CCDC_SYN_MODE_INPMOD_SHIFT 12
 #define CCDC_SYN_MODE_INPMOD_MASK  3
 #define CCDC_SYN_MODE_8BITS(7  8)
+#define CCDC_SYN_MODE_10BITS   (6  8)
+#define CCDC_SYN_MODE_11BITS   (5  8)
+#define CCDC_SYN_MODE_12BITS   (4  8)
+#define CCDC_SYN_MODE_13BITS   (3  8)
+#define CCDC_SYN_MODE_14BITS   (2  8)
+#define CCDC_SYN_MODE_15BITS   (1  8)
+#define CCDC_SYN_MODE_16BITS   (0  8)
 #define CCDC_SYN_FLDMODE_MASK  1
 #define CCDC_SYN_FLDMODE_SHIFT 7
 #define CCDC_REC656IF_BT656_EN 3
 #define CCDC_SYN_MODE_VD_POL_NEGATIVE  (1  2)
 #define CCDC_CCDCFG_Y8POS_SHIFT11
+#define CCDC_CCDCFG_BW656_10BIT(1  5)
 #define CCDC_SDOFST_FIELD_INTERLEAVED  0x249
 #define CCDC_NO_CULLING0x00ff
 #endif
--
1.6.2.4

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH-V1 09/10] VPFE Capture: Add support for USERPTR mode of operation

2010-02-23 Thread hvaibhav
From: Vaibhav Hiremath hvaib...@ti.com


Signed-off-by: Vaibhav Hiremath hvaib...@ti.com
Signed-off-by: Muralidharan Karicheri m-kariche...@ti.com
---
 drivers/media/video/ti-media/vpfe_capture.c |   94 ++
 1 files changed, 79 insertions(+), 15 deletions(-)

diff --git a/drivers/media/video/ti-media/vpfe_capture.c 
b/drivers/media/video/ti-media/vpfe_capture.c
index cece265..7d4ab44 100644
--- a/drivers/media/video/ti-media/vpfe_capture.c
+++ b/drivers/media/video/ti-media/vpfe_capture.c
@@ -538,7 +538,24 @@ static void vpfe_schedule_next_buffer(struct vpfe_device 
*vpfe_dev)
struct videobuf_buffer, queue);
list_del(vpfe_dev-next_frm-queue);
vpfe_dev-next_frm-state = VIDEOBUF_ACTIVE;
-   addr = videobuf_to_dma_contig(vpfe_dev-next_frm);
+   if (V4L2_MEMORY_USERPTR == vpfe_dev-memory)
+   addr = vpfe_dev-cur_frm-boff;
+   else
+   addr = videobuf_to_dma_contig(vpfe_dev-next_frm);
+
+   ccdc_dev-hw_ops.setfbaddr(addr);
+}
+
+static void vpfe_schedule_bottom_field(struct vpfe_device *vpfe_dev)
+{
+   unsigned long addr;
+
+   if (V4L2_MEMORY_USERPTR == vpfe_dev-memory)
+   addr = vpfe_dev-cur_frm-boff;
+   else
+   addr = videobuf_to_dma_contig(vpfe_dev-cur_frm);
+
+   addr += vpfe_dev-field_off;
ccdc_dev-hw_ops.setfbaddr(addr);
 }

@@ -559,7 +576,6 @@ static irqreturn_t vpfe_isr(int irq, void *dev_id)
 {
struct vpfe_device *vpfe_dev = dev_id;
enum v4l2_field field;
-   unsigned long addr;
int fid;

v4l2_dbg(1, debug, vpfe_dev-v4l2_dev, \nStarting vpfe_isr...\n);
@@ -604,10 +620,7 @@ static irqreturn_t vpfe_isr(int irq, void *dev_id)
 * the CCDC memory address
 */
if (field == V4L2_FIELD_SEQ_TB) {
-   addr =
- videobuf_to_dma_contig(vpfe_dev-cur_frm);
-   addr += vpfe_dev-field_off;
-   ccdc_dev-hw_ops.setfbaddr(addr);
+   vpfe_schedule_bottom_field(vpfe_dev);
}
goto clear_intr;
}
@@ -1234,7 +1247,10 @@ static int vpfe_videobuf_setup(struct videobuf_queue *vq,
struct vpfe_device *vpfe_dev = fh-vpfe_dev;

v4l2_dbg(1, debug, vpfe_dev-v4l2_dev, vpfe_buffer_setup\n);
-   *size = config_params.device_bufsize;
+   *size = vpfe_dev-fmt.fmt.pix.sizeimage;
+   if (vpfe_dev-memory == V4L2_MEMORY_MMAP 
+   vpfe_dev-fmt.fmt.pix.sizeimage  config_params.device_bufsize)
+   *size = config_params.device_bufsize;

if (*count  config_params.min_numbuffers)
*count = config_params.min_numbuffers;
@@ -1243,6 +1259,46 @@ static int vpfe_videobuf_setup(struct videobuf_queue *vq,
return 0;
 }

+/*
+ * vpfe_uservirt_to_phys: This function is used to convert user
+ * space virtual address to physical address.
+ */
+static u32 vpfe_uservirt_to_phys(struct vpfe_device *vpfe_dev, u32 virtp)
+{
+   struct mm_struct *mm = current-mm;
+   unsigned long physp = 0;
+   struct vm_area_struct *vma;
+
+   vma = find_vma(mm, virtp);
+
+   /* For kernel direct-mapped memory, take the easy way */
+   if (virtp = PAGE_OFFSET)
+   physp = virt_to_phys((void *)virtp);
+   else if (vma  (vma-vm_flags  VM_IO)  (vma-vm_pgoff))
+   /* this will catch, kernel-allocated, mmaped-to-usermode addr */
+   physp = (vma-vm_pgoff  PAGE_SHIFT) + (virtp - vma-vm_start);
+   else {
+   /* otherwise, use get_user_pages() for general userland pages */
+   int res, nr_pages = 1;
+   struct page *pages;
+   down_read(current-mm-mmap_sem);
+
+   res = get_user_pages(current, current-mm,
+virtp, nr_pages, 1, 0, pages, NULL);
+   up_read(current-mm-mmap_sem);
+
+   if (res == nr_pages)
+   physp = __pa(page_address(pages[0]) +
+(virtp  ~PAGE_MASK));
+   else {
+   v4l2_dbg(1, debug, vpfe_dev-v4l2_dev,
+   get_user_pages failed\n);
+   return 0;
+   }
+   }
+   return physp;
+}
+
 static int vpfe_videobuf_prepare(struct videobuf_queue *vq,
struct videobuf_buffer *vb,
enum v4l2_field field)
@@ -1259,6 +1315,18 @@ static int vpfe_videobuf_prepare(struct videobuf_queue 
*vq,
vb-size = vpfe_dev-fmt.fmt.pix.sizeimage;
vb-field = field;
}
+
+   if (V4L2_MEMORY_USERPTR == vpfe_dev-memory) {
+   if (!vb-baddr) {
+   v4l2_dbg(1, debug, 

[PATCH-V1 08/10] DM644x CCDC : Add Suspend/Resume Support

2010-02-23 Thread hvaibhav
From: Vaibhav Hiremath hvaib...@ti.com


Signed-off-by: Vaibhav Hiremath hvaib...@ti.com
---
 drivers/media/video/ti-media/dm644x_ccdc.c  |  114 +++
 drivers/media/video/ti-media/dm644x_ccdc_regs.h |2 +-
 2 files changed, 115 insertions(+), 1 deletions(-)

diff --git a/drivers/media/video/ti-media/dm644x_ccdc.c 
b/drivers/media/video/ti-media/dm644x_ccdc.c
index 506bbf5..3045ebc 100644
--- a/drivers/media/video/ti-media/dm644x_ccdc.c
+++ b/drivers/media/video/ti-media/dm644x_ccdc.c
@@ -100,6 +100,9 @@ static u32 ccdc_raw_bayer_pix_formats[] =
 static u32 ccdc_raw_yuv_pix_formats[] =
{V4L2_PIX_FMT_UYVY, V4L2_PIX_FMT_YUYV};

+/* CCDC Save/Restore context */
+static u32 ccdc_ctx[CCDC_REG_END / sizeof(u32)];
+
 /* register access routines */
 static inline u32 regr(u32 offset)
 {
@@ -845,6 +848,87 @@ static int ccdc_set_hw_if_params(struct vpfe_hw_if_param 
*params)
return 0;
 }

+static void ccdc_save_context(void)
+{
+   ccdc_ctx[CCDC_PCR  2] = regr(CCDC_PCR);
+   ccdc_ctx[CCDC_SYN_MODE  2] = regr(CCDC_SYN_MODE);
+   ccdc_ctx[CCDC_HD_VD_WID  2] = regr(CCDC_HD_VD_WID);
+   ccdc_ctx[CCDC_PIX_LINES  2] = regr(CCDC_PIX_LINES);
+   ccdc_ctx[CCDC_HORZ_INFO  2] = regr(CCDC_HORZ_INFO);
+   ccdc_ctx[CCDC_VERT_START  2] = regr(CCDC_VERT_START);
+   ccdc_ctx[CCDC_VERT_LINES  2] = regr(CCDC_VERT_LINES);
+   ccdc_ctx[CCDC_CULLING  2] = regr(CCDC_CULLING);
+   ccdc_ctx[CCDC_HSIZE_OFF  2] = regr(CCDC_HSIZE_OFF);
+   ccdc_ctx[CCDC_SDOFST  2] = regr(CCDC_SDOFST);
+   ccdc_ctx[CCDC_SDR_ADDR  2] = regr(CCDC_SDR_ADDR);
+   ccdc_ctx[CCDC_CLAMP  2] = regr(CCDC_CLAMP);
+   ccdc_ctx[CCDC_DCSUB  2] = regr(CCDC_DCSUB);
+   ccdc_ctx[CCDC_COLPTN  2] = regr(CCDC_COLPTN);
+   ccdc_ctx[CCDC_BLKCMP  2] = regr(CCDC_BLKCMP);
+   ccdc_ctx[CCDC_FPC  2] = regr(CCDC_FPC);
+   ccdc_ctx[CCDC_FPC_ADDR  2] = regr(CCDC_FPC_ADDR);
+   ccdc_ctx[CCDC_VDINT  2] = regr(CCDC_VDINT);
+   ccdc_ctx[CCDC_ALAW  2] = regr(CCDC_ALAW);
+   ccdc_ctx[CCDC_REC656IF  2] = regr(CCDC_REC656IF);
+   ccdc_ctx[CCDC_CCDCFG  2] = regr(CCDC_CCDCFG);
+   ccdc_ctx[CCDC_FMTCFG  2] = regr(CCDC_FMTCFG);
+   ccdc_ctx[CCDC_FMT_HORZ  2] = regr(CCDC_FMT_HORZ);
+   ccdc_ctx[CCDC_FMT_VERT  2] = regr(CCDC_FMT_VERT);
+   ccdc_ctx[CCDC_FMT_ADDR0  2] = regr(CCDC_FMT_ADDR0);
+   ccdc_ctx[CCDC_FMT_ADDR1  2] = regr(CCDC_FMT_ADDR1);
+   ccdc_ctx[CCDC_FMT_ADDR2  2] = regr(CCDC_FMT_ADDR2);
+   ccdc_ctx[CCDC_FMT_ADDR3  2] = regr(CCDC_FMT_ADDR3);
+   ccdc_ctx[CCDC_FMT_ADDR4  2] = regr(CCDC_FMT_ADDR4);
+   ccdc_ctx[CCDC_FMT_ADDR5  2] = regr(CCDC_FMT_ADDR5);
+   ccdc_ctx[CCDC_FMT_ADDR6  2] = regr(CCDC_FMT_ADDR6);
+   ccdc_ctx[CCDC_FMT_ADDR7  2] = regr(CCDC_FMT_ADDR7);
+   ccdc_ctx[CCDC_PRGEVEN_0  2] = regr(CCDC_PRGEVEN_0);
+   ccdc_ctx[CCDC_PRGEVEN_1  2] = regr(CCDC_PRGEVEN_1);
+   ccdc_ctx[CCDC_PRGODD_0  2] = regr(CCDC_PRGODD_0);
+   ccdc_ctx[CCDC_PRGODD_1  2] = regr(CCDC_PRGODD_1);
+   ccdc_ctx[CCDC_VP_OUT  2] = regr(CCDC_VP_OUT);
+}
+
+static void ccdc_restore_context(void)
+{
+   regw(ccdc_ctx[CCDC_SYN_MODE  2], CCDC_SYN_MODE);
+   regw(ccdc_ctx[CCDC_HD_VD_WID  2], CCDC_HD_VD_WID);
+   regw(ccdc_ctx[CCDC_PIX_LINES  2], CCDC_PIX_LINES);
+   regw(ccdc_ctx[CCDC_HORZ_INFO  2], CCDC_HORZ_INFO);
+   regw(ccdc_ctx[CCDC_VERT_START  2], CCDC_VERT_START);
+   regw(ccdc_ctx[CCDC_VERT_LINES  2], CCDC_VERT_LINES);
+   regw(ccdc_ctx[CCDC_CULLING  2], CCDC_CULLING);
+   regw(ccdc_ctx[CCDC_HSIZE_OFF  2], CCDC_HSIZE_OFF);
+   regw(ccdc_ctx[CCDC_SDOFST  2], CCDC_SDOFST);
+   regw(ccdc_ctx[CCDC_SDR_ADDR  2], CCDC_SDR_ADDR);
+   regw(ccdc_ctx[CCDC_CLAMP  2], CCDC_CLAMP);
+   regw(ccdc_ctx[CCDC_DCSUB  2], CCDC_DCSUB);
+   regw(ccdc_ctx[CCDC_COLPTN  2], CCDC_COLPTN);
+   regw(ccdc_ctx[CCDC_BLKCMP  2], CCDC_BLKCMP);
+   regw(ccdc_ctx[CCDC_FPC  2], CCDC_FPC);
+   regw(ccdc_ctx[CCDC_FPC_ADDR  2], CCDC_FPC_ADDR);
+   regw(ccdc_ctx[CCDC_VDINT  2], CCDC_VDINT);
+   regw(ccdc_ctx[CCDC_ALAW  2], CCDC_ALAW);
+   regw(ccdc_ctx[CCDC_REC656IF  2], CCDC_REC656IF);
+   regw(ccdc_ctx[CCDC_CCDCFG  2], CCDC_CCDCFG);
+   regw(ccdc_ctx[CCDC_FMTCFG  2], CCDC_FMTCFG);
+   regw(ccdc_ctx[CCDC_FMT_HORZ  2], CCDC_FMT_HORZ);
+   regw(ccdc_ctx[CCDC_FMT_VERT  2], CCDC_FMT_VERT);
+   regw(ccdc_ctx[CCDC_FMT_ADDR0  2], CCDC_FMT_ADDR0);
+   regw(ccdc_ctx[CCDC_FMT_ADDR1  2], CCDC_FMT_ADDR1);
+   regw(ccdc_ctx[CCDC_FMT_ADDR2  2], CCDC_FMT_ADDR2);
+   regw(ccdc_ctx[CCDC_FMT_ADDR3  2], CCDC_FMT_ADDR3);
+   regw(ccdc_ctx[CCDC_FMT_ADDR4  2], CCDC_FMT_ADDR4);
+   regw(ccdc_ctx[CCDC_FMT_ADDR5  2], CCDC_FMT_ADDR5);
+   regw(ccdc_ctx[CCDC_FMT_ADDR6  2], CCDC_FMT_ADDR6);
+   regw(ccdc_ctx[CCDC_FMT_ADDR7  2], CCDC_FMT_ADDR7);
+   regw(ccdc_ctx[CCDC_PRGEVEN_0  2], CCDC_PRGEVEN_0);
+   regw(ccdc_ctx[CCDC_PRGEVEN_1  2], CCDC_PRGEVEN_1);
+   

[PATCH-V1 10/10] AM3517: Add VPFE Capture driver support

2010-02-23 Thread hvaibhav
From: Vaibhav Hiremath hvaib...@ti.com

AM3517 and DM644x uses same CCDC IP, so reusing the driver
for AM3517.

Signed-off-by: Vaibhav Hiremath hvaib...@ti.com
---
 arch/arm/mach-omap2/board-am3517evm.c |  160 +
 1 files changed, 160 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/board-am3517evm.c 
b/arch/arm/mach-omap2/board-am3517evm.c
index 195d0ce..9411979 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -30,11 +30,164 @@

 #include plat/board.h
 #include plat/common.h
+#include plat/control.h
 #include plat/usb.h
 #include plat/display.h

+#include media/tvp514x.h
+#include media/ti-media/vpfe_capture.h
+
 #include mux.h

+/*
+ * VPFE - Video Decoder interface
+ */
+#define TVP514X_STD_ALL(V4L2_STD_NTSC | V4L2_STD_PAL)
+
+/* Inputs available at the TVP5146 */
+static struct v4l2_input tvp5146_inputs[] = {
+   {
+   .index  = 0,
+   .name   = Composite,
+   .type   = V4L2_INPUT_TYPE_CAMERA,
+   .std= TVP514X_STD_ALL,
+   },
+   {
+   .index  = 1,
+   .name   = S-Video,
+   .type   = V4L2_INPUT_TYPE_CAMERA,
+   .std= TVP514X_STD_ALL,
+   },
+};
+
+static struct tvp514x_platform_data tvp5146_pdata = {
+   .clk_polarity   = 0,
+   .hs_polarity= 1,
+   .vs_polarity= 1
+};
+
+static struct vpfe_route tvp5146_routes[] = {
+   {
+   .input  = INPUT_CVBS_VI1A,
+   .output = OUTPUT_10BIT_422_EMBEDDED_SYNC,
+   },
+   {
+   .input  = INPUT_SVIDEO_VI2C_VI1C,
+   .output = OUTPUT_10BIT_422_EMBEDDED_SYNC,
+   },
+};
+
+static struct vpfe_subdev_info vpfe_sub_devs[] = {
+   {
+   .name   = tvp5146,
+   .grp_id = 0,
+   .num_inputs = ARRAY_SIZE(tvp5146_inputs),
+   .inputs = tvp5146_inputs,
+   .routes = tvp5146_routes,
+   .can_route  = 1,
+   .ccdc_if_params = {
+   .if_type = VPFE_BT656,
+   .hdpol  = VPFE_PINPOL_POSITIVE,
+   .vdpol  = VPFE_PINPOL_POSITIVE,
+   },
+   .board_info = {
+   I2C_BOARD_INFO(tvp5146, 0x5C),
+   .platform_data = tvp5146_pdata,
+   },
+   },
+};
+
+static void am3517_evm_clear_vpfe_intr(int vdint)
+{
+   unsigned int vpfe_int_clr;
+
+   vpfe_int_clr = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR);
+
+   switch (vdint) {
+   /* VD0 interrrupt */
+   case INT_35XX_CCDC_VD0_IRQ:
+   vpfe_int_clr = ~AM35XX_VPFE_CCDC_VD0_INT_CLR;
+   vpfe_int_clr |= AM35XX_VPFE_CCDC_VD0_INT_CLR;
+   break;
+   /* VD1 interrrupt */
+   case INT_35XX_CCDC_VD1_IRQ:
+   vpfe_int_clr = ~AM35XX_VPFE_CCDC_VD1_INT_CLR;
+   vpfe_int_clr |= AM35XX_VPFE_CCDC_VD1_INT_CLR;
+   break;
+   /* VD2 interrrupt */
+   case INT_35XX_CCDC_VD2_IRQ:
+   vpfe_int_clr = ~AM35XX_VPFE_CCDC_VD2_INT_CLR;
+   vpfe_int_clr |= AM35XX_VPFE_CCDC_VD2_INT_CLR;
+   break;
+   /* Clear all interrrupts */
+   default:
+   vpfe_int_clr = ~(AM35XX_VPFE_CCDC_VD0_INT_CLR |
+   AM35XX_VPFE_CCDC_VD1_INT_CLR |
+   AM35XX_VPFE_CCDC_VD2_INT_CLR);
+   vpfe_int_clr |= (AM35XX_VPFE_CCDC_VD0_INT_CLR |
+   AM35XX_VPFE_CCDC_VD1_INT_CLR |
+   AM35XX_VPFE_CCDC_VD2_INT_CLR);
+   break;
+   }
+   omap_ctrl_writel(vpfe_int_clr, AM35XX_CONTROL_LVL_INTR_CLEAR);
+   vpfe_int_clr = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR);
+}
+
+static struct vpfe_config vpfe_cfg = {
+   .num_subdevs= ARRAY_SIZE(vpfe_sub_devs),
+   .i2c_adapter_id = 3,
+   .sub_devs   = vpfe_sub_devs,
+   .clr_intr   = am3517_evm_clear_vpfe_intr,
+   .card_name  = DM6446 EVM,
+   .ccdc   = DM6446 CCDC,
+};
+
+static struct resource vpfe_resources[] = {
+   {
+   .start  = INT_35XX_CCDC_VD0_IRQ,
+   .end= INT_35XX_CCDC_VD0_IRQ,
+   .flags  = IORESOURCE_IRQ,
+   },
+   {
+   .start  = INT_35XX_CCDC_VD1_IRQ,
+   .end= INT_35XX_CCDC_VD1_IRQ,
+   .flags  = IORESOURCE_IRQ,
+   },
+};
+
+static u64 vpfe_capture_dma_mask = DMA_BIT_MASK(32);
+static struct platform_device vpfe_capture_dev = {
+   .name   = CAPTURE_DRV_NAME,
+   .id = -1,
+   .num_resources  = ARRAY_SIZE(vpfe_resources),
+   .resource   = vpfe_resources,
+   .dev = {
+   .dma_mask   = vpfe_capture_dma_mask,
+   .coherent_dma_mask  

[PATCH-V1 02/10] tvp514x: add YUYV format support

2010-02-23 Thread hvaibhav
From: Vaibhav Hiremath hvaib...@ti.com


Signed-off-by: Vaibhav Hiremath hvaib...@ti.com
---
 drivers/media/video/tvp514x.c |7 +++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/drivers/media/video/tvp514x.c b/drivers/media/video/tvp514x.c
index 26b4e71..08fe579 100644
--- a/drivers/media/video/tvp514x.c
+++ b/drivers/media/video/tvp514x.c
@@ -212,6 +212,13 @@ static const struct v4l2_fmtdesc tvp514x_fmt_list[] = {
 .description = 8-bit UYVY 4:2:2 Format,
 .pixelformat = V4L2_PIX_FMT_UYVY,
},
+   {
+.index = 1,
+.type = V4L2_BUF_TYPE_VIDEO_CAPTURE,
+.flags = 0,
+.description = 8-bit YUYV 4:2:2 Format,
+.pixelformat = V4L2_PIX_FMT_YUYV,
+   },
 };

 /**
--
1.6.2.4

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH-V6 0/2] OMAP3: Add V4L2 display driver support

2010-02-23 Thread hvaibhav
From: Vaibhav Hiremath hvaib...@ti.com

This is 6th Version of patch-set, adds support for V4L2 display driver
ontop of DSS2 framework.

Please note that this patch is dependent on patch which add
ti-media directory (submitted earlier to this patch series).


Vaibhav Hiremath (2):
  OMAP2/3 V4L2: Add support for OMAP2/3 V4L2 driver on top of DSS2
  OMAP2/3: Add V4L2 DSS driver support in device.c

 arch/arm/plat-omap/devices.c|   29 +
 drivers/media/video/ti-media/Kconfig|   12 +
 drivers/media/video/ti-media/Makefile   |4 +
 drivers/media/video/ti-media/omap_vout.c| 2655 +++
 drivers/media/video/ti-media/omap_voutdef.h |  148 ++
 drivers/media/video/ti-media/omap_voutlib.c |  258 +++
 drivers/media/video/ti-media/omap_voutlib.h |   34 +
 7 files changed, 3140 insertions(+), 0 deletions(-)
 create mode 100644 drivers/media/video/ti-media/omap_vout.c
 create mode 100644 drivers/media/video/ti-media/omap_voutdef.h
 create mode 100644 drivers/media/video/ti-media/omap_voutlib.c
 create mode 100644 drivers/media/video/ti-media/omap_voutlib.h

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH-V6 2/2] OMAP2/3: Add V4L2 DSS driver support in device.c

2010-02-23 Thread hvaibhav
From: Vaibhav Hiremath hvaib...@ti.com


Signed-off-by: Vaibhav Hiremath hvaib...@ti.com
---
 arch/arm/plat-omap/devices.c |   29 +
 1 files changed, 29 insertions(+), 0 deletions(-)

diff --git a/arch/arm/plat-omap/devices.c b/arch/arm/plat-omap/devices.c
index 30b5db7..64f2a3a 100644
--- a/arch/arm/plat-omap/devices.c
+++ b/arch/arm/plat-omap/devices.c
@@ -357,6 +357,34 @@ static void omap_init_wdt(void)
 static inline void omap_init_wdt(void) {}
 #endif

+/*---*/
+
+#if defined(CONFIG_VIDEO_OMAP2_VOUT) || \
+   defined(CONFIG_VIDEO_OMAP2_VOUT_MODULE)
+#if defined (CONFIG_FB_OMAP2) || defined (CONFIG_FB_OMAP2_MODULE)
+static struct resource omap_vout_resource[3 - CONFIG_FB_OMAP2_NUM_FBS] = {
+};
+#else
+static struct resource omap_vout_resource[2] = {
+};
+#endif
+
+static struct platform_device omap_vout_device = {
+   .name   = omap_vout,
+   .num_resources  = ARRAY_SIZE(omap_vout_resource),
+   .resource   = omap_vout_resource[0],
+   .id = -1,
+};
+static void omap_init_vout(void)
+{
+   (void) platform_device_register(omap_vout_device);
+}
+#else
+static inline void omap_init_vout(void) {}
+#endif
+
+/*---*/
+
 /*
  * This gets called after board-specific INIT_MACHINE, and initializes most
  * on-chip peripherals accessible on this board (except for few like USB):
@@ -387,6 +415,7 @@ static int __init omap_init_devices(void)
omap_init_rng();
omap_init_uwire();
omap_init_wdt();
+   omap_init_vout();
return 0;
 }
 arch_initcall(omap_init_devices);
--
1.6.2.4

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/9] Feature enhancement of VPFE/CCDC Capture driver

2010-01-04 Thread hvaibhav
From: Vaibhav Hiremath hvaib...@ti.com

While adding support for AM3517/05 devices I have implemented/came-across
these features/enhancement/bug-fixes for VPFE-Capture driver.

Also the important change added is, to introduced ti-media
directory for all TI devices.

Vaibhav Hiremath (9):
  Makfile:Removed duplicate entry of davinci
  TVP514x:Switch to automode for querystd
  tvp514x: add YUYV format support
  Introducing ti-media directory
  DMx:Update board files for ti-media directory change
  Davinci VPFE Capture:Return 0 from suspend/resume
  DM644x CCDC : Add Suspend/Resume Support
  VPFE Capture: Add call back function for interrupt clear to vpfe_cfg
  DM644x CCDC: Add 10bit BT support

 arch/arm/mach-davinci/include/mach/dm355.h  |2 +-
 arch/arm/mach-davinci/include/mach/dm644x.h |2 +-
 drivers/media/video/Kconfig |   84 +-
 drivers/media/video/Makefile|4 +-
 drivers/media/video/davinci/Makefile|   17 -
 drivers/media/video/davinci/ccdc_hw_device.h|  110 --
 drivers/media/video/davinci/dm355_ccdc.c| 1081 ---
 drivers/media/video/davinci/dm355_ccdc_regs.h   |  310 
 drivers/media/video/davinci/dm644x_ccdc.c   |  966 --
 drivers/media/video/davinci/dm644x_ccdc_regs.h  |  145 --
 drivers/media/video/davinci/vpfe_capture.c  | 2055 -
 drivers/media/video/davinci/vpif.c  |  296 ---
 drivers/media/video/davinci/vpif.h  |  642 ---
 drivers/media/video/davinci/vpif_capture.c  | 2168 ---
 drivers/media/video/davinci/vpif_capture.h  |  165 --
 drivers/media/video/davinci/vpif_display.c  | 1654 -
 drivers/media/video/davinci/vpif_display.h  |  175 --
 drivers/media/video/davinci/vpss.c  |  301 
 drivers/media/video/ti-media/Kconfig|   88 +
 drivers/media/video/ti-media/Makefile   |   17 +
 drivers/media/video/ti-media/ccdc_hw_device.h   |  110 ++
 drivers/media/video/ti-media/dm355_ccdc.c   | 1081 +++
 drivers/media/video/ti-media/dm355_ccdc_regs.h  |  310 
 drivers/media/video/ti-media/dm644x_ccdc.c  | 1090 
 drivers/media/video/ti-media/dm644x_ccdc_regs.h |  153 ++
 drivers/media/video/ti-media/vpfe_capture.c | 2067 +
 drivers/media/video/ti-media/vpif.c |  296 +++
 drivers/media/video/ti-media/vpif.h |  642 +++
 drivers/media/video/ti-media/vpif_capture.c | 2168 +++
 drivers/media/video/ti-media/vpif_capture.h |  165 ++
 drivers/media/video/ti-media/vpif_display.c | 1654 +
 drivers/media/video/ti-media/vpif_display.h |  175 ++
 drivers/media/video/ti-media/vpss.c |  301 
 drivers/media/video/tvp514x.c   |   15 +
 include/media/davinci/ccdc_types.h  |   43 -
 include/media/davinci/dm355_ccdc.h  |  321 
 include/media/davinci/dm644x_ccdc.h |  184 --
 include/media/davinci/vpfe_capture.h|  200 ---
 include/media/davinci/vpfe_types.h  |   51 -
 include/media/davinci/vpss.h|   69 -
 include/media/ti-media/ccdc_types.h |   43 +
 include/media/ti-media/dm355_ccdc.h |  321 
 include/media/ti-media/dm644x_ccdc.h|  184 ++
 include/media/ti-media/vpfe_capture.h   |  202 +++
 include/media/ti-media/vpfe_types.h |   51 +
 include/media/ti-media/vpss.h   |   69 +
 46 files changed, 11207 insertions(+), 11040 deletions(-)
 delete mode 100644 drivers/media/video/davinci/Makefile
 delete mode 100644 drivers/media/video/davinci/ccdc_hw_device.h
 delete mode 100644 drivers/media/video/davinci/dm355_ccdc.c
 delete mode 100644 drivers/media/video/davinci/dm355_ccdc_regs.h
 delete mode 100644 drivers/media/video/davinci/dm644x_ccdc.c
 delete mode 100644 drivers/media/video/davinci/dm644x_ccdc_regs.h
 delete mode 100644 drivers/media/video/davinci/vpfe_capture.c
 delete mode 100644 drivers/media/video/davinci/vpif.c
 delete mode 100644 drivers/media/video/davinci/vpif.h
 delete mode 100644 drivers/media/video/davinci/vpif_capture.c
 delete mode 100644 drivers/media/video/davinci/vpif_capture.h
 delete mode 100644 drivers/media/video/davinci/vpif_display.c
 delete mode 100644 drivers/media/video/davinci/vpif_display.h
 delete mode 100644 drivers/media/video/davinci/vpss.c
 create mode 100644 drivers/media/video/ti-media/Kconfig
 create mode 100644 drivers/media/video/ti-media/Makefile
 create mode 100644 drivers/media/video/ti-media/ccdc_hw_device.h
 create mode 100644 drivers/media/video/ti-media/dm355_ccdc.c
 create mode 100644 drivers/media/video/ti-media/dm355_ccdc_regs.h
 create mode 100644 drivers/media/video/ti-media/dm644x_ccdc.c
 create mode 100644 drivers/media/video/ti-media/dm644x_ccdc_regs.h
 create mode 100644 

[PATCH 5/9] DMx:Update board files for ti-media directory change

2010-01-04 Thread hvaibhav
From: Vaibhav Hiremath hvaib...@ti.com


Signed-off-by: Vaibhav Hiremath hvaib...@ti.com
---
 arch/arm/mach-davinci/include/mach/dm355.h  |2 +-
 arch/arm/mach-davinci/include/mach/dm644x.h |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-davinci/include/mach/dm355.h 
b/arch/arm/mach-davinci/include/mach/dm355.h
index 85536d8..ffba662 100644
--- a/arch/arm/mach-davinci/include/mach/dm355.h
+++ b/arch/arm/mach-davinci/include/mach/dm355.h
@@ -13,7 +13,7 @@
 
 #include mach/hardware.h
 #include mach/asp.h
-#include media/davinci/vpfe_capture.h
+#include media/ti-media/vpfe_capture.h
 
 #define ASP1_TX_EVT_EN 1
 #define ASP1_RX_EVT_EN 2
diff --git a/arch/arm/mach-davinci/include/mach/dm644x.h 
b/arch/arm/mach-davinci/include/mach/dm644x.h
index 44e8f0f..95f1e65 100644
--- a/arch/arm/mach-davinci/include/mach/dm644x.h
+++ b/arch/arm/mach-davinci/include/mach/dm644x.h
@@ -25,7 +25,7 @@
 #include mach/hardware.h
 #include mach/emac.h
 #include mach/asp.h
-#include media/davinci/vpfe_capture.h
+#include media/ti-media/vpfe_capture.h
 
 #define DM644X_EMAC_BASE   (0x01C8)
 #define DM644X_EMAC_CNTRL_OFFSET   (0x)
-- 
1.6.2.4

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 6/9] Davinci VPFE Capture:Return 0 from suspend/resume

2010-01-04 Thread hvaibhav
From: Vaibhav Hiremath hvaib...@ti.com

Now Suspend/Resume functionality is being handled by respective CCDC
code, so return true (0) from bridge suspend/resume function.

Signed-off-by: Vaibhav Hiremath hvaib...@ti.com
---
 drivers/media/video/ti-media/vpfe_capture.c |   12 
 1 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/media/video/ti-media/vpfe_capture.c 
b/drivers/media/video/ti-media/vpfe_capture.c
index 3257d26..7187eaa 100644
--- a/drivers/media/video/ti-media/vpfe_capture.c
+++ b/drivers/media/video/ti-media/vpfe_capture.c
@@ -2007,18 +2007,14 @@ static int vpfe_remove(struct platform_device *pdev)
return 0;
 }
 
-static int
-vpfe_suspend(struct device *dev)
+static int vpfe_suspend(struct device *dev)
 {
-   /* add suspend code here later */
-   return -1;
+   return 0;
 }
 
-static int
-vpfe_resume(struct device *dev)
+static int vpfe_resume(struct device *dev)
 {
-   /* add resume code here later */
-   return -1;
+   return 0;
 }
 
 static const struct dev_pm_ops vpfe_dev_pm_ops = {
-- 
1.6.2.4

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/9] TVP514x:Switch to automode for querystd

2010-01-04 Thread hvaibhav
From: Vaibhav Hiremath hvaib...@ti.com

Driver should switch to AutoSwitch mode on QUERYSTD ioctls.
It has been observed that, if user configure the standard explicitely
then driver preserves the old settings, but query_std must detect the
standard instead of returning old settings.

Signed-off-by: Vaibhav Hiremath hvaib...@ti.com
---
 drivers/media/video/tvp514x.c |8 
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/drivers/media/video/tvp514x.c b/drivers/media/video/tvp514x.c
index 26b4e71..4cf3593 100644
--- a/drivers/media/video/tvp514x.c
+++ b/drivers/media/video/tvp514x.c
@@ -523,10 +523,18 @@ static int tvp514x_querystd(struct v4l2_subdev *sd, 
v4l2_std_id *std_id)
enum tvp514x_std current_std;
enum tvp514x_input input_sel;
u8 sync_lock_status, lock_mask;
+   int err;
 
if (std_id == NULL)
return -EINVAL;
 
+   err = tvp514x_write_reg(sd, REG_VIDEO_STD,
+   VIDEO_STD_AUTO_SWITCH_BIT);
+   if (err  0)
+   return err;
+
+   msleep(LOCK_RETRY_DELAY);
+
/* get the current standard */
current_std = tvp514x_get_current_std(sd);
if (current_std == STD_INVALID)
-- 
1.6.2.4

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 3/9] tvp514x: add YUYV format support

2010-01-04 Thread hvaibhav
From: Vaibhav Hiremath hvaib...@ti.com


Signed-off-by: Vaibhav Hiremath hvaib...@ti.com
---
 drivers/media/video/tvp514x.c |7 +++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/drivers/media/video/tvp514x.c b/drivers/media/video/tvp514x.c
index 4cf3593..b344b58 100644
--- a/drivers/media/video/tvp514x.c
+++ b/drivers/media/video/tvp514x.c
@@ -212,6 +212,13 @@ static const struct v4l2_fmtdesc tvp514x_fmt_list[] = {
 .description = 8-bit UYVY 4:2:2 Format,
 .pixelformat = V4L2_PIX_FMT_UYVY,
},
+   {
+.index = 1,
+.type = V4L2_BUF_TYPE_VIDEO_CAPTURE,
+.flags = 0,
+.description = 8-bit YUYV 4:2:2 Format,
+.pixelformat = V4L2_PIX_FMT_YUYV,
+   },
 };
 
 /**
-- 
1.6.2.4

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 9/9] DM644x CCDC: Add 10bit BT support

2010-01-04 Thread hvaibhav
From: Vaibhav Hiremath hvaib...@ti.com


Signed-off-by: Vaibhav Hiremath hvaib...@ti.com
---
 drivers/media/video/ti-media/dm644x_ccdc.c  |   16 +---
 drivers/media/video/ti-media/dm644x_ccdc_regs.h |8 
 2 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/drivers/media/video/ti-media/dm644x_ccdc.c 
b/drivers/media/video/ti-media/dm644x_ccdc.c
index b762f99..8483467 100644
--- a/drivers/media/video/ti-media/dm644x_ccdc.c
+++ b/drivers/media/video/ti-media/dm644x_ccdc.c
@@ -401,7 +401,11 @@ void ccdc_config_ycbcr(void)
 * configure the FID, VD, HD pin polarity,
 * fld,hd pol positive, vd negative, 8-bit data
 */
-   syn_mode |= CCDC_SYN_MODE_VD_POL_NEGATIVE | CCDC_SYN_MODE_8BITS;
+   syn_mode |= CCDC_SYN_MODE_VD_POL_NEGATIVE;
+   if (ccdc_cfg.if_type == VPFE_BT656_10BIT)
+   syn_mode |= CCDC_SYN_MODE_10BITS;
+   else
+   syn_mode |= CCDC_SYN_MODE_8BITS;
} else {
/* y/c external sync mode */
syn_mode |= (((params-fid_pol  CCDC_FID_POL_MASK) 
@@ -420,8 +424,13 @@ void ccdc_config_ycbcr(void)
 * configure the order of y cb cr in SDRAM, and disable latch
 * internal register on vsync
 */
-   regw((params-pix_order  CCDC_CCDCFG_Y8POS_SHIFT) |
-CCDC_LATCH_ON_VSYNC_DISABLE, CCDC_CCDCFG);
+   if (ccdc_cfg.if_type == VPFE_BT656_10BIT)
+   regw((params-pix_order  CCDC_CCDCFG_Y8POS_SHIFT) |
+   CCDC_LATCH_ON_VSYNC_DISABLE | CCDC_CCDCFG_BW656_10BIT,
+   CCDC_CCDCFG);
+   else
+   regw((params-pix_order  CCDC_CCDCFG_Y8POS_SHIFT) |
+   CCDC_LATCH_ON_VSYNC_DISABLE, CCDC_CCDCFG);
 
/*
 * configure the horizontal line offset. This should be a
@@ -828,6 +837,7 @@ static int ccdc_set_hw_if_params(struct vpfe_hw_if_param 
*params)
case VPFE_BT656:
case VPFE_YCBCR_SYNC_16:
case VPFE_YCBCR_SYNC_8:
+   case VPFE_BT656_10BIT:
ccdc_cfg.ycbcr.vd_pol = params-vdpol;
ccdc_cfg.ycbcr.hd_pol = params-hdpol;
break;
diff --git a/drivers/media/video/ti-media/dm644x_ccdc_regs.h 
b/drivers/media/video/ti-media/dm644x_ccdc_regs.h
index 319253a..90370e4 100644
--- a/drivers/media/video/ti-media/dm644x_ccdc_regs.h
+++ b/drivers/media/video/ti-media/dm644x_ccdc_regs.h
@@ -135,11 +135,19 @@
 #define CCDC_SYN_MODE_INPMOD_SHIFT 12
 #define CCDC_SYN_MODE_INPMOD_MASK  3
 #define CCDC_SYN_MODE_8BITS(7  8)
+#define CCDC_SYN_MODE_10BITS   (6  8)
+#define CCDC_SYN_MODE_11BITS   (5  8)
+#define CCDC_SYN_MODE_12BITS   (4  8)
+#define CCDC_SYN_MODE_13BITS   (3  8)
+#define CCDC_SYN_MODE_14BITS   (2  8)
+#define CCDC_SYN_MODE_15BITS   (1  8)
+#define CCDC_SYN_MODE_16BITS   (0  8)
 #define CCDC_SYN_FLDMODE_MASK  1
 #define CCDC_SYN_FLDMODE_SHIFT 7
 #define CCDC_REC656IF_BT656_EN 3
 #define CCDC_SYN_MODE_VD_POL_NEGATIVE  (1  2)
 #define CCDC_CCDCFG_Y8POS_SHIFT11
+#define CCDC_CCDCFG_BW656_10BIT(1  5)
 #define CCDC_SDOFST_FIELD_INTERLEAVED  0x249
 #define CCDC_NO_CULLING0x00ff
 #endif
-- 
1.6.2.4

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 8/9] VPFE Capture: Add call back function for interrupt clear to vpfe_cfg

2010-01-04 Thread hvaibhav
From: Vaibhav Hiremath hvaib...@ti.com

For the devices like AM3517, it is expected that driver clears the
interrupt in ISR. Since this is device spcific, callback function
added to the platform_data.

Signed-off-by: Vaibhav Hiremath hvaib...@ti.com
---
 drivers/media/video/ti-media/vpfe_capture.c |   24 
 include/media/ti-media/vpfe_capture.h   |2 ++
 2 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/drivers/media/video/ti-media/vpfe_capture.c 
b/drivers/media/video/ti-media/vpfe_capture.c
index 7187eaa..95538b2 100644
--- a/drivers/media/video/ti-media/vpfe_capture.c
+++ b/drivers/media/video/ti-media/vpfe_capture.c
@@ -475,6 +475,11 @@ static int vpfe_initialize_device(struct vpfe_device 
*vpfe_dev)
ret = ccdc_dev-hw_ops.open(vpfe_dev-pdev);
if (!ret)
vpfe_dev-initialized = 1;
+
+   /* Clear all VPFE/CCDC interrupts */
+   if (vpfe_dev-cfg-clr_intr)
+   vpfe_dev-cfg-clr_intr(-1);
+
 unlock:
mutex_unlock(ccdc_lock);
return ret;
@@ -562,7 +567,7 @@ static irqreturn_t vpfe_isr(int irq, void *dev_id)
 
/* if streaming not started, don't do anything */
if (!vpfe_dev-started)
-   return IRQ_HANDLED;
+   goto clear_intr;
 
/* only for 6446 this will be applicable */
if (NULL != ccdc_dev-hw_ops.reset)
@@ -574,7 +579,7 @@ static irqreturn_t vpfe_isr(int irq, void *dev_id)
frame format is progressive...\n);
if (vpfe_dev-cur_frm != vpfe_dev-next_frm)
vpfe_process_buffer_complete(vpfe_dev);
-   return IRQ_HANDLED;
+   goto clear_intr;
}
 
/* interlaced or TB capture check which field we are in hardware */
@@ -604,7 +609,7 @@ static irqreturn_t vpfe_isr(int irq, void *dev_id)
addr += vpfe_dev-field_off;
ccdc_dev-hw_ops.setfbaddr(addr);
}
-   return IRQ_HANDLED;
+   goto clear_intr;
}
/*
 * if one field is just being captured configure
@@ -624,6 +629,10 @@ static irqreturn_t vpfe_isr(int irq, void *dev_id)
 */
vpfe_dev-field_id = fid;
}
+clear_intr:
+   if (vpfe_dev-cfg-clr_intr)
+   vpfe_dev-cfg-clr_intr(irq);
+
return IRQ_HANDLED;
 }
 
@@ -635,8 +644,11 @@ static irqreturn_t vdint1_isr(int irq, void *dev_id)
v4l2_dbg(1, debug, vpfe_dev-v4l2_dev, \nInside vdint1_isr...\n);
 
/* if streaming not started, don't do anything */
-   if (!vpfe_dev-started)
+   if (!vpfe_dev-started) {
+   if (vpfe_dev-cfg-clr_intr)
+   vpfe_dev-cfg-clr_intr(irq);
return IRQ_HANDLED;
+   }
 
spin_lock(vpfe_dev-dma_queue_lock);
if ((vpfe_dev-fmt.fmt.pix.field == V4L2_FIELD_NONE) 
@@ -644,6 +656,10 @@ static irqreturn_t vdint1_isr(int irq, void *dev_id)
vpfe_dev-cur_frm == vpfe_dev-next_frm)
vpfe_schedule_next_buffer(vpfe_dev);
spin_unlock(vpfe_dev-dma_queue_lock);
+
+   if (vpfe_dev-cfg-clr_intr)
+   vpfe_dev-cfg-clr_intr(irq);
+
return IRQ_HANDLED;
 }
 
diff --git a/include/media/ti-media/vpfe_capture.h 
b/include/media/ti-media/vpfe_capture.h
index 5287368..f0a7b7a 100644
--- a/include/media/ti-media/vpfe_capture.h
+++ b/include/media/ti-media/vpfe_capture.h
@@ -94,6 +94,8 @@ struct vpfe_config {
/* vpfe clock */
struct clk *vpssclk;
struct clk *slaveclk;
+   /* Function for Clearing the interrupt */
+   void (*clr_intr)(int vdint);
 };
 
 struct vpfe_device {
-- 
1.6.2.4

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/9] Makfile:Removed duplicate entry of davinci

2010-01-04 Thread hvaibhav
From: Vaibhav Hiremath hvaib...@ti.com


Signed-off-by: Vaibhav Hiremath hvaib...@ti.com
---
 drivers/media/video/Makefile |2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/drivers/media/video/Makefile b/drivers/media/video/Makefile
index 2af68ee..bebbee6 100644
--- a/drivers/media/video/Makefile
+++ b/drivers/media/video/Makefile
@@ -158,8 +158,6 @@ obj-$(CONFIG_VIDEO_MX3) += mx3_camera.o
 obj-$(CONFIG_VIDEO_PXA27x) += pxa_camera.o
 obj-$(CONFIG_VIDEO_SH_MOBILE_CEU)  += sh_mobile_ceu_camera.o
 
-obj-$(CONFIG_ARCH_DAVINCI) += davinci/
-
 obj-$(CONFIG_VIDEO_AU0828) += au0828/
 
 obj-$(CONFIG_USB_VIDEO_CLASS)  += uvc/
-- 
1.6.2.4

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/2] OMAP3: Add V4L2 display driver support

2010-01-04 Thread hvaibhav
From: Vaibhav Hiremath hvaib...@ti.com

This series of patch-set adds support for V4L2 display driver
ontop of DSS2 framework.

Please note that this patch is dependent on patch which add
ti-media directory (submitted earlier to this patch series)

Vaibhav Hiremath (2):
  OMAP2/3 V4L2: Add support for OMAP2/3 V4L2 driver on top of DSS2
  OMAP2/3: Add V4L2 DSS driver support in device.c

 arch/arm/plat-omap/devices.c|   29 +
 drivers/media/video/ti-media/Kconfig|   10 +
 drivers/media/video/ti-media/Makefile   |4 +
 drivers/media/video/ti-media/omap_vout.c| 2654 +++
 drivers/media/video/ti-media/omap_voutdef.h |  148 ++
 drivers/media/video/ti-media/omap_voutlib.c |  258 +++
 drivers/media/video/ti-media/omap_voutlib.h |   34 +
 7 files changed, 3137 insertions(+), 0 deletions(-)
 create mode 100644 drivers/media/video/ti-media/omap_vout.c
 create mode 100644 drivers/media/video/ti-media/omap_voutdef.h
 create mode 100644 drivers/media/video/ti-media/omap_voutlib.c
 create mode 100644 drivers/media/video/ti-media/omap_voutlib.h

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/2] OMAP2/3: Add V4L2 DSS driver support in device.c

2010-01-04 Thread hvaibhav
From: Vaibhav Hiremath hvaib...@ti.com


Signed-off-by: Vaibhav Hiremath hvaib...@ti.com
---
 arch/arm/plat-omap/devices.c |   29 +
 1 files changed, 29 insertions(+), 0 deletions(-)

diff --git a/arch/arm/plat-omap/devices.c b/arch/arm/plat-omap/devices.c
index 30b5db7..64f2a3a 100644
--- a/arch/arm/plat-omap/devices.c
+++ b/arch/arm/plat-omap/devices.c
@@ -357,6 +357,34 @@ static void omap_init_wdt(void)
 static inline void omap_init_wdt(void) {}
 #endif
 
+/*---*/
+
+#if defined(CONFIG_VIDEO_OMAP2_VOUT) || \
+   defined(CONFIG_VIDEO_OMAP2_VOUT_MODULE)
+#if defined (CONFIG_FB_OMAP2) || defined (CONFIG_FB_OMAP2_MODULE)
+static struct resource omap_vout_resource[3 - CONFIG_FB_OMAP2_NUM_FBS] = {
+};
+#else
+static struct resource omap_vout_resource[2] = {
+};
+#endif
+
+static struct platform_device omap_vout_device = {
+   .name   = omap_vout,
+   .num_resources  = ARRAY_SIZE(omap_vout_resource),
+   .resource   = omap_vout_resource[0],
+   .id = -1,
+};
+static void omap_init_vout(void)
+{
+   (void) platform_device_register(omap_vout_device);
+}
+#else
+static inline void omap_init_vout(void) {}
+#endif
+
+/*---*/
+
 /*
  * This gets called after board-specific INIT_MACHINE, and initializes most
  * on-chip peripherals accessible on this board (except for few like USB):
@@ -387,6 +415,7 @@ static int __init omap_init_devices(void)
omap_init_rng();
omap_init_uwire();
omap_init_wdt();
+   omap_init_vout();
return 0;
 }
 arch_initcall(omap_init_devices);
-- 
1.6.2.4

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] Davinci VPFE Capture: Add Suspend/Resume Support

2009-11-18 Thread hvaibhav
From: Vaibhav Hiremath hvaib...@ti.com

Validated on AM3517 Platform.

Signed-off-by: Vaibhav Hiremath hvaib...@ti.com
---
 drivers/media/video/davinci/ccdc_hw_device.h |4 +
 drivers/media/video/davinci/dm644x_ccdc.c|   87 ++
 drivers/media/video/davinci/vpfe_capture.c   |   29 ++---
 3 files changed, 112 insertions(+), 8 deletions(-)

diff --git a/drivers/media/video/davinci/ccdc_hw_device.h 
b/drivers/media/video/davinci/ccdc_hw_device.h
index 86b9b35..2a1ead4 100644
--- a/drivers/media/video/davinci/ccdc_hw_device.h
+++ b/drivers/media/video/davinci/ccdc_hw_device.h
@@ -91,6 +91,10 @@ struct ccdc_hw_ops {
void (*setfbaddr) (unsigned long addr);
/* Pointer to function to get field id */
int (*getfid) (void);
+
+   /* suspend/resume support */
+   void (*save_context)(void);
+   void (*restore_context)(void);
 };
 
 struct ccdc_hw_device {
diff --git a/drivers/media/video/davinci/dm644x_ccdc.c 
b/drivers/media/video/davinci/dm644x_ccdc.c
index 5dff8d9..fdab823 100644
--- a/drivers/media/video/davinci/dm644x_ccdc.c
+++ b/drivers/media/video/davinci/dm644x_ccdc.c
@@ -88,6 +88,10 @@ static void *__iomem ccdc_base_addr;
 static int ccdc_addr_size;
 static enum vpfe_hw_if_type ccdc_if_type;
 
+#define CCDC_SZ_REGS   SZ_1K
+
+static u32 ccdc_ctx[CCDC_SZ_REGS / sizeof(u32)];
+
 /* register access routines */
 static inline u32 regr(u32 offset)
 {
@@ -834,6 +838,87 @@ static int ccdc_set_hw_if_params(struct vpfe_hw_if_param 
*params)
return 0;
 }
 
+static void ccdc_save_context(void)
+{
+   ccdc_ctx[CCDC_PCR] = regr(CCDC_PCR);
+   ccdc_ctx[CCDC_SYN_MODE] = regr(CCDC_SYN_MODE);
+   ccdc_ctx[CCDC_HD_VD_WID] = regr(CCDC_HD_VD_WID);
+   ccdc_ctx[CCDC_PIX_LINES] = regr(CCDC_PIX_LINES);
+   ccdc_ctx[CCDC_HORZ_INFO] = regr(CCDC_HORZ_INFO);
+   ccdc_ctx[CCDC_VERT_START] = regr(CCDC_VERT_START);
+   ccdc_ctx[CCDC_VERT_LINES] = regr(CCDC_VERT_LINES);
+   ccdc_ctx[CCDC_CULLING] = regr(CCDC_CULLING);
+   ccdc_ctx[CCDC_HSIZE_OFF] = regr(CCDC_HSIZE_OFF);
+   ccdc_ctx[CCDC_SDOFST] = regr(CCDC_SDOFST);
+   ccdc_ctx[CCDC_SDR_ADDR] = regr(CCDC_SDR_ADDR);
+   ccdc_ctx[CCDC_CLAMP] = regr(CCDC_CLAMP);
+   ccdc_ctx[CCDC_DCSUB] = regr(CCDC_DCSUB);
+   ccdc_ctx[CCDC_COLPTN] = regr(CCDC_COLPTN);
+   ccdc_ctx[CCDC_BLKCMP] = regr(CCDC_BLKCMP);
+   ccdc_ctx[CCDC_FPC] = regr(CCDC_FPC);
+   ccdc_ctx[CCDC_FPC_ADDR] = regr(CCDC_FPC_ADDR);
+   ccdc_ctx[CCDC_VDINT] = regr(CCDC_VDINT);
+   ccdc_ctx[CCDC_ALAW] = regr(CCDC_ALAW);
+   ccdc_ctx[CCDC_REC656IF] = regr(CCDC_REC656IF);
+   ccdc_ctx[CCDC_CCDCFG] = regr(CCDC_CCDCFG);
+   ccdc_ctx[CCDC_FMTCFG] = regr(CCDC_FMTCFG);
+   ccdc_ctx[CCDC_FMT_HORZ] = regr(CCDC_FMT_HORZ);
+   ccdc_ctx[CCDC_FMT_VERT] = regr(CCDC_FMT_VERT);
+   ccdc_ctx[CCDC_FMT_ADDR0] = regr(CCDC_FMT_ADDR0);
+   ccdc_ctx[CCDC_FMT_ADDR1] = regr(CCDC_FMT_ADDR1);
+   ccdc_ctx[CCDC_FMT_ADDR2] = regr(CCDC_FMT_ADDR2);
+   ccdc_ctx[CCDC_FMT_ADDR3] = regr(CCDC_FMT_ADDR3);
+   ccdc_ctx[CCDC_FMT_ADDR4] = regr(CCDC_FMT_ADDR4);
+   ccdc_ctx[CCDC_FMT_ADDR5] = regr(CCDC_FMT_ADDR5);
+   ccdc_ctx[CCDC_FMT_ADDR6] = regr(CCDC_FMT_ADDR6);
+   ccdc_ctx[CCDC_FMT_ADDR7] = regr(CCDC_FMT_ADDR7);
+   ccdc_ctx[CCDC_PRGEVEN_0] = regr(CCDC_PRGEVEN_0);
+   ccdc_ctx[CCDC_PRGEVEN_1] = regr(CCDC_PRGEVEN_1);
+   ccdc_ctx[CCDC_PRGODD_0] = regr(CCDC_PRGODD_0);
+   ccdc_ctx[CCDC_PRGODD_1] = regr(CCDC_PRGODD_1);
+   ccdc_ctx[CCDC_VP_OUT] = regr(CCDC_VP_OUT);
+}
+
+static void ccdc_restore_context(void)
+{
+   regw(ccdc_ctx[CCDC_SYN_MODE], CCDC_SYN_MODE);
+   regw(ccdc_ctx[CCDC_HD_VD_WID], CCDC_HD_VD_WID);
+   regw(ccdc_ctx[CCDC_PIX_LINES], CCDC_PIX_LINES);
+   regw(ccdc_ctx[CCDC_HORZ_INFO], CCDC_HORZ_INFO);
+   regw(ccdc_ctx[CCDC_VERT_START], CCDC_VERT_START);
+   regw(ccdc_ctx[CCDC_VERT_LINES], CCDC_VERT_LINES);
+   regw(ccdc_ctx[CCDC_CULLING], CCDC_CULLING);
+   regw(ccdc_ctx[CCDC_HSIZE_OFF], CCDC_HSIZE_OFF);
+   regw(ccdc_ctx[CCDC_SDOFST], CCDC_SDOFST);
+   regw(ccdc_ctx[CCDC_SDR_ADDR], CCDC_SDR_ADDR);
+   regw(ccdc_ctx[CCDC_CLAMP], CCDC_CLAMP);
+   regw(ccdc_ctx[CCDC_DCSUB], CCDC_DCSUB);
+   regw(ccdc_ctx[CCDC_COLPTN], CCDC_COLPTN);
+   regw(ccdc_ctx[CCDC_BLKCMP], CCDC_BLKCMP);
+   regw(ccdc_ctx[CCDC_FPC], CCDC_FPC);
+   regw(ccdc_ctx[CCDC_FPC_ADDR], CCDC_FPC_ADDR);
+   regw(ccdc_ctx[CCDC_VDINT], CCDC_VDINT);
+   regw(ccdc_ctx[CCDC_ALAW], CCDC_ALAW);
+   regw(ccdc_ctx[CCDC_REC656IF], CCDC_REC656IF);
+   regw(ccdc_ctx[CCDC_CCDCFG], CCDC_CCDCFG);
+   regw(ccdc_ctx[CCDC_FMTCFG], CCDC_FMTCFG);
+   regw(ccdc_ctx[CCDC_FMT_HORZ], CCDC_FMT_HORZ);
+   regw(ccdc_ctx[CCDC_FMT_VERT], CCDC_FMT_VERT);
+   regw(ccdc_ctx[CCDC_FMT_ADDR0], CCDC_FMT_ADDR0);
+   regw(ccdc_ctx[CCDC_FMT_ADDR1], CCDC_FMT_ADDR1);
+   

[PATCH] VPFE Capture: Add call back function for interrupt clear to vpfe_cfg

2009-11-18 Thread hvaibhav
From: Vaibhav Hiremath hvaib...@ti.com

For the devices like AM3517, it is expected that driver clears the
interrupt in ISR. Since this is device spcific, callback function
added to the platform_data.

Signed-off-by: Vaibhav Hiremath hvaib...@ti.com
---
 drivers/media/video/davinci/vpfe_capture.c |   26 --
 include/media/davinci/vpfe_capture.h   |2 ++
 2 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/drivers/media/video/davinci/vpfe_capture.c 
b/drivers/media/video/davinci/vpfe_capture.c
index 9b6b254..4c5152e 100644
--- a/drivers/media/video/davinci/vpfe_capture.c
+++ b/drivers/media/video/davinci/vpfe_capture.c
@@ -563,6 +563,11 @@ static int vpfe_initialize_device(struct vpfe_device 
*vpfe_dev)
ret = ccdc_dev-hw_ops.open(vpfe_dev-pdev);
if (!ret)
vpfe_dev-initialized = 1;
+
+   /* Clear all VPFE/CCDC interrupts */
+   if (vpfe_dev-cfg-clr_intr)
+   vpfe_dev-cfg-clr_intr(-1);
+
 unlock:
mutex_unlock(ccdc_lock);
return ret;
@@ -663,8 +668,11 @@ static irqreturn_t vpfe_isr(int irq, void *dev_id)
field = vpfe_dev-fmt.fmt.pix.field;
 
/* if streaming not started, don't do anything */
-   if (!vpfe_dev-started)
+   if (!vpfe_dev-started) {
+   if (vpfe_dev-cfg-clr_intr)
+   vpfe_dev-cfg-clr_intr(irq);
return IRQ_HANDLED;
+   }
 
/* only for 6446 this will be applicable */
if (NULL != ccdc_dev-hw_ops.reset)
@@ -676,6 +684,8 @@ static irqreturn_t vpfe_isr(int irq, void *dev_id)
frame format is progressive...\n);
if (vpfe_dev-cur_frm != vpfe_dev-next_frm)
vpfe_process_buffer_complete(vpfe_dev);
+   if (vpfe_dev-cfg-clr_intr)
+   vpfe_dev-cfg-clr_intr(irq);
return IRQ_HANDLED;
}
 
@@ -703,6 +713,8 @@ static irqreturn_t vpfe_isr(int irq, void *dev_id)
if (field == V4L2_FIELD_SEQ_TB)
vpfe_schedule_bottom_field(vpfe_dev);
 
+   if (vpfe_dev-cfg-clr_intr)
+   vpfe_dev-cfg-clr_intr(irq);
return IRQ_HANDLED;
}
/*
@@ -723,6 +735,9 @@ static irqreturn_t vpfe_isr(int irq, void *dev_id)
 */
vpfe_dev-field_id = fid;
}
+   if (vpfe_dev-cfg-clr_intr)
+   vpfe_dev-cfg-clr_intr(irq);
+
return IRQ_HANDLED;
 }
 
@@ -734,8 +749,11 @@ static irqreturn_t vdint1_isr(int irq, void *dev_id)
v4l2_dbg(1, debug, vpfe_dev-v4l2_dev, \nInside vdint1_isr...\n);
 
/* if streaming not started, don't do anything */
-   if (!vpfe_dev-started)
+   if (!vpfe_dev-started) {
+   if (vpfe_dev-cfg-clr_intr)
+   vpfe_dev-cfg-clr_intr(irq);
return IRQ_HANDLED;
+   }
 
spin_lock(vpfe_dev-dma_queue_lock);
if ((vpfe_dev-fmt.fmt.pix.field == V4L2_FIELD_NONE) 
@@ -743,6 +761,10 @@ static irqreturn_t vdint1_isr(int irq, void *dev_id)
vpfe_dev-cur_frm == vpfe_dev-next_frm)
vpfe_schedule_next_buffer(vpfe_dev);
spin_unlock(vpfe_dev-dma_queue_lock);
+
+   if (vpfe_dev-cfg-clr_intr)
+   vpfe_dev-cfg-clr_intr(irq);
+
return IRQ_HANDLED;
 }
 
diff --git a/include/media/davinci/vpfe_capture.h 
b/include/media/davinci/vpfe_capture.h
index fc83d98..5a21265 100644
--- a/include/media/davinci/vpfe_capture.h
+++ b/include/media/davinci/vpfe_capture.h
@@ -104,6 +104,8 @@ struct vpfe_config {
char *ccdc;
/* setup function for the input path */
int (*setup_input)(enum vpfe_subdev_id id);
+   /* Function for Clearing the interrupt */
+   void (*clr_intr)(int vdint);
/* number of clocks */
int num_clocks;
/* clocks used for vpfe capture */
-- 
1.6.2.4

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH V2] VPFE Capture: Add call back function for interrupt clear to vpfe_cfg

2009-11-18 Thread hvaibhav
From: Vaibhav Hiremath hvaib...@ti.com

For the devices like AM3517, it is expected that driver clears the
interrupt in ISR. Since this is device spcific, callback function
added to the platform_data.

Signed-off-by: Vaibhav Hiremath hvaib...@ti.com
---
 drivers/media/video/davinci/vpfe_capture.c |   24 
 include/media/davinci/vpfe_capture.h   |2 ++
 2 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/drivers/media/video/davinci/vpfe_capture.c 
b/drivers/media/video/davinci/vpfe_capture.c
index 9b6b254..46e2939 100644
--- a/drivers/media/video/davinci/vpfe_capture.c
+++ b/drivers/media/video/davinci/vpfe_capture.c
@@ -563,6 +563,11 @@ static int vpfe_initialize_device(struct vpfe_device 
*vpfe_dev)
ret = ccdc_dev-hw_ops.open(vpfe_dev-pdev);
if (!ret)
vpfe_dev-initialized = 1;
+
+   /* Clear all VPFE/CCDC interrupts */
+   if (vpfe_dev-cfg-clr_intr)
+   vpfe_dev-cfg-clr_intr(-1);
+
 unlock:
mutex_unlock(ccdc_lock);
return ret;
@@ -664,7 +669,7 @@ static irqreturn_t vpfe_isr(int irq, void *dev_id)

/* if streaming not started, don't do anything */
if (!vpfe_dev-started)
-   return IRQ_HANDLED;
+   goto clear_intr;

/* only for 6446 this will be applicable */
if (NULL != ccdc_dev-hw_ops.reset)
@@ -676,7 +681,7 @@ static irqreturn_t vpfe_isr(int irq, void *dev_id)
frame format is progressive...\n);
if (vpfe_dev-cur_frm != vpfe_dev-next_frm)
vpfe_process_buffer_complete(vpfe_dev);
-   return IRQ_HANDLED;
+   goto clear_intr;
}

/* interlaced or TB capture check which field we are in hardware */
@@ -703,7 +708,7 @@ static irqreturn_t vpfe_isr(int irq, void *dev_id)
if (field == V4L2_FIELD_SEQ_TB)
vpfe_schedule_bottom_field(vpfe_dev);

-   return IRQ_HANDLED;
+   goto clear_intr;
}
/*
 * if one field is just being captured configure
@@ -723,6 +728,10 @@ static irqreturn_t vpfe_isr(int irq, void *dev_id)
 */
vpfe_dev-field_id = fid;
}
+clear_intr:
+   if (vpfe_dev-cfg-clr_intr)
+   vpfe_dev-cfg-clr_intr(irq);
+
return IRQ_HANDLED;
 }

@@ -734,8 +743,11 @@ static irqreturn_t vdint1_isr(int irq, void *dev_id)
v4l2_dbg(1, debug, vpfe_dev-v4l2_dev, \nInside vdint1_isr...\n);

/* if streaming not started, don't do anything */
-   if (!vpfe_dev-started)
+   if (!vpfe_dev-started) {
+   if (vpfe_dev-cfg-clr_intr)
+   vpfe_dev-cfg-clr_intr(irq);
return IRQ_HANDLED;
+   }

spin_lock(vpfe_dev-dma_queue_lock);
if ((vpfe_dev-fmt.fmt.pix.field == V4L2_FIELD_NONE) 
@@ -743,6 +755,10 @@ static irqreturn_t vdint1_isr(int irq, void *dev_id)
vpfe_dev-cur_frm == vpfe_dev-next_frm)
vpfe_schedule_next_buffer(vpfe_dev);
spin_unlock(vpfe_dev-dma_queue_lock);
+
+   if (vpfe_dev-cfg-clr_intr)
+   vpfe_dev-cfg-clr_intr(irq);
+
return IRQ_HANDLED;
 }

diff --git a/include/media/davinci/vpfe_capture.h 
b/include/media/davinci/vpfe_capture.h
index fc83d98..5a21265 100644
--- a/include/media/davinci/vpfe_capture.h
+++ b/include/media/davinci/vpfe_capture.h
@@ -104,6 +104,8 @@ struct vpfe_config {
char *ccdc;
/* setup function for the input path */
int (*setup_input)(enum vpfe_subdev_id id);
+   /* Function for Clearing the interrupt */
+   void (*clr_intr)(int vdint);
/* number of clocks */
int num_clocks;
/* clocks used for vpfe capture */
--
1.6.2.4

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] DM644x CCDC: Add 10bit BT support

2009-11-15 Thread hvaibhav
From: Vaibhav Hiremath hvaib...@ti.com


Signed-off-by: Vaibhav Hiremath hvaib...@ti.com
Reviewed-by: Muralidharan Karicheri m-kariche...@ti.com
---
 drivers/media/video/davinci/dm644x_ccdc.c  |   17 +
 drivers/media/video/davinci/dm644x_ccdc_regs.h |8 
 2 files changed, 21 insertions(+), 4 deletions(-)

diff --git a/drivers/media/video/davinci/dm644x_ccdc.c 
b/drivers/media/video/davinci/dm644x_ccdc.c
index 2f19a91..9d601b4 100644
--- a/drivers/media/video/davinci/dm644x_ccdc.c
+++ b/drivers/media/video/davinci/dm644x_ccdc.c
@@ -394,7 +394,11 @@ void ccdc_config_ycbcr(void)
 * configure the FID, VD, HD pin polarity,
 * fld,hd pol positive, vd negative, 8-bit data
 */
-   syn_mode |= CCDC_SYN_MODE_VD_POL_NEGATIVE | CCDC_SYN_MODE_8BITS;
+   syn_mode |= CCDC_SYN_MODE_VD_POL_NEGATIVE;
+   if (ccdc_if_type == VPFE_BT656_10BIT)
+   syn_mode |= CCDC_SYN_MODE_10BITS;
+   else
+   syn_mode |= CCDC_SYN_MODE_8BITS;
} else {
/* y/c external sync mode */
syn_mode |= (((params-fid_pol  CCDC_FID_POL_MASK) 
@@ -413,8 +417,13 @@ void ccdc_config_ycbcr(void)
 * configure the order of y cb cr in SDRAM, and disable latch
 * internal register on vsync
 */
-   regw((params-pix_order  CCDC_CCDCFG_Y8POS_SHIFT) |
-CCDC_LATCH_ON_VSYNC_DISABLE, CCDC_CCDCFG);
+   if (ccdc_if_type == VPFE_BT656_10BIT)
+   regw((params-pix_order  CCDC_CCDCFG_Y8POS_SHIFT) |
+   CCDC_LATCH_ON_VSYNC_DISABLE | CCDC_CCDCFG_BW656_10BIT,
+   CCDC_CCDCFG);
+   else
+   regw((params-pix_order  CCDC_CCDCFG_Y8POS_SHIFT) |
+   CCDC_LATCH_ON_VSYNC_DISABLE, CCDC_CCDCFG);

/*
 * configure the horizontal line offset. This should be a
@@ -429,7 +438,6 @@ void ccdc_config_ycbcr(void)

ccdc_sbl_reset();
dev_dbg(dev, \nEnd of ccdc_config_ycbcr...\n);
-   ccdc_readregs();
 }

 static void ccdc_config_black_clamp(struct ccdc_black_clamp *bclamp)
@@ -822,6 +830,7 @@ static int ccdc_set_hw_if_params(struct vpfe_hw_if_param 
*params)
case VPFE_BT656:
case VPFE_YCBCR_SYNC_16:
case VPFE_YCBCR_SYNC_8:
+   case VPFE_BT656_10BIT:
ccdc_hw_params_ycbcr.vd_pol = params-vdpol;
ccdc_hw_params_ycbcr.hd_pol = params-hdpol;
break;
diff --git a/drivers/media/video/davinci/dm644x_ccdc_regs.h 
b/drivers/media/video/davinci/dm644x_ccdc_regs.h
index 6e5d053..b18d166 100644
--- a/drivers/media/video/davinci/dm644x_ccdc_regs.h
+++ b/drivers/media/video/davinci/dm644x_ccdc_regs.h
@@ -135,11 +135,19 @@
 #define CCDC_SYN_MODE_INPMOD_SHIFT 12
 #define CCDC_SYN_MODE_INPMOD_MASK  3
 #define CCDC_SYN_MODE_8BITS(7  8)
+#define CCDC_SYN_MODE_10BITS   (6  8)
+#define CCDC_SYN_MODE_11BITS   (5  8)
+#define CCDC_SYN_MODE_12BITS   (4  8)
+#define CCDC_SYN_MODE_13BITS   (3  8)
+#define CCDC_SYN_MODE_14BITS   (2  8)
+#define CCDC_SYN_MODE_15BITS   (1  8)
+#define CCDC_SYN_MODE_16BITS   (0  8)
 #define CCDC_SYN_FLDMODE_MASK  1
 #define CCDC_SYN_FLDMODE_SHIFT 7
 #define CCDC_REC656IF_BT656_EN 3
 #define CCDC_SYN_MODE_VD_POL_NEGATIVE  (1  2)
 #define CCDC_CCDCFG_Y8POS_SHIFT11
+#define CCDC_CCDCFG_BW656_10BIT(1  5)
 #define CCDC_SDOFST_FIELD_INTERLEAVED  0x249
 #define CCDC_NO_CULLING0x00ff
 #endif
--
1.6.2.4

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] Davinci VPFE Capture: Add support for Control ioctls

2009-11-10 Thread hvaibhav
From: Vaibhav Hiremath hvaib...@ti.com

Added support for Control IOCTL,
- s_ctrl
- g_ctrl
- queryctrl

Signed-off-by: Vaibhav Hiremath hvaib...@ti.com
---
 drivers/media/video/davinci/vpfe_capture.c |   38 
 1 files changed, 38 insertions(+), 0 deletions(-)

diff --git a/drivers/media/video/davinci/vpfe_capture.c 
b/drivers/media/video/davinci/vpfe_capture.c
index abe21e4..9c859a7 100644
--- a/drivers/media/video/davinci/vpfe_capture.c
+++ b/drivers/media/video/davinci/vpfe_capture.c
@@ -1368,6 +1368,41 @@ static int vpfe_g_std(struct file *file, void *priv, 
v4l2_std_id *std_id)
return 0;
 }
 
+static int vpfe_queryctrl(struct file *file, void *priv,
+   struct v4l2_queryctrl *qctrl)
+{
+   struct vpfe_device *vpfe_dev = video_drvdata(file);
+   struct vpfe_subdev_info *sdinfo;
+
+   sdinfo = vpfe_dev-current_subdev;
+
+   return v4l2_device_call_until_err(vpfe_dev-v4l2_dev, sdinfo-grp_id,
+core, queryctrl, qctrl);
+
+}
+
+static int vpfe_g_ctrl(struct file *file, void *priv, struct v4l2_control 
*ctrl)
+{
+   struct vpfe_device *vpfe_dev = video_drvdata(file);
+   struct vpfe_subdev_info *sdinfo;
+
+   sdinfo = vpfe_dev-current_subdev;
+
+   return v4l2_device_call_until_err(vpfe_dev-v4l2_dev, sdinfo-grp_id,
+core, g_ctrl, ctrl);
+}
+
+static int vpfe_s_ctrl(struct file *file, void *priv, struct v4l2_control 
*ctrl)
+{
+   struct vpfe_device *vpfe_dev = video_drvdata(file);
+   struct vpfe_subdev_info *sdinfo;
+
+   sdinfo = vpfe_dev-current_subdev;
+
+   return v4l2_device_call_until_err(vpfe_dev-v4l2_dev, sdinfo-grp_id,
+core, s_ctrl, ctrl);
+}
+
 /*
  *  Videobuf operations
  */
@@ -1939,6 +1974,9 @@ static const struct v4l2_ioctl_ops vpfe_ioctl_ops = {
.vidioc_querystd = vpfe_querystd,
.vidioc_s_std= vpfe_s_std,
.vidioc_g_std= vpfe_g_std,
+   .vidioc_queryctrl= vpfe_queryctrl,
+   .vidioc_g_ctrl   = vpfe_g_ctrl,
+   .vidioc_s_ctrl   = vpfe_s_ctrl,
.vidioc_reqbufs  = vpfe_reqbufs,
.vidioc_querybuf = vpfe_querybuf,
.vidioc_qbuf = vpfe_qbuf,
-- 
1.6.2.4

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] v4l2 doc: Added FBUF_CAP_SRC_CHROMAKEY/FLAG_SRC_CHROMAKEY

2009-11-10 Thread hvaibhav
From: Vaibhav Hiremath hvaib...@ti.com


Signed-off-by: Vaibhav Hiremath hvaib...@ti.com
---
 linux/Documentation/DocBook/v4l/videodev2.h.xml   |2 ++
 linux/Documentation/DocBook/v4l/vidioc-g-fbuf.xml |   17 +
 2 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/linux/Documentation/DocBook/v4l/videodev2.h.xml 
b/linux/Documentation/DocBook/v4l/videodev2.h.xml
index 9700206..eef7ba4 100644
--- a/linux/Documentation/DocBook/v4l/videodev2.h.xml
+++ b/linux/Documentation/DocBook/v4l/videodev2.h.xml
@@ -565,6 +565,7 @@ struct link 
linkend=v4l2-framebufferv4l2_framebuffer/link {
 #define V4L2_FBUF_CAP_LOCAL_ALPHA   0x0010
 #define V4L2_FBUF_CAP_GLOBAL_ALPHA  0x0020
 #define V4L2_FBUF_CAP_LOCAL_INV_ALPHA   0x0040
+#define V4L2_FBUF_CAP_SRC_CHROMAKEY 0x0080
 /*  Flags for the 'flags' field. */
 #define V4L2_FBUF_FLAG_PRIMARY  0x0001
 #define V4L2_FBUF_FLAG_OVERLAY  0x0002
@@ -572,6 +573,7 @@ struct link 
linkend=v4l2-framebufferv4l2_framebuffer/link {
 #define V4L2_FBUF_FLAG_LOCAL_ALPHA  0x0008
 #define V4L2_FBUF_FLAG_GLOBAL_ALPHA 0x0010
 #define V4L2_FBUF_FLAG_LOCAL_INV_ALPHA  0x0020
+#define V4L2_FBUF_FLAG_SRC_CHROMAKEY0x0040
 
 struct link linkend=v4l2-clipv4l2_clip/link {
 struct link linkend=v4l2-rectv4l2_rect/linkc;
diff --git a/linux/Documentation/DocBook/v4l/vidioc-g-fbuf.xml 
b/linux/Documentation/DocBook/v4l/vidioc-g-fbuf.xml
index f701706..e7dda48 100644
--- a/linux/Documentation/DocBook/v4l/vidioc-g-fbuf.xml
+++ b/linux/Documentation/DocBook/v4l/vidioc-g-fbuf.xml
@@ -336,6 +336,13 @@ alpha value. Alpha blending makes no sense for destructive 
overlays./entry
 inverted alpha channel of the framebuffer or VGA signal. Alpha
 blending makes no sense for destructive overlays./entry
  /row
+ row
+   entryconstantV4L2_FBUF_CAP_SRC_CHROMAKEY/constant/entry
+   entry0x0080/entry
+   entryThe device supports Source Chroma-keying. Framebuffer pixels
+with the chroma-key colors are replaced by video pixels, which is exactly 
opposite of
+constantV4L2_FBUF_CAP_CHROMAKEY/constant/entry
+ /row
/tbody
   /tgroup
 /table
@@ -411,6 +418,16 @@ images, but with an inverted alpha value. The blend 
function is:
 output = framebuffer pixel * (1 - alpha) + video pixel * alpha. The
 actual alpha depth depends on the framebuffer pixel format./entry
  /row
+ row
+   entryconstantV4L2_FBUF_FLAG_SRC_CHROMAKEY/constant/entry
+   entry0x0040/entry
+   entryUse source chroma-keying. The source chroma-key color is
+determined by the structfieldchromakey/structfield field of
+v4l2-window; and negotiated with the VIDIOC-S-FMT; ioctl, see xref
+linkend=overlay / and xref linkend=osd /.
+Both chroma-keying are mutual exclusive to each other, so same
+structfieldchromakey/structfield field of v4l2-window; is being 
used./entry
+ /row
/tbody
   /tgroup
 /table
-- 
1.6.2.4

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH V2] Davinci VPFE Capture: Add support for Control ioctls

2009-10-29 Thread hvaibhav
From: Vaibhav Hiremath hvaib...@ti.com

Added support for Control IOCTL,
- s_ctrl
- g_ctrl
- queryctrl

Change from last patch:
- added room for error return in queryctrl function.

Signed-off-by: Vaibhav Hiremath hvaib...@ti.com
---
 drivers/media/video/davinci/vpfe_capture.c |   43 
 1 files changed, 43 insertions(+), 0 deletions(-)

diff --git a/drivers/media/video/davinci/vpfe_capture.c 
b/drivers/media/video/davinci/vpfe_capture.c
index abe21e4..8275d02 100644
--- a/drivers/media/video/davinci/vpfe_capture.c
+++ b/drivers/media/video/davinci/vpfe_capture.c
@@ -1368,6 +1368,46 @@ static int vpfe_g_std(struct file *file, void *priv, 
v4l2_std_id *std_id)
return 0;
 }

+static int vpfe_queryctrl(struct file *file, void *priv,
+   struct v4l2_queryctrl *qctrl)
+{
+   struct vpfe_device *vpfe_dev = video_drvdata(file);
+   struct vpfe_subdev_info *sdinfo;
+   int ret = 0;
+
+   sdinfo = vpfe_dev-current_subdev;
+
+   ret = v4l2_device_call_until_err(vpfe_dev-v4l2_dev, sdinfo-grp_id,
+core, queryctrl, qctrl);
+
+   if (ret)
+   qctrl-flags |= V4L2_CTRL_FLAG_DISABLED;
+
+   return ret;
+}
+
+static int vpfe_g_ctrl(struct file *file, void *priv, struct v4l2_control 
*ctrl)
+{
+   struct vpfe_device *vpfe_dev = video_drvdata(file);
+   struct vpfe_subdev_info *sdinfo;
+
+   sdinfo = vpfe_dev-current_subdev;
+
+   return v4l2_device_call_until_err(vpfe_dev-v4l2_dev, sdinfo-grp_id,
+core, g_ctrl, ctrl);
+}
+
+static int vpfe_s_ctrl(struct file *file, void *priv, struct v4l2_control 
*ctrl)
+{
+   struct vpfe_device *vpfe_dev = video_drvdata(file);
+   struct vpfe_subdev_info *sdinfo;
+
+   sdinfo = vpfe_dev-current_subdev;
+
+   return v4l2_device_call_until_err(vpfe_dev-v4l2_dev, sdinfo-grp_id,
+core, s_ctrl, ctrl);
+}
+
 /*
  *  Videobuf operations
  */
@@ -1939,6 +1979,9 @@ static const struct v4l2_ioctl_ops vpfe_ioctl_ops = {
.vidioc_querystd = vpfe_querystd,
.vidioc_s_std= vpfe_s_std,
.vidioc_g_std= vpfe_g_std,
+   .vidioc_queryctrl= vpfe_queryctrl,
+   .vidioc_g_ctrl   = vpfe_g_ctrl,
+   .vidioc_s_ctrl   = vpfe_s_ctrl,
.vidioc_reqbufs  = vpfe_reqbufs,
.vidioc_querybuf = vpfe_querybuf,
.vidioc_qbuf = vpfe_qbuf,
--
1.6.2.4

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/1] v4l2 doc: Added S/G_ROTATE, S/G_BG_COLOR information

2009-10-28 Thread hvaibhav
From: Vaibhav Hiremath hvaib...@ti.com


Signed-off-by: Vaibhav Hiremath hvaib...@ti.com
---
 v4l2-spec/controls.sgml |   20 +++-
 1 files changed, 19 insertions(+), 1 deletions(-)

diff --git a/v4l2-spec/controls.sgml b/v4l2-spec/controls.sgml
index 477a970..a675f30 100644
--- a/v4l2-spec/controls.sgml
+++ b/v4l2-spec/controls.sgml
@@ -281,10 +281,28 @@ minimum value disables backlight compensation./entry
 constantV4L2_COLORFX_SEPIA/constant (2)./entry
  /row
  row
+   entryconstantV4L2_CID_ROTATE/constant/entry
+   entryinteger/entry
+   entryRotates the image by specified angle. Common angles are 90,
+   270 and 180. Rotating the image to 90 and 270 will reverse the 
height
+   and width of the display window. It is necessary to set the new 
height and
+   width of the picture using S_FMT ioctl, see xref 
linkend=vidioc-g-fmt according to
+   the rotation angle selected./entry
+ /row
+ row
+   entryconstantV4L2_CID_BG_COLOR/constant/entry
+   entryinteger/entry
+   entrySets the background color on the current output device.
+   Background color needs to be specified in the RGB24 format. The
+   supplied 32 bit value is interpreted as bits 0-7 Red color 
information,
+   bits 8-15 Green color information, bits 16-23 Blue color
+   information and bits 24-31 must be zero./entry
+ /row
+ row
entryconstantV4L2_CID_LASTP1/constant/entry
entry/entry
entryEnd of the predefined control IDs (currently
-constantV4L2_CID_COLORFX/constant + 1)./entry
+constantV4L2_CID_BG_COLOR/constant + 1)./entry
  /row
  row
entryconstantV4L2_CID_PRIVATE_BASE/constant/entry
-- 
1.6.2.4

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/4] V4L2: Added New V4L2 CIDs VIDIOC_S/G_COLOR_SPACE_CONV

2009-10-16 Thread hvaibhav
From: Vaibhav Hiremath hvaib...@ti.com


Signed-off-by: Vaibhav Hiremath hvaib...@ti.com
---
 drivers/media/video/v4l2-ioctl.c |   19 +++
 include/linux/videodev2.h|   14 ++
 include/media/v4l2-ioctl.h   |4 
 3 files changed, 37 insertions(+), 0 deletions(-)

diff --git a/drivers/media/video/v4l2-ioctl.c b/drivers/media/video/v4l2-ioctl.c
index 30cc334..d3140e0 100644
--- a/drivers/media/video/v4l2-ioctl.c
+++ b/drivers/media/video/v4l2-ioctl.c
@@ -284,6 +284,8 @@ static const char *v4l2_ioctls[] = {
[_IOC_NR(VIDIOC_DBG_G_CHIP_IDENT)] = VIDIOC_DBG_G_CHIP_IDENT,
[_IOC_NR(VIDIOC_S_HW_FREQ_SEEK)]   = VIDIOC_S_HW_FREQ_SEEK,
 #endif
+   [_IOC_NR(VIDIOC_S_COLOR_SPACE_CONV)]   = VIDIOC_S_COLOR_SPACE_CONV,
+   [_IOC_NR(VIDIOC_G_COLOR_SPACE_CONV)]   = VIDIOC_G_COLOR_SPACE_CONV,
 };
 #define V4L2_IOCTLS ARRAY_SIZE(v4l2_ioctls)
 
@@ -1795,6 +1797,23 @@ static long __video_do_ioctl(struct file *file,
break;
}
 
+   /*---Color space conversion--*/
+   case VIDIOC_S_COLOR_SPACE_CONV:
+   {
+   struct v4l2_color_space_conv *p = arg;
+   if (!ops-vidioc_s_color_space_conv)
+   break;
+   ret = ops-vidioc_s_color_space_conv(file, fh, p);
+   break;
+   }
+   case VIDIOC_G_COLOR_SPACE_CONV:
+   {
+   struct v4l2_color_space_conv *p = arg;
+   if (!ops-vidioc_g_color_space_conv)
+   break;
+   ret = ops-vidioc_g_color_space_conv(file, fh, p);
+   break;
+   }
default:
{
if (!ops-vidioc_default)
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index b59e78c..b6fe1de 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -1281,6 +1281,18 @@ struct v4l2_rds_data {
 #define V4L2_RDS_BLOCK_ERROR0x80
 
 /*
+ * Color conversion
+ * User needs to pass pointer to color conversion matrix
+ * defined by hardware
+ */
+struct v4l2_color_space_conv {
+   __s32 coefficients[3][3];
+   __s32 const_factor;
+   __s32 input_offs[3];
+   __s32 output_offs[3];
+};
+
+/*
  * A U D I O
  */
 struct v4l2_audio {
@@ -1619,6 +1631,8 @@ struct v4l2_dbg_chip_ident {
 #endif
 
 #define VIDIOC_S_HW_FREQ_SEEK   _IOW('V', 82, struct v4l2_hw_freq_seek)
+#define VIDIOC_S_COLOR_SPACE_CONV _IOW('V', 83, struct v4l2_color_space_conv)
+#define VIDIOC_G_COLOR_SPACE_CONV _IOR('V', 84, struct v4l2_color_space_conv)
 /* Reminder: when adding new ioctls please add support for them to
drivers/media/video/v4l2-compat-ioctl32.c as well! */
 
diff --git a/include/media/v4l2-ioctl.h b/include/media/v4l2-ioctl.h
index 7a4529d..0e31ace 100644
--- a/include/media/v4l2-ioctl.h
+++ b/include/media/v4l2-ioctl.h
@@ -242,6 +242,10 @@ struct v4l2_ioctl_ops {
/* For other private ioctls */
long (*vidioc_default) (struct file *file, void *fh,
int cmd, void *arg);
+   int (*vidioc_s_color_space_conv) (struct file *file, void *fh,
+   struct v4l2_color_space_conv *a);
+   int (*vidioc_g_color_space_conv) (struct file *file, void *fh,
+   struct v4l2_color_space_conv *a);
 };
 
 
-- 
1.6.2.4

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/4] V4L2: Added CID's V4L2_CID_ROTATE/BG_COLOR

2009-10-16 Thread hvaibhav
From: Vaibhav Hiremath hvaib...@ti.com

Signed-off-by: Vaibhav Hiremath hvaib...@ti.com
---
 drivers/media/video/v4l2-common.c |9 +
 include/linux/videodev2.h |4 +++-
 2 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/drivers/media/video/v4l2-common.c 
b/drivers/media/video/v4l2-common.c
index f5a93ae..35a0107 100644
--- a/drivers/media/video/v4l2-common.c
+++ b/drivers/media/video/v4l2-common.c
@@ -431,6 +431,8 @@ const char *v4l2_ctrl_get_name(u32 id)
case V4L2_CID_CHROMA_AGC:   return Chroma AGC;
case V4L2_CID_COLOR_KILLER: return Color Killer;
case V4L2_CID_COLORFX:  return Color Effects;
+   case V4L2_CID_ROTATE:   return Rotate;
+   case V4L2_CID_BG_COLOR: return Background color;
 
/* MPEG controls */
case V4L2_CID_MPEG_CLASS:   return MPEG Encoder Controls;
@@ -587,6 +589,13 @@ int v4l2_ctrl_query_fill(struct v4l2_queryctrl *qctrl, s32 
min, s32 max, s32 ste
qctrl-flags |= V4L2_CTRL_FLAG_READ_ONLY;
min = max = step = def = 0;
break;
+   case V4L2_CID_BG_COLOR:
+   qctrl-type = V4L2_CTRL_TYPE_INTEGER;
+   step = 1;
+   min = 0;
+   /* Max is calculated as RGB888 that is 2^12*/
+   max = 0xFF;
+   break;
default:
qctrl-type = V4L2_CTRL_TYPE_INTEGER;
break;
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index b6fe1de..d77db6f 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -912,8 +912,10 @@ enum v4l2_colorfx {
 #define V4L2_CID_AUTOBRIGHTNESS(V4L2_CID_BASE+32)
 #define V4L2_CID_BAND_STOP_FILTER  (V4L2_CID_BASE+33)
 
+#define V4L2_CID_ROTATE(V4L2_CID_BASE+34)
+#define V4L2_CID_BG_COLOR  (V4L2_CID_BASE+35)
 /* last CID + 1 */
-#define V4L2_CID_LASTP1 (V4L2_CID_BASE+34)
+#define V4L2_CID_LASTP1 (V4L2_CID_BASE+36)
 
 /*  MPEG-class control IDs defined by V4L2 */
 #define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900)
-- 
1.6.2.4

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 3/4] V4L2: Add Capability and Flag field for Croma Key

2009-10-16 Thread hvaibhav
From: Vaibhav Hiremath hvaib...@ti.com


Signed-off-by: Vaibhav Hiremath hvaib...@ti.com
---
 include/linux/videodev2.h |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index d77db6f..adff8d9 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -563,6 +563,7 @@ struct v4l2_framebuffer {
 #define V4L2_FBUF_CAP_LOCAL_ALPHA  0x0010
 #define V4L2_FBUF_CAP_GLOBAL_ALPHA 0x0020
 #define V4L2_FBUF_CAP_LOCAL_INV_ALPHA  0x0040
+#define V4L2_FBUF_CAP_SRC_CHROMAKEY0x0080
 /*  Flags for the 'flags' field. */
 #define V4L2_FBUF_FLAG_PRIMARY 0x0001
 #define V4L2_FBUF_FLAG_OVERLAY 0x0002
@@ -570,6 +571,7 @@ struct v4l2_framebuffer {
 #define V4L2_FBUF_FLAG_LOCAL_ALPHA 0x0008
 #define V4L2_FBUF_FLAG_GLOBAL_ALPHA0x0010
 #define V4L2_FBUF_FLAG_LOCAL_INV_ALPHA 0x0020
+#define V4L2_FBUF_FLAG_SRC_CHROMAKEY   0x0040
 
 struct v4l2_clip {
struct v4l2_rectc;
-- 
1.6.2.4

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Resubmition PATCH] Davinci VPFE Capture: Take i2c adapter id through platform data

2009-10-16 Thread hvaibhav
From: Vaibhav Hiremath hvaib...@ti.com

The I2C adapter ID is actually depends on Board and may vary, Davinci
uses id=1, but in case of AM3517 id=3.

Changes:
- Fixed review comments (Typo) from Sergei

Signed-off-by: Vaibhav Hiremath hvaib...@ti.com
---
 drivers/media/video/davinci/vpfe_capture.c |3 +--
 include/media/davinci/vpfe_capture.h   |2 ++
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/media/video/davinci/vpfe_capture.c 
b/drivers/media/video/davinci/vpfe_capture.c
index dc32de0..c3c37e7 100644
--- a/drivers/media/video/davinci/vpfe_capture.c
+++ b/drivers/media/video/davinci/vpfe_capture.c
@@ -2228,8 +2228,7 @@ static __init int vpfe_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, vpfe_dev);
/* set driver private data */
video_set_drvdata(vpfe_dev-video_dev, vpfe_dev);
-   i2c_adap = i2c_get_adapter(1);
-   vpfe_cfg = pdev-dev.platform_data;
+   i2c_adap = i2c_get_adapter(vpfe_cfg-i2c_adapter_id);
num_subdevs = vpfe_cfg-num_subdevs;
vpfe_dev-sd = kmalloc(sizeof(struct v4l2_subdev *) * num_subdevs,
GFP_KERNEL);
diff --git a/include/media/davinci/vpfe_capture.h 
b/include/media/davinci/vpfe_capture.h
index e8272d1..fc83d98 100644
--- a/include/media/davinci/vpfe_capture.h
+++ b/include/media/davinci/vpfe_capture.h
@@ -94,6 +94,8 @@ struct vpfe_subdev_info {
 struct vpfe_config {
/* Number of sub devices connected to vpfe */
int num_subdevs;
+   /* I2C Bus adapter no */
+   int i2c_adapter_id;
/* information about each subdev */
struct vpfe_subdev_info *sub_devs;
/* evm card info */
--
1.6.2.4

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/6] Davinci VPFE Capture: Specify device pointer in videobuf_queue_dma_contig_init

2009-10-13 Thread hvaibhav
From: Vaibhav Hiremath hvaib...@ti.com

Signed-off-by: Vaibhav Hiremath hvaib...@ti.com
---
 drivers/media/video/davinci/vpfe_capture.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/media/video/davinci/vpfe_capture.c 
b/drivers/media/video/davinci/vpfe_capture.c
index ff43446..dc32de0 100644
--- a/drivers/media/video/davinci/vpfe_capture.c
+++ b/drivers/media/video/davinci/vpfe_capture.c
@@ -1547,7 +1547,7 @@ static int vpfe_reqbufs(struct file *file, void *priv,
vpfe_dev-memory = req_buf-memory;
videobuf_queue_dma_contig_init(vpfe_dev-buffer_queue,
vpfe_videobuf_qops,
-   NULL,
+   vpfe_dev-pdev,
vpfe_dev-irqlock,
req_buf-type,
vpfe_dev-fmt.fmt.pix.field,
-- 
1.6.2.4

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/6] Davinci VPFE Capture: Take i2c adapter id through platform data

2009-10-13 Thread hvaibhav
From: Vaibhav Hiremath hvaib...@ti.com

The I2C adapter ID is actually depends on Board and may vary, Davinci
uses id=1, but in case of AM3517 id=3.

Signed-off-by: Vaibhav Hiremath hvaib...@ti.com
---
 drivers/media/video/davinci/vpfe_capture.c |3 +--
 include/media/davinci/vpfe_capture.h   |2 ++
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/media/video/davinci/vpfe_capture.c 
b/drivers/media/video/davinci/vpfe_capture.c
index dc32de0..c3c37e7 100644
--- a/drivers/media/video/davinci/vpfe_capture.c
+++ b/drivers/media/video/davinci/vpfe_capture.c
@@ -2228,8 +2228,7 @@ static __init int vpfe_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, vpfe_dev);
/* set driver private data */
video_set_drvdata(vpfe_dev-video_dev, vpfe_dev);
-   i2c_adap = i2c_get_adapter(1);
-   vpfe_cfg = pdev-dev.platform_data;
+   i2c_adap = i2c_get_adapter(vpfe_cfg-i2c_adapter_id);
num_subdevs = vpfe_cfg-num_subdevs;
vpfe_dev-sd = kmalloc(sizeof(struct v4l2_subdev *) * num_subdevs,
GFP_KERNEL);
diff --git a/include/media/davinci/vpfe_capture.h 
b/include/media/davinci/vpfe_capture.h
index e8272d1..f610104 100644
--- a/include/media/davinci/vpfe_capture.h
+++ b/include/media/davinci/vpfe_capture.h
@@ -94,6 +94,8 @@ struct vpfe_subdev_info {
 struct vpfe_config {
/* Number of sub devices connected to vpfe */
int num_subdevs;
+   /*I2c Bus adapter no*/
+   int i2c_adapter_id;
/* information about each subdev */
struct vpfe_subdev_info *sub_devs;
/* evm card info */
-- 
1.6.2.4

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 3/6] Davinci VPFE Capture: Take i2c adapter id through platform data

2009-10-13 Thread hvaibhav
From: Vaibhav Hiremath hvaib...@ti.com

The I2C adapter ID is actually depends on Board and may vary, Davinci
uses id=1, but in case of AM3517 id=3.

So modified respective davinci board files.

Signed-off-by: Vaibhav Hiremath hvaib...@ti.com
---
 arch/arm/mach-davinci/board-dm355-evm.c  |1 +
 arch/arm/mach-davinci/board-dm644x-evm.c |1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-davinci/board-dm355-evm.c 
b/arch/arm/mach-davinci/board-dm355-evm.c
index f683559..4a9252a 100644
--- a/arch/arm/mach-davinci/board-dm355-evm.c
+++ b/arch/arm/mach-davinci/board-dm355-evm.c
@@ -372,6 +372,7 @@ static struct vpfe_subdev_info vpfe_sub_devs[] = {
 
 static struct vpfe_config vpfe_cfg = {
.num_subdevs = ARRAY_SIZE(vpfe_sub_devs),
+   .i2c_adapter_id = 1,
.sub_devs = vpfe_sub_devs,
.card_name = DM355 EVM,
.ccdc = DM355 CCDC,
diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c 
b/arch/arm/mach-davinci/board-dm644x-evm.c
index cfd9afa..fed64e2 100644
--- a/arch/arm/mach-davinci/board-dm644x-evm.c
+++ b/arch/arm/mach-davinci/board-dm644x-evm.c
@@ -257,6 +257,7 @@ static struct vpfe_subdev_info vpfe_sub_devs[] = {
 
 static struct vpfe_config vpfe_cfg = {
.num_subdevs = ARRAY_SIZE(vpfe_sub_devs),
+   .i2c_adapter_id = 1,
.sub_devs = vpfe_sub_devs,
.card_name = DM6446 EVM,
.ccdc = DM6446 CCDC,
-- 
1.6.2.4

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 4/6] Davinci VPFE Capture:Replaced IRQ_VDINT1 with vpfe_dev-ccdc_irq1

2009-10-13 Thread hvaibhav
From: Vaibhav Hiremath hvaib...@ti.com

Signed-off-by: Vaibhav Hiremath hvaib...@ti.com
---
 drivers/media/video/davinci/vpfe_capture.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/media/video/davinci/vpfe_capture.c 
b/drivers/media/video/davinci/vpfe_capture.c
index c3c37e7..abe21e4 100644
--- a/drivers/media/video/davinci/vpfe_capture.c
+++ b/drivers/media/video/davinci/vpfe_capture.c
@@ -752,7 +752,7 @@ static void vpfe_detach_irq(struct vpfe_device *vpfe_dev)
 
frame_format = ccdc_dev-hw_ops.get_frame_format();
if (frame_format == CCDC_FRMFMT_PROGRESSIVE)
-   free_irq(IRQ_VDINT1, vpfe_dev);
+   free_irq(vpfe_dev-ccdc_irq1, vpfe_dev);
 }
 
 static int vpfe_attach_irq(struct vpfe_device *vpfe_dev)
-- 
1.6.2.4

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 5/6] Davinci VPFE Capture: Add support for Control ioctls

2009-10-13 Thread hvaibhav
From: Vaibhav Hiremath hvaib...@ti.com

Added support for Control IOCTL,
- s_ctrl
- g_ctrl
- queryctrl

Signed-off-by: Vaibhav Hiremath hvaib...@ti.com
---
 drivers/media/video/davinci/vpfe_capture.c |   43 
 1 files changed, 43 insertions(+), 0 deletions(-)

diff --git a/drivers/media/video/davinci/vpfe_capture.c 
b/drivers/media/video/davinci/vpfe_capture.c
index abe21e4..f77d99b 100644
--- a/drivers/media/video/davinci/vpfe_capture.c
+++ b/drivers/media/video/davinci/vpfe_capture.c
@@ -1368,6 +1368,46 @@ static int vpfe_g_std(struct file *file, void *priv, 
v4l2_std_id *std_id)
return 0;
 }
 
+static int vpfe_queryctrl(struct file *file, void *priv,
+   struct v4l2_queryctrl *qctrl)
+{
+   struct vpfe_device *vpfe_dev = video_drvdata(file);
+   struct vpfe_subdev_info *sdinfo;
+   int ret = 0;
+
+   sdinfo = vpfe_dev-current_subdev;
+
+   ret = v4l2_device_call_until_err(vpfe_dev-v4l2_dev, sdinfo-grp_id,
+core, queryctrl, qctrl);
+
+   if (ret)
+   qctrl-flags |= V4L2_CTRL_FLAG_DISABLED;
+
+   return 0;
+}
+
+static int vpfe_g_ctrl(struct file *file, void *priv, struct v4l2_control 
*ctrl)
+{
+   struct vpfe_device *vpfe_dev = video_drvdata(file);
+   struct vpfe_subdev_info *sdinfo;
+
+   sdinfo = vpfe_dev-current_subdev;
+
+   return v4l2_device_call_until_err(vpfe_dev-v4l2_dev, sdinfo-grp_id,
+core, g_ctrl, ctrl);
+}
+
+static int vpfe_s_ctrl(struct file *file, void *priv, struct v4l2_control 
*ctrl)
+{
+   struct vpfe_device *vpfe_dev = video_drvdata(file);
+   struct vpfe_subdev_info *sdinfo;
+
+   sdinfo = vpfe_dev-current_subdev;
+
+   return v4l2_device_call_until_err(vpfe_dev-v4l2_dev, sdinfo-grp_id,
+core, s_ctrl, ctrl);
+}
+
 /*
  *  Videobuf operations
  */
@@ -1939,6 +1979,9 @@ static const struct v4l2_ioctl_ops vpfe_ioctl_ops = {
.vidioc_querystd = vpfe_querystd,
.vidioc_s_std= vpfe_s_std,
.vidioc_g_std= vpfe_g_std,
+   .vidioc_queryctrl= vpfe_queryctrl,
+   .vidioc_g_ctrl   = vpfe_g_ctrl,
+   .vidioc_s_ctrl   = vpfe_s_ctrl,
.vidioc_reqbufs  = vpfe_reqbufs,
.vidioc_querybuf = vpfe_querybuf,
.vidioc_qbuf = vpfe_qbuf,
-- 
1.6.2.4

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 6/6] TVP514x:Switch to automode for s_input/querystd

2009-10-13 Thread hvaibhav
From: Vaibhav Hiremath hvaib...@ti.com

Driver should switch to AutoSwitch mode on S_INPUT and QUERYSTD ioctls.
It has been observed that, if user configure the standard explicitely
then driver preserves the old settings.

Reviewed by: Vaibhav Hiremath hvaib...@ti.com
Signed-off-by: Brijesh Jadav brijes...@ti.com
---
 drivers/media/video/tvp514x.c |   17 +
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/drivers/media/video/tvp514x.c b/drivers/media/video/tvp514x.c
index 2443726..0b0412d 100644
--- a/drivers/media/video/tvp514x.c
+++ b/drivers/media/video/tvp514x.c
@@ -523,10 +523,18 @@ static int tvp514x_querystd(struct v4l2_subdev *sd, 
v4l2_std_id *std_id)
enum tvp514x_std current_std;
enum tvp514x_input input_sel;
u8 sync_lock_status, lock_mask;
+   int err;

if (std_id == NULL)
return -EINVAL;

+   err = tvp514x_write_reg(sd, REG_VIDEO_STD,
+   VIDEO_STD_AUTO_SWITCH_BIT);
+   if (err  0)
+   return err;
+
+   msleep(LOCK_RETRY_DELAY);
+
/* get the current standard */
current_std = tvp514x_get_current_std(sd);
if (current_std == STD_INVALID)
@@ -643,6 +651,15 @@ static int tvp514x_s_routing(struct v4l2_subdev *sd,
/* Index out of bound */
return -EINVAL;

+   /* Since this api is goint to detect the input, it is required
+  to set the standard in the auto switch mode */
+   err = tvp514x_write_reg(sd, REG_VIDEO_STD,
+   VIDEO_STD_AUTO_SWITCH_BIT);
+   if (err  0)
+   return err;
+
+   msleep(LOCK_RETRY_DELAY);
+
input_sel = input;
output_sel = output;

--
1.6.2.4

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


TVP514x: Migration to sub-device framework

2009-04-30 Thread hvaibhav
From: Vaibhav Hiremath hvaib...@ti.com

This is first version of sub-device framework based
TVP514x decoder driver. Earlier version of TVP514x driver is based
on V4L2-int framework.

Initial version reviewed by Hans Verkuil.

NOTE: Please note that this patch has not been tested on any board,
  only compilation/build tested.

I will consolidate all the review comments and will incorporate
in the next version, which should also be include validation
of these changes on any of the supported boards.

TODO:
- Add support for some basic video/core functionality like,
.g_chip_ident
.reset
.g_input_status
- Migration master driver to validate this driver.
- validate on Davinci and OMAP boards.

Signed-off-by: Brijesh Jadav brijes...@ti.com
Signed-off-by: Hardik Shah hardik.s...@ti.com
Signed-off-by: Vaibhav Hiremath hvaib...@ti.com
---
 drivers/media/video/tvp514x.c  |  787 ++--
 drivers/media/video/tvp514x_regs.h |   10 -
 include/media/tvp514x.h|4 -
 3 files changed, 310 insertions(+), 491 deletions(-)

diff --git a/drivers/media/video/tvp514x.c b/drivers/media/video/tvp514x.c
index 4262e60..d42cef2 100644
--- a/drivers/media/video/tvp514x.c
+++ b/drivers/media/video/tvp514x.c
@@ -31,7 +31,10 @@
 #include linux/i2c.h
 #include linux/delay.h
 #include linux/videodev2.h
-#include media/v4l2-int-device.h
+#include media/v4l2-device.h
+#include media/v4l2-common.h
+#include media/v4l2-chip-ident.h
+#include media/v4l2-i2c-drv.h
 #include media/tvp514x.h

 #include tvp514x_regs.h
@@ -49,10 +52,10 @@ static int debug;
 module_param(debug, bool, 0644);
 MODULE_PARM_DESC(debug, Debug level (0-1));

-#define dump_reg(client, reg, val) \
+#define dump_reg(sd, reg, val) \
do {\
-   val = tvp514x_read_reg(client, reg);\
-   v4l_info(client, Reg(0x%.2X): 0x%.2X\n, reg, val); \
+   val = tvp514x_read_reg(sd, reg);\
+   v4l2_info(sd, Reg(0x%.2X): 0x%.2X\n, reg, val); \
} while (0)

 /**
@@ -65,14 +68,6 @@ enum tvp514x_std {
 };

 /**
- * enum tvp514x_state - enum for different decoder states
- */
-enum tvp514x_state {
-   STATE_NOT_DETECTED,
-   STATE_DETECTED
-};
-
-/**
  * struct tvp514x_std_info - Structure to store standard informations
  * @width: Line width in pixels
  * @height:Number of active lines
@@ -89,33 +84,27 @@ struct tvp514x_std_info {
 static struct tvp514x_reg tvp514x_reg_list_default[0x40];
 /**
  * struct tvp514x_decoder - TVP5146/47 decoder object
- * @v4l2_int_device: Slave handle
- * @tvp514x_slave: Slave pointer which is used by @v4l2_int_device
+ * @sd: Subdevice Slave handle
  * @tvp514x_regs: copy of hw's regs with preset values.
  * @pdata: Board specific
- * @client: I2C client data
- * @id: Entry from I2C table
  * @ver: Chip version
- * @state: TVP5146/47 decoder state - detected or not-detected
+ * @state: TVP5146/47 decoder state - enabled or disabled.
  * @pix: Current pixel format
  * @num_fmts: Number of formats
  * @fmt_list: Format list
  * @current_std: Current standard
  * @num_stds: Number of standards
  * @std_list: Standards list
- * @route: input and output routing at chip level
+ * @input: Input routing at chip level
+ * @output: Output routing at chip level
  */
 struct tvp514x_decoder {
-   struct v4l2_int_device v4l2_int_device;
-   struct v4l2_int_slave tvp514x_slave;
+   struct v4l2_subdev sd;
struct tvp514x_reg tvp514x_regs[ARRAY_SIZE(tvp514x_reg_list_default)];
const struct tvp514x_platform_data *pdata;
-   struct i2c_client *client;
-
-   struct i2c_device_id *id;

int ver;
-   enum tvp514x_state state;
+   int state;

struct v4l2_pix_format pix;
int num_fmts;
@@ -124,8 +113,11 @@ struct tvp514x_decoder {
enum tvp514x_std current_std;
int num_stds;
struct tvp514x_std_info *std_list;
-
-   struct v4l2_routing route;
+   /*
+* Input and Output Routing parameters
+*/
+   unsigned int input;
+   unsigned int output;
 };

 /* TVP514x default register values */
@@ -240,35 +232,22 @@ static struct tvp514x_std_info tvp514x_std_list[] = {
},
/* Standard: need to add for additional standard */
 };
-/*
- * Control structure for Auto Gain
- * This is temporary data, will get replaced once
- * v4l2_ctrl_query_fill supports it.
- */
-static const struct v4l2_queryctrl tvp514x_autogain_ctrl = {
-   .id = V4L2_CID_AUTOGAIN,
-   .name = Gain, Automatic,
-   .type = V4L2_CTRL_TYPE_BOOLEAN,
-   .minimum = 0,
-   .maximum = 1,
-   .step = 1,
-   .default_value = 1,
-};

 /*
  * Read a value from a register in an TVP5146/47 decoder device.
  * Returns value read if successful, or non-zero (-1) otherwise.
  */
-static int 

[PATCH 2/2 (V3)] OMAP3EVM Multi-Media Daughter Card Support

2009-03-19 Thread hvaibhav
From: Vaibhav Hiremath hvaib...@ti.com

This is Third version of OMAP3EVM Mulit-Media Daughter
Card support.

NOTE: Please note that, hence forth I will try to avoid submitting
  patches on top of V4L2-int framework. The next immediate activity
  would be migration to sub-device framework.

Fixes:
- Refreshed with Latest ISP-Camera patches
- Comments from 'Tony Lindgren'
- Comments from 'Alexey Klimov'
TODO:
- Need to migrate along with OMAP3-Camera
Tested:
- TVP5146 (BT656) decoder interface on top of
  Sakari's Git tree.
  http://git.gitorious.org/omap3camera/mainline.git

- Capturing the frame to file and validate

Signed-off-by: Brijesh Jadav brijes...@ti.com
Signed-off-by: Hardik Shah hardik.s...@ti.com
Signed-off-by: Vaibhav Hiremath hvaib...@ti.com
---
 arch/arm/mach-omap2/Kconfig   |8 +-
 arch/arm/mach-omap2/Makefile  |1 +
 arch/arm/mach-omap2/board-omap3evm-mmdc-v4l.c |  351 +
 arch/arm/mach-omap2/board-omap3evm-mmdc.h |   42 +++
 4 files changed, 401 insertions(+), 1 deletions(-)
 create mode 100644 arch/arm/mach-omap2/board-omap3evm-mmdc-v4l.c
 create mode 100644 arch/arm/mach-omap2/board-omap3evm-mmdc.h

diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index 8fa650d..8dadf2a 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -113,7 +113,7 @@ config MACH_OMAP_LDP
bool OMAP3 LDP board
depends on ARCH_OMAP3  ARCH_OMAP34XX

-config MACH_OMAP2EVM
+config MACH_OMAP2EVM
bool OMAP 2530 EVM board
depends on ARCH_OMAP2  ARCH_OMAP24XX

@@ -125,6 +125,12 @@ config MACH_OMAP3EVM
bool OMAP 3530 EVM board
depends on ARCH_OMAP3  ARCH_OMAP34XX

+config MACH_OMAP3EVM_MMDC
+   bool OMAP 3530 EVM Multi-Media Daughter Card board
+   depends on MACH_OMAP3EVM
+   help
+ Set this if you've got a Multi-Media Daughter Card board.
+
 config MACH_OMAP3_BEAGLE
bool OMAP3 BEAGLE board
depends on ARCH_OMAP3  ARCH_OMAP34XX
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 33b5aa8..715d0e4 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -58,6 +58,7 @@ obj-$(CONFIG_MACH_OMAP3EVM)   += board-omap3evm.o \
   mmc-twl4030.o \
   board-omap3evm-flash.o \
   twl4030-generic-scripts.o
+obj-$(CONFIG_MACH_OMAP3EVM_MMDC)   += board-omap3evm-mmdc-v4l.o
 obj-$(CONFIG_MACH_OMAP3_BEAGLE)+= board-omap3beagle.o \
   mmc-twl4030.o \
   twl4030-generic-scripts.o
diff --git a/arch/arm/mach-omap2/board-omap3evm-mmdc-v4l.c 
b/arch/arm/mach-omap2/board-omap3evm-mmdc-v4l.c
new file mode 100644
index 000..c00a731
--- /dev/null
+++ b/arch/arm/mach-omap2/board-omap3evm-mmdc-v4l.c
@@ -0,0 +1,351 @@
+/*
+ * arch/arm/mach-omap2/board-omap3evm-mmdc-v4l.c
+ *
+ * Driver for OMAP3 EVM Multi Media Daughter Card
+ *
+ * Copyright (C) 2008 Texas Instruments Inc
+ * Author: Vaibhav Hiremath hvaib...@ti.com
+ *
+ * Contributors:
+ * Anuj Aggarwal anuj.aggar...@ti.com
+ * Sivaraj R siva...@ti.com
+ *
+ * This package 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.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+
+#include linux/init.h
+#include linux/i2c.h
+#include linux/gpio.h
+#include linux/videodev2.h
+
+#include mach/mux.h
+
+#include media/v4l2-int-device.h
+#include media/tvp514x.h
+
+/* Include V4L2 ISP-Camera driver related header file */
+#include ../drivers/media/video/omap34xxcam.h
+#include ../drivers/media/video/isp/ispreg.h
+
+#include board-omap3evm-mmdc.h
+
+#define MODULE_NAMEomap3evm-mmdc
+
+/* Macro Definitions */
+
+/* GPIO pins */
+#define GPIO134_SEL_TVP_Y  (134)
+#define GPIO54_SEL_EXP_CAM (54)
+#define GPIO136_SEL_CAM(136)
+
+/* board internal information (BEGIN) */
+
+/* I2C bus to which all I2C slave devices are attached */
+#define BOARD_I2C_BUSNUM   (3)
+
+/* I2C address of chips present in board */
+#define TVP5146_I2C_ADDR   (0x5D)
+
+#if defined(CONFIG_VIDEO_TVP514X) || defined(CONFIG_VIDEO_TVP514X_MODULE)
+#if defined(CONFIG_VIDEO_OMAP3) || 

[PATCH 1/2] Pad configuration for OMAP3EVM Multi-Media Daughter Card Support

2009-01-29 Thread hvaibhav
From: Vaibhav Hiremath hvaib...@ti.com

On OMAP3EVM Mass Market Daugher Card following GPIO pins are being
used -

GPIO134 -- Enable/Disable TVP5146 interface
GPIO54 -- Enable/Disable Expansion Camera interface
GPIO136 -- Enable/Disable Camera (Sensor) interface

Added entry for the above GPIO's in mux.c and mux.h file

Signed-off-by: Brijesh Jadav brijes...@ti.com
Signed-off-by: Hardik Shah hardik.s...@ti.com
Signed-off-by: Vaibhav Hiremath hvaib...@ti.com
---
 arch/arm/mach-omap2/mux.c |6 ++
 arch/arm/plat-omap/include/mach/mux.h |5 -
 2 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap2/mux.c b/arch/arm/mach-omap2/mux.c
index 1556688..d226d81 100644
--- a/arch/arm/mach-omap2/mux.c
+++ b/arch/arm/mach-omap2/mux.c
@@ -471,6 +471,12 @@ MUX_CFG_34XX(AF5_34XX_GPIO142, 0x170,
OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_OUTPUT)
 MUX_CFG_34XX(AE5_34XX_GPIO143, 0x172,
OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_OUTPUT)
+MUX_CFG_34XX(AG4_34XX_GPIO134, 0x160,
+   OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_OUTPUT)
+MUX_CFG_34XX(U8_34XX_GPIO54, 0x0b4,
+   OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_OUTPUT)
+MUX_CFG_34XX(AE4_34XX_GPIO136, 0x164,
+   OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_OUTPUT)

 };

diff --git a/arch/arm/plat-omap/include/mach/mux.h 
b/arch/arm/plat-omap/include/mach/mux.h
index 67fddec..ace037f 100644
--- a/arch/arm/plat-omap/include/mach/mux.h
+++ b/arch/arm/plat-omap/include/mach/mux.h
@@ -795,7 +795,10 @@ enum omap34xx_index {
AF6_34XX_GPIO140_UP,
AE6_34XX_GPIO141,
AF5_34XX_GPIO142,
-   AE5_34XX_GPIO143
+   AE5_34XX_GPIO143,
+   AG4_34XX_GPIO134,
+   U8_34XX_GPIO54,
+   AE4_34XX_GPIO136,
 };

 struct omap_mux_cfg {
--
1.5.6

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[REVIEW PATCH 1/2] OMAP3 ISP-Camera: Added BT656 support

2009-01-06 Thread hvaibhav
From: Vaibhav Hiremath hvaib...@ti.com

Support for BT656 through TVP5146 decoder, works on top of
ISP-Camera patches posted by Sergio on 12th Dec 2008.

The TVP514x driver patch has been accepted under V4L, will
be part of O-L in the next merge window. As of now you can
access the patches from -

http://markmail.org/search/?q=TVP514x#query:TVP514x%20from%3A%22Hiremath%2C%20Vaibhav%22%20extension%3Apatch+page:1+mid:b5pcj3sriwknm2cv+state:results

ToDO List:
- Add support for scaling and cropping

Signed-off-by: Brijesh Jadav brijes...@ti.com
Signed-off-by: Hardik Shah hardik.s...@ti.com
Signed-off-by: Manjunath Hadli m...@ti.com
Signed-off-by: R Sivaraj siva...@ti.com
Signed-off-by: Vaibhav Hiremath hvaib...@ti.com
---
 drivers/media/video/isp/isp.c |  118 ---
 drivers/media/video/isp/isp.h |7 +-
 drivers/media/video/isp/ispccdc.c |  146 +++
 drivers/media/video/isp/ispccdc.h |9 ++
 drivers/media/video/omap34xxcam.c |  197 +
 drivers/media/video/omap34xxcam.h |5 +
 6 files changed, 428 insertions(+), 54 deletions(-)
 mode change 100644 = 100755 drivers/media/video/isp/isp.c
 mode change 100644 = 100755 drivers/media/video/omap34xxcam.c

diff --git a/drivers/media/video/isp/isp.c b/drivers/media/video/isp/isp.c
old mode 100644
new mode 100755
index 92a415c..87d85dd
--- a/drivers/media/video/isp/isp.c
+++ b/drivers/media/video/isp/isp.c
@@ -191,6 +191,7 @@ struct isp_sgdma ispsg;
  * @resizer_input_height: ISP Resizer module input image height.
  * @resizer_output_width: ISP Resizer module output image width.
  * @resizer_output_height: ISP Resizer module output image height.
+ * @current_field: Current field for interlaced capture.
  */
 struct ispmodule {
unsigned int isp_pipeline;
@@ -209,6 +210,7 @@ struct ispmodule {
unsigned int resizer_input_height;
unsigned int resizer_output_width;
unsigned int resizer_output_height;
+   int current_field;
 };

 static struct ispmodule ispmodule_obj = {
@@ -224,11 +226,14 @@ static struct ispmodule ispmodule_obj = {
.colorspace = V4L2_COLORSPACE_JPEG,
.priv = 0,
},
+   .current_field = 0,
 };

 /* Structure for saving/restoring ISP module registers */
 static struct isp_reg isp_reg_list[] = {
{ISP_SYSCONFIG, 0},
+   {ISP_IRQ0ENABLE, 0},
+   {ISP_IRQ1ENABLE, 0},
{ISP_TCTRL_GRESET_LENGTH, 0},
{ISP_TCTRL_PSTRB_REPLAY, 0},
{ISP_CTRL, 0},
@@ -550,6 +555,11 @@ EXPORT_SYMBOL(isp_unset_callback);
  **/
 int isp_request_interface(enum isp_interface_type if_t)
 {
+   enum isp_interface_type temp_if_t = if_t;
+
+   if (if_t == ISP_PARLL_YUV_BT)
+   if_t = ISP_PARLL;
+
if (isp_obj.if_status  if_t) {
DPRINTK_ISPCTRL(ISP_ERR : Requested Interface already \
allocated\n);
@@ -569,7 +579,7 @@ int isp_request_interface(enum isp_interface_type if_t)
((isp_obj.if_status == ISP_CSIB) 
(if_t == ISP_CSIA)) ||
(isp_obj.if_status == 0)) {
-   isp_obj.if_status |= if_t;
+   isp_obj.if_status |= (if_t | temp_if_t);
return 0;
} else {
DPRINTK_ISPCTRL(ISP_ERR : Invalid Combination Serial- \
@@ -587,6 +597,9 @@ EXPORT_SYMBOL(isp_request_interface);
  **/
 int isp_free_interface(enum isp_interface_type if_t)
 {
+   if ((if_t == ISP_PARLL) || (if_t == ISP_PARLL_YUV_BT))
+   if_t |= (ISP_PARLL | ISP_PARLL_YUV_BT);
+
isp_obj.if_status = ~if_t;
return 0;
 }
@@ -888,6 +901,7 @@ int isp_configure_interface(struct isp_interface_config 
*config)
ispctrl_val = (ISPCTRL_PAR_SER_CLK_SEL_MASK);
switch (config-ccdc_par_ser) {
case ISP_PARLL:
+   case ISP_PARLL_YUV_BT:
ispctrl_val |= ISPCTRL_PAR_SER_CLK_SEL_PARALLEL;
ispctrl_val |= (config-u.par.par_clk_pol
 ISPCTRL_PAR_CLK_POL_SHIFT);
@@ -1122,6 +1136,11 @@ out:
omap_writel(irqstatus, ISP_IRQ0STATUS);
spin_unlock_irqrestore(isp_obj.lock, irqflags);

+   /* TODO: Workaround suggested by Tony for spurious
+* interrupt issue
+   */
+   irqstatus = omap_readl(ISP_IRQ0STATUS);
+
if (is_irqhandled)
return IRQ_HANDLED;
else
@@ -1345,9 +1364,14 @@ u32 isp_calc_pipeline(struct v4l2_pix_format *pix_input,
ispccdc_request();
if (pix_input-pixelformat == V4L2_PIX_FMT_SGRBG10)
ispccdc_config_datapath(CCDC_RAW, CCDC_OTHERS_VP_MEM);
-   else
-   ispccdc_config_datapath(CCDC_YUV_SYNC,
-   CCDC_OTHERS_MEM);
+   else {
+   if (isp_obj.if_status  

[REVIEW PATCH 2/2] Added OMAP3EVM Multi-Media Daughter Card Support

2009-01-06 Thread hvaibhav
From: Vaibhav Hiremath hvaib...@ti.com

This is first version of OMAP3EVM Mulit-Media Daughter
Card support.

Tested:
- TVP5146 (BT656) decoder interface on top of
  Sergio's ISP-Camera patches.
- Loopback application, capturing image through TVP5146
  and displaying it onto the TV/LCD on top of Hardik's
  V4L2 driver.
- Basic functionality of HSUSB Transceiver USB-83320
-

TODO:
- Camera sensor support
- Driver header file inclusion (dependency on ISP-Camera patches)
- Some more clean-up may required.

Signed-off-by: Brijesh Jadav brijes...@ti.com
Signed-off-by: Hardik Shah hardik.s...@ti.com
Signed-off-by: Manjunath Hadli m...@ti.com
Signed-off-by: R Sivaraj siva...@ti.com
Signed-off-by: Vaibhav Hiremath hvaib...@ti.com
---
 arch/arm/mach-omap2/Kconfig |4 +
 arch/arm/mach-omap2/Makefile|1 +
 arch/arm/mach-omap2/board-omap3evm-dc.c |  417 +++
 arch/arm/mach-omap2/board-omap3evm-dc.h |   43 
 arch/arm/mach-omap2/mux.c   |7 +
 arch/arm/plat-omap/include/mach/mux.h   |4 +
 6 files changed, 476 insertions(+), 0 deletions(-)
 mode change 100644 = 100755 arch/arm/mach-omap2/Kconfig
 mode change 100644 = 100755 arch/arm/mach-omap2/Makefile
 create mode 100755 arch/arm/mach-omap2/board-omap3evm-dc.c
 create mode 100755 arch/arm/mach-omap2/board-omap3evm-dc.h
 mode change 100644 = 100755 arch/arm/mach-omap2/mux.c
 mode change 100644 = 100755 arch/arm/plat-omap/include/mach/mux.h

diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
old mode 100644
new mode 100755
index ca24a7a..094c97f
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -121,6 +121,10 @@ config MACH_OMAP3EVM
bool OMAP 3530 EVM board
depends on ARCH_OMAP3  ARCH_OMAP34XX

+config MACH_OMAP3EVM_DC
+   bool OMAP 3530 EVM daughter card board
+   depends on ARCH_OMAP3  ARCH_OMAP34XX  MACH_OMAP3EVM
+
 config MACH_OMAP3_BEAGLE
bool OMAP3 BEAGLE board
depends on ARCH_OMAP3  ARCH_OMAP34XX
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
old mode 100644
new mode 100755
index 3897347..16fa35a
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -60,6 +60,7 @@ obj-$(CONFIG_MACH_OMAP3EVM)   += board-omap3evm.o \
   usb-musb.o usb-ehci.o \
   board-omap3evm-flash.o \
   twl4030-generic-scripts.o
+obj-$(CONFIG_MACH_OMAP3EVM_DC) += board-omap3evm-dc.o
 obj-$(CONFIG_MACH_OMAP3_BEAGLE)+= board-omap3beagle.o \
   usb-musb.o usb-ehci.o \
   mmc-twl4030.o \
diff --git a/arch/arm/mach-omap2/board-omap3evm-dc.c 
b/arch/arm/mach-omap2/board-omap3evm-dc.c
new file mode 100755
index 000..233c219
--- /dev/null
+++ b/arch/arm/mach-omap2/board-omap3evm-dc.c
@@ -0,0 +1,417 @@
+/*
+ * arch/arm/mach-omap2/board-omap3evm-dc.c
+ *
+ * Driver for OMAP3 EVM Daughter Card
+ *
+ * Copyright (C) 2008 Texas Instruments Inc
+ * Author: Vaibhav Hiremath hvaib...@ti.com
+ *
+ * Contributors:
+ * Anuj Aggarwal anuj.aggar...@ti.com
+ * Sivaraj R siva...@ti.com
+ *
+ * This package 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.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+
+#include linux/module.h
+#include linux/kernel_stat.h
+#include linux/init.h
+#include linux/i2c.h
+#include linux/delay.h
+#include linux/spinlock.h
+#include linux/clk.h
+#include linux/device.h
+#include linux/io.h
+#include linux/gpio.h
+
+#include mach/io.h
+#include mach/mux.h
+
+#if defined(CONFIG_VIDEO_TVP514X) || defined(CONFIG_VIDEO_TVP514X_MODULE)
+#include linux/videodev2.h
+#include media/v4l2-int-device.h
+#include media/tvp514x.h
+/* include V4L2 camera driver related header file */
+#if defined(CONFIG_VIDEO_OMAP3) || defined(CONFIG_VIDEO_OMAP3_MODULE)
+#include ../drivers/media/video/omap34xxcam.h
+#include ../drivers/media/video/isp/ispreg.h
+#endif /* #ifdef CONFIG_VIDEO_OMAP3 */
+#endif /* #ifdef CONFIG_VIDEO_TVP514X*/
+
+#include board-omap3evm-dc.h
+
+#define MODULE_NAMEomap3evmdc
+
+#ifdef DEBUG
+#define dprintk(fmt, args...) printk(KERN_ERR MODULE_NAME :  fmt, ## args)
+#else
+#define dprintk(fmt, args...)
+#endif