[GIT PATCHES FOR 2.6.35] gspca for_2.6.35

2010-05-18 Thread Jean-Francois Moine
Hi Mauro,

I removed the patch from Sarah Sharp.

The following changes since commit
4fcfa8824391ef0f9cff82122067f31c6d920921:

  V4L/DVB: vivi and mem2mem_testdev need slab.h to build (2010-05-12
  02:17:35 -0300)

are available in the git repository at:
  git://linuxtv.org/jfrancois/gspca.git for_2.6.35

Jean-François Moine (2):
  gspca - sonixb: Have 0c45:602e handled by sonixb instead of
sn9c102.
  gspca - sonixj: Add information about some potential JPEG
webcams.

Warren Bosworth Focke (1):
  gspca - sonixj: Add webcam 0c45:60ce.

 Documentation/video4linux/gspca.txt|1 +
 drivers/media/video/gspca/sonixb.c |2 --
 drivers/media/video/gspca/sonixj.c |5 -
 drivers/media/video/sn9c102/sn9c102_devtable.h |2 +-
 4 files changed, 6 insertions(+), 4 deletions(-)

Thanks.

-- 
Ken ar c'hentañ | ** Breizh ha Linux atav! **
Jef |   http://moinejf.free.fr/
--
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] tm6000, reset I2C bus function

2010-05-18 Thread Dmitri Belimov
Hi

Add new function for reset I2C bus. Rework some code for use this function.

diff -r 8f5129efe974 linux/drivers/staging/tm6000/tm6000-cards.c
--- a/linux/drivers/staging/tm6000/tm6000-cards.c   Sun May 16 18:48:01 
2010 -0300
+++ b/linux/drivers/staging/tm6000/tm6000-cards.c   Tue May 18 11:14:55 
2010 +1000
@@ -378,13 +378,7 @@
tm6000_set_reg(dev, REQ_04_EN_DISABLE_MCU_INT,
0x02, arg);
msleep(10);
-   rc = tm6000_set_reg(dev, REQ_03_SET_GET_MCU_PIN,
-   TM6000_GPIO_CLK, 0);
-   if (rc  0)
-   return rc;
-   msleep(10);
-   rc = tm6000_set_reg(dev, REQ_03_SET_GET_MCU_PIN,
-   TM6000_GPIO_CLK, 1);
+   rc = tm6000_i2c_reset(dev, 10);
break;
case XC2028_TUNER_RESET:
/* Reset codes during load firmware */
@@ -438,14 +432,7 @@
break;
 
case 2:
-   rc = tm6000_set_reg(dev, REQ_03_SET_GET_MCU_PIN,
-   TM6000_GPIO_CLK, 0);
-   if (rc  0)
-   return rc;
-   msleep(100);
-   rc = tm6000_set_reg(dev, REQ_03_SET_GET_MCU_PIN,
-   TM6000_GPIO_CLK, 1);
-   msleep(100);
+   rc = tm6000_i2c_reset(dev, 100);
break;
}
}
diff -r 8f5129efe974 linux/drivers/staging/tm6000/tm6000-core.c
--- a/linux/drivers/staging/tm6000/tm6000-core.cSun May 16 18:48:01 
2010 -0300
+++ b/linux/drivers/staging/tm6000/tm6000-core.cTue May 18 11:14:55 
2010 +1000
@@ -156,6 +156,22 @@
return rc;
 
return buf[3] | buf[2]  8 | buf[1]  16 | buf[0]  24;
+}
+
+int tm6000_i2c_reset(struct tm6000_core *dev, u16 tsleep)
+{
+   int rc;
+
+   rc = tm6000_set_reg(dev, REQ_03_SET_GET_MCU_PIN, TM6000_GPIO_CLK, 0);
+   if (rc  0)
+   return rc;
+
+   msleep(tsleep);
+
+   rc = tm6000_set_reg(dev, REQ_03_SET_GET_MCU_PIN, TM6000_GPIO_CLK, 1);
+   msleep(tsleep);
+
+   return rc;
 }
 
 void tm6000_set_fourcc_format(struct tm6000_core *dev)
diff -r 8f5129efe974 linux/drivers/staging/tm6000/tm6000.h
--- a/linux/drivers/staging/tm6000/tm6000.h Sun May 16 18:48:01 2010 -0300
+++ b/linux/drivers/staging/tm6000/tm6000.h Tue May 18 11:14:55 2010 +1000
@@ -241,6 +241,8 @@
 int tm6000_get_reg16(struct tm6000_core *dev, u8 req, u16 value, u16 index);
 int tm6000_get_reg32(struct tm6000_core *dev, u8 req, u16 value, u16 index);
 int tm6000_set_reg (struct tm6000_core *dev, u8 req, u16 value, u16 index);
+int tm6000_i2c_reset(struct tm6000_core *dev, u16 tsleep);
+
 int tm6000_init (struct tm6000_core *dev);
 
 int tm6000_init_analog_mode (struct tm6000_core *dev);

Signed-off-by: Beholder Intl. Ltd. Dmitry Belimov d.beli...@gmail.com


With my best regards, Dmitry.
diff -r 8f5129efe974 linux/drivers/staging/tm6000/tm6000-cards.c
--- a/linux/drivers/staging/tm6000/tm6000-cards.c	Sun May 16 18:48:01 2010 -0300
+++ b/linux/drivers/staging/tm6000/tm6000-cards.c	Tue May 18 11:14:55 2010 +1000
@@ -378,13 +378,7 @@
 		tm6000_set_reg(dev, REQ_04_EN_DISABLE_MCU_INT,
 	0x02, arg);
 		msleep(10);
-		rc = tm6000_set_reg(dev, REQ_03_SET_GET_MCU_PIN,
-	TM6000_GPIO_CLK, 0);
-		if (rc  0)
-			return rc;
-		msleep(10);
-		rc = tm6000_set_reg(dev, REQ_03_SET_GET_MCU_PIN,
-	TM6000_GPIO_CLK, 1);
+		rc = tm6000_i2c_reset(dev, 10);
 		break;
 	case XC2028_TUNER_RESET:
 		/* Reset codes during load firmware */
@@ -438,14 +432,7 @@
 			break;
 
 		case 2:
-			rc = tm6000_set_reg(dev, REQ_03_SET_GET_MCU_PIN,
-		TM6000_GPIO_CLK, 0);
-			if (rc  0)
-return rc;
-			msleep(100);
-			rc = tm6000_set_reg(dev, REQ_03_SET_GET_MCU_PIN,
-		TM6000_GPIO_CLK, 1);
-			msleep(100);
+			rc = tm6000_i2c_reset(dev, 100);
 			break;
 		}
 	}
diff -r 8f5129efe974 linux/drivers/staging/tm6000/tm6000-core.c
--- a/linux/drivers/staging/tm6000/tm6000-core.c	Sun May 16 18:48:01 2010 -0300
+++ b/linux/drivers/staging/tm6000/tm6000-core.c	Tue May 18 11:14:55 2010 +1000
@@ -156,6 +156,22 @@
 		return rc;
 
 	return buf[3] | buf[2]  8 | buf[1]  16 | buf[0]  24;
+}
+
+int tm6000_i2c_reset(struct tm6000_core *dev, u16 tsleep)
+{
+	int rc;
+
+	rc = tm6000_set_reg(dev, REQ_03_SET_GET_MCU_PIN, TM6000_GPIO_CLK, 0);
+	if (rc  0)
+		return rc;
+
+	msleep(tsleep);
+
+	rc = tm6000_set_reg(dev, REQ_03_SET_GET_MCU_PIN, TM6000_GPIO_CLK, 1);
+	msleep(tsleep);
+
+	return rc;
 }
 
 void tm6000_set_fourcc_format(struct tm6000_core *dev)
diff -r 8f5129efe974 linux/drivers/staging/tm6000/tm6000.h
--- a/linux/drivers/staging/tm6000/tm6000.h	Sun May 16 18:48:01 2010 -0300
+++ b/linux/drivers/staging/tm6000/tm6000.h	Tue May 18 11:14:55 2010 +1000
@@ 

[PATCH] xc5000, rework xc_write_reg

2010-05-18 Thread Dmitri Belimov
Hi

Rework xc_write_reg function for correct read register of the xc5000.
It is very useful for tm6000.

Tested for tm6000 and for saa7134 works well.

diff -r 8f5129efe974 linux/drivers/media/common/tuners/xc5000.c
--- a/linux/drivers/media/common/tuners/xc5000.cSun May 16 18:48:01 
2010 -0300
+++ b/linux/drivers/media/common/tuners/xc5000.cTue May 18 11:14:55 
2010 +1000
@@ -232,6 +232,26 @@
return 0;
 }
 
