[PATCH] libv4l1: move VIDIOCGTUNER and VIDIOCSTUNER to libv4l1

2010-06-04 Thread huzaifas
From: Huzaifa Sidhpurwala huzai...@redhat.com

move VIDIOCGTUNER and VIDIOCSTUNER to libv4l1

Signed-of-by: Huzaifa Sidhpurwala huzai...@redhat.com
---
 lib/libv4l1/libv4l1.c |   58 +
 1 files changed, 58 insertions(+), 0 deletions(-)

diff --git a/lib/libv4l1/libv4l1.c b/lib/libv4l1/libv4l1.c
index 75b823c..081ed0a 100644
--- a/lib/libv4l1/libv4l1.c
+++ b/lib/libv4l1/libv4l1.c
@@ -881,6 +881,64 @@ int v4l1_ioctl(int fd, unsigned long int request, ...)
break;
}
 
+   case VIDIOCSTUNER: {
+   struct video_tuner *tun = arg;
+   struct v4l2_tuner t = { 0, };
+
+   t.index = tun-tuner;
+   result = v4l2_ioctl(fd, VIDIOC_S_TUNER, t);
+
+   break;
+   }
+
+   case VIDIOCGTUNER: {
+   int i;
+   struct video_tuner *tun = arg;
+   struct v4l2_tuner tun2 = { 0, };
+   struct v4l2_standard std2 = { 0, };
+   v4l2_std_id sid;
+
+   result = v4l2_ioctl(fd, VIDIOC_G_TUNER, tun2);
+   if (result  0)
+   break;
+
+   memcpy(tun-name, tun2.name,
+   min(sizeof(tun-name), sizeof(tun2.name)));
+   tun-name[sizeof(tun-name) - 1] = 0;
+   tun-rangelow = tun2.rangelow;
+   tun-rangehigh = tun2.rangehigh;
+   tun-flags = 0;
+   tun-mode = VIDEO_MODE_AUTO;
+
+   for (i = 0; i  64; i++) {
+   std2.index = i;
+   if (0 != v4l2_ioctl(fd, VIDIOC_ENUMSTD, std2))
+   break;
+   if (std2.id  V4L2_STD_PAL)
+   tun-flags |= VIDEO_TUNER_PAL;
+   if (std2.id  V4L2_STD_NTSC)
+   tun-flags |= VIDEO_TUNER_NTSC;
+   if (std2.id  V4L2_STD_SECAM)
+   tun-flags |= VIDEO_TUNER_SECAM;
+   }
+
+   if (v4l2_ioctl(fd, VIDIOC_G_STD, sid) == 0) {
+   if (sid  V4L2_STD_PAL)
+   tun-mode = VIDEO_MODE_PAL;
+   if (sid  V4L2_STD_NTSC)
+   tun-mode = VIDEO_MODE_NTSC;
+   if (sid  V4L2_STD_SECAM)
+   tun-mode = VIDEO_MODE_SECAM;
+   }
+   if (tun2.capability  V4L2_TUNER_CAP_LOW)
+   tun-flags |= VIDEO_TUNER_LOW;
+   if (tun2.rxsubchans  V4L2_TUNER_SUB_STEREO)
+   tun-flags |= VIDEO_TUNER_STEREO_ON;
+   tun-signal = tun2.signal;
+
+   break;
+   }
+
default:
/* Pass through libv4l2 for applications which are using v4l2 
through
   libv4l1 (this can happen with the v4l1compat.so wrapper 
preloaded */
-- 
1.6.6.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


[PATCH] libv4l1: move VIDIOCGFREQ and VIDIOCSFREQ to libv4l1

2010-06-04 Thread huzaifas
From: Huzaifa Sidhpurwala huzai...@redhat.com

move VIDIOCGFREQ and VIDIOCSFREQ to libv4l1

Signed-of-by: Huzaifa Sidhpurwala huzai...@redhat.com
---
 lib/libv4l1/libv4l1.c |   28 
 1 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/lib/libv4l1/libv4l1.c b/lib/libv4l1/libv4l1.c
index 081ed0a..579f13b 100644
--- a/lib/libv4l1/libv4l1.c
+++ b/lib/libv4l1/libv4l1.c
@@ -939,6 +939,34 @@ int v4l1_ioctl(int fd, unsigned long int request, ...)
break;
}
 
+   case VIDIOCSFREQ: {
+   unsigned long *freq = arg;
+   struct v4l2_frequency freq2 = { 0, };
+
+   result = v4l2_ioctl(fd, VIDIOC_G_FREQUENCY, freq2);
+   if (result  0)
+   break;
+
+   freq2.frequency = *freq;
+
+   result = v4l2_ioctl(fd, VIDIOC_S_FREQUENCY, freq2);
+
+   break;
+   }
+
+   case VIDIOCGFREQ: {
+   unsigned long *freq = arg;
+   struct v4l2_frequency freq2 = { 0, };
+
+   freq2.tuner = 0;
+   result = v4l2_ioctl(fd, VIDIOC_G_FREQUENCY, freq2);
+   if (result  0)
+   break;
+   if (0 == result)
+   *freq = freq2.frequency;
+
+   break;
+   }
default:
/* Pass through libv4l2 for applications which are using v4l2 
through
   libv4l1 (this can happen with the v4l1compat.so wrapper 
preloaded */
-- 
1.6.6.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


[PATCH] libv4l1: move VIDIOCCAPTURE to libv4l1

2010-06-04 Thread huzaifas
From: Huzaifa Sidhpurwala huzai...@redhat.com

move VIDIOCCAPTURE to libv4l1

Signed-of-by: Huzaifa Sidhpurwala huzai...@redhat.com
---
 lib/libv4l1/libv4l1.c |   16 
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/lib/libv4l1/libv4l1.c b/lib/libv4l1/libv4l1.c
index 579f13b..2981c40 100644
--- a/lib/libv4l1/libv4l1.c
+++ b/lib/libv4l1/libv4l1.c
@@ -967,6 +967,22 @@ int v4l1_ioctl(int fd, unsigned long int request, ...)
 
break;
}
+
+   case VIDIOCCAPTURE: {
+   int *on = arg;
+   enum v4l2_buf_type captype = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+
+   if (0 == *on) {
+   /* dirty hack time.  But v4l1 has no STREAMOFF
+   * equivalent in the API, and this one at
+   * least comes close ... */
+   v4l2_ioctl(fd, VIDIOC_STREAMOFF, captype);
+   }
+
+   result = v4l2_ioctl(fd, VIDIOC_OVERLAY, on);
+
+   break;
+   }
default:
/* Pass through libv4l2 for applications which are using v4l2 
through
   libv4l1 (this can happen with the v4l1compat.so wrapper 
preloaded */
-- 
1.6.6.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


[PATCH v4 3/5] ASoC: WL1273 FM Radio Digital audio codec.

2010-06-04 Thread Matti J. Aaltonen
The codec handles digital audio input to and output from the
WL1273 FM radio.

Signed-off-by: Matti J. Aaltonen matti.j.aalto...@nokia.com
---
 sound/soc/codecs/Kconfig  |6 +
 sound/soc/codecs/Makefile |2 +
 sound/soc/codecs/wl1273.c |  594 +
 sound/soc/codecs/wl1273.h |   40 +++
 4 files changed, 642 insertions(+), 0 deletions(-)
 create mode 100644 sound/soc/codecs/wl1273.c
 create mode 100644 sound/soc/codecs/wl1273.h

diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig
index 52b005f..c4769f2 100644
--- a/sound/soc/codecs/Kconfig
+++ b/sound/soc/codecs/Kconfig
@@ -35,6 +35,7 @@ config SND_SOC_ALL_CODECS
select SND_SOC_TWL4030 if TWL4030_CORE
select SND_SOC_UDA134X
select SND_SOC_UDA1380 if I2C
+   select SND_SOC_WL1273 if I2C
select SND_SOC_WM8350 if MFD_WM8350
select SND_SOC_WM8400 if MFD_WM8400
select SND_SOC_WM8510 if SND_SOC_I2C_AND_SPI
@@ -161,6 +162,11 @@ config SND_SOC_UDA134X
 config SND_SOC_UDA1380
 tristate
 
+config SND_SOC_WL1273
+   tristate
+   select WL1273_CORE
+   default n
+
 config SND_SOC_WM8350
tristate
 
diff --git a/sound/soc/codecs/Makefile b/sound/soc/codecs/Makefile
index dbaecb1..2a7c564 100644
--- a/sound/soc/codecs/Makefile
+++ b/sound/soc/codecs/Makefile
@@ -22,6 +22,7 @@ snd-soc-tlv320dac33-objs := tlv320dac33.o
 snd-soc-twl4030-objs := twl4030.o
 snd-soc-uda134x-objs := uda134x.o
 snd-soc-uda1380-objs := uda1380.o
+snd-soc-wl1273-objs := wl1273.o
 snd-soc-wm8350-objs := wm8350.o
 snd-soc-wm8400-objs := wm8400.o
 snd-soc-wm8510-objs := wm8510.o
@@ -78,6 +79,7 @@ obj-$(CONFIG_SND_SOC_TLV320DAC33) += snd-soc-tlv320dac33.o
 obj-$(CONFIG_SND_SOC_TWL4030)  += snd-soc-twl4030.o
 obj-$(CONFIG_SND_SOC_UDA134X)  += snd-soc-uda134x.o
 obj-$(CONFIG_SND_SOC_UDA1380)  += snd-soc-uda1380.o
+obj-$(CONFIG_SND_SOC_WL1273)   += snd-soc-wl1273.o
 obj-$(CONFIG_SND_SOC_WM8350)   += snd-soc-wm8350.o
 obj-$(CONFIG_SND_SOC_WM8400)   += snd-soc-wm8400.o
 obj-$(CONFIG_SND_SOC_WM8510)   += snd-soc-wm8510.o
