Re: [PATCH] Re: 2.6.12: itimer_real timers don't survive execve() any more

2005-08-05 Thread Gerd Knorr
On Thu, Aug 04, 2005 at 03:02:51PM -0700, Andrew Morton wrote:
> Roland McGrath <[EMAIL PROTECTED]> wrote:
> >
> > That's wrong.  It has to be done only by the last thread in the group to go.
> > Just revert Ingo's change.
> > 
> 
> OK..
> 
> +++ 25-akpm/kernel/exit.c Thu Aug  4 15:01:06 2005
> @@ -829,8 +829,10 @@ fastcall NORET_TYPE void do_exit(long co
> - if (group_dead)
> + if (group_dead) {
> + del_timer_sync(>signal->real_timer);
>   acct_process(code);
> + }
> +++ 25-akpm/kernel/posix-timers.c Thu Aug  4 15:01:06 2005
> @@ -1166,7 +1166,6 @@ void exit_itimers(struct signal_struct *
> - del_timer_sync(>real_timer);

That one fixes it for me.

  Gerd

-- 
panic("it works"); /* avoid being flooded with debug messages */
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Re: 2.6.12: itimer_real timers don't survive execve() any more

2005-08-05 Thread Gerd Knorr
On Thu, Aug 04, 2005 at 03:02:51PM -0700, Andrew Morton wrote:
 Roland McGrath [EMAIL PROTECTED] wrote:
 
  That's wrong.  It has to be done only by the last thread in the group to go.
  Just revert Ingo's change.
  
 
 OK..
 
 +++ 25-akpm/kernel/exit.c Thu Aug  4 15:01:06 2005
 @@ -829,8 +829,10 @@ fastcall NORET_TYPE void do_exit(long co
 - if (group_dead)
 + if (group_dead) {
 + del_timer_sync(tsk-signal-real_timer);
   acct_process(code);
 + }
 +++ 25-akpm/kernel/posix-timers.c Thu Aug  4 15:01:06 2005
 @@ -1166,7 +1166,6 @@ void exit_itimers(struct signal_struct *
 - del_timer_sync(sig-real_timer);

That one fixes it for me.

  Gerd

-- 
panic(it works); /* avoid being flooded with debug messages */
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


2.6.12: itimer_real timers don't survive execve() any more

2005-08-04 Thread Gerd Knorr
  Hi,

Somewhere between 2.6.11 and 2.6.12 the regression in $subject
was added to the linux kernel.  Testcase below.

Ideas on that anyone?

  Gerd

==[ test_exec_alarm.c 
]==
#include 
#include 
#include 

int main(int argc, char ** argv)
{
struct itimerval value;
int retval;
static char hosted_executable[256];
char * hosted_executable_args[2];

/* Set the alarm timer. */
value.it_interval.tv_sec = 0;
value.it_interval.tv_usec = 0;
value.it_value.tv_sec = 200;
value.it_value.tv_usec = 0;
retval = setitimer(ITIMER_REAL, , NULL);
if (retval != 0) {
perror("setitimer()");
return 1;
}

/* Prepare the file name of the hosted executable. */
strcpy(hosted_executable, "./test_getitimer");

/* Prepare the command line arguments. */
hosted_executable_args[0] = hosted_executable;
hosted_executable_args[1] = NULL;

/* Execute the hosted executable which should inherit the timer. */
retval = execvp(hosted_executable, hosted_executable_args);

/* If we get here, the execvp() call failed. */
perror("execvp()");
return 1;
}
==[ test_getitimer.c ]==
#include 
#include 

int main(int argc, char ** argv)
{
struct itimerval value;
int retval;

retval = getitimer(ITIMER_REAL, );
if (retval != 0) {
perror("getitimer()");
return 1;
}

printf("alarm timer value: %u sec, %u msec\n", value.it_value.tv_sec, 
value.it_value.tv_usec);
return 0;
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


2.6.12: itimer_real timers don't survive execve() any more

2005-08-04 Thread Gerd Knorr
  Hi,

Somewhere between 2.6.11 and 2.6.12 the regression in $subject
was added to the linux kernel.  Testcase below.

Ideas on that anyone?

  Gerd

==[ test_exec_alarm.c 
]==
#include sys/time.h
#include unistd.h
#include string.h

int main(int argc, char ** argv)
{
struct itimerval value;
int retval;
static char hosted_executable[256];
char * hosted_executable_args[2];

/* Set the alarm timer. */
value.it_interval.tv_sec = 0;
value.it_interval.tv_usec = 0;
value.it_value.tv_sec = 200;
value.it_value.tv_usec = 0;
retval = setitimer(ITIMER_REAL, value, NULL);
if (retval != 0) {
perror(setitimer());
return 1;
}

/* Prepare the file name of the hosted executable. */
strcpy(hosted_executable, ./test_getitimer);

/* Prepare the command line arguments. */
hosted_executable_args[0] = hosted_executable;
hosted_executable_args[1] = NULL;

/* Execute the hosted executable which should inherit the timer. */
retval = execvp(hosted_executable, hosted_executable_args);

/* If we get here, the execvp() call failed. */
perror(execvp());
return 1;
}
==[ test_getitimer.c ]==
#include sys/time.h
#include stdio.h

int main(int argc, char ** argv)
{
struct itimerval value;
int retval;

retval = getitimer(ITIMER_REAL, value);
if (retval != 0) {
perror(getitimer());
return 1;
}

printf(alarm timer value: %u sec, %u msec\n, value.it_value.tv_sec, 
value.it_value.tv_usec);
return 0;
}
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] i386: Selectable Frequency of the Timer Interrupt

2005-07-15 Thread Gerd Knorr
Linus Torvalds <[EMAIL PROTECTED]> writes:

> Now, if somebody wants to make nicer helper functions so that you can say
> 
>   timeout = ms_from_now(500);

We already have something very simliar:
timeout = jiffies + msecs_to_jiffies(500);

;)

  Gerd

-- 
panic("it works"); /* avoid being flooded with debug messages */
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] i386: Selectable Frequency of the Timer Interrupt

2005-07-15 Thread Gerd Knorr
Linus Torvalds [EMAIL PROTECTED] writes:

 Now, if somebody wants to make nicer helper functions so that you can say
 
   timeout = ms_from_now(500);

We already have something very simliar:
timeout = jiffies + msecs_to_jiffies(500);

;)

  Gerd

-- 
panic(it works); /* avoid being flooded with debug messages */
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [2.6 patch] drivers/media/video/tveeprom.c: possible cleanups

2005-04-19 Thread Gerd Knorr
> - #if 0 the EXPORT_SYMBOL'ed but unused function tveeprom_dump

That's a debug helper function, please don't drop it.  #if 0 might be
ok, not sure though, the tveeprom module is also used by a out-of-kernel
driver (ivtv).  Otherwise the patch looks fine to me.

  Gerd

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [2.6 patch] drivers/media/video/tveeprom.c: possible cleanups

2005-04-19 Thread Gerd Knorr
 - #if 0 the EXPORT_SYMBOL'ed but unused function tveeprom_dump

That's a debug helper function, please don't drop it.  #if 0 might be
ok, not sure though, the tveeprom module is also used by a out-of-kernel
driver (ivtv).  Otherwise the patch looks fine to me.

  Gerd

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: IA32 (2.6.11 - 2005-03-12.16.00) - 56 New warnings

2005-03-14 Thread Gerd Knorr
> > struct dvb_pll_desc {
[ ... ]
> > struct {
[ ... ]
> > } entries[];
> > };
> > 
> >  while 2.6.11-mm3 changed it into entries[0].
> 
> The original code failed to compile with gcc-2.95.4, so I stuck the [0] in
> there, then was vaguely surprised when no warnings came out.  Seems that
> later compilers _do_ warn.
> 
> I guess we could put a 9 in there.

Yep, that should do, I think that is enougth for all existing
entries ...

  Gerd

-- 
#define printk(args...) fprintf(stderr, ## args)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: IA32 (2.6.11 - 2005-03-12.16.00) - 56 New warnings

2005-03-14 Thread Gerd Knorr
  struct dvb_pll_desc {
[ ... ]
  struct {
[ ... ]
  } entries[];
  };
  
   while 2.6.11-mm3 changed it into entries[0].
 
 The original code failed to compile with gcc-2.95.4, so I stuck the [0] in
 there, then was vaguely surprised when no warnings came out.  Seems that
 later compilers _do_ warn.
 
 I guess we could put a 9 in there.

Yep, that should do, I think that is enougth for all existing
entries ...

  Gerd

-- 
#define printk(args...) fprintf(stderr, ## args)
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[patch] v4l: MAINTAINERS file update.

2005-03-08 Thread Gerd Knorr
  Hi folks,

Goodbye, and that thanks for all the fish ;)

After several years of v4l maintainance I'm going to switch
to a new work field and will not be able to spend much time
on maintaining video4linux and the drivers, so someone else
will have to step in.

I will not suddenly disappear from earth, I will be available
for questions and patch reviews for some time, but I'll stop
doing active development and most likely will not have the
time to act as central patch relay for all video4linux stuff.

cheers,

  Gerd

Signed-off-by: Gerd Knorr <[EMAIL PROTECTED]>
---
 MAINTAINERS |5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

Index: linux-2.6.11/MAINTAINERS
===
--- linux-2.6.11.orig/MAINTAINERS   2005-03-07 10:14:21.0 +0100
+++ linux-2.6.11/MAINTAINERS2005-03-07 18:13:48.0 +0100
@@ -501,7 +501,7 @@ P:  Gerd Knorr
 M: [EMAIL PROTECTED]
 L: video4linux-list@redhat.com
 W: http://bytesex.org/bttv/
-S: Maintained
+S: Orphan
 
 BUSLOGIC SCSI DRIVER
 P: Leonard N. Zubkoff
@@ -2534,7 +2534,8 @@ S:Maintained
 VIDEO FOR LINUX
 P:     Gerd Knorr
 M: [EMAIL PROTECTED]
-S: Maintained
+L: video4linux-list@redhat.com
+S: Orphan
 
 W1 DALLAS'S 1-WIRE BUS
 P: Evgeniy Polyakov

-- 
#define printk(args...) fprintf(stderr, ## args)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[patch] dvb: add or51132 driver (atsc demodulator)

2005-03-08 Thread Gerd Knorr
  Hi,

This patch adds a new ATSC frontend driver, needed by the cx88-based
pcHDTV 3000 card.  Also includes a tiny chunk to activate the or51132
support in the cx88-dvb driver.

This patch depends on the cx88 dvb driver update.

  Gerd

Signed-off-by: Gerd Knorr <[EMAIL PROTECTED]>
---
 drivers/media/dvb/frontends/Kconfig   |4 
 drivers/media/dvb/frontends/Makefile  |2 
 drivers/media/dvb/frontends/or51132.c |  628 ++
 drivers/media/dvb/frontends/or51132.h |   48 +
 drivers/media/video/Kconfig   |1 
 drivers/media/video/cx88/cx88-dvb.c   |2 
 6 files changed, 683 insertions(+), 2 deletions(-)

Index: linux-2.6.11/drivers/media/dvb/frontends/or51132.h
===
--- /dev/null   1970-01-01 00:00:00.0 +
+++ linux-2.6.11/drivers/media/dvb/frontends/or51132.h  2005-03-07 
16:31:12.0 +0100
@@ -0,0 +1,48 @@
+/*
+ *Support for OR51132 (pcHDTV HD-3000) - VSB/QAM
+ *
+ *Copyright (C) 2005 Kirk Lapray <[EMAIL PROTECTED]>
+ *
+ *This program is free software; you can redistribute it and/or modify
+ *it under the terms of the GNU General Public License as published by
+ *the Free Software Foundation; either version 2 of the License, or
+ *(at your option) any later version.
+ *
+ *This program is distributed in the hope that it will be useful,
+ *but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *GNU General Public License for more details.
+ *
+ *You should have received a copy of the GNU General Public License
+ *along with this program; if not, write to the Free Software
+ *Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+*/
+
+#ifndef OR51132_H
+#define OR51132_H
+
+#include 
+#include 
+
+struct or51132_config
+{
+   /* The demodulator's i2c address */
+   u8 demod_address;
+   u8 pll_address;
+   struct dvb_pll_desc *pll_desc;
+
+   /* Need to set device param for start_dma */
+   int (*set_ts_params)(struct dvb_frontend* fe, int is_punctured);
+};
+
+extern struct dvb_frontend* or51132_attach(const struct or51132_config* config,
+  struct i2c_adapter* i2c);
+
+#endif // OR51132_H
+
+/*
+ * Local variables:
+ * c-basic-offset: 8
+ * End:
+ */
Index: linux-2.6.11/drivers/media/dvb/frontends/or51132.c
===
--- /dev/null   1970-01-01 00:00:00.0 +
+++ linux-2.6.11/drivers/media/dvb/frontends/or51132.c  2005-03-07 
16:31:12.0 +0100
@@ -0,0 +1,628 @@
+/*
+ *Support for OR51132 (pcHDTV HD-3000) - VSB/QAM
+ *
+ *Copyright (C) 2005 Kirk Lapray <[EMAIL PROTECTED]>
+ *
+ *Based on code from Jack Kelliher ([EMAIL PROTECTED])
+ *   Copyright (C) 2002 & pcHDTV, inc.
+ *
+ *This program is free software; you can redistribute it and/or modify
+ *it under the terms of the GNU General Public License as published by
+ *the Free Software Foundation; either version 2 of the License, or
+ *(at your option) any later version.
+ *
+ *This program is distributed in the hope that it will be useful,
+ *but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *GNU General Public License for more details.
+ *
+ *You should have received a copy of the GNU General Public License
+ *along with this program; if not, write to the Free Software
+ *Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+*/
+
+/*
+ * This driver needs two external firmware files. Please copy
+ * "dvb-fe-or51132-vsb.fw" and "dvb-fe-or51132-qam.fw" to
+ * /usr/lib/hotplug/firmware/ or /lib/firmware/
+ * (depending on configuration of firmware hotplug).
+ */
+#define OR51132_VSB_FIRMWARE "dvb-fe-or51132-vsb.fw"
+#define OR51132_QAM_FIRMWARE "dvb-fe-or51132-qam.fw"
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "dvb_frontend.h"
+#include "dvb-pll.h"
+#include "or51132.h"
+
+static int debug;
+#define dprintk(args...) \
+   do { \
+   if (debug) printk(KERN_DEBUG "or51132: " args); \
+   } while (0)
+
+
+struct or51132_state
+{
+   struct i2c_adapter* i2c;
+   struct dvb_frontend_ops ops;
+
+   /* Configuration settings */
+   const struct or51132_config* config;
+
+   struct dvb_frontend frontend;
+   
+   /* Demodulator private data */
+   fe_modulation_t current_modulation;
+
+   /* Tuner private data */
+   u32 current_frequency;
+};
+
+static int i2c_writebytes (struct or51132_state* state, u8 reg, u8 *buf, int 
len)
+{
+   int err;
+   struct i2c_msg msg;
+   msg.addr  = reg;
+   msg.fla

[patch] v4l2 api: mpeg encoder support

2005-03-08 Thread Gerd Knorr
Add a ioctl to set mpeg hardware encoder parameters.

Signed-off-by: Gerd Knorr <[EMAIL PROTECTED]>
---
 include/linux/videodev2.h |  136 ++
 1 files changed, 82 insertions(+), 54 deletions(-)

Index: linux-2.6.11-rc4/include/linux/videodev2.h
===
--- linux-2.6.11-rc4.orig/include/linux/videodev2.h 2005-02-14 
15:24:05.0 +0100
+++ linux-2.6.11-rc4/include/linux/videodev2.h  2005-02-15 12:37:28.0 
+0100
@@ -268,64 +268,92 @@ struct v4l2_timecode
 /* The above is based on SMPTE timecodes */
 
 
+#if 1
 /*
- * C O M P R E S S I O N   P A R A M E T E R S
+ * M P E G   C O M P R E S S I O N   P A R A M E T E R S
+ *
+ *  ### WARNING: this is still work-in-progress right now, most likely
+ *  ###  there will be some incompatible changes.
+ *
  */
-#if 0
-/* ### generic compression settings don't work, there is too much
- * ### codec-specific stuff.  Maybe reuse that for MPEG codec settings
- * ### later ... */
-struct v4l2_compression
-{
-   __u32   quality;
-   __u32   keyframerate;
-   __u32   pframerate;
-   __u32   reserved[5];
 
-/*  what we'll need for MPEG, extracted from some postings on
-the v4l list (Gert Vervoort, PlasmaJohn).
 
-system stream:
-  - type: elementary stream(ES), packatised elementary stream(s) (PES)
-program stream(PS), transport stream(TS)
-  - system bitrate
-  - PS packet size (DVD: 2048 bytes, VCD: 2324 bytes)
-  - TS video PID
-  - TS audio PID
-  - TS PCR PID
-  - TS system information tables (PAT, PMT, CAT, NIT and SIT)
-  - (MPEG-1 systems stream vs. MPEG-2 program stream (TS not supported
-by MPEG-1 systems)
+enum v4l2_bitrate_mode {
+   V4L2_BITRATE_NONE = 0,  /* not specified */
+   V4L2_BITRATE_CBR,   /* constant bitrate */
+   V4L2_BITRATE_VBR,   /* variable bitrate */
+};
+struct v4l2_bitrate {
+   /* rates are specified in kbit/sec */
+   enum v4l2_bitrate_mode  mode;
+   __u32   min;
+   __u32   target;  /* use this one for CBR */
+   __u32   max;
+};
 
-audio:
-  - type: MPEG (+Layer I,II,III), AC-3, LPCM
-  - bitrate
-  - sampling frequency (DVD: 48 Khz, VCD: 44.1 KHz, 32 kHz)
-  - Trick Modes? (ff, rew)
-  - Copyright
-  - Inverse Telecine
+enum v4l2_mpeg_streamtype {
+   V4L2_MPEG_SS_1, /* MPEG-1 system stream */
+   V4L2_MPEG_PS_2, /* MPEG-2 program stream */
+   V4L2_MPEG_TS_2, /* MPEG-2 transport stream */
+   V4L2_MPEG_PS_DVD,   /* MPEG-2 program stream with DVD header fixups 
*/
+};
+enum v4l2_mpeg_audiotype {
+   V4L2_MPEG_AU_2_I,   /* MPEG-2 layer 1 */
+   V4L2_MPEG_AU_2_II,  /* MPEG-2 layer 2 */
+   V4L2_MPEG_AU_2_III, /* MPEG-2 layer 3 */
+   V4L2_MPEG_AC3,  /* AC3 */
+   V4L2_MPEG_LPCM, /* LPCM */
+};
+enum v4l2_mpeg_videotype {
+   V4L2_MPEG_VI_1, /* MPEG-1 */
+   V4L2_MPEG_VI_2, /* MPEG-2 */
+};
+enum v4l2_mpeg_aspectratio {
+   V4L2_MPEG_ASPECT_SQUARE = 1,   /* square pixel */
+   V4L2_MPEG_ASPECT_4_3= 2,   /*  4 : 3   */
+   V4L2_MPEG_ASPECT_16_9   = 3,   /* 16 : 9   */
+   V4L2_MPEG_ASPECT_1_221  = 4,   /*  1 : 2,21*/
+};
 
-video:
-  - picturesize (SIF, 1/2 D1, 2/3 D1, D1) and PAL/NTSC norm can be set
-through excisting V4L2 controls
-  - noise reduction, parameters encoder specific?
-  - MPEG video version: MPEG-1, MPEG-2
-  - GOP (Group Of Pictures) definition:
-- N: number of frames per GOP
-- M: distance between reference (I,P) frames
-- open/closed GOP
-  - quantiser matrix: inter Q matrix (64 bytes) and intra Q matrix (64 bytes)
-  - quantiser scale: linear or logarithmic
-  - scanning: alternate or zigzag
-  - bitrate mode: CBR (constant bitrate) or VBR (variable bitrate).
-  - target video bitrate for CBR
-  - target video bitrate for VBR
-  - maximum video bitrate for VBR - min. quantiser value for VBR
-  - max. quantiser value for VBR
-  - adaptive quantisation value
-  - return the number of bytes per GOP or bitrate for bitrate monitoring
+struct v4l2_mpeg_compression {
+   /* general */
+   enum v4l2_mpeg_streamtype   st_type;
+   struct v4l2_bitrate st_bitrate;
 
-*/
+   /* transport streams */
+   __u16   ts_pid_pmt;
+   __u16   ts_pid_audio;
+   __u16   ts_pid_video;
+   __u16   ts_pid_pcr;
+
+   /* program stream */
+   __u16   ps_size;
+   __u16   reserved_1;/* align */
+
+   /* audio */
+   enum v4l2_mpeg_audiotypeau_type;
+   struct v4l2_bitrate au_bitrate;
+   __u32   au_sample_rate;
+   __u8au_pesid;
+ 

[patch] dvb: mt352 frontend driver update

2005-03-08 Thread Gerd Knorr
  Hi,

This patch updates the mt352 driver to make it work with the Pinnacle
300i card.  Some values are calculated at runtime now instead of having
hard-coded defaults because the defaults don't fit for the Pinnacle, and
some more small tweaks + fixes.

This was also discussed + accepted on the dvb list, going to submit
directly because the saa7134 driver update depends on this.

  Gerd

Signed-off-by: Gerd Knorr <[EMAIL PROTECTED]>
---
 drivers/media/dvb/frontends/mt352.c |  197 ++--
 drivers/media/dvb/frontends/mt352.h |   15 +-
 2 files changed, 144 insertions(+), 68 deletions(-)

Index: linux-2.6.11-rc3/drivers/media/dvb/frontends/mt352.h
===
--- linux-2.6.11-rc3.orig/drivers/media/dvb/frontends/mt352.h   2005-02-04 
11:26:50.0 +0100
+++ linux-2.6.11-rc3/drivers/media/dvb/frontends/mt352.h2005-02-04 
12:48:31.924889857 +0100
@@ -40,6 +40,13 @@ struct mt352_config
/* the demodulator's i2c address */
u8 demod_address;
 
+   /* frequencies in kHz */
+   int adc_clock;  // default: 20480
+   int if2;// default: 36166
+
+   /* set if no pll is connected to the secondary i2c bus */
+   int no_tuner;
+
/* Initialise the demodulator and PLL. Cannot be NULL */
int (*demod_init)(struct dvb_frontend* fe);
 
@@ -54,6 +61,12 @@ extern struct dvb_frontend* mt352_attach
 struct i2c_adapter* i2c);
 
 extern int mt352_write(struct dvb_frontend* fe, u8* ibuf, int ilen);
-extern u8 mt352_read(struct dvb_frontend *fe, u8 reg);
+extern int mt352_read(struct dvb_frontend *fe, u8 reg);
 
 #endif // MT352_H
+
+/*
+ * Local variables:
+ * c-basic-offset: 8
+ * End:
+ */
Index: linux-2.6.11-rc3/drivers/media/dvb/frontends/mt352.c
===
--- linux-2.6.11-rc3.orig/drivers/media/dvb/frontends/mt352.c   2005-02-04 
11:23:23.0 +0100
+++ linux-2.6.11-rc3/drivers/media/dvb/frontends/mt352.c2005-02-04 
12:49:21.800514554 +0100
@@ -41,13 +41,12 @@
 #include "mt352.h"
 
 struct mt352_state {
-
struct i2c_adapter* i2c;
-
struct dvb_frontend_ops ops;
 
/* configuration settings */
const struct mt352_config* config;
+   int s0,s1,s3;
 
struct dvb_frontend frontend;
 };
@@ -66,23 +65,23 @@ static int mt352_single_write(struct dvb
   .buf = buf, .len = 2 };
int err = i2c_transfer(state->i2c, , 1);
if (err != 1) {
-   dprintk("mt352_write() to reg %x failed (err = %d)!\n", reg, 
err);
+   printk("mt352_write() to reg %x failed (err = %d)!\n", reg, 
err);
return err;
-}
-   return 0; 
+   }
+   return 0;
 }
 
 int mt352_write(struct dvb_frontend* fe, u8* ibuf, int ilen)
 {
int err,i;
for (i=0; i < ilen-1; i++)
-   if ((err = mt352_single_write(fe,ibuf[0]+i,ibuf[i+1]))) 
+   if ((err = mt352_single_write(fe,ibuf[0]+i,ibuf[i+1])))
return err;
 
return 0;
 }
 