+static int xc5000_readreg(struct xc5000_priv *priv, u16 reg, u16 *val)
+{
+   u8 buf[2] = { reg  8, reg  0xff };
+   u8 bval[2] = { 0, 0 };
+   struct i2c_msg msg[2] = {
+   { .addr = priv-i2c_props.addr,
+   .flags = 0, .buf = buf[0], .len = 2 },
+   { .addr = priv-i2c_props.addr,
+   .flags = I2C_M_RD, .buf = bval[0], .len = 2 },
+   };
+
+   if (i2c_transfer(priv-i2c_props.adap, msg, 2) != 2) {
+   printk(KERN_WARNING xc5000: I2C read failed\n);
+   return -EREMOTEIO;
+   }
+
+   *val = (bval[0]  8) | bval[1];
+   return XC_RESULT_SUCCESS;
+}
+
 static void xc_wait(int wait_ms)
 {
msleep(wait_ms);
@@ -275,20 +295,14 @@
if (result == XC_RESULT_SUCCESS) {
/* wait for busy flag to clear */
while ((WatchDogTimer  0)  (result == XC_RESULT_SUCCESS)) {
-   buf[0] = 0;
-   buf[1] = XREG_BUSY;
-
-   result = xc_send_i2c_data(priv, buf, 2);
+   result = xc5000_readreg(priv, XREG_BUSY, buf);
if (result == XC_RESULT_SUCCESS) {
-   result = xc_read_i2c_data(priv, buf, 2);
-   if (result == XC_RESULT_SUCCESS) {
-   if ((buf[0] == 0)  (buf[1] == 0)) {
-   /* busy flag cleared */
+   if ((buf[0] == 0)  (buf[1] == 0)) {
+   /* busy flag cleared */
break;
-   } else {
-   xc_wait(5); /* wait 5 ms */
-   WatchDogTimer--;
-   }
+   } else {
+   xc_wait(5); /* wait 5 ms */
+   WatchDogTimer--;
}
}
}
@@ -534,25 +548,6 @@
return found;
 }
 
-static int xc5000_readreg(struct xc5000_priv *priv, u16 reg, u16 *val)
-{
-   u8 buf[2] = { reg  8, reg  0xff };
-   u8 bval[2] = { 0, 0 };
-   struct i2c_msg msg[2] = {
-   { .addr = priv-i2c_props.addr,
-   .flags = 0, .buf = buf[0], .len = 2 },
-   { .addr = priv-i2c_props.addr,
-   .flags = I2C_M_RD, .buf = bval[0], .len = 2 },
-   };
-
-   if (i2c_transfer(priv-i2c_props.adap, msg, 2) != 2) {
-   printk(KERN_WARNING xc5000: I2C read failed\n);
-   return -EREMOTEIO;
-   }
-
-   *val = (bval[0]  8) | bval[1];
-   return XC_RESULT_SUCCESS;
-}
 
 static int xc5000_fwupload(struct dvb_frontend *fe)
 {

Signed-off-by: Beholder Intl. Ltd. Dmitry Belimov d.beli...@gmail.com


With my best regards, Dmitry.
diff -r 8f5129efe974 linux/drivers/media/common/tuners/xc5000.c
--- a/linux/drivers/media/common/tuners/xc5000.c	Sun May 16 18:48:01 2010 -0300
+++ b/linux/drivers/media/common/tuners/xc5000.c	Tue May 18 11:14:55 2010 +1000
@@ -232,6 +232,26 @@
 	return 0;
 }
 
+static int xc5000_readreg(struct xc5000_priv *priv, u16 reg, u16 *val)
+{
+	u8 buf[2] = { reg  8, reg  0xff };
+	u8 bval[2] = { 0, 0 };
+	struct i2c_msg msg[2] = {
+		{ .addr = priv-i2c_props.addr,
+			.flags = 0, .buf = buf[0], .len = 2 },
+		{ .addr = priv-i2c_props.addr,
+			.flags = I2C_M_RD, .buf = bval[0], .len = 2 },
+	};
+
+	if (i2c_transfer(priv-i2c_props.adap, msg, 2) != 2) {
+		printk(KERN_WARNING xc5000: I2C read failed\n);
+		return -EREMOTEIO;
+	}
+
+	*val = (bval[0]  8) | bval[1];
+	return XC_RESULT_SUCCESS;
+}
+
 static void xc_wait(int wait_ms)
 {
 	msleep(wait_ms);
@@ -275,20 +295,14 @@
 	if (result == XC_RESULT_SUCCESS) {
 		/* wait for busy flag to clear */
 		while ((WatchDogTimer  0)  (result == XC_RESULT_SUCCESS)) {
-			buf[0] = 0;
-			buf[1] = XREG_BUSY;
-
-			result = xc_send_i2c_data(priv, buf, 2);
+			result = xc5000_readreg(priv, XREG_BUSY, buf);
 			if (result == XC_RESULT_SUCCESS) {
-result = xc_read_i2c_data(priv, buf, 2);
-if (result == XC_RESULT_SUCCESS) {
-	if ((buf[0] == 0)  (buf[1] == 0)) {
-		/* busy flag cleared */
+if ((buf[0] == 0)  (buf[1] == 0)) {
+	/* busy flag cleared */
 	break;
-	} else {
-		xc_wait(5); /* wait 5 ms */
-		WatchDogTimer--;
-	}
+} else {
+

[RESEND][PATCH] Technotrend S2-3200 ships with a TT 1500 remote

2010-05-18 Thread Hermann Gausterer
The Technotrend Budget S2-3200 ships with the
Technotrend 1500 bundled remote which is already supported.
Just add the right Subsystem Device ID.

Signed-off-by: Hermann Gausterer git-kernel-2...@mrq1.org
---
 drivers/media/dvb/ttpci/budget-ci.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/media/dvb/ttpci/budget-ci.c 
b/drivers/media/dvb/ttpci/budget-ci.c
index b5c6813..4526d66 100644
--- a/drivers/media/dvb/ttpci/budget-ci.c
+++ b/drivers/media/dvb/ttpci/budget-ci.c
@@ -234,6 +234,7 @@ static int msp430_ir_init(struct budget_ci *budget_ci)
break;
case 0x1010:
case 0x1017:
+   case 0x1019:
case 0x101a:
/* for the Technotrend 1500 bundled remote */
ir_input_init(input_dev, budget_ci-ir.state,
-- 
1.6.0.4



signature.asc
Description: Digital signature


tm6000

2010-05-18 Thread Dmitri Belimov
Hi 

tm6000 progress bar :-)

At this moment I can watch TV with mplayer without sound.
Our card based on the xc5000 and tm6010
It is possible with my last patch for xc5000 tuner.

Next task is a sound, check init process and stds settings.

P.S. Compile without support DVB-T frontend for our cards. Linux kernel is 
2.6.33

With my best regards, Dmitry.
--
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


v4l2: V4L2_BUF_FLAG_ERROR flag in output streams

2010-05-18 Thread Kamil Debski
Hello,

V4L2_BUF_FLAG_ERROR flag has been recently introduced. Its meaning is obvious 
for capture streams - if there is a recoverable stream error the flag is set. 
This may include corruption in coded stream which results in partially decoded 
frame, missing stream data, etc. This basically means that the generated data 
in the buffer may be erroneous.

It is somehow different for output streams. There is no (meaningful) data after 
the buffer is dequeued. Would it be a good idea to use this flag to mark a 
source buffer that failed to process, because the data it contained was 
corrupt? By this I mean that a mem2mem device produced no output as it is not 
possible to set this flag in the capture buffer. And the meaning of this flag 
would be different.

In addition the relationship between source and destination buffers is not 
always 1:1 for media codecs. This means that lack of destination buffer does 
not always correspond to an error.

Best wishes,
--
Kamil Debski
Linux Platform Group
Samsung Poland RD Center


--
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 v3 1/8] V4L2 subdev patchset for Intel Moorestown Camera Imaging Subsystem

2010-05-18 Thread Zhang, Xiaolin
From 50009eae70b1e69f053cd567375d2394fd926203 Mon Sep 17 00:00:00 2001
From: Xiaolin Zhang xiaolin.zh...@intel.com
Date: Tue, 18 May 2010 15:20:59 +0800
Subject: [PATCH 1/8] the common sensor v4l2-subdev private structures and 
resolutions definition
 ued in ov2650, ov5630, ov9665, s5k4e1 v4l2-subdev sensor drivers.

Signed-off-by: Xiaolin Zhang xiaolin.zh...@intel.com
---
 drivers/media/video/Kconfig  |   75 ++
 drivers/media/video/Makefile |9 +
 drivers/media/video/mrst_sensor_common.h |  378 ++
 3 files changed, 462 insertions(+), 0 deletions(-)
 create mode 100644 drivers/media/video/mrst_sensor_common.h

diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig
index 9644cf7..d23adcc 100644
--- a/drivers/media/video/Kconfig
+++ b/drivers/media/video/Kconfig
@@ -332,6 +332,79 @@ config VIDEO_TCM825X
  This is a driver for the Toshiba TCM825x VGA camera sensor.
  It is used for example in Nokia N800.

+config VIDEO_OV2650
+tristate OmniVision OV2650 SoC Sensor support
+depends on I2C  VIDEO_V4L2
+
+---help---
+  This is a Video4Linux2 sensor-level driver for the OmniVision
+  OV2650 2MP camera. It currently only works with the Intel Atom
+  (Moorestown) platform.
+
+config VIDEO_OV9665
+   tristate OmniVision OV9665 SoC Sensor support
+   depends on I2C  VIDEO_V4L2
+
+   ---help---
+ This is a Video4Linux2 sensor-level driver for the OmniVision
+OV9665 1.3MP camera. It currently only works with the Intel Atom
+(Moorestown) platform.
+
+config VIDEO_OV5630
+   tristate OmniVision OV5630 RAW Sensor support
+   depends on I2C  VIDEO_V4L2
+
+   ---help---
+ This is a Video4Linux2 sensor-level driver for the OmniVision
+OV5630 5MP camera. It currently only works with the Intel Atom
+(Moorestown) platform.
+
+config VIDEO_S5K4E1
+   tristate Samsung s5k4e1 RAW Sensor support
+   depends on I2C  VIDEO_V4L2
+
+   ---help---
+   This is a Video4Linux2 sensor-level driver for the Samsung
+   s5k4e1 5MP camera. It currently only works with Intel Atom
+   (Moorestown) platform.
+
+config VIDEO_OV5630_MOTOR
+   tristate Analog Devices AD5820 VCM (OVT OV5630) support
+   depends on I2C  VIDEO_V4L2  VIDEO_OV5630
+   default y
+   ---help---
+ This is a video4linux2 driver for the Analog Devices AD5820
+ VCM Driver integrated into OVT OV5630 camera module
+  which is curretly supported on Intel Atom
+ (Moorestown)CMOS camera controller.
+
+ To compile this driver as a module, choose M here: the
+ module will be called ov5630_motor.ko.
+
+config VIDEO_S5K4E1_MOTOR
+   tristate Renesas VCM driver (KMOT IX51A) support
+   depends on I2C  VIDEO_V4L2  VIDEO_S5K4E1
+   default y
+   ---help---
+ This is a video4linux2 driver for the Renesas VCM driver R2A30419BX
+ which is located in KMOT IX51A camera module which is curretly
+ supported on Intel Atom (Moorestown)CMOS camera controller.
+
+ To compile this driver as a module, choose M here: the
+ module will be called s5k4e1_motor.ko.
+
+config VIDEO_MRSTFLASH
+   tristate National Semiconductor LM3553 Flash LED Driver support
+   depends on I2C  VIDEO_V4L2
+   default y
+   ---help---
+ This is a video4linux2 driver for the National Semiconductor LM3553
+ 1.2A Dual Flas LED Driver which is curretly supported on Intel Atom
+ (Moorestown)CMOS camera controller.
+
+ To compile this driver as a module, choose M here: the
+ module will be called lm3553.ko
+
 config VIDEO_SAA7110
tristate Philips SAA7110 video decoder
depends on VIDEO_V4L2  I2C
@@ -833,6 +906,8 @@ config VIDEO_CAFE_CCIC
  CMOS camera controller.  This is the controller found on first-
  generation OLPC systems.

+source drivers/media/video/mrstisp/Kconfig
+
 config SOC_CAMERA
tristate SoC camera support
depends on VIDEO_V4L2  HAS_DMA  I2C
diff --git a/drivers/media/video/Makefile b/drivers/media/video/Makefile
index c51c386..d7eca01 100644
--- a/drivers/media/video/Makefile
+++ b/drivers/media/video/Makefile
@@ -70,6 +70,13 @@ obj-$(CONFIG_VIDEO_UPD64031A) += upd64031a.o
 obj-$(CONFIG_VIDEO_UPD64083) += upd64083.o
 obj-$(CONFIG_VIDEO_OV7670) += ov7670.o
 obj-$(CONFIG_VIDEO_TCM825X) += tcm825x.o
+obj-$(CONFIG_VIDEO_OV2650) += ov2650.o
+obj-$(CONFIG_VIDEO_OV9665) += ov9665.o
+obj-$(CONFIG_VIDEO_OV5630) += ov5630.o
+obj-$(CONFIG_VIDEO_S5K4E1) += ovs5k4e1.o
+obj-$(CONFIG_VIDEO_MRSTFLASH) += mrstflash.o
+obj-$(CONFIG_VIDEO_OV5630_MOTOR) += ov5630_motor.o
+obj-$(CONFIG_VIDEO_S5K4E1_MOTOR) += s5k4e1_motor.o
 obj-$(CONFIG_VIDEO_TVEEPROM) += tveeprom.o
 obj-$(CONFIG_VIDEO_MT9V011) += mt9v011.o

@@ -123,6 +130,8 @@ obj-$(CONFIG_VIDEO_CX2341X) += cx2341x.o

 

[PATCH v3 2/8] V4L2 subdev patchset for Intel Moorestown Camera Imaging Subsystem

2010-05-18 Thread Zhang, Xiaolin
From 5bd8b947c84256aff927cfdd7a54da6d712b7e16 Mon Sep 17 00:00:00 2001
From: Xiaolin Zhang xiaolin.zh...@intel.com
Date: Tue, 18 May 2010 15:22:00 +0800
Subject: [PATCH 2/8] This patch is to add 2MP camera (ov2650) support which is 
based
 on the video4linux2 sub-dev driver framework.

Signed-off-by: Xiaolin Zhang xiaolin.zh...@intel.com
---
 drivers/media/video/ov2650.c |  690 
 drivers/media/video/ov2650.h |  717 ++
 2 files changed, 1407 insertions(+), 0 deletions(-)
 create mode 100644 drivers/media/video/ov2650.c
 create mode 100644 drivers/media/video/ov2650.h

diff --git a/drivers/media/video/ov2650.c b/drivers/media/video/ov2650.c
new file mode 100644
index 000..70a54fd
--- /dev/null
+++ b/drivers/media/video/ov2650.c
@@ -0,0 +1,690 @@
+/*
+ * Support for Moorestown Langwell Camera Imaging ISP subsystem.
+ *
+ * Copyright (c) 2009 Intel Corporation. All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version
+ * 2 as published by the Free Software Foundation.
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA.
+ *
+ *
+ * Xiaolin Zhang xiaolin.zh...@intel.com
+ */
+#include linux/i2c.h
+#include linux/delay.h
+#include linux/videodev2.h
+#include linux/slab.h
+#include media/v4l2-device.h
+
+#include mrst_sensor_common.h
+#include ov2650.h
+
+static int ov2650_debug;
+module_param(ov2650_debug, int, 0644);
+MODULE_PARM_DESC(ov2650_debug, Debug level (0-1));
+
+#define dprintk(level, fmt, arg...) do {   \
+   if (ov2650_debug = level)  \
+   printk(KERN_DEBUG %s:  fmt \n, \
+  __func__, ## arg); } \
+   while (0)
+
+#define eprintk(fmt, arg...)   \
+   printk(KERN_ERR %s: line %d:  fmt \n,   \
+  __func__, __LINE__, ## arg);
+
+static inline struct ci_sensor_config *to_sensor_config(struct v4l2_subdev *sd)
+{
+   return container_of(sd, struct ci_sensor_config, sd);
+}
+
+static struct ov2650_res_struct {
+   __u8 *desc;
+   int res;
+   int width;
+   int height;
+   int fps;
+   bool used;
+   const struct regval_list *regs;
+} ov2650_res[] = {
+   {
+   .desc   = UXGA,
+   .res= SENSOR_RES_UXGA,
+   .width  = 1600,
+   .height = 1200,
+   .fps= 15,
+   .used   = 0,
+   .regs   = ov2650_res_uxga,
+   },
+   {
+   .desc   = SXGA,
+   .res= SENSOR_RES_SXGA,
+   .width  = 1280,
+   .height = 1024,
+   .fps= 15,
+   .used   = 0,
+   .regs   = ov2650_res_sxga,
+   },
+   {
+   .desc   = SVGA,
+   .res= SENSOR_RES_SVGA,
+   .width  = 800,
+   .height = 600,
+   .fps= 15,
+   .used   = 0,
+   .regs   = ov2650_res_svga,
+   },
+   {
+   .desc   = VGA,
+   .res= SENSOR_RES_VGA,
+   .width  = 640,
+   .height = 480,
+   .fps= 15,
+   .used   = 0,
+   .regs   = ov2650_res_vga_vario,
+   },
+   {
+   .desc   = QVGA,
+   .res= SENSOR_RES_QVGA,
+   .width  = 320,
+   .height = 240,
+   .fps= 15,
+   .used   = 0,
+   .regs   = ov2650_res_qvga,
+   },
+};
+
+#define N_RES (ARRAY_SIZE(ov2650_res))
+
+static int ov2650_read(struct i2c_client *c, u16 reg, u8 *value)
+{
+   int ret;
+   int i;
+   struct i2c_msg msg[2];
+   u8 msgbuf[2];
+   u8 ret_val = 0;
+   *value = 0;
+   memset(msg, 0, sizeof(msg));
+   msgbuf[0] = 0;
+   msgbuf[1] = 0;
+   i = 0;
+   msgbuf[i++] = reg  8;
+   msgbuf[i++] = reg;
+   msg[0].addr = c-addr;
+   msg[0].buf = msgbuf;
+   msg[0].len = i;
+
+   msg[1].addr = c-addr;
+   msg[1].flags = I2C_M_RD;
+   msg[1].buf = ret_val;
+   msg[1].len = 1;
+
+   ret = i2c_transfer(c-adapter, msg[0], 2);
+  

[PATCH v3 3/8] V4L2 subdev patchset for Intel Moorestown Camera Imaging Subsystem

2010-05-18 Thread Zhang, Xiaolin
From 77c6856881ae269e1d3a58be3581d9f131037010 Mon Sep 17 00:00:00 2001
From: Xiaolin Zhang xiaolin.zh...@intel.com
Date: Tue, 18 May 2010 15:22:59 +0800
Subject: [PATCH 3/8] This patch is to add 5MP raw camera (ov5630) support which 
is based
 on the video4linux2 sub-dev driver framework.

Signed-off-by: Xiaolin Zhang xiaolin.zh...@intel.com
---
 drivers/media/video/ov5630.c |  734 ++
 drivers/media/video/ov5630.h |  635 
 2 files changed, 1369 insertions(+), 0 deletions(-)
 create mode 100644 drivers/media/video/ov5630.c
 create mode 100644 drivers/media/video/ov5630.h

diff --git a/drivers/media/video/ov5630.c b/drivers/media/video/ov5630.c
new file mode 100644
index 000..c4be115
--- /dev/null
+++ b/drivers/media/video/ov5630.c
@@ -0,0 +1,734 @@
+/*
+ * Support for Moorestown Langwell Camera Imaging ISP subsystem.
+ *
+ * Copyright (c) 2009 Intel Corporation. All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version
+ * 2 as published by the Free Software Foundation.
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA.
+ *
+ *
+ * Xiaolin Zhang xiaolin.zh...@intel.com
+ */
+#include linux/i2c.h
+#include linux/gpio.h
+#include linux/delay.h
+#include linux/videodev2.h
+#include linux/slab.h
+#include media/v4l2-device.h
+
+#include mrst_sensor_common.h
+#include ov5630.h
+
+static int ov5630_debug;
+module_param(ov5630_debug, int, 0644);
+MODULE_PARM_DESC(ov5630_debug, Debug level (0-1));
+
+#define dprintk(level, fmt, arg...) do {   \
+   if (ov5630_debug = level)  \
+   printk(KERN_DEBUG %s:  fmt \n,  \
+  __func__, ## arg); } \
+   while (0)
+
+#define eprintk(fmt, arg...)   \
+   printk(KERN_ERR %s: line %d:  fmt \n,   \
+  __func__, __LINE__, ## arg);
+
+static inline struct ci_sensor_config *to_sensor_config(struct v4l2_subdev *sd)
+{
+   return container_of(sd, struct ci_sensor_config, sd);
+}
+
+static struct ov5630_res_struct {
+   __u8 *desc;
+   int res;
+   int width;
+   int height;
+   int fps;
+   bool used;
+   const struct regval_list *regs;
+} ov5630_res[] = {
+   {
+   .desc   = QSXGA_PLUS4,
+   .res= SENSOR_RES_QXGA_PLUS,
+   .width  = 2592,
+   .height = 1944,
+   .fps= 15,
+   .used   = 0,
+   .regs   = ov5630_res_qsxga_plus4,
+   },
+   {
+   .desc   = 1080P,
+   .res= SENSOR_RES_1080P,
+   .width  = 1920,
+   .height = 1080,
+   .fps= 25,
+   .used   = 0,
+   .regs   = ov5630_res_1080p,
+   },
+   {
+   .desc   = XGA_PLUS,
+   .res= SENSOR_RES_XGA_PLUS,
+   .width  = 1280,
+   .height = 960,
+   .fps= 30,
+   .used   = 0,
+   .regs   = ov5630_res_xga_plus,
+   },
+   {
+   .desc   = 720p,
+   .res= SENSOR_RES_720P,
+   .width  = 1280,
+   .height = 720,
+   .fps= 34,
+   .used   = 0,
+   .regs   = ov5630_res_720p,
+   },
+   {
+   .desc   = VGA,
+   .res= SENSOR_RES_VGA,
+   .width  = 640,
+   .height = 480,
+   .fps= 39,
+   .used   = 0,
+   .regs   = ov5630_res_vga_ac04_bill,
+   },
+};
+
+#define N_RES (ARRAY_SIZE(ov5630_res))
+
+/*
+ * I2C Read  Write stuff
+ */
+static int ov5630_read(struct i2c_client *c, u32 reg, u32 *value)
+{
+   int ret;
+   int i;
+   struct i2c_msg msg[2];
+   u8 msgbuf[2];
+   u8 ret_val = 0;
+   *value = 0;
+   memset(msg, 0, sizeof(msg));
+   msgbuf[0] = 0;
+   msgbuf[1] = 0;
+   i = 0;
+
+   msgbuf[i++] = ((u16)reg)  8;
+   msgbuf[i++] = ((u16)reg)  0xff;
+   msg[0].addr = c-addr;
+   msg[0].buf = msgbuf;
+   msg[0].len = i;
+
+   msg[1].addr = c-addr;
+   

[PATCH v3 5/8] V4L2 subdev patchset for Intel Moorestown Camera Imaging Subsystem

2010-05-18 Thread Zhang, Xiaolin
From 9c2160917def0545c3a55dddef6c3ead770a1cb1 Mon Sep 17 00:00:00 2001
From: Xiaolin Zhang xiaolin.zh...@intel.com
Date: Tue, 18 May 2010 15:25:06 +0800
Subject: [PATCH 5/8] This patch is to add 5MP raw camera (s5k4e1) support which 
is based
 on the video4linux2 sub-dev driver framework.

Signed-off-by: Xiaolin Zhang xiaolin.zh...@intel.com
---
 drivers/media/video/s5k4e1.c |  717 ++
 drivers/media/video/s5k4e1.h |  573 +
 2 files changed, 1290 insertions(+), 0 deletions(-)
 create mode 100644 drivers/media/video/s5k4e1.c
 create mode 100644 drivers/media/video/s5k4e1.h

diff --git a/drivers/media/video/s5k4e1.c b/drivers/media/video/s5k4e1.c
new file mode 100644
index 000..fc47cec
--- /dev/null
+++ b/drivers/media/video/s5k4e1.c
@@ -0,0 +1,717 @@
+/*
+ * Support for Moorestown Langwell Camera Imaging ISP subsystem.
+ *
+ * Copyright (c) 2009 Intel Corporation. All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version
+ * 2 as published by the Free Software Foundation.
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA.
+ *
+ *
+ * Xiaolin Zhang xiaolin.zh...@intel.com
+ */
+
+#include linux/i2c.h
+#include linux/gpio.h
+#include linux/delay.h
+#include linux/videodev2.h
+#include linux/slab.h
+#include media/v4l2-device.h
+
+#include mrst_sensor_common.h
+#include s5k4e1.h
+
+static int s5k4e1_debug;
+module_param(s5k4e1_debug, int, 0644);
+MODULE_PARM_DESC(s5k4e1_debug, Debug level (0-1));
+
+#define dprintk(level, fmt, arg...) \
+   do { \
+   if (s5k4e1_debug = level) \
+   printk(KERN_DEBUG %s:  fmt \n, \
+  __func__, ## arg);\
+   } while (0)
+
+#define eprintk(fmt, arg...)   \
+   printk(KERN_ERR %s: fmt \n, \
+  __func__, ## arg);
+
+static inline struct ci_sensor_config *to_sensor_config(struct v4l2_subdev *sd)
+{
+   return container_of(sd, struct ci_sensor_config, sd);
+}
+
+static struct s5k4e1_res_struct {
+   __u8 *desc;
+   int res;
+   int width;
+   int height;
+   int fps;
+   bool used;
+   const struct regval_list *regs;
+} s5k4e1_res[] = {
+   {
+   .desc   = QSXGA_PLUS4,
+   .res= SENSOR_RES_QXGA_PLUS,
+   .width  = 2592,
+   .height = 1944,
+   .fps= 15,
+   .used   = 0,
+   .regs   = s5k4e1_res_qsxga_plus4,
+   },
+   {
+   .desc   = 1080P,
+   .res= SENSOR_RES_1080P,
+   .width  = 1920,
+   .height = 1080,
+   .fps= 25,
+   .used   = 0,
+   .regs   = s5k4e1_res_1080p,
+   },
+   {
+   .desc   = VGA_PLUS,
+   .res= SENSOR_RES_VGA_PLUS,
+   .width  = 1304,
+   .height = 980,
+   .fps= 30,
+   .used   = 0,
+   .regs   = s5k4e1_res_vga_ac04_bill,
+   },
+   {
+   .desc   = 720p,
+   .res= SENSOR_RES_720P,
+   .width  = 1280,
+   .height = 720,
+   .fps= 30,
+   .used   = 0,
+   .regs   = s5k4e1_res_720p,
+   },
+   {
+   .desc   = VGA,
+   .res= SENSOR_RES_VGA,
+   .width  = 640,
+   .height = 480,
+   .used   = 0,
+   .fps= 40,
+   .regs   = s5k4e1_res_vga_ac04_bill,
+   },
+};
+
+#define N_RES (ARRAY_SIZE(s5k4e1_res))
+
+static int s5k4e1_read(struct i2c_client *c, u32 reg, u32 *value)
+{
+   int ret;
+   int i;
+   struct i2c_msg msg[2];
+   u8 msgbuf[2];
+   u8 ret_val = 0;
+   *value = 0;
+   memset(msg, 0, sizeof(msg));
+   msgbuf[0] = 0;
+   msgbuf[1] = 0;
+   i = 0;
+
+   msgbuf[i++] = ((u16)reg)  8;
+   msgbuf[i++] = ((u16)reg)  0xff;
+   msg[0].addr = c-addr;
+   msg[0].buf = msgbuf;
+   msg[0].len = i;
+
+   msg[1].addr = c-addr;
+   msg[1].flags = I2C_M_RD;
+   msg[1].buf = ret_val;
+   msg[1].len = 1;
+
+   ret = 

[PATCH v3 0/8] V4L2 subdev patchset for Intel Moorestown Camera Imaging Subsystem

2010-05-18 Thread Zhang, Xiaolin
Hi linux-media, 

Here is the third version of V4L2 camera sensors and ISP driver patchset for 
Intel Moorestown camera imaging subsystem to address community feedback, 
especially from Hans. 

Beginning from this version, I am going to split the whole camera driver into 
two parts: one is dedicated for v4l2 subdev patchset including 4 different 
cameras, 1 flash led, 2 VCM lens driver and another one is dedicated for v4l2 
ISP patchset including only ISP driver with different logical component. Since 
it is a complicated one subsystem and after this split, it is more clear 
without logical dependency and would be a convenient for community review. 

At this point, I only submit the v4l2 subdev patchset and the ISP patchset will 
be submitted later. 

In this set of v4l2 subdev driver patches, I will submit the following 8 
patches to add 4 different cameras, 1 flash led, 2 VCM lens driver support to 
the Linux v4l2 subsystem:

1. a common sensor v4l2-subdev private structures and resolution definition. 
2. OVT 2MP camera (ov2650) sensor subdev driver.
3. OVT 5MP camera (ov5630) sensor subdev driver.
4. OVT 1.3MP camera (ov9665) sensor subdev driver.
5. Samsung 5MP camera (s5k4e1) sensor driver.
6. Analog Device (AD5820) VCM/lens subdev driver.
7. Renesas (R2A30419BX) VCMlens subdev driver
8. National Semiconductor LM3552 flash led subdev driver

Please review them and comments are welcome as always. 

Regards,

Xiaolin
xiaolin.zh...@intel.com

--
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 v3 6/8] V4L2 subdev patchset for Intel Moorestown Camera Imaging Subsystem

2010-05-18 Thread Zhang, Xiaolin
From 46bf8433c86a7450604a981981c8ce487130dce0 Mon Sep 17 00:00:00 2001
From: Xiaolin Zhang xiaolin.zh...@intel.com
Date: Tue, 18 May 2010 15:25:50 +0800
Subject: [PATCH 6/8] This patch is to add AD5820 VCM (for ov5630)driver support
 which is based on the video4linux2 sub-dev driver framework.

Signed-off-by: Xiaolin Zhang xiaolin.zh...@intel.com
---
 drivers/media/video/ov5630_motor.c |  365 
 drivers/media/video/ov5630_motor.h |   77 
 2 files changed, 442 insertions(+), 0 deletions(-)
 create mode 100644 drivers/media/video/ov5630_motor.c
 create mode 100644 drivers/media/video/ov5630_motor.h

diff --git a/drivers/media/video/ov5630_motor.c 
b/drivers/media/video/ov5630_motor.c
new file mode 100644
index 000..dfac612
--- /dev/null
+++ b/drivers/media/video/ov5630_motor.c
@@ -0,0 +1,365 @@
+/*
+ * Support for Moorestown Langwell Camera Imaging ISP subsystem.
+ *
+ * Copyright (c) 2009 Intel Corporation. All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version
+ * 2 as published by the Free Software Foundation.
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA.
+ *
+ *
+ * Xiaolin Zhang xiaolin.zh...@intel.com
+ */
+
+#include linux/i2c.h
+#include linux/delay.h
+#include linux/slab.h
+#include media/v4l2-device.h
+
+#include ov5630_motor.h
+
+static int mrstov5630_motor_debug;
+module_param(mrstov5630_motor_debug, int, 0644);
+MODULE_PARM_DESC(mrstov5630_motor_debug, Debug level (0-1));
+
+#define dprintk(level, fmt, arg...) do {   \
+   if (mrstov5630_motor_debug = level)\
+   printk(KERN_DEBUG mrst...@%s:  fmt \n, \
+  __func__, ## arg); } \
+   while (0)
+
+#define eprintk(fmt, arg...)   \
+   printk(KERN_ERR mrst...@%s: line %d:  fmt \n,   \
+  __func__, __LINE__, ## arg);
+
+static inline struct ov5630_motor *to_motor_config(struct v4l2_subdev *sd)
+{
+   return container_of(sd, struct ov5630_motor, sd);
+}
+
+static int motor_read(struct i2c_client *c, u16 *reg)
+{
+   int ret;
+   struct i2c_msg msg;
+   u8 msgbuf[2];
+
+   msgbuf[0] = 0;
+   msgbuf[1] = 0;
+
+   memset(msg, 0, sizeof(msg));
+   msg.addr = c-addr;
+   msg.buf = msgbuf;
+   msg.len = 2;
+   msg.flags = I2C_M_RD;
+
+   ret = i2c_transfer(c-adapter, msg, 1);
+   *reg = (msgbuf[0]  8 | msgbuf[1]);
+
+   ret = (ret == 1) ? 0 : -1;
+   return ret;
+}
+
+static int motor_write(struct i2c_client *c, u16 reg)
+{
+   int ret;
+   struct i2c_msg msg;
+   u8 msgbuf[2];
+
+   memset(msg, 0, sizeof(msg));
+   msgbuf[0] = reg  8;
+   msgbuf[1] = reg;
+
+   msg.addr = c-addr;
+   msg.flags = 0;
+   msg.buf = msgbuf;
+   msg.len = 2;
+
+   ret = i2c_transfer(c-adapter, msg, 1);
+   ret = (ret == 1) ? 0 : -1;
+   return ret;
+}
+
+static int ov5630_motor_goto_position(struct i2c_client *c,
+ unsigned short code,
+ struct ov5630_motor *config)
+{
+   int max_code, min_code;
+   u8 cmdh, cmdl;
+   u16 cmd, val = 0;
+
+   max_code = config-macro_code;
+   min_code = config-infin_code;
+
+   if (code  max_code)
+   code = max_code;
+   if (code  min_code)
+   code = min_code;
+
+   cmdh = (MOTOR_DAC_CODE_H(code));
+   cmdl = (MOTOR_DAC_CODE_L(code) | MOTOR_DAC_CTRL_MODE_2(SUB_MODE_4));
+   cmd = cmdh  8 | cmdl;
+
+   motor_write(c, cmd);
+   msleep(8);
+   motor_read(c, val);
+
+   return (cmd == val ? 0 : -1);
+}
+
+int ov5630_motor_init(struct i2c_client *client, struct ov5630_motor *config)
+{
+   int ret;
+   int infin_cur, macro_cur;
+
+   infin_cur = max(MOTOR_INFIN_CUR, MOTOR_DAC_MIN_CUR);
+   macro_cur = min(MOTOR_MACRO_CUR, MOTOR_DAC_MAX_CUR);
+
+   config-infin_cur = infin_cur;
+   config-macro_cur = macro_cur;
+   config-infin_code = (int)((infin_cur * MOTOR_DAC_MAX_CODE)
+  / MOTOR_DAC_MAX_CUR);
+   config-macro_code = (int)((macro_cur * MOTOR_DAC_MAX_CODE)
+  / MOTOR_DAC_MAX_CUR);
+
+   config-max_step = ((config-macro_code - config-infin_code)
+MOTOR_STEP_SHIFT) + 1;
+   ret = ov5630_motor_goto_position(client, config-infin_code, config);
+   if (!ret)
+   

[PATCH v3 8/8] V4L2 subdev patchset for Intel Moorestown Camera Imaging Subsystem

2010-05-18 Thread Zhang, Xiaolin
From fb60254ff50703b8b8301d6708371be011f1050e Mon Sep 17 00:00:00 2001
From: Xiaolin Zhang xiaolin.zh...@intel.com
Date: Tue, 18 May 2010 15:27:48 +0800
Subject: [PATCH 8/8] This patch is to add National Semiconductor LM3553 flash 
LED driver support
 which is based on the video4linux2 sub-dev driver framework.

Signed-off-by: Xiaolin Zhang xiaolin.zh...@intel.com
---
 drivers/media/video/mrstflash.c |  151 +++
 1 files changed, 151 insertions(+), 0 deletions(-)
 create mode 100644 drivers/media/video/mrstflash.c

diff --git a/drivers/media/video/mrstflash.c b/drivers/media/video/mrstflash.c
new file mode 100644
index 000..927939b
--- /dev/null
+++ b/drivers/media/video/mrstflash.c
@@ -0,0 +1,151 @@
+/*
+ * Support for Moorestown Langwell Camera Imaging camera flash.
+ *
+ * Copyright (c) 2009 Intel Corporation. All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version
+ * 2 as published by the Free Software Foundation.
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA.
+ *
+ *
+ * Xiaolin Zhang xiaolin.zh...@intel.com
+ */
+
+#include linux/delay.h
+#include linux/i2c.h
+#include linux/videodev2.h
+#include linux/slab.h
+#include media/v4l2-device.h
+
+static int debug;
+module_param(debug, bool, 0644);
+MODULE_PARM_DESC(debug, Debug level (0-1));
+
+MODULE_AUTHOR(Xiaolin Zhang xiaolin.zh...@intel.com);
+MODULE_DESCRIPTION(A low-level driver for mrst flash);
+MODULE_LICENSE(GPL);
+
+static int flash_g_chip_ident(struct v4l2_subdev *sd,
+   struct v4l2_dbg_chip_ident *chip)
+{
+   struct i2c_client *client = v4l2_get_subdevdata(sd);
+
+   #define V4L2_IDENT_MRST_FLASH 8248
+   return v4l2_chip_ident_i2c_client(client, chip,
+ V4L2_IDENT_MRST_FLASH, 0);
+}
+
+static const struct v4l2_subdev_core_ops flash_core_ops = {
+   .g_chip_ident = flash_g_chip_ident,
+};
+static const struct v4l2_subdev_ops flash_ops = {
+   .core = flash_core_ops,
+};
+
+static int flash_detect(struct i2c_client *client)
+{
+   struct i2c_adapter *adapter = client-adapter;
+   u8 pid;
+
+   if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA))
+   return -ENODEV;
+
+   if (adapter-nr != 0)
+   return -ENODEV;
+
+   pid = i2c_smbus_read_byte_data(client, 0x10);
+   if (pid == 0x18) {
+   printk(KERN_ERR camera flash device found\n);
+   v4l_dbg(1, debug, client, found camera flash device);
+   } else {
+   printk(KERN_ERR no camera flash device found\n);
+   return -ENODEV;
+   }
+
+   return 0;
+}
+
+static int flash_probe(struct i2c_client *client,
+   const struct i2c_device_id *id)
+{
+   u8 pid, ver;
+   int ret = -1;
+   struct v4l2_subdev *sd;
+
+   v4l_info(client, chip found @ 0x%x (%s)\n,
+   client-addr  1, client-adapter-name);
+
+   sd = kzalloc(sizeof(struct v4l2_subdev), GFP_KERNEL);
+   ret = flash_detect(client);
+   if (ret)
+   return -ENODEV;
+
+   v4l2_i2c_subdev_init(sd, client, flash_ops);
+
+   ver = i2c_smbus_read_byte_data(client, 0x50);
+   v4l_dbg(1, debug, client, detect:CST from device is 0x%x, ver);
+   pid = i2c_smbus_read_byte_data(client, 0x20);
+   v4l_dbg(1, debug, client, detect:MFPC from device is 0x%x, pid);
+   pid = i2c_smbus_read_byte_data(client, 0xA0);
+   v4l_dbg(1, debug, client, detect:TCC from device is 0x%x, pid);
+   pid = i2c_smbus_read_byte_data(client, 0xB0);
+   v4l_dbg(1, debug, client, detect:FCC from device is 0x%x, pid);
+   pid = i2c_smbus_read_byte_data(client, 0xC0);
+   v4l_dbg(1, debug, client, detect:FDC from device is 0x%x, pid);
+   i2c_smbus_write_byte_data(client, 0xc0, 0xff); /*set FST to 1000us*/
+   pid = i2c_smbus_read_byte_data(client, 0xc0);
+   v4l_dbg(1, debug, client, FDC from device is 0x%x, pid);
+
+   v4l_dbg(1, debug, client,
+   successfully load camera flash device driver);
+   return 0;
+}
+
+static int flash_remove(struct i2c_client *client)
+{
+   struct v4l2_subdev *sd = i2c_get_clientdata(client);
+
+   v4l2_device_unregister_subdev(sd);
+   kfree(sd);
+
+   return 0;
+}
+
+static const struct i2c_device_id flash_id[] = {
+   {mrst_camera_flash, 0},
+   {}
+};
+
+MODULE_DEVICE_TABLE(i2c, flash_id);
+
+static struct 

[PATCH v3 4/8] V4L2 subdev patchset for Intel Moorestown Camera Imaging Subsystem

2010-05-18 Thread Zhang, Xiaolin
From 979d0efb8d6c4ab6efde2c9781e5d73f20174d62 Mon Sep 17 00:00:00 2001
From: Xiaolin Zhang xiaolin.zh...@intel.com
Date: Tue, 18 May 2010 15:24:05 +0800
Subject: [PATCH 4/8] This patch is to add 1.3MP soc camera (ov9665) support 
which is based
 on the video4linux2 sub-dev driver framework.

Signed-off-by: Xiaolin Zhang xiaolin.zh...@intel.com
---
 drivers/media/video/ov9665.c |  631 ++
 drivers/media/video/ov9665.h |  253 +
 2 files changed, 884 insertions(+), 0 deletions(-)
 create mode 100644 drivers/media/video/ov9665.c
 create mode 100644 drivers/media/video/ov9665.h

diff --git a/drivers/media/video/ov9665.c b/drivers/media/video/ov9665.c
new file mode 100644
index 000..c122874
--- /dev/null
+++ b/drivers/media/video/ov9665.c
@@ -0,0 +1,631 @@
+/*
+ * Support for Moorestown Langwell Camera Imaging ISP subsystem.
+ *
+ * Copyright (c) 2009 Intel Corporation. All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version
+ * 2 as published by the Free Software Foundation.
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA.
+ *
+ *
+ * Xiaolin Zhang xiaolin.zh...@intel.com
+ */
+#include linux/delay.h
+#include linux/i2c.h
+#include linux/gpio.h
+#include linux/videodev2.h
+#include linux/slab.h
+#include media/v4l2-device.h
+
+#include mrst_sensor_common.h
+#include ov9665.h
+
+static int ov9665_debug;
+module_param(ov9665_debug, int, 0644);
+MODULE_PARM_DESC(ov9665_debug, Debug level (0-1));
+
+#define dprintk(level, fmt, arg...) do {   \
+   if (ov9665_debug = level)  \
+   printk(KERN_DEBUG %s:  fmt \n, \
+  __func__, ## arg); } \
+   while (0)
+
+#define eprintk(fmt, arg...)   \
+   printk(KERN_ERR %s: line %d:  fmt \n,   \
+  __func__, __LINE__, ## arg);
+
+static inline struct ci_sensor_config *to_sensor_config(struct v4l2_subdev *sd)
+{
+   return container_of(sd, struct ci_sensor_config, sd);
+}
+
+static struct ov9665_res_struct {
+   __u8 *desc;
+   int res;
+   int width;
+   int height;
+   int fps;
+   bool used;
+   const struct regval_list *regs;
+} ov9665_res[] = {
+   {
+   .desc   = SXGA,
+   .res= SENSOR_RES_SXGA,
+   .width  = 1280,
+   .height = 1024,
+   .fps= 15,
+   .used   = 0,
+   .regs   = ov9665_res_sxga,
+   },
+   {
+   .desc   = VGA,
+   .res= SENSOR_RES_VGA,
+   .width  = 640,
+   .height = 480,
+   .fps= 15,
+   .used   = 0,
+   .regs   = ov9665_res_vga,
+   },
+};
+#define N_RES (ARRAY_SIZE(ov9665_res))
+
+static int ov9665_read(struct i2c_client *c, unsigned char reg,
+  unsigned char *value)
+{
+   int ret;
+
+   ret = i2c_smbus_read_byte_data(c, reg);
+   if (ret = 0) {
+   *value = (unsigned char) ret;
+   ret = 0;
+   }
+   return ret;
+}
+
+static int ov9665_write(struct i2c_client *c, unsigned char reg,
+   unsigned char value)
+{
+   int ret = i2c_smbus_write_byte_data(c, reg, value);
+   if (reg == 0x12  (value  0x80))
+   msleep(2);
+   return ret;
+}
+
+static int ov9665_write_array(struct i2c_client *c,
+   const struct regval_list *vals)
+{
+   const struct regval_list *p;
+   u8 read_val = 0;
+   int err_num = 0;
+   int i = 0;
+   p = vals;
+   while (p-reg_num != 0xff) {
+   ov9665_write(c, p-reg_num, p-value);
+   ov9665_read(c, p-reg_num, read_val);
+   if (read_val != p-value)
+   err_num++;
+   p++;
+   i++;
+   }
+
+   return 0;
+}
+
+static int ov9665_set_data_pin_in(struct i2c_client *client)
+{
+   int ret = 0;
+
+   ret += ov9665_write(client, 0xd5, 0x00);
+   ret += ov9665_write(client, 0xd6, 0x00);
+
+   return ret;
+}
+
+static int ov9665_set_data_pin_out(struct i2c_client *client)
+{
+   int ret = 0;
+
+   ret += ov9665_write(client, 0xd5, 0xff);
+   ret += ov9665_write(client, 0xd6, 0xff);
+
+   return ret;
+}
+
+static int 

[PATCH v3 7/8] V4L2 subdev patchset for Intel Moorestown Camera Imaging Subsystem

2010-05-18 Thread Zhang, Xiaolin
From 9e72b71fd1c980bedd177590abe8faf24fc2c3b5 Mon Sep 17 00:00:00 2001
From: Xiaolin Zhang xiaolin.zh...@intel.com
Date: Tue, 18 May 2010 15:26:57 +0800
Subject: [PATCH 7/8] This patch is to add Renesas R2A30419BX VCM (for KMOT) 
driver support
 which is based on the video4linux2 sub-dev driver framework.

Signed-off-by: Xiaolin Zhang xiaolin.zh...@intel.com
---
 drivers/media/video/s5k4e1_motor.c |  413 
 drivers/media/video/s5k4e1_motor.h |   90 
 2 files changed, 503 insertions(+), 0 deletions(-)
 create mode 100644 drivers/media/video/s5k4e1_motor.c
 create mode 100644 drivers/media/video/s5k4e1_motor.h

diff --git a/drivers/media/video/s5k4e1_motor.c 
b/drivers/media/video/s5k4e1_motor.c
new file mode 100644
index 000..7ed1b77
--- /dev/null
+++ b/drivers/media/video/s5k4e1_motor.c
@@ -0,0 +1,413 @@
+/*
+ * Support for Moorestown Langwell Camera Imaging ISP subsystem.
+ *
+ * Copyright (c) 2009 Intel Corporation. All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version
+ * 2 as published by the Free Software Foundation.
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA.
+ *
+ *
+ * Xiaolin Zhang xiaolin.zh...@intel.com
+ */
+
+#include linux/i2c.h
+#include linux/delay.h
+#include linux/slab.h
+#include media/v4l2-device.h
+
+#include s5k4e1_motor.h
+
+static int s5k4e1_motor_debug;
+module_param(s5k4e1_motor_debug, int, 0644);
+MODULE_PARM_DESC(s5k4e1_motor_debug, Debug level (0-1));
+
+#define dprintk(level, fmt, arg...) \
+do {   \
+   if (s5k4e1_motor_debug = level) \
+   printk(KERN_DEBUG mrst...@%s:  fmt \n, __func__, ## arg); \
+} while (0)
+
+#define eprintk(fmt, arg...)   \
+   printk(KERN_ERR mrst...@%s: line %d:  fmt \n,   \
+  __func__, __LINE__, ## arg);
+
+static inline struct s5k4e1_motor *to_motor_config(struct v4l2_subdev *sd)
+{
+   return container_of(sd, struct s5k4e1_motor, sd);
+}
+
+static int motor_read(struct i2c_client *c, u32 *reg)
+{
+   int ret;
+   struct i2c_msg msg;
+   u8 msgbuf[3];
+
+   msgbuf[0] = 0;
+   msgbuf[1] = 0;
+   msgbuf[2] = 0;
+
+   memset(msg, 0, sizeof(msg));
+   msg.addr = c-addr;
+   msg.buf = msgbuf;
+   msg.len = 3;
+   msg.flags = I2C_M_RD;
+
+   ret = i2c_transfer(c-adapter, msg, 1);
+
+   *reg = (msgbuf[0]  16 | msgbuf[1]  8 | msgbuf[2]);
+
+   ret = (ret == 1) ? 0 : -1;
+   return ret;
+}
+
+static int motor_write(struct i2c_client *c, u32 reg)
+{
+   int ret;
+   struct i2c_msg msg;
+   u8 msgbuf[3];
+
+   memset(msg, 0, sizeof(msg));
+   msgbuf[0] = (reg  0x00)  16;
+   msgbuf[1] = (reg  0x)  8 ;
+   msgbuf[2] = reg;
+
+   msg.addr = c-addr;
+   msg.flags = 0;
+   msg.buf = msgbuf;
+   msg.len = 3;
+
+   ret = i2c_transfer(c-adapter, msg, 1);
+
+   ret = (ret == 1) ? 0 : -1;
+   return ret;
+}
+
+static int s5k4e1_motor_goto_position(struct i2c_client *c,
+ unsigned short code,
+ struct s5k4e1_motor *config,
+ unsigned int step)
+{
+   int max_code, min_code;
+   int timeout = 25; /*TODO: check the timeout time */
+   u8 cmdh, cmdl, finished;
+   u32 cmd = 0, val = 0;
+
+   max_code = config-macro_code;
+   min_code = config-infin_code;
+
+   if (code  max_code)
+   code = max_code;
+   if (code  min_code)
+   code = min_code;
+
+   cmdh = MOTOR_DAC_CTRL_MODE_1 | (code  8); /* PS EN x x M W TD9 TD8*/
+   cmdl = code; /* TD7 ~ TD0 */
+   cmd |= (cmdh  16) | (cmdl  8);
+
+   dprintk(1, cmdh: %x, cmdl: %x, cmd: %x, cmdh, cmdl, cmd);
+   dprintk(1, DAC code: %x, code);
+
+   motor_write(c, cmd);
+   finished = 0;
+   while ((!finished)  timeout--) {
+   msleep(1);
+   motor_read(c, val);
+   cmdh = val  16;
+   cmdl = val  8;
+
+   dprintk(1, cmdh  MOTOR_F = %x, cmdh  MOTOR_F);
+   finished = cmdh  MOTOR_F;
+   finished = (finished) ? 0 : 1;
+   };
+
+   if (finished) {
+   dprintk(1, Moving from code %x to code %x takes %d ms.,
+  config-cur_code, code, 25-timeout);
+   return 0;
+   } else {
+   eprintk(Unable to move motor to step %d, 

[PATCH] Add 12 bit RAW Bayer Pattern pixel format support in V4L2

2010-05-18 Thread Zhang, Xiaolin
From 54079deb89764a9399c95098e4c3830c88d24a5c Mon Sep 17 00:00:00 2001
From: Xiaolin Zhang xiaolin.zh...@intel.com
Date: Tue, 18 May 2010 18:02:24 +0800
Subject: [PATCH] Add 12 bit RAW Bayer Pattern pixel format support.

Signed-off-by: Xiaolin Zhang xiaolin.zh...@intel.com
---
 Documentation/DocBook/v4l/videodev2.h.xml |   10 +-
 include/linux/videodev2.h |4 
 2 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/Documentation/DocBook/v4l/videodev2.h.xml 
b/Documentation/DocBook/v4l/videodev2.h.xml
index 0683259..649ef9e 100644
--- a/Documentation/DocBook/v4l/videodev2.h.xml
+++ b/Documentation/DocBook/v4l/videodev2.h.xml
@@ -330,7 +330,15 @@ struct link 
linkend=v4l2-pix-formatv4l2_pix_format/link {
 #define link linkend=V4L2-PIX-FMT-SBGGR8V4L2_PIX_FMT_SBGGR8/link  
v4l2_fourcc('B', 'A', '8', '1') /*  8  BGBG.. GRGR.. */
 #define link linkend=V4L2-PIX-FMT-SGBRG8V4L2_PIX_FMT_SGBRG8/link  
v4l2_fourcc('G', 'B', 'R', 'G') /*  8  GBGB.. RGRG.. */
 #define link linkend=V4L2-PIX-FMT-SGRBG8V4L2_PIX_FMT_SGRBG8/link  
v4l2_fourcc('G', 'R', 'B', 'G') /*  8  GRGR.. BGBG.. */
-#define link linkend=V4L2-PIX-FMT-SGRBG10V4L2_PIX_FMT_SGRBG10/link 
v4l2_fourcc('B', 'A', '1', '0') /* 10bit raw bayer */
+#define link linkend=V4L2-PIX-FMT-SGRBG8V4L2_PIX_FMT_SRGGB8/link  
v4l2_fourcc('R', 'G', 'G', 'B') /*  8  RGRG.. GBGB.. */
+#define link linkend=V4L2-PIX-FMT-SBGGR10V4L2_PIX_FMT_SBGGR10/link  
v4l2_fourcc('B', 'G', '1', '0') /*  10  BGBG.. GRGR.. */
+#define link linkend=V4L2-PIX-FMT-SGBRG10V4L2_PIX_FMT_SGBRG10/link  
v4l2_fourcc('G', 'B', '1', '0') /*  10  GBGB.. RGRG.. */
+#define link linkend=V4L2-PIX-FMT-SGRBG10V4L2_PIX_FMT_SGRBG10/link  
v4l2_fourcc('B', 'A', '1', '0') /*  10  GRGR.. BGBG.. */
+#define link linkend=V4L2-PIX-FMT-SGRBG10V4L2_PIX_FMT_SRGGB10/link  
v4l2_fourcc('R', 'G', '1', '0') /*  10  RGRG.. GBGB.. */
+#define link linkend=V4L2-PIX-FMT-SBGGR12V4L2_PIX_FMT_SBGGR12/link  
v4l2_fourcc('B', 'G', '1', '2') /*  12  BGBG.. GRGR.. */
+#define link linkend=V4L2-PIX-FMT-SGBRG12V4L2_PIX_FMT_SGBRG12/link  
v4l2_fourcc('G', 'B', '1', '2') /*  12  GBGB.. RGRG.. */
+#define link linkend=V4L2-PIX-FMT-SGRBG12V4L2_PIX_FMT_SGRBG12/link  
v4l2_fourcc('B', 'A', '1', '2') /*  12  GRGR.. BGBG.. */
+#define link linkend=V4L2-PIX-FMT-SGRBG12V4L2_PIX_FMT_SRGGB12/link  
v4l2_fourcc('R', 'G', '1', '2') /*  12  RGRG.. GBGB.. */
 /* 10bit raw bayer DPCM compressed to 8 bits */
 #define link 
linkend=V4L2-PIX-FMT-SGRBG10DPCM8V4L2_PIX_FMT_SGRBG10DPCM8/link 
v4l2_fourcc('B', 'D', '1', '0')
 /*
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index 3793d16..202092a 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -335,6 +335,10 @@ struct v4l2_pix_format {
 #define V4L2_PIX_FMT_SGBRG10 v4l2_fourcc('G', 'B', '1', '0') /* 10  GBGB.. 
RGRG.. */
 #define V4L2_PIX_FMT_SGRBG10 v4l2_fourcc('B', 'A', '1', '0') /* 10  GRGR.. 
BGBG.. */
 #define V4L2_PIX_FMT_SRGGB10 v4l2_fourcc('R', 'G', '1', '0') /* 10  RGRG.. 
GBGB.. */
+#define V4L2_PIX_FMT_SBGGR12 v4l2_fourcc('B', 'G', '1', '2') /* 12  BGBG.. 
GRGR.. */
+#define V4L2_PIX_FMT_SGBRG12 v4l2_fourcc('G', 'B', '1', '2') /* 12  GBGB.. 
RGRG.. */
+#define V4L2_PIX_FMT_SGRBG12 v4l2_fourcc('B', 'A', '1', '2') /* 12  GRGR.. 
BGBG.. */
+#define V4L2_PIX_FMT_SRGGB12 v4l2_fourcc('R', 'G', '1', '2') /* 12  RGRG.. 
GBGB.. */
/* 10bit raw bayer DPCM compressed to 8 bits */
 #define V4L2_PIX_FMT_SGRBG10DPCM8 v4l2_fourcc('B', 'D', '1', '0')
/*
-- 
1.6.3.2

--
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] Moving v4l1 ioctls from kernel to libv4l1

2010-05-18 Thread Huzaifa Sidhpurwala
Hi All,
I have been working with Hans for moving the v4l1 ioctls from the kernel
to libv4l1.
It would be best to work on one ioctl at a time.
The enclosed patch attempts to implement VIDIOCGCAP in the libv4l1.

Note: Hans is working with Bill, asking for permission to re-use the
v4l1-compat.c code under the LGPL



diff --git a/lib/libv4l1/libv4l1.c b/lib/libv4l1/libv4l1.c
index eae3b43..8571651 100644
--- a/lib/libv4l1/libv4l1.c
+++ b/lib/libv4l1/libv4l1.c
@@ -61,6 +61,10 @@
 #define V4L1_PIX_FMT_TOUCHED0x04
 #define V4L1_PIX_SIZE_TOUCHED   0x08

+#ifndef min
+   #define min( a, b ) ( ((a)  (b)) ? (a) : (b) )
+#endif
+
 static pthread_mutex_t v4l1_open_mutex = PTHREAD_MUTEX_INITIALIZER;
 static struct v4l1_dev_info devices[V4L1_MAX_DEVICES] = {
{ .fd = -1 },
@@ -130,6 +134,45 @@ static unsigned int pixelformat_to_palette(unsigned
int pixelformat)
return 0;
 }

+static int count_inputs(int fd)
+{
+   struct v4l2_input input2;
+   int i;
+   for (i = 0;; i++) {
+   memset(input2, 0, sizeof(input2));
+   input2.index = i;
+   if (0 != SYS_IOCTL(fd, VIDIOC_ENUMINPUT, input2))
+   break;
+   }
+   return i;
+}
+
+static int check_size(int fd,int *maxw,int *maxh)
+{
+   struct v4l2_fmtdesc desc2;
+   struct v4l2_format fmt2;
+
+   memset(desc2, 0, sizeof(desc2));
+   memset(fmt2, 0, sizeof(fmt2));
+
+   desc2.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+   if (0 != SYS_IOCTL(fd, VIDIOC_ENUM_FMT, desc2))
+   goto done;
+
+   fmt2.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+   fmt2.fmt.pix.width = 1;
+   fmt2.fmt.pix.height = 1;
+   fmt2.fmt.pix.pixelformat = desc2.pixelformat;
+   if (0 != SYS_IOCTL(fd, VIDIOC_TRY_FMT, fmt2))
+   goto done;
+
+   *maxw = fmt2.fmt.pix.width;
+   *maxh = fmt2.fmt.pix.height;
+
+   done:
+   return 0;
+}
+
 static int v4l1_set_format(int index, unsigned int width,
unsigned int height, int v4l1_pal, int width_height_may_differ)
 {
@@ -492,7 +535,54 @@ int v4l1_ioctl(int fd, unsigned long int request, ...)
case VIDIOCGCAP: {
struct video_capability *cap = arg;

-   result = SYS_IOCTL(fd, request, arg);
+   long err;
+   struct v4l2_framebuffer fbuf;
+   struct v4l2_capability *cap2;
+
+   cap2 = malloc (sizeof(*cap2));
+   if (!cap2) {
+   return -ENOMEM;
+   }
+
+   memset(cap,0,sizeof(*cap));
+   memset(fbuf, 0, sizeof(fbuf));
+
+   err = SYS_IOCTL(fd, VIDIOC_QUERYCAP,cap2);
+   if (err  0)
+   goto done;
+
+   if (cap2-capabilities  V4L2_CAP_VIDEO_OVERLAY) {
+   err = SYS_IOCTL(fd, VIDIOC_G_FBUF, fbuf);
+   if (err  0) {
+   memset(fbuf, 0, sizeof(fbuf));
+   }
+   err = 0;
+   }
+   
+   memcpy(cap-name,  cap2-card,
min(sizeof(cap-name),sizeof(cap2-card)) );
+   
+   cap-name[sizeof(cap-name) -1 ] = 0;
+   
+   if (cap2-capabilities  V4L2_CAP_VIDEO_CAPTURE)
+   cap-type |= VID_TYPE_CAPTURE;
+   if (cap2-capabilities  V4L2_CAP_TUNER)
+   cap-type |= VID_TYPE_TUNER;
+   if (cap2-capabilities  V4L2_CAP_VBI_CAPTURE)
+   cap-type |= VID_TYPE_TELETEXT;
+   if (cap2-capabilities  V4L2_CAP_VIDEO_OVERLAY)
+   cap-type |= VID_TYPE_OVERLAY;
+   if (fbuf.capability  V4L2_FBUF_CAP_LIST_CLIPPING)
+   cap-type |= VID_TYPE_CLIPPING;
+
+   cap-channels = count_inputs(fd);
+
+   check_size(fd,
+   cap-maxwidth, cap-maxheight);
+   
+   
+   /*  result = SYS_IOCTL(fd, request, arg);*/
+
+

/* override kernel v4l1 compat min / max size with our own more
   accurate values */
@@ -500,7 +590,10 @@ int v4l1_ioctl(int fd, unsigned long int request, ...)
cap-minheight = devices[index].min_height;
cap-maxwidth  = devices[index].max_width;
cap-maxheight = devices[index].max_height;
-   break;
+
+   done:
+   free(cap2);
+   break;
}

case VIDIOCSPICT: {

-- 
Regards,
Huzaifa Sidhpurwala, RHCE, CCNA (IRC: huzaifas)
IT Desktop RD Lead.
Global Help Desk, Pune (India)
Phone: +91 20 4005 7322 (UTC +5.5)

GnuPG Fingerprint:
3A0F DAFB 9279 02ED 273B FFE9 CC70 DCF2 DA5B DAE5
--
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  

Re: [Patch] Moving v4l1 ioctls from kernel to libv4l1

2010-05-18 Thread Hans de Goede

Hi Huzaifa,

First of all many thanks for working on this!

Comments inline.

On 05/18/2010 01:12 PM, Huzaifa Sidhpurwala wrote:

Hi All,
I have been working with Hans for moving the v4l1 ioctls from the kernel
to libv4l1.
It would be best to work on one ioctl at a time.
The enclosed patch attempts to implement VIDIOCGCAP in the libv4l1.

Note: Hans is working with Bill, asking for permission to re-use the
v4l1-compat.c code under the LGPL



diff --git a/lib/libv4l1/libv4l1.c b/lib/libv4l1/libv4l1.c
index eae3b43..8571651 100644
--- a/lib/libv4l1/libv4l1.c
+++ b/lib/libv4l1/libv4l1.c
@@ -61,6 +61,10 @@
  #define V4L1_PIX_FMT_TOUCHED0x04
  #define V4L1_PIX_SIZE_TOUCHED   0x08

+#ifndef min
+   #define min( a, b ) ( ((a)  (b)) ? (a) : (b) )
+#endif
+
  static pthread_mutex_t v4l1_open_mutex = PTHREAD_MUTEX_INITIALIZER;
  static struct v4l1_dev_info devices[V4L1_MAX_DEVICES] = {
{ .fd = -1 },
@@ -130,6 +134,45 @@ static unsigned int pixelformat_to_palette(unsigned
int pixelformat)
return 0;
  }

+static int count_inputs(int fd)
+{
+   struct v4l2_input input2;
+   int i;
+   for (i = 0;; i++) {
+   memset(input2, 0, sizeof(input2));
+   input2.index = i;
+   if (0 != SYS_IOCTL(fd, VIDIOC_ENUMINPUT,input2))
+   break;
+   }
+   return i;
+}
+
+static int check_size(int fd,int *maxw,int *maxh)
+{
+   struct v4l2_fmtdesc desc2;
+   struct v4l2_format fmt2;
+
+   memset(desc2, 0, sizeof(desc2));
+   memset(fmt2, 0, sizeof(fmt2));
+
+   desc2.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+   if (0 != SYS_IOCTL(fd, VIDIOC_ENUM_FMT,desc2))
+   goto done;
+
+   fmt2.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+   fmt2.fmt.pix.width = 1;
+   fmt2.fmt.pix.height = 1;
+   fmt2.fmt.pix.pixelformat = desc2.pixelformat;
+   if (0 != SYS_IOCTL(fd, VIDIOC_TRY_FMT,fmt2))
+   goto done;
+
+   *maxw = fmt2.fmt.pix.width;
+   *maxh = fmt2.fmt.pix.height;
+
+   done:
+   return 0;
+}
+


We don't need this function, see below.


  static int v4l1_set_format(int index, unsigned int width,
unsigned int height, int v4l1_pal, int width_height_may_differ)
  {
@@ -492,7 +535,54 @@ int v4l1_ioctl(int fd, unsigned long int request, ...)
case VIDIOCGCAP: {
struct video_capability *cap = arg;

-   result = SYS_IOCTL(fd, request, arg);
+   long err;
+   struct v4l2_framebuffer fbuf;
+   struct v4l2_capability *cap2;


The kernel mallocs struct v4l2_capability because the kernel
stack is severely limited, no need to do that in userspace, just
put the entire struct on the stack.


+
+   cap2 = malloc (sizeof(*cap2));
+   if (!cap2) {
+   return -ENOMEM;
+   }
+
+   memset(cap,0,sizeof(*cap));
+   memset(fbuf, 0, sizeof(fbuf));
+


You can get the memset effect, by initalizing the first field of the
struct to 0, the compiler will then 0 out the rest:
struct v4l2_framebuffer fbuf = { 0, };
struct v4l2_capability cap2 =  { 0, };



+   err = SYS_IOCTL(fd, VIDIOC_QUERYCAP,cap2);
+   if (err  0)
+   goto done;
+
+   if (cap2-capabilities  V4L2_CAP_VIDEO_OVERLAY) {
+   err = SYS_IOCTL(fd, VIDIOC_G_FBUF,fbuf);
+   if (err  0) {
+   memset(fbuf, 0, sizeof(fbuf));
+   }
+   err = 0;
+   }
+   
+   memcpy(cap-name,  cap2-card,
min(sizeof(cap-name),sizeof(cap2-card)) );
+   
+   cap-name[sizeof(cap-name) -1 ] = 0;
+   
+   if (cap2-capabilities  V4L2_CAP_VIDEO_CAPTURE)
+   cap-type |= VID_TYPE_CAPTURE;
+   if (cap2-capabilities  V4L2_CAP_TUNER)
+   cap-type |= VID_TYPE_TUNER;
+   if (cap2-capabilities  V4L2_CAP_VBI_CAPTURE)
+   cap-type |= VID_TYPE_TELETEXT;
+   if (cap2-capabilities  V4L2_CAP_VIDEO_OVERLAY)
+   cap-type |= VID_TYPE_OVERLAY;
+   if (fbuf.capability  V4L2_FBUF_CAP_LIST_CLIPPING)
+   cap-type |= VID_TYPE_CLIPPING;
+
+   cap-channels = count_inputs(fd);
+
+   check_size(fd,
+   cap-maxwidth,cap-maxheight);
+   


No need to check size here, as we override that below, so this line can
be dropped.


+   
+   /*  result = SYS_IOCTL(fd, request, arg);*/
+


This can be dropped too.


+

/* override kernel v4l1 compat min / max size with our own more
   accurate values */


And the override comment can be dropped to, as we no longer will be
suing the v4l1 

bugreport: tt-budget c-1501 - buffer larger than encounte size

2010-05-18 Thread dietmar . hein
Hi all,

I am using yaVDR 0.1.1 based on ubuntu 9.10 i386
-- DVB-C card: TT-Budget C-1501
Multimedia controller: Philips Semiconductors SAA7146 (rev 01)

-- several times when switching channels buffer error occurs:

dmesg | grep buffer
[ 6194.632558] dvb_ca adapter 0: CAM tried to send a buffer larger than the 
ecount size!
[ 6263.209584] saa7146 (0): dma buffer size 192512

/var/log/messages
May  9 17:47:51 hostname kernel: [11344.224843] dvb_ca adapter 0: CAM tried 
to send a buffer larger than the ecount size!
May  9 17:47:51 hostname kernel: [11344.224860] dvb_ca adapter 0: DVB CAM 
link initialisation failed :(

If you need more informations feel free to reply to my email
thx.
/regards dietmar


--
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


Re: [PATCH] si4713: Fix oops when si4713_platform_data is marked as __initdata

2010-05-18 Thread Eduardo Valentin
Hello,

On Sun, May 16, 2010 at 07:04:26PM +0200, Jarkko Nikula wrote:
 This driver can cause an oops if si4713_platform_data holding pointer to
 set_power function is marked as __initdata and when trying to power up the
 chip after booting e.g. with 'v4l2-ctl -d /dev/radio0 --set-ctrl=mute=0'.
 
 This happens because the sdev-platform_data doesn't point to valid data
 anymore after kernel is initialized.
 
 Fix this by taking local copy of si4713_platform_data-set_power. Add also
 NULL check for this function pointer.

I'm probably fine with this patch, and the driver must check for the pointer
before using it, indeed.

But, I'm a bit skeptic about marking its platform data as __initdata. Would it 
make sense?
What happens if driver is built as module and loaded / unload / loaded again?

Maybe the initdata flag does not apply in this case. Not sure (and not tested 
the above case).

BR,

 
 Signed-off-by: Jarkko Nikula jhnik...@gmail.com
 Cc: Eduardo Valentin eduardo.valen...@nokia.com
 ---
  drivers/media/radio/si4713-i2c.c |   15 +--
  drivers/media/radio/si4713-i2c.h |2 +-
  2 files changed, 10 insertions(+), 7 deletions(-)
 
 diff --git a/drivers/media/radio/si4713-i2c.c 
 b/drivers/media/radio/si4713-i2c.c
 index ab63dd5..cf9858d 100644
 --- a/drivers/media/radio/si4713-i2c.c
 +++ b/drivers/media/radio/si4713-i2c.c
 @@ -369,7 +369,8 @@ static int si4713_powerup(struct si4713_device *sdev)
   if (sdev-power_state)
   return 0;
  
 - sdev-platform_data-set_power(1);
 + if (sdev-set_power)
 + sdev-set_power(1);
   err = si4713_send_command(sdev, SI4713_CMD_POWER_UP,
   args, ARRAY_SIZE(args),
   resp, ARRAY_SIZE(resp),
 @@ -383,8 +384,8 @@ static int si4713_powerup(struct si4713_device *sdev)
  
   err = si4713_write_property(sdev, SI4713_GPO_IEN,
   SI4713_STC_INT | SI4713_CTS);
 - } else {
 - sdev-platform_data-set_power(0);
 + } else if (sdev-set_power) {
 + sdev-set_power(0);
   }
  
   return err;
 @@ -411,7 +412,8 @@ static int si4713_powerdown(struct si4713_device *sdev)
   v4l2_dbg(1, debug, sdev-sd, Power down response: 0x%02x\n,
   resp[0]);
   v4l2_dbg(1, debug, sdev-sd, Device in reset mode\n);
 - sdev-platform_data-set_power(0);
 + if (sdev-set_power)
 + sdev-set_power(0);
   sdev-power_state = POWER_OFF;
   }
  
 @@ -1959,6 +1961,7 @@ static int si4713_probe(struct i2c_client *client,
   const struct i2c_device_id *id)
  {
   struct si4713_device *sdev;
 + struct si4713_platform_data *pdata = client-dev.platform_data;
   int rval;
  
   sdev = kzalloc(sizeof *sdev, GFP_KERNEL);
 @@ -1968,12 +1971,12 @@ static int si4713_probe(struct i2c_client *client,
   goto exit;
   }
  
 - sdev-platform_data = client-dev.platform_data;
 - if (!sdev-platform_data) {
 + if (!pdata) {
   v4l2_err(sdev-sd, No platform data registered.\n);
   rval = -ENODEV;
   goto free_sdev;
   }
 + sdev-set_power = pdata-set_power;
  
   v4l2_i2c_subdev_init(sdev-sd, client, si4713_subdev_ops);
  
 diff --git a/drivers/media/radio/si4713-i2c.h 
 b/drivers/media/radio/si4713-i2c.h
 index faf8cff..d1af889 100644
 --- a/drivers/media/radio/si4713-i2c.h
 +++ b/drivers/media/radio/si4713-i2c.h
 @@ -220,7 +220,7 @@ struct si4713_device {
   /* private data structures */
   struct mutex mutex;
   struct completion work;
 - struct si4713_platform_data *platform_data;
 + int (*set_power)(int power);
   struct rds_info rds_info;
   struct limiter_info limiter_info;
   struct pilot_info pilot_info;
 -- 
 1.7.1
--
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


Re: [PATCH] si4713: Fix oops when si4713_platform_data is marked as __initdata

2010-05-18 Thread Jarkko Nikula
On Tue, 18 May 2010 15:55:27 +0300
Eduardo Valentin eduardo.valen...@nokia.com wrote:

 I'm probably fine with this patch, and the driver must check for the pointer
 before using it, indeed.
 
 But, I'm a bit skeptic about marking its platform data as __initdata. Would 
 it make sense?
 What happens if driver is built as module and loaded / unload / loaded again?
 
 Maybe the initdata flag does not apply in this case. Not sure (and not tested 
 the above case).
 
Yep, it doesn't work or make sense for modules if platform data is
marked as __initdata but with built in case it can save some bytes which
are not needed after kernel is initialized.

Like with this driver the i2c_bus number and i2_board_info data are not
needed after probing but only pointer to set_power must be preserved.


-- 
Jarkko
--
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


new DVB-T initial tuning for fr-nantes

2010-05-18 Thread matpic
hello

As from today (18/05/2010) there is new frequency since analogic signal
is stopped and is now only numeric.


guard-interval has to be set to AUTO or scan find anything
 (1/32, 1/16, 1/8 ,1/4 doesn't work)


# Nantes - France
# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy
T 53800 8MHz 2/3 NONE QAM64 8k AUTO NONE
T 49000 8MHz 2/3 NONE QAM64 8k AUTO NONE
T 54600 8MHz 2/3 NONE QAM64 8k AUTO NONE
T 65800 8MHz 2/3 NONE QAM64 8k AUTO NONE
T 68200 8MHz 2/3 NONE QAM64 8k AUTO NONE
T 73800 8MHz 2/3 NONE QAM64 8k AUTO NONE
#same frequency + offset 16700 for some hardware DVB-T tuner
T 538167000 8MHz 2/3 NONE QAM64 8k AUTO NONE
T 546167000 8MHz 2/3 NONE QAM64 8k AUTO NONE
T 658167000 8MHz 2/3 NONE QAM64 8k AUTO NONE
T 682167000 8MHz 2/3 NONE QAM64 8k AUTO NONE
T 738167000 8MHz 2/3 NONE QAM64 8k AUTO NONE
--
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


Re: [linux-dvb] new DVB-T initial tuning for fr-nantes

2010-05-18 Thread Christophe Thommeret
Le mardi 18 mai 2010 16:25:56, BOUWSMA Barry a écrit :
 On wto (wtorek) 18.maj (maj) 2010, 15:05:00, matpic wrote:
 
 Salut!
 
  hello
  As from today (18/05/2010) there is new frequency since analogic signal
  is stopped and is now only numeric.
  guard-interval has to be set to AUTO or scan find anything
  
   (1/32, 1/16, 1/8 ,1/4 doesn't work)
 
 I do not have the CSA data at hand, but I understand that
 presently use is made of single transmitter sites, in a MFN
 (Multi-Frequency Network) and thus a guard interval of 1/32 should
 be correct.
 
 (I understand though that some filler transmitters may be in
 planning so that a small SFN may be put in service, but I am
 not clear as to these details...  I must research this.)
 
  #same frequency + offset 16700 for some hardware DVB-T tuner
 
 It was my understanding that the different offsets above or
 below the nominal centre frequency is a result of mixed digital
 and legacy analogue services co-broadcasting, in order to avoid
 interference with adjacent channels.
 
 So I am wondering whether, in the absence of local analogue
 services, this offset is no longer employed?
 
 I am afraid that I am not following the conversion to TNT so
 closely to know if a whole geographic region, in this case the
 Loire, is having the remaining analogue services shut down all
 at once, or if it is being done on a site-by-site basis, with
 the potential for interference to a more remote but still
 operational analogue transmitter.
 
 In any case, all but one of the new frequencies appear to be
 very different from the ones previously used before today.
 
 
 Merci, for reporting this change!
 
 barry bouwsma

All analogic services are all closed at once.
I guess the offset is there to help some (buggy?) devices, like cinergy T2, 
not to reflect a real frequency offset.

-- 
Christophe Thommeret


--
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


Re: [linux-dvb] new DVB-T initial tuning for fr-nantes

2010-05-18 Thread Christophe Thommeret
Le mardi 18 mai 2010 16:39:56, Christophe Thommeret a écrit :
 Le mardi 18 mai 2010 16:25:56, BOUWSMA Barry a écrit :
  On wto (wtorek) 18.maj (maj) 2010, 15:05:00, matpic wrote:
  
  Salut!
  
   hello
   As from today (18/05/2010) there is new frequency since analogic signal
   is stopped and is now only numeric.
   guard-interval has to be set to AUTO or scan find anything
   
(1/32, 1/16, 1/8 ,1/4 doesn't work)
  
  I do not have the CSA data at hand, but I understand that
  presently use is made of single transmitter sites, in a MFN
  (Multi-Frequency Network) and thus a guard interval of 1/32 should
  be correct.
  
  (I understand though that some filler transmitters may be in
  planning so that a small SFN may be put in service, but I am
  not clear as to these details...  I must research this.)
  
   #same frequency + offset 16700 for some hardware DVB-T tuner
  
  It was my understanding that the different offsets above or
  below the nominal centre frequency is a result of mixed digital
  and legacy analogue services co-broadcasting, in order to avoid
  interference with adjacent channels.
  
  So I am wondering whether, in the absence of local analogue
  services, this offset is no longer employed?
  
  I am afraid that I am not following the conversion to TNT so
  closely to know if a whole geographic region, in this case the
  Loire, is having the remaining analogue services shut down all
  at once, or if it is being done on a site-by-site basis, with
  the potential for interference to a more remote but still
  operational analogue transmitter.
  
  In any case, all but one of the new frequencies appear to be
  very different from the ones previously used before today.
  
  
  Merci, for reporting this change!
  
  barry bouwsma
 
 All analogic services are all closed at once.
 I guess the offset is there to help some (buggy?) devices, like cinergy
 T2, not to reflect a real frequency offset.

BTW, analogic shut down has happened (18 may, 00:00) for the entire french 
region Pays de Loire, so a lot of transmitters are affected.
fr-Laval now uses these freqs:

71400
57000
77000
76200
65000
78600

-- 
Christophe Thommeret


--
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


Re: Pinnacle PCTV DVB-T 70e

2010-05-18 Thread Mauro Carvalho Chehab
Alexjan Carraturo wrote:

 Why not? Because nobody can cure this entry? Or why the driver is not
 compatible with the version in the kernel now?

For someone to add support to a device, it needs to have that device (or
a similar one), and to be able to get access to the datasheets or to use
some reverse engineering technique. One important information is what
are the chips inside the device.

 You can, however, look to see if you can add support for your device to
 the existing v4l-dvb kernel driver. There are several developers that
 are knowledgeable of the em28xx driver, and whom may be able to help you
 in that regard, but you will have to gain there attention first.


 
 I'm sorry, but even knowing a bit 'of the C programming language, I
 have never written a driver, I'm not able, and I honestly do not even
 capable.
 
 You tell me to add support to the current driver, but I have no idea
 how to do. It is also good to clarify that the driver on the kernel
 vanulla charge in the presence of this card, but simply does not work,
 and does not create deivce (/dev/dvb/).

Take a look at linuxtv WIKI pages. It explains several useful things
on how to add support to a new device.

 So knowing that I'm not able to write the driver, I would say that
 this device is definitely dead and buried ... in this case would be at
 least that was not loaded em28xx module (the one in the kernel),
 avoiding giving the illusion that the driver functions.
 
 I do not know if you can, but should be added, if any, in a sort of blacklist.

The USB ID used by your device is generic: all devices with em2870 without
eeprom will inform the same code (and even some with eeprom, but where
the vendor didn't care to write their own ID there).

What are the components used on your device?


-- 

Cheers,
Mauro
--
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


[cron job] v4l-dvb daily build 2.6.22 and up: ERRORS, 2.6.16-2.6.21: ERRORS

2010-05-18 Thread Hans Verkuil
This message is generated daily by a cron job that builds v4l-dvb for
the kernels and architectures in the list below.

Results of the daily build of v4l-dvb:

date:Tue May 18 19:00:29 CEST 2010
path:http://www.linuxtv.org/hg/v4l-dvb
changeset:   14862:f6303be936e4
git master:   f6760aa024199cfbce564311dc4bc4d47b6fb349
git media-master: 4fcfa8824391ef0f9cff82122067f31c6d920921
gcc version:  i686-linux-gcc (GCC) 4.4.3
host hardware:x86_64
host os:  2.6.32.5

linux-2.6.32.6-armv5: OK
linux-2.6.33-armv5: OK
linux-2.6.34-rc7-armv5: ERRORS
linux-2.6.32.6-armv5-davinci: OK
linux-2.6.33-armv5-davinci: OK
linux-2.6.34-rc7-armv5-davinci: ERRORS
linux-2.6.32.6-armv5-ixp: OK
linux-2.6.33-armv5-ixp: OK
linux-2.6.34-rc7-armv5-ixp: ERRORS
linux-2.6.32.6-armv5-omap2: OK
linux-2.6.33-armv5-omap2: OK
linux-2.6.34-rc7-armv5-omap2: ERRORS
linux-2.6.22.19-i686: ERRORS
linux-2.6.23.17-i686: ERRORS
linux-2.6.24.7-i686: ERRORS
linux-2.6.25.20-i686: ERRORS
linux-2.6.26.8-i686: ERRORS
linux-2.6.27.44-i686: ERRORS
linux-2.6.28.10-i686: WARNINGS
linux-2.6.29.1-i686: WARNINGS
linux-2.6.30.10-i686: WARNINGS
linux-2.6.31.12-i686: OK
linux-2.6.32.6-i686: OK
linux-2.6.33-i686: OK
linux-2.6.34-rc7-i686: ERRORS
linux-2.6.32.6-m32r: OK
linux-2.6.33-m32r: OK
linux-2.6.34-rc7-m32r: ERRORS
linux-2.6.32.6-mips: OK
linux-2.6.33-mips: OK
linux-2.6.34-rc7-mips: ERRORS
linux-2.6.32.6-powerpc64: OK
linux-2.6.33-powerpc64: OK
linux-2.6.34-rc7-powerpc64: ERRORS
linux-2.6.22.19-x86_64: ERRORS
linux-2.6.23.17-x86_64: ERRORS
linux-2.6.24.7-x86_64: ERRORS
linux-2.6.25.20-x86_64: ERRORS
linux-2.6.26.8-x86_64: ERRORS
linux-2.6.27.44-x86_64: ERRORS
linux-2.6.28.10-x86_64: WARNINGS
linux-2.6.29.1-x86_64: WARNINGS
linux-2.6.30.10-x86_64: WARNINGS
linux-2.6.31.12-x86_64: OK
linux-2.6.32.6-x86_64: OK
linux-2.6.33-x86_64: OK
linux-2.6.34-rc7-x86_64: ERRORS
linux-git-armv5: WARNINGS
linux-git-armv5-davinci: WARNINGS
linux-git-armv5-ixp: WARNINGS
linux-git-armv5-omap2: WARNINGS
linux-git-i686: WARNINGS
linux-git-m32r: OK
linux-git-mips: OK
linux-git-powerpc64: OK
linux-git-x86_64: WARNINGS
spec: ERRORS
spec-git: OK
sparse: ERRORS
linux-2.6.16.62-i686: ERRORS
linux-2.6.17.14-i686: ERRORS
linux-2.6.18.8-i686: ERRORS
linux-2.6.19.7-i686: ERRORS
linux-2.6.20.21-i686: ERRORS
linux-2.6.21.7-i686: ERRORS
linux-2.6.16.62-x86_64: ERRORS
linux-2.6.17.14-x86_64: ERRORS
linux-2.6.18.8-x86_64: ERRORS
linux-2.6.19.7-x86_64: ERRORS
linux-2.6.20.21-x86_64: ERRORS
linux-2.6.21.7-x86_64: ERRORS

Detailed results are available here:

http://www.xs4all.nl/~hverkuil/logs/Tuesday.log

Full logs are available here:

http://www.xs4all.nl/~hverkuil/logs/Tuesday.tar.bz2

The V4L-DVB specification from this daily build is here:

http://www.xs4all.nl/~hverkuil/spec/media.html
--
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 2.6.35] i7core/Nehalem/Nehalem-EP/Lynnfield/Westmore-EP

2010-05-18 Thread Mauro Carvalho Chehab
The following changes since commit 66f41d4c5c8a5deed66fdcc84509376c9a0bf9d8:
  Linus Torvalds (1):
Linux 2.6.34-rc6

are available in the git repository at:

  ssh://master.kernel.org/pub/scm/linux/kernel/git/i7core.git linux-next

This patch series adds support for memory error detection for the
Memory Controllers found on the Nehalem CPU's, from i7core to Xeon 56xx,
via EDAC interface.

It doesn't support Xeon 75xx CPU's, as they use a different type of
memory controller.

Cheers,
Mauro


Alan Cox (1):
  edac: i7core_edac produces undefined behaviour on 32bit

Alexander Beregalov (1):
  i7core_edac: fix memory leak of i7core_dev

Aristeu Rozanski (1):
  pci: Add a probing code that seeks for an specific bus

Jiri Slaby (1):
  EDAC: add __init to i7core_xeon_pci_fixup

Keith Mannthey (2):
  i7core_edac: Fix ecc enable shift
  i7core_edac: Probe on Xeons eariler

Mauro Carvalho Chehab (72):
  i7core_edac: Add an EDAC memory controller driver for Nehalem chipsets
  i7core_edac: Add error insertion code for Nehalem
  i7core_edac: Add more status functions to EDAC driver
  i7core_edac: Registers all supported MC functions
  i7core_edac: Show read/write virtual/physical channel association
  i7core_edac: A few fixes at error injection code
  i7core_edac: need mci-edac_check, otherwise module removal doesn't work
  i7core_edac: Add a memory check routine, based on device 3 function 4
  i7core_edac: Add additional tests for error detection
  i7core_edac: Properly fill struct csrow_info
  i7core_edac: Improve error handling
  i7core_edac: Add more information about each active dimm
  i7core_edac: Get more info about the memory DIMMs
  i7core_edac: Memory info fixes and preparation for properly filling 
cswrow data
  i7core_edac: fill csrows edac sysfs info
  i7core_edac: CodingStyle fixes
  edac_mce: Add an interface driver to report mce errors via edac
  edac/Kconfig: edac_mce can't be module
  i7core_edac: Add edac_mce glue
  i7core_edac: Adds write unlock to MC registers
  i7core_edac: Add a code to probe Xeon 55xx bus
  i7core_edac: add support for more than one MC socket
  i7core_edac: maps all sockets as if ther are one MC controller
  i7core_edac: decode mcelog error and send it via edac interface
  i7core_edac: some fixes at memory error parser
  i7core: fix probing on Xeon55xx
  i7core: check if the memory error is fatal or non-fatal
  i7core: enrich error information based on memory transaction type
  i7core: fix get_devices routine for Xeon55xx
  i7core: better document i7core_get_active_channels()
  i7core: add socket info at the debug msg
  i7core: remove some uneeded noisy debug messages
  i7core_edac: Some cleanups at displayed info
  i7core_edac: some fixes at error injection code
  i7core_edac: fix error codes for sysfs error injection interface
  i7core_edac: fix error injection
  Documentation/edac.txt: Add Nehalem specific EDAC characteristics
  i7core_edac: CodingSyle fixes/cleanups
  i7core_edac: Print an error message if pci register fails
  i7core_edac: Use Device 3 function 2 to report errors with RDIMM's
  i7core: Use registered memories per processor
  i7core_edac: Improve corrected_error_counts output for RDIMM
  i7core: temporary workaround to allow it to compile against 2.6.30
  Dynamically allocate memory for PCI devices
  i7core_edac: create one mc per socket/QPI
  i7core_edac: sanity check: print a warning if a mcelog is ignored
  i7core_edac: a few fixes for multiple mc's
  Documentation/edac.txt: Improve it to reflect the latest changes at the 
driver
  i7core_edac: Fix a bug when printing error counts with RDIMMs
  i7core_edac: at remove, don't remove all pci devices at once
  i7core_edac: remove static counter for max sockets
  i7core_edac: change remove module strategy
  i7core_edac: We need to use list_for_each_entry_safe to avoid errors
  i7core_edac: Avoid printing a warning when debug is disabled
  edac_core: Allow the creation of sysfs groups
  i7core_edac: Add support for sysfs addrmatch group
  edac: store/show methods for device groups weren't working
  edac: Don't create csrow entries on instance groups
  i7core_edac: Convert UDIMM error counters into a proper sysfs group
  Documentation/edac.txt: Reflect the sysfs changes at the document
  edac: Create an unique instance for each kobj
  i7core_edac: Use a lockless ringbuffer
  i7core_edac: Better parse any addrmask
  i7core_edac: First store, then increment
  i7core_edac: Fix ringbuffer maxsize
  i7core_edac: PCI device is called NONCORE, instead of NOCORE
  i7core_edac: Use a more generic approach for probing PCI devices
  i7core_edac: Add initial support for Lynnfield
  i7core: add support for Lynnfield 

Re: [GIT PULL for 2.6.35] i7core/Nehalem/Nehalem-EP/Lynnfield/Westmore-EP

2010-05-18 Thread Mauro Carvalho Chehab
Mauro Carvalho Chehab wrote:
 The following changes since commit 66f41d4c5c8a5deed66fdcc84509376c9a0bf9d8:
   Linus Torvalds (1):
 Linux 2.6.34-rc6
 
 are available in the git repository at:
 
   ssh://master.kernel.org/pub/scm/linux/kernel/git/i7core.git linux-next

Sorry, this pull request were not meant to be c/c to LMML, but, instead, to 
LKML... 
It seems that my fingers were on automatic mode ;-)

 
 This patch series adds support for memory error detection for the
 Memory Controllers found on the Nehalem CPU's, from i7core to Xeon 56xx,
 via EDAC interface.
 
 It doesn't support Xeon 75xx CPU's, as they use a different type of
 memory controller.
 
 Cheers,
 Mauro
 
 
 Alan Cox (1):
   edac: i7core_edac produces undefined behaviour on 32bit
 
 Alexander Beregalov (1):
   i7core_edac: fix memory leak of i7core_dev
 
 Aristeu Rozanski (1):
   pci: Add a probing code that seeks for an specific bus
 
 Jiri Slaby (1):
   EDAC: add __init to i7core_xeon_pci_fixup
 
 Keith Mannthey (2):
   i7core_edac: Fix ecc enable shift
   i7core_edac: Probe on Xeons eariler
 
 Mauro Carvalho Chehab (72):
   i7core_edac: Add an EDAC memory controller driver for Nehalem chipsets
   i7core_edac: Add error insertion code for Nehalem
   i7core_edac: Add more status functions to EDAC driver
   i7core_edac: Registers all supported MC functions
   i7core_edac: Show read/write virtual/physical channel association
   i7core_edac: A few fixes at error injection code
   i7core_edac: need mci-edac_check, otherwise module removal doesn't work
   i7core_edac: Add a memory check routine, based on device 3 function 4
   i7core_edac: Add additional tests for error detection
   i7core_edac: Properly fill struct csrow_info
   i7core_edac: Improve error handling
   i7core_edac: Add more information about each active dimm
   i7core_edac: Get more info about the memory DIMMs
   i7core_edac: Memory info fixes and preparation for properly filling 
 cswrow data
   i7core_edac: fill csrows edac sysfs info
   i7core_edac: CodingStyle fixes
   edac_mce: Add an interface driver to report mce errors via edac
   edac/Kconfig: edac_mce can't be module
   i7core_edac: Add edac_mce glue
   i7core_edac: Adds write unlock to MC registers
   i7core_edac: Add a code to probe Xeon 55xx bus
   i7core_edac: add support for more than one MC socket
   i7core_edac: maps all sockets as if ther are one MC controller
   i7core_edac: decode mcelog error and send it via edac interface
   i7core_edac: some fixes at memory error parser
   i7core: fix probing on Xeon55xx
   i7core: check if the memory error is fatal or non-fatal
   i7core: enrich error information based on memory transaction type
   i7core: fix get_devices routine for Xeon55xx
   i7core: better document i7core_get_active_channels()
   i7core: add socket info at the debug msg
   i7core: remove some uneeded noisy debug messages
   i7core_edac: Some cleanups at displayed info
   i7core_edac: some fixes at error injection code
   i7core_edac: fix error codes for sysfs error injection interface
   i7core_edac: fix error injection
   Documentation/edac.txt: Add Nehalem specific EDAC characteristics
   i7core_edac: CodingSyle fixes/cleanups
   i7core_edac: Print an error message if pci register fails
   i7core_edac: Use Device 3 function 2 to report errors with RDIMM's
   i7core: Use registered memories per processor
   i7core_edac: Improve corrected_error_counts output for RDIMM
   i7core: temporary workaround to allow it to compile against 2.6.30
   Dynamically allocate memory for PCI devices
   i7core_edac: create one mc per socket/QPI
   i7core_edac: sanity check: print a warning if a mcelog is ignored
   i7core_edac: a few fixes for multiple mc's
   Documentation/edac.txt: Improve it to reflect the latest changes at the 
 driver
   i7core_edac: Fix a bug when printing error counts with RDIMMs
   i7core_edac: at remove, don't remove all pci devices at once
   i7core_edac: remove static counter for max sockets
   i7core_edac: change remove module strategy
   i7core_edac: We need to use list_for_each_entry_safe to avoid errors
   i7core_edac: Avoid printing a warning when debug is disabled
   edac_core: Allow the creation of sysfs groups
   i7core_edac: Add support for sysfs addrmatch group
   edac: store/show methods for device groups weren't working
   edac: Don't create csrow entries on instance groups
   i7core_edac: Convert UDIMM error counters into a proper sysfs group
   Documentation/edac.txt: Reflect the sysfs changes at the document
   edac: Create an unique instance for each kobj
   i7core_edac: Use a lockless ringbuffer
   i7core_edac: Better parse any addrmask
   i7core_edac: First store, then increment
   

Re: av7110 and budget_av are broken!

2010-05-18 Thread hermann pitton
Hi,

Am Sonntag, den 16.05.2010, 06:21 +0200 schrieb Oliver Endriss:
 On Sunday 16 May 2010 03:53:48 hermann pitton wrote:
  
  Am Samstag, den 15.05.2010, 22:33 -0300 schrieb Douglas Schilling
  Landgraf:
   Hello Oliver,
   
   On Sat, May 15, 2010 at 8:06 PM, Oliver Endriss o.endr...@gmx.de wrote:
On Wednesday 21 April 2010 11:44:16 Oliver Endriss wrote:
On Wednesday 21 April 2010 08:37:39 Hans Verkuil wrote:
  Am 22.3.2010 20:34, schrieb e9hack:
  Am 20.3.2010 22:37, schrieb Hans Verkuil:
  On Saturday 20 March 2010 17:03:01 e9hack wrote:
  OK, I know that. But does the patch I mailed you last time fix 
  this
  problem
  without causing new ones? If so, then I'll post that patch to 
  the list.
 
  With your last patch, I've no problems. I'm using a a TT-C2300 
  and a
  Budget card. If my
  VDR does start, currently I've no chance to determine which 
  module is
  load first, but it
  works. If I unload all modules and load it again, I've no 
  problem. In
  this case, the
  modules for the budget card is load first and the modules for the 
  FF
  loads as second one.
 
  Ping!!

 It's merged in Mauro's fixes tree, but I don't think those pending 
 patches
 have been pushed upstream yet. Mauro, can you verify this? They 
 should be
 pushed to 2.6.34!
   
What about the HG driver?
The v4l-dvb HG repository is broken for 7 weeks...
   
Hi guys,
   
we have May 16th, and the HG driver is broken for 10 weeks now!
   
History:
- The changeset which caused the mess was applied on March 2nd:
 http://linuxtv.org/hg/v4l-dvb/rev/2eda2bcc8d6f
   
- A fix is waiting at fixes.git since March 24th:
 
http://git.linuxtv.org/fixes.git?a=commitdiff_plain;h=40358c8b5380604ac2507be2fac0c9bbd3e02b73
   
Are there any plans to bring v4ldvb HG to an usable state?
   
   Yes, Now I will collect patches from devel and fixes tree. At least
   until we achieve a better approach on it.
   Sorry the delay.
   
   Sounds good? Any other suggestion?
   
   Let me work on it.
   
   Cheers
   Douglas
  
  
  Hi, Douglas and Oliver,
  
  just as a small comment.
  
  I have not been on latest rc1 and such rcs close to a release for some
  time.
 
  But I was for a long time and v4l-dvb can't be a substitute for such.
 
 Sorry, I do not want to cope with experimental kernels and their bugs on
 my systems. I need a stable and reliable platform, so that I can
 concentrate on 'my' bugs.
 
 Usually I update the kernel every 3..4 releases (which causes enough
 trouble due to changed features, interfaces etc).

that is what everyone does prefer and that I call subsystem developer
service.

In fact, everyone has to be on .rc stuff starting with .rc1 ;)

Failing on being there, than blaming the one doing the backports for
being in delay, likely without any related hardware in his possession,
that can't work.

Cheers,
Hermann


--
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 v3 04/10] V4L2 ISP driver patchset for Intel Moorestown Camera Imaging Subsystem

2010-05-18 Thread Zhang, Xiaolin
From 68aa3138cafdb98027116227498bcf67492b82d6 Mon Sep 17 00:00:00 2001
From: Xiaolin Zhang xiaolin.zh...@intel.com
Date: Tue, 18 May 2010 15:43:04 +0800
Subject: [PATCH 04/10] This patch is a part of v4l2 ISP patchset for Intel 
Moorestown camera imaging
 subsystem support which control the ISP JPEG encoder setting.

Signed-off-by: Xiaolin Zhang xiaolin.zh...@intel.com
---
 drivers/media/video/mrstisp/include/mrstisp_jpe.h |  416 +++
 drivers/media/video/mrstisp/mrstisp_jpe.c |  569 +
 2 files changed, 985 insertions(+), 0 deletions(-)
 create mode 100644 drivers/media/video/mrstisp/include/mrstisp_jpe.h
 create mode 100644 drivers/media/video/mrstisp/mrstisp_jpe.c

diff --git a/drivers/media/video/mrstisp/include/mrstisp_jpe.h 
b/drivers/media/video/mrstisp/include/mrstisp_jpe.h
new file mode 100644
index 000..634c715
--- /dev/null
+++ b/drivers/media/video/mrstisp/include/mrstisp_jpe.h
@@ -0,0 +1,416 @@
+/*
+ * Support for Moorestown Langwell Camera Imaging ISP subsystem.
+ *
+ * Copyright (c) 2009 Intel Corporation. All Rights Reserved.
+ *
+ * Copyright (c) Silicon Image 2008  www.siliconimage.com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version
+ * 2 as published by the Free Software Foundation.
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA.
+ *
+ *
+ * Xiaolin Zhang xiaolin.zh...@intel.com
+ */
+
+#include mrstisp.h
+
+/* DC luma table according to ISO/IEC 10918-1 annex K */
+static const u8 ci_isp_dc_luma_table_annex_k[] = {
+   0x00, 0x01, 0x05, 0x01, 0x01, 0x01, 0x01, 0x01,
+   0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+   0x08, 0x09, 0x0a, 0x0b
+};
+
+/* DC chroma table according to ISO/IEC 10918-1 annex K */
+static const u8 ci_isp_dc_chroma_table_annex_k[] = {
+   0x00, 0x03, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+   0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+   0x08, 0x09, 0x0a, 0x0b
+};
+
+/* AC luma table according to ISO/IEC 10918-1 annex K */
+static const u8 ci_isp_ac_luma_table_annex_k[] = {
+   0x00, 0x02, 0x01, 0x03, 0x03, 0x02, 0x04, 0x03,
+   0x05, 0x05, 0x04, 0x04, 0x00, 0x00, 0x01, 0x7d,
+   0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12,
+   0x21, 0x31, 0x41, 0x06, 0x13, 0x51, 0x61, 0x07,
+   0x22, 0x71, 0x14, 0x32, 0x81, 0x91, 0xa1, 0x08,
+   0x23, 0x42, 0xb1, 0xc1, 0x15, 0x52, 0xd1, 0xf0,
+   0x24, 0x33, 0x62, 0x72, 0x82, 0x09, 0x0a, 0x16,
+   0x17, 0x18, 0x19, 0x1a, 0x25, 0x26, 0x27, 0x28,
+   0x29, 0x2a, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39,
+   0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49,
+   0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59,
+   0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69,
+   0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79,
+   0x7a, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89,
+   0x8a, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98,
+   0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
+   0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6,
+   0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3, 0xc4, 0xc5,
+   0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2, 0xd3, 0xd4,
+   0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xe1, 0xe2,
+   0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea,
+   0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8,
+   0xf9, 0xfa
+};
+
+/* AC Chroma table according to ISO/IEC 10918-1 annex K */
+static const u8 ci_isp_ac_chroma_table_annex_k[] = {
+   0x00, 0x02, 0x01, 0x02, 0x04, 0x04, 0x03, 0x04,
+   0x07, 0x05, 0x04, 0x04, 0x00, 0x01, 0x02, 0x77,
+   0x00, 0x01, 0x02, 0x03, 0x11, 0x04, 0x05, 0x21,
+   0x31, 0x06, 0x12, 0x41, 0x51, 0x07, 0x61, 0x71,
+   0x13, 0x22, 0x32, 0x81, 0x08, 0x14, 0x42, 0x91,
+   0xa1, 0xb1, 0xc1, 0x09, 0x23, 0x33, 0x52, 0xf0,
+   0x15, 0x62, 0x72, 0xd1, 0x0a, 0x16, 0x24, 0x34,
+   0xe1, 0x25, 0xf1, 0x17, 0x18, 0x19, 0x1a, 0x26,
+   0x27, 0x28, 0x29, 0x2a, 0x35, 0x36, 0x37, 0x38,
+   0x39, 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48,
+   0x49, 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58,
+   0x59, 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68,
+   0x69, 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78,
+   0x79, 0x7a, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
+   0x88, 0x89, 0x8a, 0x92, 0x93, 0x94, 0x95, 0x96,
+   0x97, 0x98, 0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5,
+   0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4,
+   0xb5, 

[PATCH v3 06/10] V4L2 ISP driver patchset for Intel Moorestown Camera Imaging Subsystem

2010-05-18 Thread Zhang, Xiaolin
From 4c1c3d6692bb55f372d588a8217f2c75bf2bbb84 Mon Sep 17 00:00:00 2001
From: Xiaolin Zhang xiaolin.zh...@intel.com
Date: Tue, 18 May 2010 15:46:39 +0800
Subject: [PATCH 06/10] This patch is a part of v4l2 ISP patchset for Intel 
Moorestown camera imaging
 subsystem support which setup the sensor specic information for ISP.

Signed-off-by: Xiaolin Zhang xiaolin.zh...@intel.com
---
 .../video/mrstisp/include/mrst_sensor_common.h |  378 
 .../media/video/mrstisp/include/mrstisp_snr_conf.h |   31 ++
 drivers/media/video/mrstisp/mrstisp_snr_conf.c |  143 
 3 files changed, 552 insertions(+), 0 deletions(-)
 create mode 100644 drivers/media/video/mrstisp/include/mrst_sensor_common.h
 create mode 100644 drivers/media/video/mrstisp/include/mrstisp_snr_conf.h
 create mode 100644 drivers/media/video/mrstisp/mrstisp_snr_conf.c

diff --git a/drivers/media/video/mrstisp/include/mrst_sensor_common.h 
b/drivers/media/video/mrstisp/include/mrst_sensor_common.h
new file mode 100644
index 000..ca0da2f
--- /dev/null
+++ b/drivers/media/video/mrstisp/include/mrst_sensor_common.h
@@ -0,0 +1,378 @@
+/*
+ * Support for Moorestown Langwell Camera Imaging ISP subsystem.
+ *
+ * Copyright (c) 2009 Intel Corporation. All Rights Reserved.
+ *
+ * Copyright (c) Silicon Image 2008  www.siliconimage.com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version
+ * 2 as published by the Free Software Foundation.
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA.
+ *
+ *
+ * Xiaolin Zhang xiaolin.zh...@intel.com
+ */
+
+#ifndef _SENSOR_FMT_COMMON_H
+#define _SENSOR_FMT_COMMON_H
+#include media/v4l2-subdev.h
+
+/*
+ * sensor capabilities struct: a struct member may have 0, 1 or several bits
+ * set according to the capabilities of the sensor. All struct members must be
+ * unsigned int and no padding is allowed. Thus, access to the fields is also
+ * possible by means of a field of unsigned int values. Indicees for the
+ * field-like access are given below.
+ */
+struct ci_sensor_caps{
+   unsigned int bus_width;
+   unsigned int mode;
+   unsigned int field_inv;
+   unsigned int field_sel;
+   unsigned int ycseq;
+   unsigned int conv422;
+   unsigned int bpat;
+   unsigned int hpol;
+   unsigned int vpol;
+   unsigned int edge;
+   unsigned int bls;
+   unsigned int gamma;
+   unsigned int cconv;
+   unsigned int res;
+   unsigned int dwn_sz;
+   unsigned int blc;
+   unsigned int agc;
+   unsigned int awb;
+   unsigned int aec;
+   unsigned int cie_profile;
+   unsigned int flicker_freq;
+   unsigned int smia_mode;
+   unsigned int mipi_mode;
+   unsigned int type;
+   char name[32];
+
+   struct v4l2_subdev sd;
+};
+
+#define ci_sensor_config   ci_sensor_caps
+
+#define SENSOR_BPAT_RGRGGBGB   0x0001
+#define SENSOR_BPAT_GRGRBGBG   0x0002
+#define SENSOR_BPAT_GBGBRGRG   0x0004
+#define SENSOR_BPAT_BGBGGRGR   0x0008
+
+#define SENSOR_BLC_AUTO0x0001
+#define SENSOR_BLC_OFF 0x0002
+
+#define SENSOR_AGC_AUTO0x0001
+#define SENSOR_AGC_OFF 0x0002
+
+#define SENSOR_AWB_AUTO0x0001
+#define SENSOR_AWB_OFF 0x0002
+
+#define SENSOR_AEC_AUTO0x0001
+#define SENSOR_AEC_OFF 0x0002
+
+/* turns on/off additional black lines at frame start */
+#define SENSOR_BLS_OFF 0x0001
+#define SENSOR_BLS_TWO_LINES   0x0002
+#define SENSOR_BLS_FOUR_LINES  0x0004
+
+/* turns on/off gamma correction in the sensor ISP */
+#define SENSOR_GAMMA_ON0x0001
+#define SENSOR_GAMMA_OFF   0x0002
+
+/* 88x72 */
+#define SENSOR_RES_QQCIF   0x0001
+/* 160x120 */
+#define SENSOR_RES_QQVGA   0x0002
+/* 176x144 */
+#define SENSOR_RES_QCIF0x0004
+/* 320x240 */
+#define SENSOR_RES_QVGA0x0008
+/* 352x288 */
+#define SENSOR_RES_CIF 0x0010
+/* 640x480 */
+#define SENSOR_RES_VGA 0x0020
+/* 800x600 */
+#define SENSOR_RES_SVGA0x0040
+/* 1024x768 */
+#define SENSOR_RES_XGA 0x0080
+/* 1280x960 max. resolution of OV9640 (QuadVGA) */
+#define SENSOR_RES_XGA_PLUS0x0100
+/* 1280x1024 */
+#define SENSOR_RES_SXGA0x0200
+/* 1600x1200 */
+#define SENSOR_RES_UXGA0x0400
+/* 

[PATCH v3 09/10] V4L2 ISP driver patchset for Intel Moorestown Camera Imaging Subsystem

2010-05-18 Thread Zhang, Xiaolin
From 25b539d6fb4105c5552aca9a40f94aa30cd3a07c Mon Sep 17 00:00:00 2001
From: Xiaolin Zhang xiaolin.zh...@intel.com
Date: Tue, 18 May 2010 15:52:01 +0800
Subject: [PATCH 09/10] This patch is a part of v4l2 ISP patchset for Intel 
Moorestown camera imaging
 subsystem support which declare the private ioctls information.

Signed-off-by: Xiaolin Zhang xiaolin.zh...@intel.com
---
 drivers/media/video/mrstisp/include/ci_va.h|   47 
 .../media/video/mrstisp/include/v4l2_jpg_review.h  |   47 
 2 files changed, 94 insertions(+), 0 deletions(-)
 create mode 100644 drivers/media/video/mrstisp/include/ci_va.h
 create mode 100644 drivers/media/video/mrstisp/include/v4l2_jpg_review.h

diff --git a/drivers/media/video/mrstisp/include/ci_va.h 
b/drivers/media/video/mrstisp/include/ci_va.h
new file mode 100644
index 000..e77bb58
--- /dev/null
+++ b/drivers/media/video/mrstisp/include/ci_va.h
@@ -0,0 +1,47 @@
+/*
+ * Support for Moorestown Langwell Camera Imaging ISP subsystem.
+ *
+ * Copyright (c) 2009 Intel Corporation. All Rights Reserved.
+ *
+ * Copyright (c) Silicon Image 2008  www.siliconimage.com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version
+ * 2 as published by the Free Software Foundation.
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA.
+ *
+ *
+ * Xiaolin Zhang xiaolin.zh...@intel.com
+ */
+
+/*
+ * for buffer sharing between camera and video subsystem to improve preview
+ *  and video capture perofrmance
+ */
+
+#ifndef _CI_VA_H
+#define _CI_VA_H
+
+/* fixme: will be replaced for subdev/media controller framework */
+struct ci_frame_info {
+   unsigned long frame_id; /* in */
+   unsigned int width; /* out */
+   unsigned int height; /* out */
+   unsigned int stride; /* out */
+   unsigned int fourcc; /* out */
+   unsigned int offset; /* out */
+};
+
+#define ISP_IOCTL_GET_FRAME_INFO _IOWR('V', 192 + 5, struct ci_frame_info)
+
+#endif
+
diff --git a/drivers/media/video/mrstisp/include/v4l2_jpg_review.h 
b/drivers/media/video/mrstisp/include/v4l2_jpg_review.h
new file mode 100644
index 000..d574d83
--- /dev/null
+++ b/drivers/media/video/mrstisp/include/v4l2_jpg_review.h
@@ -0,0 +1,47 @@
+/*
+ * Support for Moorestown Langwell Camera Imaging ISP subsystem.
+ *
+ * Copyright (c) 2009 Intel Corporation. All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version
+ * 2 as published by the Free Software Foundation.
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA.
+ *
+ *
+ * Xiaolin Zhang xiaolin.zh...@intel.com
+ */
+
+#ifndef__V4L2_JPG_REVIEW_EXT_H
+#define__V4L2_JPG_REVIEW_EXT_H
+
+#include linux/videodev2.h
+
+/*
+ * Moorestown JPG image auto review structure and IOCTL.
+ */
+struct v4l2_jpg_review_buffer{
+   __u32   width;  /* in: frame width */
+   __u32   height; /* in: frame height */
+   __u32   pix_fmt;/* in: frame fourcc */
+   __u32   jpg_frame;  /* in: corresponding jpg frame id */
+   __u32   bytesperline;   /* out: 0 if not used */
+   __u32   frame_size; /* out: frame size */
+   __u32   offset; /* out: mmap offset */
+};
+
+#defineBASE_VIDIOC_PRIVATE_JPG_REVIEW  (BASE_VIDIOC_PRIVATE + 10)
+
+#defineVIDIOC_CREATE_JPG_REVIEW_BUF_IOWR('V', \
+   BASE_VIDIOC_PRIVATE_JPG_REVIEW + 1, \
+   struct v4l2_jpg_review_buffer)
+#endif
-- 
1.6.3.2

--
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 v3 10/10] V4L2 ISP driver patchset for Intel Moorestown Camera Imaging Subsystem

2010-05-18 Thread Zhang, Xiaolin
From e81476bafd59afd7cc3474f7003e331fc4303e96 Mon Sep 17 00:00:00 2001
From: Xiaolin Zhang xiaolin.zh...@intel.com
Date: Tue, 18 May 2010 15:53:41 +0800
Subject: [PATCH 10/10] This patch is a part of v4l2 ISP patchset for Intel 
Moorestown camera imaging
 subsystem support which contain the chagne in the build system.

Signed-off-by: Xiaolin Zhang xiaolin.zh...@intel.com
---
 drivers/media/video/mrstisp/Kconfig  |   24 
 drivers/media/video/mrstisp/Makefile |6 ++
 2 files changed, 30 insertions(+), 0 deletions(-)
 create mode 100644 drivers/media/video/mrstisp/Kconfig
 create mode 100644 drivers/media/video/mrstisp/Makefile

diff --git a/drivers/media/video/mrstisp/Kconfig 
b/drivers/media/video/mrstisp/Kconfig
new file mode 100644
index 000..64f257c
--- /dev/null
+++ b/drivers/media/video/mrstisp/Kconfig
@@ -0,0 +1,24 @@
+config VIDEO_MRSTCI
+   tristate Intel Moorestown CMOS Camera Controller support
+   depends on PCI  I2C  VIDEO_V4L2
+   select VIDEOBUF_DMA_CONTIG
+   select VIDEO_OV2650
+   select VIDEO_OV5630
+   select VIDEO_OV9665
+   select VIDEO_S5K4E1
+   select VIDEO_OV5630_MOTOR
+   select VIDEO_S5K4E1_MOTOR
+   default y
+   ---help---
+ This is a video4linux2 driver for the Intel Atom (Moorestown)
+ CMOS camera controller.
+
+config VIDEO_MRSTISP
+   tristate Intel Moorestown ISP Controller support
+   depends on VIDEO_MRSTCI
+   default y
+   ---help---
+ This is a video4linux2 driver for the Intel Atom (Moorestown)
+ CMOS camera controller.
+ To compile this driver as a module, choose M here: the
+ module will be called mrstisp.ko.
diff --git a/drivers/media/video/mrstisp/Makefile 
b/drivers/media/video/mrstisp/Makefile
new file mode 100644
index 000..1511922
--- /dev/null
+++ b/drivers/media/video/mrstisp/Makefile
@@ -0,0 +1,6 @@
+mrstisp-objs   := mrstisp_main.o mrstisp_hw.o mrstisp_isp.o\
+mrstisp_dp.o mrstisp_mif.o mrstisp_jpe.o   \
+   __mrstisp_private_ioctl.o
+
+obj-$(CONFIG_VIDEO_MRSTISP) += mrstisp.o
+EXTRA_CFLAGS   +=   -I$(src)/include
-- 
1.6.3.2

--
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