diff --git a/sound/soc/codecs/wl1273.c b/sound/soc/codecs/wl1273.c
new file mode 100644
index 000..a2089ad
--- /dev/null
+++ b/sound/soc/codecs/wl1273.c
@@ -0,0 +1,594 @@
+/*
+ * ALSA SoC WL1273 codec driver
+ *
+ * Author:  Matti Aaltonen, matti.j.aalto...@nokia.com
+ *
+ * Copyright:   (C) 2010 Nokia Corporation
+ *
+ * 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 St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ */
+
+#undef DEBUG
+
+#include linux/mfd/wl1273-core.h
+#include linux/module.h
+#include sound/pcm.h
+#include sound/pcm_params.h
+#include sound/soc.h
+#include sound/soc-dapm.h
+#include sound/initval.h
+
+#include wl1273.h
+
+static int snd_wl1273_fm_set_i2s_mode(struct wl1273_core *core,
+ int rate, int width)
+{
+   struct device *dev = core-i2c_dev-dev;
+   int r = 0;
+   u16 mode;
+
+   dev_dbg(dev, rate: %d\n, rate);
+   dev_dbg(dev, width: %d\n, width);
+
+   mutex_lock(core-lock);
+
+   mode = core-i2s_mode  ~WL1273_IS2_WIDTH  ~WL1273_IS2_RATE;
+
+   switch (rate) {
+   case 48000:
+   mode |= WL1273_IS2_RATE_48K;
+   break;
+   case 44100:
+   mode |= WL1273_IS2_RATE_44_1K;
+   break;
+   case 32000:
+   mode |= WL1273_IS2_RATE_32K;
+   break;
+   case 22050:
+   mode |= WL1273_IS2_RATE_22_05K;
+   break;
+   case 16000:
+   mode |= WL1273_IS2_RATE_16K;
+   break;
+   case 12000:
+   mode |= WL1273_IS2_RATE_12K;
+   break;
+   case 11025:
+   mode |= WL1273_IS2_RATE_11_025;
+   break;
+   case 8000:
+   mode |= WL1273_IS2_RATE_8K;
+   break;
+   default:
+   dev_err(dev, Sampling rate: %d not supported\n, rate);
+   r = -EINVAL;
+   goto out;
+   }
+
+   switch (width) {
+   case 16:
+   mode |= WL1273_IS2_WIDTH_32;
+   break;
+   case 20:
+   mode |= WL1273_IS2_WIDTH_40;
+   break;
+   case 24:
+   mode |= WL1273_IS2_WIDTH_48;
+   break;
+   case 25:
+   mode |= WL1273_IS2_WIDTH_50;
+   break;
+   case 30:
+  

[PATCH v4 1/5] V4L2: Add seek spacing and FM RX class.

2010-06-04 Thread Matti J. Aaltonen
Add spacing field to v4l2_hw_freq_seek and also add FM RX class to
control classes.

Signed-off-by: Matti J. Aaltonen matti.j.aalto...@nokia.com
---
 include/linux/videodev2.h |   15 ++-
 1 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index 418dacf..95675cd 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -935,6 +935,7 @@ struct v4l2_ext_controls {
 #define V4L2_CTRL_CLASS_MPEG 0x0099/* MPEG-compression controls */
 #define V4L2_CTRL_CLASS_CAMERA 0x009a  /* Camera class controls */
 #define V4L2_CTRL_CLASS_FM_TX 0x009b   /* FM Modulator control class */
+#define V4L2_CTRL_CLASS_FM_RX 0x009c   /* FM Tuner control class */
 
 #define V4L2_CTRL_ID_MASK(0x0fff)
 #define V4L2_CTRL_ID2CLASS(id)((id)  0x0fffUL)
@@ -1313,6 +1314,17 @@ enum v4l2_preemphasis {
 #define V4L2_CID_TUNE_POWER_LEVEL  (V4L2_CID_FM_TX_CLASS_BASE + 
113)
 #define V4L2_CID_TUNE_ANTENNA_CAPACITOR
(V4L2_CID_FM_TX_CLASS_BASE + 114)
 
+/* FM Tuner class control IDs */
+#define V4L2_CID_FM_RX_CLASS_BASE  (V4L2_CTRL_CLASS_FM_RX | 0x900)
+#define V4L2_CID_FM_RX_CLASS   (V4L2_CTRL_CLASS_FM_RX | 1)
+
+#define V4L2_CID_FM_RX_BAND(V4L2_CID_FM_TX_CLASS_BASE + 1)
+enum v4l2_fm_rx_band {
+   V4L2_FM_BAND_OTHER  = 0,
+   V4L2_FM_BAND_JAPAN  = 1,
+   V4L2_FM_BAND_OIRT   = 2
+};
+
 /*
  * T U N I N G
  */
@@ -1377,7 +1389,8 @@ struct v4l2_hw_freq_seek {
enum v4l2_tuner_type  type;
__u32 seek_upward;
__u32 wrap_around;
-   __u32 reserved[8];
+   __u32 spacing;
+   __u32 reserved[7];
 };
 
 /*
-- 
1.6.1.3

--
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 v4 2/5] MFD: WL1273 FM Radio: MFD driver for the FM radio.

2010-06-04 Thread Matti J. Aaltonen
This is a parent driver for two child drivers: the V4L2 driver and
the ALSA codec driver. The MFD part provides the I2C communication
to the device and a couple of functions that are called from both
children.

Signed-off-by: Matti J. Aaltonen matti.j.aalto...@nokia.com
---
 drivers/mfd/Kconfig |6 +
 drivers/mfd/Makefile|2 +
 drivers/mfd/wl1273-core.c   |  616 +++
 include/linux/mfd/wl1273-core.h |  326 +
 4 files changed, 950 insertions(+), 0 deletions(-)
 create mode 100644 drivers/mfd/wl1273-core.c
 create mode 100644 include/linux/mfd/wl1273-core.h

diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index 413576a..5998a94 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -135,6 +135,12 @@ config TWL4030_CODEC
select MFD_CORE
default n
 
+config WL1273_CORE
+   bool
+   depends on I2C
+   select MFD_CORE
+   default n
+
 config MFD_TMIO
bool
default n
diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
index 78295d6..46e611d 100644
--- a/drivers/mfd/Makefile
+++ b/drivers/mfd/Makefile
@@ -30,6 +30,8 @@ obj-$(CONFIG_TWL4030_CORE)+= twl-core.o twl4030-irq.o 
twl6030-irq.o
 obj-$(CONFIG_TWL4030_POWER)+= twl4030-power.o
 obj-$(CONFIG_TWL4030_CODEC)+= twl4030-codec.o
 
+obj-$(CONFIG_WL1273_CORE)  += wl1273-core.o
+
 obj-$(CONFIG_MFD_MC13783)  += mc13783-core.o
 
 obj-$(CONFIG_MFD_CORE) += mfd-core.o
diff --git a/drivers/mfd/wl1273-core.c b/drivers/mfd/wl1273-core.c
new file mode 100644
index 000..6c7dbba
--- /dev/null
+++ b/drivers/mfd/wl1273-core.c
@@ -0,0 +1,616 @@
+/*
+ * MFD driver for wl1273 FM radio and audio codec submodules.
+ *
+ * Author: Matti Aaltonen matti.j.aalto...@nokia.com
+ *
+ * Copyright:   (C) 2010 Nokia Corporation
+ *
+ * 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 St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ */
+
+#undef DEBUG
+
+#include asm/unaligned.h
+#include linux/completion.h
+#include linux/delay.h
+#include linux/i2c.h
+#include linux/interrupt.h
+#include linux/module.h
+#include linux/types.h
+#include linux/kernel.h
+#include linux/fs.h
+#include linux/platform_device.h
+#include linux/mfd/core.h
+#include linux/mfd/wl1273-core.h
+#include media/v4l2-common.h
+
+#define DRIVER_DESC WL1273 FM Radio Core
+
+#define WL1273_IRQ_MASK (WL1273_FR_EVENT   |   \
+ WL1273_POW_ENB_EVENT)
+
+static const struct band_info bands[] = {
+   /* USA  Europe */
+   {
+   .bottom_frequency   = 87500,
+   .top_frequency  = 108000,
+   .band   = V4L2_FM_BAND_OTHER,
+   },
+   /* Japan */
+   {
+   .bottom_frequency   = 76000,
+   .top_frequency  = 9,
+   .band   = V4L2_FM_BAND_JAPAN,
+   },
+};
+
+/*
+ * static unsigned char radio_band - Band
+ *
+ * The bands are 0=Japan, 1=USA-Europe. USA-Europe is the default.
+ */
+static unsigned char radio_band = 1;
+module_param(radio_band, byte, 0);
+MODULE_PARM_DESC(radio_band, Band: 0=Japan, 1=USA-Europe*);
+
+/*
+ * static unsigned int rds_buf - the number of RDS buffer blocks used.
+ *
+ * The default number is 100.
+ */
+static unsigned int rds_buf = 100;
+module_param(rds_buf, uint, 0);
+MODULE_PARM_DESC(rds_buf, RDS buffer entries: *100*);
+
+int wl1273_fm_read_reg(struct wl1273_core *core, u8 reg, u16 *value)
+{
+   struct i2c_client *client = core-i2c_dev;
+   u8 b[2];
+   int r;
+
+   r = i2c_smbus_read_i2c_block_data(client, reg, 2, b);
+   if (r != 2) {
+   dev_err(client-dev, %s: Read: %d fails.\n, __func__, reg);
+   return -EREMOTEIO;
+   }
+
+   *value = (u16)b[0]  8 | b[1];
+
+   return 0;
+}
+EXPORT_SYMBOL(wl1273_fm_read_reg);
+
+int wl1273_fm_write_cmd(struct wl1273_core *core, u8 cmd, u16 param)
+{
+   struct i2c_client *client = core-i2c_dev;
+   u8 buf[] = { (param  8)  0xff, param  0xff };
+   int r;
+
+   r = i2c_smbus_write_i2c_block_data(client, cmd, 2, buf);
+   if (r) {
+   dev_err(client-dev, %s: Cmd: %d fails.\n, __func__, cmd);
+   return r;
+   }
+
+   return 0;
+}
+EXPORT_SYMBOL(wl1273_fm_write_cmd);
+
+int wl1273_fm_write_data(struct wl1273_core *core, u8 

[PATCH v4 4/5] V4L2: WL1273 FM Radio: Controls for the FM radio.

2010-06-04 Thread Matti J. Aaltonen
This file implements V4L2 controls for using the Texas Instruments
WL1273 FM Radio.

Signed-off-by: Matti J. Aaltonen matti.j.aalto...@nokia.com
---
 drivers/media/radio/Kconfig|   15 +
 drivers/media/radio/Makefile   |1 +
 drivers/media/radio/radio-wl1273.c | 1907 
 3 files changed, 1923 insertions(+), 0 deletions(-)
 create mode 100644 drivers/media/radio/radio-wl1273.c

diff --git a/drivers/media/radio/Kconfig b/drivers/media/radio/Kconfig
index 83567b8..209fd37 100644
--- a/drivers/media/radio/Kconfig
+++ b/drivers/media/radio/Kconfig
@@ -452,4 +452,19 @@ config RADIO_TIMBERDALE
  found behind the Timberdale FPGA on the Russellville board.
  Enabling this driver will automatically select the DSP and tuner.
 
+config RADIO_WL1273
+   tristate Texas Instruments WL1273 I2C FM Radio
+depends on I2C  VIDEO_V4L2  SND
+   select FW_LOADER
+   ---help---
+ Choose Y here if you have this FM radio chip.
+
+ In order to control your radio card, you will need to use programs
+ that are compatible with the Video For Linux 2 API.  Information on
+ this API and pointers to v4l2 programs may be found at
+ file:Documentation/video4linux/API.html.
+
+ To compile this driver as a module, choose M here: the
+ module will be called radio-wl1273.
+
 endif # RADIO_ADAPTERS
diff --git a/drivers/media/radio/Makefile b/drivers/media/radio/Makefile
index f615583..d297074 100644
--- a/drivers/media/radio/Makefile
+++ b/drivers/media/radio/Makefile
@@ -26,5 +26,6 @@ obj-$(CONFIG_RADIO_TEA5764) += radio-tea5764.o
 obj-$(CONFIG_RADIO_SAA7706H) += saa7706h.o
 obj-$(CONFIG_RADIO_TEF6862) += tef6862.o
 obj-$(CONFIG_RADIO_TIMBERDALE) += radio-timb.o
+obj-$(CONFIG_RADIO_WL1273) += radio-wl1273.o
 
 EXTRA_CFLAGS += -Isound
diff --git a/drivers/media/radio/radio-wl1273.c 
b/drivers/media/radio/radio-wl1273.c
new file mode 100644
index 000..473c194
--- /dev/null
+++ b/drivers/media/radio/radio-wl1273.c
@@ -0,0 +1,1907 @@
+/*
+ * Driver for the Texas Instruments WL1273 FM radio.
+ *
+ * Copyright (C) Nokia Corporation
+ * Author: Matti J. Aaltonen matti.j.aalto...@nokia.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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#undef DEBUG
+
+#include asm/unaligned.h
+#include linux/delay.h
+#include linux/firmware.h
+#include linux/mfd/wl1273-core.h
+#include linux/platform_device.h
+#include media/v4l2-common.h
+#include media/v4l2-device.h
+#include media/v4l2-ioctl.h
+
+#define DRIVER_DESC Wl1273 FM Radio - V4L2
+
+#define WL1273_POWER_SET_OFF   0
+#define WL1273_POWER_SET_FM(1  0)
+#define WL1273_POWER_SET_RDS   (1  1)
+#define WL1273_POWER_SET_RETENTION (1  4)
+
+#define WL1273_PUPD_SET_OFF0x00
+#define WL1273_PUPD_SET_ON 0x01
+#define WL1273_PUPD_SET_RETENTION  0x10
+
+#define WL1273_FREQ_MULT   (1 / 625)
+#define WL1273_INV_FREQ_MULT   (625 / 1)
+/*
+ * static unsigned char radio_band - Band
+ *
+ * The bands are 0=Japan, 1=USA-Europe. USA-Europe is the default.
+ */
+static unsigned char radio_band = 1;
+module_param(radio_band, byte, 0);
+MODULE_PARM_DESC(radio_band, Band: 0=Japan, 1=USA-Europe*);
+
+/*
+ * static int radio_nr - The number of the radio device
+ *
+ * The default is 0.
+ */
+static int radio_nr = -1;
+module_param(radio_nr, int, 0);
+MODULE_PARM_DESC(radio_nr, Radio Nr);
+
+struct wl1273_device {
+   struct v4l2_device v4l2dev;
+   struct video_device videodev;
+   struct device *dev;
+   struct wl1273_core *core;
+   struct file *owner;
+   char *write_buf;
+   bool rds_on;
+};
+
+static int wl1273_fm_set_tx_freq(struct wl1273_core *core, unsigned int freq)
+{
+   int r = 0;
+
+   if (freq  76000) {
+   dev_err(core-i2c_dev-dev,
+   Frequency out of range: %d  %d\n,
+   freq, core-bands[core-band].bottom_frequency);
+   return -EDOM;
+   }
+
+   if (freq  108000) {
+   dev_err(core-i2c_dev-dev,
+   Frequency out of range: %d  %d\n,
+   freq, core-bands[core-band].top_frequency);
+   return -EDOM;
+   }
+
+   /*
+*  The driver works better with this msleep,
+*  the documentation 

[PATCH v4 5/5] Documentation: v4l: Add hw_seek spacing.

2010-06-04 Thread Matti J. Aaltonen
Add a couple of words about the spacing field in HW seek struct.

Signed-off-by: Matti J. Aaltonen matti.j.aalto...@nokia.com
---
 .../DocBook/v4l/vidioc-s-hw-freq-seek.xml  |   10 --
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/Documentation/DocBook/v4l/vidioc-s-hw-freq-seek.xml 
b/Documentation/DocBook/v4l/vidioc-s-hw-freq-seek.xml
index 14b3ec7..8ee614c 100644
--- a/Documentation/DocBook/v4l/vidioc-s-hw-freq-seek.xml
+++ b/Documentation/DocBook/v4l/vidioc-s-hw-freq-seek.xml
@@ -51,7 +51,8 @@
 
 paraStart a hardware frequency seek from the current frequency.
 To do this applications initialize the structfieldtuner/structfield,
-structfieldtype/structfield, structfieldseek_upward/structfield and
+structfieldtype/structfield, structfieldseek_upward/structfield,
+structfieldspacing/structfield and
 structfieldwrap_around/structfield fields, and zero out the
 structfieldreserved/structfield array of a v4l2-hw-freq-seek; and
 call the constantVIDIOC_S_HW_FREQ_SEEK/constant ioctl with a pointer
@@ -89,7 +90,12 @@ field and the v4l2-tuner; structfieldindex/structfield 
field./entry
  /row
  row
entry__u32/entry
-   entrystructfieldreserved/structfield[8]/entry
+   entrystructfieldspacing/structfield/entry
+   entryIf non-zero, gives the search resolution to be used in 
hardware scan. The driver selects the nearest value that is supported by the 
hardware. If spacing is zero use a reasonable default value./entry
+ /row
+ row
+   entry__u32/entry
+   entrystructfieldreserved/structfield[7]/entry
entryReserved for future extensions. Drivers and
applications must set the array to zero./entry
  /row
-- 
1.6.1.3

--
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 v4 0/5] WL1273 FM Radio driver.

2010-06-04 Thread Matti J. Aaltonen
Hello again,

and thank you for the comments. 

New in this version of the patch set:

General headers:

I removed the seek level stuff and added the FM RX class. And I've added the
BAND IOCTL and I defined the three existing bands: I also added the OIRT band
because I think it's nicer to have three bands than only two.


Hans wrote:
 Is there a difference in power consumption between the 'off' and 'suspend' 
 state
 of the device? I assume that 'off' has the lowest power consumption.

 In that case I would have the driver go to suspend when no one has opened the
 radioX device. And if the driver is asked to go to suspend (that's the linux
 suspend state), then the driver can turn off the radio and on resume it will
 reload the firmware.

 Does that sound reasonable?

Yes that's reasonable... But I have had one problem here: the suspend does not
work, but we are working on it.


 As mentioned I don't think the level stuff should be added at the moment.
 The spacing field is no problem, but don't forget to update the V4L2 spec as
 well. Also document there what should happen if spacing == 0 (which is the
 case for existing apps). It basically boils down to the fact that the driver
 uses the spacing as a hint only and will adjust it to whatever the hardware
 supports.

I've fixed the spacing handling.

I've dropped the seek level stuff.

drivers/mfd/wl1273-core.c:

 Don't use bitfields! How bitfields are ordered is compiler specific.

I've dropped the bitfields.

 Does the data you copy here conform to the v4l2_rds_data struct?
 In particular the block byte. It is well documented in the Spec in the
 section on 'Reading RDS data'.

The error bits are not same as in the spec so I now copy them to the correct
positions and use the v4l2_rds_data struct.


drivers/media/radio/radio-wl1273.c:

 I understood that the band was relevant for receiving only?

That's true, I've removed the band stuff here.

 Rather than continually allocating and freeing this buffer I would just make
 it a field in struct wl1273_device. It's never more than 256 bytes, so that's
 no problem.

Now the buffer gets allocated and freed only once.

 Don't. Just make sure there can be only one reader. This is the same principle
 used by video: there can be multiple file handles open on a video node, but
 only one can be used for streaming at a time. Trying to handle multiple 
 readers
 or writers in a driver will lead to chaos. And this can be done much better by
 userspace.

Now only one reader or writer is accepted.

 Where are the other FM_TX controls?

Added the missing controls. However, there's read-only control - I didn't add 
that.

 Use strlcpy here as well.

Now I'm using strlcpy everywhere...

 I strongly recommend using v4l2_ctrl_query_fill() instead (defined in
 v4l2-common.c). This ensures consistent naming. It will also make it easier
 to convert to the upcoming new control framework.

Replaced the old code with code that uses v4l2_ctrl_query_fill etc.


 Make this dev_dbg. I think it is probably better to pick the closest spacing
 rather than falling back to 50.

I've changed spacing handling quite a bit.

Cheers,


Matti J. Aaltonen (5):
  V4L2: Add seek spacing and FM RX class.
  MFD: WL1273 FM Radio: MFD driver for the FM radio.
  ASoC: WL1273 FM Radio Digital audio codec.
  V4L2: WL1273 FM Radio: Controls for the FM radio.
  Documentation: v4l: Add hw_seek spacing.

 .../DocBook/v4l/vidioc-s-hw-freq-seek.xml  |   10 +-
 drivers/media/radio/Kconfig|   15 +
 drivers/media/radio/Makefile   |1 +
 drivers/media/radio/radio-wl1273.c | 1907 
 drivers/mfd/Kconfig|6 +
 drivers/mfd/Makefile   |2 +
 drivers/mfd/wl1273-core.c  |  616 +++
 include/linux/mfd/wl1273-core.h|  326 
 include/linux/videodev2.h  |   15 +-
 sound/soc/codecs/Kconfig   |6 +
 sound/soc/codecs/Makefile  |2 +
 sound/soc/codecs/wl1273.c  |  594 ++
 sound/soc/codecs/wl1273.h  |   40 +
 13 files changed, 3537 insertions(+), 3 deletions(-)
 create mode 100644 drivers/media/radio/radio-wl1273.c
 create mode 100644 drivers/mfd/wl1273-core.c
 create mode 100644 include/linux/mfd/wl1273-core.h
 create mode 100644 sound/soc/codecs/wl1273.c
 create mode 100644 sound/soc/codecs/wl1273.h

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


[patch] media/radio: fix copy_to_user to user handling

2010-06-04 Thread Dan Carpenter
copy_to/from_user() returns the number of bytes remaining to be copied
but the code here was testing for negative returns.  I modified it to
return -EFAULT.  These functions are called from si4713_s_ext_ctrls() and
that only tests for negative error codes. 

Signed-off-by: Dan Carpenter erro...@gmail.com

diff --git a/drivers/media/radio/si4713-i2c.c b/drivers/media/radio/si4713-i2c.c
index ab63dd5..fc7f4b7 100644
--- a/drivers/media/radio/si4713-i2c.c
+++ b/drivers/media/radio/si4713-i2c.c
@@ -1009,8 +1009,10 @@ static int si4713_write_econtrol_string(struct 
si4713_device *sdev,
goto exit;
}
rval = copy_from_user(ps_name, control-string, len);
-   if (rval  0)
+   if (rval) {
+   rval = -EFAULT;
goto exit;
+   }
ps_name[len] = '\0';
 
if (strlen(ps_name) % vqc.step) {
@@ -1031,8 +1033,10 @@ static int si4713_write_econtrol_string(struct 
si4713_device *sdev,
goto exit;
}
rval = copy_from_user(radio_text, control-string, len);
-   if (rval  0)
+   if (rval) {
+   rval = -EFAULT;
goto exit;
+   }
radio_text[len] = '\0';
 
if (strlen(radio_text) % vqc.step) {
@@ -1367,6 +1371,8 @@ static int si4713_read_econtrol_string(struct 
si4713_device *sdev,
}
rval = copy_to_user(control-string, sdev-rds_info.ps_name,
strlen(sdev-rds_info.ps_name) + 1);
+   if (rval)
+   rval = -EFAULT;
break;
 
case V4L2_CID_RDS_TX_RADIO_TEXT:
@@ -1377,6 +1383,8 @@ static int si4713_read_econtrol_string(struct 
si4713_device *sdev,
}
rval = copy_to_user(control-string, sdev-rds_info.radio_text,
strlen(sdev-rds_info.radio_text) + 1);
+   if (rval)
+   rval = -EFAULT;
break;
 
default:
--
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] V4L/DVB: dvb_ca_en50221: return -EFAULT on copy_to_user errors

2010-06-04 Thread Dan Carpenter
copy_to_user() returns the number of bytes remaining to be copied which
isn't the right thing to return here.  The comments say that these 
functions in dvb_ca_en50221.c should return the number of bytes copied or
an error return.  I've changed it to return -EFAULT.

Signed-off-by: Dan Carpenter erro...@gmail.com

diff --git a/drivers/media/dvb/dvb-core/dvb_ca_en50221.c 
b/drivers/media/dvb/dvb-core/dvb_ca_en50221.c
index ef259a0..aa7a298 100644
--- a/drivers/media/dvb/dvb-core/dvb_ca_en50221.c
+++ b/drivers/media/dvb/dvb-core/dvb_ca_en50221.c
@@ -1318,8 +1318,10 @@ static ssize_t dvb_ca_en50221_io_write(struct file *file,
 
fragbuf[0] = connection_id;
fragbuf[1] = ((fragpos + fraglen)  count) ? 0x80 : 0x00;
-   if ((status = copy_from_user(fragbuf + 2, buf + fragpos, 
fraglen)) != 0)
+   if ((status = copy_from_user(fragbuf + 2, buf + fragpos, 
fraglen)) != 0) {
+   status = -EFAULT;
goto exit;
+   }
 
timeout = jiffies + HZ / 2;
written = 0;
@@ -1494,8 +1496,10 @@ static ssize_t dvb_ca_en50221_io_read(struct file *file, 
char __user * buf,
 
hdr[0] = slot;
hdr[1] = connection_id;
-   if ((status = copy_to_user(buf, hdr, 2)) != 0)
+   if ((status = copy_to_user(buf, hdr, 2)) != 0) {
+   status = -EFAULT;
goto exit;
+   }
status = pktlen;
 
 exit:
--
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] V4L/DVB: dvb_ca_en50221: return -EFAULT on copy_to_user errors

2010-06-04 Thread walter harms


Dan Carpenter schrieb:
 copy_to_user() returns the number of bytes remaining to be copied which
 isn't the right thing to return here.  The comments say that these 
 functions in dvb_ca_en50221.c should return the number of bytes copied or
 an error return.  I've changed it to return -EFAULT.
 
 Signed-off-by: Dan Carpenter erro...@gmail.com
 
 diff --git a/drivers/media/dvb/dvb-core/dvb_ca_en50221.c 
 b/drivers/media/dvb/dvb-core/dvb_ca_en50221.c
 index ef259a0..aa7a298 100644
 --- a/drivers/media/dvb/dvb-core/dvb_ca_en50221.c
 +++ b/drivers/media/dvb/dvb-core/dvb_ca_en50221.c
 @@ -1318,8 +1318,10 @@ static ssize_t dvb_ca_en50221_io_write(struct file 
 *file,
  
   fragbuf[0] = connection_id;
   fragbuf[1] = ((fragpos + fraglen)  count) ? 0x80 : 0x00;
 - if ((status = copy_from_user(fragbuf + 2, buf + fragpos, 
 fraglen)) != 0)
 + if ((status = copy_from_user(fragbuf + 2, buf + fragpos, 
 fraglen)) != 0) {
 + status = -EFAULT;
   goto exit;
 + }
  
   timeout = jiffies + HZ / 2;
   written = 0;
 @@ -1494,8 +1496,10 @@ static ssize_t dvb_ca_en50221_io_read(struct file 
 *file, char __user * buf,
  
   hdr[0] = slot;
   hdr[1] = connection_id;
 - if ((status = copy_to_user(buf, hdr, 2)) != 0)
 + if ((status = copy_to_user(buf, hdr, 2)) != 0) {
 + status = -EFAULT;
   goto exit;
 + }
   status = pktlen;
  
  exit:
 --


Doint to many things at once is bad. IMHO it is more readable to do so:

+status = copy_to_user(buf, hdr, 2);
+if ( status  != 0) {

Maybe the maintainer has different ideas but especialy lines like will gain.

-if ((status = copy_from_user(fragbuf + 2, buf + fragpos, fraglen)) != 0)
+status = copy_from_user(fragbuf + 2, buf + fragpos, fraglen):
+if ( status  != 0) {

just my 2 cents,
 wh
--
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


Terratec Cinergy C DVB-C card problems

2010-06-04 Thread Rune Evjen
 Hi,

 I've got a terratec cinergy c dvb-c card, fresh install of ubuntu
 10.04 lucid i386. Card is here:

 http://www.linuxtv.org/wiki/index.php/TerraTec_Cinergy_C_DVB-C

 I followed the install instructions under Driver, installing the one from

 http://mercurial.intuxication.org/hg/s2-liplianin

 dmesg output afterwards:

 http://dpaste.com/202745/

 and lsmod/lspci:

 http://dpaste.com/202150/

 The previous install that worked nicely was hardy, using
 mantis-a9ecd19a37c9 that refused to compile with lucid's more recent
 kernel. Any ideas?

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

Hi,

The Mantis drivers are available in the Ubuntu kernel 2.6.33.

I installed this kernel on top of lucid using this PPA:
http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.33/

Unfortunately, this kernel is built without the mantis module, after
installing the kernel I also compiled the kernel source and copied the
mantis modules into the /lib/modules/2.6.33-020633-
generic/misc/ directory and ran 'depmod -a'

I compiled the following modules to make it work:
-rw-r--r-- 1 root root 10412 2010-05-27 18:15 hopper.ko
-rw-r--r-- 1 root root 45620 2010-05-27 18:15 mantis_core.ko
-rw-r--r-- 1 root root 25624 2010-05-27 18:15 mantis.ko
-rw-r--r-- 1 root root 25244 2010-05-27 18:21 mb86a16.ko

This is probably not the best approach, but it works.

For some reason this module is not automatically loaded during boot
with ubuntu, but I added 'modprobe mantis' to /etc/rc.local so that it
loads during bootup.

Best regards,

Rune
--
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] IR/mceusb: clean up gen1 device init

2010-06-04 Thread Jarod Wilson
The first-gen mceusb device init code, while mostly functional, had a few
issues in it. This patch does the following:

1) removes use of magic numbers
2) eliminates mapping of memory from stack
3) makes debug spew translator functional
4) properly initializes default tx blaster mask

Signed-off-by: Jarod Wilson ja...@redhat.com

---
 drivers/media/IR/mceusb.c |   57 
 1 files changed, 41 insertions(+), 16 deletions(-)

diff --git a/drivers/media/IR/mceusb.c b/drivers/media/IR/mceusb.c
index 6659cd1..ca146ad 100644
--- a/drivers/media/IR/mceusb.c
+++ b/drivers/media/IR/mceusb.c
@@ -48,6 +48,8 @@
 
 #define USB_BUFLEN 32  /* USB reception buffer length */
 #define IRBUF_SIZE 256 /* IR work buffer length */
+#define USB_CTRL_MSG_SZ2   /* Size of usb ctrl msg on gen1 hw */
+#define MCE_G1_INIT_MSGS 40/* Init messages on gen1 hw to throw out */
 
 /* MCE constants */
 #define MCE_CMDBUF_SIZE384 /* MCE Command buffer length */
@@ -300,11 +302,13 @@ static void mceusb_dev_printdata(struct mceusb_dev *ir, 
char *buf,
int i;
u8 cmd, subcmd, data1, data2;
struct device *dev = ir-dev;
+   int idx = 0;
 
-   if (len = 0)
-   return;
+   /* skip meaningless 0xb1 0x60 header bytes on orig receiver */
+   if (ir-flags.microsoft_gen1  !out)
+   idx = 2;
 
-   if (ir-flags.microsoft_gen1  len = 2)
+   if (len = idx)
return;
 
for (i = 0; i  len  i  USB_BUFLEN; i++)
@@ -318,10 +322,10 @@ static void mceusb_dev_printdata(struct mceusb_dev *ir, 
char *buf,
else
strcpy(inout, Got\0);
 
-   cmd= buf[0]  0xff;
-   subcmd = buf[1]  0xff;
-   data1  = buf[2]  0xff;
-   data2  = buf[3]  0xff;
+   cmd= buf[idx]  0xff;
+   subcmd = buf[idx + 1]  0xff;
+   data1  = buf[idx + 2]  0xff;
+   data2  = buf[idx + 3]  0xff;
 
switch (cmd) {
case 0x00:
@@ -339,7 +343,7 @@ static void mceusb_dev_printdata(struct mceusb_dev *ir, 
char *buf,
else
dev_info(dev, hw/sw rev 0x%02x 0x%02x 
 0x%02x 0x%02x\n, data1, data2,
-buf[4], buf[5]);
+buf[idx + 4], buf[idx + 5]);
break;
case 0xaa:
dev_info(dev, Device reset requested\n);
@@ -705,6 +709,13 @@ static void mceusb_set_default_tx_mask(struct urb *urb)
char *buffer = urb-transfer_buffer;
u8 cmd, subcmd, def_tx_mask;
 
+   /* default mask isn't fetchable on gen1, we have to set it */
+   if (ir-flags.microsoft_gen1) {
+   ir-def_tx_mask = MCE_DEFAULT_TX_MASK;
+   ir-tx_mask = MCE_DEFAULT_TX_MASK;
+   return;
+   }
+
cmd= buffer[0]  0xff;
subcmd = buffer[1]  0xff;
 
@@ -769,27 +780,38 @@ static void mceusb_dev_recv(struct urb *urb, struct 
pt_regs *regs)
 static void mceusb_gen1_init(struct mceusb_dev *ir)
 {
int i, ret;
-   char junk[64], data[8];
int partial = 0;
struct device *dev = ir-dev;
+   char *junk, *data;
+
+   junk = kmalloc(2 * USB_BUFLEN, GFP_KERNEL);
+   if (!junk) {
+   dev_err(dev, %s: memory allocation failed!\n, __func__);
+   return;
+   }
+
+   data = kzalloc(USB_CTRL_MSG_SZ, GFP_KERNEL);
+   if (!data) {
+   dev_err(dev, %s: memory allocation failed!\n, __func__);
+   kfree(junk);
+   return;
+   }
 
/*
 * Clear off the first few messages. These look like calibration
 * or test data, I can't really tell. This also flushes in case
 * we have random ir data queued up.
 */
-   for (i = 0; i  40; i++)
+   for (i = 0; i  MCE_G1_INIT_MSGS; i++)
usb_bulk_msg(ir-usbdev,
usb_rcvbulkpipe(ir-usbdev,
ir-usb_ep_in-bEndpointAddress),
-   junk, 64, partial, HZ * 10);
-
-   memset(data, 0, 8);
+   junk, sizeof(junk), partial, HZ * 10);
 
/* Get Status */
ret = usb_control_msg(ir-usbdev, usb_rcvctrlpipe(ir-usbdev, 0),
  USB_REQ_GET_STATUS, USB_DIR_IN,
- 0, 0, data, 2, HZ * 3);
+ 0, 0, data, USB_CTRL_MSG_SZ, HZ * 3);
 
/*ret = usb_get_status( ir-usbdev, 0, 0, data ); */
dev_dbg(dev, %s - ret = %d status = 0x%x 0x%x\n, __func__,
@@ -799,11 +821,11 @@ static void mceusb_gen1_init(struct mceusb_dev *ir)
 * This is a strange one. They issue a set address to the device
 * on the receive control pipe and expect a certain value pair back
 */
-   memset(data, 0, 8);
+   memset(data, 0, sizeof(data));
 
   

Re: [PATCH RESEND] FusionHDTV: Use quick reads for I2C IR device probing

2010-06-04 Thread Jean Delvare
Mauro,

On Wed, 26 May 2010 15:05:11 +0200, Jean Delvare wrote:
 IR support on FusionHDTV cards is broken since kernel 2.6.31. One side
 effect of the switch to the standard binding model for IR I2C devices
 was to let i2c-core do the probing instead of the ir-kbd-i2c driver.
 There is a slight difference between the two probe methods: i2c-core
 uses 0-byte writes, while the ir-kbd-i2c was using 0-byte reads. As
 some IR I2C devices only support reads, the new probe method fails to
 detect them.
 
 For now, revert to letting the driver do the probe, using 0-byte
 reads. In the future, i2c-core will be extended to let callers of
 i2c_new_probed_device() provide a custom probing function.
 
 Signed-off-by: Jean Delvare kh...@linux-fr.org
 Tested-by: Timothy D. Lenz tl...@vorgon.com
 ---
 This fix applies to kernels 2.6.31 to 2.6.34. Should be sent to Linus
 quickly. I had already sent on March 29th, but apparently it was
 overlooked. I have further i2c patches which depend on this one, so
 please process it quickly, otherwise I'll have to push it myself.

This fix is still not upstream! What do I have to do to get it there?
Please!

  drivers/media/video/cx23885/cx23885-i2c.c |   12 +++-
  drivers/media/video/cx88/cx88-i2c.c   |   16 +++-
  2 files changed, 26 insertions(+), 2 deletions(-)
 
 --- linux-2.6.34-rc1.orig/drivers/media/video/cx23885/cx23885-i2c.c   
 2010-02-25 09:10:33.0 +0100
 +++ linux-2.6.34-rc1/drivers/media/video/cx23885/cx23885-i2c.c
 2010-03-18 13:33:05.0 +0100
 @@ -365,7 +365,17 @@ int cx23885_i2c_register(struct cx23885_
  
   memset(info, 0, sizeof(struct i2c_board_info));
   strlcpy(info.type, ir_video, I2C_NAME_SIZE);
 - i2c_new_probed_device(bus-i2c_adap, info, addr_list);
 + /*
 +  * We can't call i2c_new_probed_device() because it uses
 +  * quick writes for probing and the IR receiver device only
 +  * replies to reads.
 +  */
 + if (i2c_smbus_xfer(bus-i2c_adap, addr_list[0], 0,
 +I2C_SMBUS_READ, 0, I2C_SMBUS_QUICK,
 +NULL) = 0) {
 + info.addr = addr_list[0];
 + i2c_new_device(bus-i2c_adap, info);
 + }
   }
  
   return bus-i2c_rc;
 --- linux-2.6.34-rc1.orig/drivers/media/video/cx88/cx88-i2c.c 2010-02-25 
 09:08:40.0 +0100
 +++ linux-2.6.34-rc1/drivers/media/video/cx88/cx88-i2c.c  2010-03-18 
 13:33:05.0 +0100
 @@ -188,10 +188,24 @@ int cx88_i2c_init(struct cx88_core *core
   0x18, 0x6b, 0x71,
   I2C_CLIENT_END
   };
 + const unsigned short *addrp;
  
   memset(info, 0, sizeof(struct i2c_board_info));
   strlcpy(info.type, ir_video, I2C_NAME_SIZE);
 - i2c_new_probed_device(core-i2c_adap, info, addr_list);
 + /*
 +  * We can't call i2c_new_probed_device() because it uses
 +  * quick writes for probing and at least some R receiver
 +  * devices only reply to reads.
 +  */
 + for (addrp = addr_list; *addrp != I2C_CLIENT_END; addrp++) {
 + if (i2c_smbus_xfer(core-i2c_adap, *addrp, 0,
 +I2C_SMBUS_READ, 0,
 +I2C_SMBUS_QUICK, NULL) = 0) {
 + info.addr = *addrp;
 + i2c_new_device(core-i2c_adap, info);
 + break;
 + }
 + }
   }
   return core-i2c_rc;
  }
 
 

-- 
Jean Delvare
--
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] V4L/DVB: dvb_ca_en50221: return -EFAULT on copy_to_user errors

2010-06-04 Thread Dan Carpenter
On Fri, Jun 04, 2010 at 02:26:05PM +0200, walter harms wrote:
 
 Doint to many things at once is bad. IMHO it is more readable to do so:
 
 +status = copy_to_user(buf, hdr, 2);
 +if ( status  != 0) {
 
 Maybe the maintainer has different ideas but especialy lines like will gain.
 
 -if ((status = copy_from_user(fragbuf + 2, buf + fragpos, fraglen)) != 0)
 +status = copy_from_user(fragbuf + 2, buf + fragpos, fraglen):
 +if ( status  != 0) {
 
 just my 2 cents,

You're right of course as always and checkpatch warns about these as
well.

I figured if it was in the original code, it was probably OK to leave it.
But I now recognize this as pure laziness on my part and I appologize.  
Twenty lashes for me and all that.  Fixed patch coming up.  ;)

regards,
dan carpenter


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


[patch v2] V4L/DVB: dvb_ca_en50221: return -EFAULT on copy_to_user errors

2010-06-04 Thread Dan Carpenter
copy_to_user() returns the number of bytes remaining to be copied which
isn't the right thing to return here.  The comments say that these 
functions in dvb_ca_en50221.c should return the number of bytes copied or
an error return.  I've changed it to return -EFAULT.

Signed-off-by: Dan Carpenter erro...@gmail.com
---
V2: Some style fixes suggested by Walter Harms.

diff --git a/drivers/media/dvb/dvb-core/dvb_ca_en50221.c 
b/drivers/media/dvb/dvb-core/dvb_ca_en50221.c
index ef259a0..cb97e6b 100644
--- a/drivers/media/dvb/dvb-core/dvb_ca_en50221.c
+++ b/drivers/media/dvb/dvb-core/dvb_ca_en50221.c
@@ -1318,8 +1318,11 @@ static ssize_t dvb_ca_en50221_io_write(struct file *file,
 
fragbuf[0] = connection_id;
fragbuf[1] = ((fragpos + fraglen)  count) ? 0x80 : 0x00;
-   if ((status = copy_from_user(fragbuf + 2, buf + fragpos, 
fraglen)) != 0)
+   status = copy_from_user(fragbuf + 2, buf + fragpos, fraglen);
+   if (status) {
+   status = -EFAULT;
goto exit;
+   }
 
timeout = jiffies + HZ / 2;
written = 0;
@@ -1494,8 +1497,11 @@ static ssize_t dvb_ca_en50221_io_read(struct file *file, 
char __user * buf,
 
hdr[0] = slot;
hdr[1] = connection_id;
-   if ((status = copy_to_user(buf, hdr, 2)) != 0)
+   status = copy_to_user(buf, hdr, 2);
+   if (status) {
+   status = -EFAULT;
goto exit;
+   }
status = pktlen;
 
 exit:
--
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] V4L/DVB fixes

2010-06-04 Thread Mauro Carvalho Chehab
The following changes since commit 67a3e12b05e055c0415c556a315a3d3eb637e29e:

  Linux 2.6.35-rc1 (2010-05-30 13:21:02 -0700)

are available in the git repository at:
  ssh://master.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git 
v4l_for_2.6.35

Abylay Ospan (1):
  V4L/DVB: cx23885: Check register errors

Andy Walls (1):
  V4L/DVB: cx18, cx23885, v4l2 doc, MAINTAINERS: Update Andy Walls' email 
address

Ang Way Chuang (1):
  V4L/DVB: dvb-core: Fix ULE decapsulation bug

Ben Hutchings (4):
  V4L/DVB: dw2102: Select tda10023 frontend, not tda10021
  V4L/DVB: budget: Select correct frontends
  V4L/DVB: dib0700: Select dib0090 frontend
  V4L/DVB: m920x: Select simple tuner

Dan Carpenter (3):
  V4L/DVB: em28xx: remove unneeded null checks
  V4L/DVB: video/saa7134: remove duplicate break
  V4L/DVB: video/saa7134: change dprintk() to i2cdprintk()

Dmitri Belimov (1):
  V4L/DVB: tm6000, reset I2C bus function

Guy Martin (2):
  V4L/DVB: TT CT-3650 DVB-C support
  V4L/DVB: stv6110x: Fix kernel null pointer deref

Hans Verkuil (30):
  V4L/DVB: bw-qcam: convert to V4L2
  V4L/DVB: c-qcam: convert to V4L2
  V4L/DVB: V4L2 Spec: Improve the VIDIOC_QUERY_DV_PRESET description
  V4L/DVB: saa7115: add s_mbus_fmt op
  V4L/DVB: cx25840: add support for s_mbus_fmt
  V4L/DVB: saa717x: add support for s_mbus_fmt
  V4L/DVB: ivtv: convert to use s_mbus_fmt
  V4L/DVB: cx18: add s_mbus_fmt support
  V4L/DVB: cx18: remove old g/s_fmt from the cx18_av subdev
  V4L/DVB: saa7127: remove obsolete g_fmt support
  V4L/DVB: saa717x: remove obsolete s_fmt op
  V4L/DVB: v4l2-mediabus.h: add two helper functions
  V4L/DVB: saa6752hs: add g/s_mbus_fmt support
  V4L/DVB: saa7134: convert to use the new mbus API
  V4L/DVB: pvrusb2: convert to s_mbus_fmt
  V4L/DVB: cx23885: convert to s_mbus_fmt
  V4L/DVB: cx231xx: convert to s_mbus_fmt
  V4L/DVB: cx24850: remove obsolete g/s_fmt ops
  V4L/DVB: saa7115: remove obsolete g/s_fmt ops
  V4L/DVB: v4l2-mediabus.h: added V4L2_MBUS_FMT_SGRBG8_1X8
  V4L/DVB: mt9v011: add enum/try/s_mbus_fmt support
  V4L/DVB: tvp5150: remove obsolete g/s_fmt ops
  V4L/DVB: au8522_decoder: g/s_fmt doesn't do anything: remove
  V4L/DVB: v4l2-subdev.h: fix enum_mbus_fmt prototype
  V4L/DVB: tvp514x: do NOT change the std as a side effect
  V4L/DVB: tvp514x: make std_list const
  V4L/DVB: tvp514x: there is only one supported format, so simplify the code
  V4L/DVB: tvp514x: add missing newlines
  V4L/DVB: tvp514x: remove obsolete fmt_list
  V4L/DVB: tvp514x: simplify try/g/s_fmt handling

Hermann Gausterer (1):
  V4L/DVB: Technotrend S2-3200 ships with a TT 1500 remote

Herton Ronaldo Krzesinski (2):
  V4L/DVB: saa7134: add support for Avermedia M733A
  V4L/DVB: saa7134: add RM-K6 remote control support for Avermedia M135A

Huang Weiyi (1):
  V4L/DVB: ngene: remove unused #include linux/version.h

Ian Armstrong (4):
  V4L/DVB: cx2341x: Report correct temporal setting for log-status
  V4L/DVB: ivtvfb : Module load / unload fixes
  V4L/DVB: ivtv: Avoid accidental video standard change
  V4L/DVB: ivtv: Timing tweaks and code re-order to try and improve 
stability

Igor M. Liplianin (1):
  V4L/DVB: Bug fix: make IR work again for dm1105

Jarod Wilson (2):
  V4L/DVB: IR/imon: clean up usage of bools
  V4L/DVB: IR/imon: add auto-config for 0xffdc rf device

Jean Delvare (1):
  V4L/DVB: FusionHDTV: Use quick reads for I2C IR device probing

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

Julia Lawall (2):
  V4L/DVB: drivers/media: Use kzalloc
  V4L/DVB: drivers/media: Eliminate a NULL pointer dereference

Mike Isely (7):
  V4L/DVB: pvrusb2: Fix Gotview hardware support
  V4L/DVB: pvrusb2: Avoid using stack allocated buffers when performing USB 
I/O
  V4L/DVB: pvrusb2: New feature to mark specific hardware support as 
experimental
  V4L/DVB: pvrusb2: Fix kernel oops at device unregistration
  V4L/DVB: pvrusb2: Fix USB parent device reference count
  V4L/DVB: pvrusb2: Fix minor internal array allocation
  V4L/DVB: pvrusb2: Fix kernel oops on device tear-down

Oliver Endriss (6):
  V4L/DVB: ngene: Support new device 'Digital Devices DuoFlex S2 miniPCIe'
  V4L/DVB: ngene: Do not call demuxer with interrupts disabled
  V4L/DVB: ngene: Implement support for MSI
  V4L/DVB: ngene: Make command timeout workaround configurable
  V4L/DVB: ngene: MSI cleanup
  V4L/DVB: ngene: Remove debug message

Prarit Bhargava (1):
  V4L/DVB: Add notification to cxusb_dualdig4_rev2_frontend_attach() error  
handling

Randy Dunlap (3):
  V4L/DVB: [-next] IR: fix ir-nec-decoder build, select BITREVERSE
  V4L/DVB: ak881x 

Re: [PATCH 1/3] IR: add core lirc device interface

2010-06-04 Thread Mauro Carvalho Chehab
Em 04-06-2010 12:51, Christoph Bartelmus escreveu:
 Hi Mauro,
 
 on 04 Jun 10 at 01:10, Mauro Carvalho Chehab wrote:
 Em 03-06-2010 19:06, Jarod Wilson escreveu:
 [...]
 As for the compat bits... I actually pulled them out of the Fedora kernel
 and userspace for a while, and there were only a few people who really ran
 into issues with it, but I think if the new userspace and kernel are rolled
 out at the same time in a new distro release (i.e., Fedora 14, in our
 particular case), it should be mostly transparent to users.
 
 For sure this will happen on all distros that follows upstream: they'll
 update lirc to fulfill the minimal requirement at Documentation/Changes.

 The issue will appear only to people that manually compile kernel and lirc.
 Those users are likely smart enough to upgrade to a newer lirc version if
 they notice a trouble, and to check at the forums.
 
 Christoph
 wasn't a fan of the change, and actually asked me to revert it, so I'm
 cc'ing him here for further feedback, but I'm inclined to say that if this
 is the price we pay to get upstream, so be it.
 
 I understand Christoph view, but I think that having to deal with compat
 stuff forever is a high price to pay, as the impact of this change is
 transitory and shouldn't be hard to deal with.
 
 I'm not against doing this change, but it has to be coordinated between  
 drivers and user-space.
 Just changing lirc.h is not enough. You also have to change all user-space  
 applications that use the affected ioctls to use the correct types.
 That's what Jarod did not address last time so I asked him to revert the  
 change.

For sure coordination between kernel and userspace is very important. I'm sure
that Jarod can help with this sync. Also, after having the changes implemented
on userspace, I expect one patch from you adding the minimal lirc requirement 
at Documentation/Changes.

 And I'd also like to collect all other change request to the API  
 if there are any and do all changes in one go.

You and Jarod are the most indicated people to point for such needs. Also, Jon
and David may have some comments.

From my side, as I said before, I'd like to see a documentation of the defined 
API bits,
and the removal of the currently unused ioctls (they can be added later, 
together
with the patches that will introduce the code that handles them) to give my 
final ack.

From what I'm seeing, those are the current used ioctls:

+#define LIRC_GET_FEATURES  _IOR('i', 0x, unsigned long)

+#define LIRC_GET_LENGTH_IOR('i', 0x000f, unsigned long)

+#define LIRC_GET_MIN_TIMEOUT   _IOR('i', 0x0008, uint32_t)
+#define LIRC_GET_MAX_TIMEOUT   _IOR('i', 0x0009, uint32_t)

There is also a defined LIRC_GET_REC_MODE that just returns a mask of 
GET_FEATURES
bits, and a LIRC_SET_REC_MODE that do nothing.

I can't comment about the other ioctls, as currently there's no code using 
them, but
it seems that some of them would be better implemented as ioctl, like the ones 
that
send carrier/burst, etc.

One discussion that may be pertinent is if we should add ioctls for those 
controls,
or if it would be better to just add sysfs nodes for them.

As all those ioctls are related to config stuff, IMO, using sysfs would be 
better, but
I haven't a closed opinion about that matter.

Btw, a lirc userspace that would work with both the out-of-tree and in-tree 
lirc-dev
can easily check for the proper sysfs nodes to know what version of the driver 
is being
used. It will need access sysfs anyway, to enable the lirc decoder.

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


Re: [PATCH RESEND] FusionHDTV: Use quick reads for I2C IR device probing

2010-06-04 Thread Mauro Carvalho Chehab
Em 04-06-2010 12:14, Jean Delvare escreveu:
 Mauro,
 
 On Wed, 26 May 2010 15:05:11 +0200, Jean Delvare wrote:
 IR support on FusionHDTV cards is broken since kernel 2.6.31. One side
 effect of the switch to the standard binding model for IR I2C devices
 was to let i2c-core do the probing instead of the ir-kbd-i2c driver.
 There is a slight difference between the two probe methods: i2c-core
 uses 0-byte writes, while the ir-kbd-i2c was using 0-byte reads. As
 some IR I2C devices only support reads, the new probe method fails to
 detect them.

 For now, revert to letting the driver do the probe, using 0-byte
 reads. In the future, i2c-core will be extended to let callers of
 i2c_new_probed_device() provide a custom probing function.

 Signed-off-by: Jean Delvare kh...@linux-fr.org
 Tested-by: Timothy D. Lenz tl...@vorgon.com
 ---
 This fix applies to kernels 2.6.31 to 2.6.34. Should be sent to Linus
 quickly. I had already sent on March 29th, but apparently it was
 overlooked. I have further i2c patches which depend on this one, so
 please process it quickly, otherwise I'll have to push it myself.
 
 This fix is still not upstream! What do I have to do to get it there?
 Please!

Just sent a pull request.

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


Re: [PATCH 1/3] IR: add core lirc device interface

2010-06-04 Thread Jon Smirl
On Fri, Jun 4, 2010 at 2:38 PM, Mauro Carvalho Chehab
mche...@redhat.com wrote:
 Em 04-06-2010 12:51, Christoph Bartelmus escreveu:
 Hi Mauro,

 on 04 Jun 10 at 01:10, Mauro Carvalho Chehab wrote:
 Em 03-06-2010 19:06, Jarod Wilson escreveu:
 [...]
 As for the compat bits... I actually pulled them out of the Fedora kernel
 and userspace for a while, and there were only a few people who really ran
 into issues with it, but I think if the new userspace and kernel are rolled
 out at the same time in a new distro release (i.e., Fedora 14, in our
 particular case), it should be mostly transparent to users.

 For sure this will happen on all distros that follows upstream: they'll
 update lirc to fulfill the minimal requirement at Documentation/Changes.

 The issue will appear only to people that manually compile kernel and lirc.
 Those users are likely smart enough to upgrade to a newer lirc version if
 they notice a trouble, and to check at the forums.

 Christoph
 wasn't a fan of the change, and actually asked me to revert it, so I'm
 cc'ing him here for further feedback, but I'm inclined to say that if this
 is the price we pay to get upstream, so be it.

 I understand Christoph view, but I think that having to deal with compat
 stuff forever is a high price to pay, as the impact of this change is
 transitory and shouldn't be hard to deal with.

 I'm not against doing this change, but it has to be coordinated between
 drivers and user-space.
 Just changing lirc.h is not enough. You also have to change all user-space
 applications that use the affected ioctls to use the correct types.
 That's what Jarod did not address last time so I asked him to revert the
 change.

 For sure coordination between kernel and userspace is very important. I'm sure
 that Jarod can help with this sync. Also, after having the changes implemented
 on userspace, I expect one patch from you adding the minimal lirc requirement
 at Documentation/Changes.

Keep the get_version() ioctl stable. The first thing user space would
do it call the get_version() ioctl. If user space doesn't support the
kernel version error out and print a message with the url of the
project web site and tell the user to upgrade.

If you have the ability to upgrade your kernel you should also have
the ability to upgrade user space too. I'm no fan of keeping backwards
compatibility code around. It just becomes piles of clutter that
nobody maintains. A reliable mechanism to determine version mismatch
is all that is needed.

PS - I really don't like having to fix bug reports in compatibility
code. That is an incredible waste of support time that can be easily
fixed by upgrading the user.


 And I'd also like to collect all other change request to the API
 if there are any and do all changes in one go.

 You and Jarod are the most indicated people to point for such needs. Also, Jon
 and David may have some comments.

 From my side, as I said before, I'd like to see a documentation of the 
 defined API bits,
 and the removal of the currently unused ioctls (they can be added later, 
 together
 with the patches that will introduce the code that handles them) to give my 
 final ack.

 From what I'm seeing, those are the current used ioctls:

 +#define LIRC_GET_FEATURES              _IOR('i', 0x, unsigned long)

 +#define LIRC_GET_LENGTH                _IOR('i', 0x000f, unsigned long)

Has this been set into stone yet? if not a 64b word would be more future proof.
Checking the existence of features might be better as sysfs
attributes. You can have as many sysfs attributes as you want.

 +#define LIRC_GET_MIN_TIMEOUT           _IOR('i', 0x0008, uint32_t)
 +#define LIRC_GET_MAX_TIMEOUT           _IOR('i', 0x0009, uint32_t)

 There is also a defined LIRC_GET_REC_MODE that just returns a mask of 
 GET_FEATURES
 bits, and a LIRC_SET_REC_MODE that do nothing.

 I can't comment about the other ioctls, as currently there's no code using 
 them, but
 it seems that some of them would be better implemented as ioctl, like the 
 ones that
 send carrier/burst, etc.

If the ioctls haven't been implemented, leave them as comments in the
h file. Don't implement them with stubs. Stubs will set the parameters
into stone and the parameters may be wrong.

 One discussion that may be pertinent is if we should add ioctls for those 
 controls,
 or if it would be better to just add sysfs nodes for them.

 As all those ioctls are related to config stuff, IMO, using sysfs would be 
 better, but
 I haven't a closed opinion about that matter.

In general sysfs is used to set options that are static or only change
infrequently.

If the parameter is set on every request, use an IOCTL.



 Btw, a lirc userspace that would work with both the out-of-tree and in-tree 
 lirc-dev
 can easily check for the proper sysfs nodes to know what version of the 
 driver is being
 used. It will need access sysfs anyway, to enable the lirc decoder.

 Cheers,
 Mauro.




-- 
Jon Smirl

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

2010-06-04 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:Fri Jun  4 19:00:22 CEST 2010
path:http://www.linuxtv.org/hg/v4l-dvb
changeset:   14875:304cfde05b3f
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-armv5: ERRORS
linux-2.6.35-rc1-armv5: ERRORS
linux-2.6.32.6-armv5-davinci: OK
linux-2.6.33-armv5-davinci: OK
linux-2.6.34-armv5-davinci: ERRORS
linux-2.6.35-rc1-armv5-davinci: ERRORS
linux-2.6.32.6-armv5-ixp: OK
linux-2.6.33-armv5-ixp: OK
linux-2.6.34-armv5-ixp: ERRORS
linux-2.6.35-rc1-armv5-ixp: ERRORS
linux-2.6.32.6-armv5-omap2: OK
linux-2.6.33-armv5-omap2: OK
linux-2.6.34-armv5-omap2: ERRORS
linux-2.6.35-rc1-armv5-omap2: ERRORS
linux-2.6.22.19-i686: ERRORS
linux-2.6.23.17-i686: ERRORS
linux-2.6.24.7-i686: WARNINGS
linux-2.6.25.20-i686: WARNINGS
linux-2.6.26.8-i686: WARNINGS
linux-2.6.27.44-i686: WARNINGS
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-i686: ERRORS
linux-2.6.35-rc1-i686: ERRORS
linux-2.6.32.6-m32r: OK
linux-2.6.33-m32r: OK
linux-2.6.34-m32r: ERRORS
linux-2.6.35-rc1-m32r: ERRORS
linux-2.6.32.6-mips: OK
linux-2.6.33-mips: OK
linux-2.6.34-mips: ERRORS
linux-2.6.35-rc1-mips: ERRORS
linux-2.6.32.6-powerpc64: OK
linux-2.6.33-powerpc64: OK
linux-2.6.34-powerpc64: ERRORS
linux-2.6.35-rc1-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: WARNINGS
linux-2.6.25.20-x86_64: WARNINGS
linux-2.6.26.8-x86_64: WARNINGS
linux-2.6.27.44-x86_64: WARNINGS
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-x86_64: ERRORS
linux-2.6.35-rc1-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/Friday.log

Full logs are available here:

http://www.xs4all.nl/~hverkuil/logs/Friday.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


tm6000 audio buffer

2010-06-04 Thread Luis Henrique Fagundes
Hi,

I'm sending a patch that hypothetically would allocate a memory buffer
for the audio and copy the data from urb to buffer. It doesn't work,
so I'm not putting a [PATCH] in subject and send it just for feedback.
Am I going on the right way of implementing this? The patch was made
against the mercurial version at http://linuxtv.org/hg/v4l-dvb.

I can see the audio packets at tm6000-video.c. Mauro said that the urb
audio packets had just 4 bytes of relevant data, 2 for each channel,
but the audio buffer has 128Kb and I see too few packets. Anyway, the
tm6000_audio_isocirq function receives the size of the packet and now
is copying everything to the buffer, I guess next step will be to find
what is relevant in this stream and make sure I have all packets here.

I haven't applied all the recent patches from Stefan yet.

Luis


audio_buffer_patch
Description: Binary data


tm6000 autio isoc blocks

2010-06-04 Thread Stefan Ringel
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
 
Hi Mauro,

I have check the windows usb log and if I have audio block it's say 0
byte, but the data is complete 180 bytes until next block header. So I
think it's good if that audio block (cmd=2) resize from 0 to 180
(actual read 0 without resize it).
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.12 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
 
iQEcBAEBAgAGBQJMCWhtAAoJEAWtPFjxMvFGgyAH/jCgxFhc6pA7umakxaYAwfnf
Yrg/V+JDEPUGzGVmvl4a7jzHkzn1hrZ3Pn3YCgNP7CIGeaoaiWgx+4ptLpKSyuH3
noG36DXQBX19g35Dhch4vpCrhVlCE4M+fD6gsBRgcCFEmAdWojsHDpyhOBoPnxrS
t9xkh59SEcYSPKvleB3HGVP9/tKggbGXoeRh7Ag7lBtzKAraqQMA/C0REwT4OHmc
/IL2+z1D1fb/vR2MU5uYHLgANI3WdiRbdr9yHzBdpOJ57IrytsoVRL8WdhbmuFI8
/PH2NXYfOAoyi/boFbVidmu0MSj7+OA0XrHUORjKPnmrgleOahbitDYZAxh6Jfo=
=CRkV
-END PGP SIGNATURE-

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


tm6000 and ir

2010-06-04 Thread Stefan Ringel
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
 
Hi Mauro,

I write actually the ir implementation (tm6000-input.c). Can you give
me any stuff what can help me?

Stefan Ringel
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.12 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
 
iQEcBAEBAgAGBQJMCWoFAAoJEAWtPFjxMvFGvn8H/iJ2Xg4cabtrdDEgQ9WbXA+C
TH6FTsqQ6eOZTkEOUxAkKOWXi+12UGrdqhQC6twqulhPpRi4bJm6kEqM8reeZJCl
EUvqkfQdkqOrnhDnAvj1Q1sp/RLHLjXpCUFOk43f+fwnA2bc3/CJk2uKeMNDtLa7
f1pIN4Eu7+by7K0SPFW3qlmKoTO6bEFmBUCxtrszJFBVVpcpeX4iAoQ693Q5LFCb
FTjPRpKFRdS47WGlXP4jBgC8DQ70KjNCVoXFiqeVbfCDEdYunhjPytxzVkD0Zgij
WXbuTrfpoGIzOJ0QOXr7Fj8XaAMmlEIjzqTeviY/MLUMdOKxpaR4TMHXYkvuQvA=
=loGv
-END PGP SIGNATURE-

--
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 1/3] IR: add core lirc device interface

2010-06-04 Thread Jarod Wilson
On Fri, Jun 4, 2010 at 4:17 PM, Jarod Wilson ja...@redhat.com wrote:
 On Fri, Jun 04, 2010 at 02:57:04PM -0400, Jon Smirl wrote:
...
  From what I'm seeing, those are the current used ioctls:
 
  +#define LIRC_GET_FEATURES              _IOR('i', 0x, unsigned 
  long)
  +#define LIRC_GET_LENGTH                _IOR('i', 0x000f, unsigned 
  long)

 Has this been set into stone yet? if not a 64b word would be more future 
 proof.

 Nope, not set in stone at all, nothing has been merged. A patch I was
 carrying in Fedora changed all unsigned long to u64 and unsigned int to
 u32, and my current ir wip tree has all u32, but I don't see a reason why
 if we're going to make a change, it couldn't be to all u64, for as much
 future-proofing as possible.

Hrm, struct file_operations specifies an unsigned long for the ioctl
args, so doesn't that mean we're pretty much stuck with only 32-bit
for the ioctls?

Even with only 32 feature flags, I think we'd still be just fine,
there appear to be only 15 feature flags at present, and I doubt many
more features need to be added, given how long lirc has been around.

-- 
Jarod Wilson
ja...@wilsonet.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


Re: [PATCH 1/3] IR: add core lirc device interface

2010-06-04 Thread Jon Smirl
On Fri, Jun 4, 2010 at 5:17 PM, Jarod Wilson ja...@wilsonet.com wrote:
 On Fri, Jun 4, 2010 at 4:17 PM, Jarod Wilson ja...@redhat.com wrote:
 On Fri, Jun 04, 2010 at 02:57:04PM -0400, Jon Smirl wrote:
 ...
  From what I'm seeing, those are the current used ioctls:
 
  +#define LIRC_GET_FEATURES              _IOR('i', 0x, unsigned 
  long)
  +#define LIRC_GET_LENGTH                _IOR('i', 0x000f, unsigned 
  long)

 Has this been set into stone yet? if not a 64b word would be more future 
 proof.

 Nope, not set in stone at all, nothing has been merged. A patch I was
 carrying in Fedora changed all unsigned long to u64 and unsigned int to
 u32, and my current ir wip tree has all u32, but I don't see a reason why
 if we're going to make a change, it couldn't be to all u64, for as much
 future-proofing as possible.

 Hrm, struct file_operations specifies an unsigned long for the ioctl
 args, so doesn't that mean we're pretty much stuck with only 32-bit
 for the ioctls?

I haven't written an IOCTL in a while, but how would you pass a 64b
memory address?


 Even with only 32 feature flags, I think we'd still be just fine,
 there appear to be only 15 feature flags at present, and I doubt many
 more features need to be added, given how long lirc has been around.

 --
 Jarod Wilson
 ja...@wilsonet.com




-- 
Jon Smirl
jonsm...@gmail.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


Re: [PATCH] tm6000: bugfix unkown symbol tm6000_debug

2010-06-04 Thread Mauro Carvalho Chehab
Em 03-06-2010 12:49, stefan.rin...@arcor.de escreveu:
 From: Stefan Ringel stefan.rin...@arcor.de
 
 May 30 07:54:09 linux-v5dy kernel: [ 2555.727426] tm6000: Unknown symbol
 tm6000_debug

This won't work, since the same module will have diferent tm6000_debug vars.

I'll write a proper fix and submit shortly, together with some patches I've made
for alsa.

 
 Signed-off-by: Stefan Ringel stefan.rin...@arcor.de
 ---
  drivers/staging/tm6000/tm6000-core.c  |2 ++
  drivers/staging/tm6000/tm6000-dvb.c   |4 ++--
  drivers/staging/tm6000/tm6000-video.c |2 +-
  drivers/staging/tm6000/tm6000.h   |2 --
  4 files changed, 5 insertions(+), 5 deletions(-)
 
 diff --git a/drivers/staging/tm6000/tm6000-core.c 
 b/drivers/staging/tm6000/tm6000-core.c
 index 2fbf4f6..350770e 100644
 --- a/drivers/staging/tm6000/tm6000-core.c
 +++ b/drivers/staging/tm6000/tm6000-core.c
 @@ -29,6 +29,8 @@
  #include media/v4l2-common.h
  #include media/tuner.h
  
 +static int tm6000_debug;
 +
  #define USB_TIMEOUT  5*HZ /* ms */
  
  int tm6000_read_write_usb(struct tm6000_core *dev, u8 req_type, u8 req,
 diff --git a/drivers/staging/tm6000/tm6000-dvb.c 
 b/drivers/staging/tm6000/tm6000-dvb.c
 index 3ccc466..34dc8e5 100644
 --- a/drivers/staging/tm6000/tm6000-dvb.c
 +++ b/drivers/staging/tm6000/tm6000-dvb.c
 @@ -38,9 +38,9 @@ MODULE_SUPPORTED_DEVICE({{Trident, tm5600},
   {{Trident, tm6000},
   {{Trident, tm6010});
  
 -static int debug
 +static int tm6000_debug;
  
 -module_param(debug, int, 0644);
 +module_param_named(debug, tm6000_debug, int, 0644);
  MODULE_PARM_DESC(debug, enable debug message);
  
  static inline void print_err_status(struct tm6000_core *dev,
 diff --git a/drivers/staging/tm6000/tm6000-video.c 
 b/drivers/staging/tm6000/tm6000-video.c
 index 1e348ac..1663dd2 100644
 --- a/drivers/staging/tm6000/tm6000-video.c
 +++ b/drivers/staging/tm6000/tm6000-video.c
 @@ -55,7 +55,7 @@ static unsigned int vid_limit = 16; /* Video memory limit, 
 in Mb */
  static int video_nr = -1;/* /dev/videoN, -1 for autodetect */
  
  /* Debug level */
 -int tm6000_debug;
 +static int tm6000_debug;
  
  /* supported controls */
  static struct v4l2_queryctrl tm6000_qctrl[] = {
 diff --git a/drivers/staging/tm6000/tm6000.h b/drivers/staging/tm6000/tm6000.h
 index 4b65094..ed7fece 100644
 --- a/drivers/staging/tm6000/tm6000.h
 +++ b/drivers/staging/tm6000/tm6000.h
 @@ -318,8 +318,6 @@ int tm6000_queue_init(struct tm6000_core *dev);
  
  /* Debug stuff */
  
 -extern int tm6000_debug;
 -
  #define dprintk(dev, level, fmt, arg...) do {\
   if (tm6000_debug  level) \
   printk(KERN_INFO (%lu) %s %s :fmt, jiffies, \

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


[PATCH 3/6] tm6000-alsa: rework audio buffer allocation/deallocation

2010-06-04 Thread Mauro Carvalho Chehab
Signed-off-by: Mauro Carvalho Chehab mche...@redhat.com

diff --git a/drivers/staging/tm6000/tm6000-alsa.c 
b/drivers/staging/tm6000/tm6000-alsa.c
index 8520434..ca9aec5 100644
--- a/drivers/staging/tm6000/tm6000-alsa.c
+++ b/drivers/staging/tm6000/tm6000-alsa.c
@@ -15,6 +15,7 @@
 #include linux/device.h
 #include linux/interrupt.h
 #include linux/usb.h
+#include linux/vmalloc.h
 
 #include asm/delay.h
 #include sound/core.h
@@ -105,19 +106,39 @@ static int _tm6000_stop_audio_dma(struct snd_tm6000_card 
*chip)
return 0;
 }
 
-static int dsp_buffer_free(struct snd_tm6000_card *chip)
+static void dsp_buffer_free(struct snd_pcm_substream *substream)
 {
-   BUG_ON(!chip-bufsize);
+   struct snd_tm6000_card *chip = snd_pcm_substream_chip(substream);
 
dprintk(2, Freeing buffer\n);
 
-   /* FIXME: Frees buffer */
+   vfree(substream-runtime-dma_area);
+   substream-runtime-dma_area = NULL;
+   substream-runtime-dma_bytes = 0;
+}
+
+static int dsp_buffer_alloc(struct snd_pcm_substream *substream, int size)
+{
+   struct snd_tm6000_card *chip = snd_pcm_substream_chip(substream);
+
+   dprintk(2, Allocating buffer\n);
 
-   chip-bufsize = 0;
+   if (substream-runtime-dma_area) {
+   if (substream-runtime-dma_bytes  size)
+   return 0;
+   dsp_buffer_free(substream);
+   }
 
-   return 0;
+   substream-runtime-dma_area = vmalloc(size);
+   if (!substream-runtime-dma_area)
+   return -ENOMEM;
+
+   substream-runtime-dma_bytes = size;
+
+   return 0;
 }
 
+
 /
ALSA PCM Interface
  /
@@ -184,23 +205,13 @@ static int snd_tm6000_close(struct snd_pcm_substream 
*substream)
 static int snd_tm6000_hw_params(struct snd_pcm_substream *substream,
  struct snd_pcm_hw_params *hw_params)
 {
-   struct snd_tm6000_card *chip = snd_pcm_substream_chip(substream);
+   int size, rc;
 
-   if (substream-runtime-dma_area) {
-   dsp_buffer_free(chip);
-   substream-runtime-dma_area = NULL;
-   }
-
-   chip-period_size = params_period_bytes(hw_params);
-   chip-num_periods = params_periods(hw_params);
-   chip-bufsize = chip-period_size * params_periods(hw_params);
-
-   BUG_ON(!chip-bufsize);
-
-   dprintk(1, Setting buffer\n);
-
-   /* FIXME: Allocate buffer for audio */
+   size = params_period_bytes(hw_params) * params_periods(hw_params);
 
+   rc = dsp_buffer_alloc(substream, size);
+   if (rc  0)
+   return rc;
 
return 0;
 }
@@ -210,13 +221,7 @@ static int snd_tm6000_hw_params(struct snd_pcm_substream 
*substream,
  */
 static int snd_tm6000_hw_free(struct snd_pcm_substream *substream)
 {
-
-   struct snd_tm6000_card *chip = snd_pcm_substream_chip(substream);
-
-   if (substream-runtime-dma_area) {
-   dsp_buffer_free(chip);
-   substream-runtime-dma_area = NULL;
-   }
+   dsp_buffer_free(substream);
 
return 0;
 }
diff --git a/drivers/staging/tm6000/tm6000.h b/drivers/staging/tm6000/tm6000.h
index 18d1e51..a1d96d6 100644
--- a/drivers/staging/tm6000/tm6000.h
+++ b/drivers/staging/tm6000/tm6000.h
@@ -136,11 +136,7 @@ struct snd_tm6000_card {
struct snd_card *card;
spinlock_t  reg_lock;
atomic_tcount;
-   unsigned intperiod_size;
-   unsigned intnum_periods;
struct tm6000_core  *core;
-   struct tm6000_buffer*buf;
-   int bufsize;
struct snd_pcm_substream*substream;
 };
 
-- 
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


[PATCH 1/6] tm6000: Fix compilation breakages

2010-06-04 Thread Mauro Carvalho Chehab
A previous patch seemed to break compilation of the driver.

Signed-off-by: Mauro Carvalho Chehab mche...@redhat.com

 mode change 100644 = 100755 Documentation/video4linux/extract_xc3028.pl

diff --git a/Documentation/video4linux/extract_xc3028.pl 
b/Documentation/video4linux/extract_xc3028.pl
old mode 100644
new mode 100755
diff --git a/drivers/staging/tm6000/tm6000-cards.c 
b/drivers/staging/tm6000/tm6000-cards.c
index 4a8c659..50756e5 100644
--- a/drivers/staging/tm6000/tm6000-cards.c
+++ b/drivers/staging/tm6000/tm6000-cards.c
@@ -683,7 +683,6 @@ static int tm6000_init_dev(struct tm6000_core *dev)
tm6000_add_into_devlist(dev);
tm6000_init_extension(dev);
 
-   }
mutex_unlock(dev-lock);
return 0;
 
diff --git a/drivers/staging/tm6000/tm6000-core.c 
b/drivers/staging/tm6000/tm6000-core.c
index 2fbf4f6..1f2765c 100644
--- a/drivers/staging/tm6000/tm6000-core.c
+++ b/drivers/staging/tm6000/tm6000-core.c
@@ -295,7 +295,6 @@ int tm6000_init_analog_mode(struct tm6000_core *dev)
tm6000_set_reg(dev, 
TM6010_REQ07_RC0_ACTIVE_VIDEO_SOURCE, 0x20);
else/* Enable Hfilter and disable TS Drop err */
tm6000_set_reg(dev, 
TM6010_REQ07_RC0_ACTIVE_VIDEO_SOURCE, 0x80);
-   }
 
tm6000_set_reg(dev, TM6010_REQ07_RC3_HSTART1, 0x88);
tm6000_set_reg(dev, TM6010_REQ07_RD8_IR_WAKEUP_SEL, 0x23);
@@ -401,7 +400,7 @@ int tm6000_init_digital_mode(struct tm6000_core *dev)
 
return 0;
 }
-EXPORT_SYMBOL(tm6000_init_digial_mode);
+EXPORT_SYMBOL(tm6000_init_digital_mode);
 
 struct reg_init {
u8 req;
diff --git a/drivers/staging/tm6000/tm6000-dvb.c 
b/drivers/staging/tm6000/tm6000-dvb.c
index 3ccc466..5ee1aff 100644
--- a/drivers/staging/tm6000/tm6000-dvb.c
+++ b/drivers/staging/tm6000/tm6000-dvb.c
@@ -38,7 +38,7 @@ MODULE_SUPPORTED_DEVICE({{Trident, tm5600},
{{Trident, tm6000},
{{Trident, tm6010});
 
-static int debug
+static int debug;
 
 module_param(debug, int, 0644);
 MODULE_PARM_DESC(debug, enable debug message);
@@ -191,7 +191,7 @@ int tm6000_start_feed(struct dvb_demux_feed *feed)
dvb-streams = 1;
 /* mutex_init(tm6000_dev-streming_mutex); */
tm6000_start_stream(dev);
-   } else {
+   } else
++(dvb-streams);
mutex_unlock(dvb-mutex);
 
@@ -227,7 +227,7 @@ int tm6000_dvb_attach_frontend(struct tm6000_core *dev)
 
if (dev-caps.has_zl10353) {
struct zl10353_config config = {
-demod_address = dev-demod_addr,
+.demod_address = dev-demod_addr,
 .no_tuner = 1,
 .parallel_ts = 1,
 .if2 = 45700,
@@ -390,7 +390,7 @@ static int dvb_init(struct tm6000_core *dev)
int rc;
 
if (!dev)
-   retrun 0;
+   return 0;
 
if (!dev-caps.has_dvb)
return 0;
@@ -427,7 +427,7 @@ static int dvb_fini(struct tm6000_core *dev)
dev-dvb = NULL;
}
 
-   retrun 0;
+   return 0;
 }
 
 static struct tm6000_ops dvb_ops = {
diff --git a/drivers/staging/tm6000/tm6000.h b/drivers/staging/tm6000/tm6000.h
index 4b65094..18d1e51 100644
--- a/drivers/staging/tm6000/tm6000.h
+++ b/drivers/staging/tm6000/tm6000.h
@@ -269,9 +269,6 @@ int tm6000_init_analog_mode(struct tm6000_core *dev);
 int tm6000_init_digital_mode(struct tm6000_core *dev);
 int tm6000_set_audio_bitrate(struct tm6000_core *dev, int bitrate);
 
-int tm6000_dvb_register(struct tm6000_core *dev);
-void tm6000_dvb_unregister(struct tm6000_core *dev);
-
 int tm6000_v4l2_register(struct tm6000_core *dev);
 int tm6000_v4l2_unregister(struct tm6000_core *dev);
 int tm6000_v4l2_exit(void);
-- 
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


[PATCH 2/6] tm6000: Avoid OOPS when loading tm6000-alsa module

2010-06-04 Thread Mauro Carvalho Chehab
Signed-off-by: Mauro Carvalho Chehab mche...@redhat.com

diff --git a/drivers/staging/tm6000/tm6000-alsa.c 
b/drivers/staging/tm6000/tm6000-alsa.c
index 55a0925..8520434 100644
--- a/drivers/staging/tm6000/tm6000-alsa.c
+++ b/drivers/staging/tm6000/tm6000-alsa.c
@@ -39,7 +39,7 @@
  /
 
 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
-static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;   /* ID for this card */
+
 static int enable[SNDRV_CARDS] = {1, [1 ... (SNDRV_CARDS - 1)] = 1};
 
 module_param_array(enable, bool, NULL, 0444);
@@ -316,7 +316,7 @@ int tm6000_audio_init(struct tm6000_core *dev)
if (!enable[devnr])
return -ENOENT;
 
-   rc = snd_card_create(index[devnr], id[devnr], THIS_MODULE, 0, card);
+   rc = snd_card_create(index[devnr], tm6000, THIS_MODULE, 0, card);
if (rc  0) {
snd_printk(KERN_ERR cannot create card instance %d\n, devnr);
return rc;
-- 
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


[PATCH 0/6] tm6000: some fixes plus alsa improvements

2010-06-04 Thread Mauro Carvalho Chehab
This patch series fixes a few compilation troubles with tm6000, caused by
recent patches, and adds an alsa callback to allow it to fill the audio
buffers.

The current code there is just a printk code, but finishing it should be
trivial (assuming that the audio buffers are properly filled).

Mauro Carvalho Chehab (6):
  tm6000: Fix compilation breakages
  tm6000: Avoid OOPS when loading tm6000-alsa module
  tm6000-alsa: rework audio buffer allocation/deallocation
  tm6000: Use an emum for extension type
  tm6000: Add a callback code for buffer fill
  tm6000: avoid unknown symbol tm6000_debug

 drivers/staging/tm6000/tm6000-alsa.c|   81 +--
 drivers/staging/tm6000/tm6000-cards.c   |1 -
 drivers/staging/tm6000/tm6000-core.c|   20 ++-
 drivers/staging/tm6000/tm6000-dvb.c |   12 ++--
 drivers/staging/tm6000/tm6000-video.c   |3 +-
 drivers/staging/tm6000/tm6000.h |   19 +++---
 6 files changed, 86 insertions(+), 50 deletions(-)
 mode change 100644 = 100755 Documentation/video4linux/extract_xc3028.pl

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


[PATCH 6/6] tm6000: avoid unknown symbol tm6000_debug

2010-06-04 Thread Mauro Carvalho Chehab
Reported by Stefan Ringel.

Thanks-to: Stefan Ringel stefan.rin...@arcor.de
Signed-off-by: Mauro Carvalho Chehab mche...@redhat.com

diff --git a/drivers/staging/tm6000/tm6000-video.c 
b/drivers/staging/tm6000/tm6000-video.c
index c0d6f6a..34e8ef5 100644
--- a/drivers/staging/tm6000/tm6000-video.c
+++ b/drivers/staging/tm6000/tm6000-video.c
@@ -56,6 +56,7 @@ static int video_nr = -1; /* /dev/videoN, -1 for 
autodetect */
 
 /* Debug level */
 int tm6000_debug;
+EXPORT_SYMBOL_GPL(tm6000_debug);
 
 /* supported controls */
 static struct v4l2_queryctrl tm6000_qctrl[] = {
-- 
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


[PATCH 5/6] tm6000: Add a callback code for buffer fill

2010-06-04 Thread Mauro Carvalho Chehab
Implements a callback to be used by tm6000-alsa, in order to allow filling
audio data packets.

Signed-off-by: Mauro Carvalho Chehab mche...@redhat.com

diff --git a/drivers/staging/tm6000/tm6000-alsa.c 
b/drivers/staging/tm6000/tm6000-alsa.c
index db1eef9..e71579e 100644
--- a/drivers/staging/tm6000/tm6000-alsa.c
+++ b/drivers/staging/tm6000/tm6000-alsa.c
@@ -199,6 +199,21 @@ static int snd_tm6000_close(struct snd_pcm_substream 
*substream)
return 0;
 }
 
+static int tm6000_fillbuf(struct tm6000_core *core, char *buf, int size)
+{
+   int i;
+
+   /* Need to add a real code to copy audio buffer */
+   printk(Audio (%i bytes): , size);
+   for (i = 0; i  size - 3; i +=4)
+   printk((0x%04x, 0x%04x), ,
+   *(u16 *)(buf + i), *(u16 *)(buf + i + 2));
+
+   printk(\n);
+
+   return 0;
+}
+
 /*
  * hw_params callback
  */
@@ -395,6 +410,7 @@ struct tm6000_ops audio_ops = {
.name   = TM6000 Audio Extension,
.init   = tm6000_audio_init,
.fini   = tm6000_audio_fini,
+   .fillbuf = tm6000_fillbuf,
 };
 
 static int __init tm6000_alsa_register(void)
diff --git a/drivers/staging/tm6000/tm6000-core.c 
b/drivers/staging/tm6000/tm6000-core.c
index 1f2765c..626b85e 100644
--- a/drivers/staging/tm6000/tm6000-core.c
+++ b/drivers/staging/tm6000/tm6000-core.c
@@ -652,6 +652,23 @@ void tm6000_add_into_devlist(struct tm6000_core *dev)
 static LIST_HEAD(tm6000_extension_devlist);
 static DEFINE_MUTEX(tm6000_extension_devlist_lock);
 
+int tm6000_call_fillbuf(struct tm6000_core *dev, enum tm6000_ops_type type,
+   char *buf, int size)
+{
+   struct tm6000_ops *ops = NULL;
+
+   /* FIXME: tm6000_extension_devlist_lock should be a spinlock */
+
+   if (!list_empty(tm6000_extension_devlist)) {
+   list_for_each_entry(ops, tm6000_extension_devlist, next) {
+   if (ops-fillbuf  ops-type == type)
+   ops-fillbuf(dev, buf, size);
+   }
+   }
+
+   return 0;
+}
+
 int tm6000_register_extension(struct tm6000_ops *ops)
 {
struct tm6000_core *dev = NULL;
diff --git a/drivers/staging/tm6000/tm6000-video.c 
b/drivers/staging/tm6000/tm6000-video.c
index 1e348ac..c0d6f6a 100644
--- a/drivers/staging/tm6000/tm6000-video.c
+++ b/drivers/staging/tm6000/tm6000-video.c
@@ -301,7 +301,7 @@ static int copy_streams(u8 *data, unsigned long len,
memcpy (voutp[pos], ptr, cpysize);
break;
case TM6000_URB_MSG_AUDIO:
-   /* Need some code to copy audio buffer */
+   tm6000_call_fillbuf(dev, TM6000_AUDIO, ptr, 
cpysize);
break;
case TM6000_URB_MSG_VBI:
/* Need some code to copy vbi buffer */
diff --git a/drivers/staging/tm6000/tm6000.h b/drivers/staging/tm6000/tm6000.h
index 8fccf3e..db99959 100644
--- a/drivers/staging/tm6000/tm6000.h
+++ b/drivers/staging/tm6000/tm6000.h
@@ -229,6 +229,7 @@ struct tm6000_ops {
enum tm6000_ops_typetype;
int (*init)(struct tm6000_core *);
int (*fini)(struct tm6000_core *);
+   int (*fillbuf)(struct tm6000_core *, char *buf, int size);
 };
 
 struct tm6000_fh {
@@ -278,6 +279,9 @@ int tm6000_register_extension(struct tm6000_ops *ops);
 void tm6000_unregister_extension(struct tm6000_ops *ops);
 void tm6000_init_extension(struct tm6000_core *dev);
 void tm6000_close_extension(struct tm6000_core *dev);
+int tm6000_call_fillbuf(struct tm6000_core *dev, enum tm6000_ops_type type,
+   char *buf, int size);
+
 
 /* In tm6000-stds.c */
 void tm6000_get_std_res(struct tm6000_core *dev);
-- 
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


[PATCH 4/6] tm6000: Use an emum for extension type

2010-06-04 Thread Mauro Carvalho Chehab
In order to better document and be sure that the values are used
at the proper places, convert extension type into an enum and
name it as type, instead of id.

Signed-off-by: Mauro Carvalho Chehab mche...@redhat.com

diff --git a/drivers/staging/tm6000/tm6000-alsa.c 
b/drivers/staging/tm6000/tm6000-alsa.c
index ca9aec5..db1eef9 100644
--- a/drivers/staging/tm6000/tm6000-alsa.c
+++ b/drivers/staging/tm6000/tm6000-alsa.c
@@ -391,7 +391,7 @@ static int tm6000_audio_fini(struct tm6000_core *dev)
 }
 
 struct tm6000_ops audio_ops = {
-   .id = TM6000_AUDIO,
+   .type   = TM6000_AUDIO,
.name   = TM6000 Audio Extension,
.init   = tm6000_audio_init,
.fini   = tm6000_audio_fini,
diff --git a/drivers/staging/tm6000/tm6000-dvb.c 
b/drivers/staging/tm6000/tm6000-dvb.c
index 5ee1aff..ff9cc6d 100644
--- a/drivers/staging/tm6000/tm6000-dvb.c
+++ b/drivers/staging/tm6000/tm6000-dvb.c
@@ -431,7 +431,7 @@ static int dvb_fini(struct tm6000_core *dev)
 }
 
 static struct tm6000_ops dvb_ops = {
-   .id = TM6000_DVB,
+   .type   = TM6000_DVB,
.name   = TM6000 dvb Extension,
.init   = dvb_init,
.fini   = dvb_fini,
diff --git a/drivers/staging/tm6000/tm6000.h b/drivers/staging/tm6000/tm6000.h
index a1d96d6..8fccf3e 100644
--- a/drivers/staging/tm6000/tm6000.h
+++ b/drivers/staging/tm6000/tm6000.h
@@ -218,13 +218,15 @@ struct tm6000_core {
spinlock_t   slock;
 };
 
-#define TM6000_AUDIO 0x10
-#define TM6000_DVB 0x20
+enum tm6000_ops_type {
+   TM6000_AUDIO = 0x10,
+   TM6000_DVB = 0x20,
+};
 
 struct tm6000_ops {
struct list_headnext;
char*name;
-   int id;
+   enum tm6000_ops_typetype;
int (*init)(struct tm6000_core *);
int (*fini)(struct tm6000_core *);
 };
-- 
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: tm6000 audio buffer

2010-06-04 Thread Mauro Carvalho Chehab
Hi Luis,

Em 04-06-2010 16:39, Luis Henrique Fagundes escreveu:
 Hi,
 
 I'm sending a patch that hypothetically would allocate a memory buffer
 for the audio and copy the data from urb to buffer. It doesn't work,
 so I'm not putting a [PATCH] in subject and send it just for feedback.
 Am I going on the right way of implementing this? The patch was made
 against the mercurial version at http://linuxtv.org/hg/v4l-dvb.
 
 I can see the audio packets at tm6000-video.c. Mauro said that the urb
 audio packets had just 4 bytes of relevant data, 2 for each channel,
 but the audio buffer has 128Kb and I see too few packets. Anyway, the
 tm6000_audio_isocirq function receives the size of the packet and now
 is copying everything to the buffer, I guess next step will be to find
 what is relevant in this stream and make sure I have all packets here.
 
 I haven't applied all the recent patches from Stefan yet.

I just sent a series of patches against my git (branch staging/tm6000), where
the other patches were added. I'll be merging those patches there shortly.

It basically implements most of the code to proccess alsa, and fixes some bugs.

The remaining code is just to copy the data into the alsa dma runtime buffers,
that the code already allocates.

I'll be writing the code and sending the patch soon. Yet, I suspect that there's
something still wrong, as the amount of audio data seems too less than I would
expect (at least on my tests, where those info are printed at console).

This is what I'm getting here with the Saphire WonderTV (you need to modprobe
tm6000-alsa to see the printk's, as they're implemented inside the alsa module):

[ 4476.987081] Audio (48 bytes): (0x24a4, 0x03dc), (0x472f, 0x346e), (0x5b86, 
0x5982), (0x427a, 0x4585), (0x5080, 0x4a8a), (0x4889, 0x4162), (0x4192, 
0x2448), (0x2a7b, 0x4e5e), (0x4f6b, 0x3d6a), (0x4679, 0x546f), (0x4880, 
0x4172), (0x4d83, 0x4f77), 
[ 4479.534198] Audio (8 bytes): (0x2a91, 0x2868), (0x2e88, 0x2578), 
[ 4480.908388] Audio (16 bytes): (0x5387, 0x5578), (0x5064, 0x4e8e), (0x4c61, 
0x4a91), (0x4967, 0x4897), 
[ 4482.184835] Audio (132 bytes): (0xb03e, 0x633a), (0x9238, 0x7b32), (0x882d, 
0x7734), (0x8738, 0x7836), (0x7b34, 0x8137), (0x8439, 0x7738), (0x5c37, 
0x2683), (0x8347, 0x7935), (0x6e34, 0x8235), (0x7d37, 0x7637), (0x8639, 
0x763a), (0x8238, 0x7d36), (0x8e37, 0x7e37), (0x8736, 0x8c3a), (0x7b3d, 
0x953f), (0x6a40, 0x963f), (0x5b3d, 0x8e3d), (0x6541, 0x7e42), (0x763f, 
0x793c), (0x813b, 0x7c39), (0x813a, 0x7e3b), (0x843a, 0x7d39), (0x883c, 
0x7f3e), (0x883b, 0x8139), (0x853b, 0x833b), (0x7e38, 0x843a), (0x773d, 
0x7f3b), (0x6d38, 0x7c35), (0x6f35, 0x7d35), (0x8d3a, 0x7a41), (0xa946, 
0x6f58), (0xa25a, 0x6a3f), (0x9328, 0x6d34), 
[ 4483.810896] Audio (28 bytes): (0x478a, 0x4862), (0x4889, 0x4761), (0x4385, 
0x4067), (0x3f87, 0x3e6e), (0x3d7a, 0x3f74), (0x416f, 0x4372), (0x427e, 
0x416d), 
[ 4483.813847] Audio (56 bytes): (0x4273, 0x4930), (0x5035, 0x502a), (0x5148, 
0x5250), (0x5669, 0x5e60), (0x5a74, 0x4f5f), (0x4c89, 0x4d5e), (0x4988, 
0x425e), (0x4380, 0x4468), (0x4487, 0x496b), (0x4d8f, 0x4d6b), (0x4d8b, 
0x5276), (0x5883, 0x4f79), (0x4d7f, 0x4b79), (0x4578, 0x457d), 
[ 4484.794152] Audio (8 bytes): (0x5b73, 0x5c65), (0x5487, 0x5b5f), 
[ 4488.094453] Audio (180 bytes): (0x8847, 0x2644), (0x9e56, 0x4f3f), (0x852f, 
0x554b), (0x814c, 0x6e3a), (0x7b41, 0x9b40), (0x833b, 0x9e37), (0xa135, 
0x8134), (0xa435, 0x8c34), (0x913a, 0x7a3e), (0x9f32, 0x6336), (0x8e3d, 
0x873e), (0x783e, 0x7648), (0x974b, 0x6540), (0x933f, 0x873d), (0x733c, 
0x914a), (0x6f59, 0x7249), (0x803a, 0x594c), (0x8363, 0x576a), (0x776d, 
0xb37e), (0x4c87, 0xe380), (0x5687, 0x9592), (0x8175, 0x7e5e), (0x6c5e, 
0x9366), (0x5c72, 0x8d75), (0x627d, 0x9289), (0x5b7f, 0xaa7c), (0x558d, 
0xa39b), (0x66a6, 0x9bb2), (0x6dba, 0x5cc0), (0x29b3, 0x9247), (0x72c3, 
0x7fc4), (0x76c1, 0x88bb), (0x6ab5, 0x99af), (0x6aac, 0x90a7), (0x7aa9, 
0x96a2), (0x708e, 0xdc7b), (0x527f, 0xf080), (0x7073, 0xd96a), (0xb85e, 
0x9264), (0xcb55, 0x784b), (0xb447, 0x5344), (0xb747, 0x6a40), (0x9624, 
0x9517), (0x751e, 0x6c24), (0x8c27, 0x6b2e), 

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


Re: question about v4l2_subdev

2010-06-04 Thread Andy Walls
On Tue, 2010-06-01 at 10:14 +0200, Sedji Gaouaou wrote:
 Hi,
 
 
 
  1. Something first should call v4l2_device_register() on a v4l2_device
  object.  (Typically there is only one v4l2_device object per bridge
  chip between the PCI, PCIe, or USB bus and the subdevices, even if that
  bridge chip has more than one I2C master implementation.)
 
  2. Then, for subdevices connected to the bridge chip via I2C, something
  needs to call v4l2_i2c_new_subdev() with the v4l2_device pointer as one
  of the arguments, to get back a v4l2_subdevice instance pointer.
 
  3. After that, v4l2_subdev_call() with the v4l2_subdev pointer as one of
  the arguments can be used to invoke the subdevice methods.
 
  TV Video capture drivers do this work themselves.  Drivers using a
  camera framework may have the framework doing some of the work for them.
 
 
  Regards,
  Andy
 
 
 
 
 
 Is there a sensor driver which is using this method?
 
 To write the ov2640 driver I have just copied the ov7670.c file, and I 
 didn't find the v4l2_i2c_new_subdev in it...

Subdev driver modules, like ov7670.c, don't attach themselves; the
bridge chip driver attaches an instance to an I2C bus.

Look at

drivers/media/video/cafe_ccic.c

And examine cafe_pci_probe() and the definition and use of the
sensor_call() macro.

Also note

$ grep -Ril ov7670 drivers/media/video/*

will show you in what drivers, the ov7670 might be used.


Regards,
Andy

 Regards,
 Sedji



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


dvb-usb/af9015 disconnection crashes

2010-06-04 Thread Xavier Gnata
Hi,

I get crashes when I disconnect a dvb-usb-af9015:


[54017.407738] usb 2-1.1: USB disconnect, address 9
[54018.685543] usb 2-1.5: USB disconnect, address 8
[54018.685895] af9015: bulk message failed:-22 (8/0)
[54018.685901] af9013: I2C read failed reg:d417
[54018.685907] af9015: bulk message failed:-22 (8/0)
[54018.685911] af9013: I2C read failed reg:d417
[54018.685915] af9015: bulk message failed:-22 (9/0)
[54018.685919] mt2060 I2C write failed
[54018.685923] af9015: bulk message failed:-22 (8/-30719)
[54018.685927] af9013: I2C read failed reg:d417
[54018.685931] af9015: bulk message failed:-22 (8/-30720)
[54018.685934] af9013: I2C read failed reg:d417
[54018.685940] af9015: bulk message failed:-22 (8/-1)
[54018.685944] af9013: I2C read failed reg:d730
[54024.625315] sky2 :04:00.0: eth0: Link is down
[54148.121532] INFO: task khubd:42 blocked for more than 120 seconds.
[54148.121537] echo 0  /proc/sys/kernel/hung_task_timeout_secs
disables this message.
[54148.121542] khubd D  042  2
0x
[54148.121549]  8801270fdb00 0046 dead00200200
00015740
[54148.121555]  8801270fdfd8 00015740 8801270fdfd8
8801270f5c00
[54148.121561]  00015740 00015740 8801270fdfd8
00015740
[54148.121566] Call Trace:
[54148.121578]  [8107b7f0] ? prepare_to_wait+0x60/0x90
[54148.121594]  [a123f885] dvb_unregister_frontend+0xc5/0x110
[dvb_core]
[54148.121600]  [8107b540] ? autoremove_wake_function+0x0/0x40
[54148.121607]  [8129b6c7] ? idr_remove+0x187/0x1f0
[54148.121614]  [a10be072]
dvb_usb_adapter_frontend_exit+0x22/0x40 [dvb_usb]
[54148.121620]  [a10bd4b3] dvb_usb_exit+0x53/0xd0 [dvb_usb]
[54148.121627]  [a10bd579] dvb_usb_device_exit+0x49/0x60 [dvb_usb]
[54148.121633]  [a1253051] af9015_usb_device_exit+0x41/0x60
[dvb_usb_af9015]
[54148.121643]  [813c8721] usb_unbind_interface+0x61/0x190
[54148.121651]  [8135512f] __device_release_driver+0x6f/0xe0
[54148.121656]  [8135529d] device_release_driver+0x2d/0x40
[54148.121662]  [813542ba] bus_remove_device+0x9a/0xc0
[54148.121667]  [813523c7] device_del+0x127/0x1d0
[54148.121672]  [813c4d18] usb_disable_device+0xa8/0x130
[54148.121678]  [813be893] usb_disconnect+0xd3/0x170
[54148.121683]  [813bf8ee] hub_thread+0x50e/0x1260
[54148.121689]  [8107b540] ? autoremove_wake_function+0x0/0x40
[54148.121694]  [813bf3e0] ? hub_thread+0x0/0x1260
[54148.121698]  [8107b006] kthread+0x96/0xa0
[54148.121705]  [8100ae64] kernel_thread_helper+0x4/0x10
[54148.121710]  [8107af70] ? kthread+0x0/0xa0
[54148.121714]  [8100ae60] ? kernel_thread_helper+0x0/0x10
[54267.913317] INFO: task khubd:42 blocked for more than 120 seconds.
[54267.913322] echo 0  /proc/sys/kernel/hung_task_timeout_secs
disables this message.
[54267.913327] khubd D  042  2
0x
[54267.91]  8801270fdb00 0046 dead00200200
00015740
[54267.913340]  8801270fdfd8 00015740 8801270fdfd8
8801270f5c00
[54267.913346]  00015740 00015740 8801270fdfd8
00015740
[54267.913351] Call Trace:
[54267.913363]  [8107b7f0] ? prepare_to_wait+0x60/0x90
[54267.913378]  [a123f885] dvb_unregister_frontend+0xc5/0x110
[dvb_core]
[54267.913384]  [8107b540] ? autoremove_wake_function+0x0/0x40
[54267.913392]  [8129b6c7] ? idr_remove+0x187/0x1f0
[54267.913398]  [a10be072]
dvb_usb_adapter_frontend_exit+0x22/0x40 [dvb_usb]
[54267.913405]  [a10bd4b3] dvb_usb_exit+0x53/0xd0 [dvb_usb]
[54267.913411]  [a10bd579] dvb_usb_device_exit+0x49/0x60 [dvb_usb]
[54267.913418]  [a1253051] af9015_usb_device_exit+0x41/0x60
[dvb_usb_af9015]
[54267.913427]  [813c8721] usb_unbind_interface+0x61/0x190
[54267.913435]  [8135512f] __device_release_driver+0x6f/0xe0
[54267.913441]  [8135529d] device_release_driver+0x2d/0x40
[54267.913446]  [813542ba] bus_remove_device+0x9a/0xc0
[54267.913451]  [813523c7] device_del+0x127/0x1d0
[54267.913457]  [813c4d18] usb_disable_device+0xa8/0x130
[54267.913462]  [813be893] usb_disconnect+0xd3/0x170
[54267.913467]  [813bf8ee] hub_thread+0x50e/0x1260
[54267.913473]  [8107b540] ? autoremove_wake_function+0x0/0x40
[54267.913478]  [813bf3e0] ? hub_thread+0x0/0x1260
[54267.913483]  [8107b006] kthread+0x96/0xa0
[54267.913490]  [8100ae64] kernel_thread_helper+0x4/0x10
[54267.913494]  [8107af70] ? kthread+0x0/0xa0
[54267.913499]  [8100ae60] ? kernel_thread_helper+0x0/0x10
[54387.706298] INFO: task khubd:42 blocked for more than 120 seconds.
[54387.706304] echo 0  /proc/sys/kernel/hung_task_timeout_secs
disables this message.
[54387.706308] khubd D  042

Re: [PATCH 1/3] IR: add core lirc device interface

2010-06-04 Thread Jarod Wilson
On Fri, Jun 4, 2010 at 7:16 PM, Jon Smirl jonsm...@gmail.com wrote:
 On Fri, Jun 4, 2010 at 5:17 PM, Jarod Wilson ja...@wilsonet.com wrote:
 On Fri, Jun 4, 2010 at 4:17 PM, Jarod Wilson ja...@redhat.com wrote:
 On Fri, Jun 04, 2010 at 02:57:04PM -0400, Jon Smirl wrote:
 ...
  From what I'm seeing, those are the current used ioctls:
 
  +#define LIRC_GET_FEATURES              _IOR('i', 0x, unsigned 
  long)
  +#define LIRC_GET_LENGTH                _IOR('i', 0x000f, unsigned 
  long)

 Has this been set into stone yet? if not a 64b word would be more future 
 proof.

 Nope, not set in stone at all, nothing has been merged. A patch I was
 carrying in Fedora changed all unsigned long to u64 and unsigned int to
 u32, and my current ir wip tree has all u32, but I don't see a reason why
 if we're going to make a change, it couldn't be to all u64, for as much
 future-proofing as possible.

 Hrm, struct file_operations specifies an unsigned long for the ioctl
 args, so doesn't that mean we're pretty much stuck with only 32-bit
 for the ioctls?

 I haven't written an IOCTL in a while, but how would you pass a 64b
 memory address?

Well, you wouldn't use struct file_operations' ioctl definition if you
wanted to do so on a 32-bit host. :)

Its definitely possible using a different ioctl definition (see
gdth_ioctl_free in drivers/scsi/gdth_proc.c, for example), but we're
currently bound by what's there for file_operations.

-- 
Jarod Wilson
ja...@wilsonet.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