-static u8 mt352_read_register(struct mt352_state* state, u8 reg)
+static int mt352_read_register(struct mt352_state* state, u8 reg)
 {
int ret;
u8 b0 [] = { reg };
@@ -96,41 +95,87 @@ static u8 mt352_read_register(struct mt3
 
ret = i2c_transfer(state->i2c, msg, 2);
 
-   if (ret != 2)
-   dprintk("%s: readreg error (ret == %i)\n", __FUNCTION__, ret);
+   if (ret != 2) {
+   printk("%s: readreg error (reg=%d, ret==%i)\n",
+  __FUNCTION__, reg, ret);
+   return ret;
+   }
 
return b1[0];
 }
 
-u8 mt352_read(struct dvb_frontend *fe, u8 reg)
+int mt352_read(struct dvb_frontend *fe, u8 reg)
 {
return mt352_read_register(fe->demodulator_priv,reg);
 }
 
-
-
-
-
-
-
-
 static int mt352_sleep(struct dvb_frontend* fe)
 {
static u8 mt352_softdown[] = { CLOCK_CTL, 0x20, 0x08 };
 
mt352_write(fe, mt352_softdown, sizeof(mt352_softdown));
-
return 0;
 }
 
+static void mt352_calc_nominal_rate(struct mt352_state* state,
+   enum fe_bandwidth bandwidth,
+   unsigned char *buf)
+{
+   u32 adc_clock = 20480; /* 20.340 MHz */
+   u32 bw,value;
+
+   switch (bandwidth) {
+   case BANDWIDTH_6_MHZ:
+   bw = 6;
+   break;
+   case BANDWIDTH_7_MHZ:
+   bw = 7;
+   break;
+   case BANDWIDTH_8_MHZ:
+   default:
+   bw = 8;
+   break;
+   }
+   if (state->config->adc_clock)
+   adc_clock = state->config->adc_clock;
+
+   value = 64 * bw * (1<<16) / (7 * 8);
+   value = value * 1000 / adc_clock;
+   dprintk("%s: bw %d, 

[patch] dvb: add pll lib

2005-03-08 Thread Gerd Knorr
  Hi,

This adds some helper code to handle tuning for dvb cards,
with a struct describing the pll and a function calculating
the command sequence needed to program it.

This one was discussed + accepted on the linuxtv list and
also is in the linuxtv cvs.  As the the cx88 driver update
I want finally get out of the door depends on this one I'll
go submit it myself instead of waiting for the dvb guys doing
it.

  Gerd

Signed-off-by: Gerd Knorr <[EMAIL PROTECTED]>
---
 drivers/media/dvb/frontends/Makefile  |1 
 drivers/media/dvb/frontends/dvb-pll.c |  168 ++
 drivers/media/dvb/frontends/dvb-pll.h |   34 +
 3 files changed, 203 insertions(+)

Index: linux-2.6.11-rc4/drivers/media/dvb/frontends/Makefile
===
--- linux-2.6.11-rc4.orig/drivers/media/dvb/frontends/Makefile  2005-02-14 
15:21:59.0 +0100
+++ linux-2.6.11-rc4/drivers/media/dvb/frontends/Makefile   2005-02-15 
12:31:40.0 +0100
@@ -4,6 +4,7 @@
 
 EXTRA_CFLAGS = -Idrivers/media/dvb/dvb-core/
 
+obj-$(CONFIG_DVB_CORE) += dvb-pll.o
 obj-$(CONFIG_DVB_STV0299) += stv0299.o
 obj-$(CONFIG_DVB_SP8870) += sp8870.o
 obj-$(CONFIG_DVB_CX22700) += cx22700.o
Index: linux-2.6.11-rc4/drivers/media/dvb/frontends/dvb-pll.c
===
--- /dev/null   1970-01-01 00:00:00.0 +
+++ linux-2.6.11-rc4/drivers/media/dvb/frontends/dvb-pll.c  2005-02-15 
12:31:51.0 +0100
@@ -0,0 +1,168 @@
+/*
+ * $Id: dvb-pll.c,v 1.7 2005/02/10 11:52:02 kraxel Exp $
+ *
+ * descriptions + helper functions for simple dvb plls.
+ *
+ * (c) 2004 Gerd Knorr <[EMAIL PROTECTED]> [SuSE Labs]
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include 
+#include 
+#include 
+
+#include "dvb-pll.h"
+
+/* --- */
+/* descriptions*/
+
+struct dvb_pll_desc dvb_pll_thomson_dtt7579 = {
+   .name  = "Thomson dtt7579",
+   .min   = 17700,
+   .max   = 85800,
+   .count = 5,
+   .entries = {
+   {  0, 3617, 16, 0xb4, 0x03 }, /* go sleep */
+   {  44325, 3617, 16, 0xb4, 0x02 },
+   {  54200, 3617, 16, 0xb4, 0x08 },
+   {  77100, 3617, 16, 0xbc, 0x08 },
+   {  9, 3617, 16, 0xf4, 0x08 },
+   },
+};
+EXPORT_SYMBOL(dvb_pll_thomson_dtt7579);
+
+struct dvb_pll_desc dvb_pll_thomson_dtt7610 = {
+   .name  = "Thomson dtt7610",
+   .min   =  4400,
+   .max   = 95800,
+   .count = 3,
+   .entries = {
+   { 15725, 4400, 62500, 0x8e, 0x39 },
+   { 45400, 4400, 62500, 0x8e, 0x3a },
+   { 9, 4400, 62500, 0x8e, 0x3c },
+   },
+};
+EXPORT_SYMBOL(dvb_pll_thomson_dtt7610);
+
+static void thomson_dtt759x_bw(u8 *buf, int bandwidth)
+{
+   if (BANDWIDTH_7_MHZ == bandwidth)
+   buf[3] |= 0x10;
+}
+
+struct dvb_pll_desc dvb_pll_thomson_dtt759x = {
+   .name  = "Thomson dtt759x",
+   .min   = 17700,
+   .max   = 89600,
+   .setbw = thomson_dtt759x_bw,
+   .count = 6,
+   .entries = {
+   {  0, 3617, 16, 0x84, 0x03 },
+   {  26400, 3617, 16, 0xb4, 0x02 },
+   {  47000, 3617, 16, 0xbc, 0x02 },
+   {  73500, 3617, 16, 0xbc, 0x08 },
+   {  83500, 3617, 16, 0xf4, 0x08 },
+   {  9, 3617, 16, 0xfc, 0x08 },
+   },
+};
+EXPORT_SYMBOL(dvb_pll_thomson_dtt759x);
+
+struct dvb_pll_desc dvb_pll_lg_z201 = {
+   .name  = "LG z201",
+   .min   = 17400,
+   .max   = 86200,
+   .count = 5,
+   .entries = {
+   {  0, 3617, 16, 0xbc, 0x03 },
+   {  44325, 3617, 16, 0xbc, 0x01 },
+   {  54200, 3617, 16, 0xbc, 0x02 },
+   {  83000, 3617, 16, 0xf4, 0x02 },
+   {  9, 3617, 16, 0xfc, 0x02 },
+   },
+};
+EXPORT_SYMBOL(dvb_pll_lg_z20

[patch] v4l: documentation update.

2005-03-08 Thread Gerd Knorr
$subject says all ;)

Signed-off-by: Gerd Knorr <[EMAIL PROTECTED]>
---
 Documentation/video4linux/CARDLIST.saa7134 |   41 ++---
 Documentation/video4linux/README.cx88  |3 -
 Documentation/video4linux/bttv/Cards   |7 ++-
 Documentation/video4linux/bttv/README  |2 -
 4 files changed, 27 insertions(+), 26 deletions(-)

Index: linux-2.6.11/Documentation/video4linux/CARDLIST.saa7134
===
--- linux-2.6.11.orig/Documentation/video4linux/CARDLIST.saa7134
2005-03-07 10:12:23.0 +0100
+++ linux-2.6.11/Documentation/video4linux/CARDLIST.saa7134 2005-03-07 
16:36:47.0 +0100
@@ -6,29 +6,30 @@
   5 -> SKNet Monster TV [1131:4e85]
   6 -> Tevion MD 9717  
   7 -> KNC One TV-Station RDS / Typhoon TV Tuner RDS [1131:fe01,1894:fe01]
-  8 -> KNC One TV-Station DVR   [1894:a006]
-  9 -> Terratec Cinergy 400 TV  [153B:1142]
- 10 -> Medion 5044
- 11 -> Kworld/KuroutoShikou SAA7130-TVPCI
- 12 -> Terratec Cinergy 600 TV  [153B:1143]
- 13 -> Medion 7134  [16be:0003]
- 14 -> Typhoon TV+Radio 90031
- 15 -> ELSA EX-VISION 300TV [1048:226b]
- 16 -> ELSA EX-VISION 500TV [1048:226b]
- 17 -> ASUS TV-FM 7134  [1043:4842,1043:4830,1043:4840]
- 18 -> AOPEN VA1000 POWER   [1131:7133]
- 19 -> 10MOONS PCI TV CAPTURE CARD  [1131:2001]
- 20 -> BMK MPEX No Tuner
- 21 -> Compro VideoMate TV  [185b:c100]
- 22 -> Matrox CronosPlus[102B:48d0]
- 23 -> Medion 2819/ AverMedia M156  [1461:a70b,1461:2115]
- 24 -> BMK MPEX Tuner
+  8 -> Terratec Cinergy 400 TV  [153B:1142]
+  9 -> Medion 5044 
+ 10 -> Kworld/KuroutoShikou SAA7130-TVPCI  
+ 11 -> Terratec Cinergy 600 TV  [153B:1143]
+ 12 -> Medion 7134  [16be:0003]
+ 13 -> Typhoon TV+Radio 90031  
+ 14 -> ELSA EX-VISION 300TV [1048:226b]
+ 15 -> ELSA EX-VISION 500TV [1048:226b]
+ 16 -> ASUS TV-FM 7134  [1043:4842,1043:4830,1043:4840]
+ 17 -> AOPEN VA1000 POWER   [1131:7133]
+ 18 -> BMK MPEX No Tuner   
+ 19 -> Compro VideoMate TV  [185b:c100]
+ 20 -> Matrox CronosPlus[102B:48d0]
+ 21 -> 10MOONS PCI TV CAPTURE CARD  [1131:2001]
+ 22 -> Medion 2819/ AverMedia M156  [1461:a70b,1461:2115]
+ 23 -> BMK MPEX Tuner  
+ 24 -> KNC One TV-Station DVR   [1894:a006]
  25 -> ASUS TV-FM 7133  [1043:4843]
  26 -> Pinnacle PCTV Stereo (saa7134)   [11bd:002b]
- 27 -> Manli MuchTV M-TV002
- 28 -> Manli MuchTV M-TV001
+ 27 -> Manli MuchTV M-TV002
+ 28 -> Manli MuchTV M-TV001
  29 -> Nagase Sangyo TransGear 3000TV   [1461:050c]
  30 -> Elitegroup ECS TVP3XP FM1216 Tuner Card(PAL-BG,FM)  [1019:4cb4]
  31 -> Elitegroup ECS TVP3XP FM1236 Tuner Card (NTSC,FM) [1019:4cb5]
- 32 -> AVACS SmartTV
+ 32 -> AVACS SmartTV   
  33 -> AVerMedia DVD EZMaker[1461:10ff]
+ 34 -> LifeView FlyTV Platinum33 mini   [5168:0212]
Index: linux-2.6.11/Documentation/video4linux/bttv/README
===
--- linux-2.6.11.orig/Documentation/video4linux/bttv/README 2005-03-07 
10:12:37.0 +0100
+++ linux-2.6.11/Documentation/video4linux/bttv/README  2005-03-07 
16:36:47.0 +0100
@@ -22,7 +22,7 @@ very likely specified the wrong (or no) 
 cards is in CARDLIST.bttv
 
 If bttv takes very long to load (happens sometimes with the cheap
-cards which have no tuner), try adding this to your modprobe.conf:
+cards which have no tuner), try adding this to your modules.conf:
options i2c-algo-bit bit_test=1
 
 For the WinTV/PVR you need one firmware file from the driver CD:
Index: linux-2.6.11/Documentation/video4linux/README.cx88
===
--- linux-2.6.11.orig/Documentation/video4linux/README.cx88 2005-03-07 
10:13:25.0 +0100
+++ linux-2.6.11/Documentation/video4linux/README.cx88  2005-03-07 
16:36:47.0 +0100
@@ -11,9 +11,6 @@ current status
 video
- Basically works.
- Some minor image quality glitches.
-   - Red and blue are swapped sometimes for not-yet known
- reasons (seems to depend on the image size, try to resize
- your tv app windo

[patch] Videotext: use I2C_CLIENT_INSMOD macro

2005-03-08 Thread Gerd Knorr
Hi,

the patch below simplifies the videotext drivers saa5246a and saa5249 by
using the I2C_CLIENT_INSMOD macro.

Thanks to Kai Volkmar.

Michael

Signed-off-by: Michael Geng <[EMAIL PROTECTED]>
Signed-off-by: Gerd Knorr <[EMAIL PROTECTED]>
---
 drivers/media/video/saa5246a.c |   13 +
 drivers/media/video/saa5249.c  |   13 +
 2 files changed, 2 insertions(+), 24 deletions(-)

diff -u linux-2.6.11/drivers/media/video/saa5246a.c 
linux/drivers/media/video/saa5246a.c
--- linux-2.6.11/drivers/media/video/saa5246a.c Wed Mar  2 08:38:08 2005
+++ linux/drivers/media/video/saa5246a.cSun Mar  6 17:00:35 2005
@@ -65,18 +65,7 @@
 /* Addresses to scan */
 static unsigned short normal_i2c[]  = { I2C_ADDRESS, I2C_CLIENT_END };
 static unsigned short normal_i2c_range[] = { I2C_CLIENT_END };
-static unsigned short probe[2]  = { I2C_CLIENT_END, I2C_CLIENT_END };
-static unsigned short probe_range[2]= { I2C_CLIENT_END, I2C_CLIENT_END };
-static unsigned short ignore[2] = { I2C_CLIENT_END, 
I2C_CLIENT_END };
-static unsigned short ignore_range[2]   = { I2C_CLIENT_END, I2C_CLIENT_END };
-static unsigned short force[2]  = { I2C_CLIENT_END, I2C_CLIENT_END };
-
-static struct i2c_client_address_data addr_data = {
-   normal_i2c, normal_i2c_range,
-   probe, probe_range,
-   ignore, ignore_range,
-   force
-};
+I2C_CLIENT_INSMOD;
 
 static struct i2c_client client_template;
 
diff -u linux-2.6.11/drivers/media/video/saa5249.c 
linux/drivers/media/video/saa5249.c
--- linux-2.6.11/drivers/media/video/saa5249.c  Wed Mar  2 08:38:17 2005
+++ linux/drivers/media/video/saa5249.c Sun Mar  6 17:01:35 2005
@@ -133,18 +133,7 @@
 /* Addresses to scan */
 static unsigned short normal_i2c[] = {34>>1,I2C_CLIENT_END};
 static unsigned short normal_i2c_range[] = {I2C_CLIENT_END};
-static unsigned short probe[2]= { I2C_CLIENT_END, I2C_CLIENT_END };
-static unsigned short probe_range[2]  = { I2C_CLIENT_END, I2C_CLIENT_END };
-static unsigned short ignore[2]   = { I2C_CLIENT_END, I2C_CLIENT_END };
-static unsigned short ignore_range[2] = { I2C_CLIENT_END, I2C_CLIENT_END };
-static unsigned short force[2]= { I2C_CLIENT_END, I2C_CLIENT_END };
-
-static struct i2c_client_address_data addr_data = {
-   normal_i2c, normal_i2c_range, 
-   probe, probe_range, 
-   ignore, ignore_range, 
-   force
-};
+I2C_CLIENT_INSMOD;
 
 static struct i2c_client client_template;
 
Common subdirectories: linux-2.6.11/drivers/media/video/saa7134 and 
linux/drivers/media/video/saa7134

-- 
#define printk(args...) fprintf(stderr, ## args)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[patch] v4l: tveeprom update

2005-03-08 Thread Gerd Knorr
Add some new tuners to the list.

Signed-off-by: Gerd Knorr <[EMAIL PROTECTED]>
---
 drivers/media/video/tveeprom.c |   27 ++-
 1 files changed, 18 insertions(+), 9 deletions(-)

Index: linux-2.6.11/drivers/media/video/tveeprom.c
===
--- linux-2.6.11.orig/drivers/media/video/tveeprom.c2005-03-07 
18:13:01.0 +0100
+++ linux-2.6.11/drivers/media/video/tveeprom.c 2005-03-08 10:33:08.0 
+0100
@@ -30,6 +30,7 @@
 
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -191,11 +192,13 @@ hauppauge_tuner[] =
{ TUNER_ABSENT,"TCL MFPE05 2"},
/* 90-99 */
{ TUNER_ABSENT,"LG TALN H202T"},
-   { TUNER_ABSENT,"Philips FQ1216AME MK4"},
-   { TUNER_ABSENT,"Philips FQ1236A MK4"},
+   { TUNER_PHILIPS_FQ1216AME_MK4, "Philips FQ1216AME MK4"},
+   { TUNER_PHILIPS_FQ1236A_MK4, "Philips FQ1236A MK4"},
{ TUNER_ABSENT,"Philips FQ1286A MK4"},
{ TUNER_ABSENT,"Philips FQ1216ME MK5"},
{ TUNER_ABSENT,"Philips FQ1236 MK5"},
+   { TUNER_ABSENT,"Unspecified"},
+   { TUNER_LG_PAL_TAPE,   "LG PAL (TAPE Series)"},
 };
 
 static char *sndtype[] = {
@@ -241,6 +244,7 @@ static int hasRadioTuner(int tunerType)
 case 61: //PNPEnv_TUNER_TAPE_M001D_MK3:
 case 78: //PNPEnv_TUNER_TDA8275C1_8290_FM:
 case 89: //PNPEnv_TUNER_TCL_MFPE05_2:
+case 92: //PNPEnv_TUNER_PHILIPS_FQ1236A_MK4:
 return 1;
 }
 return 0;
@@ -256,8 +260,8 @@ void tveeprom_hauppauge_analog(struct tv
** if packet[0] & f8 == f8, then EOD and packet[1] == checksum
**
** In our (ivtv) case we're interested in the following:
-   ** tuner type: tag [00].05 or [0a].01 (index into hauppauge_tuners)
-   ** tuner fmts: tag [00].04 or [0a].00 (bitmask index into 
hauppauge_fmts)
+   ** tuner type: tag [00].05 or [0a].01 (index into hauppauge_tuner)
+   ** tuner fmts: tag [00].04 or [0a].00 (bitmask index into 
hauppauge_tuner_fmt)
** radio:  tag [00].{last} or [0e].00  (bitmask.  bit2=FM)
** audio proc: tag [02].01 or [05].00 (lower nibble indexes lut?)
 
@@ -269,11 +273,11 @@ void tveeprom_hauppauge_analog(struct tv
** # of inputs/outputs ???
*/
 
-   int i, j, len, done, tag, tuner = 0, t_format = 0;
+   int i, j, len, done, beenhere, tag, tuner = 0, t_format = 0;
char *t_name = NULL, *t_fmt_name = NULL;
 
dprintk(1, "%s\n",__FUNCTION__);
-   tvee->revision = done = len = 0;
+   tvee->revision = done = len = beenhere = 0;
for (i = 0; !done && i < 256; i += len) {
dprintk(2, "processing pos = %02x (%02x, %02x)\n",
i, eeprom_data[i], eeprom_data[i + 1]);
@@ -342,9 +346,14 @@ void tveeprom_hauppauge_analog(struct tv
(eeprom_data[i+7] << 16);
break;
case 0x0a:
-   tuner = eeprom_data[i+2];
-   t_format = eeprom_data[i+1];
-   break;
+   if(beenhere == 0) {
+   tuner = eeprom_data[i+2];
+   t_format = eeprom_data[i+1];
+   beenhere = 1;
+   break;
+   } else {
+   break;
+   }
case 0x0e:
tvee->has_radio = eeprom_data[i+1];
break;

-- 
#define printk(args...) fprintf(stderr, ## args)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[patch] v4l: tuner update

2005-03-08 Thread Gerd Knorr
Minor update for the tuner module:  Add some new entries,
fix a bug in the tda8290 driver.

Signed-off-by: Gerd Knorr <[EMAIL PROTECTED]>
---
 drivers/media/video/mt20xx.c   |3 ++-
 drivers/media/video/tda8290.c  |4 ++--
 drivers/media/video/tuner-simple.c |9 -
 include/media/tuner.h  |4 
 4 files changed, 16 insertions(+), 4 deletions(-)

Index: linux-2.6.11/include/media/tuner.h
===
--- linux-2.6.11.orig/include/media/tuner.h 2005-03-07 18:13:01.0 
+0100
+++ linux-2.6.11/include/media/tuner.h  2005-03-08 10:32:50.0 +0100
@@ -93,6 +93,10 @@
 #define TUNER_THOMSON_DTT761052
 #define TUNER_PHILIPS_FQ1286 53
 #define TUNER_PHILIPS_TDA829054
+#define TUNER_LG_PAL_TAPE55/* Hauppauge PVR-150 PAL */
+
+#define TUNER_PHILIPS_FQ1216AME_MK4 56 /* Hauppauge PVR-150 PAL */
+#define TUNER_PHILIPS_FQ1236A_MK4 57   /* Hauppauge PVR-500MCE NTSC */
 
 #define NOTUNER 0
 #define PAL 1  /* PAL_BG */
Index: linux-2.6.11/drivers/media/video/tuner-simple.c
===
--- linux-2.6.11.orig/drivers/media/video/tuner-simple.c2005-03-07 
18:13:01.0 +0100
+++ linux-2.6.11/drivers/media/video/tuner-simple.c 2005-03-08 
10:32:50.0 +0100
@@ -1,5 +1,5 @@
 /*
- * $Id: tuner-simple.c,v 1.4 2005/02/15 15:59:35 kraxel Exp $
+ * $Id: tuner-simple.c,v 1.10 2005/03/08 08:38:00 kraxel Exp $
  *
  * i2c tv tuner chip device driver
  * controls all those simple 4-control-bytes style tuners.
@@ -204,6 +204,13 @@ static struct tunertype tuners[] = {
  16*160.00,16*454.00,0x41,0x42,0x04,0x8e,940}, // UHF band untested
{ "tda8290+75", Philips,PAL|NTSC,
  /* see tda8290.c for details */ },
+   { "LG PAL (TAPE series)", LGINNOTEK, PAL,
+  16*170.00, 16*450.00, 0x01,0x02,0x08,0xce,623},
+
+{ "Philips PAL/SECAM multi (FQ1216AME MK4)", Philips, PAL,
+  16*160.00,16*442.00,0x01,0x02,0x04,0xce,623 },
+{ "Philips FQ1236A MK4", Philips, NTSC,
+  16*160.00,16*442.00,0x01,0x02,0x04,0x8e,732 },
 
 };
 unsigned const int tuner_count = ARRAY_SIZE(tuners);
Index: linux-2.6.11/drivers/media/video/mt20xx.c
===
--- linux-2.6.11.orig/drivers/media/video/mt20xx.c  2005-03-07 
18:13:01.0 +0100
+++ linux-2.6.11/drivers/media/video/mt20xx.c   2005-03-07 18:13:02.0 
+0100
@@ -1,5 +1,5 @@
 /*
- * $Id: mt20xx.c,v 1.3 2005/02/15 15:59:35 kraxel Exp $
+ * $Id: mt20xx.c,v 1.4 2005/03/04 09:24:56 kraxel Exp $
  *
  * i2c tv tuner chip device driver
  * controls microtune tuners, mt2032 + mt2050 at the moment.
@@ -7,6 +7,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 /* -- */
Index: linux-2.6.11/drivers/media/video/tda8290.c
===
--- linux-2.6.11.orig/drivers/media/video/tda8290.c 2005-03-07 
18:13:01.0 +0100
+++ linux-2.6.11/drivers/media/video/tda8290.c  2005-03-07 18:13:02.0 
+0100
@@ -1,5 +1,5 @@
 /*
- * $Id: tda8290.c,v 1.5 2005/02/15 15:59:35 kraxel Exp $
+ * $Id: tda8290.c,v 1.7 2005/03/07 12:01:51 kraxel Exp $
  *
  * i2c tv tuner chip device driver
  * controls the philips tda8290+75 tuner chip combo.
@@ -123,7 +123,7 @@ static int tda8290_tune(struct i2c_clien
struct i2c_msg easy_mode =
{ I2C_ADDR_TDA8290, 0, 2, t->i2c_easy_mode };
struct i2c_msg set_freq =
-   { I2C_ADDR_TDA8290, 0, 8, t->i2c_set_freq  };
+   { I2C_ADDR_TDA8275, 0, 8, t->i2c_set_freq  };
 
i2c_transfer(c->adapter, _mode,  1);
i2c_transfer(c->adapter, i2c_msg_prolog, ARRAY_SIZE(i2c_msg_prolog));

-- 
#define printk(args...) fprintf(stderr, ## args)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[patch] v4l: bttv driver update

2005-03-08 Thread Gerd Knorr
This is a bttv driver update, changes:
  * add support for a new card.
  * add some debug code (bt878 risc disassembler).
  * drop some obsolete i2c code.

Signed-off-by: Gerd Knorr <[EMAIL PROTECTED]>
---
 drivers/media/video/btcx-risc.c   |   12 +-
 drivers/media/video/bttv-cards.c  |  175 +-
 drivers/media/video/bttv-driver.c |   93 +--
 drivers/media/video/bttv-gpio.c   |   17 --
 drivers/media/video/bttv-i2c.c|   15 --
 drivers/media/video/bttv.h|5 
 drivers/media/video/bttvp.h   |3 
 7 files changed, 263 insertions(+), 57 deletions(-)

Index: linux-2.6.11/drivers/media/video/bttv.h
===
--- linux-2.6.11.orig/drivers/media/video/bttv.h2005-03-07 
15:25:35.0 +0100
+++ linux-2.6.11/drivers/media/video/bttv.h 2005-03-07 16:23:11.0 
+0100
@@ -1,5 +1,5 @@
 /*
- * $Id: bttv.h,v 1.15 2005/01/24 17:37:23 kraxel Exp $
+ * $Id: bttv.h,v 1.17 2005/02/22 14:06:32 kraxel Exp $
  *
  *  bttv - Bt848 frame grabber driver
  *
@@ -134,6 +134,7 @@
 #define BTTV_APAC_VIEWCOMP  0x7f
 #define BTTV_DVICO_DVBT_LITE  0x80
 #define BTTV_TIBET_CS16  0x83
+#define BTTV_KODICOM_4400R  0x84
 
 /* i2c address list */
 #define I2C_TSA55220xc2
@@ -302,8 +303,6 @@ struct bttv_sub_driver {
struct device_driver   drv;
char   wanted[BUS_ID_SIZE];
void   (*gpio_irq)(struct bttv_sub_device *sub);
-   void   (*i2c_info)(struct bttv_sub_device *sub,
-  struct i2c_client *client, int 
attach);
 };
 #define to_bttv_sub_drv(x) container_of((x), struct bttv_sub_driver, drv)
 
Index: linux-2.6.11/drivers/media/video/bttvp.h
===
--- linux-2.6.11.orig/drivers/media/video/bttvp.h   2005-03-07 
15:25:35.0 +0100
+++ linux-2.6.11/drivers/media/video/bttvp.h2005-03-07 16:23:03.0 
+0100
@@ -1,5 +1,5 @@
 /*
-$Id: bttvp.h,v 1.16 2005/01/24 17:37:23 kraxel Exp $
+$Id: bttvp.h,v 1.17 2005/02/16 12:14:10 kraxel Exp $
 
 bttv - Bt848 frame grabber driver
 
@@ -209,7 +209,6 @@ extern struct bus_type bttv_sub_bus_type
 int bttv_sub_add_device(struct bttv_core *core, char *name);
 int bttv_sub_del_devices(struct bttv_core *core);
 void bttv_gpio_irq(struct bttv_core *core);
-void bttv_i2c_info(struct bttv_core *core, struct i2c_client *client, int 
attach);
 
 
 /* -- */
Index: linux-2.6.11/drivers/media/video/bttv-cards.c
===
--- linux-2.6.11.orig/drivers/media/video/bttv-cards.c  2005-03-07 
15:25:35.0 +0100
+++ linux-2.6.11/drivers/media/video/bttv-cards.c   2005-03-07 
16:23:11.0 +0100
@@ -1,5 +1,5 @@
 /*
-$Id: bttv-cards.c,v 1.44 2005/01/31 11:35:05 kraxel Exp $
+$Id: bttv-cards.c,v 1.47 2005/02/22 14:06:32 kraxel Exp $
 
 bttv-cards.c
 
@@ -80,6 +80,9 @@ static void picolo_tetra_init(struct btt
 static void tibetCS16_muxsel(struct bttv *btv, unsigned int input);
 static void tibetCS16_init(struct bttv *btv);
 
+static void kodicom4400r_muxsel(struct bttv *btv, unsigned int input);
+static void kodicom4400r_init(struct bttv *btv);
+
 static void sigmaSLC_muxsel(struct bttv *btv, unsigned int input);
 static void sigmaSQ_muxsel(struct bttv *btv, unsigned int input);
 
@@ -101,6 +104,7 @@ static unsigned int pll[BTTV_MAX]= {
 static unsigned int tuner[BTTV_MAX]  = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
 static unsigned int svhs[BTTV_MAX]   = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
 static unsigned int remote[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
+static struct bttv  *master[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = NULL };
 #ifdef MODULE
 static unsigned int autoload = 1;
 #else
@@ -293,7 +297,7 @@ static struct CARD {
{ 0x07611461, BTTV_AVDVBT_761,"AverMedia AverTV DVB-T 761" },
{ 0x001c11bd, BTTV_PINNACLESAT,   "Pinnacle PCTV Sat" },
{ 0x002611bd, BTTV_TWINHAN_DST,   "Pinnacle PCTV SAT CI" },
-   { 0x00011822, BTTV_TWINHAN_DST,   "Twinhan VisionPlus DVB-T" },
+   { 0x00011822, BTTV_TWINHAN_DST,   "Twinhan VisionPlus DVB" },
{ 0xfc00270f, BTTV_TWINHAN_DST,   "ChainTech digitop DST-1000 DVB-S" },
{ 0x07711461, BTTV_AVDVBT_771,"AVermedia AverTV DVB-T 771" },
{ 0xdb1018ac, BTTV_DVICO_DVBT_LITE,"DVICO FusionHDTV DVB-T Lite" },
@@ -1922,6 +1926,7 @@ struct tvcard bttv_tvcards[] = {
.svhs   = 2,
.muxsel = { 2, 3, 1, 0},
.tuner_type = TUNER_PHILIPS_ATSC,
+   .has_dvb= 1,
 },{
.name   = "Twinhan DST + clones",
.no_msp34xx = 1,
@@ -2190,6 +2195,63 @@ struct tvcard bttv_tvcards[] = {
   

[patch] v4l: IR common update

2005-03-08 Thread Gerd Knorr
Changes:
 * add some keytables which are used by both bttv and cx88 driver
   so they can be shared.
 * add IR decoding helper functions.

Signed-off-by: Gerd Knorr <[EMAIL PROTECTED]>
---
 drivers/media/common/ir-common.c |  164 ++-
 include/media/ir-common.h|6 -
 2 files changed, 167 insertions(+), 3 deletions(-)

Index: linux-2.6.11/include/media/ir-common.h
===
--- linux-2.6.11.orig/include/media/ir-common.h 2005-03-07 10:15:15.0 
+0100
+++ linux-2.6.11/include/media/ir-common.h  2005-03-07 16:17:34.0 
+0100
@@ -1,5 +1,5 @@
 /*
- * $Id: ir-common.h,v 1.6 2004/09/15 16:15:24 kraxel Exp $
+ * $Id: ir-common.h,v 1.8 2005/02/22 12:28:40 kraxel Exp $
  *
  * some common structs and functions to handle infrared remotes via
  * input layer ...
@@ -47,7 +47,9 @@ struct ir_input_state {
 };
 
 extern IR_KEYTAB_TYPE ir_codes_rc5_tv[IR_KEYTAB_SIZE];
+extern IR_KEYTAB_TYPE ir_codes_winfast[IR_KEYTAB_SIZE];
 extern IR_KEYTAB_TYPE ir_codes_empty[IR_KEYTAB_SIZE];
+extern IR_KEYTAB_TYPE ir_codes_hauppauge_new[IR_KEYTAB_SIZE];
 
 void ir_input_init(struct input_dev *dev, struct ir_input_state *ir,
   int ir_type, IR_KEYTAB_TYPE *ir_codes);
@@ -55,6 +57,8 @@ void ir_input_nokey(struct input_dev *de
 void ir_input_keydown(struct input_dev *dev, struct ir_input_state *ir,
  u32 ir_key, u32 ir_raw);
 u32  ir_extract_bits(u32 data, u32 mask);
+int  ir_dump_samples(u32 *samples, int count);
+int  ir_decode_biphase(u32 *samples, int count, int low, int high);
 
 /*
  * Local variables:
Index: linux-2.6.11/drivers/media/common/ir-common.c
===
--- linux-2.6.11.orig/drivers/media/common/ir-common.c  2005-03-07 
10:14:43.0 +0100
+++ linux-2.6.11/drivers/media/common/ir-common.c   2005-03-07 
16:17:34.0 +0100
@@ -1,5 +1,5 @@
 /*
- * $Id: ir-common.c,v 1.6 2004/12/10 12:33:39 kraxel Exp $
+ * $Id: ir-common.c,v 1.8 2005/02/22 12:28:40 kraxel Exp $
  *
  * some common structs and functions to handle infrared remotes via
  * input layer ...
@@ -23,7 +23,6 @@
 
 #include 
 #include 
-
 #include 
 
 /* -- 
*/
@@ -45,6 +44,7 @@ module_param(debug, int, 0644);
 
 /* generic RC5 keytable  */
 /* see http://users.pandora.be/nenya/electronics/rc5/codes00.htm */
+/* used by old (black) Hauppauge remotes */
 IR_KEYTAB_TYPE ir_codes_rc5_tv[IR_KEYTAB_SIZE] = {
[ 0x00 ] = KEY_KP0, // 0
[ 0x01 ] = KEY_KP1, // 1
@@ -117,12 +117,102 @@ IR_KEYTAB_TYPE ir_codes_rc5_tv[IR_KEYTAB
 };
 EXPORT_SYMBOL_GPL(ir_codes_rc5_tv);
 
+/* Table for Leadtek Winfast Remote Controls - used by both bttv and cx88 */
+IR_KEYTAB_TYPE ir_codes_winfast[IR_KEYTAB_SIZE] = {
+   [  5 ] = KEY_KP1,
+   [  6 ] = KEY_KP2,
+   [  7 ] = KEY_KP3,
+   [  9 ] = KEY_KP4,
+   [ 10 ] = KEY_KP5,
+   [ 11 ] = KEY_KP6,
+   [ 13 ] = KEY_KP7,
+   [ 14 ] = KEY_KP8,
+   [ 15 ] = KEY_KP9,
+   [ 18 ] = KEY_KP0,
+
+   [  0 ] = KEY_POWER,
+//  [ 27 ] = MTS button
+   [  2 ] = KEY_TUNER, // TV/FM
+   [ 30 ] = KEY_VIDEO,
+//  [ 22 ] = display button
+   [  4 ] = KEY_VOLUMEUP,
+   [  8 ] = KEY_VOLUMEDOWN,
+   [ 12 ] = KEY_CHANNELUP,
+   [ 16 ] = KEY_CHANNELDOWN,
+   [  3 ] = KEY_ZOOM,  // fullscreen
+   [ 31 ] = KEY_SUBTITLE,  // closed caption/teletext
+   [ 32 ] = KEY_SLEEP,
+//  [ 41 ] = boss key
+   [ 20 ] = KEY_MUTE,
+   [ 43 ] = KEY_RED,
+   [ 44 ] = KEY_GREEN,
+   [ 45 ] = KEY_YELLOW,
+   [ 46 ] = KEY_BLUE,
+   [ 24 ] = KEY_KPPLUS,//fine tune +
+   [ 25 ] = KEY_KPMINUS,   //fine tune -
+//  [ 42 ] = picture in picture
+[ 33 ] = KEY_KPDOT,
+   [ 19 ] = KEY_KPENTER,
+//  [ 17 ] = recall
+   [ 34 ] = KEY_BACK,
+   [ 35 ] = KEY_PLAYPAUSE,
+   [ 36 ] = KEY_NEXT,
+//  [ 37 ] = time shifting
+   [ 38 ] = KEY_STOP,
+   [ 39 ] = KEY_RECORD
+//  [ 40 ] = snapshot
+};
+EXPORT_SYMBOL_GPL(ir_codes_winfast);
+
 /* empty keytable, can be used as placeholder for not-yet created keytables */
 IR_KEYTAB_TYPE ir_codes_empty[IR_KEYTAB_SIZE] = {
[ 42 ] = KEY_COFFEE,
 };
 EXPORT_SYMBOL_GPL(ir_codes_empty);
 
+/* Hauppauge: the newer, gray remotes (seems there are multiple
+ * slightly different versions), shipped with cx88+ivtv cards.
+ * almost rc5 coding, but some non-standard keys */
+IR_KEYTAB_TYPE ir_codes_hauppauge_new[IR_KEYTAB_SIZE] = {
+   [ 0x00 ] = KEY_KP0, // 0
+   [ 0x01 ] = KEY_KP1, // 1
+   [ 0x02 ] = KEY_KP2, // 2
+   [ 0x03 ] = KEY_KP3, // 3
+   [ 0x04 ] = KEY_KP4, // 4
+   [ 0x05 ] = KEY_KP5,   

[patch] v4l: bttv IR driver update

2005-03-08 Thread Gerd Knorr
minor bttv IR driver update: drop a keytable and use the one in
ir-common.ko instead.

This patch depends on the ir-common update.

Signed-off-by: Gerd Knorr <[EMAIL PROTECTED]>
---
 drivers/media/video/ir-kbd-gpio.c |   51 +-
 1 files changed, 3 insertions(+), 48 deletions(-)

diff -u linux-2.6.11/drivers/media/video/ir-kbd-gpio.c 
linux/drivers/media/video/ir-kbd-gpio.c
--- linux-2.6.11/drivers/media/video/ir-kbd-gpio.c  2005-03-07 
10:14:58.0 +0100
+++ linux/drivers/media/video/ir-kbd-gpio.c 2005-03-07 15:19:06.0 
+0100
@@ -1,5 +1,5 @@
 /*
- * $Id: ir-kbd-gpio.c,v 1.11 2004/10/25 11:26:36 kraxel Exp $
+ * $Id: ir-kbd-gpio.c,v 1.12 2005/02/22 12:28:40 kraxel Exp $
  *
  * Copyright (c) 2003 Gerd Knorr
  * Copyright (c) 2003 Pavel Machek
@@ -114,51 +114,6 @@
[ 0x3e ] = KEY_VOLUMEUP,// 'volume +'
 };
 
-static IR_KEYTAB_TYPE winfast_codes[IR_KEYTAB_SIZE] = {
-   [  5 ] = KEY_KP1,
-   [  6 ] = KEY_KP2,
-   [  7 ] = KEY_KP3,
-   [  9 ] = KEY_KP4,
-   [ 10 ] = KEY_KP5,
-   [ 11 ] = KEY_KP6,
-   [ 13 ] = KEY_KP7,
-   [ 14 ] = KEY_KP8,
-   [ 15 ] = KEY_KP9,
-   [ 18 ] = KEY_KP0,
-
-   [  0 ] = KEY_POWER,
-//  [ 27 ] = MTS button
-   [  2 ] = KEY_TUNER, // TV/FM
-   [ 30 ] = KEY_VIDEO,
-//  [ 22 ] = display button
-   [  4 ] = KEY_VOLUMEUP,
-   [  8 ] = KEY_VOLUMEDOWN,
-   [ 12 ] = KEY_CHANNELUP,
-   [ 16 ] = KEY_CHANNELDOWN,
-   [  3 ] = KEY_ZOOM,  // fullscreen
-   [ 31 ] = KEY_SUBTITLE,  // closed caption/teletext
-   [ 32 ] = KEY_SLEEP,
-//  [ 41 ] = boss key
-   [ 20 ] = KEY_MUTE,
-   [ 43 ] = KEY_RED,
-   [ 44 ] = KEY_GREEN,
-   [ 45 ] = KEY_YELLOW,
-   [ 46 ] = KEY_BLUE,
-   [ 24 ] = KEY_KPPLUS,//fine tune +
-   [ 25 ] = KEY_KPMINUS,   //fine tune -
-//  [ 42 ] = picture in picture
-[ 33 ] = KEY_KPDOT,
-   [ 19 ] = KEY_KPENTER,
-//  [ 17 ] = recall
-   [ 34 ] = KEY_BACK,
-   [ 35 ] = KEY_PLAYPAUSE,
-   [ 36 ] = KEY_NEXT,
-//  [ 37 ] = time shifting
-   [ 38 ] = KEY_STOP,
-   [ 39 ] = KEY_RECORD
-//  [ 40 ] = snapshot
-};
-
 static IR_KEYTAB_TYPE ir_codes_pixelview[IR_KEYTAB_SIZE] = {
[  2 ] = KEY_KP0,
[  1 ] = KEY_KP1,
@@ -388,12 +343,12 @@
 break;
 
case BTTV_WINFAST2000:
-   ir_codes = winfast_codes;
+   ir_codes = ir_codes_winfast;
ir->mask_keycode = 0x1f8;
break;
case BTTV_MAGICTVIEW061:
case BTTV_MAGICTVIEW063:
-   ir_codes = winfast_codes;
+   ir_codes = ir_codes_winfast;
ir->mask_keycode = 0x0008e000;
ir->mask_keydown = 0x0020;
break;

-- 
#define printk(args...) fprintf(stderr, ## args)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[patch] v4l: video-buf update

2005-03-08 Thread Gerd Knorr
Bugfix: catch pci_map_sg() failures.

Signed-off-by: Gerd Knorr <[EMAIL PROTECTED]>
---
 drivers/media/video/video-buf.c |   13 +++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff -u linux-2.6.11/drivers/media/video/video-buf.c 
linux/drivers/media/video/video-buf.c
--- linux-2.6.11/drivers/media/video/video-buf.c2005-03-07 
10:13:55.0 +0100
+++ linux/drivers/media/video/video-buf.c   2005-03-07 16:38:38.0 
+0100
@@ -1,5 +1,5 @@
 /*
- * $Id: video-buf.c,v 1.17 2004/12/10 12:33:40 kraxel Exp $
+ * $Id: video-buf.c,v 1.18 2005/02/24 13:32:30 kraxel Exp $
  *
  * generic helper functions for video4linux capture buffers, to handle
  * memory management and PCI DMA.  Right now bttv + saa7134 use it.
@@ -217,9 +217,18 @@
return -ENOMEM;
}
 
-   if (!dma->bus_addr)
+   if (!dma->bus_addr) {
dma->sglen = pci_map_sg(dev,dma->sglist,dma->nr_pages,
dma->direction);
+   if (0 == dma->sglen) {
+   printk(KERN_WARNING
+  "%s: pci_map_sg failed\n",__FUNCTION__);
+   kfree(dma->sglist);
+   dma->sglist = NULL;
+   dma->sglen = 0;
+   return -EIO;
+   }
+   }
return 0;
 }
 

-- 
#define printk(args...) fprintf(stderr, ## args)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[patch] v4l: video-buf update

2005-03-08 Thread Gerd Knorr
Bugfix: catch pci_map_sg() failures.

Signed-off-by: Gerd Knorr [EMAIL PROTECTED]
---
 drivers/media/video/video-buf.c |   13 +++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff -u linux-2.6.11/drivers/media/video/video-buf.c 
linux/drivers/media/video/video-buf.c
--- linux-2.6.11/drivers/media/video/video-buf.c2005-03-07 
10:13:55.0 +0100
+++ linux/drivers/media/video/video-buf.c   2005-03-07 16:38:38.0 
+0100
@@ -1,5 +1,5 @@
 /*
- * $Id: video-buf.c,v 1.17 2004/12/10 12:33:40 kraxel Exp $
+ * $Id: video-buf.c,v 1.18 2005/02/24 13:32:30 kraxel Exp $
  *
  * generic helper functions for video4linux capture buffers, to handle
  * memory management and PCI DMA.  Right now bttv + saa7134 use it.
@@ -217,9 +217,18 @@
return -ENOMEM;
}
 
-   if (!dma-bus_addr)
+   if (!dma-bus_addr) {
dma-sglen = pci_map_sg(dev,dma-sglist,dma-nr_pages,
dma-direction);
+   if (0 == dma-sglen) {
+   printk(KERN_WARNING
+  %s: pci_map_sg failed\n,__FUNCTION__);
+   kfree(dma-sglist);
+   dma-sglist = NULL;
+   dma-sglen = 0;
+   return -EIO;
+   }
+   }
return 0;
 }
 

-- 
#define printk(args...) fprintf(stderr, ## args)
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[patch] v4l: bttv IR driver update

2005-03-08 Thread Gerd Knorr
minor bttv IR driver update: drop a keytable and use the one in
ir-common.ko instead.

This patch depends on the ir-common update.

Signed-off-by: Gerd Knorr [EMAIL PROTECTED]
---
 drivers/media/video/ir-kbd-gpio.c |   51 +-
 1 files changed, 3 insertions(+), 48 deletions(-)

diff -u linux-2.6.11/drivers/media/video/ir-kbd-gpio.c 
linux/drivers/media/video/ir-kbd-gpio.c
--- linux-2.6.11/drivers/media/video/ir-kbd-gpio.c  2005-03-07 
10:14:58.0 +0100
+++ linux/drivers/media/video/ir-kbd-gpio.c 2005-03-07 15:19:06.0 
+0100
@@ -1,5 +1,5 @@
 /*
- * $Id: ir-kbd-gpio.c,v 1.11 2004/10/25 11:26:36 kraxel Exp $
+ * $Id: ir-kbd-gpio.c,v 1.12 2005/02/22 12:28:40 kraxel Exp $
  *
  * Copyright (c) 2003 Gerd Knorr
  * Copyright (c) 2003 Pavel Machek
@@ -114,51 +114,6 @@
[ 0x3e ] = KEY_VOLUMEUP,// 'volume +'
 };
 
-static IR_KEYTAB_TYPE winfast_codes[IR_KEYTAB_SIZE] = {
-   [  5 ] = KEY_KP1,
-   [  6 ] = KEY_KP2,
-   [  7 ] = KEY_KP3,
-   [  9 ] = KEY_KP4,
-   [ 10 ] = KEY_KP5,
-   [ 11 ] = KEY_KP6,
-   [ 13 ] = KEY_KP7,
-   [ 14 ] = KEY_KP8,
-   [ 15 ] = KEY_KP9,
-   [ 18 ] = KEY_KP0,
-
-   [  0 ] = KEY_POWER,
-//  [ 27 ] = MTS button
-   [  2 ] = KEY_TUNER, // TV/FM
-   [ 30 ] = KEY_VIDEO,
-//  [ 22 ] = display button
-   [  4 ] = KEY_VOLUMEUP,
-   [  8 ] = KEY_VOLUMEDOWN,
-   [ 12 ] = KEY_CHANNELUP,
-   [ 16 ] = KEY_CHANNELDOWN,
-   [  3 ] = KEY_ZOOM,  // fullscreen
-   [ 31 ] = KEY_SUBTITLE,  // closed caption/teletext
-   [ 32 ] = KEY_SLEEP,
-//  [ 41 ] = boss key
-   [ 20 ] = KEY_MUTE,
-   [ 43 ] = KEY_RED,
-   [ 44 ] = KEY_GREEN,
-   [ 45 ] = KEY_YELLOW,
-   [ 46 ] = KEY_BLUE,
-   [ 24 ] = KEY_KPPLUS,//fine tune +
-   [ 25 ] = KEY_KPMINUS,   //fine tune -
-//  [ 42 ] = picture in picture
-[ 33 ] = KEY_KPDOT,
-   [ 19 ] = KEY_KPENTER,
-//  [ 17 ] = recall
-   [ 34 ] = KEY_BACK,
-   [ 35 ] = KEY_PLAYPAUSE,
-   [ 36 ] = KEY_NEXT,
-//  [ 37 ] = time shifting
-   [ 38 ] = KEY_STOP,
-   [ 39 ] = KEY_RECORD
-//  [ 40 ] = snapshot
-};
-
 static IR_KEYTAB_TYPE ir_codes_pixelview[IR_KEYTAB_SIZE] = {
[  2 ] = KEY_KP0,
[  1 ] = KEY_KP1,
@@ -388,12 +343,12 @@
 break;
 
case BTTV_WINFAST2000:
-   ir_codes = winfast_codes;
+   ir_codes = ir_codes_winfast;
ir-mask_keycode = 0x1f8;
break;
case BTTV_MAGICTVIEW061:
case BTTV_MAGICTVIEW063:
-   ir_codes = winfast_codes;
+   ir_codes = ir_codes_winfast;
ir-mask_keycode = 0x0008e000;
ir-mask_keydown = 0x0020;
break;

-- 
#define printk(args...) fprintf(stderr, ## args)
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[patch] v4l: bttv driver update

2005-03-08 Thread Gerd Knorr
This is a bttv driver update, changes:
  * add support for a new card.
  * add some debug code (bt878 risc disassembler).
  * drop some obsolete i2c code.

Signed-off-by: Gerd Knorr [EMAIL PROTECTED]
---
 drivers/media/video/btcx-risc.c   |   12 +-
 drivers/media/video/bttv-cards.c  |  175 +-
 drivers/media/video/bttv-driver.c |   93 +--
 drivers/media/video/bttv-gpio.c   |   17 --
 drivers/media/video/bttv-i2c.c|   15 --
 drivers/media/video/bttv.h|5 
 drivers/media/video/bttvp.h   |3 
 7 files changed, 263 insertions(+), 57 deletions(-)

Index: linux-2.6.11/drivers/media/video/bttv.h
===
--- linux-2.6.11.orig/drivers/media/video/bttv.h2005-03-07 
15:25:35.0 +0100
+++ linux-2.6.11/drivers/media/video/bttv.h 2005-03-07 16:23:11.0 
+0100
@@ -1,5 +1,5 @@
 /*
- * $Id: bttv.h,v 1.15 2005/01/24 17:37:23 kraxel Exp $
+ * $Id: bttv.h,v 1.17 2005/02/22 14:06:32 kraxel Exp $
  *
  *  bttv - Bt848 frame grabber driver
  *
@@ -134,6 +134,7 @@
 #define BTTV_APAC_VIEWCOMP  0x7f
 #define BTTV_DVICO_DVBT_LITE  0x80
 #define BTTV_TIBET_CS16  0x83
+#define BTTV_KODICOM_4400R  0x84
 
 /* i2c address list */
 #define I2C_TSA55220xc2
@@ -302,8 +303,6 @@ struct bttv_sub_driver {
struct device_driver   drv;
char   wanted[BUS_ID_SIZE];
void   (*gpio_irq)(struct bttv_sub_device *sub);
-   void   (*i2c_info)(struct bttv_sub_device *sub,
-  struct i2c_client *client, int 
attach);
 };
 #define to_bttv_sub_drv(x) container_of((x), struct bttv_sub_driver, drv)
 
Index: linux-2.6.11/drivers/media/video/bttvp.h
===
--- linux-2.6.11.orig/drivers/media/video/bttvp.h   2005-03-07 
15:25:35.0 +0100
+++ linux-2.6.11/drivers/media/video/bttvp.h2005-03-07 16:23:03.0 
+0100
@@ -1,5 +1,5 @@
 /*
-$Id: bttvp.h,v 1.16 2005/01/24 17:37:23 kraxel Exp $
+$Id: bttvp.h,v 1.17 2005/02/16 12:14:10 kraxel Exp $
 
 bttv - Bt848 frame grabber driver
 
@@ -209,7 +209,6 @@ extern struct bus_type bttv_sub_bus_type
 int bttv_sub_add_device(struct bttv_core *core, char *name);
 int bttv_sub_del_devices(struct bttv_core *core);
 void bttv_gpio_irq(struct bttv_core *core);
-void bttv_i2c_info(struct bttv_core *core, struct i2c_client *client, int 
attach);
 
 
 /* -- */
Index: linux-2.6.11/drivers/media/video/bttv-cards.c
===
--- linux-2.6.11.orig/drivers/media/video/bttv-cards.c  2005-03-07 
15:25:35.0 +0100
+++ linux-2.6.11/drivers/media/video/bttv-cards.c   2005-03-07 
16:23:11.0 +0100
@@ -1,5 +1,5 @@
 /*
-$Id: bttv-cards.c,v 1.44 2005/01/31 11:35:05 kraxel Exp $
+$Id: bttv-cards.c,v 1.47 2005/02/22 14:06:32 kraxel Exp $
 
 bttv-cards.c
 
@@ -80,6 +80,9 @@ static void picolo_tetra_init(struct btt
 static void tibetCS16_muxsel(struct bttv *btv, unsigned int input);
 static void tibetCS16_init(struct bttv *btv);
 
+static void kodicom4400r_muxsel(struct bttv *btv, unsigned int input);
+static void kodicom4400r_init(struct bttv *btv);
+
 static void sigmaSLC_muxsel(struct bttv *btv, unsigned int input);
 static void sigmaSQ_muxsel(struct bttv *btv, unsigned int input);
 
@@ -101,6 +104,7 @@ static unsigned int pll[BTTV_MAX]= {
 static unsigned int tuner[BTTV_MAX]  = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
 static unsigned int svhs[BTTV_MAX]   = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
 static unsigned int remote[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
+static struct bttv  *master[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = NULL };
 #ifdef MODULE
 static unsigned int autoload = 1;
 #else
@@ -293,7 +297,7 @@ static struct CARD {
{ 0x07611461, BTTV_AVDVBT_761,AverMedia AverTV DVB-T 761 },
{ 0x001c11bd, BTTV_PINNACLESAT,   Pinnacle PCTV Sat },
{ 0x002611bd, BTTV_TWINHAN_DST,   Pinnacle PCTV SAT CI },
-   { 0x00011822, BTTV_TWINHAN_DST,   Twinhan VisionPlus DVB-T },
+   { 0x00011822, BTTV_TWINHAN_DST,   Twinhan VisionPlus DVB },
{ 0xfc00270f, BTTV_TWINHAN_DST,   ChainTech digitop DST-1000 DVB-S },
{ 0x07711461, BTTV_AVDVBT_771,AVermedia AverTV DVB-T 771 },
{ 0xdb1018ac, BTTV_DVICO_DVBT_LITE,DVICO FusionHDTV DVB-T Lite },
@@ -1922,6 +1926,7 @@ struct tvcard bttv_tvcards[] = {
.svhs   = 2,
.muxsel = { 2, 3, 1, 0},
.tuner_type = TUNER_PHILIPS_ATSC,
+   .has_dvb= 1,
 },{
.name   = Twinhan DST + clones,
.no_msp34xx = 1,
@@ -2190,6 +2195,63 @@ struct tvcard bttv_tvcards[] = {
.no_tda7432 = 1,
.tuner_type = -1,
.muxsel_hook= tibetCS16_muxsel

[patch] v4l: IR common update

2005-03-08 Thread Gerd Knorr
Changes:
 * add some keytables which are used by both bttv and cx88 driver
   so they can be shared.
 * add IR decoding helper functions.

Signed-off-by: Gerd Knorr [EMAIL PROTECTED]
---
 drivers/media/common/ir-common.c |  164 ++-
 include/media/ir-common.h|6 -
 2 files changed, 167 insertions(+), 3 deletions(-)

Index: linux-2.6.11/include/media/ir-common.h
===
--- linux-2.6.11.orig/include/media/ir-common.h 2005-03-07 10:15:15.0 
+0100
+++ linux-2.6.11/include/media/ir-common.h  2005-03-07 16:17:34.0 
+0100
@@ -1,5 +1,5 @@
 /*
- * $Id: ir-common.h,v 1.6 2004/09/15 16:15:24 kraxel Exp $
+ * $Id: ir-common.h,v 1.8 2005/02/22 12:28:40 kraxel Exp $
  *
  * some common structs and functions to handle infrared remotes via
  * input layer ...
@@ -47,7 +47,9 @@ struct ir_input_state {
 };
 
 extern IR_KEYTAB_TYPE ir_codes_rc5_tv[IR_KEYTAB_SIZE];
+extern IR_KEYTAB_TYPE ir_codes_winfast[IR_KEYTAB_SIZE];
 extern IR_KEYTAB_TYPE ir_codes_empty[IR_KEYTAB_SIZE];
+extern IR_KEYTAB_TYPE ir_codes_hauppauge_new[IR_KEYTAB_SIZE];
 
 void ir_input_init(struct input_dev *dev, struct ir_input_state *ir,
   int ir_type, IR_KEYTAB_TYPE *ir_codes);
@@ -55,6 +57,8 @@ void ir_input_nokey(struct input_dev *de
 void ir_input_keydown(struct input_dev *dev, struct ir_input_state *ir,
  u32 ir_key, u32 ir_raw);
 u32  ir_extract_bits(u32 data, u32 mask);
+int  ir_dump_samples(u32 *samples, int count);
+int  ir_decode_biphase(u32 *samples, int count, int low, int high);
 
 /*
  * Local variables:
Index: linux-2.6.11/drivers/media/common/ir-common.c
===
--- linux-2.6.11.orig/drivers/media/common/ir-common.c  2005-03-07 
10:14:43.0 +0100
+++ linux-2.6.11/drivers/media/common/ir-common.c   2005-03-07 
16:17:34.0 +0100
@@ -1,5 +1,5 @@
 /*
- * $Id: ir-common.c,v 1.6 2004/12/10 12:33:39 kraxel Exp $
+ * $Id: ir-common.c,v 1.8 2005/02/22 12:28:40 kraxel Exp $
  *
  * some common structs and functions to handle infrared remotes via
  * input layer ...
@@ -23,7 +23,6 @@
 
 #include linux/module.h
 #include linux/moduleparam.h
-
 #include media/ir-common.h
 
 /* -- 
*/
@@ -45,6 +44,7 @@ module_param(debug, int, 0644);
 
 /* generic RC5 keytable  */
 /* see http://users.pandora.be/nenya/electronics/rc5/codes00.htm */
+/* used by old (black) Hauppauge remotes */
 IR_KEYTAB_TYPE ir_codes_rc5_tv[IR_KEYTAB_SIZE] = {
[ 0x00 ] = KEY_KP0, // 0
[ 0x01 ] = KEY_KP1, // 1
@@ -117,12 +117,102 @@ IR_KEYTAB_TYPE ir_codes_rc5_tv[IR_KEYTAB
 };
 EXPORT_SYMBOL_GPL(ir_codes_rc5_tv);
 
+/* Table for Leadtek Winfast Remote Controls - used by both bttv and cx88 */
+IR_KEYTAB_TYPE ir_codes_winfast[IR_KEYTAB_SIZE] = {
+   [  5 ] = KEY_KP1,
+   [  6 ] = KEY_KP2,
+   [  7 ] = KEY_KP3,
+   [  9 ] = KEY_KP4,
+   [ 10 ] = KEY_KP5,
+   [ 11 ] = KEY_KP6,
+   [ 13 ] = KEY_KP7,
+   [ 14 ] = KEY_KP8,
+   [ 15 ] = KEY_KP9,
+   [ 18 ] = KEY_KP0,
+
+   [  0 ] = KEY_POWER,
+//  [ 27 ] = MTS button
+   [  2 ] = KEY_TUNER, // TV/FM
+   [ 30 ] = KEY_VIDEO,
+//  [ 22 ] = display button
+   [  4 ] = KEY_VOLUMEUP,
+   [  8 ] = KEY_VOLUMEDOWN,
+   [ 12 ] = KEY_CHANNELUP,
+   [ 16 ] = KEY_CHANNELDOWN,
+   [  3 ] = KEY_ZOOM,  // fullscreen
+   [ 31 ] = KEY_SUBTITLE,  // closed caption/teletext
+   [ 32 ] = KEY_SLEEP,
+//  [ 41 ] = boss key
+   [ 20 ] = KEY_MUTE,
+   [ 43 ] = KEY_RED,
+   [ 44 ] = KEY_GREEN,
+   [ 45 ] = KEY_YELLOW,
+   [ 46 ] = KEY_BLUE,
+   [ 24 ] = KEY_KPPLUS,//fine tune +
+   [ 25 ] = KEY_KPMINUS,   //fine tune -
+//  [ 42 ] = picture in picture
+[ 33 ] = KEY_KPDOT,
+   [ 19 ] = KEY_KPENTER,
+//  [ 17 ] = recall
+   [ 34 ] = KEY_BACK,
+   [ 35 ] = KEY_PLAYPAUSE,
+   [ 36 ] = KEY_NEXT,
+//  [ 37 ] = time shifting
+   [ 38 ] = KEY_STOP,
+   [ 39 ] = KEY_RECORD
+//  [ 40 ] = snapshot
+};
+EXPORT_SYMBOL_GPL(ir_codes_winfast);
+
 /* empty keytable, can be used as placeholder for not-yet created keytables */
 IR_KEYTAB_TYPE ir_codes_empty[IR_KEYTAB_SIZE] = {
[ 42 ] = KEY_COFFEE,
 };
 EXPORT_SYMBOL_GPL(ir_codes_empty);
 
+/* Hauppauge: the newer, gray remotes (seems there are multiple
+ * slightly different versions), shipped with cx88+ivtv cards.
+ * almost rc5 coding, but some non-standard keys */
+IR_KEYTAB_TYPE ir_codes_hauppauge_new[IR_KEYTAB_SIZE] = {
+   [ 0x00 ] = KEY_KP0, // 0
+   [ 0x01 ] = KEY_KP1, // 1
+   [ 0x02 ] = KEY_KP2, // 2
+   [ 0x03 ] = KEY_KP3, // 3
+   [ 0x04 ] = KEY_KP4, // 4

[patch] v4l: tveeprom update

2005-03-08 Thread Gerd Knorr
Add some new tuners to the list.

Signed-off-by: Gerd Knorr [EMAIL PROTECTED]
---
 drivers/media/video/tveeprom.c |   27 ++-
 1 files changed, 18 insertions(+), 9 deletions(-)

Index: linux-2.6.11/drivers/media/video/tveeprom.c
===
--- linux-2.6.11.orig/drivers/media/video/tveeprom.c2005-03-07 
18:13:01.0 +0100
+++ linux-2.6.11/drivers/media/video/tveeprom.c 2005-03-08 10:33:08.0 
+0100
@@ -30,6 +30,7 @@
 
 
 #include linux/module.h
+#include linux/moduleparam.h
 #include linux/errno.h
 #include linux/kernel.h
 #include linux/init.h
@@ -191,11 +192,13 @@ hauppauge_tuner[] =
{ TUNER_ABSENT,TCL MFPE05 2},
/* 90-99 */
{ TUNER_ABSENT,LG TALN H202T},
-   { TUNER_ABSENT,Philips FQ1216AME MK4},
-   { TUNER_ABSENT,Philips FQ1236A MK4},
+   { TUNER_PHILIPS_FQ1216AME_MK4, Philips FQ1216AME MK4},
+   { TUNER_PHILIPS_FQ1236A_MK4, Philips FQ1236A MK4},
{ TUNER_ABSENT,Philips FQ1286A MK4},
{ TUNER_ABSENT,Philips FQ1216ME MK5},
{ TUNER_ABSENT,Philips FQ1236 MK5},
+   { TUNER_ABSENT,Unspecified},
+   { TUNER_LG_PAL_TAPE,   LG PAL (TAPE Series)},
 };
 
 static char *sndtype[] = {
@@ -241,6 +244,7 @@ static int hasRadioTuner(int tunerType)
 case 61: //PNPEnv_TUNER_TAPE_M001D_MK3:
 case 78: //PNPEnv_TUNER_TDA8275C1_8290_FM:
 case 89: //PNPEnv_TUNER_TCL_MFPE05_2:
+case 92: //PNPEnv_TUNER_PHILIPS_FQ1236A_MK4:
 return 1;
 }
 return 0;
@@ -256,8 +260,8 @@ void tveeprom_hauppauge_analog(struct tv
** if packet[0]  f8 == f8, then EOD and packet[1] == checksum
**
** In our (ivtv) case we're interested in the following:
-   ** tuner type: tag [00].05 or [0a].01 (index into hauppauge_tuners)
-   ** tuner fmts: tag [00].04 or [0a].00 (bitmask index into 
hauppauge_fmts)
+   ** tuner type: tag [00].05 or [0a].01 (index into hauppauge_tuner)
+   ** tuner fmts: tag [00].04 or [0a].00 (bitmask index into 
hauppauge_tuner_fmt)
** radio:  tag [00].{last} or [0e].00  (bitmask.  bit2=FM)
** audio proc: tag [02].01 or [05].00 (lower nibble indexes lut?)
 
@@ -269,11 +273,11 @@ void tveeprom_hauppauge_analog(struct tv
** # of inputs/outputs ???
*/
 
-   int i, j, len, done, tag, tuner = 0, t_format = 0;
+   int i, j, len, done, beenhere, tag, tuner = 0, t_format = 0;
char *t_name = NULL, *t_fmt_name = NULL;
 
dprintk(1, %s\n,__FUNCTION__);
-   tvee-revision = done = len = 0;
+   tvee-revision = done = len = beenhere = 0;
for (i = 0; !done  i  256; i += len) {
dprintk(2, processing pos = %02x (%02x, %02x)\n,
i, eeprom_data[i], eeprom_data[i + 1]);
@@ -342,9 +346,14 @@ void tveeprom_hauppauge_analog(struct tv
(eeprom_data[i+7]  16);
break;
case 0x0a:
-   tuner = eeprom_data[i+2];
-   t_format = eeprom_data[i+1];
-   break;
+   if(beenhere == 0) {
+   tuner = eeprom_data[i+2];
+   t_format = eeprom_data[i+1];
+   beenhere = 1;
+   break;
+   } else {
+   break;
+   }
case 0x0e:
tvee-has_radio = eeprom_data[i+1];
break;

-- 
#define printk(args...) fprintf(stderr, ## args)
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[patch] v4l: tuner update

2005-03-08 Thread Gerd Knorr
Minor update for the tuner module:  Add some new entries,
fix a bug in the tda8290 driver.

Signed-off-by: Gerd Knorr [EMAIL PROTECTED]
---
 drivers/media/video/mt20xx.c   |3 ++-
 drivers/media/video/tda8290.c  |4 ++--
 drivers/media/video/tuner-simple.c |9 -
 include/media/tuner.h  |4 
 4 files changed, 16 insertions(+), 4 deletions(-)

Index: linux-2.6.11/include/media/tuner.h
===
--- linux-2.6.11.orig/include/media/tuner.h 2005-03-07 18:13:01.0 
+0100
+++ linux-2.6.11/include/media/tuner.h  2005-03-08 10:32:50.0 +0100
@@ -93,6 +93,10 @@
 #define TUNER_THOMSON_DTT761052
 #define TUNER_PHILIPS_FQ1286 53
 #define TUNER_PHILIPS_TDA829054
+#define TUNER_LG_PAL_TAPE55/* Hauppauge PVR-150 PAL */
+
+#define TUNER_PHILIPS_FQ1216AME_MK4 56 /* Hauppauge PVR-150 PAL */
+#define TUNER_PHILIPS_FQ1236A_MK4 57   /* Hauppauge PVR-500MCE NTSC */
 
 #define NOTUNER 0
 #define PAL 1  /* PAL_BG */
Index: linux-2.6.11/drivers/media/video/tuner-simple.c
===
--- linux-2.6.11.orig/drivers/media/video/tuner-simple.c2005-03-07 
18:13:01.0 +0100
+++ linux-2.6.11/drivers/media/video/tuner-simple.c 2005-03-08 
10:32:50.0 +0100
@@ -1,5 +1,5 @@
 /*
- * $Id: tuner-simple.c,v 1.4 2005/02/15 15:59:35 kraxel Exp $
+ * $Id: tuner-simple.c,v 1.10 2005/03/08 08:38:00 kraxel Exp $
  *
  * i2c tv tuner chip device driver
  * controls all those simple 4-control-bytes style tuners.
@@ -204,6 +204,13 @@ static struct tunertype tuners[] = {
  16*160.00,16*454.00,0x41,0x42,0x04,0x8e,940}, // UHF band untested
{ tda8290+75, Philips,PAL|NTSC,
  /* see tda8290.c for details */ },
+   { LG PAL (TAPE series), LGINNOTEK, PAL,
+  16*170.00, 16*450.00, 0x01,0x02,0x08,0xce,623},
+
+{ Philips PAL/SECAM multi (FQ1216AME MK4), Philips, PAL,
+  16*160.00,16*442.00,0x01,0x02,0x04,0xce,623 },
+{ Philips FQ1236A MK4, Philips, NTSC,
+  16*160.00,16*442.00,0x01,0x02,0x04,0x8e,732 },
 
 };
 unsigned const int tuner_count = ARRAY_SIZE(tuners);
Index: linux-2.6.11/drivers/media/video/mt20xx.c
===
--- linux-2.6.11.orig/drivers/media/video/mt20xx.c  2005-03-07 
18:13:01.0 +0100
+++ linux-2.6.11/drivers/media/video/mt20xx.c   2005-03-07 18:13:02.0 
+0100
@@ -1,5 +1,5 @@
 /*
- * $Id: mt20xx.c,v 1.3 2005/02/15 15:59:35 kraxel Exp $
+ * $Id: mt20xx.c,v 1.4 2005/03/04 09:24:56 kraxel Exp $
  *
  * i2c tv tuner chip device driver
  * controls microtune tuners, mt2032 + mt2050 at the moment.
@@ -7,6 +7,7 @@
 #include linux/delay.h
 #include linux/i2c.h
 #include linux/videodev.h
+#include linux/moduleparam.h
 #include media/tuner.h
 
 /* -- */
Index: linux-2.6.11/drivers/media/video/tda8290.c
===
--- linux-2.6.11.orig/drivers/media/video/tda8290.c 2005-03-07 
18:13:01.0 +0100
+++ linux-2.6.11/drivers/media/video/tda8290.c  2005-03-07 18:13:02.0 
+0100
@@ -1,5 +1,5 @@
 /*
- * $Id: tda8290.c,v 1.5 2005/02/15 15:59:35 kraxel Exp $
+ * $Id: tda8290.c,v 1.7 2005/03/07 12:01:51 kraxel Exp $
  *
  * i2c tv tuner chip device driver
  * controls the philips tda8290+75 tuner chip combo.
@@ -123,7 +123,7 @@ static int tda8290_tune(struct i2c_clien
struct i2c_msg easy_mode =
{ I2C_ADDR_TDA8290, 0, 2, t-i2c_easy_mode };
struct i2c_msg set_freq =
-   { I2C_ADDR_TDA8290, 0, 8, t-i2c_set_freq  };
+   { I2C_ADDR_TDA8275, 0, 8, t-i2c_set_freq  };
 
i2c_transfer(c-adapter, easy_mode,  1);
i2c_transfer(c-adapter, i2c_msg_prolog, ARRAY_SIZE(i2c_msg_prolog));

-- 
#define printk(args...) fprintf(stderr, ## args)
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[patch] v4l: documentation update.

2005-03-08 Thread Gerd Knorr
$subject says all ;)

Signed-off-by: Gerd Knorr [EMAIL PROTECTED]
---
 Documentation/video4linux/CARDLIST.saa7134 |   41 ++---
 Documentation/video4linux/README.cx88  |3 -
 Documentation/video4linux/bttv/Cards   |7 ++-
 Documentation/video4linux/bttv/README  |2 -
 4 files changed, 27 insertions(+), 26 deletions(-)

Index: linux-2.6.11/Documentation/video4linux/CARDLIST.saa7134
===
--- linux-2.6.11.orig/Documentation/video4linux/CARDLIST.saa7134
2005-03-07 10:12:23.0 +0100
+++ linux-2.6.11/Documentation/video4linux/CARDLIST.saa7134 2005-03-07 
16:36:47.0 +0100
@@ -6,29 +6,30 @@
   5 - SKNet Monster TV [1131:4e85]
   6 - Tevion MD 9717  
   7 - KNC One TV-Station RDS / Typhoon TV Tuner RDS [1131:fe01,1894:fe01]
-  8 - KNC One TV-Station DVR   [1894:a006]
-  9 - Terratec Cinergy 400 TV  [153B:1142]
- 10 - Medion 5044
- 11 - Kworld/KuroutoShikou SAA7130-TVPCI
- 12 - Terratec Cinergy 600 TV  [153B:1143]
- 13 - Medion 7134  [16be:0003]
- 14 - Typhoon TV+Radio 90031
- 15 - ELSA EX-VISION 300TV [1048:226b]
- 16 - ELSA EX-VISION 500TV [1048:226b]
- 17 - ASUS TV-FM 7134  [1043:4842,1043:4830,1043:4840]
- 18 - AOPEN VA1000 POWER   [1131:7133]
- 19 - 10MOONS PCI TV CAPTURE CARD  [1131:2001]
- 20 - BMK MPEX No Tuner
- 21 - Compro VideoMate TV  [185b:c100]
- 22 - Matrox CronosPlus[102B:48d0]
- 23 - Medion 2819/ AverMedia M156  [1461:a70b,1461:2115]
- 24 - BMK MPEX Tuner
+  8 - Terratec Cinergy 400 TV  [153B:1142]
+  9 - Medion 5044 
+ 10 - Kworld/KuroutoShikou SAA7130-TVPCI  
+ 11 - Terratec Cinergy 600 TV  [153B:1143]
+ 12 - Medion 7134  [16be:0003]
+ 13 - Typhoon TV+Radio 90031  
+ 14 - ELSA EX-VISION 300TV [1048:226b]
+ 15 - ELSA EX-VISION 500TV [1048:226b]
+ 16 - ASUS TV-FM 7134  [1043:4842,1043:4830,1043:4840]
+ 17 - AOPEN VA1000 POWER   [1131:7133]
+ 18 - BMK MPEX No Tuner   
+ 19 - Compro VideoMate TV  [185b:c100]
+ 20 - Matrox CronosPlus[102B:48d0]
+ 21 - 10MOONS PCI TV CAPTURE CARD  [1131:2001]
+ 22 - Medion 2819/ AverMedia M156  [1461:a70b,1461:2115]
+ 23 - BMK MPEX Tuner  
+ 24 - KNC One TV-Station DVR   [1894:a006]
  25 - ASUS TV-FM 7133  [1043:4843]
  26 - Pinnacle PCTV Stereo (saa7134)   [11bd:002b]
- 27 - Manli MuchTV M-TV002
- 28 - Manli MuchTV M-TV001
+ 27 - Manli MuchTV M-TV002
+ 28 - Manli MuchTV M-TV001
  29 - Nagase Sangyo TransGear 3000TV   [1461:050c]
  30 - Elitegroup ECS TVP3XP FM1216 Tuner Card(PAL-BG,FM)  [1019:4cb4]
  31 - Elitegroup ECS TVP3XP FM1236 Tuner Card (NTSC,FM) [1019:4cb5]
- 32 - AVACS SmartTV
+ 32 - AVACS SmartTV   
  33 - AVerMedia DVD EZMaker[1461:10ff]
+ 34 - LifeView FlyTV Platinum33 mini   [5168:0212]
Index: linux-2.6.11/Documentation/video4linux/bttv/README
===
--- linux-2.6.11.orig/Documentation/video4linux/bttv/README 2005-03-07 
10:12:37.0 +0100
+++ linux-2.6.11/Documentation/video4linux/bttv/README  2005-03-07 
16:36:47.0 +0100
@@ -22,7 +22,7 @@ very likely specified the wrong (or no) 
 cards is in CARDLIST.bttv
 
 If bttv takes very long to load (happens sometimes with the cheap
-cards which have no tuner), try adding this to your modprobe.conf:
+cards which have no tuner), try adding this to your modules.conf:
options i2c-algo-bit bit_test=1
 
 For the WinTV/PVR you need one firmware file from the driver CD:
Index: linux-2.6.11/Documentation/video4linux/README.cx88
===
--- linux-2.6.11.orig/Documentation/video4linux/README.cx88 2005-03-07 
10:13:25.0 +0100
+++ linux-2.6.11/Documentation/video4linux/README.cx88  2005-03-07 
16:36:47.0 +0100
@@ -11,9 +11,6 @@ current status
 video
- Basically works.
- Some minor image quality glitches.
-   - Red and blue are swapped sometimes for not-yet known
- reasons (seems to depend on the image size, try to resize
- your tv app window as workaround ...).
- For now only capture, overlay support isn't completed yet.
 
 audio
Index: linux-2.6.11/Documentation/video4linux/bttv/Cards
===
--- linux-2.6.11.orig

[patch] Videotext: use I2C_CLIENT_INSMOD macro

2005-03-08 Thread Gerd Knorr
Hi,

the patch below simplifies the videotext drivers saa5246a and saa5249 by
using the I2C_CLIENT_INSMOD macro.

Thanks to Kai Volkmar.

Michael

Signed-off-by: Michael Geng [EMAIL PROTECTED]
Signed-off-by: Gerd Knorr [EMAIL PROTECTED]
---
 drivers/media/video/saa5246a.c |   13 +
 drivers/media/video/saa5249.c  |   13 +
 2 files changed, 2 insertions(+), 24 deletions(-)

diff -u linux-2.6.11/drivers/media/video/saa5246a.c 
linux/drivers/media/video/saa5246a.c
--- linux-2.6.11/drivers/media/video/saa5246a.c Wed Mar  2 08:38:08 2005
+++ linux/drivers/media/video/saa5246a.cSun Mar  6 17:00:35 2005
@@ -65,18 +65,7 @@
 /* Addresses to scan */
 static unsigned short normal_i2c[]  = { I2C_ADDRESS, I2C_CLIENT_END };
 static unsigned short normal_i2c_range[] = { I2C_CLIENT_END };
-static unsigned short probe[2]  = { I2C_CLIENT_END, I2C_CLIENT_END };
-static unsigned short probe_range[2]= { I2C_CLIENT_END, I2C_CLIENT_END };
-static unsigned short ignore[2] = { I2C_CLIENT_END, 
I2C_CLIENT_END };
-static unsigned short ignore_range[2]   = { I2C_CLIENT_END, I2C_CLIENT_END };
-static unsigned short force[2]  = { I2C_CLIENT_END, I2C_CLIENT_END };
-
-static struct i2c_client_address_data addr_data = {
-   normal_i2c, normal_i2c_range,
-   probe, probe_range,
-   ignore, ignore_range,
-   force
-};
+I2C_CLIENT_INSMOD;
 
 static struct i2c_client client_template;
 
diff -u linux-2.6.11/drivers/media/video/saa5249.c 
linux/drivers/media/video/saa5249.c
--- linux-2.6.11/drivers/media/video/saa5249.c  Wed Mar  2 08:38:17 2005
+++ linux/drivers/media/video/saa5249.c Sun Mar  6 17:01:35 2005
@@ -133,18 +133,7 @@
 /* Addresses to scan */
 static unsigned short normal_i2c[] = {341,I2C_CLIENT_END};
 static unsigned short normal_i2c_range[] = {I2C_CLIENT_END};
-static unsigned short probe[2]= { I2C_CLIENT_END, I2C_CLIENT_END };
-static unsigned short probe_range[2]  = { I2C_CLIENT_END, I2C_CLIENT_END };
-static unsigned short ignore[2]   = { I2C_CLIENT_END, I2C_CLIENT_END };
-static unsigned short ignore_range[2] = { I2C_CLIENT_END, I2C_CLIENT_END };
-static unsigned short force[2]= { I2C_CLIENT_END, I2C_CLIENT_END };
-
-static struct i2c_client_address_data addr_data = {
-   normal_i2c, normal_i2c_range, 
-   probe, probe_range, 
-   ignore, ignore_range, 
-   force
-};
+I2C_CLIENT_INSMOD;
 
 static struct i2c_client client_template;
 
Common subdirectories: linux-2.6.11/drivers/media/video/saa7134 and 
linux/drivers/media/video/saa7134

-- 
#define printk(args...) fprintf(stderr, ## args)
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[patch] dvb: add pll lib

2005-03-08 Thread Gerd Knorr
  Hi,

This adds some helper code to handle tuning for dvb cards,
with a struct describing the pll and a function calculating
the command sequence needed to program it.

This one was discussed + accepted on the linuxtv list and
also is in the linuxtv cvs.  As the the cx88 driver update
I want finally get out of the door depends on this one I'll
go submit it myself instead of waiting for the dvb guys doing
it.

  Gerd

Signed-off-by: Gerd Knorr [EMAIL PROTECTED]
---
 drivers/media/dvb/frontends/Makefile  |1 
 drivers/media/dvb/frontends/dvb-pll.c |  168 ++
 drivers/media/dvb/frontends/dvb-pll.h |   34 +
 3 files changed, 203 insertions(+)

Index: linux-2.6.11-rc4/drivers/media/dvb/frontends/Makefile
===
--- linux-2.6.11-rc4.orig/drivers/media/dvb/frontends/Makefile  2005-02-14 
15:21:59.0 +0100
+++ linux-2.6.11-rc4/drivers/media/dvb/frontends/Makefile   2005-02-15 
12:31:40.0 +0100
@@ -4,6 +4,7 @@
 
 EXTRA_CFLAGS = -Idrivers/media/dvb/dvb-core/
 
+obj-$(CONFIG_DVB_CORE) += dvb-pll.o
 obj-$(CONFIG_DVB_STV0299) += stv0299.o
 obj-$(CONFIG_DVB_SP8870) += sp8870.o
 obj-$(CONFIG_DVB_CX22700) += cx22700.o
Index: linux-2.6.11-rc4/drivers/media/dvb/frontends/dvb-pll.c
===
--- /dev/null   1970-01-01 00:00:00.0 +
+++ linux-2.6.11-rc4/drivers/media/dvb/frontends/dvb-pll.c  2005-02-15 
12:31:51.0 +0100
@@ -0,0 +1,168 @@
+/*
+ * $Id: dvb-pll.c,v 1.7 2005/02/10 11:52:02 kraxel Exp $
+ *
+ * descriptions + helper functions for simple dvb plls.
+ *
+ * (c) 2004 Gerd Knorr [EMAIL PROTECTED] [SuSE Labs]
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include linux/module.h
+#include linux/dvb/frontend.h
+#include asm/types.h
+
+#include dvb-pll.h
+
+/* --- */
+/* descriptions*/
+
+struct dvb_pll_desc dvb_pll_thomson_dtt7579 = {
+   .name  = Thomson dtt7579,
+   .min   = 17700,
+   .max   = 85800,
+   .count = 5,
+   .entries = {
+   {  0, 3617, 16, 0xb4, 0x03 }, /* go sleep */
+   {  44325, 3617, 16, 0xb4, 0x02 },
+   {  54200, 3617, 16, 0xb4, 0x08 },
+   {  77100, 3617, 16, 0xbc, 0x08 },
+   {  9, 3617, 16, 0xf4, 0x08 },
+   },
+};
+EXPORT_SYMBOL(dvb_pll_thomson_dtt7579);
+
+struct dvb_pll_desc dvb_pll_thomson_dtt7610 = {
+   .name  = Thomson dtt7610,
+   .min   =  4400,
+   .max   = 95800,
+   .count = 3,
+   .entries = {
+   { 15725, 4400, 62500, 0x8e, 0x39 },
+   { 45400, 4400, 62500, 0x8e, 0x3a },
+   { 9, 4400, 62500, 0x8e, 0x3c },
+   },
+};
+EXPORT_SYMBOL(dvb_pll_thomson_dtt7610);
+
+static void thomson_dtt759x_bw(u8 *buf, int bandwidth)
+{
+   if (BANDWIDTH_7_MHZ == bandwidth)
+   buf[3] |= 0x10;
+}
+
+struct dvb_pll_desc dvb_pll_thomson_dtt759x = {
+   .name  = Thomson dtt759x,
+   .min   = 17700,
+   .max   = 89600,
+   .setbw = thomson_dtt759x_bw,
+   .count = 6,
+   .entries = {
+   {  0, 3617, 16, 0x84, 0x03 },
+   {  26400, 3617, 16, 0xb4, 0x02 },
+   {  47000, 3617, 16, 0xbc, 0x02 },
+   {  73500, 3617, 16, 0xbc, 0x08 },
+   {  83500, 3617, 16, 0xf4, 0x08 },
+   {  9, 3617, 16, 0xfc, 0x08 },
+   },
+};
+EXPORT_SYMBOL(dvb_pll_thomson_dtt759x);
+
+struct dvb_pll_desc dvb_pll_lg_z201 = {
+   .name  = LG z201,
+   .min   = 17400,
+   .max   = 86200,
+   .count = 5,
+   .entries = {
+   {  0, 3617, 16, 0xbc, 0x03 },
+   {  44325, 3617, 16, 0xbc, 0x01 },
+   {  54200, 3617, 16, 0xbc, 0x02 },
+   {  83000, 3617, 16, 0xf4, 0x02 },
+   {  9, 3617, 16, 0xfc, 0x02 },
+   },
+};
+EXPORT_SYMBOL(dvb_pll_lg_z201);
+
+struct dvb_pll_desc

[patch] dvb: mt352 frontend driver update

2005-03-08 Thread Gerd Knorr
  Hi,

This patch updates the mt352 driver to make it work with the Pinnacle
300i card.  Some values are calculated at runtime now instead of having
hard-coded defaults because the defaults don't fit for the Pinnacle, and
some more small tweaks + fixes.

This was also discussed + accepted on the dvb list, going to submit
directly because the saa7134 driver update depends on this.

  Gerd

Signed-off-by: Gerd Knorr [EMAIL PROTECTED]
---
 drivers/media/dvb/frontends/mt352.c |  197 ++--
 drivers/media/dvb/frontends/mt352.h |   15 +-
 2 files changed, 144 insertions(+), 68 deletions(-)

Index: linux-2.6.11-rc3/drivers/media/dvb/frontends/mt352.h
===
--- linux-2.6.11-rc3.orig/drivers/media/dvb/frontends/mt352.h   2005-02-04 
11:26:50.0 +0100
+++ linux-2.6.11-rc3/drivers/media/dvb/frontends/mt352.h2005-02-04 
12:48:31.924889857 +0100
@@ -40,6 +40,13 @@ struct mt352_config
/* the demodulator's i2c address */
u8 demod_address;
 
+   /* frequencies in kHz */
+   int adc_clock;  // default: 20480
+   int if2;// default: 36166
+
+   /* set if no pll is connected to the secondary i2c bus */
+   int no_tuner;
+
/* Initialise the demodulator and PLL. Cannot be NULL */
int (*demod_init)(struct dvb_frontend* fe);
 
@@ -54,6 +61,12 @@ extern struct dvb_frontend* mt352_attach
 struct i2c_adapter* i2c);
 
 extern int mt352_write(struct dvb_frontend* fe, u8* ibuf, int ilen);
-extern u8 mt352_read(struct dvb_frontend *fe, u8 reg);
+extern int mt352_read(struct dvb_frontend *fe, u8 reg);
 
 #endif // MT352_H
+
+/*
+ * Local variables:
+ * c-basic-offset: 8
+ * End:
+ */
Index: linux-2.6.11-rc3/drivers/media/dvb/frontends/mt352.c
===
--- linux-2.6.11-rc3.orig/drivers/media/dvb/frontends/mt352.c   2005-02-04 
11:23:23.0 +0100
+++ linux-2.6.11-rc3/drivers/media/dvb/frontends/mt352.c2005-02-04 
12:49:21.800514554 +0100
@@ -41,13 +41,12 @@
 #include mt352.h
 
 struct mt352_state {
-
struct i2c_adapter* i2c;
-
struct dvb_frontend_ops ops;
 
/* configuration settings */
const struct mt352_config* config;
+   int s0,s1,s3;
 
struct dvb_frontend frontend;
 };
@@ -66,23 +65,23 @@ static int mt352_single_write(struct dvb
   .buf = buf, .len = 2 };
int err = i2c_transfer(state-i2c, msg, 1);
if (err != 1) {
-   dprintk(mt352_write() to reg %x failed (err = %d)!\n, reg, 
err);
+   printk(mt352_write() to reg %x failed (err = %d)!\n, reg, 
err);
return err;
-}
-   return 0; 
+   }
+   return 0;
 }
 
 int mt352_write(struct dvb_frontend* fe, u8* ibuf, int ilen)
 {
int err,i;
for (i=0; i  ilen-1; i++)
-   if ((err = mt352_single_write(fe,ibuf[0]+i,ibuf[i+1]))) 
+   if ((err = mt352_single_write(fe,ibuf[0]+i,ibuf[i+1])))
return err;
 
return 0;
 }
 
-static u8 mt352_read_register(struct mt352_state* state, u8 reg)
+static int mt352_read_register(struct mt352_state* state, u8 reg)
 {
int ret;
u8 b0 [] = { reg };
@@ -96,41 +95,87 @@ static u8 mt352_read_register(struct mt3
 
ret = i2c_transfer(state-i2c, msg, 2);
 
-   if (ret != 2)
-   dprintk(%s: readreg error (ret == %i)\n, __FUNCTION__, ret);
+   if (ret != 2) {
+   printk(%s: readreg error (reg=%d, ret==%i)\n,
+  __FUNCTION__, reg, ret);
+   return ret;
+   }
 
return b1[0];
 }
 
-u8 mt352_read(struct dvb_frontend *fe, u8 reg)
+int mt352_read(struct dvb_frontend *fe, u8 reg)
 {
return mt352_read_register(fe-demodulator_priv,reg);
 }
 
-
-
-
-
-
-
-
 static int mt352_sleep(struct dvb_frontend* fe)
 {
static u8 mt352_softdown[] = { CLOCK_CTL, 0x20, 0x08 };
 
mt352_write(fe, mt352_softdown, sizeof(mt352_softdown));
-
return 0;
 }
 
+static void mt352_calc_nominal_rate(struct mt352_state* state,
+   enum fe_bandwidth bandwidth,
+   unsigned char *buf)
+{
+   u32 adc_clock = 20480; /* 20.340 MHz */
+   u32 bw,value;
+
+   switch (bandwidth) {
+   case BANDWIDTH_6_MHZ:
+   bw = 6;
+   break;
+   case BANDWIDTH_7_MHZ:
+   bw = 7;
+   break;
+   case BANDWIDTH_8_MHZ:
+   default:
+   bw = 8;
+   break;
+   }
+   if (state-config-adc_clock)
+   adc_clock = state-config-adc_clock;
+
+   value = 64 * bw * (116) / (7 * 8);
+   value = value * 1000 / adc_clock;
+   dprintk(%s: bw %d, adc_clock %d = 0x%x\n,
+   __FUNCTION__, bw, adc_clock, value);
+   buf[0] = msb(value

[patch] v4l2 api: mpeg encoder support

2005-03-08 Thread Gerd Knorr
Add a ioctl to set mpeg hardware encoder parameters.

Signed-off-by: Gerd Knorr [EMAIL PROTECTED]
---
 include/linux/videodev2.h |  136 ++
 1 files changed, 82 insertions(+), 54 deletions(-)

Index: linux-2.6.11-rc4/include/linux/videodev2.h
===
--- linux-2.6.11-rc4.orig/include/linux/videodev2.h 2005-02-14 
15:24:05.0 +0100
+++ linux-2.6.11-rc4/include/linux/videodev2.h  2005-02-15 12:37:28.0 
+0100
@@ -268,64 +268,92 @@ struct v4l2_timecode
 /* The above is based on SMPTE timecodes */
 
 
+#if 1
 /*
- * C O M P R E S S I O N   P A R A M E T E R S
+ * M P E G   C O M P R E S S I O N   P A R A M E T E R S
+ *
+ *  ### WARNING: this is still work-in-progress right now, most likely
+ *  ###  there will be some incompatible changes.
+ *
  */
-#if 0
-/* ### generic compression settings don't work, there is too much
- * ### codec-specific stuff.  Maybe reuse that for MPEG codec settings
- * ### later ... */
-struct v4l2_compression
-{
-   __u32   quality;
-   __u32   keyframerate;
-   __u32   pframerate;
-   __u32   reserved[5];
 
-/*  what we'll need for MPEG, extracted from some postings on
-the v4l list (Gert Vervoort, PlasmaJohn).
 
-system stream:
-  - type: elementary stream(ES), packatised elementary stream(s) (PES)
-program stream(PS), transport stream(TS)
-  - system bitrate
-  - PS packet size (DVD: 2048 bytes, VCD: 2324 bytes)
-  - TS video PID
-  - TS audio PID
-  - TS PCR PID
-  - TS system information tables (PAT, PMT, CAT, NIT and SIT)
-  - (MPEG-1 systems stream vs. MPEG-2 program stream (TS not supported
-by MPEG-1 systems)
+enum v4l2_bitrate_mode {
+   V4L2_BITRATE_NONE = 0,  /* not specified */
+   V4L2_BITRATE_CBR,   /* constant bitrate */
+   V4L2_BITRATE_VBR,   /* variable bitrate */
+};
+struct v4l2_bitrate {
+   /* rates are specified in kbit/sec */
+   enum v4l2_bitrate_mode  mode;
+   __u32   min;
+   __u32   target;  /* use this one for CBR */
+   __u32   max;
+};
 
-audio:
-  - type: MPEG (+Layer I,II,III), AC-3, LPCM
-  - bitrate
-  - sampling frequency (DVD: 48 Khz, VCD: 44.1 KHz, 32 kHz)
-  - Trick Modes? (ff, rew)
-  - Copyright
-  - Inverse Telecine
+enum v4l2_mpeg_streamtype {
+   V4L2_MPEG_SS_1, /* MPEG-1 system stream */
+   V4L2_MPEG_PS_2, /* MPEG-2 program stream */
+   V4L2_MPEG_TS_2, /* MPEG-2 transport stream */
+   V4L2_MPEG_PS_DVD,   /* MPEG-2 program stream with DVD header fixups 
*/
+};
+enum v4l2_mpeg_audiotype {
+   V4L2_MPEG_AU_2_I,   /* MPEG-2 layer 1 */
+   V4L2_MPEG_AU_2_II,  /* MPEG-2 layer 2 */
+   V4L2_MPEG_AU_2_III, /* MPEG-2 layer 3 */
+   V4L2_MPEG_AC3,  /* AC3 */
+   V4L2_MPEG_LPCM, /* LPCM */
+};
+enum v4l2_mpeg_videotype {
+   V4L2_MPEG_VI_1, /* MPEG-1 */
+   V4L2_MPEG_VI_2, /* MPEG-2 */
+};
+enum v4l2_mpeg_aspectratio {
+   V4L2_MPEG_ASPECT_SQUARE = 1,   /* square pixel */
+   V4L2_MPEG_ASPECT_4_3= 2,   /*  4 : 3   */
+   V4L2_MPEG_ASPECT_16_9   = 3,   /* 16 : 9   */
+   V4L2_MPEG_ASPECT_1_221  = 4,   /*  1 : 2,21*/
+};
 
-video:
-  - picturesize (SIF, 1/2 D1, 2/3 D1, D1) and PAL/NTSC norm can be set
-through excisting V4L2 controls
-  - noise reduction, parameters encoder specific?
-  - MPEG video version: MPEG-1, MPEG-2
-  - GOP (Group Of Pictures) definition:
-- N: number of frames per GOP
-- M: distance between reference (I,P) frames
-- open/closed GOP
-  - quantiser matrix: inter Q matrix (64 bytes) and intra Q matrix (64 bytes)
-  - quantiser scale: linear or logarithmic
-  - scanning: alternate or zigzag
-  - bitrate mode: CBR (constant bitrate) or VBR (variable bitrate).
-  - target video bitrate for CBR
-  - target video bitrate for VBR
-  - maximum video bitrate for VBR - min. quantiser value for VBR
-  - max. quantiser value for VBR
-  - adaptive quantisation value
-  - return the number of bytes per GOP or bitrate for bitrate monitoring
+struct v4l2_mpeg_compression {
+   /* general */
+   enum v4l2_mpeg_streamtype   st_type;
+   struct v4l2_bitrate st_bitrate;
 
-*/
+   /* transport streams */
+   __u16   ts_pid_pmt;
+   __u16   ts_pid_audio;
+   __u16   ts_pid_video;
+   __u16   ts_pid_pcr;
+
+   /* program stream */
+   __u16   ps_size;
+   __u16   reserved_1;/* align */
+
+   /* audio */
+   enum v4l2_mpeg_audiotypeau_type;
+   struct v4l2_bitrate au_bitrate;
+   __u32   au_sample_rate;
+   __u8au_pesid;
+   __u8

[patch] dvb: add or51132 driver (atsc demodulator)

2005-03-08 Thread Gerd Knorr
  Hi,

This patch adds a new ATSC frontend driver, needed by the cx88-based
pcHDTV 3000 card.  Also includes a tiny chunk to activate the or51132
support in the cx88-dvb driver.

This patch depends on the cx88 dvb driver update.

  Gerd

Signed-off-by: Gerd Knorr [EMAIL PROTECTED]
---
 drivers/media/dvb/frontends/Kconfig   |4 
 drivers/media/dvb/frontends/Makefile  |2 
 drivers/media/dvb/frontends/or51132.c |  628 ++
 drivers/media/dvb/frontends/or51132.h |   48 +
 drivers/media/video/Kconfig   |1 
 drivers/media/video/cx88/cx88-dvb.c   |2 
 6 files changed, 683 insertions(+), 2 deletions(-)

Index: linux-2.6.11/drivers/media/dvb/frontends/or51132.h
===
--- /dev/null   1970-01-01 00:00:00.0 +
+++ linux-2.6.11/drivers/media/dvb/frontends/or51132.h  2005-03-07 
16:31:12.0 +0100
@@ -0,0 +1,48 @@
+/*
+ *Support for OR51132 (pcHDTV HD-3000) - VSB/QAM
+ *
+ *Copyright (C) 2005 Kirk Lapray [EMAIL PROTECTED]
+ *
+ *This program is free software; you can redistribute it and/or modify
+ *it under the terms of the GNU General Public License as published by
+ *the Free Software Foundation; either version 2 of the License, or
+ *(at your option) any later version.
+ *
+ *This program is distributed in the hope that it will be useful,
+ *but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *GNU General Public License for more details.
+ *
+ *You should have received a copy of the GNU General Public License
+ *along with this program; if not, write to the Free Software
+ *Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+*/
+
+#ifndef OR51132_H
+#define OR51132_H
+
+#include linux/firmware.h
+#include linux/dvb/frontend.h
+
+struct or51132_config
+{
+   /* The demodulator's i2c address */
+   u8 demod_address;
+   u8 pll_address;
+   struct dvb_pll_desc *pll_desc;
+
+   /* Need to set device param for start_dma */
+   int (*set_ts_params)(struct dvb_frontend* fe, int is_punctured);
+};
+
+extern struct dvb_frontend* or51132_attach(const struct or51132_config* config,
+  struct i2c_adapter* i2c);
+
+#endif // OR51132_H
+
+/*
+ * Local variables:
+ * c-basic-offset: 8
+ * End:
+ */
Index: linux-2.6.11/drivers/media/dvb/frontends/or51132.c
===
--- /dev/null   1970-01-01 00:00:00.0 +
+++ linux-2.6.11/drivers/media/dvb/frontends/or51132.c  2005-03-07 
16:31:12.0 +0100
@@ -0,0 +1,628 @@
+/*
+ *Support for OR51132 (pcHDTV HD-3000) - VSB/QAM
+ *
+ *Copyright (C) 2005 Kirk Lapray [EMAIL PROTECTED]
+ *
+ *Based on code from Jack Kelliher ([EMAIL PROTECTED])
+ *   Copyright (C) 2002  pcHDTV, inc.
+ *
+ *This program is free software; you can redistribute it and/or modify
+ *it under the terms of the GNU General Public License as published by
+ *the Free Software Foundation; either version 2 of the License, or
+ *(at your option) any later version.
+ *
+ *This program is distributed in the hope that it will be useful,
+ *but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *GNU General Public License for more details.
+ *
+ *You should have received a copy of the GNU General Public License
+ *along with this program; if not, write to the Free Software
+ *Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+*/
+
+/*
+ * This driver needs two external firmware files. Please copy
+ * dvb-fe-or51132-vsb.fw and dvb-fe-or51132-qam.fw to
+ * /usr/lib/hotplug/firmware/ or /lib/firmware/
+ * (depending on configuration of firmware hotplug).
+ */
+#define OR51132_VSB_FIRMWARE dvb-fe-or51132-vsb.fw
+#define OR51132_QAM_FIRMWARE dvb-fe-or51132-qam.fw
+
+#include linux/kernel.h
+#include linux/module.h
+#include linux/moduleparam.h
+#include linux/init.h
+#include linux/delay.h
+#include asm/byteorder.h
+
+#include dvb_frontend.h
+#include dvb-pll.h
+#include or51132.h
+
+static int debug;
+#define dprintk(args...) \
+   do { \
+   if (debug) printk(KERN_DEBUG or51132:  args); \
+   } while (0)
+
+
+struct or51132_state
+{
+   struct i2c_adapter* i2c;
+   struct dvb_frontend_ops ops;
+
+   /* Configuration settings */
+   const struct or51132_config* config;
+
+   struct dvb_frontend frontend;
+   
+   /* Demodulator private data */
+   fe_modulation_t current_modulation;
+
+   /* Tuner private data */
+   u32 current_frequency;
+};
+
+static int i2c_writebytes (struct or51132_state* state, u8 reg, u8 *buf, int 
len)
+{
+   int err;
+   struct i2c_msg msg;
+   msg.addr  = reg;
+   msg.flags

[patch] v4l: MAINTAINERS file update.

2005-03-08 Thread Gerd Knorr
  Hi folks,

Goodbye, and that thanks for all the fish ;)

After several years of v4l maintainance I'm going to switch
to a new work field and will not be able to spend much time
on maintaining video4linux and the drivers, so someone else
will have to step in.

I will not suddenly disappear from earth, I will be available
for questions and patch reviews for some time, but I'll stop
doing active development and most likely will not have the
time to act as central patch relay for all video4linux stuff.

cheers,

  Gerd

Signed-off-by: Gerd Knorr [EMAIL PROTECTED]
---
 MAINTAINERS |5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

Index: linux-2.6.11/MAINTAINERS
===
--- linux-2.6.11.orig/MAINTAINERS   2005-03-07 10:14:21.0 +0100
+++ linux-2.6.11/MAINTAINERS2005-03-07 18:13:48.0 +0100
@@ -501,7 +501,7 @@ P:  Gerd Knorr
 M: [EMAIL PROTECTED]
 L: video4linux-list@redhat.com
 W: http://bytesex.org/bttv/
-S: Maintained
+S: Orphan
 
 BUSLOGIC SCSI DRIVER
 P: Leonard N. Zubkoff
@@ -2534,7 +2534,8 @@ S:Maintained
 VIDEO FOR LINUX
 P: Gerd Knorr
 M: [EMAIL PROTECTED]
-S: Maintained
+L: video4linux-list@redhat.com
+S: Orphan
 
 W1 DALLAS'S 1-WIRE BUS
 P: Evgeniy Polyakov

-- 
#define printk(args...) fprintf(stderr, ## args)
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [patch] add scsi changer driver

2005-03-07 Thread Gerd Knorr
On Sun, Mar 06, 2005 at 07:55:25PM +0200, James Bottomley wrote:
> Looking through this, the only things I really noticed that need work
> are:
> 
> ch_do_scsi():  It looks like this has an effective reimplementation of
> scsi_wait_req.  We're trying to deprecate the usage of scsi_do_req so we
> can make it private eventually.  What's the reason you can't use
> scsi_wait_req?

Probably historical reasons, I havn't tracked the scsi layer changes for
quite some time, so this might simply be a 2.6 cleanup I've missed
because of that.  Will check ...

> ch_ioctl() (and the compat): since this is a new driver, can't this all
> be done via sysfs?  That way, the user would be able to manipulate it
> from the command line, and we'd no longer need any of the 32->64 compat
> glue.

Well, it isn't new, it already exists for many years, just not living in
mainline (which I finally want to change now ...).

  Gerd

-- 
#define printk(args...) fprintf(stderr, ## args)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [patch] add scsi changer driver

2005-03-07 Thread Gerd Knorr
On Sun, Mar 06, 2005 at 07:55:25PM +0200, James Bottomley wrote:
 Looking through this, the only things I really noticed that need work
 are:
 
 ch_do_scsi():  It looks like this has an effective reimplementation of
 scsi_wait_req.  We're trying to deprecate the usage of scsi_do_req so we
 can make it private eventually.  What's the reason you can't use
 scsi_wait_req?

Probably historical reasons, I havn't tracked the scsi layer changes for
quite some time, so this might simply be a 2.6 cleanup I've missed
because of that.  Will check ...

 ch_ioctl() (and the compat): since this is a new driver, can't this all
 be done via sysfs?  That way, the user would be able to manipulate it
 from the command line, and we'd no longer need any of the 32-64 compat
 glue.

Well, it isn't new, it already exists for many years, just not living in
mainline (which I finally want to change now ...).

  Gerd

-- 
#define printk(args...) fprintf(stderr, ## args)
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: 2.6.11 vs DVB cx88 stuffs

2005-03-04 Thread Gerd Knorr
On Fri, Mar 04, 2005 at 02:39:17AM -0500, Dave Jones wrote:
> On Thu, Mar 03, 2005 at 11:17:16PM -0800, Andrew Morton wrote:
> 
>  > >  The reason this wasn't picked up is that neither `make allyesconfig' or
>  > >  `make allmodconfig' enables CONFIG_VIDEO_CX88_DVB or
>  > >  CONFIG_VIDEO_CX88_DVB_MODULE.
>  > >
>  > >  For coverage purposes it would be excellent to fix that up too, please.
>  > 
>  > Wise words, those.
> 
> It's dependant on CONFIG_BROKEN. Remove that, and allmodconfig should pick it 
> up.

It's tagged broken _because_ it doesn't build yet.  I've patches in the
queue, they depend on some dvb updates through, and I'm bugging the
linuxtv guys at the moment to push updates, so I can submit my stuff as
well.  The build failure and the CONFIG_BROKEN will go away then.

There is no point in fixing the build now somehow because that wouldn't
make the driver actually work ...

  Gerd

-- 
#define printk(args...) fprintf(stderr, ## args)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: 2.6.11 vs DVB cx88 stuffs

2005-03-04 Thread Gerd Knorr
On Fri, Mar 04, 2005 at 02:39:17AM -0500, Dave Jones wrote:
 On Thu, Mar 03, 2005 at 11:17:16PM -0800, Andrew Morton wrote:
 
 The reason this wasn't picked up is that neither `make allyesconfig' or
 `make allmodconfig' enables CONFIG_VIDEO_CX88_DVB or
 CONFIG_VIDEO_CX88_DVB_MODULE.
   
 For coverage purposes it would be excellent to fix that up too, please.
   
   Wise words, those.
 
 It's dependant on CONFIG_BROKEN. Remove that, and allmodconfig should pick it 
 up.

It's tagged broken _because_ it doesn't build yet.  I've patches in the
queue, they depend on some dvb updates through, and I'm bugging the
linuxtv guys at the moment to push updates, so I can submit my stuff as
well.  The build failure and the CONFIG_BROKEN will go away then.

There is no point in fixing the build now somehow because that wouldn't
make the driver actually work ...

  Gerd

-- 
#define printk(args...) fprintf(stderr, ## args)
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Potentially dead bttv cards from 2.6.10

2005-03-01 Thread Gerd Knorr
> I did notice one strange thing though; the card= option is only applied 
> to the first bttv card.  All remaining cards in the system are still 
> autodetected (which ends up assuming card=0 in my case).  Not sure if 
> this is the intended behavior or not, since someone really could run two 
> different bttv cards in the same system.

Intentional.  Try "insmd bttv card=3,4" ...

  Gerd

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Potentially dead bttv cards from 2.6.10

2005-03-01 Thread Gerd Knorr
James Bruce <[EMAIL PROTECTED]> writes:

> If you could suggest a very well tested kernel for bttv (2.6.9?),

What do you expect?  With just one single report and not remotely
being clear what exactly caused it ...

> I've heard that there is some way to dump eeproms; Is there a way to
> write them also?

Yes, you can.  That works only if you can still talk to it though.

> If I could copy the eeprom from the unused cards to the (now broken)
> pair that might fix things.

No.  It's not accessable, not just the content scrambled.

  Gerd
 
-- 
#define printk(args...) fprintf(stderr, ## args)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Potentially dead bttv cards from 2.6.10

2005-03-01 Thread Gerd Knorr
James Bruce [EMAIL PROTECTED] writes:

 If you could suggest a very well tested kernel for bttv (2.6.9?),

What do you expect?  With just one single report and not remotely
being clear what exactly caused it ...

 I've heard that there is some way to dump eeproms; Is there a way to
 write them also?

Yes, you can.  That works only if you can still talk to it though.

 If I could copy the eeprom from the unused cards to the (now broken)
 pair that might fix things.

No.  It's not accessable, not just the content scrambled.

  Gerd
 
-- 
#define printk(args...) fprintf(stderr, ## args)
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Potentially dead bttv cards from 2.6.10

2005-03-01 Thread Gerd Knorr
 I did notice one strange thing though; the card= option is only applied 
 to the first bttv card.  All remaining cards in the system are still 
 autodetected (which ends up assuming card=0 in my case).  Not sure if 
 this is the intended behavior or not, since someone really could run two 
 different bttv cards in the same system.

Intentional.  Try insmd bttv card=3,4 ...

  Gerd

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Potentially dead bttv cards from 2.6.10

2005-02-28 Thread Gerd Knorr
> I remember something about that you shouldn't use the teletext-decoder
> at the same time as viewing regular tv. That would damage the eeprom.
> Maybe it is related?

No.  Thats (a) very old and about two drivers banging on the bt848 card
at the same time, where the second doesn't even exist for 2.4 any more I
think.  And (b) damage in that case means "write random bytes to it",
which is a very different issue.  You can still read it in that case.

  Gerd

-- 
#define printk(args...) fprintf(stderr, ## args)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Potentially dead bttv cards from 2.6.10

2005-02-28 Thread Gerd Knorr
James Bruce <[EMAIL PROTECTED]> writes:

> Well, are there any theories as to why it would work flawlessly, then
> after a hard lockup (due to what I think is a buggy V4L2 application),
> that the cards no longer work?

No idea why the eeprom doesn't respond any more.  Maybe it's really
broken.  Note that the eeprom is read only at insmod time (and even
that for some cards only), thus there isn't a clear connection between
the crash and the eeprom issue.  It could have died earlied unnoticed.

The eeprom holds the PCI Subsystem ID, so without a working eeprom
bttv can't figure automatically what exact card that is (see the
"unknown/default" card name in the log) and maybe thats why does not
work any more for the card in question.  Thats should be easily
fixable using the card= insmod option.

  Gerd

-- 
#define printk(args...) fprintf(stderr, ## args)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Potentially dead bttv cards from 2.6.10

2005-02-28 Thread Gerd Knorr
On Fri, Feb 25, 2005 at 11:57:49PM -0500, James Bruce wrote:
> Hi I've read elsewhere that the following message:
>   "tveeprom(bttv internal): Huh, no eeprom present (err=-121)?"
> Means that a bttv card is dead.

Or i2c communication to the eeprom failed.  There used to be some -mm
kernels with experimental i2c stuff causing this ...

  Gerd

-- 
#define printk(args...) fprintf(stderr, ## args)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Potentially dead bttv cards from 2.6.10

2005-02-28 Thread Gerd Knorr
On Fri, Feb 25, 2005 at 11:57:49PM -0500, James Bruce wrote:
 Hi I've read elsewhere that the following message:
   tveeprom(bttv internal): Huh, no eeprom present (err=-121)?
 Means that a bttv card is dead.

Or i2c communication to the eeprom failed.  There used to be some -mm
kernels with experimental i2c stuff causing this ...

  Gerd

-- 
#define printk(args...) fprintf(stderr, ## args)
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Potentially dead bttv cards from 2.6.10

2005-02-28 Thread Gerd Knorr
James Bruce [EMAIL PROTECTED] writes:

 Well, are there any theories as to why it would work flawlessly, then
 after a hard lockup (due to what I think is a buggy V4L2 application),
 that the cards no longer work?

No idea why the eeprom doesn't respond any more.  Maybe it's really
broken.  Note that the eeprom is read only at insmod time (and even
that for some cards only), thus there isn't a clear connection between
the crash and the eeprom issue.  It could have died earlied unnoticed.

The eeprom holds the PCI Subsystem ID, so without a working eeprom
bttv can't figure automatically what exact card that is (see the
unknown/default card name in the log) and maybe thats why does not
work any more for the card in question.  Thats should be easily
fixable using the card= insmod option.

  Gerd

-- 
#define printk(args...) fprintf(stderr, ## args)
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Potentially dead bttv cards from 2.6.10

2005-02-28 Thread Gerd Knorr
 I remember something about that you shouldn't use the teletext-decoder
 at the same time as viewing regular tv. That would damage the eeprom.
 Maybe it is related?

No.  Thats (a) very old and about two drivers banging on the bt848 card
at the same time, where the second doesn't even exist for 2.4 any more I
think.  And (b) damage in that case means write random bytes to it,
which is a very different issue.  You can still read it in that case.

  Gerd

-- 
#define printk(args...) fprintf(stderr, ## args)
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [patch] add scsi changer driver

2005-02-16 Thread Gerd Knorr
> > +#include 
> not needed.
> > +#include 
> I doubt you'll need this one.

Dropped.

> > +#define MAJOR_NR   SCSI_CHANGER_MAJOR
> please kill this one

Done.

> > +#include "scsi.h"
> never use this header but always the 

Done.

> > +MODULE_SUPPORTED_DEVICE("sch");
> no needed thsese days

Dropped.

> > +static int ioctl32_register(void)
> > +{
> 
> please implement ->compat_ioctl instead.

Done.

> > +   sr = scsi_allocate_request(ch->device, GFP_ATOMIC);
> 
> wouldn't a GFP_KERNEL do just fine?

Yes (there was another one of this ...).
Fixed.

> > +   if (NULL == sr)
> > +   return -ENOMEM;
> 
> normal kernel style would be
> 
>   if (!s)
>   return -ENOMEM;

Well, I prefeare the first as it's more readable IMHO.

> > +   list_for_each(item,_devlist) {
> > +   tmp = list_entry(item, scsi_changer, list);
> 
> list_for_each_entry

Oh, a new fancy toy I havn't notices yet ;)
When this was added btw.?

New version of the patch is below.

  Gerd

==[ cut here ]==
Subject: [patch] scsi changer

This patch adds a device driver for scsi media changer devices.

Signed-off-by: Gerd Knorr <[EMAIL PROTECTED]>
---
 Documentation/scsi-changer.txt |  180 +
 drivers/scsi/Kconfig   |   18 
 drivers/scsi/Makefile  |1 
 drivers/scsi/ch.c  | 1020 +
 include/linux/chio.h   |  168 +
 include/linux/major.h  |1 
 include/scsi/scsi.h|3 
 7 files changed, 1391 insertions(+)

Index: linux-2.6.11-rc4/Documentation/scsi-changer.txt
===
--- /dev/null   1970-01-01 00:00:00.0 +
+++ linux-2.6.11-rc4/Documentation/scsi-changer.txt 2005-02-16 
15:04:37.0 +0100
@@ -0,0 +1,180 @@
+
+README for the SCSI media changer driver
+
+
+This is a driver for SCSI Medium Changer devices, which are listed
+with "Type: Medium Changer" in /proc/scsi/scsi.
+
+This is for *real* Jukeboxes.  It is *not* supported to work with
+common small CD-ROM changers, neither one-lun-per-slot SCSI changers
+nor IDE drives.
+
+Userland tools available from here:
+   http://linux.bytesex.org/misc/changer.html
+
+
+General Information
+---
+
+First some words about how changers work: A changer has 2 (possibly
+more) SCSI ID's. One for the changer device which controls the robot,
+and one for the device which actually reads and writes the data. The
+later may be anything, a MOD, a CD-ROM, a tape or whatever. For the
+changer device this is a "don't care", he *only* shuffles around the
+media, nothing else.
+
+
+The SCSI changer model is complex, compared to - for example - IDE-CD
+changers. But it allows to handle nearly all possible cases. It knows
+4 different types of changer elements:
+
+  media transport - this one shuffles around the media, i.e. the
+transport arm.  Also known as "picker".
+  storage - a slot which can hold a media.
+  import/export   - the same as above, but is accessable from outside,
+i.e. there the operator (you !) can use this to
+fill in and remove media from the changer.
+   Sometimes named "mailslot".
+  data transfer   - this is the device which reads/writes, i.e. the
+   CD-ROM / Tape / whatever drive.
+
+None of these is limited to one: A huge Jukebox could have slots for
+123 CD-ROM's, 5 CD-ROM readers (and therefore 6 SCSI ID's: the changer
+and each CD-ROM) and 2 transport arms. No problem to handle.
+
+
+How it is implemented
+-
+
+I implemented the driver as character device driver with a NetBSD-like
+ioctl interface. Just grabbed NetBSD's header file and one of the
+other linux SCSI device drivers as starting point. The interface
+should be source code compatible with NetBSD. So if there is any
+software (anybody knows ???) which supports a BSDish changer driver,
+it should work with this driver too.
+
+Over time a few more ioctls where added, volume tag support for example
+wasn't covered by the NetBSD ioctl API.
+
+
+Current State
+-
+
+Support for more than one transport arm is not implemented yet (and
+nobody asked for it so far...).
+
+I test and use the driver myself with a 35 slot cdrom jukebox from
+Grundig.  I got some reports telling it works ok with tape autoloaders
+(Exabyte, HP and DEC).  Some People use this driver with amanda.  It
+works fine with small (11 slots) and a huge (4 MOs, 88 slots)
+magneto-optical Jukebox.  Probably with lots of other changers too, most
+(but not all :-) people mail me only if it does *not* work...
+
+I don't have any device

Re: [patch] add scsi changer driver

2005-02-16 Thread Gerd Knorr
  +#include linux/version.h
 not needed.
  +#include asm/system.h
 I doubt you'll need this one.

Dropped.

  +#define MAJOR_NR   SCSI_CHANGER_MAJOR
 please kill this one

Done.

  +#include scsi.h
 never use this header but always the scsi/*.h

Done.

  +MODULE_SUPPORTED_DEVICE(sch);
 no needed thsese days

Dropped.

  +static int ioctl32_register(void)
  +{
 
 please implement -compat_ioctl instead.

Done.

  +   sr = scsi_allocate_request(ch-device, GFP_ATOMIC);
 
 wouldn't a GFP_KERNEL do just fine?

Yes (there was another one of this ...).
Fixed.

  +   if (NULL == sr)
  +   return -ENOMEM;
 
 normal kernel style would be
 
   if (!s)
   return -ENOMEM;

Well, I prefeare the first as it's more readable IMHO.

  +   list_for_each(item,ch_devlist) {
  +   tmp = list_entry(item, scsi_changer, list);
 
 list_for_each_entry

Oh, a new fancy toy I havn't notices yet ;)
When this was added btw.?

New version of the patch is below.

  Gerd

==[ cut here ]==
Subject: [patch] scsi changer

This patch adds a device driver for scsi media changer devices.

Signed-off-by: Gerd Knorr [EMAIL PROTECTED]
---
 Documentation/scsi-changer.txt |  180 +
 drivers/scsi/Kconfig   |   18 
 drivers/scsi/Makefile  |1 
 drivers/scsi/ch.c  | 1020 +
 include/linux/chio.h   |  168 +
 include/linux/major.h  |1 
 include/scsi/scsi.h|3 
 7 files changed, 1391 insertions(+)

Index: linux-2.6.11-rc4/Documentation/scsi-changer.txt
===
--- /dev/null   1970-01-01 00:00:00.0 +
+++ linux-2.6.11-rc4/Documentation/scsi-changer.txt 2005-02-16 
15:04:37.0 +0100
@@ -0,0 +1,180 @@
+
+README for the SCSI media changer driver
+
+
+This is a driver for SCSI Medium Changer devices, which are listed
+with Type: Medium Changer in /proc/scsi/scsi.
+
+This is for *real* Jukeboxes.  It is *not* supported to work with
+common small CD-ROM changers, neither one-lun-per-slot SCSI changers
+nor IDE drives.
+
+Userland tools available from here:
+   http://linux.bytesex.org/misc/changer.html
+
+
+General Information
+---
+
+First some words about how changers work: A changer has 2 (possibly
+more) SCSI ID's. One for the changer device which controls the robot,
+and one for the device which actually reads and writes the data. The
+later may be anything, a MOD, a CD-ROM, a tape or whatever. For the
+changer device this is a don't care, he *only* shuffles around the
+media, nothing else.
+
+
+The SCSI changer model is complex, compared to - for example - IDE-CD
+changers. But it allows to handle nearly all possible cases. It knows
+4 different types of changer elements:
+
+  media transport - this one shuffles around the media, i.e. the
+transport arm.  Also known as picker.
+  storage - a slot which can hold a media.
+  import/export   - the same as above, but is accessable from outside,
+i.e. there the operator (you !) can use this to
+fill in and remove media from the changer.
+   Sometimes named mailslot.
+  data transfer   - this is the device which reads/writes, i.e. the
+   CD-ROM / Tape / whatever drive.
+
+None of these is limited to one: A huge Jukebox could have slots for
+123 CD-ROM's, 5 CD-ROM readers (and therefore 6 SCSI ID's: the changer
+and each CD-ROM) and 2 transport arms. No problem to handle.
+
+
+How it is implemented
+-
+
+I implemented the driver as character device driver with a NetBSD-like
+ioctl interface. Just grabbed NetBSD's header file and one of the
+other linux SCSI device drivers as starting point. The interface
+should be source code compatible with NetBSD. So if there is any
+software (anybody knows ???) which supports a BSDish changer driver,
+it should work with this driver too.
+
+Over time a few more ioctls where added, volume tag support for example
+wasn't covered by the NetBSD ioctl API.
+
+
+Current State
+-
+
+Support for more than one transport arm is not implemented yet (and
+nobody asked for it so far...).
+
+I test and use the driver myself with a 35 slot cdrom jukebox from
+Grundig.  I got some reports telling it works ok with tape autoloaders
+(Exabyte, HP and DEC).  Some People use this driver with amanda.  It
+works fine with small (11 slots) and a huge (4 MOs, 88 slots)
+magneto-optical Jukebox.  Probably with lots of other changers too, most
+(but not all :-) people mail me only if it does *not* work...
+
+I don't have any device lists, neither black-list nor white-list.  Thus
+it is quite useless to ask me whenever a specific device is supported or
+not.  In theory every changer device which supports the SCSI-2 media
+changer command set

[patch] add scsi changer driver

2005-02-15 Thread Gerd Knorr
  Hi,

This patch adds a device driver for scsi media changer devices (tape
libraries for example).

It exists for quite some time (since 2.2.x or so ...), is used by
several people and also is in some vendor kernels (debian, suse, maybe
others as well).  People bug be from time to time to submit it ;)

Recently I went over it and did some 2.6 cleanups, module parameters
and the like.  And now, finally, here it is.

Please apply,

  Gerd

Signed-off-by: Gerd Knorr <[EMAIL PROTECTED]>
---
 Documentation/scsi-changer.txt |  184 +
 drivers/scsi/Kconfig   |   18 
 drivers/scsi/Makefile  |1 
 drivers/scsi/ch.c  | 1059 +
 include/linux/chio.h   |  168 +
 include/linux/major.h  |1 
 include/scsi/scsi.h|3 
 7 files changed, 1434 insertions(+)

Index: linux-2.6.10/Documentation/scsi-changer.txt
===
--- /dev/null   1970-01-01 00:00:00.0 +
+++ linux-2.6.10/Documentation/scsi-changer.txt 2005-01-19 14:30:27.0 
+0100
@@ -0,0 +1,184 @@
+
+README for the SCSI media changer driver
+
+
+This is a driver for SCSI Medium Changer devices, which are listed
+with "Type: Medium Changer" in /proc/scsi/scsi.
+
+This is for *real* Jukeboxes.  It is *not* supported to work with
+common small CD-ROM changers, neither one-lun-per-slot SCSI changers
+nor IDE drives.
+
+Userland tools available from: http://bytesex.org/changer.html
+
+
+General Information
+---
+
+First some words about how changers work: A changer has 2 (possibly
+more) SCSI ID's. One for the changer device which controls the robot,
+and one for the device which actually reads and writes the data. The
+later may be anything, a MOD, a CD-ROM, a tape or whatever. For the
+changer device this is a "don't care", he *only* shuffles around the
+media, nothing else.
+
+
+The SCSI changer model is complex, compared to - for example - IDE-CD
+changers. But it allows to handle nearly all possible cases. It knows
+4 different types of changer elements:
+
+  media transport - this one shuffles around the media, i.e. the
+transport arm.  Also known as "picker".
+  storage - a slot which can hold a media.
+  import/export   - the same as above, but is accessable from outside,
+i.e. there the operator (you !) can use this to
+fill in and remove media from the changer.
+   Sometimes named "mailslot".
+  data transfer   - this is the device which reads/writes, i.e. the
+   CD-ROM / Tape / whatever drive.
+
+None of these is limited to one: A huge Jukebox could have slots for
+123 CD-ROM's, 5 CD-ROM readers (and therefore 6 SCSI ID's: the changer
+and each CD-ROM) and 2 transport arms. No problem to handle.
+
+
+How it is implemented
+-
+
+I implemented the driver as character device driver with a NetBSD-like
+ioctl interface. Just grabbed NetBSD's header file and one of the
+other linux SCSI device drivers as starting point. The interface
+should be source code compatible with NetBSD. So if there is any
+software (anybody knows ???) which supports a BSDish changer driver,
+it should work with this driver too.
+
+Over time a few more ioctls where added, volume tag support for example
+wasn't covered by the NetBSD ioctl API.
+
+
+Current State
+-
+
+Support for more than one transport arm is not implemented yet (and
+nobody asked for it so far...).
+
+I test and use the driver myself with a 35 slot cdrom jukebox from
+Grundig.  I got some reports telling it works ok with tape autoloaders
+(Exabyte, HP and DEC).  Some People use this driver with amanda.  It
+works fine with small (11 slots) and a huge (4 MOs, 88 slots)
+magneto-optical Jukebox.  Probably with lots of other changers too, most
+(but not all :-) people mail me only if it does *not* work...
+
+I don't have any device lists, neither black-list nor white-list.  Thus
+it is quite useless to ask me whenever a specific device is supported or
+not.  In theory every changer device which supports the SCSI-2 media
+changer command set should work out-of-the-box with this driver.  If it
+doesn't, it is a bug.  Either within the driver or within the firmware
+of the changer device.
+
+
+Using it
+
+
+This is a character device with major number is 86, so use
+"mknod /dev/sch0 c 86 0" to create the special file for the driver.
+
+If the module finds the changer, it prints some messages about the
+device [ try "dmesg" if you don't see anything ] and should show up in
+/proc/devices. If not  some changers use ID ? / LUN 0 for the
+device and ID ? / LUN 1 for the robot mechanism. But Linux does *not*
+look for LUN's other than 0 as default, becauce there are to many
+broken devices. So y

[patch] minor bttv driver update

2005-02-15 Thread Gerd Knorr
Just a new PCI Subsystem ID and a PM fix from Pavel.

Signed-off-by: Gerd Knorr <[EMAIL PROTECTED]>
---
 drivers/media/video/bttv-cards.c  |4 +++-
 drivers/media/video/bttv-driver.c |4 ++--
 drivers/media/video/bttv.h|2 +-
 drivers/media/video/bttvp.h   |2 +-
 4 files changed, 7 insertions(+), 5 deletions(-)

Index: linux-2.6.11-rc4/drivers/media/video/bttv.h
===
--- linux-2.6.11-rc4.orig/drivers/media/video/bttv.h2005-02-14 
15:22:19.0 +0100
+++ linux-2.6.11-rc4/drivers/media/video/bttv.h 2005-02-15 12:29:56.0 
+0100
@@ -1,5 +1,5 @@
 /*
- * $Id: bttv.h,v 1.14 2005/01/07 13:11:19 kraxel Exp $
+ * $Id: bttv.h,v 1.15 2005/01/24 17:37:23 kraxel Exp $
  *
  *  bttv - Bt848 frame grabber driver
  *
Index: linux-2.6.11-rc4/drivers/media/video/bttvp.h
===
--- linux-2.6.11-rc4.orig/drivers/media/video/bttvp.h   2005-02-14 
15:25:54.0 +0100
+++ linux-2.6.11-rc4/drivers/media/video/bttvp.h2005-02-15 
12:29:56.0 +0100
@@ -1,5 +1,5 @@
 /*
-$Id: bttvp.h,v 1.15 2004/12/14 15:33:30 kraxel Exp $
+$Id: bttvp.h,v 1.16 2005/01/24 17:37:23 kraxel Exp $
 
 bttv - Bt848 frame grabber driver
 
Index: linux-2.6.11-rc4/drivers/media/video/bttv-driver.c
===
--- linux-2.6.11-rc4.orig/drivers/media/video/bttv-driver.c 2005-02-14 
15:24:27.0 +0100
+++ linux-2.6.11-rc4/drivers/media/video/bttv-driver.c  2005-02-15 
12:30:02.0 +0100
@@ -1,5 +1,5 @@
 /*
-$Id: bttv-driver.c,v 1.34 2005/01/07 13:11:19 kraxel Exp $
+$Id: bttv-driver.c,v 1.36 2005/02/15 10:51:53 kraxel Exp $
 
 bttv - Bt848 frame grabber driver
 
@@ -3921,7 +3921,7 @@ static void __devexit bttv_remove(struct
 return;
 }
 
-static int bttv_suspend(struct pci_dev *pci_dev, u32 state)
+static int bttv_suspend(struct pci_dev *pci_dev, pm_message_t state)
 {
 struct bttv *btv = pci_get_drvdata(pci_dev);
struct bttv_buffer_set idle;
Index: linux-2.6.11-rc4/drivers/media/video/bttv-cards.c
===
--- linux-2.6.11-rc4.orig/drivers/media/video/bttv-cards.c  2005-02-14 
15:23:26.0 +0100
+++ linux-2.6.11-rc4/drivers/media/video/bttv-cards.c   2005-02-15 
12:29:56.0 +0100
@@ -1,5 +1,5 @@
 /*
-$Id: bttv-cards.c,v 1.42 2005/01/13 17:22:33 kraxel Exp $
+$Id: bttv-cards.c,v 1.44 2005/01/31 11:35:05 kraxel Exp $
 
 bttv-cards.c
 
@@ -170,6 +170,8 @@ static struct CARD {
// some cards ship with byteswapped IDs ...
{ 0x1200bd11, BTTV_PINNACLE,  "Pinnacle PCTV [bswap]" },
{ 0xff00bd11, BTTV_PINNACLE,  "Pinnacle PCTV [bswap]" },
+   // this seems to happen as well ...
+   { 0xff1211bd, BTTV_PINNACLE,  "Pinnacle PCTV" },
 
{ 0x3000121a, BTTV_VOODOOTV_FM,   "3Dfx VoodooTV FM/ VoodooTV 200" },
{ 0x263710b4, BTTV_VOODOOTV_FM,   "3Dfx VoodooTV FM/ VoodooTV 200" },

-- 
#define printk(args...) fprintf(stderr, ## args)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[patch] minor bttv driver update

2005-02-15 Thread Gerd Knorr
Just a new PCI Subsystem ID and a PM fix from Pavel.

Signed-off-by: Gerd Knorr [EMAIL PROTECTED]
---
 drivers/media/video/bttv-cards.c  |4 +++-
 drivers/media/video/bttv-driver.c |4 ++--
 drivers/media/video/bttv.h|2 +-
 drivers/media/video/bttvp.h   |2 +-
 4 files changed, 7 insertions(+), 5 deletions(-)

Index: linux-2.6.11-rc4/drivers/media/video/bttv.h
===
--- linux-2.6.11-rc4.orig/drivers/media/video/bttv.h2005-02-14 
15:22:19.0 +0100
+++ linux-2.6.11-rc4/drivers/media/video/bttv.h 2005-02-15 12:29:56.0 
+0100
@@ -1,5 +1,5 @@
 /*
- * $Id: bttv.h,v 1.14 2005/01/07 13:11:19 kraxel Exp $
+ * $Id: bttv.h,v 1.15 2005/01/24 17:37:23 kraxel Exp $
  *
  *  bttv - Bt848 frame grabber driver
  *
Index: linux-2.6.11-rc4/drivers/media/video/bttvp.h
===
--- linux-2.6.11-rc4.orig/drivers/media/video/bttvp.h   2005-02-14 
15:25:54.0 +0100
+++ linux-2.6.11-rc4/drivers/media/video/bttvp.h2005-02-15 
12:29:56.0 +0100
@@ -1,5 +1,5 @@
 /*
-$Id: bttvp.h,v 1.15 2004/12/14 15:33:30 kraxel Exp $
+$Id: bttvp.h,v 1.16 2005/01/24 17:37:23 kraxel Exp $
 
 bttv - Bt848 frame grabber driver
 
Index: linux-2.6.11-rc4/drivers/media/video/bttv-driver.c
===
--- linux-2.6.11-rc4.orig/drivers/media/video/bttv-driver.c 2005-02-14 
15:24:27.0 +0100
+++ linux-2.6.11-rc4/drivers/media/video/bttv-driver.c  2005-02-15 
12:30:02.0 +0100
@@ -1,5 +1,5 @@
 /*
-$Id: bttv-driver.c,v 1.34 2005/01/07 13:11:19 kraxel Exp $
+$Id: bttv-driver.c,v 1.36 2005/02/15 10:51:53 kraxel Exp $
 
 bttv - Bt848 frame grabber driver
 
@@ -3921,7 +3921,7 @@ static void __devexit bttv_remove(struct
 return;
 }
 
-static int bttv_suspend(struct pci_dev *pci_dev, u32 state)
+static int bttv_suspend(struct pci_dev *pci_dev, pm_message_t state)
 {
 struct bttv *btv = pci_get_drvdata(pci_dev);
struct bttv_buffer_set idle;
Index: linux-2.6.11-rc4/drivers/media/video/bttv-cards.c
===
--- linux-2.6.11-rc4.orig/drivers/media/video/bttv-cards.c  2005-02-14 
15:23:26.0 +0100
+++ linux-2.6.11-rc4/drivers/media/video/bttv-cards.c   2005-02-15 
12:29:56.0 +0100
@@ -1,5 +1,5 @@
 /*
-$Id: bttv-cards.c,v 1.42 2005/01/13 17:22:33 kraxel Exp $
+$Id: bttv-cards.c,v 1.44 2005/01/31 11:35:05 kraxel Exp $
 
 bttv-cards.c
 
@@ -170,6 +170,8 @@ static struct CARD {
// some cards ship with byteswapped IDs ...
{ 0x1200bd11, BTTV_PINNACLE,  Pinnacle PCTV [bswap] },
{ 0xff00bd11, BTTV_PINNACLE,  Pinnacle PCTV [bswap] },
+   // this seems to happen as well ...
+   { 0xff1211bd, BTTV_PINNACLE,  Pinnacle PCTV },
 
{ 0x3000121a, BTTV_VOODOOTV_FM,   3Dfx VoodooTV FM/ VoodooTV 200 },
{ 0x263710b4, BTTV_VOODOOTV_FM,   3Dfx VoodooTV FM/ VoodooTV 200 },

-- 
#define printk(args...) fprintf(stderr, ## args)
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[patch] add scsi changer driver

2005-02-15 Thread Gerd Knorr
  Hi,

This patch adds a device driver for scsi media changer devices (tape
libraries for example).

It exists for quite some time (since 2.2.x or so ...), is used by
several people and also is in some vendor kernels (debian, suse, maybe
others as well).  People bug be from time to time to submit it ;)

Recently I went over it and did some 2.6 cleanups, module parameters
and the like.  And now, finally, here it is.

Please apply,

  Gerd

Signed-off-by: Gerd Knorr [EMAIL PROTECTED]
---
 Documentation/scsi-changer.txt |  184 +
 drivers/scsi/Kconfig   |   18 
 drivers/scsi/Makefile  |1 
 drivers/scsi/ch.c  | 1059 +
 include/linux/chio.h   |  168 +
 include/linux/major.h  |1 
 include/scsi/scsi.h|3 
 7 files changed, 1434 insertions(+)

Index: linux-2.6.10/Documentation/scsi-changer.txt
===
--- /dev/null   1970-01-01 00:00:00.0 +
+++ linux-2.6.10/Documentation/scsi-changer.txt 2005-01-19 14:30:27.0 
+0100
@@ -0,0 +1,184 @@
+
+README for the SCSI media changer driver
+
+
+This is a driver for SCSI Medium Changer devices, which are listed
+with Type: Medium Changer in /proc/scsi/scsi.
+
+This is for *real* Jukeboxes.  It is *not* supported to work with
+common small CD-ROM changers, neither one-lun-per-slot SCSI changers
+nor IDE drives.
+
+Userland tools available from: http://bytesex.org/changer.html
+
+
+General Information
+---
+
+First some words about how changers work: A changer has 2 (possibly
+more) SCSI ID's. One for the changer device which controls the robot,
+and one for the device which actually reads and writes the data. The
+later may be anything, a MOD, a CD-ROM, a tape or whatever. For the
+changer device this is a don't care, he *only* shuffles around the
+media, nothing else.
+
+
+The SCSI changer model is complex, compared to - for example - IDE-CD
+changers. But it allows to handle nearly all possible cases. It knows
+4 different types of changer elements:
+
+  media transport - this one shuffles around the media, i.e. the
+transport arm.  Also known as picker.
+  storage - a slot which can hold a media.
+  import/export   - the same as above, but is accessable from outside,
+i.e. there the operator (you !) can use this to
+fill in and remove media from the changer.
+   Sometimes named mailslot.
+  data transfer   - this is the device which reads/writes, i.e. the
+   CD-ROM / Tape / whatever drive.
+
+None of these is limited to one: A huge Jukebox could have slots for
+123 CD-ROM's, 5 CD-ROM readers (and therefore 6 SCSI ID's: the changer
+and each CD-ROM) and 2 transport arms. No problem to handle.
+
+
+How it is implemented
+-
+
+I implemented the driver as character device driver with a NetBSD-like
+ioctl interface. Just grabbed NetBSD's header file and one of the
+other linux SCSI device drivers as starting point. The interface
+should be source code compatible with NetBSD. So if there is any
+software (anybody knows ???) which supports a BSDish changer driver,
+it should work with this driver too.
+
+Over time a few more ioctls where added, volume tag support for example
+wasn't covered by the NetBSD ioctl API.
+
+
+Current State
+-
+
+Support for more than one transport arm is not implemented yet (and
+nobody asked for it so far...).
+
+I test and use the driver myself with a 35 slot cdrom jukebox from
+Grundig.  I got some reports telling it works ok with tape autoloaders
+(Exabyte, HP and DEC).  Some People use this driver with amanda.  It
+works fine with small (11 slots) and a huge (4 MOs, 88 slots)
+magneto-optical Jukebox.  Probably with lots of other changers too, most
+(but not all :-) people mail me only if it does *not* work...
+
+I don't have any device lists, neither black-list nor white-list.  Thus
+it is quite useless to ask me whenever a specific device is supported or
+not.  In theory every changer device which supports the SCSI-2 media
+changer command set should work out-of-the-box with this driver.  If it
+doesn't, it is a bug.  Either within the driver or within the firmware
+of the changer device.
+
+
+Using it
+
+
+This is a character device with major number is 86, so use
+mknod /dev/sch0 c 86 0 to create the special file for the driver.
+
+If the module finds the changer, it prints some messages about the
+device [ try dmesg if you don't see anything ] and should show up in
+/proc/devices. If not  some changers use ID ? / LUN 0 for the
+device and ID ? / LUN 1 for the robot mechanism. But Linux does *not*
+look for LUN's other than 0 as default, becauce there are to many
+broken devices. So you can try:
+
+  1) echo scsi add-single-device 0 0 ID 1  /proc/scsi/scsi

Re: [patch] tv-card tuner fixup

2005-02-08 Thread Gerd Knorr
> > That one should go into 2.6.11.
> > - fix initialization order bug.
> 
> I applied your earlier patch already. Can you verify that I merged 
> everything correctly, and that my current BK tree matches yours?

Yep, it is fine.  Just a whitespace sneaked in somehow, otherwise
current bk is identical to my sources ;)

  Gerd

-- 
#define printk(args...) fprintf(stderr, ## args)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [patch] tv-card tuner fixup

2005-02-08 Thread Gerd Knorr
  That one should go into 2.6.11.
  - fix initialization order bug.
 
 I applied your earlier patch already. Can you verify that I merged 
 everything correctly, and that my current BK tree matches yours?

Yep, it is fine.  Just a whitespace sneaked in somehow, otherwise
current bk is identical to my sources ;)

  Gerd

-- 
#define printk(args...) fprintf(stderr, ## args)
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[patch] tv-card tuner fixup

2005-02-04 Thread Gerd Knorr
  Hi,

That one should go into 2.6.11.

- fix initialization order bug.
- disable + comment current secam tweak, will not work that way ...

Signed-off-by: Gerd Knorr <[EMAIL PROTECTED]>
---
 drivers/media/video/tda9887.c |   11 ---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff -u linux-2.6.11/drivers/media/video/tda9887.c 
linux/drivers/media/video/tda9887.c
--- linux-2.6.11/drivers/media/video/tda9887.c  2005-02-04 11:26:26.0 
+0100
+++ linux/drivers/media/video/tda9887.c 2005-02-04 12:43:57.615444344 +0100
@@ -305,9 +305,9 @@
printk("  B5   force mute audio: %s\n",
   (buf[1] & 0x20) ? "yes" : "no");
printk("  B6   output port 1   : %s\n",
-  (buf[1] & 0x40) ? "high" : "low");
+  (buf[1] & 0x40) ? "high (inactive)" : "low (active)");
printk("  B7   output port 2   : %s\n",
-  (buf[1] & 0x80) ? "high" : "low");
+  (buf[1] & 0x80) ? "high (inactive)" : "low (active)");
 
printk(PREFIX "write: byte C 0x%02x\n",buf[2]);
printk("  C0-4 top adjustment  : %s dB\n", adjust[buf[2] & 0x1f]);
@@ -545,19 +545,24 @@
int rc;
 
memset(buf,0,sizeof(buf));
+   tda9887_set_tvnorm(t,buf);
buf[1] |= cOutputPort1Inactive;
buf[1] |= cOutputPort2Inactive;
-   tda9887_set_tvnorm(t,buf);
if (UNSET != t->pinnacle_id) {
tda9887_set_pinnacle(t,buf);
}
tda9887_set_config(t,buf);
tda9887_set_insmod(t,buf);
 
+#if 0
+   /* This as-is breaks some cards, must be fixed in a
+* card-specific way, probably using TDA9887_SET_CONFIG to
+* turn on/off port2 */
if (t->std & V4L2_STD_SECAM_L) {
/* secam fixup (FIXME: move this to tvnorms array?) */
buf[1] &= ~cOutputPort2Inactive;
}
+#endif
 
dprintk(PREFIX "writing: b=0x%02x c=0x%02x e=0x%02x\n",
buf[1],buf[2],buf[3]);

-- 
#define printk(args...) fprintf(stderr, ## args)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[patch] tv-card tuner fixup

2005-02-04 Thread Gerd Knorr
  Hi,

That one should go into 2.6.11.

- fix initialization order bug.
- disable + comment current secam tweak, will not work that way ...

Signed-off-by: Gerd Knorr [EMAIL PROTECTED]
---
 drivers/media/video/tda9887.c |   11 ---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff -u linux-2.6.11/drivers/media/video/tda9887.c 
linux/drivers/media/video/tda9887.c
--- linux-2.6.11/drivers/media/video/tda9887.c  2005-02-04 11:26:26.0 
+0100
+++ linux/drivers/media/video/tda9887.c 2005-02-04 12:43:57.615444344 +0100
@@ -305,9 +305,9 @@
printk(  B5   force mute audio: %s\n,
   (buf[1]  0x20) ? yes : no);
printk(  B6   output port 1   : %s\n,
-  (buf[1]  0x40) ? high : low);
+  (buf[1]  0x40) ? high (inactive) : low (active));
printk(  B7   output port 2   : %s\n,
-  (buf[1]  0x80) ? high : low);
+  (buf[1]  0x80) ? high (inactive) : low (active));
 
printk(PREFIX write: byte C 0x%02x\n,buf[2]);
printk(  C0-4 top adjustment  : %s dB\n, adjust[buf[2]  0x1f]);
@@ -545,19 +545,24 @@
int rc;
 
memset(buf,0,sizeof(buf));
+   tda9887_set_tvnorm(t,buf);
buf[1] |= cOutputPort1Inactive;
buf[1] |= cOutputPort2Inactive;
-   tda9887_set_tvnorm(t,buf);
if (UNSET != t-pinnacle_id) {
tda9887_set_pinnacle(t,buf);
}
tda9887_set_config(t,buf);
tda9887_set_insmod(t,buf);
 
+#if 0
+   /* This as-is breaks some cards, must be fixed in a
+* card-specific way, probably using TDA9887_SET_CONFIG to
+* turn on/off port2 */
if (t-std  V4L2_STD_SECAM_L) {
/* secam fixup (FIXME: move this to tvnorms array?) */
buf[1] = ~cOutputPort2Inactive;
}
+#endif
 
dprintk(PREFIX writing: b=0x%02x c=0x%02x e=0x%02x\n,
buf[1],buf[2],buf[3]);

-- 
#define printk(args...) fprintf(stderr, ## args)
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Linux 2.6.11-rc3 - BT848 no signal

2005-02-03 Thread Gerd Knorr
> > > mt2032_set_if_freq failed with -121
> 
> OK here you go.

Thanks, seems to be a initialization order bug which changes the default
state of the tda9887 output ports.  The patch below should fix that.

  Gerd

diff -u linux-2.6.11/drivers/media/video/tda9887.c 
linux/drivers/media/video/tda9887.c
--- linux-2.6.11/drivers/media/video/tda9887.c  2005-01-25 11:57:21.0 
+0100
+++ linux/drivers/media/video/tda9887.c 2005-02-03 12:26:16.246003021 +0100
@@ -305,9 +305,9 @@
printk("  B5   force mute audio: %s\n",
   (buf[1] & 0x20) ? "yes" : "no");
printk("  B6   output port 1   : %s\n",
-  (buf[1] & 0x40) ? "high" : "low");
+  (buf[1] & 0x40) ? "high (inactive)" : "low (active)");
printk("  B7   output port 2   : %s\n",
-  (buf[1] & 0x80) ? "high" : "low");
+  (buf[1] & 0x80) ? "high (inactive)" : "low (active)");
 
printk(PREFIX "write: byte C 0x%02x\n",buf[2]);
printk("  C0-4 top adjustment  : %s dB\n", adjust[buf[2] & 0x1f]);
@@ -545,9 +545,9 @@
int rc;
 
memset(buf,0,sizeof(buf));
+   tda9887_set_tvnorm(t,buf);
buf[1] |= cOutputPort1Inactive;
buf[1] |= cOutputPort2Inactive;
-   tda9887_set_tvnorm(t,buf);
if (UNSET != t->pinnacle_id) {
tda9887_set_pinnacle(t,buf);
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Fix SAA7134 transport stream errors

2005-02-03 Thread Gerd Knorr
On Tue, Feb 01, 2005 at 08:19:17PM -0500, Eric Lammerts wrote:
> 
> Hi,
> I had a lot of problems with the transport stream input on the
> SAA7134. Even the slighest bit of other system activity caused data
> corruption. This patch corrects the switching of the two DMA
> buffers.

Thanks, merged (and fixed a simliar issue in saa7134-video.c along the
way ;).

> FYI, the problems only occur on Transmeta TM5800/TM5400 Crusoe boards
> (1GHz/533MHz). When I move the SAA7134 board to a 400MHz Celeron, no
> problems at all. I measured the interrupt latency of the SAA7134
> interrupt on the Crusoe, and that peaks to >1000us when power
> management is enabled and other activity (IDE DMA) is taking place!!
> That may explain why other people haven't seen this problem.

It has shown up before already (long ago), thats why the two-buffer
thingy exists in the first place.  Looks like 2.6 really makes a better
job on low-latency than 2.4 did, otherwise that would have been noticed
earlier...

  Gerd

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Linux 2.6.11-rc3 - BT848 no signal

2005-02-03 Thread Gerd Knorr
Markus Trippelsdorf <[EMAIL PROTECTED]> writes:

> tuner: chip found at addr 0xc0 i2c-bus bt878 #0 [sw]
> tuner: type set to 33 (MT20xx universal) by bt878 #0 [sw]
> tuner: microtune: companycode=4d54 part=04 rev=04
> tuner: microtune MT2032 found, OK
> tda9885/6/7: chip found @ 0x86
> ...
> mt2032_set_if_freq failed with -121

Can you please load tuner.o with debug=1, tda9887.o with debug=2 and
mail me the logs for driver load + attempt to tune some station for
both working and non-working kernel please?

Thanks,

  Gerd

-- 
#define printk(args...) fprintf(stderr, ## args)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Fix SAA7134 transport stream errors

2005-02-03 Thread Gerd Knorr
On Tue, Feb 01, 2005 at 08:19:17PM -0500, Eric Lammerts wrote:
 
 Hi,
 I had a lot of problems with the transport stream input on the
 SAA7134. Even the slighest bit of other system activity caused data
 corruption. This patch corrects the switching of the two DMA
 buffers.

Thanks, merged (and fixed a simliar issue in saa7134-video.c along the
way ;).

 FYI, the problems only occur on Transmeta TM5800/TM5400 Crusoe boards
 (1GHz/533MHz). When I move the SAA7134 board to a 400MHz Celeron, no
 problems at all. I measured the interrupt latency of the SAA7134
 interrupt on the Crusoe, and that peaks to 1000us when power
 management is enabled and other activity (IDE DMA) is taking place!!
 That may explain why other people haven't seen this problem.

It has shown up before already (long ago), thats why the two-buffer
thingy exists in the first place.  Looks like 2.6 really makes a better
job on low-latency than 2.4 did, otherwise that would have been noticed
earlier...

  Gerd

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Linux 2.6.11-rc3 - BT848 no signal

2005-02-03 Thread Gerd Knorr
Markus Trippelsdorf [EMAIL PROTECTED] writes:

 tuner: chip found at addr 0xc0 i2c-bus bt878 #0 [sw]
 tuner: type set to 33 (MT20xx universal) by bt878 #0 [sw]
 tuner: microtune: companycode=4d54 part=04 rev=04
 tuner: microtune MT2032 found, OK
 tda9885/6/7: chip found @ 0x86
 ...
 mt2032_set_if_freq failed with -121

Can you please load tuner.o with debug=1, tda9887.o with debug=2 and
mail me the logs for driver load + attempt to tune some station for
both working and non-working kernel please?

Thanks,

  Gerd

-- 
#define printk(args...) fprintf(stderr, ## args)
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Linux 2.6.11-rc3 - BT848 no signal

2005-02-03 Thread Gerd Knorr
   mt2032_set_if_freq failed with -121
 
 OK here you go.

Thanks, seems to be a initialization order bug which changes the default
state of the tda9887 output ports.  The patch below should fix that.

  Gerd

diff -u linux-2.6.11/drivers/media/video/tda9887.c 
linux/drivers/media/video/tda9887.c
--- linux-2.6.11/drivers/media/video/tda9887.c  2005-01-25 11:57:21.0 
+0100
+++ linux/drivers/media/video/tda9887.c 2005-02-03 12:26:16.246003021 +0100
@@ -305,9 +305,9 @@
printk(  B5   force mute audio: %s\n,
   (buf[1]  0x20) ? yes : no);
printk(  B6   output port 1   : %s\n,
-  (buf[1]  0x40) ? high : low);
+  (buf[1]  0x40) ? high (inactive) : low (active));
printk(  B7   output port 2   : %s\n,
-  (buf[1]  0x80) ? high : low);
+  (buf[1]  0x80) ? high (inactive) : low (active));
 
printk(PREFIX write: byte C 0x%02x\n,buf[2]);
printk(  C0-4 top adjustment  : %s dB\n, adjust[buf[2]  0x1f]);
@@ -545,9 +545,9 @@
int rc;
 
memset(buf,0,sizeof(buf));
+   tda9887_set_tvnorm(t,buf);
buf[1] |= cOutputPort1Inactive;
buf[1] |= cOutputPort2Inactive;
-   tda9887_set_tvnorm(t,buf);
if (UNSET != t-pinnacle_id) {
tda9887_set_pinnacle(t,buf);
}
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [patch] add i2c adapter id for the cx88 driver.

2005-01-25 Thread Gerd Knorr
> 0x1a is reserved for TI PCILynx in the i2c project, although I never took
> the time to forward the update to the kernel trees. Could you please use
> 0x1b instead?

Ok, here is a new version of the patch, using 0x1b.

  Gerd

Index: linux-2005-01-23/include/linux/i2c-id.h
===
--- linux-2005-01-23.orig/include/linux/i2c-id.h2005-01-24 
16:27:38.0 +0100
+++ linux-2005-01-23/include/linux/i2c-id.h 2005-01-25 11:57:45.0 
+0100
@@ -239,6 +239,7 @@
 #define I2C_HW_B_IXP4XX 0x17   /* GPIO on IXP4XX systems   */
 #define I2C_HW_B_S3VIA 0x18/* S3Via ProSavage adapter  */
 #define I2C_HW_B_ZR36067 0x19  /* Zoran-36057/36067 based boards   */
+#define I2C_HW_B_CX2388x 0x1b  /* connexant 2388x based tv cards   */
 
 /* --- PCF 8584 based algorithms   */
 #define I2C_HW_P_LP0x00/* Parallel port interface  */
Index: linux-2005-01-23/drivers/media/video/cx88/cx88-i2c.c
===
--- linux-2005-01-23.orig/drivers/media/video/cx88/cx88-i2c.c   2005-01-24 
16:28:43.0 +0100
+++ linux-2005-01-23/drivers/media/video/cx88/cx88-i2c.c2005-01-25 
11:57:21.0 +0100
@@ -134,7 +134,7 @@ static struct i2c_algo_bit_data cx8800_i
 static struct i2c_adapter cx8800_i2c_adap_template = {
I2C_DEVNAME("cx2388x"),
.owner = THIS_MODULE,
-   .id= I2C_HW_B_BT848,
+   .id= I2C_HW_B_CX2388x,
.client_register   = attach_inform,
.client_unregister = detach_inform,
 };
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[patch] add i2c adapter id for the cx88 driver.

2005-01-25 Thread Gerd Knorr
  Hi,

$subject says all.  Please apply,

  Gerd

Index: linux-2.6.11-rc2/include/linux/i2c-id.h
===
--- linux-2.6.11-rc2.orig/include/linux/i2c-id.h2005-01-24 
09:11:12.0 +0100
+++ linux-2.6.11-rc2/include/linux/i2c-id.h 2005-01-24 15:09:14.0 
+0100
@@ -239,6 +239,7 @@
 #define I2C_HW_B_IXP4XX 0x17   /* GPIO on IXP4XX systems   */
 #define I2C_HW_B_S3VIA 0x18/* S3Via ProSavage adapter  */
 #define I2C_HW_B_ZR36067 0x19  /* Zoran-36057/36067 based boards   */
+#define I2C_HW_B_CX2388x 0x1a  /* connexant 2388x based tv cards   */
 
 /* --- PCF 8584 based algorithms   */
 #define I2C_HW_P_LP0x00/* Parallel port interface  */
Index: linux-2.6.11-rc2/drivers/media/video/cx88/cx88-i2c.c
===
--- linux-2.6.11-rc2.orig/drivers/media/video/cx88/cx88-i2c.c   2005-01-24 
14:54:35.0 +0100
+++ linux-2.6.11-rc2/drivers/media/video/cx88/cx88-i2c.c2005-01-24 
15:09:41.0 +0100
@@ -135,7 +135,7 @@ static struct i2c_algo_bit_data cx8800_i
 static struct i2c_adapter cx8800_i2c_adap_template = {
I2C_DEVNAME("cx2388x"),
.owner = THIS_MODULE,
-   .id= I2C_HW_B_BT848,
+   .id= I2C_HW_B_CX2388x,
.client_register   = attach_inform,
.client_unregister = detach_inform,
 };
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: 2.6.11-rc2-mm1: v4l-saa7134-module compile error

2005-01-25 Thread Gerd Knorr
> > The patch below should fix this.
> 
> Not completely:

>   CC  drivers/media/video/saa7134/saa7134-core.o
> drivers/media/video/saa7134/saa7134-core.c: In function `saa7134_initdev':
> drivers/media/video/saa7134/saa7134-core.c:997: error: `need_empress' 
> undeclared (first use in this function)

New version, this time using a #define, which should kill the reference
to need_* as well ...

  Gerd

Index: linux-2005-01-23/drivers/media/video/saa7134/saa7134-core.c
===
--- linux-2005-01-23.orig/drivers/media/video/saa7134/saa7134-core.c
2005-01-24 18:43:20.0 +0100
+++ linux-2005-01-23/drivers/media/video/saa7134/saa7134-core.c 2005-01-25 
10:04:17.0 +0100
@@ -21,6 +21,7 @@
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
+#include 
 #include 
 #include 
 #include 
@@ -225,6 +226,8 @@ static void dump_statusregs(struct saa71
 /* --- */
 /* delayed request_module  */
 
+#ifdef CONFIG_MODULES
+
 static int need_empress;
 static int need_dvb;
 
@@ -265,6 +268,12 @@ static void request_module_depend(char *
}
 }
 
+#else
+
+#define request_module_depend(name,flag)
+
+#endif /* CONFIG_MODULES */
+
 /* -- */
 
 /* nr of (saa7134-)pages for the given buffer size */
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: 2.6.11-rc2-mm1: v4l-saa7134-module compile error

2005-01-25 Thread Gerd Knorr
  The patch below should fix this.
 
 Not completely:

   CC  drivers/media/video/saa7134/saa7134-core.o
 drivers/media/video/saa7134/saa7134-core.c: In function `saa7134_initdev':
 drivers/media/video/saa7134/saa7134-core.c:997: error: `need_empress' 
 undeclared (first use in this function)

New version, this time using a #define, which should kill the reference
to need_* as well ...

  Gerd

Index: linux-2005-01-23/drivers/media/video/saa7134/saa7134-core.c
===
--- linux-2005-01-23.orig/drivers/media/video/saa7134/saa7134-core.c
2005-01-24 18:43:20.0 +0100
+++ linux-2005-01-23/drivers/media/video/saa7134/saa7134-core.c 2005-01-25 
10:04:17.0 +0100
@@ -21,6 +21,7 @@
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
+#include linux/config.h
 #include linux/init.h
 #include linux/list.h
 #include linux/module.h
@@ -225,6 +226,8 @@ static void dump_statusregs(struct saa71
 /* --- */
 /* delayed request_module  */
 
+#ifdef CONFIG_MODULES
+
 static int need_empress;
 static int need_dvb;
 
@@ -265,6 +268,12 @@ static void request_module_depend(char *
}
 }
 
+#else
+
+#define request_module_depend(name,flag)
+
+#endif /* CONFIG_MODULES */
+
 /* -- */
 
 /* nr of (saa7134-)pages for the given buffer size */
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[patch] add i2c adapter id for the cx88 driver.

2005-01-25 Thread Gerd Knorr
  Hi,

$subject says all.  Please apply,

  Gerd

Index: linux-2.6.11-rc2/include/linux/i2c-id.h
===
--- linux-2.6.11-rc2.orig/include/linux/i2c-id.h2005-01-24 
09:11:12.0 +0100
+++ linux-2.6.11-rc2/include/linux/i2c-id.h 2005-01-24 15:09:14.0 
+0100
@@ -239,6 +239,7 @@
 #define I2C_HW_B_IXP4XX 0x17   /* GPIO on IXP4XX systems   */
 #define I2C_HW_B_S3VIA 0x18/* S3Via ProSavage adapter  */
 #define I2C_HW_B_ZR36067 0x19  /* Zoran-36057/36067 based boards   */
+#define I2C_HW_B_CX2388x 0x1a  /* connexant 2388x based tv cards   */
 
 /* --- PCF 8584 based algorithms   */
 #define I2C_HW_P_LP0x00/* Parallel port interface  */
Index: linux-2.6.11-rc2/drivers/media/video/cx88/cx88-i2c.c
===
--- linux-2.6.11-rc2.orig/drivers/media/video/cx88/cx88-i2c.c   2005-01-24 
14:54:35.0 +0100
+++ linux-2.6.11-rc2/drivers/media/video/cx88/cx88-i2c.c2005-01-24 
15:09:41.0 +0100
@@ -135,7 +135,7 @@ static struct i2c_algo_bit_data cx8800_i
 static struct i2c_adapter cx8800_i2c_adap_template = {
I2C_DEVNAME(cx2388x),
.owner = THIS_MODULE,
-   .id= I2C_HW_B_BT848,
+   .id= I2C_HW_B_CX2388x,
.client_register   = attach_inform,
.client_unregister = detach_inform,
 };
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [patch] add i2c adapter id for the cx88 driver.

2005-01-25 Thread Gerd Knorr
 0x1a is reserved for TI PCILynx in the i2c project, although I never took
 the time to forward the update to the kernel trees. Could you please use
 0x1b instead?

Ok, here is a new version of the patch, using 0x1b.

  Gerd

Index: linux-2005-01-23/include/linux/i2c-id.h
===
--- linux-2005-01-23.orig/include/linux/i2c-id.h2005-01-24 
16:27:38.0 +0100
+++ linux-2005-01-23/include/linux/i2c-id.h 2005-01-25 11:57:45.0 
+0100
@@ -239,6 +239,7 @@
 #define I2C_HW_B_IXP4XX 0x17   /* GPIO on IXP4XX systems   */
 #define I2C_HW_B_S3VIA 0x18/* S3Via ProSavage adapter  */
 #define I2C_HW_B_ZR36067 0x19  /* Zoran-36057/36067 based boards   */
+#define I2C_HW_B_CX2388x 0x1b  /* connexant 2388x based tv cards   */
 
 /* --- PCF 8584 based algorithms   */
 #define I2C_HW_P_LP0x00/* Parallel port interface  */
Index: linux-2005-01-23/drivers/media/video/cx88/cx88-i2c.c
===
--- linux-2005-01-23.orig/drivers/media/video/cx88/cx88-i2c.c   2005-01-24 
16:28:43.0 +0100
+++ linux-2005-01-23/drivers/media/video/cx88/cx88-i2c.c2005-01-25 
11:57:21.0 +0100
@@ -134,7 +134,7 @@ static struct i2c_algo_bit_data cx8800_i
 static struct i2c_adapter cx8800_i2c_adap_template = {
I2C_DEVNAME(cx2388x),
.owner = THIS_MODULE,
-   .id= I2C_HW_B_BT848,
+   .id= I2C_HW_B_CX2388x,
.client_register   = attach_inform,
.client_unregister = detach_inform,
 };
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: 2.6.11-rc2-mm1: v4l-saa7134-module compile error

2005-01-24 Thread Gerd Knorr
On Mon, Jan 24, 2005 at 12:17:13PM +0100, Adrian Bunk wrote:
> On Mon, Jan 24, 2005 at 02:15:16AM -0800, Andrew Morton wrote:
> >...
> > +v4l-saa7134-module.patch
> 
> This patch broke compilation with CONFIG_MODULES=n:
> 
> drivers/media/video/saa7134/saa7134-core.c: In function `pending_call':
> drivers/media/video/saa7134/saa7134-core.c:234: error: `MODULE_STATE_LIVE' 
> undeclared (first use in this function)

The patch below should fix this.

  Gerd

Index: linux-2.6.11-rc2/drivers/media/video/saa7134/saa7134-core.c
===
--- linux-2.6.11-rc2.orig/drivers/media/video/saa7134/saa7134-core.c
2005-01-24 11:05:45.0 +0100
+++ linux-2.6.11-rc2/drivers/media/video/saa7134/saa7134-core.c 2005-01-24 
14:54:29.0 +0100
@@ -21,6 +21,7 @@
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
+#include 
 #include 
 #include 
 #include 
@@ -225,6 +226,8 @@ static void dump_statusregs(struct saa71
 /* --- */
 /* delayed request_module  */
 
+#ifdef CONFIG_MODULES
+
 static int need_empress;
 static int need_dvb;
 
@@ -265,6 +268,12 @@ static void request_module_depend(char *
}
 }
 
+#else
+
+static inline void request_module_depend(char *name, int *flag) {}
+
+#endif /* CONFIG_MODULES */
+
 /* -- */
 
 /* nr of (saa7134-)pages for the given buffer size */
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: 2.6.11-rc2-mm1: v4l-saa7134-module compile error

2005-01-24 Thread Gerd Knorr
On Mon, Jan 24, 2005 at 12:17:13PM +0100, Adrian Bunk wrote:
 On Mon, Jan 24, 2005 at 02:15:16AM -0800, Andrew Morton wrote:
 ...
  +v4l-saa7134-module.patch
 
 This patch broke compilation with CONFIG_MODULES=n:
 
 drivers/media/video/saa7134/saa7134-core.c: In function `pending_call':
 drivers/media/video/saa7134/saa7134-core.c:234: error: `MODULE_STATE_LIVE' 
 undeclared (first use in this function)

The patch below should fix this.

  Gerd

Index: linux-2.6.11-rc2/drivers/media/video/saa7134/saa7134-core.c
===
--- linux-2.6.11-rc2.orig/drivers/media/video/saa7134/saa7134-core.c
2005-01-24 11:05:45.0 +0100
+++ linux-2.6.11-rc2/drivers/media/video/saa7134/saa7134-core.c 2005-01-24 
14:54:29.0 +0100
@@ -21,6 +21,7 @@
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
+#include linux/config.h
 #include linux/init.h
 #include linux/list.h
 #include linux/module.h
@@ -225,6 +226,8 @@ static void dump_statusregs(struct saa71
 /* --- */
 /* delayed request_module  */
 
+#ifdef CONFIG_MODULES
+
 static int need_empress;
 static int need_dvb;
 
@@ -265,6 +268,12 @@ static void request_module_depend(char *
}
 }
 
+#else
+
+static inline void request_module_depend(char *name, int *flag) {}
+
+#endif /* CONFIG_MODULES */
+
 /* -- */
 
 /* nr of (saa7134-)pages for the given buffer size */
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[patch] v4l2 tuner api update

2005-01-20 Thread Gerd Knorr
Add new tuner type to the v4l2 API.

Signed-off-by: Gerd Knorr <[EMAIL PROTECTED]>
---
 include/linux/videodev2.h |1 +
 1 files changed, 1 insertion(+)

diff -u linux-2.6.10/include/linux/videodev2.h linux/include/linux/videodev2.h
--- linux-2.6.10/include/linux/videodev2.h  2005-01-13 10:48:21.0 
+0100
+++ linux/include/linux/videodev2.h 2005-01-19 14:05:40.661259590 +0100
@@ -78,6 +78,7 @@
 enum v4l2_tuner_type {
V4L2_TUNER_RADIO = 1,
V4L2_TUNER_ANALOG_TV = 2,
+   V4L2_TUNER_DIGITAL_TV= 3,
 };
 
 enum v4l2_memory {

-- 
#define printk(args...) fprintf(stderr, ## args)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[patch] v4l: video-buf update

2005-01-20 Thread Gerd Knorr
- Fix a memory leak in video-buf.c
- Small update for the video-buf-dvb.c module.

Signed-off-by: Gerd Knorr <[EMAIL PROTECTED]>
---
 drivers/media/video/video-buf-dvb.c |   11 +++
 drivers/media/video/video-buf.c |4 +++-
 include/media/video-buf-dvb.h   |4 +++-
 3 files changed, 13 insertions(+), 6 deletions(-)

Index: linux-2.6.10/drivers/media/video/video-buf.c
===
--- linux-2.6.10.orig/drivers/media/video/video-buf.c   2004-12-29 
23:56:51.0 +0100
+++ linux-2.6.10/drivers/media/video/video-buf.c2005-01-07 
16:46:42.650627658 +0100
@@ -1,5 +1,5 @@
 /*
- * $Id: video-buf.c,v 1.15 2004/11/07 14:45:00 kraxel Exp $
+ * $Id: video-buf.c,v 1.17 2004/12/10 12:33:40 kraxel Exp $
  *
  * generic helper functions for video4linux capture buffers, to handle
  * memory management and PCI DMA.  Right now bttv + saa7134 use it.
@@ -20,6 +20,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -892,6 +893,7 @@ void videobuf_read_stop(struct videobuf_
int i;
 
videobuf_queue_cancel(q);
+   videobuf_mmap_free(q);
INIT_LIST_HEAD(>stream);
for (i = 0; i < VIDEO_MAX_FRAME; i++) {
if (NULL == q->bufs[i])
Index: linux-2.6.10/drivers/media/video/video-buf-dvb.c
===
--- linux-2.6.10.orig/drivers/media/video/video-buf-dvb.c   2004-12-29 
23:55:09.0 +0100
+++ linux-2.6.10/drivers/media/video/video-buf-dvb.c2005-01-07 
16:41:25.0 +0100
@@ -1,5 +1,5 @@
 /*
- * $Id: video-buf-dvb.c,v 1.5 2004/11/07 13:17:15 kraxel Exp $
+ * $Id: video-buf-dvb.c,v 1.7 2004/12/09 12:51:35 kraxel Exp $
  *
  * some helper function for simple DVB cards which simply DMA the
  * complete transport stream and let the computer sort everything else
@@ -35,7 +35,7 @@ module_param(debug, int, 0644);
 MODULE_PARM_DESC(debug,"enable debug messages");
 
 #define dprintk(fmt, arg...)   if (debug)  \
-   printk(KERN_DEBUG "%s/dvb: " fmt, dvb->name, ## arg)
+   printk(KERN_DEBUG "%s/dvb: " fmt, dvb->name , ## arg)
 
 /* -- */
 
@@ -134,19 +134,22 @@ static int videobuf_dvb_stop_feed(struct
 
 /* -- */
 
-int videobuf_dvb_register(struct videobuf_dvb *dvb)
+int videobuf_dvb_register(struct videobuf_dvb *dvb,
+ struct module *module,
+ void *adapter_priv)
 {
int result;
 
init_MUTEX(>lock);
 
/* register adapter */
-   result = dvb_register_adapter(>adapter, dvb->name, THIS_MODULE);
+   result = dvb_register_adapter(>adapter, dvb->name, module);
if (result < 0) {
printk(KERN_WARNING "%s: dvb_register_adapter failed (errno = 
%d)\n",
   dvb->name, result);
goto fail_adapter;
}
+   dvb->adapter->priv = adapter_priv;
 
/* register frontend */
result = dvb_register_frontend(dvb->adapter, dvb->frontend);
Index: linux-2.6.10/include/media/video-buf-dvb.h
===
--- linux-2.6.10.orig/include/media/video-buf-dvb.h 2004-12-29 
23:58:34.0 +0100
+++ linux-2.6.10/include/media/video-buf-dvb.h  2005-01-07 16:41:25.0 
+0100
@@ -24,7 +24,9 @@ struct videobuf_dvb {
struct dvb_net net;
 };
 
-int videobuf_dvb_register(struct videobuf_dvb *dvb);
+int videobuf_dvb_register(struct videobuf_dvb *dvb,
+ struct module *module,
+ void *adapter_priv);
 void videobuf_dvb_unregister(struct videobuf_dvb *dvb);
 
 /*

-- 
#define printk(args...) fprintf(stderr, ## args)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[patch] v4l: tuner update

2005-01-20 Thread Gerd Knorr
- add new tuner types.
- add support for digital tv tuning.
- make tda9887 output ports more configurable.

Signed-off-by: Gerd Knorr <[EMAIL PROTECTED]>
---
 drivers/media/video/tda9887.c |   38 +++--
 drivers/media/video/tuner.c   |   60 +++---
 include/media/tuner.h |8 +++-
 3 files changed, 69 insertions(+), 37 deletions(-)

Index: linux-2.6.10/include/media/tuner.h
===
--- linux-2.6.10.orig/include/media/tuner.h 2004-12-29 23:57:53.0 
+0100
+++ linux-2.6.10/include/media/tuner.h  2005-01-19 14:12:25.168221195 +0100
@@ -77,6 +77,7 @@
 #define TUNER_MICROTUNE_4042FI5  49/* FusionHDTV 3 Gold - 4042 FI5 (3X 
8147) */
 #define TUNER_TCL_2002N  50
 #define TUNER_PHILIPS_FM1256_IH3   51
+#define TUNER_THOMSON_DTT761052
 
 #define NOTUNER 0
 #define PAL 1  /* PAL_BG */
@@ -97,6 +98,7 @@
 #define HITACHI 9
 #define Panasonic 10
 #define TCL 11
+#define THOMSON 12
 
 #define TUNER_SET_TYPE   _IOW('t',1,int)/* set tuner type */
 #define TUNER_SET_TVFREQ _IOW('t',2,int)/* set tv freq */
@@ -108,10 +110,12 @@
 #define  TDA9887_SET_CONFIG  _IOW('t',5,int)
 /* tv card specific */
 # define TDA9887_PRESENT (1<<0)
-# define TDA9887_PORT1   (1<<1)
-# define TDA9887_PORT2   (1<<2)
+# define TDA9887_PORT1_INACTIVE  (1<<1)
+# define TDA9887_PORT2_INACTIVE  (1<<2)
 # define TDA9887_QSS (1<<3)
 # define TDA9887_INTERCARRIER(1<<4)
+# define TDA9887_PORT1_ACTIVE(1<<5)
+# define TDA9887_PORT2_ACTIVE(1<<6)
 /* config options */
 # define TDA9887_DEEMPHASIS_MASK (3<<16)
 # define TDA9887_DEEMPHASIS_NONE (1<<16)
Index: linux-2.6.10/drivers/media/video/tuner.c
===
--- linux-2.6.10.orig/drivers/media/video/tuner.c   2004-12-30 
00:00:10.0 +0100
+++ linux-2.6.10/drivers/media/video/tuner.c2005-01-19 14:12:25.169221007 
+0100
@@ -1,5 +1,5 @@
 /*
- * $Id: tuner.c,v 1.31 2004/11/10 11:07:24 kraxel Exp $
+ * $Id: tuner.c,v 1.36 2005/01/14 13:29:40 kraxel Exp $
  */
 
 #include 
@@ -62,7 +62,7 @@ struct tuner {
v4l2_std_id  std;
int  using_v4l2;
 
-   unsigned int radio;
+   enum v4l2_tuner_type mode;
unsigned int input;
 
// only for MT2032
@@ -265,6 +265,11 @@ static struct tunertype tuners[] = {
{ "Philips PAL/SECAM_D (FM 1256 I-H3)", Philips, PAL,
  16*160.00,16*442.00,0x01,0x02,0x04,0x8e,623 },
 
+   { "Thomson DDT 7610 ATSC/NTSC)", THOMSON, ATSC,
+ 16*157.25,16*454.00,0x39,0x3a,0x3c,0x8e,732},
+   { "Philips FQ1286", Philips, NTSC,
+ 16*160.00,16*454.00,0x41,0x42,0x04,0x8e,940}, // UHF band untested
+
 };
 #define TUNERS ARRAY_SIZE(tuners)
 
@@ -663,7 +668,8 @@ static void mt2050_set_if_freq(struct i2
int ret;
unsigned char buf[6];
 
-   dprintk("mt2050_set_if_freq freq=%d\n",freq);
+   dprintk("mt2050_set_if_freq freq=%d if1=%d if2=%d\n",
+   freq,if1,if2);
 
f_lo1=freq+if1;
f_lo1=(f_lo1/100)*100;
@@ -688,9 +694,10 @@ static void mt2050_set_if_freq(struct i2
div2a=(lo2/8)-1;
div2b=lo2-(div2a+1)*8;
 
-   dprintk("lo1 lo2 = %d %d\n", lo1, lo2);
-dprintk("num1 num2 div1a div1b div2a div2b= %x %x %x %x %x 
%x\n",num1,num2,div1a,div1b,div2a,div2b);
-
+   if (debug > 1) {
+   printk("lo1 lo2 = %d %d\n", lo1, lo2);
+   printk("num1 num2 div1a div1b div2a div2b= %x %x %x %x %x 
%x\n",num1,num2,div1a,div1b,div2a,div2b);
+   }
 
buf[0]=1;
buf[1]= 4*div1b + num1;
@@ -702,7 +709,7 @@ static void mt2050_set_if_freq(struct i2
buf[5]=div2a;
if(num2!=0) buf[5]=buf[5]|0x40;
 
-   if(debug) {
+   if (debug > 1) {
int i;
printk("bufs is: ");
for(i=0;i<6;i++)
@@ -727,6 +734,10 @@ static void mt2050_set_tv_freq(struct i2
 // PAL
 if2 = 38900*1000;
 }
+   if (V4L2_TUNER_DIGITAL_TV == t->mode) {
+   // testing for DVB ...
+   if2 = 36150*1000;
+   }
mt2050_set_if_freq(c, freq*62500, if2);
mt2050_set_antenna(c, tv_antenna);
 }
@@ -1069,14 +1080,18 @@ static void set_freq(struct i2c_client *
 {
struct tuner *t = i2c_get_clientdata(c);
 
-   if (t->radio) {
+   switch (t->mode) {
+   case V4L2_TUNER_RADIO:
dprintk("tuner: radio freq set to %lu.%02lu\n",
freq/16,freq%16*100/16);
set_radio_freq(c,freq);
-   } else {
+

[patch] v4l: add tveeprom module.

2005-01-20 Thread Gerd Knorr
Add a module which can parse config informations out of
TV card eeproms.  Will be used by bttv, cx88 and ivtv.

Signed-off-by: Gerd Knorr <[EMAIL PROTECTED]>
---
 drivers/media/Kconfig  |3 
 drivers/media/video/Makefile   |1 
 drivers/media/video/tveeprom.c |  577 +
 include/media/tveeprom.h   |   23 +
 4 files changed, 604 insertions(+)

Index: linux-2.6.10/include/media/tveeprom.h
===
--- /dev/null   1970-01-01 00:00:00.0 +
+++ linux-2.6.10/include/media/tveeprom.h   2005-01-19 14:11:40.830555813 
+0100
@@ -0,0 +1,23 @@
+struct tveeprom {
+   u32 has_radio;
+
+   u32 tuner_type;
+   u32 tuner_formats;
+
+   u32 digitizer;
+   u32 digitizer_formats;
+
+   u32 audio_processor;
+   /* a_p_fmts? */
+
+   u32 model;
+   u32 revision;
+   u32 serial_number;
+   char rev_str[5];
+};
+
+void tveeprom_hauppauge_analog(struct tveeprom *tvee,
+  unsigned char *eeprom_data);
+
+int tveeprom_read(struct i2c_client *c, unsigned char *eedata, int len);
+int tveeprom_dump(unsigned char *eedata, int len);
Index: linux-2.6.10/drivers/media/video/tveeprom.c
===
--- /dev/null   1970-01-01 00:00:00.0 +
+++ linux-2.6.10/drivers/media/video/tveeprom.c 2005-01-19 14:12:11.606770486 
+0100
@@ -0,0 +1,577 @@
+/* 
+ * tveeprom - eeprom decoder for tvcard configuration eeproms
+ *
+ * Data and decoding routines shamelessly borrowed from bttv-cards.c
+ * eeprom access routine shamelessly borrowed from bttv-if.c
+ * which are:
+
+Copyright (C) 1996,97,98 Ralph  Metzler ([EMAIL PROTECTED])
+   & Marcus Metzler ([EMAIL PROTECTED])
+(c) 1999-2001 Gerd Knorr <[EMAIL PROTECTED]>
+
+ * Adjustments to fit a more general model and all bugs:
+ 
+   Copyright (C) 2003 John Klar 
+
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+MODULE_DESCRIPTION("i2c Hauppauge eeprom decoder driver");
+MODULE_AUTHOR("John Klar");
+MODULE_LICENSE("GPL");
+
+static int debug = 0;
+module_param(debug, int, 0644);
+MODULE_PARM_DESC(debug, "Debug level (0-2)");
+
+#define STRM(array,i) (i < sizeof(array)/sizeof(char*) ? array[i] : "unknown")
+
+#define dprintk(num, args...) \
+   do { \
+   if (debug >= num) \
+   printk(KERN_INFO "tveeprom: " args); \
+   } while (0)
+
+#define TVEEPROM_KERN_ERR(args...) printk(KERN_ERR "tveeprom: " args);
+#define TVEEPROM_KERN_INFO(args...) printk(KERN_INFO "tveeprom: " args);
+
+/* --- */
+/* some hauppauge specific stuff   */
+
+static struct HAUPPAUGE_TUNER_FMT
+{
+   int id;
+   char *name;
+}
+hauppauge_tuner_fmt[] =
+{
+   { 0x, "unknown1" },
+   { 0x, "unknown2" },
+   { 0x0007, "PAL(B/G)" },
+   { 0x1000, "NTSC(M)" },
+   { 0x0010, "PAL(I)" },
+   { 0x0040, "SECAM(L/Lï)" },
+   { 0x0e00, "PAL(D/K)" },
+   { 0x0300, "ATSC Digital" },
+};
+
+/* This is the full list of possible tuners. Many thanks to Hauppauge for
+   supplying this information. Note that many tuners where only used for
+   testing and never made it to the outside world. So you will only see
+   a subset in actual produced cards. */
+static struct HAUPPAUGE_TUNER 
+{
+   int  id;
+   char *name;
+} 
+hauppauge_tuner[] = 
+{
+   /* 0-9 */
+   { TUNER_ABSENT,"None" },
+   { TUNER_ABSENT,"External" },
+   { TUNER_ABSENT,"Unspecified" },
+   { TUNER_PHILIPS_PAL,   "Philips FI1216" },
+   { TUNER_PHILIPS_SECAM, "Philips FI1216MF" },
+   { TUNER_PHILIPS_NTSC,  "Philips FI1236" },
+   { TUNER_PHILIPS_PAL_I, "Philips FI1246" },
+   { TUNER_PHILIPS_PAL_DK,"

[patch] v4l: bttv IR input driver update

2005-01-20 Thread Gerd Knorr
This patch enables IR support for one AverMedia card and
drops a obsolete function.

Signed-off-by: Gerd Knorr <[EMAIL PROTECTED]>
---
 drivers/media/common/ir-common.c  |3 ++-
 drivers/media/video/ir-kbd-gpio.c |4 ++--
 drivers/media/video/ir-kbd-i2c.c  |   14 ++
 3 files changed, 6 insertions(+), 15 deletions(-)

Index: linux-2004-12-16/drivers/media/video/ir-kbd-gpio.c
===
--- linux-2004-12-16.orig/drivers/media/video/ir-kbd-gpio.c 2004-12-17 
12:09:03.0 +0100
+++ linux-2004-12-16/drivers/media/video/ir-kbd-gpio.c  2004-12-17 
12:28:00.761810330 +0100
@@ -1,5 +1,5 @@
 /*
- * $Id: ir-kbd-gpio.c,v 1.10 2004/09/15 16:15:24 kraxel Exp $
+ * $Id: ir-kbd-gpio.c,v 1.11 2004/10/25 11:26:36 kraxel Exp $
  *
  * Copyright (c) 2003 Gerd Knorr
  * Copyright (c) 2003 Pavel Machek
@@ -366,7 +366,7 @@ static int ir_probe(struct device *dev)
break;
 
case BTTV_AVDVBT_761:
-   /* case BTTV_AVDVBT_771: */
+   case BTTV_AVDVBT_771:
ir_codes = ir_codes_avermedia_dvbt;
ir->mask_keycode = 0x0f00c0;
ir->mask_keydown = 0x20;
Index: linux-2004-12-16/drivers/media/video/ir-kbd-i2c.c
===
--- linux-2004-12-16.orig/drivers/media/video/ir-kbd-i2c.c  2004-12-17 
12:06:32.0 +0100
+++ linux-2004-12-16/drivers/media/video/ir-kbd-i2c.c   2004-12-17 
12:28:00.762810142 +0100
@@ -1,5 +1,5 @@
 /*
- * $Id: ir-kbd-i2c.c,v 1.8 2004/09/15 16:15:24 kraxel Exp $
+ * $Id: ir-kbd-i2c.c,v 1.10 2004/12/09 12:51:35 kraxel Exp $
  *
  * keyboard input driver for i2c IR remote controls
  *
@@ -155,16 +155,6 @@ module_param(debug, int, 0644);/* de
 
 /* --- */
 
-static inline int reverse(int data, int bits)
-{
-   int i,c;
-
-   for (c=0,i=0; i
+#include 
 
 #include 
 

-- 
#define printk(args...) fprintf(stderr, ## args)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[patch] v4l: bttv update

2005-01-20 Thread Gerd Knorr
- some cleanups merged.
- use new tveeprom module to configure Hauppauge cards.
- add new tv cards.

Signed-off-by: Gerd Knorr <[EMAIL PROTECTED]>
---
 drivers/media/video/Kconfig   |1 
 drivers/media/video/btcx-risc.c   |3 
 drivers/media/video/bttv-cards.c  |  203 +++---
 drivers/media/video/bttv-driver.c |   21 ++-
 drivers/media/video/bttv-i2c.c|   23 ---
 drivers/media/video/bttv-if.c |   14 +-
 drivers/media/video/bttv-risc.c   |2 
 drivers/media/video/bttv-vbi.c|5 
 drivers/media/video/bttv.h|5 
 drivers/media/video/bttvp.h   |8 -
 10 files changed, 147 insertions(+), 138 deletions(-)

Index: linux-2.6.10/drivers/media/video/bttv.h
===
--- linux-2.6.10.orig/drivers/media/video/bttv.h2005-01-13 
10:48:20.0 +0100
+++ linux-2.6.10/drivers/media/video/bttv.h 2005-01-19 14:12:59.139835175 
+0100
@@ -1,5 +1,5 @@
 /*
- * $Id: bttv.h,v 1.10 2004/10/13 10:39:00 kraxel Exp $
+ * $Id: bttv.h,v 1.14 2005/01/07 13:11:19 kraxel Exp $
  *
  *  bttv - Bt848 frame grabber driver
  *
@@ -133,6 +133,7 @@
 #define BTTV_MATRIX_VISIONSLC 0x7e
 #define BTTV_APAC_VIEWCOMP  0x7f
 #define BTTV_DVICO_DVBT_LITE  0x80
+#define BTTV_TIBET_CS16  0x83
 
 /* i2c address list */
 #define I2C_TSA55220xc2
@@ -149,7 +150,7 @@
 #define I2C_VHX0xc0
 #define I2C_MSP34000x80
 #define I2C_MSP3400_ALT0x88
-#define I2C_TEA63000x80
+#define I2C_TEA63000x80 /* also used by 6320 */
 #define I2C_DPL3518   0x84
 #define I2C_TDA9887   0x86
 
Index: linux-2.6.10/drivers/media/video/bttvp.h
===
--- linux-2.6.10.orig/drivers/media/video/bttvp.h   2005-01-13 
10:48:20.0 +0100
+++ linux-2.6.10/drivers/media/video/bttvp.h2005-01-19 14:12:59.147833671 
+0100
@@ -1,5 +1,5 @@
 /*
-$Id: bttvp.h,v 1.12 2004/10/25 11:26:36 kraxel Exp $
+$Id: bttvp.h,v 1.15 2004/12/14 15:33:30 kraxel Exp $
 
 bttv - Bt848 frame grabber driver
 
@@ -43,6 +43,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include "bt848.h"
@@ -224,11 +225,6 @@ extern unsigned int bttv_gpio;
 extern void bttv_gpio_tracking(struct bttv *btv, char *comment);
 extern int init_bttv_i2c(struct bttv *btv);
 extern int fini_bttv_i2c(struct bttv *btv);
-extern int pvr_boot(struct bttv *btv);
-
-extern int bttv_common_ioctls(struct bttv *btv, unsigned int cmd, void *arg);
-extern void bttv_reinit_bt848(struct bttv *btv);
-extern void bttv_field_count(struct bttv *btv);
 
 #define vprintk  if (bttv_verbose) printk
 #define dprintk  if (bttv_debug >= 1) printk
Index: linux-2.6.10/drivers/media/video/bttv-driver.c
===
--- linux-2.6.10.orig/drivers/media/video/bttv-driver.c 2005-01-13 
10:48:20.0 +0100
+++ linux-2.6.10/drivers/media/video/bttv-driver.c  2005-01-19 
14:12:59.168829724 +0100
@@ -1,5 +1,5 @@
 /*
-$Id: bttv-driver.c,v 1.27 2004/11/07 14:44:59 kraxel Exp $
+$Id: bttv-driver.c,v 1.34 2005/01/07 13:11:19 kraxel Exp $
 
 bttv - Bt848 frame grabber driver
 
@@ -27,6 +27,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -105,6 +106,7 @@ module_param(adc_crush, int, 044
 module_param(whitecrush_upper,  int, 0444);
 module_param(whitecrush_lower,  int, 0444);
 module_param(vcr_hack,  int, 0444);
+
 module_param_array(radio, int, NULL, 0444);
 
 MODULE_PARM_DESC(radio,"The TV card supports radio, default is 0 (no)");
@@ -1063,7 +1065,7 @@ static void init_bt848(struct bttv *btv)
init_irqreg(btv);
 }
 
-void bttv_reinit_bt848(struct bttv *btv)
+static void bttv_reinit_bt848(struct bttv *btv)
 {
unsigned long flags;
 
@@ -1267,7 +1269,7 @@ void bttv_gpio_tracking(struct bttv *btv
   btv->c.nr,outbits,data & outbits, data & ~outbits, comment);
 }
 
-void bttv_field_count(struct bttv *btv)
+static void bttv_field_count(struct bttv *btv)
 {
int need_count = 0;
 
@@ -1467,7 +1469,7 @@ static const char *v4l1_ioctls[] = {
"SMICROCODE", "GVBIFMT", "SVBIFMT" };
 #define V4L1_IOCTLS ARRAY_SIZE(v4l1_ioctls)
 
-int bttv_common_ioctls(struct bttv *btv, unsigned int cmd, void *arg)
+static int bttv_common_ioctls(struct bttv *btv, unsigned int cmd, void *arg)
 {
switch (cmd) {
 case BTTV_VERSION:
@@ -2531,9 +2533,11 @@ static int bttv_do_ioctl(struct inode *i
V4L2_CAP_VIDEO_CAPTURE |
V4L2_CAP_VIDEO_OVERLAY |
V4L2_CAP_VBI_CAPTURE |
-   V4L2_CAP_TUNER |
V4L2_CAP_READWRITE |
V4L2_CAP_STREAMING;
+   if (bttv_tvcards[btv->c.type].tuner != UNSET &&
+   bttv_tvca

[patch] v4l: saa7134 module

2005-01-20 Thread Gerd Knorr
- fix saa7134 module loading issues.

Signed-off-by: Gerd Knorr <[EMAIL PROTECTED]>
---
 drivers/media/video/saa7134/saa7134-core.c |   47 -
 1 files changed, 45 insertions(+), 2 deletions(-)

Index: linux-2.6.10/drivers/media/video/saa7134/saa7134-core.c
===
--- linux-2.6.10.orig/drivers/media/video/saa7134/saa7134-core.c
2005-01-10 12:40:58.613644368 +0100
+++ linux-2.6.10/drivers/media/video/saa7134/saa7134-core.c 2005-01-10 
12:40:59.759428971 +0100
@@ -222,6 +222,49 @@ static void dump_statusregs(struct saa71
 }
 #endif
 
+/* --- */
+/* delayed request_module  */
+
+static int need_empress;
+static int need_dvb;
+
+static int pending_call(struct notifier_block *self, unsigned long state,
+   void *module)
+{
+   if (module != THIS_MODULE || state != MODULE_STATE_LIVE)
+   return NOTIFY_DONE;
+
+if (need_empress)
+request_module("saa7134-empress");
+if (need_dvb)
+request_module("saa7134-dvb");
+   return NOTIFY_DONE;
+}
+
+static int pending_registered;
+static struct notifier_block pending_notifier = {
+   .notifier_call = pending_call,
+};
+
+static void request_module_depend(char *name, int *flag)
+{
+   switch (THIS_MODULE->state) {
+   case MODULE_STATE_COMING:
+   if (!pending_registered) {
+   register_module_notifier(_notifier);
+   pending_registered = 1;
+   }
+   *flag = 1;
+   break;
+   case MODULE_STATE_LIVE:
+   request_module(name);
+   break;
+   default:
+   /* nothing */;
+   break;
+   }
+}
+
 /* -- */
 
 /* nr of (saa7134-)pages for the given buffer size */
@@ -941,11 +984,11 @@ static int __devinit saa7134_initdev(str
if (dev->tda9887_conf)
request_module("tda9887");
if (card_is_empress(dev)) {
-   request_module("saa7134-empress");
request_module("saa6752hs");
+   request_module_depend("saa7134-empress",_empress);
}
if (card_is_dvb(dev))
-   request_module("saa7134-dvb");
+   request_module_depend("saa7134-dvb",_dvb);
 
v4l2_prio_init(>prio);
 

-- 
#define printk(args...) fprintf(stderr, ## args)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[patch] videotext: ioctls changed to use _IO macros

2005-01-20 Thread Gerd Knorr
From: [EMAIL PROTECTED] (Michael Geng)

This patch switches the videotext drivers over to use the _IO
macros for ioctls.  video_usercopy() works correctly then.
The drivers will also map the old to the new ioctl numbers to
make sure old apps don't break.

The patch also updates Documentation/ioctl.h to reflect that change.
and deletes a unused struct in include/linux/videotext.h.

Signed-off-by: Gerd Knorr <[EMAIL PROTECTED]>
---
 Documentation/ioctl-number.txt |3 -
 drivers/media/video/saa5246a.c |   49 +++
 drivers/media/video/saa5246a.h |2 
 drivers/media/video/saa5249.c  |   54 
 include/linux/videotext.h  |   85 -
 5 files changed, 138 insertions(+), 55 deletions(-)

Index: linux-2004-12-08/Documentation/ioctl-number.txt
===
--- linux-2004-12-08.orig/Documentation/ioctl-number.txt2004-12-09 
14:18:34.0 +0100
+++ linux-2004-12-08/Documentation/ioctl-number.txt 2004-12-14 
13:18:03.988861152 +0100
@@ -145,7 +145,7 @@ CodeSeq#Include FileComments
 'p'40-7F   linux/nvram.h
 'p'80-9F   user-space parport
<mailto:[EMAIL PROTECTED]>
-'q'00-1F   linux/videotext.h   conflict!
+'q'00-1F   linux/serio.h
 'q'80-FF   Internet PhoneJACK, Internet LineJACK
<http://www.quicknet.net>
 'r'00-1F   linux/msdos_fs.h
@@ -163,6 +163,7 @@ CodeSeq#Include FileComments
 'z'40-7F   CAN bus card
<mailto:[EMAIL PROTECTED]>
 0x80   00-1F   linux/fb.h
+0x81   00-1F   linux/videotext.h
 0x89   00-06   asm-i386/sockios.h
 0x89   0B-DF   linux/sockios.h
 0x89   E0-EF   linux/sockios.h SIOCPROTOPRIVATE range
Index: linux-2004-12-08/drivers/media/video/saa5246a.c
===
--- linux-2004-12-08.orig/drivers/media/video/saa5246a.c2004-12-09 
14:16:45.0 +0100
+++ linux-2004-12-08/drivers/media/video/saa5246a.c 2004-12-14 
13:18:04.062847242 +0100
@@ -682,6 +682,54 @@ static int do_saa5246a_ioctl(struct inod
 }
 
 /*
+ * Translates old vtx IOCTLs to new ones
+ *
+ * This keeps new kernel versions compatible with old userspace programs.
+ */
+static inline unsigned int vtx_fix_command(unsigned int cmd)
+{
+   switch (cmd) {
+   case VTXIOCGETINFO_OLD:
+   cmd = VTXIOCGETINFO;
+   break;
+   case VTXIOCCLRPAGE_OLD:
+   cmd = VTXIOCCLRPAGE;
+   break;
+   case VTXIOCCLRFOUND_OLD:
+   cmd = VTXIOCCLRFOUND;
+   break;
+   case VTXIOCPAGEREQ_OLD:
+   cmd = VTXIOCPAGEREQ;
+   break;
+   case VTXIOCGETSTAT_OLD:
+   cmd = VTXIOCGETSTAT;
+   break;
+   case VTXIOCGETPAGE_OLD:
+   cmd = VTXIOCGETPAGE;
+   break;
+   case VTXIOCSTOPDAU_OLD:
+   cmd = VTXIOCSTOPDAU;
+   break;
+   case VTXIOCPUTPAGE_OLD:
+   cmd = VTXIOCPUTPAGE;
+   break;
+   case VTXIOCSETDISP_OLD:
+   cmd = VTXIOCSETDISP;
+   break;
+   case VTXIOCPUTSTAT_OLD:
+   cmd = VTXIOCPUTSTAT;
+   break;
+   case VTXIOCCLRCACHE_OLD:
+   cmd = VTXIOCCLRCACHE;
+   break;
+   case VTXIOCSETVIRT_OLD:
+   cmd = VTXIOCSETVIRT;
+   break;
+   }
+   return cmd;
+}
+
+/*
  * Handle the locking
  */
 static int saa5246a_ioctl(struct inode *inode, struct file *file,
@@ -691,6 +739,7 @@ static int saa5246a_ioctl(struct inode *
struct saa5246a_device *t = vd->priv;
int err;
 
+   cmd = vtx_fix_command(cmd);
down(>lock);
err = video_usercopy(inode, file, cmd, arg, do_saa5246a_ioctl);
up(>lock);
Index: linux-2004-12-08/drivers/media/video/saa5246a.h
===
--- linux-2004-12-08.orig/drivers/media/video/saa5246a.h2004-12-09 
14:17:58.0 +0100
+++ linux-2004-12-08/drivers/media/video/saa5246a.h 2004-12-14 
13:18:04.083843294 +0100
@@ -23,7 +23,7 @@
 #define __SAA5246A_H__
 
 #define MAJOR_VERSION 1/* driver major version number */
-#define MINOR_VERSION 7/* driver minor version number */
+#define MINOR_VERSION 8/* driver minor version number */
 
 #define IF_NAME "SAA5246A"
 
Index: linux-2004-12-08/drivers/media/video/saa5249.c
===
--- linux-2004-12-08.orig/drivers/media/video/saa5249.c 2004-12-09 
14:17:56.0 +0100
+++ linux-2004-12-08/drivers/media/video/saa5249.

Re: bttv/v4l2/Linux 2.6.10-ac8: xawtv hanging in videobuf_waiton

2005-01-20 Thread Gerd Knorr
> About 100 pixels from my windowmaker background got garbled (I also ran
> xrefresh) while panicking ;-> and "rpm -V mozilla" showed three modified
> libs.

> However, the libs were OK after reboot (maybe because no time for syncing),
> but reiserfsck found vpf-10640 error for /var partition.

Thats typical for page cache corruption.  The libs are read-only data
and thus never ever flushed back to disk, thus a reboot will fix it.
Creating some memory pressure to make the kernel drop the corrupted
pages from the cache should make it go away as well.

> How to debug this kind of memory corruption?
> 
> garbled by bttv:
> 
> 0035b000  08 00 00 14 00 c0 35 0a  f8 03 00 18 08 cc 35 0a  |..5...5.|
> 0035b010  08 08 00 14 00 50 0a 03  f8 0b 00 18 08 64 88 0a  |.P...d..|

Could be bt878 risc code.  No idea how this makes it into the mozilla
libs ...

  Gerd

-- 
#define printk(args...) fprintf(stderr, ## args)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: bttv/v4l2/Linux 2.6.10-ac8: xawtv hanging in videobuf_waiton

2005-01-20 Thread Gerd Knorr
 About 100 pixels from my windowmaker background got garbled (I also ran
 xrefresh) while panicking ;- and rpm -V mozilla showed three modified
 libs.

 However, the libs were OK after reboot (maybe because no time for syncing),
 but reiserfsck found vpf-10640 error for /var partition.

Thats typical for page cache corruption.  The libs are read-only data
and thus never ever flushed back to disk, thus a reboot will fix it.
Creating some memory pressure to make the kernel drop the corrupted
pages from the cache should make it go away as well.

 How to debug this kind of memory corruption?
 
 garbled by bttv:
 
 0035b000  08 00 00 14 00 c0 35 0a  f8 03 00 18 08 cc 35 0a  |..5...5.|
 0035b010  08 08 00 14 00 50 0a 03  f8 0b 00 18 08 64 88 0a  |.P...d..|

Could be bt878 risc code.  No idea how this makes it into the mozilla
libs ...

  Gerd

-- 
#define printk(args...) fprintf(stderr, ## args)
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[patch] videotext: ioctls changed to use _IO macros

2005-01-20 Thread Gerd Knorr
From: [EMAIL PROTECTED] (Michael Geng)

This patch switches the videotext drivers over to use the _IO
macros for ioctls.  video_usercopy() works correctly then.
The drivers will also map the old to the new ioctl numbers to
make sure old apps don't break.

The patch also updates Documentation/ioctl.h to reflect that change.
and deletes a unused struct in include/linux/videotext.h.

Signed-off-by: Gerd Knorr [EMAIL PROTECTED]
---
 Documentation/ioctl-number.txt |3 -
 drivers/media/video/saa5246a.c |   49 +++
 drivers/media/video/saa5246a.h |2 
 drivers/media/video/saa5249.c  |   54 
 include/linux/videotext.h  |   85 -
 5 files changed, 138 insertions(+), 55 deletions(-)

Index: linux-2004-12-08/Documentation/ioctl-number.txt
===
--- linux-2004-12-08.orig/Documentation/ioctl-number.txt2004-12-09 
14:18:34.0 +0100
+++ linux-2004-12-08/Documentation/ioctl-number.txt 2004-12-14 
13:18:03.988861152 +0100
@@ -145,7 +145,7 @@ CodeSeq#Include FileComments
 'p'40-7F   linux/nvram.h
 'p'80-9F   user-space parport
mailto:[EMAIL PROTECTED]
-'q'00-1F   linux/videotext.h   conflict!
+'q'00-1F   linux/serio.h
 'q'80-FF   Internet PhoneJACK, Internet LineJACK
http://www.quicknet.net
 'r'00-1F   linux/msdos_fs.h
@@ -163,6 +163,7 @@ CodeSeq#Include FileComments
 'z'40-7F   CAN bus card
mailto:[EMAIL PROTECTED]
 0x80   00-1F   linux/fb.h
+0x81   00-1F   linux/videotext.h
 0x89   00-06   asm-i386/sockios.h
 0x89   0B-DF   linux/sockios.h
 0x89   E0-EF   linux/sockios.h SIOCPROTOPRIVATE range
Index: linux-2004-12-08/drivers/media/video/saa5246a.c
===
--- linux-2004-12-08.orig/drivers/media/video/saa5246a.c2004-12-09 
14:16:45.0 +0100
+++ linux-2004-12-08/drivers/media/video/saa5246a.c 2004-12-14 
13:18:04.062847242 +0100
@@ -682,6 +682,54 @@ static int do_saa5246a_ioctl(struct inod
 }
 
 /*
+ * Translates old vtx IOCTLs to new ones
+ *
+ * This keeps new kernel versions compatible with old userspace programs.
+ */
+static inline unsigned int vtx_fix_command(unsigned int cmd)
+{
+   switch (cmd) {
+   case VTXIOCGETINFO_OLD:
+   cmd = VTXIOCGETINFO;
+   break;
+   case VTXIOCCLRPAGE_OLD:
+   cmd = VTXIOCCLRPAGE;
+   break;
+   case VTXIOCCLRFOUND_OLD:
+   cmd = VTXIOCCLRFOUND;
+   break;
+   case VTXIOCPAGEREQ_OLD:
+   cmd = VTXIOCPAGEREQ;
+   break;
+   case VTXIOCGETSTAT_OLD:
+   cmd = VTXIOCGETSTAT;
+   break;
+   case VTXIOCGETPAGE_OLD:
+   cmd = VTXIOCGETPAGE;
+   break;
+   case VTXIOCSTOPDAU_OLD:
+   cmd = VTXIOCSTOPDAU;
+   break;
+   case VTXIOCPUTPAGE_OLD:
+   cmd = VTXIOCPUTPAGE;
+   break;
+   case VTXIOCSETDISP_OLD:
+   cmd = VTXIOCSETDISP;
+   break;
+   case VTXIOCPUTSTAT_OLD:
+   cmd = VTXIOCPUTSTAT;
+   break;
+   case VTXIOCCLRCACHE_OLD:
+   cmd = VTXIOCCLRCACHE;
+   break;
+   case VTXIOCSETVIRT_OLD:
+   cmd = VTXIOCSETVIRT;
+   break;
+   }
+   return cmd;
+}
+
+/*
  * Handle the locking
  */
 static int saa5246a_ioctl(struct inode *inode, struct file *file,
@@ -691,6 +739,7 @@ static int saa5246a_ioctl(struct inode *
struct saa5246a_device *t = vd-priv;
int err;
 
+   cmd = vtx_fix_command(cmd);
down(t-lock);
err = video_usercopy(inode, file, cmd, arg, do_saa5246a_ioctl);
up(t-lock);
Index: linux-2004-12-08/drivers/media/video/saa5246a.h
===
--- linux-2004-12-08.orig/drivers/media/video/saa5246a.h2004-12-09 
14:17:58.0 +0100
+++ linux-2004-12-08/drivers/media/video/saa5246a.h 2004-12-14 
13:18:04.083843294 +0100
@@ -23,7 +23,7 @@
 #define __SAA5246A_H__
 
 #define MAJOR_VERSION 1/* driver major version number */
-#define MINOR_VERSION 7/* driver minor version number */
+#define MINOR_VERSION 8/* driver minor version number */
 
 #define IF_NAME SAA5246A
 
Index: linux-2004-12-08/drivers/media/video/saa5249.c
===
--- linux-2004-12-08.orig/drivers/media/video/saa5249.c 2004-12-09 
14:17:56.0 +0100
+++ linux-2004-12-08/drivers/media/video/saa5249.c  2004-12-14 
13:18:04.094841227 +0100
@@ -1,4 +1,7

[patch] v4l: saa7134 module

2005-01-20 Thread Gerd Knorr
- fix saa7134 module loading issues.

Signed-off-by: Gerd Knorr [EMAIL PROTECTED]
---
 drivers/media/video/saa7134/saa7134-core.c |   47 -
 1 files changed, 45 insertions(+), 2 deletions(-)

Index: linux-2.6.10/drivers/media/video/saa7134/saa7134-core.c
===
--- linux-2.6.10.orig/drivers/media/video/saa7134/saa7134-core.c
2005-01-10 12:40:58.613644368 +0100
+++ linux-2.6.10/drivers/media/video/saa7134/saa7134-core.c 2005-01-10 
12:40:59.759428971 +0100
@@ -222,6 +222,49 @@ static void dump_statusregs(struct saa71
 }
 #endif
 
+/* --- */
+/* delayed request_module  */
+
+static int need_empress;
+static int need_dvb;
+
+static int pending_call(struct notifier_block *self, unsigned long state,
+   void *module)
+{
+   if (module != THIS_MODULE || state != MODULE_STATE_LIVE)
+   return NOTIFY_DONE;
+
+if (need_empress)
+request_module(saa7134-empress);
+if (need_dvb)
+request_module(saa7134-dvb);
+   return NOTIFY_DONE;
+}
+
+static int pending_registered;
+static struct notifier_block pending_notifier = {
+   .notifier_call = pending_call,
+};
+
+static void request_module_depend(char *name, int *flag)
+{
+   switch (THIS_MODULE-state) {
+   case MODULE_STATE_COMING:
+   if (!pending_registered) {
+   register_module_notifier(pending_notifier);
+   pending_registered = 1;
+   }
+   *flag = 1;
+   break;
+   case MODULE_STATE_LIVE:
+   request_module(name);
+   break;
+   default:
+   /* nothing */;
+   break;
+   }
+}
+
 /* -- */
 
 /* nr of (saa7134-)pages for the given buffer size */
@@ -941,11 +984,11 @@ static int __devinit saa7134_initdev(str
if (dev-tda9887_conf)
request_module(tda9887);
if (card_is_empress(dev)) {
-   request_module(saa7134-empress);
request_module(saa6752hs);
+   request_module_depend(saa7134-empress,need_empress);
}
if (card_is_dvb(dev))
-   request_module(saa7134-dvb);
+   request_module_depend(saa7134-dvb,need_dvb);
 
v4l2_prio_init(dev-prio);
 

-- 
#define printk(args...) fprintf(stderr, ## args)
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[patch] v4l: bttv update

2005-01-20 Thread Gerd Knorr
- some cleanups merged.
- use new tveeprom module to configure Hauppauge cards.
- add new tv cards.

Signed-off-by: Gerd Knorr [EMAIL PROTECTED]
---
 drivers/media/video/Kconfig   |1 
 drivers/media/video/btcx-risc.c   |3 
 drivers/media/video/bttv-cards.c  |  203 +++---
 drivers/media/video/bttv-driver.c |   21 ++-
 drivers/media/video/bttv-i2c.c|   23 ---
 drivers/media/video/bttv-if.c |   14 +-
 drivers/media/video/bttv-risc.c   |2 
 drivers/media/video/bttv-vbi.c|5 
 drivers/media/video/bttv.h|5 
 drivers/media/video/bttvp.h   |8 -
 10 files changed, 147 insertions(+), 138 deletions(-)

Index: linux-2.6.10/drivers/media/video/bttv.h
===
--- linux-2.6.10.orig/drivers/media/video/bttv.h2005-01-13 
10:48:20.0 +0100
+++ linux-2.6.10/drivers/media/video/bttv.h 2005-01-19 14:12:59.139835175 
+0100
@@ -1,5 +1,5 @@
 /*
- * $Id: bttv.h,v 1.10 2004/10/13 10:39:00 kraxel Exp $
+ * $Id: bttv.h,v 1.14 2005/01/07 13:11:19 kraxel Exp $
  *
  *  bttv - Bt848 frame grabber driver
  *
@@ -133,6 +133,7 @@
 #define BTTV_MATRIX_VISIONSLC 0x7e
 #define BTTV_APAC_VIEWCOMP  0x7f
 #define BTTV_DVICO_DVBT_LITE  0x80
+#define BTTV_TIBET_CS16  0x83
 
 /* i2c address list */
 #define I2C_TSA55220xc2
@@ -149,7 +150,7 @@
 #define I2C_VHX0xc0
 #define I2C_MSP34000x80
 #define I2C_MSP3400_ALT0x88
-#define I2C_TEA63000x80
+#define I2C_TEA63000x80 /* also used by 6320 */
 #define I2C_DPL3518   0x84
 #define I2C_TDA9887   0x86
 
Index: linux-2.6.10/drivers/media/video/bttvp.h
===
--- linux-2.6.10.orig/drivers/media/video/bttvp.h   2005-01-13 
10:48:20.0 +0100
+++ linux-2.6.10/drivers/media/video/bttvp.h2005-01-19 14:12:59.147833671 
+0100
@@ -1,5 +1,5 @@
 /*
-$Id: bttvp.h,v 1.12 2004/10/25 11:26:36 kraxel Exp $
+$Id: bttvp.h,v 1.15 2004/12/14 15:33:30 kraxel Exp $
 
 bttv - Bt848 frame grabber driver
 
@@ -43,6 +43,7 @@
 #include media/video-buf.h
 #include media/audiochip.h
 #include media/tuner.h
+#include media/tveeprom.h
 #include media/ir-common.h
 
 #include bt848.h
@@ -224,11 +225,6 @@ extern unsigned int bttv_gpio;
 extern void bttv_gpio_tracking(struct bttv *btv, char *comment);
 extern int init_bttv_i2c(struct bttv *btv);
 extern int fini_bttv_i2c(struct bttv *btv);
-extern int pvr_boot(struct bttv *btv);
-
-extern int bttv_common_ioctls(struct bttv *btv, unsigned int cmd, void *arg);
-extern void bttv_reinit_bt848(struct bttv *btv);
-extern void bttv_field_count(struct bttv *btv);
 
 #define vprintk  if (bttv_verbose) printk
 #define dprintk  if (bttv_debug = 1) printk
Index: linux-2.6.10/drivers/media/video/bttv-driver.c
===
--- linux-2.6.10.orig/drivers/media/video/bttv-driver.c 2005-01-13 
10:48:20.0 +0100
+++ linux-2.6.10/drivers/media/video/bttv-driver.c  2005-01-19 
14:12:59.168829724 +0100
@@ -1,5 +1,5 @@
 /*
-$Id: bttv-driver.c,v 1.27 2004/11/07 14:44:59 kraxel Exp $
+$Id: bttv-driver.c,v 1.34 2005/01/07 13:11:19 kraxel Exp $
 
 bttv - Bt848 frame grabber driver
 
@@ -27,6 +27,7 @@
 
 #include linux/init.h
 #include linux/module.h
+#include linux/moduleparam.h
 #include linux/delay.h
 #include linux/errno.h
 #include linux/fs.h
@@ -105,6 +106,7 @@ module_param(adc_crush, int, 044
 module_param(whitecrush_upper,  int, 0444);
 module_param(whitecrush_lower,  int, 0444);
 module_param(vcr_hack,  int, 0444);
+
 module_param_array(radio, int, NULL, 0444);
 
 MODULE_PARM_DESC(radio,The TV card supports radio, default is 0 (no));
@@ -1063,7 +1065,7 @@ static void init_bt848(struct bttv *btv)
init_irqreg(btv);
 }
 
-void bttv_reinit_bt848(struct bttv *btv)
+static void bttv_reinit_bt848(struct bttv *btv)
 {
unsigned long flags;
 
@@ -1267,7 +1269,7 @@ void bttv_gpio_tracking(struct bttv *btv
   btv-c.nr,outbits,data  outbits, data  ~outbits, comment);
 }
 
-void bttv_field_count(struct bttv *btv)
+static void bttv_field_count(struct bttv *btv)
 {
int need_count = 0;
 
@@ -1467,7 +1469,7 @@ static const char *v4l1_ioctls[] = {
SMICROCODE, GVBIFMT, SVBIFMT };
 #define V4L1_IOCTLS ARRAY_SIZE(v4l1_ioctls)
 
-int bttv_common_ioctls(struct bttv *btv, unsigned int cmd, void *arg)
+static int bttv_common_ioctls(struct bttv *btv, unsigned int cmd, void *arg)
 {
switch (cmd) {
 case BTTV_VERSION:
@@ -2531,9 +2533,11 @@ static int bttv_do_ioctl(struct inode *i
V4L2_CAP_VIDEO_CAPTURE |
V4L2_CAP_VIDEO_OVERLAY |
V4L2_CAP_VBI_CAPTURE |
-   V4L2_CAP_TUNER |
V4L2_CAP_READWRITE |
V4L2_CAP_STREAMING;
+   if (bttv_tvcards[btv-c.type

[patch] v4l: add tveeprom module.

2005-01-20 Thread Gerd Knorr
Add a module which can parse config informations out of
TV card eeproms.  Will be used by bttv, cx88 and ivtv.

Signed-off-by: Gerd Knorr [EMAIL PROTECTED]
---
 drivers/media/Kconfig  |3 
 drivers/media/video/Makefile   |1 
 drivers/media/video/tveeprom.c |  577 +
 include/media/tveeprom.h   |   23 +
 4 files changed, 604 insertions(+)

Index: linux-2.6.10/include/media/tveeprom.h
===
--- /dev/null   1970-01-01 00:00:00.0 +
+++ linux-2.6.10/include/media/tveeprom.h   2005-01-19 14:11:40.830555813 
+0100
@@ -0,0 +1,23 @@
+struct tveeprom {
+   u32 has_radio;
+
+   u32 tuner_type;
+   u32 tuner_formats;
+
+   u32 digitizer;
+   u32 digitizer_formats;
+
+   u32 audio_processor;
+   /* a_p_fmts? */
+
+   u32 model;
+   u32 revision;
+   u32 serial_number;
+   char rev_str[5];
+};
+
+void tveeprom_hauppauge_analog(struct tveeprom *tvee,
+  unsigned char *eeprom_data);
+
+int tveeprom_read(struct i2c_client *c, unsigned char *eedata, int len);
+int tveeprom_dump(unsigned char *eedata, int len);
Index: linux-2.6.10/drivers/media/video/tveeprom.c
===
--- /dev/null   1970-01-01 00:00:00.0 +
+++ linux-2.6.10/drivers/media/video/tveeprom.c 2005-01-19 14:12:11.606770486 
+0100
@@ -0,0 +1,577 @@
+/* 
+ * tveeprom - eeprom decoder for tvcard configuration eeproms
+ *
+ * Data and decoding routines shamelessly borrowed from bttv-cards.c
+ * eeprom access routine shamelessly borrowed from bttv-if.c
+ * which are:
+
+Copyright (C) 1996,97,98 Ralph  Metzler ([EMAIL PROTECTED])
+Marcus Metzler ([EMAIL PROTECTED])
+(c) 1999-2001 Gerd Knorr [EMAIL PROTECTED]
+
+ * Adjustments to fit a more general model and all bugs:
+ 
+   Copyright (C) 2003 John Klar linpvr at projectplasma.com
+
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+
+#include linux/module.h
+#include linux/errno.h
+#include linux/kernel.h
+#include linux/init.h
+#include linux/types.h
+#include linux/i2c.h
+
+#include media/tuner.h
+#include media/tveeprom.h
+
+MODULE_DESCRIPTION(i2c Hauppauge eeprom decoder driver);
+MODULE_AUTHOR(John Klar);
+MODULE_LICENSE(GPL);
+
+static int debug = 0;
+module_param(debug, int, 0644);
+MODULE_PARM_DESC(debug, Debug level (0-2));
+
+#define STRM(array,i) (i  sizeof(array)/sizeof(char*) ? array[i] : unknown)
+
+#define dprintk(num, args...) \
+   do { \
+   if (debug = num) \
+   printk(KERN_INFO tveeprom:  args); \
+   } while (0)
+
+#define TVEEPROM_KERN_ERR(args...) printk(KERN_ERR tveeprom:  args);
+#define TVEEPROM_KERN_INFO(args...) printk(KERN_INFO tveeprom:  args);
+
+/* --- */
+/* some hauppauge specific stuff   */
+
+static struct HAUPPAUGE_TUNER_FMT
+{
+   int id;
+   char *name;
+}
+hauppauge_tuner_fmt[] =
+{
+   { 0x, unknown1 },
+   { 0x, unknown2 },
+   { 0x0007, PAL(B/G) },
+   { 0x1000, NTSC(M) },
+   { 0x0010, PAL(I) },
+   { 0x0040, SECAM(L/L) },
+   { 0x0e00, PAL(D/K) },
+   { 0x0300, ATSC Digital },
+};
+
+/* This is the full list of possible tuners. Many thanks to Hauppauge for
+   supplying this information. Note that many tuners where only used for
+   testing and never made it to the outside world. So you will only see
+   a subset in actual produced cards. */
+static struct HAUPPAUGE_TUNER 
+{
+   int  id;
+   char *name;
+} 
+hauppauge_tuner[] = 
+{
+   /* 0-9 */
+   { TUNER_ABSENT,None },
+   { TUNER_ABSENT,External },
+   { TUNER_ABSENT,Unspecified },
+   { TUNER_PHILIPS_PAL,   Philips FI1216 },
+   { TUNER_PHILIPS_SECAM, Philips FI1216MF },
+   { TUNER_PHILIPS_NTSC,  Philips FI1236 },
+   { TUNER_PHILIPS_PAL_I, Philips FI1246 },
+   { TUNER_PHILIPS_PAL_DK,Philips FI1256 },
+   { TUNER_PHILIPS_PAL,   Philips FI1216 MK2 },
+   { TUNER_PHILIPS_SECAM, Philips FI1216MF MK2 },
+   /* 10-19 */
+   { TUNER_PHILIPS_NTSC

[patch] v4l: bttv IR input driver update

2005-01-20 Thread Gerd Knorr
This patch enables IR support for one AverMedia card and
drops a obsolete function.

Signed-off-by: Gerd Knorr [EMAIL PROTECTED]
---
 drivers/media/common/ir-common.c  |3 ++-
 drivers/media/video/ir-kbd-gpio.c |4 ++--
 drivers/media/video/ir-kbd-i2c.c  |   14 ++
 3 files changed, 6 insertions(+), 15 deletions(-)

Index: linux-2004-12-16/drivers/media/video/ir-kbd-gpio.c
===
--- linux-2004-12-16.orig/drivers/media/video/ir-kbd-gpio.c 2004-12-17 
12:09:03.0 +0100
+++ linux-2004-12-16/drivers/media/video/ir-kbd-gpio.c  2004-12-17 
12:28:00.761810330 +0100
@@ -1,5 +1,5 @@
 /*
- * $Id: ir-kbd-gpio.c,v 1.10 2004/09/15 16:15:24 kraxel Exp $
+ * $Id: ir-kbd-gpio.c,v 1.11 2004/10/25 11:26:36 kraxel Exp $
  *
  * Copyright (c) 2003 Gerd Knorr
  * Copyright (c) 2003 Pavel Machek
@@ -366,7 +366,7 @@ static int ir_probe(struct device *dev)
break;
 
case BTTV_AVDVBT_761:
-   /* case BTTV_AVDVBT_771: */
+   case BTTV_AVDVBT_771:
ir_codes = ir_codes_avermedia_dvbt;
ir-mask_keycode = 0x0f00c0;
ir-mask_keydown = 0x20;
Index: linux-2004-12-16/drivers/media/video/ir-kbd-i2c.c
===
--- linux-2004-12-16.orig/drivers/media/video/ir-kbd-i2c.c  2004-12-17 
12:06:32.0 +0100
+++ linux-2004-12-16/drivers/media/video/ir-kbd-i2c.c   2004-12-17 
12:28:00.762810142 +0100
@@ -1,5 +1,5 @@
 /*
- * $Id: ir-kbd-i2c.c,v 1.8 2004/09/15 16:15:24 kraxel Exp $
+ * $Id: ir-kbd-i2c.c,v 1.10 2004/12/09 12:51:35 kraxel Exp $
  *
  * keyboard input driver for i2c IR remote controls
  *
@@ -155,16 +155,6 @@ module_param(debug, int, 0644);/* de
 
 /* --- */
 
-static inline int reverse(int data, int bits)
-{
-   int i,c;
-
-   for (c=0,i=0; ibits; i++) {
-   c |= (((data  (1i)) ? 1:0))  (bits-1-i);
-   }
-   return c;
-}
-
 static int get_key_haup(struct IR *ir, u32 *ir_key, u32 *ir_raw)
 {
unsigned char buf[3];
@@ -443,7 +433,7 @@ static int ir_probe(struct i2c_adapter *
*/
 
static const int probe_bttv[] = { 0x1a, 0x18, 0x4b, 0x64, 0x30, -1};
-   static const int probe_saa7134[] = { 0x7a, -1};
+   static const int probe_saa7134[] = { 0x7a, -1 };
const int *probe = NULL;
struct i2c_client c; char buf; int i,rc;
 
Index: linux-2004-12-16/drivers/media/common/ir-common.c
===
--- linux-2004-12-16.orig/drivers/media/common/ir-common.c  2004-12-17 
12:08:49.0 +0100
+++ linux-2004-12-16/drivers/media/common/ir-common.c   2004-12-17 
12:28:11.383812920 +0100
@@ -1,5 +1,5 @@
 /*
- * $Id: ir-common.c,v 1.5 2004/11/07 13:17:15 kraxel Exp $
+ * $Id: ir-common.c,v 1.6 2004/12/10 12:33:39 kraxel Exp $
  *
  * some common structs and functions to handle infrared remotes via
  * input layer ...
@@ -22,6 +22,7 @@
  */
 
 #include linux/module.h
+#include linux/moduleparam.h
 
 #include media/ir-common.h
 

-- 
#define printk(args...) fprintf(stderr, ## args)
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[patch] v4l: tuner update

2005-01-20 Thread Gerd Knorr
- add new tuner types.
- add support for digital tv tuning.
- make tda9887 output ports more configurable.

Signed-off-by: Gerd Knorr [EMAIL PROTECTED]
---
 drivers/media/video/tda9887.c |   38 +++--
 drivers/media/video/tuner.c   |   60 +++---
 include/media/tuner.h |8 +++-
 3 files changed, 69 insertions(+), 37 deletions(-)

Index: linux-2.6.10/include/media/tuner.h
===
--- linux-2.6.10.orig/include/media/tuner.h 2004-12-29 23:57:53.0 
+0100
+++ linux-2.6.10/include/media/tuner.h  2005-01-19 14:12:25.168221195 +0100
@@ -77,6 +77,7 @@
 #define TUNER_MICROTUNE_4042FI5  49/* FusionHDTV 3 Gold - 4042 FI5 (3X 
8147) */
 #define TUNER_TCL_2002N  50
 #define TUNER_PHILIPS_FM1256_IH3   51
+#define TUNER_THOMSON_DTT761052
 
 #define NOTUNER 0
 #define PAL 1  /* PAL_BG */
@@ -97,6 +98,7 @@
 #define HITACHI 9
 #define Panasonic 10
 #define TCL 11
+#define THOMSON 12
 
 #define TUNER_SET_TYPE   _IOW('t',1,int)/* set tuner type */
 #define TUNER_SET_TVFREQ _IOW('t',2,int)/* set tv freq */
@@ -108,10 +110,12 @@
 #define  TDA9887_SET_CONFIG  _IOW('t',5,int)
 /* tv card specific */
 # define TDA9887_PRESENT (10)
-# define TDA9887_PORT1   (11)
-# define TDA9887_PORT2   (12)
+# define TDA9887_PORT1_INACTIVE  (11)
+# define TDA9887_PORT2_INACTIVE  (12)
 # define TDA9887_QSS (13)
 # define TDA9887_INTERCARRIER(14)
+# define TDA9887_PORT1_ACTIVE(15)
+# define TDA9887_PORT2_ACTIVE(16)
 /* config options */
 # define TDA9887_DEEMPHASIS_MASK (316)
 # define TDA9887_DEEMPHASIS_NONE (116)
Index: linux-2.6.10/drivers/media/video/tuner.c
===
--- linux-2.6.10.orig/drivers/media/video/tuner.c   2004-12-30 
00:00:10.0 +0100
+++ linux-2.6.10/drivers/media/video/tuner.c2005-01-19 14:12:25.169221007 
+0100
@@ -1,5 +1,5 @@
 /*
- * $Id: tuner.c,v 1.31 2004/11/10 11:07:24 kraxel Exp $
+ * $Id: tuner.c,v 1.36 2005/01/14 13:29:40 kraxel Exp $
  */
 
 #include linux/module.h
@@ -62,7 +62,7 @@ struct tuner {
v4l2_std_id  std;
int  using_v4l2;
 
-   unsigned int radio;
+   enum v4l2_tuner_type mode;
unsigned int input;
 
// only for MT2032
@@ -265,6 +265,11 @@ static struct tunertype tuners[] = {
{ Philips PAL/SECAM_D (FM 1256 I-H3), Philips, PAL,
  16*160.00,16*442.00,0x01,0x02,0x04,0x8e,623 },
 
+   { Thomson DDT 7610 ATSC/NTSC), THOMSON, ATSC,
+ 16*157.25,16*454.00,0x39,0x3a,0x3c,0x8e,732},
+   { Philips FQ1286, Philips, NTSC,
+ 16*160.00,16*454.00,0x41,0x42,0x04,0x8e,940}, // UHF band untested
+
 };
 #define TUNERS ARRAY_SIZE(tuners)
 
@@ -663,7 +668,8 @@ static void mt2050_set_if_freq(struct i2
int ret;
unsigned char buf[6];
 
-   dprintk(mt2050_set_if_freq freq=%d\n,freq);
+   dprintk(mt2050_set_if_freq freq=%d if1=%d if2=%d\n,
+   freq,if1,if2);
 
f_lo1=freq+if1;
f_lo1=(f_lo1/100)*100;
@@ -688,9 +694,10 @@ static void mt2050_set_if_freq(struct i2
div2a=(lo2/8)-1;
div2b=lo2-(div2a+1)*8;
 
-   dprintk(lo1 lo2 = %d %d\n, lo1, lo2);
-dprintk(num1 num2 div1a div1b div2a div2b= %x %x %x %x %x 
%x\n,num1,num2,div1a,div1b,div2a,div2b);
-
+   if (debug  1) {
+   printk(lo1 lo2 = %d %d\n, lo1, lo2);
+   printk(num1 num2 div1a div1b div2a div2b= %x %x %x %x %x 
%x\n,num1,num2,div1a,div1b,div2a,div2b);
+   }
 
buf[0]=1;
buf[1]= 4*div1b + num1;
@@ -702,7 +709,7 @@ static void mt2050_set_if_freq(struct i2
buf[5]=div2a;
if(num2!=0) buf[5]=buf[5]|0x40;
 
-   if(debug) {
+   if (debug  1) {
int i;
printk(bufs is: );
for(i=0;i6;i++)
@@ -727,6 +734,10 @@ static void mt2050_set_tv_freq(struct i2
 // PAL
 if2 = 38900*1000;
 }
+   if (V4L2_TUNER_DIGITAL_TV == t-mode) {
+   // testing for DVB ...
+   if2 = 36150*1000;
+   }
mt2050_set_if_freq(c, freq*62500, if2);
mt2050_set_antenna(c, tv_antenna);
 }
@@ -1069,14 +1080,18 @@ static void set_freq(struct i2c_client *
 {
struct tuner *t = i2c_get_clientdata(c);
 
-   if (t-radio) {
+   switch (t-mode) {
+   case V4L2_TUNER_RADIO:
dprintk(tuner: radio freq set to %lu.%02lu\n,
freq/16,freq%16*100/16);
set_radio_freq(c,freq);
-   } else {
+   break;
+   case V4L2_TUNER_ANALOG_TV:
+   case V4L2_TUNER_DIGITAL_TV:
dprintk(tuner: tv freq set to %lu.%02lu\n,
freq/16,freq%16*100/16);
set_tv_freq(c, freq);
+   break

[patch] v4l: video-buf update

2005-01-20 Thread Gerd Knorr
- Fix a memory leak in video-buf.c
- Small update for the video-buf-dvb.c module.

Signed-off-by: Gerd Knorr [EMAIL PROTECTED]
---
 drivers/media/video/video-buf-dvb.c |   11 +++
 drivers/media/video/video-buf.c |4 +++-
 include/media/video-buf-dvb.h   |4 +++-
 3 files changed, 13 insertions(+), 6 deletions(-)

Index: linux-2.6.10/drivers/media/video/video-buf.c
===
--- linux-2.6.10.orig/drivers/media/video/video-buf.c   2004-12-29 
23:56:51.0 +0100
+++ linux-2.6.10/drivers/media/video/video-buf.c2005-01-07 
16:46:42.650627658 +0100
@@ -1,5 +1,5 @@
 /*
- * $Id: video-buf.c,v 1.15 2004/11/07 14:45:00 kraxel Exp $
+ * $Id: video-buf.c,v 1.17 2004/12/10 12:33:40 kraxel Exp $
  *
  * generic helper functions for video4linux capture buffers, to handle
  * memory management and PCI DMA.  Right now bttv + saa7134 use it.
@@ -20,6 +20,7 @@
 
 #include linux/init.h
 #include linux/module.h
+#include linux/moduleparam.h
 #include linux/vmalloc.h
 #include linux/pagemap.h
 #include linux/slab.h
@@ -892,6 +893,7 @@ void videobuf_read_stop(struct videobuf_
int i;
 
videobuf_queue_cancel(q);
+   videobuf_mmap_free(q);
INIT_LIST_HEAD(q-stream);
for (i = 0; i  VIDEO_MAX_FRAME; i++) {
if (NULL == q-bufs[i])
Index: linux-2.6.10/drivers/media/video/video-buf-dvb.c
===
--- linux-2.6.10.orig/drivers/media/video/video-buf-dvb.c   2004-12-29 
23:55:09.0 +0100
+++ linux-2.6.10/drivers/media/video/video-buf-dvb.c2005-01-07 
16:41:25.0 +0100
@@ -1,5 +1,5 @@
 /*
- * $Id: video-buf-dvb.c,v 1.5 2004/11/07 13:17:15 kraxel Exp $
+ * $Id: video-buf-dvb.c,v 1.7 2004/12/09 12:51:35 kraxel Exp $
  *
  * some helper function for simple DVB cards which simply DMA the
  * complete transport stream and let the computer sort everything else
@@ -35,7 +35,7 @@ module_param(debug, int, 0644);
 MODULE_PARM_DESC(debug,enable debug messages);
 
 #define dprintk(fmt, arg...)   if (debug)  \
-   printk(KERN_DEBUG %s/dvb:  fmt, dvb-name, ## arg)
+   printk(KERN_DEBUG %s/dvb:  fmt, dvb-name , ## arg)
 
 /* -- */
 
@@ -134,19 +134,22 @@ static int videobuf_dvb_stop_feed(struct
 
 /* -- */
 
-int videobuf_dvb_register(struct videobuf_dvb *dvb)
+int videobuf_dvb_register(struct videobuf_dvb *dvb,
+ struct module *module,
+ void *adapter_priv)
 {
int result;
 
init_MUTEX(dvb-lock);
 
/* register adapter */
-   result = dvb_register_adapter(dvb-adapter, dvb-name, THIS_MODULE);
+   result = dvb_register_adapter(dvb-adapter, dvb-name, module);
if (result  0) {
printk(KERN_WARNING %s: dvb_register_adapter failed (errno = 
%d)\n,
   dvb-name, result);
goto fail_adapter;
}
+   dvb-adapter-priv = adapter_priv;
 
/* register frontend */
result = dvb_register_frontend(dvb-adapter, dvb-frontend);
Index: linux-2.6.10/include/media/video-buf-dvb.h
===
--- linux-2.6.10.orig/include/media/video-buf-dvb.h 2004-12-29 
23:58:34.0 +0100
+++ linux-2.6.10/include/media/video-buf-dvb.h  2005-01-07 16:41:25.0 
+0100
@@ -24,7 +24,9 @@ struct videobuf_dvb {
struct dvb_net net;
 };
 
-int videobuf_dvb_register(struct videobuf_dvb *dvb);
+int videobuf_dvb_register(struct videobuf_dvb *dvb,
+ struct module *module,
+ void *adapter_priv);
 void videobuf_dvb_unregister(struct videobuf_dvb *dvb);
 
 /*

-- 
#define printk(args...) fprintf(stderr, ## args)
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[patch] v4l2 tuner api update

2005-01-20 Thread Gerd Knorr
Add new tuner type to the v4l2 API.

Signed-off-by: Gerd Knorr [EMAIL PROTECTED]
---
 include/linux/videodev2.h |1 +
 1 files changed, 1 insertion(+)

diff -u linux-2.6.10/include/linux/videodev2.h linux/include/linux/videodev2.h
--- linux-2.6.10/include/linux/videodev2.h  2005-01-13 10:48:21.0 
+0100
+++ linux/include/linux/videodev2.h 2005-01-19 14:05:40.661259590 +0100
@@ -78,6 +78,7 @@
 enum v4l2_tuner_type {
V4L2_TUNER_RADIO = 1,
V4L2_TUNER_ANALOG_TV = 2,
+   V4L2_TUNER_DIGITAL_TV= 3,
 };
 
 enum v4l2_memory {

-- 
#define printk(args...) fprintf(stderr, ## args)
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [kbuild 2/5] Dont use the running kernels config file by default

2005-01-19 Thread Gerd Knorr
Andreas Gruenbacher <[EMAIL PROTECTED]> writes:

> The user does a ``make menuconfig'', and expects to see sane defaults.
> What kconfig really does is take the running kernel's configuration
> instead. This is a ad choice; it makes much more sense to take
> arch/$ARCH/defconfig.

IIRC the vanilla kernel's arch/i386/defconfig is the "this config
boots Linus' machine" configuration (or has that changed recently?).
I certainly wouldn't call that a sane default ...

For vendor kernels with a generic defconfig that makes sense though.

  Gerd

-- 
#define printk(args...) fprintf(stderr, ## args)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [2.6 patch] bttv: make some code static

2005-01-19 Thread Gerd Knorr
> This patch was already sent on:
> - 9 Nov 2004

Damn, yes.  I have it.  I don't consider those patches *that* important
that I instantly forward the stuff, they'll go out with the next batch
of v4l updates because it's less work that way.

If you want to have a look at my latest (not submitted yet) stuff check
out the video4linux cvs snapshots (http://dl.bytesex.org/cvs-snapshots/)
or (less frequently updated) the kernel patches @
http://dl.bytesex.org/patches/.

  Gerd

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [2.6 patch] bttv: make some code static

2005-01-19 Thread Gerd Knorr
 This patch was already sent on:
 - 9 Nov 2004

Damn, yes.  I have it.  I don't consider those patches *that* important
that I instantly forward the stuff, they'll go out with the next batch
of v4l updates because it's less work that way.

If you want to have a look at my latest (not submitted yet) stuff check
out the video4linux cvs snapshots (http://dl.bytesex.org/cvs-snapshots/)
or (less frequently updated) the kernel patches @
http://dl.bytesex.org/patches/.

  Gerd

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [kbuild 2/5] Dont use the running kernels config file by default

2005-01-19 Thread Gerd Knorr
Andreas Gruenbacher [EMAIL PROTECTED] writes:

 The user does a ``make menuconfig'', and expects to see sane defaults.
 What kconfig really does is take the running kernel's configuration
 instead. This is a ad choice; it makes much more sense to take
 arch/$ARCH/defconfig.

IIRC the vanilla kernel's arch/i386/defconfig is the this config
boots Linus' machine configuration (or has that changed recently?).
I certainly wouldn't call that a sane default ...

For vendor kernels with a generic defconfig that makes sense though.

  Gerd

-- 
#define printk(args...) fprintf(stderr, ## args)
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Tvmixer Oops

2001-06-26 Thread Gerd Knorr

On Mon, Jun 25, 2001 at 12:56:03PM +0200, Udo A. Steinberg wrote:
> 
> Hello,
> 
> Attached is the trace of an oops which seems to be caused by the
> tvmixer code. Tvmixer is compiled monolithically into the kernel,
> the rest of bttv is compiled as modules.

Any hints on how to reproduce that one?

  Gerd

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: Tvmixer Oops

2001-06-26 Thread Gerd Knorr

On Mon, Jun 25, 2001 at 12:56:03PM +0200, Udo A. Steinberg wrote:
 
 Hello,
 
 Attached is the trace of an oops which seems to be caused by the
 tvmixer code. Tvmixer is compiled monolithically into the kernel,
 the rest of bttv is compiled as modules.

Any hints on how to reproduce that one?

  Gerd

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: Annoying kernel behaviour

2001-06-25 Thread Gerd Knorr

> >There are no conflicts, and PCI should be able to share anyways.
>  
>  That's the theory now for some time, has never worked.  Even hacking
>  the SCSI driver, any attempted IRQ sharing kills my systems.  Even my
>  quad ethernet is not successful at sharing IRQs with itself, in 2+ very
>  different motherboards.

For bttv I know that irq sharing works in some cases and not on others.
Last not-working report was bttv sharing with a nvidia.  Moving the
grabber board to another PCI slot (nvidia having a exclusive irq then,
bttv shared the irq with something else) fixed it.

  Gerd

-- 
Damn lot people confuse usability and eye-candy.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: Annoying kernel behaviour

2001-06-25 Thread Gerd Knorr

 There are no conflicts, and PCI should be able to share anyways.
  
  That's the theory now for some time, has never worked.  Even hacking
  the SCSI driver, any attempted IRQ sharing kills my systems.  Even my
  quad ethernet is not successful at sharing IRQs with itself, in 2+ very
  different motherboards.

For bttv I know that irq sharing works in some cases and not on others.
Last not-working report was bttv sharing with a nvidia.  Moving the
grabber board to another PCI slot (nvidia having a exclusive irq then,
bttv shared the irq with something else) fixed it.

  Gerd

-- 
Damn lot people confuse usability and eye-candy.
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



  1   2   >