write support for preallocated blocks

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=56055d3ae4cc7fa6d2b10885f20269de8a989ed7
Commit: 56055d3ae4cc7fa6d2b10885f20269de8a989ed7
Parent: a2df2a63407803a833f82e1fa6693826c8c9d584
Author: Amit Arora [EMAIL PROTECTED]
AuthorDate: Tue Jul 17 21:42:38 2007 -0400
Committer:  Theodore Ts'o [EMAIL PROTECTED]
CommitDate: Tue Jul 17 21:42:38 2007 -0400

write support for preallocated blocks

This patch adds write support to the uninitialized extents that get
created when a preallocation is done using fallocate(). It takes care of
splitting the extents into multiple (upto three) extents and merging the
new split extents with neighbouring ones, if possible.

Signed-off-by: Amit Arora [EMAIL PROTECTED]
---
 fs/ext4/extents.c   |  254 ++-
 include/linux/ext4_fs_extents.h |3 +
 2 files changed, 225 insertions(+), 32 deletions(-)

diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index ba25832..ded3d46 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -1141,6 +1141,53 @@ ext4_can_extents_be_merged(struct inode *inode, struct 
ext4_extent *ex1,
 }
 
 /*
+ * This function tries to merge the ex extent to the next extent in the tree.
+ * It always tries to merge towards right. If you want to merge towards
+ * left, pass ex - 1 as argument instead of ex.
+ * Returns 0 if the extents (ex and ex+1) were _not_ merged and returns
+ * 1 if they got merged.
+ */
+int ext4_ext_try_to_merge(struct inode *inode,
+ struct ext4_ext_path *path,
+ struct ext4_extent *ex)
+{
+   struct ext4_extent_header *eh;
+   unsigned int depth, len;
+   int merge_done = 0;
+   int uninitialized = 0;
+
+   depth = ext_depth(inode);
+   BUG_ON(path[depth].p_hdr == NULL);
+   eh = path[depth].p_hdr;
+
+   while (ex  EXT_LAST_EXTENT(eh)) {
+   if (!ext4_can_extents_be_merged(inode, ex, ex + 1))
+   break;
+   /* merge with next extent! */
+   if (ext4_ext_is_uninitialized(ex))
+   uninitialized = 1;
+   ex-ee_len = cpu_to_le16(ext4_ext_get_actual_len(ex)
+   + ext4_ext_get_actual_len(ex + 1));
+   if (uninitialized)
+   ext4_ext_mark_uninitialized(ex);
+
+   if (ex + 1  EXT_LAST_EXTENT(eh)) {
+   len = (EXT_LAST_EXTENT(eh) - ex - 1)
+   * sizeof(struct ext4_extent);
+   memmove(ex + 1, ex + 2, len);
+   }
+   eh-eh_entries = cpu_to_le16(le16_to_cpu(eh-eh_entries) - 1);
+   merge_done = 1;
+   WARN_ON(eh-eh_entries == 0);
+   if (!eh-eh_entries)
+   ext4_error(inode-i_sb, ext4_ext_try_to_merge,
+  inode#%lu, eh-eh_entries = 0!, inode-i_ino);
+   }
+
+   return merge_done;
+}
+
+/*
  * check if a portion of the newext extent overlaps with an
  * existing extent.
  *
@@ -1328,25 +1375,7 @@ has_space:
 
 merge:
/* try to merge extents to the right */
-   while (nearex  EXT_LAST_EXTENT(eh)) {
-   if (!ext4_can_extents_be_merged(inode, nearex, nearex + 1))
-   break;
-   /* merge with next extent! */
-   if (ext4_ext_is_uninitialized(nearex))
-   uninitialized = 1;
-   nearex-ee_len = cpu_to_le16(ext4_ext_get_actual_len(nearex)
-   + ext4_ext_get_actual_len(nearex + 1));
-   if (uninitialized)
-   ext4_ext_mark_uninitialized(nearex);
-
-   if (nearex + 1  EXT_LAST_EXTENT(eh)) {
-   len = (EXT_LAST_EXTENT(eh) - nearex - 1)
-   * sizeof(struct ext4_extent);
-   memmove(nearex + 1, nearex + 2, len);
-   }
-   eh-eh_entries = cpu_to_le16(le16_to_cpu(eh-eh_entries)-1);
-   BUG_ON(eh-eh_entries == 0);
-   }
+   ext4_ext_try_to_merge(inode, path, nearex);
 
/* try to merge extents to the left */
 
@@ -2012,15 +2041,158 @@ void ext4_ext_release(struct super_block *sb)
 #endif
 }
 
+/*
+ * This function is called by ext4_ext_get_blocks() if someone tries to write
+ * to an uninitialized extent. It may result in splitting the uninitialized
+ * extent into multiple extents (upto three - one initialized and two
+ * uninitialized).
+ * There are three possibilities:
+ *   a There is no split required: Entire extent should be initialized
+ *   b Splits in two extents: Write is happening at either end of the extent
+ *   c Splits in three extents: Somone is writing in middle of the extent
+ */
+int ext4_ext_convert_to_initialized(handle_t *handle, struct inode *inode,
+  

Change on-disk format to support 2^15 uninitialized extents

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=749269facaf87f6e516c3af12763e03181b9c139
Commit: 749269facaf87f6e516c3af12763e03181b9c139
Parent: 56055d3ae4cc7fa6d2b10885f20269de8a989ed7
Author: Amit Arora [EMAIL PROTECTED]
AuthorDate: Wed Jul 18 09:02:56 2007 -0400
Committer:  Theodore Ts'o [EMAIL PROTECTED]
CommitDate: Wed Jul 18 09:02:56 2007 -0400

Change on-disk format to support 2^15 uninitialized extents

This change was suggested by Andreas Dilger.
This patch changes the EXT_MAX_LEN value and extent code which marks/checks
uninitialized extents. With this change it will be possible to have
initialized extents with 2^15 blocks (earlier the max blocks we could have
was 2^15 - 1). This way we can have better extent-to-block alignment.
Now, maximum number of blocks we can have in an initialized extent is 2^15
and in an uninitialized extent is 2^15 - 1.

Signed-off-by: Amit Arora [EMAIL PROTECTED]
---
 fs/ext4/extents.c   |   28 +---
 include/linux/ext4_fs_extents.h |   31 +++
 2 files changed, 52 insertions(+), 7 deletions(-)

diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index ded3d46..77146b8 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -1107,7 +1107,7 @@ static int
 ext4_can_extents_be_merged(struct inode *inode, struct ext4_extent *ex1,
struct ext4_extent *ex2)
 {
-   unsigned short ext1_ee_len, ext2_ee_len;
+   unsigned short ext1_ee_len, ext2_ee_len, max_len;
 
/*
 * Make sure that either both extents are uninitialized, or
@@ -1116,6 +1116,11 @@ ext4_can_extents_be_merged(struct inode *inode, struct 
ext4_extent *ex1,
if (ext4_ext_is_uninitialized(ex1) ^ ext4_ext_is_uninitialized(ex2))
return 0;
 
+   if (ext4_ext_is_uninitialized(ex1))
+   max_len = EXT_UNINIT_MAX_LEN;
+   else
+   max_len = EXT_INIT_MAX_LEN;
+
ext1_ee_len = ext4_ext_get_actual_len(ex1);
ext2_ee_len = ext4_ext_get_actual_len(ex2);
 
@@ -1128,7 +1133,7 @@ ext4_can_extents_be_merged(struct inode *inode, struct 
ext4_extent *ex1,
 * as an RO_COMPAT feature, refuse to merge to extents if
 * this can result in the top bit of ee_len being set.
 */
-   if (ext1_ee_len + ext2_ee_len  EXT_MAX_LEN)
+   if (ext1_ee_len + ext2_ee_len  max_len)
return 0;
 #ifdef AGGRESSIVE_TEST
if (le16_to_cpu(ex1-ee_len) = 4)
@@ -1815,7 +1820,11 @@ ext4_ext_rm_leaf(handle_t *handle, struct inode *inode,
 
ex-ee_block = cpu_to_le32(block);
ex-ee_len = cpu_to_le16(num);
-   if (uninitialized)
+   /*
+* Do not mark uninitialized if all the blocks in the
+* extent have been removed.
+*/
+   if (uninitialized  num)
ext4_ext_mark_uninitialized(ex);
 
err = ext4_ext_dirty(handle, inode, path + depth);
@@ -2308,6 +2317,19 @@ int ext4_ext_get_blocks(handle_t *handle, struct inode 
*inode,
/* allocate new block */
goal = ext4_ext_find_goal(inode, path, iblock);
 
+   /*
+* See if request is beyond maximum number of blocks we can have in
+* a single extent. For an initialized extent this limit is
+* EXT_INIT_MAX_LEN and for an uninitialized extent this limit is
+* EXT_UNINIT_MAX_LEN.
+*/
+   if (max_blocks  EXT_INIT_MAX_LEN 
+   create != EXT4_CREATE_UNINITIALIZED_EXT)
+   max_blocks = EXT_INIT_MAX_LEN;
+   else if (max_blocks  EXT_UNINIT_MAX_LEN 
+create == EXT4_CREATE_UNINITIALIZED_EXT)
+   max_blocks = EXT_UNINIT_MAX_LEN;
+
/* Check if we can really insert (iblock)::(iblock+max_blocks) extent */
newex.ee_block = cpu_to_le32(iblock);
newex.ee_len = cpu_to_le16(max_blocks);
diff --git a/include/linux/ext4_fs_extents.h b/include/linux/ext4_fs_extents.h
index edf49ec..81406f3 100644
--- a/include/linux/ext4_fs_extents.h
+++ b/include/linux/ext4_fs_extents.h
@@ -141,7 +141,25 @@ typedef int (*ext_prepare_callback)(struct inode *, struct 
ext4_ext_path *,
 
 #define EXT_MAX_BLOCK  0x
 
-#define EXT_MAX_LEN((1UL  15) - 1)
+/*
+ * EXT_INIT_MAX_LEN is the maximum number of blocks we can have in an
+ * initialized extent. This is 2^15 and not (2^16 - 1), since we use the
+ * MSB of ee_len field in the extent datastructure to signify if this
+ * particular extent is an initialized extent or an uninitialized (i.e.
+ * preallocated).
+ * EXT_UNINIT_MAX_LEN is the maximum number of blocks we can have in an
+ * uninitialized extent.
+ * If ee_len is = 0x8000, it is an initialized extent. Otherwise, it is an
+ * uninitialized one. In other words, if MSB of ee_len is set, it is an
+ * uninitialized extent with only one 

ext4: Enable extents by default

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1e2462f93e011f63fd0f1fedd2c05338ca6b31c2
Commit: 1e2462f93e011f63fd0f1fedd2c05338ca6b31c2
Parent: 749269facaf87f6e516c3af12763e03181b9c139
Author: Mingming Cao [EMAIL PROTECTED]
AuthorDate: Wed Jul 18 09:00:55 2007 -0400
Committer:  Theodore Ts'o [EMAIL PROTECTED]
CommitDate: Wed Jul 18 09:00:55 2007 -0400

ext4: Enable extents by default

Turn on extents feature by default in ext4 filesystem, to get wider
testing of extents feature in ext4dev.  This can be disabled using
-o noextents.

Signed-off-by: Mingming Cao [EMAIL PROTECTED]
Signed-off-by: Theodore Ts'o [EMAIL PROTECTED]
---
 fs/ext4/super.c |   12 +++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index b806e68..9c8baf4 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -734,7 +734,7 @@ enum {
Opt_usrjquota, Opt_grpjquota, Opt_offusrjquota, Opt_offgrpjquota,
Opt_jqfmt_vfsold, Opt_jqfmt_vfsv0, Opt_quota, Opt_noquota,
Opt_ignore, Opt_barrier, Opt_err, Opt_resize, Opt_usrquota,
-   Opt_grpquota, Opt_extents,
+   Opt_grpquota, Opt_extents, Opt_noextents,
 };
 
 static match_table_t tokens = {
@@ -785,6 +785,7 @@ static match_table_t tokens = {
{Opt_usrquota, usrquota},
{Opt_barrier, barrier=%u},
{Opt_extents, extents},
+   {Opt_noextents, noextents},
{Opt_err, NULL},
{Opt_resize, resize},
 };
@@ -1120,6 +1121,9 @@ clear_qf_name:
case Opt_extents:
set_opt (sbi-s_mount_opt, EXTENTS);
break;
+   case Opt_noextents:
+   clear_opt (sbi-s_mount_opt, EXTENTS);
+   break;
default:
printk (KERN_ERR
EXT4-fs: Unrecognized mount option \%s\ 
@@ -1551,6 +1555,12 @@ static int ext4_fill_super (struct super_block *sb, void 
*data, int silent)
 
set_opt(sbi-s_mount_opt, RESERVATION);
 
+   /*
+* turn on extents feature by default in ext4 filesystem
+* User -o noextents to turn it off
+*/
+   set_opt(sbi-s_mount_opt, EXTENTS);
+
if (!parse_options ((char *) data, sb, journal_inum, journal_devnum,
NULL, 0))
goto failed_mount;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


ext4: copy i_flags to inode flags on write

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ff9ddf7e847c4dc533f119efb6c77a6e57ab6397
Commit: ff9ddf7e847c4dc533f119efb6c77a6e57ab6397
Parent: 1e2462f93e011f63fd0f1fedd2c05338ca6b31c2
Author: Jan Kara [EMAIL PROTECTED]
AuthorDate: Wed Jul 18 09:24:20 2007 -0400
Committer:  Theodore Ts'o [EMAIL PROTECTED]
CommitDate: Wed Jul 18 09:24:20 2007 -0400

ext4: copy i_flags to inode flags on write

Propagate flags such as S_APPEND, S_IMMUTABLE, etc. from i_flags into
ext4-specific i_flags.  Quota code changes these flags on quota files
(to make it harder for sysadmin to screw himself) and these changes were
not correctly propagated into the filesystem.

(This is a forward port patch from ext3)

Signed-off-by: Jan Kara [EMAIL PROTECTED]
Signed-off-by: Mingming Cao [EMAIL PROTECTED]
Signed-off-by: Theodore Ts'o [EMAIL PROTECTED]
---
 fs/ext4/inode.c |   20 
 fs/ext4/ioctl.c |1 +
 include/linux/ext4_fs.h |1 +
 3 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 8416fa2..49035c5 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -2583,6 +2583,25 @@ void ext4_set_inode_flags(struct inode *inode)
inode-i_flags |= S_DIRSYNC;
 }
 
+/* Propagate flags from i_flags to EXT4_I(inode)-i_flags */
+void ext4_get_inode_flags(struct ext4_inode_info *ei)
+{
+   unsigned int flags = ei-vfs_inode.i_flags;
+
+   ei-i_flags = ~(EXT4_SYNC_FL|EXT4_APPEND_FL|
+   EXT4_IMMUTABLE_FL|EXT4_NOATIME_FL|EXT4_DIRSYNC_FL);
+   if (flags  S_SYNC)
+   ei-i_flags |= EXT4_SYNC_FL;
+   if (flags  S_APPEND)
+   ei-i_flags |= EXT4_APPEND_FL;
+   if (flags  S_IMMUTABLE)
+   ei-i_flags |= EXT4_IMMUTABLE_FL;
+   if (flags  S_NOATIME)
+   ei-i_flags |= EXT4_NOATIME_FL;
+   if (flags  S_DIRSYNC)
+   ei-i_flags |= EXT4_DIRSYNC_FL;
+}
+
 void ext4_read_inode(struct inode * inode)
 {
struct ext4_iloc iloc;
@@ -2744,6 +2763,7 @@ static int ext4_do_update_inode(handle_t *handle,
if (ei-i_state  EXT4_STATE_NEW)
memset(raw_inode, 0, EXT4_SB(inode-i_sb)-s_inode_size);
 
+   ext4_get_inode_flags(ei);
raw_inode-i_mode = cpu_to_le16(inode-i_mode);
if(!(test_opt(inode-i_sb, NO_UID32))) {
raw_inode-i_uid_low = cpu_to_le16(low_16_bits(inode-i_uid));
diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c
index 7b4aa45..9737432 100644
--- a/fs/ext4/ioctl.c
+++ b/fs/ext4/ioctl.c
@@ -28,6 +28,7 @@ int ext4_ioctl (struct inode * inode, struct file * filp, 
unsigned int cmd,
 
switch (cmd) {
case EXT4_IOC_GETFLAGS:
+   ext4_get_inode_flags(ei);
flags = ei-i_flags  EXT4_FL_USER_VISIBLE;
return put_user(flags, (int __user *) arg);
case EXT4_IOC_SETFLAGS: {
diff --git a/include/linux/ext4_fs.h b/include/linux/ext4_fs.h
index 87c2d7a..33b2b1a 100644
--- a/include/linux/ext4_fs.h
+++ b/include/linux/ext4_fs.h
@@ -868,6 +868,7 @@ extern int ext4_change_inode_journal_flag(struct inode *, 
int);
 extern int ext4_get_inode_loc(struct inode *, struct ext4_iloc *);
 extern void ext4_truncate (struct inode *);
 extern void ext4_set_inode_flags(struct inode *);
+extern void ext4_get_inode_flags(struct ext4_inode_info *);
 extern void ext4_set_aops(struct inode *inode);
 extern int ext4_writepage_trans_blocks(struct inode *);
 extern int ext4_block_truncate_page(handle_t *handle, struct page *page,
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


ext4: Make extents code sanely handle on-disk corruption

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c29c0ae7f282828da3695167ed870131798348d9
Commit: c29c0ae7f282828da3695167ed870131798348d9
Parent: ff9ddf7e847c4dc533f119efb6c77a6e57ab6397
Author: Alex Tomas [EMAIL PROTECTED]
AuthorDate: Wed Jul 18 09:19:09 2007 -0400
Committer:  Theodore Ts'o [EMAIL PROTECTED]
CommitDate: Wed Jul 18 09:19:09 2007 -0400

ext4: Make extents code sanely handle on-disk corruption

Add more run-time checking of extent header fields and remove BUG_ON
checks so we don't panic the kernel just because the on-disk filesystem
is corrupted.

Signed-off-by: Alex Tomas [EMAIL PROTECTED]
Signed-off-by: Mingming Cao [EMAIL PROTECTED]
Signed-off-by: Theodore Ts'o [EMAIL PROTECTED]
---
 fs/ext4/extents.c |  144 +++-
 1 files changed, 86 insertions(+), 58 deletions(-)

diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 77146b8..96264b2 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -92,36 +92,6 @@ static void ext4_idx_store_pblock(struct ext4_extent_idx 
*ix, ext4_fsblk_t pb)
ix-ei_leaf_hi = cpu_to_le16((unsigned long) ((pb  31)  1)  
0x);
 }
 
-static int ext4_ext_check_header(const char *function, struct inode *inode,
-   struct ext4_extent_header *eh)
-{
-   const char *error_msg = NULL;
-
-   if (unlikely(eh-eh_magic != EXT4_EXT_MAGIC)) {
-   error_msg = invalid magic;
-   goto corrupted;
-   }
-   if (unlikely(eh-eh_max == 0)) {
-   error_msg = invalid eh_max;
-   goto corrupted;
-   }
-   if (unlikely(le16_to_cpu(eh-eh_entries)  le16_to_cpu(eh-eh_max))) {
-   error_msg = invalid eh_entries;
-   goto corrupted;
-   }
-   return 0;
-
-corrupted:
-   ext4_error(inode-i_sb, function,
-   bad header in inode #%lu: %s - magic %x, 
-   entries %u, max %u, depth %u,
-   inode-i_ino, error_msg, le16_to_cpu(eh-eh_magic),
-   le16_to_cpu(eh-eh_entries), le16_to_cpu(eh-eh_max),
-   le16_to_cpu(eh-eh_depth));
-
-   return -EIO;
-}
-
 static handle_t *ext4_ext_journal_restart(handle_t *handle, int needed)
 {
int err;
@@ -270,6 +240,70 @@ static int ext4_ext_space_root_idx(struct inode *inode)
return size;
 }
 
+static int
+ext4_ext_max_entries(struct inode *inode, int depth)
+{
+   int max;
+
+   if (depth == ext_depth(inode)) {
+   if (depth == 0)
+   max = ext4_ext_space_root(inode);
+   else
+   max = ext4_ext_space_root_idx(inode);
+   } else {
+   if (depth == 0)
+   max = ext4_ext_space_block(inode);
+   else
+   max = ext4_ext_space_block_idx(inode);
+   }
+
+   return max;
+}
+
+static int __ext4_ext_check_header(const char *function, struct inode *inode,
+   struct ext4_extent_header *eh,
+   int depth)
+{
+   const char *error_msg;
+   int max = 0;
+
+   if (unlikely(eh-eh_magic != EXT4_EXT_MAGIC)) {
+   error_msg = invalid magic;
+   goto corrupted;
+   }
+   if (unlikely(le16_to_cpu(eh-eh_depth) != depth)) {
+   error_msg = unexpected eh_depth;
+   goto corrupted;
+   }
+   if (unlikely(eh-eh_max == 0)) {
+   error_msg = invalid eh_max;
+   goto corrupted;
+   }
+   max = ext4_ext_max_entries(inode, depth);
+   if (unlikely(le16_to_cpu(eh-eh_max)  max)) {
+   error_msg = too large eh_max;
+   goto corrupted;
+   }
+   if (unlikely(le16_to_cpu(eh-eh_entries)  le16_to_cpu(eh-eh_max))) {
+   error_msg = invalid eh_entries;
+   goto corrupted;
+   }
+   return 0;
+
+corrupted:
+   ext4_error(inode-i_sb, function,
+   bad header in inode #%lu: %s - magic %x, 
+   entries %u, max %u(%u), depth %u(%u),
+   inode-i_ino, error_msg, le16_to_cpu(eh-eh_magic),
+   le16_to_cpu(eh-eh_entries), le16_to_cpu(eh-eh_max),
+   max, le16_to_cpu(eh-eh_depth), depth);
+
+   return -EIO;
+}
+
+#define ext4_ext_check_header(inode, eh, depth)\
+   __ext4_ext_check_header(__FUNCTION__, inode, eh, depth)
+
 #ifdef EXT_DEBUG
 static void ext4_ext_show_path(struct inode *inode, struct ext4_ext_path *path)
 {
@@ -330,6 +364,7 @@ static void ext4_ext_drop_refs(struct ext4_ext_path *path)
 /*
  * ext4_ext_binsearch_idx:
  * binary search for the closest index of the given block
+ * the header must be checked before calling this
  */
 static void
 ext4_ext_binsearch_idx(struct inode *inode, struct 

jbd2: Fix CONFIG_JBD_DEBUG ifdef to be CONFIG_JBD2_DEBUG

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e23291b9120c11aafb2ee76fb71a062eb3c1056c
Commit: e23291b9120c11aafb2ee76fb71a062eb3c1056c
Parent: eb40a09c679d7f9709f7087add57f2e1c7122bb3
Author: Jose R. Santos [EMAIL PROTECTED]
AuthorDate: Wed Jul 18 08:57:06 2007 -0400
Committer:  Theodore Ts'o [EMAIL PROTECTED]
CommitDate: Wed Jul 18 08:57:06 2007 -0400

jbd2: Fix CONFIG_JBD_DEBUG ifdef to be CONFIG_JBD2_DEBUG

When the JBD code was forked to create the new JBD2 code base, the
references to CONFIG_JBD_DEBUG where never changed to
CONFIG_JBD2_DEBUG.  This patch fixes that.

Signed-off-by: Jose R. Santos [EMAIL PROTECTED]
Signed-off-by: Theodore Ts'o [EMAIL PROTECTED]
---
 fs/ext4/balloc.c   |4 ++--
 fs/ext4/ioctl.c|4 ++--
 fs/jbd2/journal.c  |   14 +++---
 fs/jbd2/recovery.c |2 +-
 include/linux/ext4_fs.h|4 ++--
 include/linux/ext4_fs_sb.h |2 +-
 include/linux/jbd2.h   |4 ++--
 7 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/fs/ext4/balloc.c b/fs/ext4/balloc.c
index 9de54ae..e53b4af 100644
--- a/fs/ext4/balloc.c
+++ b/fs/ext4/balloc.c
@@ -517,7 +517,7 @@ do_more:
/*
 * An HJ special.  This is expensive...
 */
-#ifdef CONFIG_JBD_DEBUG
+#ifdef CONFIG_JBD2_DEBUG
jbd_unlock_bh_state(bitmap_bh);
{
struct buffer_head *debug_bh;
@@ -1597,7 +1597,7 @@ allocated:
 
performed_allocation = 1;
 
-#ifdef CONFIG_JBD_DEBUG
+#ifdef CONFIG_JBD2_DEBUG
{
struct buffer_head *debug_bh;
 
diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c
index 9737432..5b00775 100644
--- a/fs/ext4/ioctl.c
+++ b/fs/ext4/ioctl.c
@@ -141,7 +141,7 @@ flags_err:
ext4_journal_stop(handle);
return err;
}
-#ifdef CONFIG_JBD_DEBUG
+#ifdef CONFIG_JBD2_DEBUG
case EXT4_IOC_WAIT_FOR_READONLY:
/*
 * This is racy - by the time we're woken up and running,
@@ -283,7 +283,7 @@ long ext4_compat_ioctl(struct file *file, unsigned int cmd, 
unsigned long arg)
case EXT4_IOC32_SETVERSION_OLD:
cmd = EXT4_IOC_SETVERSION_OLD;
break;
-#ifdef CONFIG_JBD_DEBUG
+#ifdef CONFIG_JBD2_DEBUG
case EXT4_IOC32_WAIT_FOR_READONLY:
cmd = EXT4_IOC_WAIT_FOR_READONLY;
break;
diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c
index 78d63b8..8f530cc 100644
--- a/fs/jbd2/journal.c
+++ b/fs/jbd2/journal.c
@@ -528,7 +528,7 @@ int jbd2_log_wait_commit(journal_t *journal, tid_t tid)
 {
int err = 0;
 
-#ifdef CONFIG_JBD_DEBUG
+#ifdef CONFIG_JBD2_DEBUG
spin_lock(journal-j_state_lock);
if (!tid_geq(journal-j_commit_request, tid)) {
printk(KERN_EMERG
@@ -1709,7 +1709,7 @@ void jbd2_slab_free(void *ptr,  size_t size)
  * Journal_head storage management
  */
 static struct kmem_cache *jbd2_journal_head_cache;
-#ifdef CONFIG_JBD_DEBUG
+#ifdef CONFIG_JBD2_DEBUG
 static atomic_t nr_journal_heads = ATOMIC_INIT(0);
 #endif
 
@@ -1747,7 +1747,7 @@ static struct journal_head 
*journal_alloc_journal_head(void)
struct journal_head *ret;
static unsigned long last_warning;
 
-#ifdef CONFIG_JBD_DEBUG
+#ifdef CONFIG_JBD2_DEBUG
atomic_inc(nr_journal_heads);
 #endif
ret = kmem_cache_alloc(jbd2_journal_head_cache, GFP_NOFS);
@@ -1768,7 +1768,7 @@ static struct journal_head 
*journal_alloc_journal_head(void)
 
 static void journal_free_journal_head(struct journal_head *jh)
 {
-#ifdef CONFIG_JBD_DEBUG
+#ifdef CONFIG_JBD2_DEBUG
atomic_dec(nr_journal_heads);
memset(jh, JBD_POISON_FREE, sizeof(*jh));
 #endif
@@ -1953,12 +1953,12 @@ void jbd2_journal_put_journal_head(struct journal_head 
*jh)
 /*
  * /proc tunables
  */
-#if defined(CONFIG_JBD_DEBUG)
+#if defined(CONFIG_JBD2_DEBUG)
 int jbd2_journal_enable_debug;
 EXPORT_SYMBOL(jbd2_journal_enable_debug);
 #endif
 
-#if defined(CONFIG_JBD_DEBUG)  defined(CONFIG_PROC_FS)
+#if defined(CONFIG_JBD2_DEBUG)  defined(CONFIG_PROC_FS)
 
 static struct proc_dir_entry *proc_jbd_debug;
 
@@ -2073,7 +2073,7 @@ static int __init journal_init(void)
 
 static void __exit journal_exit(void)
 {
-#ifdef CONFIG_JBD_DEBUG
+#ifdef CONFIG_JBD2_DEBUG
int n = atomic_read(nr_journal_heads);
if (n)
printk(KERN_EMERG JBD: leaked %d journal_heads!\n, n);
diff --git a/fs/jbd2/recovery.c b/fs/jbd2/recovery.c
index 395c92a..e7730a0 100644
--- a/fs/jbd2/recovery.c
+++ b/fs/jbd2/recovery.c
@@ -295,7 +295,7 @@ int jbd2_journal_skip_recovery(journal_t *journal)
printk(KERN_ERR JBD: error %d scanning journal\n, err);
++journal-j_transaction_sequence;
} else {
-#ifdef CONFIG_JBD_DEBUG
+#ifdef CONFIG_JBD2_DEBUG
int dropped = info.end_transaction - 

jbd2: Move jbd2-debug file to debugfs

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0f49d5d019afa4e94253bfc92f0daca3badb990b
Commit: 0f49d5d019afa4e94253bfc92f0daca3badb990b
Parent: e23291b9120c11aafb2ee76fb71a062eb3c1056c
Author: Jose R. Santos [EMAIL PROTECTED]
AuthorDate: Wed Jul 18 08:50:18 2007 -0400
Committer:  Theodore Ts'o [EMAIL PROTECTED]
CommitDate: Wed Jul 18 08:50:18 2007 -0400

jbd2: Move jbd2-debug file to debugfs

The jbd2-debug file used to be located in /proc/sys/fs/jbd2-debug, but it
incorrectly used create_proc_entry() instead of the sysctl routines, and
no proc entry was ever created.

Instead of fixing this we might as well move the jbd2-debug file to
debugfs which would be the preferred location for this kind of tunable.
The new location is now /sys/kernel/debug/jbd2/jbd2-debug.

Signed-off-by: Jose R. Santos [EMAIL PROTECTED]
Signed-off-by: Theodore Ts'o [EMAIL PROTECTED]
---
 fs/Kconfig   |   10 +++---
 fs/jbd2/journal.c|   67 -
 include/linux/jbd2.h |2 +-
 3 files changed, 33 insertions(+), 46 deletions(-)

diff --git a/fs/Kconfig b/fs/Kconfig
index 613df55..6a64990 100644
--- a/fs/Kconfig
+++ b/fs/Kconfig
@@ -251,7 +251,7 @@ config JBD2
 
 config JBD2_DEBUG
bool JBD2 (ext4dev/ext4) debugging support
-   depends on JBD2
+   depends on JBD2  DEBUG_FS
help
  If you are using the ext4dev/ext4 journaled file system (or
  potentially any other filesystem/device using JBD2), this option
@@ -260,10 +260,10 @@ config JBD2_DEBUG
  By default, the debugging output will be turned off.
 
  If you select Y here, then you will be able to turn on debugging
- with echo N  /proc/sys/fs/jbd2-debug, where N is a number between
- 1 and 5. The higher the number, the more debugging output is
- generated.  To turn debugging off again, do
- echo 0  /proc/sys/fs/jbd2-debug.
+ with echo N  /sys/kernel/debug/jbd2/jbd2-debug, where N is a
+ number between 1 and 5. The higher the number, the more debugging
+ output is generated.  To turn debugging off again, do
+ echo 0  /sys/kernel/debug/jbd2/jbd2-debug.
 
 config FS_MBCACHE
 # Meta block cache for Extended Attributes (ext2/ext3/ext4)
diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c
index 8f530cc..f290cb7 100644
--- a/fs/jbd2/journal.c
+++ b/fs/jbd2/journal.c
@@ -35,6 +35,7 @@
 #include linux/kthread.h
 #include linux/poison.h
 #include linux/proc_fs.h
+#include linux/debugfs.h
 
 #include asm/uaccess.h
 #include asm/page.h
@@ -1951,64 +1952,50 @@ void jbd2_journal_put_journal_head(struct journal_head 
*jh)
 }
 
 /*
- * /proc tunables
+ * debugfs tunables
  */
 #if defined(CONFIG_JBD2_DEBUG)
-int jbd2_journal_enable_debug;
+u8 jbd2_journal_enable_debug;
 EXPORT_SYMBOL(jbd2_journal_enable_debug);
 #endif
 
-#if defined(CONFIG_JBD2_DEBUG)  defined(CONFIG_PROC_FS)
+#if defined(CONFIG_JBD2_DEBUG)  defined(CONFIG_DEBUG_FS)
 
-static struct proc_dir_entry *proc_jbd_debug;
+#define JBD2_DEBUG_NAME jbd2-debug
 
-static int read_jbd_debug(char *page, char **start, off_t off,
- int count, int *eof, void *data)
-{
-   int ret;
+struct dentry *jbd2_debugfs_dir, *jbd2_debug;
 
-   ret = sprintf(page + off, %d\n, jbd2_journal_enable_debug);
-   *eof = 1;
-   return ret;
+static void __init jbd2_create_debugfs_entry(void)
+{
+   jbd2_debugfs_dir = debugfs_create_dir(jbd2, NULL);
+   if (jbd2_debugfs_dir)
+   jbd2_debug = debugfs_create_u8(JBD2_DEBUG_NAME, S_IRUGO,
+  jbd2_debugfs_dir,
+  jbd2_journal_enable_debug);
 }
 
-static int write_jbd_debug(struct file *file, const char __user *buffer,
-  unsigned long count, void *data)
+static void __exit jbd2_remove_debugfs_entry(void)
 {
-   char buf[32];
-
-   if (count  ARRAY_SIZE(buf) - 1)
-   count = ARRAY_SIZE(buf) - 1;
-   if (copy_from_user(buf, buffer, count))
-   return -EFAULT;
-   buf[ARRAY_SIZE(buf) - 1] = '\0';
-   jbd2_journal_enable_debug = simple_strtoul(buf, NULL, 10);
-   return count;
+   if (jbd2_debug)
+   debugfs_remove(jbd2_debug);
+   if (jbd2_debugfs_dir)
+   debugfs_remove(jbd2_debugfs_dir);
 }
 
-#define JBD_PROC_NAME sys/fs/jbd2-debug
+#else
 
-static void __init create_jbd_proc_entry(void)
+static void __init jbd2_create_debugfs_entry(void)
 {
-   proc_jbd_debug = create_proc_entry(JBD_PROC_NAME, 0644, NULL);
-   if (proc_jbd_debug) {
-   /* Why is this so hard? */
-   proc_jbd_debug-read_proc = read_jbd_debug;
-   proc_jbd_debug-write_proc = write_jbd_debug;
-   }
+   do {
+   } while (0);
 }
 
-static void __exit jbd2_remove_jbd_proc_entry(void)

ext4: Add nanosecond timestamps

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ef7f38359ea8b3e9c7f2cae9a4d4935f55ca9e80
Commit: ef7f38359ea8b3e9c7f2cae9a4d4935f55ca9e80
Parent: 0f49d5d019afa4e94253bfc92f0daca3badb990b
Author: Kalpak Shah [EMAIL PROTECTED]
AuthorDate: Wed Jul 18 09:15:20 2007 -0400
Committer:  Theodore Ts'o [EMAIL PROTECTED]
CommitDate: Wed Jul 18 09:15:20 2007 -0400

ext4: Add nanosecond timestamps

This patch adds nanosecond timestamps for ext4. This involves adding
*time_extra fields to the ext4_inode to extend the timestamps to
64-bits.  Creation time is also added by this patch.

These extended fields will fit into an inode if the filesystem was
formatted with large inodes (-I 256 or larger) and there are currently
no EAs consuming all of the available space. For new inodes we always
reserve enough space for the kernel's known extended fields, but for
inodes created with an old kernel this might not have been the case. So
this patch also adds the EXT4_FEATURE_RO_COMPAT_EXTRA_ISIZE feature
flag(ro-compat so that older kernels can't create inodes with a smaller
extra_isize). which indicates if the fields fitting inside
s_min_extra_isize are available or not.  If the expansion of inodes if
unsuccessful then this feature will be disabled.  This feature is only
enabled if requested by the sysadmin.

None of the extended inode fields is critical for correct filesystem
operation.

Signed-off-by: Andreas Dilger [EMAIL PROTECTED]
Signed-off-by: Kalpak Shah [EMAIL PROTECTED]
Signed-off-by: Eric Sandeen [EMAIL PROTECTED]
Signed-off-by: Dave Kleikamp [EMAIL PROTECTED]
Signed-off-by: Mingming Cao [EMAIL PROTECTED]
Signed-off-by: Theodore Ts'o [EMAIL PROTECTED]
---
 fs/ext4/ialloc.c   |8 ++--
 fs/ext4/inode.c|   22 +++-
 fs/ext4/ioctl.c|4 +-
 fs/ext4/namei.c|   16 
 fs/ext4/super.c|   28 ++
 fs/ext4/xattr.c|2 +-
 include/linux/ext4_fs.h|   86 +++-
 include/linux/ext4_fs_i.h  |5 +++
 include/linux/ext4_fs_sb.h |1 +
 9 files changed, 147 insertions(+), 25 deletions(-)

diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c
index c88b439..427f830 100644
--- a/fs/ext4/ialloc.c
+++ b/fs/ext4/ialloc.c
@@ -563,7 +563,8 @@ got:
inode-i_ino = ino;
/* This is the optimal IO size (for stat), not the fs block size */
inode-i_blocks = 0;
-   inode-i_mtime = inode-i_atime = inode-i_ctime = CURRENT_TIME_SEC;
+   inode-i_mtime = inode-i_atime = inode-i_ctime = ei-i_crtime =
+  ext4_current_time(inode);
 
memset(ei-i_data, 0, sizeof(ei-i_data));
ei-i_dir_start_lookup = 0;
@@ -595,9 +596,8 @@ got:
spin_unlock(sbi-s_next_gen_lock);
 
ei-i_state = EXT4_STATE_NEW;
-   ei-i_extra_isize =
-   (EXT4_INODE_SIZE(inode-i_sb)  EXT4_GOOD_OLD_INODE_SIZE) ?
-   sizeof(struct ext4_inode) - EXT4_GOOD_OLD_INODE_SIZE : 0;
+
+   ei-i_extra_isize = EXT4_SB(sb)-s_want_extra_isize;
 
ret = inode;
if(DQUOT_ALLOC_INODE(inode)) {
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 49035c5..b83f91e 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -726,7 +726,7 @@ static int ext4_splice_branch(handle_t *handle, struct 
inode *inode,
 
/* We are done with atomic stuff, now do the rest of housekeeping */
 
-   inode-i_ctime = CURRENT_TIME_SEC;
+   inode-i_ctime = ext4_current_time(inode);
ext4_mark_inode_dirty(handle, inode);
 
/* had we spliced it onto indirect block? */
@@ -2375,7 +2375,7 @@ do_indirects:
ext4_discard_reservation(inode);
 
mutex_unlock(ei-truncate_mutex);
-   inode-i_mtime = inode-i_ctime = CURRENT_TIME_SEC;
+   inode-i_mtime = inode-i_ctime = ext4_current_time(inode);
ext4_mark_inode_dirty(handle, inode);
 
/*
@@ -2629,10 +2629,6 @@ void ext4_read_inode(struct inode * inode)
}
inode-i_nlink = le16_to_cpu(raw_inode-i_links_count);
inode-i_size = le32_to_cpu(raw_inode-i_size);
-   inode-i_atime.tv_sec = (signed)le32_to_cpu(raw_inode-i_atime);
-   inode-i_ctime.tv_sec = (signed)le32_to_cpu(raw_inode-i_ctime);
-   inode-i_mtime.tv_sec = (signed)le32_to_cpu(raw_inode-i_mtime);
-   inode-i_atime.tv_nsec = inode-i_ctime.tv_nsec = 
inode-i_mtime.tv_nsec = 0;
 
ei-i_state = 0;
ei-i_dir_start_lookup = 0;
@@ -2710,6 +2706,11 @@ void ext4_read_inode(struct inode * inode)
} else
ei-i_extra_isize = 0;
 
+   EXT4_INODE_GET_XTIME(i_ctime, inode, raw_inode);
+   EXT4_INODE_GET_XTIME(i_mtime, inode, raw_inode);
+   EXT4_INODE_GET_XTIME(i_atime, inode, raw_inode);
+   EXT4_EINODE_GET_XTIME(i_crtime, ei, raw_inode);
+
if 

ext4: Use is_power_of_2()

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1330593eb2d055bdd6ed935886cf2c13c896b288
Commit: 1330593eb2d055bdd6ed935886cf2c13c896b288
Parent: fc0e15a667121e02686cc52679f6272959fb60cc
Author: Vignesh Babu [EMAIL PROTECTED]
AuthorDate: Wed Jul 18 09:11:02 2007 -0400
Committer:  Theodore Ts'o [EMAIL PROTECTED]
CommitDate: Wed Jul 18 09:11:02 2007 -0400

ext4: Use is_power_of_2()

Replace (n  (n-1)) in the context of power of 2 checks with
is_power_of_2()

Signed-off-by: Vignesh Babu [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Dave Kleikamp [EMAIL PROTECTED]
Signed-off-by: Theodore Ts'o [EMAIL PROTECTED]
---
 fs/ext4/super.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index b47259f..6dcbb28 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -36,6 +36,7 @@
 #include linux/namei.h
 #include linux/quotaops.h
 #include linux/seq_file.h
+#include linux/log2.h
 
 #include asm/uaccess.h
 
@@ -1644,7 +1645,7 @@ static int ext4_fill_super (struct super_block *sb, void 
*data, int silent)
sbi-s_inode_size = le16_to_cpu(es-s_inode_size);
sbi-s_first_ino = le32_to_cpu(es-s_first_ino);
if ((sbi-s_inode_size  EXT4_GOOD_OLD_INODE_SIZE) ||
-   (sbi-s_inode_size  (sbi-s_inode_size - 1)) ||
+   (!is_power_of_2(sbi-s_inode_size)) ||
(sbi-s_inode_size  blocksize)) {
printk (KERN_ERR
EXT4-fs: unsupported inode size: %d\n,
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


ext4: remove extra IS_RDONLY() check

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d699594dc151c664a2b307e680a3cd9b7145fd83
Commit: d699594dc151c664a2b307e680a3cd9b7145fd83
Parent: 1330593eb2d055bdd6ed935886cf2c13c896b288
Author: Dave Hansen [EMAIL PROTECTED]
AuthorDate: Wed Jul 18 08:33:51 2007 -0400
Committer:  Theodore Ts'o [EMAIL PROTECTED]
CommitDate: Wed Jul 18 08:33:51 2007 -0400

ext4: remove extra IS_RDONLY() check

ext4_change_inode_journal_flag() is only called from one location:
ext4_ioctl(EXT3_IOC_SETFLAGS).  That ioctl case already has a IS_RDONLY()
call in it so this one is superfluous.

Signed-off-by: Dave Hansen [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Dave Kleikamp [EMAIL PROTECTED]
Signed-off-by: Theodore Ts'o [EMAIL PROTECTED]
---
 fs/ext4/inode.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 125aca7..de26c25 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -3275,7 +3275,7 @@ int ext4_change_inode_journal_flag(struct inode *inode, 
int val)
 */
 
journal = EXT4_JOURNAL(inode);
-   if (is_journal_aborted(journal) || IS_RDONLY(inode))
+   if (is_journal_aborted(journal))
return -EROFS;
 
jbd2_journal_lock_updates(journal);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Fix compilation with EXT_DEBUG, also fix leXX_to_cpu conversions.

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=26d535ed24f74ce949d7b49e40574c45cd845cdd
Commit: 26d535ed24f74ce949d7b49e40574c45cd845cdd
Parent: d699594dc151c664a2b307e680a3cd9b7145fd83
Author: Dmitry Monakhov [EMAIL PROTECTED]
AuthorDate: Wed Jul 18 08:33:37 2007 -0400
Committer:  Theodore Ts'o [EMAIL PROTECTED]
CommitDate: Wed Jul 18 08:33:37 2007 -0400

Fix compilation with EXT_DEBUG, also fix leXX_to_cpu conversions.

Signed-off-by: Dmitry Monakhov [EMAIL PROTECTED]
Acked-by: Alex Tomas [EMAIL PROTECTED]
Signed-off-by: Dave Kleikamp [EMAIL PROTECTED]
Signed-off-by: Theodore Ts'o [EMAIL PROTECTED]
---
 fs/ext4/extents.c |   18 ++
 1 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 96264b2..11ce15d 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -383,13 +383,14 @@ ext4_ext_binsearch_idx(struct inode *inode, struct 
ext4_ext_path *path, int bloc
r = m - 1;
else
l = m + 1;
-   ext_debug(%p(%u):%p(%u):%p(%u) , l, l-ei_block,
-   m, m-ei_block, r, r-ei_block);
+   ext_debug(%p(%u):%p(%u):%p(%u) , l, le32_to_cpu(l-ei_block),
+   m, le32_to_cpu(m-ei_block),
+   r, le32_to_cpu(r-ei_block));
}
 
path-p_idx = l - 1;
ext_debug(  - %d-%lld , le32_to_cpu(path-p_idx-ei_block),
- idx_block(path-p_idx));
+ idx_pblock(path-p_idx));
 
 #ifdef CHECK_BINSEARCH
{
@@ -448,8 +449,9 @@ ext4_ext_binsearch(struct inode *inode, struct 
ext4_ext_path *path, int block)
r = m - 1;
else
l = m + 1;
-   ext_debug(%p(%u):%p(%u):%p(%u) , l, l-ee_block,
-   m, m-ee_block, r, r-ee_block);
+   ext_debug(%p(%u):%p(%u):%p(%u) , l, le32_to_cpu(l-ee_block),
+   m, le32_to_cpu(m-ee_block),
+   r, le32_to_cpu(r-ee_block));
}
 
path-p_ext = l - 1;
@@ -582,7 +584,7 @@ static int ext4_ext_insert_index(handle_t *handle, struct 
inode *inode,
if (curp-p_idx != EXT_LAST_INDEX(curp-p_hdr)) {
len = (len - 1) * sizeof(struct ext4_extent_idx);
len = len  0 ? 0 : len;
-   ext_debug(insert new index %d after: %d. 
+   ext_debug(insert new index %d after: %llu. 
move %d from 0x%p to 0x%p\n,
logical, ptr, len,
(curp-p_idx + 1), (curp-p_idx + 2));
@@ -593,7 +595,7 @@ static int ext4_ext_insert_index(handle_t *handle, struct 
inode *inode,
/* insert before */
len = len * sizeof(struct ext4_extent_idx);
len = len  0 ? 0 : len;
-   ext_debug(insert new index %d before: %d. 
+   ext_debug(insert new index %d before: %llu. 
move %d from 0x%p to 0x%p\n,
logical, ptr, len,
curp-p_idx, (curp-p_idx + 1));
@@ -793,7 +795,7 @@ static int ext4_ext_split(handle_t *handle, struct inode 
*inode,
BUG_ON(EXT_MAX_INDEX(path[i].p_hdr) !=
EXT_LAST_INDEX(path[i].p_hdr));
while (path[i].p_idx = EXT_MAX_INDEX(path[i].p_hdr)) {
-   ext_debug(%d: move %d:%d in new index %llu\n, i,
+   ext_debug(%d: move %d:%llu in new index %llu\n, i,
le32_to_cpu(path[i].p_idx-ei_block),
idx_pblock(path[i].p_idx),
newblock);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


ext4: extent macros cleanup

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e9f410b1c035b6e63f0b4c3d6cfe4298d6a04492
Commit: e9f410b1c035b6e63f0b4c3d6cfe4298d6a04492
Parent: 26d535ed24f74ce949d7b49e40574c45cd845cdd
Author: Dmitry Monakhov [EMAIL PROTECTED]
AuthorDate: Wed Jul 18 09:09:15 2007 -0400
Committer:  Theodore Ts'o [EMAIL PROTECTED]
CommitDate: Wed Jul 18 09:09:15 2007 -0400

ext4: extent macros cleanup

Use the EXT_LAST_INDEX macro; that's what it's there for.

Clean up ext4_ext_ext_grow_indepth() so the correct EXT_FIRST_INDEX or
EXT_FIRST_MACRO is used as necessary.  The two macros are equivalent, so
the C will collapse the if statement out, but it makes the code much
more readable.

Signed-off-by: Dmitry Monakhov [EMAIL PROTECTED]
Acked-by: Alex Tomas [EMAIL PROTECTED]
Signed-off-by: Dave Kleikamp [EMAIL PROTECTED]
Singed-off-by: Mingming Cao [EMAIL PROTECTED]
Signed-off-by: Theodore Ts'o [EMAIL PROTECTED]
---
 fs/ext4/extents.c |   13 +
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 11ce15d..750c46f 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -376,7 +376,7 @@ ext4_ext_binsearch_idx(struct inode *inode, struct 
ext4_ext_path *path, int bloc
ext_debug(binsearch for %d(idx):  , block);
 
l = EXT_FIRST_INDEX(eh) + 1;
-   r = EXT_FIRST_INDEX(eh) + le16_to_cpu(eh-eh_entries) - 1;
+   r = EXT_LAST_INDEX(eh);
while (l = r) {
m = l + (r - l) / 2;
if (block  le32_to_cpu(m-ei_block))
@@ -441,7 +441,7 @@ ext4_ext_binsearch(struct inode *inode, struct 
ext4_ext_path *path, int block)
ext_debug(binsearch for %d:  , block);
 
l = EXT_FIRST_EXTENT(eh) + 1;
-   r = EXT_FIRST_EXTENT(eh) + le16_to_cpu(eh-eh_entries) - 1;
+   r = EXT_LAST_EXTENT(eh);
 
while (l = r) {
m = l + (r - l) / 2;
@@ -924,8 +924,13 @@ static int ext4_ext_grow_indepth(handle_t *handle, struct 
inode *inode,
curp-p_hdr-eh_max = cpu_to_le16(ext4_ext_space_root_idx(inode));
curp-p_hdr-eh_entries = cpu_to_le16(1);
curp-p_idx = EXT_FIRST_INDEX(curp-p_hdr);
-   /* FIXME: it works, but actually path[0] can be index */
-   curp-p_idx-ei_block = EXT_FIRST_EXTENT(path[0].p_hdr)-ee_block;
+
+   if (path[0].p_hdr-eh_depth)
+   curp-p_idx-ei_block =
+   EXT_FIRST_INDEX(path[0].p_hdr)-ei_block;
+   else
+   curp-p_idx-ei_block =
+   EXT_FIRST_EXTENT(path[0].p_hdr)-ee_block;
ext4_idx_store_pblock(curp-p_idx, newblock);
 
neh = ext_inode_hdr(inode);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Use zero_user_page() in ext4 where possible

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=fc0e15a667121e02686cc52679f6272959fb60cc
Commit: fc0e15a667121e02686cc52679f6272959fb60cc
Parent: f8628a14a27eb4512a1ede43de1d9db4d9f92bc3
Author: Eric Sandeen [EMAIL PROTECTED]
AuthorDate: Wed Jul 18 09:20:44 2007 -0400
Committer:  Theodore Ts'o [EMAIL PROTECTED]
CommitDate: Wed Jul 18 09:20:44 2007 -0400

Use zero_user_page() in ext4 where possible

Signed-off-by: Eric Sandeen [EMAIL PROTECTED]
Signed-off-by: Theodore Ts'o [EMAIL PROTECTED]
---
 fs/ext4/inode.c |   11 ++-
 1 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index f6d8528..125aca7 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -1766,7 +1766,6 @@ int ext4_block_truncate_page(handle_t *handle, struct 
page *page,
struct inode *inode = mapping-host;
struct buffer_head *bh;
int err = 0;
-   void *kaddr;
 
blocksize = inode-i_sb-s_blocksize;
length = blocksize - (offset  (blocksize - 1));
@@ -1778,10 +1777,7 @@ int ext4_block_truncate_page(handle_t *handle, struct 
page *page,
 */
if (!page_has_buffers(page)  test_opt(inode-i_sb, NOBH) 
 ext4_should_writeback_data(inode)  PageUptodate(page)) {
-   kaddr = kmap_atomic(page, KM_USER0);
-   memset(kaddr + offset, 0, length);
-   flush_dcache_page(page);
-   kunmap_atomic(kaddr, KM_USER0);
+   zero_user_page(page, offset, length, KM_USER0);
set_page_dirty(page);
goto unlock;
}
@@ -1834,10 +1830,7 @@ int ext4_block_truncate_page(handle_t *handle, struct 
page *page,
goto unlock;
}
 
-   kaddr = kmap_atomic(page, KM_USER0);
-   memset(kaddr + offset, 0, length);
-   flush_dcache_page(page);
-   kunmap_atomic(kaddr, KM_USER0);
+   zero_user_page(page, offset, length, KM_USER0);
 
BUFFER_TRACE(bh, zeroed end of block);
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


ext4: Remove 65000 subdirectory limit

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f8628a14a27eb4512a1ede43de1d9db4d9f92bc3
Commit: f8628a14a27eb4512a1ede43de1d9db4d9f92bc3
Parent: 6dd4ee7cab7e3a17c571aebd444f4344c8c4946e
Author: Andreas Dilger [EMAIL PROTECTED]
AuthorDate: Wed Jul 18 08:38:01 2007 -0400
Committer:  Theodore Ts'o [EMAIL PROTECTED]
CommitDate: Wed Jul 18 08:38:01 2007 -0400

ext4: Remove 65000 subdirectory limit

This patch adds support to ext4 for allowing more than 65000
subdirectories. Currently the maximum number of subdirectories is capped
at 32000.

If we exceed 65000 subdirectories in an htree directory it sets the
inode link count to 1 and no longer counts subdirectories.  The
directory link count is not actually used when determining if a
directory is empty, as that only counts subdirectories and not regular
files that might be in there.

A EXT4_FEATURE_RO_COMPAT_DIR_NLINK flag has been added and it is set if
the subdir count for any directory crosses 65000. A later fsck will clear
EXT4_FEATURE_RO_COMPAT_DIR_NLINK if there are no longer any directory
with 65000 subdirs.

Signed-off-by: Andreas Dilger [EMAIL PROTECTED]
Signed-off-by: Kalpak Shah [EMAIL PROTECTED]
Signed-off-by: Theodore Ts'o [EMAIL PROTECTED]
---
 fs/ext4/namei.c |   60 ---
 include/linux/ext4_fs.h |4 ++-
 2 files changed, 49 insertions(+), 15 deletions(-)

diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index 40106b7..da22497 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -1629,6 +1629,35 @@ static int ext4_delete_entry (handle_t *handle,
return -ENOENT;
 }
 
+/*
+ * DIR_NLINK feature is set if 1) nlinks  EXT4_LINK_MAX or 2) nlinks == 2,
+ * since this indicates that nlinks count was previously 1.
+ */
+static void ext4_inc_count(handle_t *handle, struct inode *inode)
+{
+   inc_nlink(inode);
+   if (is_dx(inode)  inode-i_nlink  1) {
+   /* limit is 16-bit i_links_count */
+   if (inode-i_nlink = EXT4_LINK_MAX || inode-i_nlink == 2) {
+   inode-i_nlink = 1;
+   EXT4_SET_RO_COMPAT_FEATURE(inode-i_sb,
+ EXT4_FEATURE_RO_COMPAT_DIR_NLINK);
+   }
+   }
+}
+
+/*
+ * If a directory had nlink == 1, then we should let it be 1. This indicates
+ * directory has EXT4_LINK_MAX subdirs.
+ */
+static void ext4_dec_count(handle_t *handle, struct inode *inode)
+{
+   drop_nlink(inode);
+   if (S_ISDIR(inode-i_mode)  inode-i_nlink == 0)
+   inc_nlink(inode);
+}
+
+
 static int ext4_add_nondir(handle_t *handle,
struct dentry *dentry, struct inode *inode)
 {
@@ -1725,7 +1754,7 @@ static int ext4_mkdir(struct inode * dir, struct dentry * 
dentry, int mode)
struct ext4_dir_entry_2 * de;
int err, retries = 0;
 
-   if (dir-i_nlink = EXT4_LINK_MAX)
+   if (EXT4_DIR_LINK_MAX(dir))
return -EMLINK;
 
 retry:
@@ -1748,7 +1777,7 @@ retry:
inode-i_size = EXT4_I(inode)-i_disksize = inode-i_sb-s_blocksize;
dir_block = ext4_bread (handle, inode, 0, 1, err);
if (!dir_block) {
-   drop_nlink(inode); /* is this nlink == 0? */
+   ext4_dec_count(handle, inode); /* is this nlink == 0? */
ext4_mark_inode_dirty(handle, inode);
iput (inode);
goto out_stop;
@@ -1780,7 +1809,7 @@ retry:
iput (inode);
goto out_stop;
}
-   inc_nlink(dir);
+   ext4_inc_count(handle, dir);
ext4_update_dx_flag(dir);
ext4_mark_inode_dirty(handle, dir);
d_instantiate(dentry, inode);
@@ -2045,9 +2074,9 @@ static int ext4_rmdir (struct inode * dir, struct dentry 
*dentry)
retval = ext4_delete_entry(handle, dir, de, bh);
if (retval)
goto end_rmdir;
-   if (inode-i_nlink != 2)
+   if (!EXT4_DIR_LINK_EMPTY(inode))
ext4_warning (inode-i_sb, ext4_rmdir,
- empty directory has nlink!=2 (%d),
+ empty directory has too many links (%d),
  inode-i_nlink);
inode-i_version++;
clear_nlink(inode);
@@ -2058,7 +2087,7 @@ static int ext4_rmdir (struct inode * dir, struct dentry 
*dentry)
ext4_orphan_add(handle, inode);
inode-i_ctime = dir-i_ctime = dir-i_mtime = ext4_current_time(inode);
ext4_mark_inode_dirty(handle, inode);
-   drop_nlink(dir);
+   ext4_dec_count(handle, dir);
ext4_update_dx_flag(dir);
ext4_mark_inode_dirty(handle, dir);
 
@@ -2109,7 +2138,7 @@ static int ext4_unlink(struct inode * dir, struct dentry 
*dentry)
dir-i_ctime = dir-i_mtime = ext4_current_time(dir);
ext4_update_dx_flag(dir);
ext4_mark_inode_dirty(handle, 

ext4: Expand extra_inodes space per the s_{want,min}_extra_isize fields

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6dd4ee7cab7e3a17c571aebd444f4344c8c4946e
Commit: 6dd4ee7cab7e3a17c571aebd444f4344c8c4946e
Parent: ef7f38359ea8b3e9c7f2cae9a4d4935f55ca9e80
Author: Kalpak Shah [EMAIL PROTECTED]
AuthorDate: Wed Jul 18 09:19:57 2007 -0400
Committer:  Theodore Ts'o [EMAIL PROTECTED]
CommitDate: Wed Jul 18 09:19:57 2007 -0400

ext4: Expand extra_inodes space per the s_{want,min}_extra_isize fields

We need to make sure that existing ext3 filesystems can also avail the
new fields that have been added to the ext4 inode. We use
s_want_extra_isize and s_min_extra_isize to decide by how much we should
expand the inode. If EXT4_FEATURE_RO_COMPAT_EXTRA_ISIZE feature is set
then we expand the inode by max(s_want_extra_isize, s_min_extra_isize ,
sizeof(ext4_inode) - EXT4_GOOD_OLD_INODE_SIZE) bytes. Actually it is
still an open question about whether users should be able to set
s_*_extra_isize smaller than the known fields or not.

This patch also adds the functionality to expand inodes to include the
newly added fields. We start by trying to expand by s_want_extra_isize
bytes and if its fails we try to expand by s_min_extra_isize bytes. This
is done by changing the i_extra_isize if enough space is available in
the inode and no EAs are present. If EAs are present and there is enough
space in the inode then the EAs in the inode are shifted to make space.
If enough space is not available in the inode due to the EAs then 1 or
more EAs are shifted to the external EA block. In the worst case when
even the external EA block does not have enough space we inform the user
that some EA would need to be deleted or s_min_extra_isize would have to
be reduced.

Signed-off-by: Andreas Dilger [EMAIL PROTECTED]
Signed-off-by: Kalpak Shah [EMAIL PROTECTED]
Signed-off-by: Mingming Cao [EMAIL PROTECTED]
Signed-off-by: Theodore Ts'o [EMAIL PROTECTED]
---
 fs/ext4/inode.c |   63 +++-
 fs/ext4/xattr.c |  274 +--
 fs/ext4/xattr.h |   17 +++
 include/linux/ext4_fs.h |1 +
 4 files changed, 347 insertions(+), 8 deletions(-)

diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index b83f91e..f6d8528 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -3106,6 +3106,39 @@ ext4_reserve_inode_write(handle_t *handle, struct inode 
*inode,
 }
 
 /*
+ * Expand an inode by new_extra_isize bytes.
+ * Returns 0 on success or negative error number on failure.
+ */
+int ext4_expand_extra_isize(struct inode *inode, unsigned int new_extra_isize,
+   struct ext4_iloc iloc, handle_t *handle)
+{
+   struct ext4_inode *raw_inode;
+   struct ext4_xattr_ibody_header *header;
+   struct ext4_xattr_entry *entry;
+
+   if (EXT4_I(inode)-i_extra_isize = new_extra_isize)
+   return 0;
+
+   raw_inode = ext4_raw_inode(iloc);
+
+   header = IHDR(inode, raw_inode);
+   entry = IFIRST(header);
+
+   /* No extended attributes present */
+   if (!(EXT4_I(inode)-i_state  EXT4_STATE_XATTR) ||
+   header-h_magic != cpu_to_le32(EXT4_XATTR_MAGIC)) {
+   memset((void *)raw_inode + EXT4_GOOD_OLD_INODE_SIZE, 0,
+   new_extra_isize);
+   EXT4_I(inode)-i_extra_isize = new_extra_isize;
+   return 0;
+   }
+
+   /* try to expand with EAs present */
+   return ext4_expand_extra_isize_ea(inode, new_extra_isize,
+ raw_inode, handle);
+}
+
+/*
  * What we do here is to mark the in-core inode as clean with respect to inode
  * dirtiness (it may still be data-dirty).
  * This means that the in-core inode may be reaped by prune_icache
@@ -3129,10 +3162,38 @@ ext4_reserve_inode_write(handle_t *handle, struct inode 
*inode,
 int ext4_mark_inode_dirty(handle_t *handle, struct inode *inode)
 {
struct ext4_iloc iloc;
-   int err;
+   struct ext4_sb_info *sbi = EXT4_SB(inode-i_sb);
+   static unsigned int mnt_count;
+   int err, ret;
 
might_sleep();
err = ext4_reserve_inode_write(handle, inode, iloc);
+   if (EXT4_I(inode)-i_extra_isize  sbi-s_want_extra_isize 
+   !(EXT4_I(inode)-i_state  EXT4_STATE_NO_EXPAND)) {
+   /*
+* We need extra buffer credits since we may write into EA block
+* with this same handle. If journal_extend fails, then it will
+* only result in a minor loss of functionality for that inode.
+* If this is felt to be critical, then e2fsck should be run to
+* force a large enough s_min_extra_isize.
+*/
+   if ((jbd2_journal_extend(handle,
+EXT4_DATA_TRANS_BLOCKS(inode-i_sb))) == 0) {
+   ret = 

V4L/DVB (5563a): Add experimental support for tea5761 tuner

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8573a9e6a8ed724b7e3074dc8762d4117ed0b3aa
Commit: 8573a9e6a8ed724b7e3074dc8762d4117ed0b3aa
Parent: 8b4a40809e5330c9da5d20107d693d92d73b31dc
Author: Mauro Carvalho Chehab [EMAIL PROTECTED]
AuthorDate: Sun Apr 8 01:09:11 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:23:11 2007 -0300

V4L/DVB (5563a): Add experimental support for tea5761 tuner

This driver were made based on tea5761 specs.

Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 Documentation/video4linux/CARDLIST.tuner |1 +
 drivers/media/video/Kconfig  |8 +
 drivers/media/video/Makefile |4 +
 drivers/media/video/tea5761.c|  239 ++
 drivers/media/video/tuner-core.c |   26 
 drivers/media/video/tuner-types.c|4 +
 include/media/tuner.h|8 +-
 7 files changed, 289 insertions(+), 1 deletions(-)

diff --git a/Documentation/video4linux/CARDLIST.tuner 
b/Documentation/video4linux/CARDLIST.tuner
index 44134f0..9b02dbb 100644
--- a/Documentation/video4linux/CARDLIST.tuner
+++ b/Documentation/video4linux/CARDLIST.tuner
@@ -72,3 +72,4 @@ tuner=70 - Samsung TCPN 2121P30A
 tuner=71 - Xceive xc3028
 tuner=72 - Thomson FE6600
 tuner=73 - Samsung TCPG 6121P30A
+tuner=75 - Philips TEA5761 FM Radio
diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig
index 4d45a40..bb072ab 100644
--- a/drivers/media/video/Kconfig
+++ b/drivers/media/video/Kconfig
@@ -489,6 +489,14 @@ config TUNER_3036
  Say Y here to include support for Philips SAB3036 compatible tuners.
  If in doubt, say N.
 
+config TUNER_TEA5761
+   tristate TEA 5761 radio tuner (EXPERIMENTAL)
+   depends on I2C
+   select VIDEO_TUNER
+   help
+ Say Y here to include support for Philips TEA5761 radio tuner.
+ If in doubt, say N.
+
 config VIDEO_VINO
tristate SGI Vino Video For Linux (EXPERIMENTAL)
depends on I2C  SGI_IP22  EXPERIMENTAL  VIDEO_V4L2
diff --git a/drivers/media/video/Makefile b/drivers/media/video/Makefile
index 9c2de50..3202e87 100644
--- a/drivers/media/video/Makefile
+++ b/drivers/media/video/Makefile
@@ -7,6 +7,10 @@ zr36067-objs   :=  zoran_procfs.o zoran_device.o \
 tuner-objs :=  tuner-core.o tuner-types.o tuner-simple.o \
mt20xx.o tda8290.o tea5767.o tda9887.o
 
+ifneq ($(CONFIG_TUNER_TEA5761),n)
+  tuner-objs += tea5761.o
+endif
+
 msp3400-objs   :=  msp3400-driver.o msp3400-kthreads.o
 
 obj-$(CONFIG_VIDEO_DEV) += videodev.o v4l2-common.o compat_ioctl32.o
diff --git a/drivers/media/video/tea5761.c b/drivers/media/video/tea5761.c
new file mode 100644
index 000..4d2d3ef
--- /dev/null
+++ b/drivers/media/video/tea5761.c
@@ -0,0 +1,239 @@
+/*
+ * For Philips TEA5761 FM Chip
+ * I2C address is allways 0x20 (0x10 at 7-bit mode).
+ *
+ * Copyright (c) 2005-2007 Mauro Carvalho Chehab ([EMAIL PROTECTED])
+ * This code is placed under the terms of the GNUv2 General Public License
+ *
+ */
+
+#include linux/i2c.h
+#include linux/videodev.h
+#include linux/delay.h
+#include media/tuner.h
+#include media/tuner.h
+
+#define PREFIX TEA5761 
+
+/* from tuner-core.c */
+extern int tuner_debug;
+
+/*/
+
+/***
+ * TEA5761HN I2C registers *
+ ***/
+
+/* INTREG - Read: bytes 0 and 1 / Write: byte 0 */
+
+   /* first byte for reading */
+#define TEA5761_INTREG_IFFLAG  0x10
+#define TEA5761_INTREG_LEVFLAG 0x8
+#define TEA5761_INTREG_FRRFLAG 0x2
+#define TEA5761_INTREG_BLFLAG  0x1
+
+   /* second byte for reading / byte for writing */
+#define TEA5761_INTREG_IFMSK   0x10
+#define TEA5761_INTREG_LEVMSK  0x8
+#define TEA5761_INTREG_FRMSK   0x2
+#define TEA5761_INTREG_BLMSK   0x1
+
+/* FRQSET - Read: bytes 2 and 3 / Write: byte 1 and 2 */
+
+   /* First byte */
+#define TEA5761_FRQSET_SEARCH_UP 0x80  /* 1=Station search from botton 
to up */
+#define TEA5761_FRQSET_SEARCH_MODE 0x40/* 1=Search mode */
+
+   /* Bits 0-5 for divider MSB */
+
+   /* Second byte */
+   /* Bits 0-7 for divider LSB */
+
+/* TNCTRL - Read: bytes 4 and 5 / Write: Bytes 3 and 4 */
+
+   /* first byte */
+
+#define TEA5761_TNCTRL_PUPD_0  0x40/* Power UP/Power Down MSB */
+#define TEA5761_TNCTRL_BLIM0X20/* 1= Japan Frequencies, 0= European 
frequencies */
+#define TEA5761_TNCTRL_SWPM0x10/* 1= software port is FRRFLAG */
+#define TEA5761_TNCTRL_IFCTC   0x08/* 1= IF count time 15.02 ms, 0= IF 
count time 2.02 ms */
+#define TEA5761_TNCTRL_AFM 0x04
+#define TEA5761_TNCTRL_SMUTE   0x02/* 1= Soft mute */
+#define TEA5761_TNCTRL_SNC 0x01
+
+   /* second 

V4L/DVB (5629): Cx88: VP3054 support can't be a module when cx88 is compiled in

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ecf854df72847d90d5e44b6676a855677b5a33df
Commit: ecf854df72847d90d5e44b6676a855677b5a33df
Parent: 8573a9e6a8ed724b7e3074dc8762d4117ed0b3aa
Author: Trent Piepho [EMAIL PROTECTED]
AuthorDate: Sat May 5 20:11:32 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:23:11 2007 -0300

V4L/DVB (5629): Cx88: VP3054 support can't be a module when cx88 is 
compiled in

If cx88 support is compiled into the kernel while vp3054 is left as a 
module,
the kernel will fail to link.  Adjust the existing #if code in cx88 so
that it won't consider vp3054 to be supported in this case.

It might make sense to move vp3054 selection into the customisation menu
instead of a cx88 sub-option (though this is a cx88 feature, there is no 
extra
chip involved).

It might also make sense to use dvb_attach() to load vp3054 support.

Signed-off-by: Trent Piepho [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/video/cx88/cx88-dvb.c|   13 -
 drivers/media/video/cx88/cx88-vp3054-i2c.h |7 +++
 2 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/drivers/media/video/cx88/cx88-dvb.c 
b/drivers/media/video/cx88/cx88-dvb.c
index dbfe4dc..796083f 100644
--- a/drivers/media/video/cx88/cx88-dvb.c
+++ b/drivers/media/video/cx88/cx88-dvb.c
@@ -35,9 +35,7 @@
 
 #include mt352.h
 #include mt352_priv.h
-#if defined(CONFIG_VIDEO_CX88_VP3054) || 
defined(CONFIG_VIDEO_CX88_VP3054_MODULE)
-# include cx88-vp3054-i2c.h
-#endif
+#include cx88-vp3054-i2c.h
 #include zl10353.h
 #include cx22702.h
 #include or51132.h
@@ -199,7 +197,7 @@ static struct mt352_config dvico_fusionhdtv_dual = {
.demod_init= dvico_dual_demod_init,
 };
 
-#if defined(CONFIG_VIDEO_CX88_VP3054) || 
defined(CONFIG_VIDEO_CX88_VP3054_MODULE)
+#if defined(CONFIG_VIDEO_CX88_VP3054) || 
(defined(CONFIG_VIDEO_CX88_VP3054_MODULE)  defined(MODULE))
 static int dntv_live_dvbt_pro_demod_init(struct dvb_frontend* fe)
 {
static u8 clock_config []  = { 0x89, 0x38, 0x38 };
@@ -544,7 +542,7 @@ static int dvb_register(struct cx8802_dev *dev)
}
break;
case CX88_BOARD_DNTV_LIVE_DVB_T_PRO:
-#if defined(CONFIG_VIDEO_CX88_VP3054) || 
defined(CONFIG_VIDEO_CX88_VP3054_MODULE)
+#if defined(CONFIG_VIDEO_CX88_VP3054) || 
(defined(CONFIG_VIDEO_CX88_VP3054_MODULE)  defined(MODULE))
dev-core-pll_addr = 0x61;
dev-core-pll_desc = dvb_pll_fmd1216me;
dev-dvb.frontend = dvb_attach(mt352_attach, 
dntv_live_dvbt_pro_config,
@@ -778,11 +776,10 @@ static int cx8802_dvb_probe(struct cx8802_driver *drv)
if (!(cx88_boards[core-board].mpeg  CX88_MPEG_DVB))
goto fail_core;
 
-#if defined(CONFIG_VIDEO_CX88_VP3054) || 
defined(CONFIG_VIDEO_CX88_VP3054_MODULE)
+   /* If vp3054 isn't enabled, a stub will just return 0 */
err = vp3054_i2c_probe(dev);
if (0 != err)
goto fail_core;
-#endif
 
/* dvb stuff */
printk(%s/2: cx2388x based dvb card\n, core-name);
@@ -807,9 +804,7 @@ static int cx8802_dvb_remove(struct cx8802_driver *drv)
/* dvb */
videobuf_dvb_unregister(dev-dvb);
 
-#if defined(CONFIG_VIDEO_CX88_VP3054) || 
defined(CONFIG_VIDEO_CX88_VP3054_MODULE)
vp3054_i2c_remove(dev);
-#endif
 
return 0;
 }
diff --git a/drivers/media/video/cx88/cx88-vp3054-i2c.h 
b/drivers/media/video/cx88/cx88-vp3054-i2c.h
index 637a7d2..be99c93 100644
--- a/drivers/media/video/cx88/cx88-vp3054-i2c.h
+++ b/drivers/media/video/cx88/cx88-vp3054-i2c.h
@@ -30,5 +30,12 @@ struct vp3054_i2c_state {
 };
 
 /* --- */
+#if defined(CONFIG_VIDEO_CX88_VP3054) || 
(defined(CONFIG_VIDEO_CX88_VP3054_MODULE)  defined(MODULE))
 int  vp3054_i2c_probe(struct cx8802_dev *dev);
 void vp3054_i2c_remove(struct cx8802_dev *dev);
+#else
+static inline int  vp3054_i2c_probe(struct cx8802_dev *dev)
+{ return 0; }
+static inline void vp3054_i2c_remove(struct cx8802_dev *dev)
+{ }
+#endif
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


V4L/DVB (5631): Dvb-core: Add level fixes to printk()s, plus spelling/grammer

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=900858ecb30c27ac94369052be650e25c0fd7d2a
Commit: 900858ecb30c27ac94369052be650e25c0fd7d2a
Parent: ecf854df72847d90d5e44b6676a855677b5a33df
Author: Simon Arlott [EMAIL PROTECTED]
AuthorDate: Sun May 6 21:06:32 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:23:12 2007 -0300

V4L/DVB (5631): Dvb-core: Add level fixes to printk()s, plus 
spelling/grammer

All the printks had missing level prefixes so I've fixed these too.
Also fixed some grammer errors.

Signed-off-by: Simon Arlott [EMAIL PROTECTED]
Signed-off-by: Trent Piepho [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/dvb/dvb-core/dvbdev.c |   10 +-
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/media/dvb/dvb-core/dvbdev.c 
b/drivers/media/dvb/dvb-core/dvbdev.c
index a9fa333..9ef0c00 100644
--- a/drivers/media/dvb/dvb-core/dvbdev.c
+++ b/drivers/media/dvb/dvb-core/dvbdev.c
@@ -208,7 +208,7 @@ int dvb_register_device(struct dvb_adapter *adap, struct 
dvb_device **pdvbdev,
if ((id = dvbdev_get_free_id (adap, type))  0){
mutex_unlock(dvbdev_register_lock);
*pdvbdev = NULL;
-   printk (%s: could get find free device id...\n, __FUNCTION__);
+   printk(KERN_ERR %s: couldn't find free device id\n, 
__FUNCTION__);
return -ENFILE;
}
 
@@ -252,7 +252,7 @@ int dvb_register_device(struct dvb_adapter *adap, struct 
dvb_device **pdvbdev,
return PTR_ERR(clsdev);
}
 
-   dprintk(DVB: register adapter%d/%s%d @ minor: %i (0x%02x)\n,
+   dprintk(KERN_DEBUG DVB: register adapter%d/%s%d @ minor: %i 
(0x%02x)\n,
adap-num, dnames[type], id, nums2minor(adap-num, type, id),
nums2minor(adap-num, type, id));
 
@@ -311,7 +311,7 @@ int dvb_register_adapter(struct dvb_adapter *adap, const 
char *name, struct modu
memset (adap, 0, sizeof(struct dvb_adapter));
INIT_LIST_HEAD (adap-device_list);
 
-   printk (DVB: registering new adapter (%s).\n, name);
+   printk(KERN_INFO DVB: registering new adapter (%s)\n, name);
 
adap-num = num;
adap-name = name;
@@ -407,13 +407,13 @@ static int __init init_dvbdev(void)
dev_t dev = MKDEV(DVB_MAJOR, 0);
 
if ((retval = register_chrdev_region(dev, MAX_DVB_MINORS, DVB)) != 0) 
{
-   printk(dvb-core: unable to get major %d\n, DVB_MAJOR);
+   printk(KERN_ERR dvb-core: unable to get major %d\n, 
DVB_MAJOR);
return retval;
}
 
cdev_init(dvb_device_cdev, dvb_device_fops);
if ((retval = cdev_add(dvb_device_cdev, dev, MAX_DVB_MINORS)) != 0) {
-   printk(dvb-core: unable to get major %d\n, DVB_MAJOR);
+   printk(KERN_ERR dvb-core: unable register character device\n);
goto error;
}
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


V4L/DVB (5632): Dvb-pll: pass dvb_frontend_parameters to generic set() function

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=77d675047062d514acdc1bbe9f84658b39f99abe
Commit: 77d675047062d514acdc1bbe9f84658b39f99abe
Parent: 900858ecb30c27ac94369052be650e25c0fd7d2a
Author: Michael Krufky [EMAIL PROTECTED]
AuthorDate: Sat May 5 12:05:39 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:23:12 2007 -0300

V4L/DVB (5632): Dvb-pll: pass dvb_frontend_parameters to generic set() 
function

Rename dvb_pll_desc.setbw() to set(), and accept struct 
dvb_frontend_parameters
instead of passing both freq and bandwidth, so that this may be used as a
generic function.

In order to do this, dvb_pll_configure must also be altered in the same 
manner,
to take struct dvb_frontend_parameters instead of freq and bandwidth.

Signed-off-by: Michael Krufky [EMAIL PROTECTED]
Signed-off-by: Trent Piepho [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/dvb/dvb-usb/dvb-usb-i2c.c   |2 +-
 drivers/media/dvb/frontends/dvb-pll.c |   94 +
 drivers/media/dvb/frontends/dvb-pll.h |4 +-
 drivers/media/dvb/ttpci/budget-av.c   |3 +-
 drivers/media/video/cx88/cx88-dvb.c   |4 +-
 drivers/media/video/saa7134/saa7134-dvb.c |4 +-
 6 files changed, 49 insertions(+), 62 deletions(-)

diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-i2c.c 
b/drivers/media/dvb/dvb-usb/dvb-usb-i2c.c
index 088b6de..4c80823 100644
--- a/drivers/media/dvb/dvb-usb/dvb-usb-i2c.c
+++ b/drivers/media/dvb/dvb-usb/dvb-usb-i2c.c
@@ -90,7 +90,7 @@ int dvb_usb_tuner_calc_regs(struct dvb_frontend *fe, struct 
dvb_frontend_paramet
deb_pll(pll addr: %x, freq: %d %p\n,adap-pll_addr, fep-frequency, 
adap-pll_desc);
 
b[0] = adap-pll_addr;
-   dvb_pll_configure(adap-pll_desc, b[1], fep-frequency, 
fep-u.ofdm.bandwidth);
+   dvb_pll_configure(adap-pll_desc, b[1], fep);
 
deb_pll(pll-buf: %x %x %x %x %x\n,b[0],b[1],b[2],b[3],b[4]);
 
diff --git a/drivers/media/dvb/frontends/dvb-pll.c 
b/drivers/media/dvb/frontends/dvb-pll.c
index 5f96ffd..0e3195f 100644
--- a/drivers/media/dvb/frontends/dvb-pll.c
+++ b/drivers/media/dvb/frontends/dvb-pll.c
@@ -68,9 +68,10 @@ struct dvb_pll_desc dvb_pll_thomson_dtt7610 = {
 };
 EXPORT_SYMBOL(dvb_pll_thomson_dtt7610);
 
-static void thomson_dtt759x_bw(u8 *buf, u32 freq, int bandwidth)
+static void thomson_dtt759x_bw(u8 *buf,
+  const struct dvb_frontend_parameters *params)
 {
-   if (BANDWIDTH_7_MHZ == bandwidth)
+   if (BANDWIDTH_7_MHZ == params-u.ofdm.bandwidth)
buf[3] |= 0x10;
 }
 
@@ -78,7 +79,7 @@ struct dvb_pll_desc dvb_pll_thomson_dtt759x = {
.name  = Thomson dtt759x,
.min   = 17700,
.max   = 89600,
-   .setbw = thomson_dtt759x_bw,
+   .set   = thomson_dtt759x_bw,
.iffreq= 3617,
.sleepdata = (u8[]){ 2, 0x84, 0x03 },
.count = 5,
@@ -195,9 +196,9 @@ EXPORT_SYMBOL(dvb_pll_env57h1xd5);
 /* Philips TDA6650/TDA6651
  * used in Panasonic ENV77H11D5
  */
-static void tda665x_bw(u8 *buf, u32 freq, int bandwidth)
+static void tda665x_bw(u8 *buf, const struct dvb_frontend_parameters *params)
 {
-   if (bandwidth == BANDWIDTH_8_MHZ)
+   if (params-u.ofdm.bandwidth == BANDWIDTH_8_MHZ)
buf[3] |= 0x08;
 }
 
@@ -205,7 +206,7 @@ struct dvb_pll_desc dvb_pll_tda665x = {
.name  = Philips TDA6650/TDA6651,
.min   =  4425,
.max   = 85800,
-   .setbw = tda665x_bw,
+   .set   = tda665x_bw,
.iffreq= 3617,
.count = 12,
.entries = {
@@ -228,9 +229,9 @@ EXPORT_SYMBOL(dvb_pll_tda665x);
 /* Infineon TUA6034
  * used in LG TDTP E102P
  */
-static void tua6034_bw(u8 *buf, u32 freq, int bandwidth)
+static void tua6034_bw(u8 *buf, const struct dvb_frontend_parameters *params)
 {
-   if (BANDWIDTH_7_MHZ != bandwidth)
+   if (BANDWIDTH_7_MHZ != params-u.ofdm.bandwidth)
buf[3] |= 0x08;
 }
 
@@ -240,7 +241,7 @@ struct dvb_pll_desc dvb_pll_tua6034 = {
.max   = 85800,
.iffreq= 3617,
.count = 3,
-   .setbw = tua6034_bw,
+   .set   = tua6034_bw,
.entries = {
{  17450, 62500, 0xce, 0x01 },
{  23000, 62500, 0xce, 0x02 },
@@ -270,9 +271,10 @@ EXPORT_SYMBOL(dvb_pll_lg_tdvs_h06xf);
 /* Philips FMD1216ME
  * used in Medion Hybrid PCMCIA card and USB Box
  */
-static void fmd1216me_bw(u8 *buf, u32 freq, int bandwidth)
+static void fmd1216me_bw(u8 *buf, const struct dvb_frontend_parameters *params)
 {
-   if (bandwidth == BANDWIDTH_8_MHZ  freq = 15887)
+   if (params-u.ofdm.bandwidth == BANDWIDTH_8_MHZ 
+   params-frequency = 15887)
buf[3] |= 0x08;
 }
 
@@ -281,7 +283,7 @@ struct dvb_pll_desc dvb_pll_fmd1216me = {
.min = 5087,

V4L/DVB (5633): Tuv1236d: move rf input switching code into dvb-pll

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4abe9f9d94e60303c30b1a9bbbc8e6532f6138cb
Commit: 4abe9f9d94e60303c30b1a9bbbc8e6532f6138cb
Parent: 77d675047062d514acdc1bbe9f84658b39f99abe
Author: Michael Krufky [EMAIL PROTECTED]
AuthorDate: Sat May 5 12:15:57 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:23:14 2007 -0300

V4L/DVB (5633): Tuv1236d: move rf input switching code into dvb-pll

This patch removes duplicate code from cx88-dvb and saa7134-dvb that handles
rf input switching for the TUV1236d tuner.

The functionality is added to dvb-pll, where all the other code that
handles the TUV1236d is kept.

Signed-off-by: Michael Krufky [EMAIL PROTECTED]
Signed-off-by: Trent Piepho [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/dvb/frontends/dvb-pll.c |   14 ++
 drivers/media/dvb/frontends/nxt200x.c |   22 +++---
 drivers/media/dvb/frontends/nxt200x.h |3 ---
 drivers/media/video/cx88/cx88-dvb.c   |   10 --
 drivers/media/video/saa7134/saa7134-dvb.c |   10 --
 5 files changed, 21 insertions(+), 38 deletions(-)

diff --git a/drivers/media/dvb/frontends/dvb-pll.c 
b/drivers/media/dvb/frontends/dvb-pll.c
index 0e3195f..1363cc8 100644
--- a/drivers/media/dvb/frontends/dvb-pll.c
+++ b/drivers/media/dvb/frontends/dvb-pll.c
@@ -343,11 +343,25 @@ EXPORT_SYMBOL(dvb_pll_tdhu2);
 /* Philips TUV1236D
  * used in ATI HDTV Wonder
  */
+static void tuv1236d_rf(u8 *buf, const struct dvb_frontend_parameters *params)
+{
+   switch (params-u.vsb.modulation) {
+   case QAM_64:
+   case QAM_256:
+   buf[3] |= 0x08;
+   break;
+   case VSB_8:
+   default:
+   buf[3] = ~0x08;
+   }
+}
+
 struct dvb_pll_desc dvb_pll_tuv1236d = {
.name  = Philips TUV1236D,
.min   =  5400,
.max   = 86400,
.iffreq= 4400,
+   .set   = tuv1236d_rf,
.count = 3,
.entries = {
{ 15725, 62500, 0xc6, 0x41 },
diff --git a/drivers/media/dvb/frontends/nxt200x.c 
b/drivers/media/dvb/frontends/nxt200x.c
index b809f83..b96f8e8 100644
--- a/drivers/media/dvb/frontends/nxt200x.c
+++ b/drivers/media/dvb/frontends/nxt200x.c
@@ -546,11 +546,6 @@ static int nxt200x_setup_frontend_parameters (struct 
dvb_frontend* fe,
nxt200x_writebytes(state, 0x17, buf, 1);
}
 
-   /* get tuning information */
-   if (fe-ops.tuner_ops.calc_regs) {
-   fe-ops.tuner_ops.calc_regs(fe, p, buf, 5);
-   }
-
/* set additional params */
switch (p-u.vsb.modulation) {
case QAM_64:
@@ -559,27 +554,24 @@ static int nxt200x_setup_frontend_parameters (struct 
dvb_frontend* fe,
/* This is just a guess since I am unable to test it */
if (state-config-set_ts_params)
state-config-set_ts_params(fe, 1);
-
-   /* set input */
-   if (state-config-set_pll_input)
-   state-config-set_pll_input(buf+1, 1);
break;
case VSB_8:
/* Set non-punctured clock for VSB */
if (state-config-set_ts_params)
state-config-set_ts_params(fe, 0);
-
-   /* set input */
-   if (state-config-set_pll_input)
-   state-config-set_pll_input(buf+1, 0);
break;
default:
return -EINVAL;
break;
}
 
-   /* write frequency information */
-   nxt200x_writetuner(state, buf);
+   if (fe-ops.tuner_ops.calc_regs) {
+   /* get tuning information */
+   fe-ops.tuner_ops.calc_regs(fe, p, buf, 5);
+
+   /* write frequency information */
+   nxt200x_writetuner(state, buf);
+   }
 
/* reset the agc now that tuning has been completed */
nxt200x_agc_reset(state);
diff --git a/drivers/media/dvb/frontends/nxt200x.h 
b/drivers/media/dvb/frontends/nxt200x.h
index 28bc559..bb0ef58 100644
--- a/drivers/media/dvb/frontends/nxt200x.h
+++ b/drivers/media/dvb/frontends/nxt200x.h
@@ -38,9 +38,6 @@ struct nxt200x_config
/* the demodulator's i2c address */
u8 demod_address;
 
-   /* used to set pll input */
-   int (*set_pll_input)(u8* buf, int input);
-
/* need to set device param for start_dma */
int (*set_ts_params)(struct dvb_frontend* fe, int is_punctured);
 };
diff --git a/drivers/media/video/cx88/cx88-dvb.c 
b/drivers/media/video/cx88/cx88-dvb.c
index 770ea64..420c25f 100644
--- 

V4L/DVB (5634): Saa7134-dvb: convert philips td1316 handling to use dvb-pll

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8511df9ec2ef4c33a6b1e76527d5b47da8bc0bb6
Commit: 8511df9ec2ef4c33a6b1e76527d5b47da8bc0bb6
Parent: 4abe9f9d94e60303c30b1a9bbbc8e6532f6138cb
Author: Michael Krufky [EMAIL PROTECTED]
AuthorDate: Mon May 7 01:34:36 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:23:15 2007 -0300

V4L/DVB (5634): Saa7134-dvb: convert philips td1316 handling to use dvb-pll

removed mt352_aver777_tuner_calc_regs, using dvb_pll_attach, instead.

Signed-off-by: Michael Krufky [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/video/saa7134/saa7134-dvb.c |   13 ++---
 1 files changed, 2 insertions(+), 11 deletions(-)

diff --git a/drivers/media/video/saa7134/saa7134-dvb.c 
b/drivers/media/video/saa7134/saa7134-dvb.c
index 1f50a48..0d66add 100644
--- a/drivers/media/video/saa7134/saa7134-dvb.c
+++ b/drivers/media/video/saa7134/saa7134-dvb.c
@@ -175,16 +175,6 @@ static int mt352_pinnacle_tuner_set_params(struct 
dvb_frontend* fe,
return mt352_pinnacle_init(fe);
 }
 
-static int mt352_aver777_tuner_calc_regs(struct dvb_frontend *fe, struct 
dvb_frontend_parameters *params, u8* pllbuf, int buf_len)
-{
-   if (buf_len  5)
-   return -EINVAL;
-
-   pllbuf[0] = 0x61;
-   dvb_pll_configure(dvb_pll_philips_td1316, pllbuf+1, params);
-   return 5;
-}
-
 static struct mt352_config pinnacle_300i = {
.demod_address = 0x3c  1,
.adc_clock = 20333,
@@ -993,7 +983,8 @@ static int dvb_init(struct saa7134_dev *dev)
dev-dvb.frontend = dvb_attach(mt352_attach, avermedia_777,
   dev-i2c_adap);
if (dev-dvb.frontend) {
-   dev-dvb.frontend-ops.tuner_ops.calc_regs = 
mt352_aver777_tuner_calc_regs;
+   dvb_attach(dvb_pll_attach, dev-dvb.frontend, 0x61,
+  NULL, dvb_pll_philips_td1316);
}
break;
case SAA7134_BOARD_MD7134:
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


V4L/DVB (5635): Budget-av: convert philips sd1878 / tda8261 to use dvb-pll

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9b98fd28b4a181cafaa5247a04d1be6d2ca7c863
Commit: 9b98fd28b4a181cafaa5247a04d1be6d2ca7c863
Parent: 8511df9ec2ef4c33a6b1e76527d5b47da8bc0bb6
Author: Michael Krufky [EMAIL PROTECTED]
AuthorDate: Mon May 7 01:48:56 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:23:16 2007 -0300

V4L/DVB (5635): Budget-av: convert philips sd1878 / tda8261 to use dvb-pll

removed philips_sd1878_tda8261_tuner_set_params, using dvb_pll_attach, 
instead.

Signed-off-by: Michael Krufky [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/dvb/ttpci/budget-av.c |   26 +++---
 1 files changed, 3 insertions(+), 23 deletions(-)

diff --git a/drivers/media/dvb/ttpci/budget-av.c 
b/drivers/media/dvb/ttpci/budget-av.c
index 8de19ce..1b590b2 100644
--- a/drivers/media/dvb/ttpci/budget-av.c
+++ b/drivers/media/dvb/ttpci/budget-av.c
@@ -828,28 +828,6 @@ static u8 philips_sd1878_inittab[] = {
0xff, 0xff
 };
 
-static int philips_sd1878_tda8261_tuner_set_params(struct dvb_frontend *fe,
-  struct 
dvb_frontend_parameters *params)
-{
-   u8  buf[4];
-   int rc;
-   struct i2c_msg  tuner_msg = 
{.addr=0x60,.flags=0,.buf=buf,.len=sizeof(buf)};
-   struct budget *budget = (struct budget *) fe-dvb-priv;
-
-   if((params-frequency  95) || (params-frequency  215))
-   return -EINVAL;
-
-   rc=dvb_pll_configure(dvb_pll_philips_sd1878_tda8261, buf, params);
-   if(rc  0) return rc;
-
-   if (fe-ops.i2c_gate_ctrl)
-   fe-ops.i2c_gate_ctrl(fe, 1);
-   if(i2c_transfer(budget-i2c_adap, tuner_msg, 1) != 1)
-   return -EIO;
-
-return 0;
-}
-
 static int philips_sd1878_ci_set_symbol_rate(struct dvb_frontend *fe,
u32 srate, u32 ratio)
 {
@@ -984,7 +962,9 @@ static void frontend_init(struct budget_av *budget_av)
fe = dvb_attach(stv0299_attach, philips_sd1878_config,
budget_av-budget.i2c_adap);
if (fe) {
-   fe-ops.tuner_ops.set_params = 
philips_sd1878_tda8261_tuner_set_params;
+   dvb_attach(dvb_pll_attach, fe, 0x60,
+  budget_av-budget.i2c_adap,
+  dvb_pll_philips_sd1878_tda8261);
}
break;
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


V4L/DVB (5643): Usbvision: make common video and radio ioctls

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ea1f83cee96badc28d3f67ef29ac29c9d0eb0a1b
Commit: ea1f83cee96badc28d3f67ef29ac29c9d0eb0a1b
Parent: 8c7189d1939f6e15c4ebc23a98b3b9f34bd004d7
Author: Thierry MERLE [EMAIL PROTECTED]
AuthorDate: Wed May 2 18:43:55 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:23:19 2007 -0300

V4L/DVB (5643): Usbvision: make common video and radio ioctls

Radio and video ioctls are the same,
delete the usbvision_do_radio_ioctl function
add the special cases for radio in usbvision_v4l2_do_ioctl

Signed-off-by: Thierry MERLE [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/video/usbvision/usbvision-video.c |  166 +++
 1 files changed, 22 insertions(+), 144 deletions(-)

diff --git a/drivers/media/video/usbvision/usbvision-video.c 
b/drivers/media/video/usbvision/usbvision-video.c
index aa3258b..dab8bc9 100644
--- a/drivers/media/video/usbvision/usbvision-video.c
+++ b/drivers/media/video/usbvision/usbvision-video.c
@@ -692,11 +692,18 @@ static int usbvision_v4l2_do_ioctl(struct inode *inode, 
struct file *file,
 
if (!usbvision-have_tuner || vt-index)// Only 
tuner 0
return -EINVAL;
-   strcpy(vt-name, Television);
+   if(usbvision-radio) {
+   strcpy(vt-name, Radio);
+   vt-type = V4L2_TUNER_RADIO;
+   }
+   else {
+   strcpy(vt-name, Television);
+   }
/* Let clients fill in the remainder of this struct */
call_i2c_clients(usbvision,VIDIOC_G_TUNER,vt);
 
-   PDEBUG(DBG_IOCTL, VIDIOC_G_TUNER signal=%x, 
afc=%x,vt-signal,vt-afc);
+   PDEBUG(DBG_IOCTL, VIDIOC_G_TUNER for %s signal=%x, 
afc=%x,
+  vt-name, vt-signal,vt-afc);
return 0;
}
case VIDIOC_S_TUNER:
@@ -717,7 +724,12 @@ static int usbvision_v4l2_do_ioctl(struct inode *inode, 
struct file *file,
struct v4l2_frequency *freq = arg;
 
freq-tuner = 0; // Only one tuner
-   freq-type = V4L2_TUNER_ANALOG_TV;
+   if(usbvision-radio) {
+   freq-type = V4L2_TUNER_RADIO;
+   }
+   else {
+   freq-type = V4L2_TUNER_ANALOG_TV;
+   }
freq-frequency = usbvision-freq;
PDEBUG(DBG_IOCTL, VIDIOC_G_FREQUENCY freq=0x%X, 
(unsigned)freq-frequency);
return 0;
@@ -739,7 +751,12 @@ static int usbvision_v4l2_do_ioctl(struct inode *inode, 
struct file *file,
{
struct v4l2_audio *v = arg;
memset(v,0, sizeof(v));
-   strcpy(v-name, TV);
+   if(usbvision-radio) {
+   strcpy(v-name,Radio);
+   }
+   else {
+   strcpy(v-name, TV);
+   }
PDEBUG(DBG_IOCTL, VIDIOC_G_AUDIO);
return 0;
}
@@ -1219,7 +1236,6 @@ static int usbvision_radio_open(struct inode *inode, 
struct file *file)
 {
struct video_device *dev = video_devdata(file);
struct usb_usbvision *usbvision = (struct usb_usbvision *) 
video_get_drvdata(dev);
-   struct v4l2_frequency freq;
int errCode = 0;
 
PDEBUG(DBG_IO, %s:, __FUNCTION__);
@@ -1249,8 +1265,6 @@ static int usbvision_radio_open(struct inode *inode, 
struct file *file)
// If so far no errors then we shall start the radio
usbvision-radio = 1;

call_i2c_clients(usbvision,AUDC_SET_RADIO,usbvision-tuner_type);
-   freq.frequency = 1517; //SWR3 @ 94.8MHz
-   call_i2c_clients(usbvision, VIDIOC_S_FREQUENCY, freq);
usbvision_set_audio(usbvision, USBVISION_AUDIO_RADIO);
usbvision-user++;
}
@@ -1304,146 +1318,10 @@ static int usbvision_radio_close(struct inode *inode, 
struct file *file)
return errCode;
 }
 
-static int usbvision_do_radio_ioctl(struct inode *inode, struct file *file,
-unsigned int cmd, void *arg)
-{
-   struct video_device *dev = video_devdata(file);
-   struct usb_usbvision *usbvision = (struct usb_usbvision *) 
video_get_drvdata(dev);
-
-   if (!USBVISION_IS_OPERATIONAL(usbvision))
-   return -EIO;
-
-   switch (cmd) {
-   case VIDIOC_QUERYCAP:
-  

V4L/DVB (5647): Saa7134: enable ir-remote for 10moons TM300

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=480f75acbc1452c0fc7b2ee595bde17c18f798aa
Commit: 480f75acbc1452c0fc7b2ee595bde17c18f798aa
Parent: aaccb82bdb93889987497b2b712c5160cdf79240
Author: Tony Wan [EMAIL PROTECTED]
AuthorDate: Fri May 11 11:33:50 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:23:21 2007 -0300

V4L/DVB (5647): Saa7134: enable ir-remote for 10moons TM300

Using Encore's key codes, we needn't add any additional key table.

Signed-off-by: Tony Wan [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/video/saa7134/saa7134-cards.c |1 +
 drivers/media/video/saa7134/saa7134-input.c |6 ++
 2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/drivers/media/video/saa7134/saa7134-cards.c 
b/drivers/media/video/saa7134/saa7134-cards.c
index 44f2077..5813509 100644
--- a/drivers/media/video/saa7134/saa7134-cards.c
+++ b/drivers/media/video/saa7134/saa7134-cards.c
@@ -4368,6 +4368,7 @@ int saa7134_board_init1(struct saa7134_dev *dev)
case SAA7134_BOARD_AVERMEDIA_A16AR:
case SAA7134_BOARD_ENCORE_ENLTV:
case SAA7134_BOARD_ENCORE_ENLTV_FM:
+   case SAA7134_BOARD_10MOONSTVMASTER3:
dev-has_remote = SAA7134_REMOTE_GPIO;
break;
case SAA7134_BOARD_FLYDVBS_LR300:
diff --git a/drivers/media/video/saa7134/saa7134-input.c 
b/drivers/media/video/saa7134/saa7134-input.c
index c0de37e..817d4b6 100644
--- a/drivers/media/video/saa7134/saa7134-input.c
+++ b/drivers/media/video/saa7134/saa7134-input.c
@@ -333,6 +333,12 @@ int saa7134_input_init1(struct saa7134_dev *dev)
mask_keyup   = 0x04;
polling  = 50; // ms
break;
+   case SAA7134_BOARD_10MOONSTVMASTER3:
+   ir_codes = ir_codes_encore_enltv;
+   mask_keycode = 0x5f8;
+   mask_keyup   = 0x800;
+   polling  = 50; //ms
+   break;
}
if (NULL == ir_codes) {
printk(%s: Oops: IR config error [card=%d]\n,
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


V4L/DVB (5649): Umt-010: convert tua6034 handling to properly use dvb-pll

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a3497135d829a7911b1b6a7e81ab78066cfa4131
Commit: a3497135d829a7911b1b6a7e81ab78066cfa4131
Parent: 890693925218501f7f7afc4cd6706fc76f395b91
Author: Michael Krufky [EMAIL PROTECTED]
AuthorDate: Wed May 9 13:33:21 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:23:23 2007 -0300

V4L/DVB (5649): Umt-010: convert tua6034 handling to properly use dvb-pll

Signed-off-by: Michael Krufky [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/dvb/dvb-usb/umt-010.c |4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/drivers/media/dvb/dvb-usb/umt-010.c 
b/drivers/media/dvb/dvb-usb/umt-010.c
index f77b48f..07dec09 100644
--- a/drivers/media/dvb/dvb-usb/umt-010.c
+++ b/drivers/media/dvb/dvb-usb/umt-010.c
@@ -65,9 +65,7 @@ static int umt_mt352_frontend_attach(struct dvb_usb_adapter 
*adap)
 
 static int umt_tuner_attach (struct dvb_usb_adapter *adap)
 {
-   adap-pll_addr = 0x61;
-   adap-pll_desc = dvb_pll_tua6034;
-   adap-fe-ops.tuner_ops.calc_regs = dvb_usb_tuner_calc_regs;
+   dvb_attach(dvb_pll_attach, adap-fe, 0x61, NULL, dvb_pll_tua6034);
return 0;
 }
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


V4L/DVB (5651): Dibusb-mb: convert pll handling to properly use dvb-pll

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=fbfee8684ff235c8cc4e8859913a017dabd59c03
Commit: fbfee8684ff235c8cc4e8859913a017dabd59c03
Parent: 9bc7c04852194377fc276072359a19b5134250cc
Author: Michael Krufky [EMAIL PROTECTED]
AuthorDate: Wed May 9 15:58:17 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:23:25 2007 -0300

V4L/DVB (5651): Dibusb-mb: convert pll handling to properly use dvb-pll

moved tda665x pll_init into dvb_pll_desc dvb_pll_tda665x.initdata
convert handling of tda665x and tua6010xs to properly use dvb-pll

Signed-off-by: Michael Krufky [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/dvb/dvb-usb/dibusb-mb.c |   21 +++--
 drivers/media/dvb/frontends/dvb-pll.c |1 +
 2 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/drivers/media/dvb/dvb-usb/dibusb-mb.c 
b/drivers/media/dvb/dvb-usb/dibusb-mb.c
index 7a6ae8f..6de4595 100644
--- a/drivers/media/dvb/dvb-usb/dibusb-mb.c
+++ b/drivers/media/dvb/dvb-usb/dibusb-mb.c
@@ -24,9 +24,6 @@ static int dibusb_dib3000mb_frontend_attach(struct 
dvb_usb_adapter *adap)
if ((adap-fe = 
dib3000mb_attach(demod_cfg,adap-dev-i2c_adap,st-ops)) == NULL)
return -ENODEV;
 
-   adap-fe-ops.tuner_ops.init   = dvb_usb_tuner_init_i2c;
-   adap-fe-ops.tuner_ops.set_params = dvb_usb_tuner_set_params_i2c;
-
adap-tuner_pass_ctrl = st-ops.tuner_pass_ctrl;
 
return 0;
@@ -34,8 +31,15 @@ static int dibusb_dib3000mb_frontend_attach(struct 
dvb_usb_adapter *adap)
 
 static int dibusb_thomson_tuner_attach(struct dvb_usb_adapter *adap)
 {
-   adap-pll_addr = 0x61;
-   adap-pll_desc = dvb_pll_tua6010xs;
+   dvb_attach(dvb_pll_attach, adap-fe, 0x61, adap-dev-i2c_adap,
+  dvb_pll_tua6010xs);
+   return 0;
+}
+
+static int dibusb_panasonic_tuner_attach(struct dvb_usb_adapter *adap)
+{
+   dvb_attach(dvb_pll_attach, adap-fe, 0x60, adap-dev-i2c_adap,
+  dvb_pll_tda665x);
return 0;
 }
 
@@ -67,13 +71,10 @@ static int dibusb_tuner_probe_and_attach(struct 
dvb_usb_adapter *adap)
 
if (b2[0] == 0xfe) {
info(This device has the Thomson Cable onboard. Which is 
default.);
-   dibusb_thomson_tuner_attach(adap);
+   ret = dibusb_thomson_tuner_attach(adap);
} else {
-   u8 bpll[4] = { 0x0b, 0xf5, 0x85, 0xab };
info(This device has the Panasonic ENV77H11D5 onboard.);
-   adap-pll_addr = 0x60;
-   memcpy(adap-pll_init,bpll,4);
-   adap-pll_desc = dvb_pll_tda665x;
+   ret = dibusb_panasonic_tuner_attach(adap);
}
 
return ret;
diff --git a/drivers/media/dvb/frontends/dvb-pll.c 
b/drivers/media/dvb/frontends/dvb-pll.c
index 1363cc8..fc440b1 100644
--- a/drivers/media/dvb/frontends/dvb-pll.c
+++ b/drivers/media/dvb/frontends/dvb-pll.c
@@ -208,6 +208,7 @@ struct dvb_pll_desc dvb_pll_tda665x = {
.max   = 85800,
.set   = tda665x_bw,
.iffreq= 3617,
+   .initdata = (u8[]){ 4, 0x0b, 0xf5, 0x85, 0xab },
.count = 12,
.entries = {
{   93834000, 17, 0xca, 0x61 /* 011 0 0 0  01 */ },
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


V4L/DVB (5652): Dibusb-mb: use dvb_attach for dib3000mb_attach

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=79d3a8bede9350e2ff28b950341dcfead85ba04b
Commit: 79d3a8bede9350e2ff28b950341dcfead85ba04b
Parent: fbfee8684ff235c8cc4e8859913a017dabd59c03
Author: Michael Krufky [EMAIL PROTECTED]
AuthorDate: Wed May 9 14:52:52 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:23:26 2007 -0300

V4L/DVB (5652): Dibusb-mb: use dvb_attach for dib3000mb_attach

convert calls to dib3000mb_attach to use dvb_attach

Signed-off-by: Michael Krufky [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/dvb/dvb-usb/dibusb-mb.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/media/dvb/dvb-usb/dibusb-mb.c 
b/drivers/media/dvb/dvb-usb/dibusb-mb.c
index 6de4595..a171900 100644
--- a/drivers/media/dvb/dvb-usb/dibusb-mb.c
+++ b/drivers/media/dvb/dvb-usb/dibusb-mb.c
@@ -21,7 +21,8 @@ static int dibusb_dib3000mb_frontend_attach(struct 
dvb_usb_adapter *adap)
 
demod_cfg.demod_address = 0x8;
 
-   if ((adap-fe = 
dib3000mb_attach(demod_cfg,adap-dev-i2c_adap,st-ops)) == NULL)
+   if ((adap-fe = dvb_attach(dib3000mb_attach, demod_cfg,
+  adap-dev-i2c_adap, st-ops)) == NULL)
return -ENODEV;
 
adap-tuner_pass_ctrl = st-ops.tuner_pass_ctrl;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


V4L/DVB (5628): Add support for A-LINK DTU dvb-t adapter

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4919c49278b3299c1373912dec9c3d9cf27ec56d
Commit: 4919c49278b3299c1373912dec9c3d9cf27ec56d
Parent: e62a42090cdeaa6bbd3d22fa25309592c5eebbbd
Author: Aapo Tahkola [EMAIL PROTECTED]
AuthorDate: Tue May 8 17:36:40 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:23:28 2007 -0300

V4L/DVB (5628): Add support for A-LINK DTU dvb-t adapter

Support for A-LINK DTU(m) is not included in this patch.

Signed-off-by: Aapo Tahkola [EMAIL PROTECTED]
Acked-by: Antti Palosaari [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/dvb/dvb-usb/dvb-usb-ids.h |2 ++
 drivers/media/dvb/dvb-usb/gl861.c   |7 ++-
 2 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-ids.h 
b/drivers/media/dvb/dvb-usb/dvb-usb-ids.h
index 9513531..4dfab02 100644
--- a/drivers/media/dvb/dvb-usb/dvb-usb-ids.h
+++ b/drivers/media/dvb/dvb-usb/dvb-usb-ids.h
@@ -13,6 +13,7 @@
 #define USB_VID_ADSTECH0x06e1
 #define USB_VID_AFATECH0x15a4
 #define USB_VID_ALCOR_MICRO0x058f
+#define USB_VID_ALINK  0x05e3
 #define USB_VID_ANCHOR 0x0547
 #define USB_VID_ANUBIS_ELECTRONIC  0x10fd
 #define USB_VID_AVERMEDIA  0x07ca
@@ -47,6 +48,7 @@
 #define USB_PID_ADSTECH_USB2_COLD  0xa333
 #define USB_PID_ADSTECH_USB2_WARM  0xa334
 #define USB_PID_AFATECH_AF9005 0x9020
+#define USB_VID_ALINK_DTU  0xf170
 #define USB_PID_AVERMEDIA_DVBT_USB_COLD0x0001
 #define USB_PID_AVERMEDIA_DVBT_USB_WARM0x0002
 #define USB_PID_AVERMEDIA_DVBT_USB2_COLD   0xa800
diff --git a/drivers/media/dvb/dvb-usb/gl861.c 
b/drivers/media/dvb/dvb-usb/gl861.c
index e0587e6..f01d99c 100644
--- a/drivers/media/dvb/dvb-usb/gl861.c
+++ b/drivers/media/dvb/dvb-usb/gl861.c
@@ -157,6 +157,7 @@ static int gl861_probe(struct usb_interface *intf,
 
 static struct usb_device_id gl861_table [] = {
{ USB_DEVICE(USB_VID_MSI, USB_PID_MSI_MEGASKY580_55801) },
+   { USB_DEVICE(USB_VID_ALINK, USB_VID_ALINK_DTU) },
{ } /* Terminating entry */
 };
 MODULE_DEVICE_TABLE (usb, gl861_table);
@@ -187,12 +188,16 @@ static struct dvb_usb_device_properties gl861_properties 
= {
}},
.i2c_algo = gl861_i2c_algo,
 
-   .num_device_descs = 1,
+   .num_device_descs = 2,
.devices = {
{   MSI Mega Sky 55801 DVB-T USB2.0,
{ gl861_table[0], NULL },
{ NULL },
},
+   {   A-LINK DTU DVB-T USB2.0,
+   { gl861_table[1], NULL },
+   { NULL },
+   },
}
 };
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


V4L/DVB (5636): Integrate all users of the fmd1216 tuner with dvb-pll

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b7754d74d20b701603eacf587a92ec6f71a302e1
Commit: b7754d74d20b701603eacf587a92ec6f71a302e1
Parent: 4919c49278b3299c1373912dec9c3d9cf27ec56d
Author: Trent Piepho [EMAIL PROTECTED]
AuthorDate: Tue May 8 18:05:16 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:23:29 2007 -0300

V4L/DVB (5636): Integrate all users of the fmd1216 tuner with dvb-pll

Enhance the dvb-pll definition of the fmd1216 tuner by adding an init 
sequence
and a sleep sequence.

The init sequence sets the AGC control register to 0xa0, selecting the fast
time constant and 112 dBuV take-over point.  This the recommended value for
DVB-T operation.

The sleep sequence sets bit P4 (which is believed to turn the analog
demodulator on), turns off the tuning voltage, and sets the AGC control
register to 0x60 (external AGC voltage, the recommended value for analog
operation).

The existing dvb-pll users in the cx88 driver, listed below, will gain these
init and sleep sequences.

CX88_BOARD_HAUPPAUGE_HVR1100Hauppauge WinTV-HVR1100 DVB-T/Hybrid
CX88_BOARD_HAUPPAUGE_HVR1100LP  Hauppauge WinTV-HVR1100 DVB-T/Hybrid (Low 
Profi
CX88_BOARD_WINFAST_DTV2000H WinFast DTV2000 H
CX88_BOARD_HAUPPAUGE_HVR3000Hauppauge WinTV-HVR3000 TriMode 
Analog/DVB-S/DV
CX88_BOARD_HAUPPAUGE_HVR1300Hauppauge WinTV-HVR1300 DVB-T/Hybrid MPEG 
Encod

This non-dvb-pll user in the cx88 driver should only gain the sleep 
sequence,
as it already had an equivalent init sequence.  The non-dvb-pll code for 
this
user is removed.

X88_BOARD_DNTV_LIVE_DVB_T_PRO   digitalnow DNTV Live! DVB-T Pro

In these saa7134 driver, these non-dvb-pll users are converted to use 
dvb-pll:

SAA7134_BOARD_MD7134Medion 7134
SAA7134_BOARD_ASUS_EUROPA2_HYBRID   Asus Europa2 OEM

The saa7134 functions philips_fmd1216_tuner_init(),
philips_fmd1216_tuner_sleep(), and philips_fmd1216_tuner_set_params() are
deleted and the dvb-pll versions are used.

This should result in equivalent sleep, init, and tuning sequences being 
sent
to the tuner.

For the cxusb driver, only one board is effected:

USB_PID_MEDION_MD95700  Medion MD95700

This board used dvb_usb_tuner_init_i2c() and dvb_usb_tuner_set_params_i2c()
for init and tuning, respectively.  These functions are effectively the same
as the dvb-pll versions.  They call a tuner pass control function defined at
the dvb-usb level, but this does not matter, as this card does not have a
tuner pass control function (only the dib3000mb does).  This board will gain
the sleep sequence, while init and tuning should be unchanged.

Signed-off-by: Trent Piepho [EMAIL PROTECTED]
Signed-off-by: Michael Krufky [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/dvb/dvb-usb/cxusb.c |   10 +--
 drivers/media/dvb/frontends/dvb-pll.c |8 ++
 drivers/media/video/cx88/cx88-dvb.c   |   61 +
 drivers/media/video/saa7134/saa7134-dvb.c |  140 +---
 4 files changed, 17 insertions(+), 202 deletions(-)

diff --git a/drivers/media/dvb/dvb-usb/cxusb.c 
b/drivers/media/dvb/dvb-usb/cxusb.c
index bac2ae3..88aeb25 100644
--- a/drivers/media/dvb/dvb-usb/cxusb.c
+++ b/drivers/media/dvb/dvb-usb/cxusb.c
@@ -354,14 +354,8 @@ static struct mt352_config cxusb_mt352_config = {
 /* Callbacks for DVB USB */
 static int cxusb_fmd1216me_tuner_attach(struct dvb_usb_adapter *adap)
 {
-   u8 bpll[4] = { 0x0b, 0xdc, 0x9c, 0xa0 };
-   adap-pll_addr = 0x61;
-   memcpy(adap-pll_init, bpll, 4);
-   adap-pll_desc = dvb_pll_fmd1216me;
-
-   adap-fe-ops.tuner_ops.init = dvb_usb_tuner_init_i2c;
-   adap-fe-ops.tuner_ops.set_params = dvb_usb_tuner_set_params_i2c;
-
+   dvb_attach(dvb_pll_attach, adap-fe, 0x61, adap-dev-i2c_adap,
+  dvb_pll_fmd1216me);
return 0;
 }
 
diff --git a/drivers/media/dvb/frontends/dvb-pll.c 
b/drivers/media/dvb/frontends/dvb-pll.c
index fc440b1..9fb4dec 100644
--- a/drivers/media/dvb/frontends/dvb-pll.c
+++ b/drivers/media/dvb/frontends/dvb-pll.c
@@ -38,6 +38,12 @@
0x50 = AGC Take over point = 103 dBuV */
 static u8 tua603x_agc103[] = { 2, 0x80|0x40|0x18|0x06|0x01, 0x00|0x50 };
 
+/* 0x04 = 166.67 kHz divider
+
+   0x80 = AGC Time constant 50ms Iagc = 9 uA
+   0x20 = AGC Take over point = 112 dBuV */
+static u8 tua603x_agc112[] = { 2, 0x80|0x40|0x18|0x04|0x01, 0x80|0x20 };
+
 struct dvb_pll_desc dvb_pll_thomson_dtt7579 = {
.name  = Thomson dtt7579,
.min   = 17700,
@@ -285,6 +291,8 @@ struct dvb_pll_desc dvb_pll_fmd1216me = {
.max = 85800,
.iffreq= 36125000,
.set   = 

V4L/DVB (5669): Budget-av: Add support for EasyWatch DVB-S (0x1894:0x001b)

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f72ce644479fc06774367ed3c80d0f94e54d938b
Commit: f72ce644479fc06774367ed3c80d0f94e54d938b
Parent: 7b68814d797ae29095b7651e172c28a31ee37fda
Author: Oliver Endriss [EMAIL PROTECTED]
AuthorDate: Sun May 13 23:25:57 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:23:31 2007 -0300

V4L/DVB (5669): Budget-av: Add support for EasyWatch DVB-S (0x1894:0x001b)

Add support for Satelco EasyWatch PCI DVB-S card (subsystem 0x1894:0x001b).

Signed-off-by: Oliver Endriss [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/dvb/ttpci/budget-av.c |4 
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/media/dvb/ttpci/budget-av.c 
b/drivers/media/dvb/ttpci/budget-av.c
index 1b590b2..398caaf 100644
--- a/drivers/media/dvb/ttpci/budget-av.c
+++ b/drivers/media/dvb/ttpci/budget-av.c
@@ -898,6 +898,7 @@ static u8 read_pwm(struct budget_av *budget_av)
 #define SUBID_DVBS_TV_STAR 0x0014
 #define SUBID_DVBS_TV_STAR_CI  0x0016
 #define SUBID_DVBS_EASYWATCH_1 0x001a
+#define SUBID_DVBS_EASYWATCH_2 0x001b
 #define SUBID_DVBS_EASYWATCH   0x001e
 
 #define SUBID_DVBC_EASYWATCH   0x002a
@@ -959,6 +960,7 @@ static void frontend_init(struct budget_av *budget_av)
case SUBID_DVBS_TV_STAR_CI:
case SUBID_DVBS_CYNERGY1200N:
case SUBID_DVBS_EASYWATCH:
+   case SUBID_DVBS_EASYWATCH_2:
fe = dvb_attach(stv0299_attach, philips_sd1878_config,
budget_av-budget.i2c_adap);
if (fe) {
@@ -1243,6 +1245,7 @@ MAKE_BUDGET_INFO(knc1t, KNC1 DVB-T, BUDGET_KNC1T);
 MAKE_BUDGET_INFO(kncxs, KNC TV STAR DVB-S, BUDGET_TVSTAR);
 MAKE_BUDGET_INFO(satewpls, Satelco EasyWatch DVB-S light, BUDGET_TVSTAR);
 MAKE_BUDGET_INFO(satewpls1, Satelco EasyWatch DVB-S light, BUDGET_KNC1S);
+MAKE_BUDGET_INFO(satewps, Satelco EasyWatch DVB-S, BUDGET_KNC1S);
 MAKE_BUDGET_INFO(satewplc, Satelco EasyWatch DVB-C, BUDGET_KNC1CP);
 MAKE_BUDGET_INFO(satewcmk3, Satelco EasyWatch DVB-C MK3, BUDGET_KNC1C_MK3);
 MAKE_BUDGET_INFO(knc1sp, KNC1 DVB-S Plus, BUDGET_KNC1SP);
@@ -1266,6 +1269,7 @@ static struct pci_device_id pci_tbl[] = {
MAKE_EXTENSION_PCI(kncxs, 0x1894, 0x0016),
MAKE_EXTENSION_PCI(satewpls, 0x1894, 0x001e),
MAKE_EXTENSION_PCI(satewpls1, 0x1894, 0x001a),
+   MAKE_EXTENSION_PCI(satewps, 0x1894, 0x001b),
MAKE_EXTENSION_PCI(satewplc, 0x1894, 0x002a),
MAKE_EXTENSION_PCI(satewcmk3, 0x1894, 0x002c),
MAKE_EXTENSION_PCI(knc1c, 0x1894, 0x0020),
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


V4L/DVB (5671): Autodetect new PVR150 low profile cards.

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e80666b87b7f832cad7f824c4ec5799b1c99fa5e
Commit: e80666b87b7f832cad7f824c4ec5799b1c99fa5e
Parent: f72ce644479fc06774367ed3c80d0f94e54d938b
Author: Hans Verkuil [EMAIL PROTECTED]
AuthorDate: Thu May 17 06:52:32 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:23:31 2007 -0300

V4L/DVB (5671): Autodetect new PVR150 low profile cards.

Signed-off-by: Hans Verkuil [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/video/ivtv/ivtv-driver.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/media/video/ivtv/ivtv-driver.c 
b/drivers/media/video/ivtv/ivtv-driver.c
index efc6635..5e07ce3 100644
--- a/drivers/media/video/ivtv/ivtv-driver.c
+++ b/drivers/media/video/ivtv/ivtv-driver.c
@@ -351,6 +351,7 @@ static void ivtv_process_eeprom(struct ivtv *itv)
case 23000 ... 23999:  /* PVR500 */
case 25000 ... 25999:  /* Low profile PVR150 */
case 26000 ... 26999:  /* Regular PVR150 */
+   case 30012 ... 30039:  /* Low profile PVR150 */
itv-card = ivtv_get_card(IVTV_CARD_PVR_150);
break;
case 0:
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


V4L/DVB (5674): Models 30012-30039 are for a low profile PVR250, not PVR150.

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1b9d313c38291c6d60f1fbf6a2bc62c484fdaa21
Commit: 1b9d313c38291c6d60f1fbf6a2bc62c484fdaa21
Parent: e80666b87b7f832cad7f824c4ec5799b1c99fa5e
Author: Hans Verkuil [EMAIL PROTECTED]
AuthorDate: Fri May 18 16:18:17 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:23:32 2007 -0300

V4L/DVB (5674): Models 30012-30039 are for a low profile PVR250, not PVR150.

Signed-off-by: Hans Verkuil [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/video/ivtv/ivtv-driver.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/media/video/ivtv/ivtv-driver.c 
b/drivers/media/video/ivtv/ivtv-driver.c
index 5e07ce3..67d9a8f 100644
--- a/drivers/media/video/ivtv/ivtv-driver.c
+++ b/drivers/media/video/ivtv/ivtv-driver.c
@@ -339,6 +339,7 @@ static void ivtv_process_eeprom(struct ivtv *itv)
/* In a few cases the PCI subsystem IDs do not correctly
   identify the card. A better method is to check the
   model number from the eeprom instead. */
+   case 30012 ... 30039:  /* Low profile PVR250 */
case 32000 ... 32999:
case 48000 ... 48099:  /* 48??? range are PVR250s with a 
cx23415 */
case 48400 ... 48599:
@@ -351,7 +352,6 @@ static void ivtv_process_eeprom(struct ivtv *itv)
case 23000 ... 23999:  /* PVR500 */
case 25000 ... 25999:  /* Low profile PVR150 */
case 26000 ... 26999:  /* Regular PVR150 */
-   case 30012 ... 30039:  /* Low profile PVR150 */
itv-card = ivtv_get_card(IVTV_CARD_PVR_150);
break;
case 0:
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


V4L/DVB (5678): Zr364xx: fix return values

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=783aa8fa1fe666a039edb784d9458647da97d28a
Commit: 783aa8fa1fe666a039edb784d9458647da97d28a
Parent: 1b9d313c38291c6d60f1fbf6a2bc62c484fdaa21
Author: Akinobu Mita [EMAIL PROTECTED]
AuthorDate: Sun May 20 09:12:10 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:23:33 2007 -0300

V4L/DVB (5678): Zr364xx: fix return values

This patch fixes several return value related problems in zr364xx.

- return -ENOMEM instead of -ENODEV on out of memory

- zr364xx checks video_register_device() error only when
  its return value is -1. But video_register_device() doesn't
  always return -1 on error.

- If usb_register() returns error, module_init() wrongly returns 1:
retval = usb_register(zr364xx_driver)  0;
...
return retval;

  And it allows the module to be loaded. Because sys_init_module() doesn't
  see positive return value as error.

Signed-off-by: Akinobu Mita [EMAIL PROTECTED]
Signed-off-by: Antoine Jacquet [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/video/zr364xx.c |   17 +
 1 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/drivers/media/video/zr364xx.c b/drivers/media/video/zr364xx.c
index b5d3364..ba469ec 100644
--- a/drivers/media/video/zr364xx.c
+++ b/drivers/media/video/zr364xx.c
@@ -792,6 +792,7 @@ static int zr364xx_probe(struct usb_interface *intf,
 {
struct usb_device *udev = interface_to_usbdev(intf);
struct zr364xx_camera *cam = NULL;
+   int err;
 
DBG(probing...);
 
@@ -799,12 +800,11 @@ static int zr364xx_probe(struct usb_interface *intf,
info(model %04x:%04x detected, udev-descriptor.idVendor,
 udev-descriptor.idProduct);
 
-   if ((cam =
-kmalloc(sizeof(struct zr364xx_camera), GFP_KERNEL)) == NULL) {
+   cam = kzalloc(sizeof(struct zr364xx_camera), GFP_KERNEL);
+   if (cam == NULL) {
info(cam: out of memory !);
-   return -ENODEV;
+   return -ENOMEM;
}
-   memset(cam, 0x00, sizeof(struct zr364xx_camera));
/* save the init method used by this camera */
cam-method = id-driver_info;
 
@@ -812,7 +812,7 @@ static int zr364xx_probe(struct usb_interface *intf,
if (cam-vdev == NULL) {
info(cam-vdev: out of memory !);
kfree(cam);
-   return -ENODEV;
+   return -ENOMEM;
}
memcpy(cam-vdev, zr364xx_template, sizeof(zr364xx_template));
video_set_drvdata(cam-vdev, cam);
@@ -858,12 +858,13 @@ static int zr364xx_probe(struct usb_interface *intf,
cam-brightness = 64;
mutex_init(cam-lock);
 
-   if (video_register_device(cam-vdev, VFL_TYPE_GRABBER, -1) == -1) {
+   err = video_register_device(cam-vdev, VFL_TYPE_GRABBER, -1);
+   if (err) {
info(video_register_device failed);
video_device_release(cam-vdev);
kfree(cam-buffer);
kfree(cam);
-   return -ENODEV;
+   return err;
}
 
usb_set_intfdata(intf, cam);
@@ -905,7 +906,7 @@ static struct usb_driver zr364xx_driver = {
 static int __init zr364xx_init(void)
 {
int retval;
-   retval = usb_register(zr364xx_driver)  0;
+   retval = usb_register(zr364xx_driver);
if (retval)
info(usb_register failed!);
else
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


V4L/DVB (5681): Correct aliases for STD/L and STD/Lc

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c57032decdd07e531fc557a207c9ecd5eef9274d
Commit: c57032decdd07e531fc557a207c9ecd5eef9274d
Parent: 783aa8fa1fe666a039edb784d9458647da97d28a
Author: Mauro Carvalho Chehab [EMAIL PROTECTED]
AuthorDate: Mon May 21 11:39:21 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:23:34 2007 -0300

V4L/DVB (5681): Correct aliases for STD/L and STD/Lc

Some macros were using very weird names, like PAL/L (this std doesn't
exist). Fixing it.

Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/video/tuner-simple.c |   12 ++--
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/media/video/tuner-simple.c 
b/drivers/media/video/tuner-simple.c
index c40b92c..b5792d6 100644
--- a/drivers/media/video/tuner-simple.c
+++ b/drivers/media/video/tuner-simple.c
@@ -54,9 +54,9 @@ MODULE_PARM_DESC(offset,Allows to specify an offset for 
tuner);
 sound 2  33.16  -  -
 NICAM33.05  33.05  39.80
  */
-#define PHILIPS_MF_SET_BG  0x01 /* Bit 2 must be zero, Bit 3 is system 
output */
-#define PHILIPS_MF_SET_PAL_L   0x03 // France
-#define PHILIPS_MF_SET_PAL_L2  0x02 // L'
+#define PHILIPS_MF_SET_STD_BG  0x01 /* Bit 2 must be zero, Bit 3 is system 
output */
+#define PHILIPS_MF_SET_STD_L   0x03 /* Used on Secam France */
+#define PHILIPS_MF_SET_STD_LC  0x02 /* Used on SECAM L' */
 
 /* Control byte */
 
@@ -207,11 +207,11 @@ static void default_set_tv_freq(struct i2c_client *c, 
unsigned int freq)
/* 0x04 - ??? PAL others / SECAM others ??? */
cb = ~0x03;
if (t-std  V4L2_STD_SECAM_L) //also valid for V4L2_STD_SECAM
-   cb |= PHILIPS_MF_SET_PAL_L;
+   cb |= PHILIPS_MF_SET_STD_L;
else if (t-std  V4L2_STD_SECAM_LC)
-   cb |= PHILIPS_MF_SET_PAL_L2;
+   cb |= PHILIPS_MF_SET_STD_LC;
else /* V4L2_STD_B|V4L2_STD_GH */
-   cb |= PHILIPS_MF_SET_BG;
+   cb |= PHILIPS_MF_SET_STD_BG;
break;
 
case TUNER_TEMIC_4046FM5:
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


V4L/DVB (5682): SAA7134 - switch to use msecs_to_jiffies()

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b4ba788425f83e0b402a543c816a1cad01873699
Commit: b4ba788425f83e0b402a543c816a1cad01873699
Parent: c57032decdd07e531fc557a207c9ecd5eef9274d
Author: Dmitry Torokhov [EMAIL PROTECTED]
AuthorDate: Mon May 21 11:41:02 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:23:35 2007 -0300

V4L/DVB (5682): SAA7134 - switch to use msecs_to_jiffies()

Signed-off-by: Dmitry Torokhov [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/video/saa7134/saa7134-input.c |   11 ---
 1 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/media/video/saa7134/saa7134-input.c 
b/drivers/media/video/saa7134/saa7134-input.c
index 817d4b6..2de8c2a 100644
--- a/drivers/media/video/saa7134/saa7134-input.c
+++ b/drivers/media/video/saa7134/saa7134-input.c
@@ -153,21 +153,18 @@ void saa7134_input_irq(struct saa7134_dev *dev)
 
 static void saa7134_input_timer(unsigned long data)
 {
-   struct saa7134_dev *dev = (struct saa7134_dev*)data;
+   struct saa7134_dev *dev = (struct saa7134_dev *)data;
struct card_ir *ir = dev-remote;
-   unsigned long timeout;
 
build_key(dev);
-   timeout = jiffies + (ir-polling * HZ / 1000);
-   mod_timer(ir-timer, timeout);
+   mod_timer(ir-timer, jiffies + msecs_to_jiffies(ir-polling));
 }
 
 static void saa7134_ir_start(struct saa7134_dev *dev, struct card_ir *ir)
 {
if (ir-polling) {
-   init_timer(ir-timer);
-   ir-timer.function = saa7134_input_timer;
-   ir-timer.data = (unsigned long)dev;
+   setup_timer(ir-timer, saa7134_input_timer,
+   (unsigned long)dev);
ir-timer.expires  = jiffies + HZ;
add_timer(ir-timer);
} else if (ir-rc5_gpio) {
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


V4L/DVB (5683): V4L: cx88 - switch to using msecs_to_jiffies()

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=749823a06e74620ff3fefc75eab9d6fa473a9b39
Commit: 749823a06e74620ff3fefc75eab9d6fa473a9b39
Parent: b4ba788425f83e0b402a543c816a1cad01873699
Author: Dmitry Torokhov [EMAIL PROTECTED]
AuthorDate: Mon May 21 11:48:11 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:23:36 2007 -0300

V4L/DVB (5683): V4L: cx88 - switch to using msecs_to_jiffies()

Signed-off-by: Dmitry Torokhov [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/video/cx88/cx88-input.c |8 ++--
 1 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/media/video/cx88/cx88-input.c 
b/drivers/media/video/cx88/cx88-input.c
index 8136673..7ff901f 100644
--- a/drivers/media/video/cx88/cx88-input.c
+++ b/drivers/media/video/cx88/cx88-input.c
@@ -148,20 +148,16 @@ static void ir_timer(unsigned long data)
 static void cx88_ir_work(struct work_struct *work)
 {
struct cx88_IR *ir = container_of(work, struct cx88_IR, work);
-   unsigned long timeout;
 
cx88_ir_handle_key(ir);
-   timeout = jiffies + (ir-polling * HZ / 1000);
-   mod_timer(ir-timer, timeout);
+   mod_timer(ir-timer, jiffies + msecs_to_jiffies(ir-polling));
 }
 
 static void cx88_ir_start(struct cx88_core *core, struct cx88_IR *ir)
 {
if (ir-polling) {
+   setup_timer(ir-timer, ir_timer, (unsigned long)ir);
INIT_WORK(ir-work, cx88_ir_work);
-   init_timer(ir-timer);
-   ir-timer.function = ir_timer;
-   ir-timer.data = (unsigned long)ir;
schedule_work(ir-work);
}
if (ir-sampling) {
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


V4L/DVB (5684): V4L: ir-kbd-i2c - switch to using msecs_to_jiffies()

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8083c5200e74a5db11c9671bfc1bcaefe8c48737
Commit: 8083c5200e74a5db11c9671bfc1bcaefe8c48737
Parent: 749823a06e74620ff3fefc75eab9d6fa473a9b39
Author: Dmitry Torokhov [EMAIL PROTECTED]
AuthorDate: Mon May 21 11:51:11 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:23:36 2007 -0300

V4L/DVB (5684): V4L: ir-kbd-i2c - switch to using msecs_to_jiffies()

Signed-off-by: Dmitry Torokhov [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/video/ir-kbd-i2c.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/media/video/ir-kbd-i2c.c b/drivers/media/video/ir-kbd-i2c.c
index ed92b6f..cd84d06 100644
--- a/drivers/media/video/ir-kbd-i2c.c
+++ b/drivers/media/video/ir-kbd-i2c.c
@@ -270,8 +270,9 @@ static void ir_timer(unsigned long data)
 static void ir_work(struct work_struct *work)
 {
struct IR_i2c *ir = container_of(work, struct IR_i2c, work);
+
ir_key_poll(ir);
-   mod_timer(ir-timer, jiffies+HZ/10);
+   mod_timer(ir-timer, jiffies + msecs_to_jiffies(100));
 }
 
 /* --- */
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


V4L/DVB (5692): M920x: attempt to fix hw pid filters on second endpoint

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=47f8df0fc0a5bd2e7e46ca438715ffa290051f72
Commit: 47f8df0fc0a5bd2e7e46ca438715ffa290051f72
Parent: 7cb47a14609eed6db2041fd1fe888027b2a3c3e0
Author: Aapo Tahkola [EMAIL PROTECTED]
AuthorDate: Tue May 8 12:03:55 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:23:38 2007 -0300

V4L/DVB (5692): M920x: attempt to fix hw pid filters on second endpoint

Signed-off-by: Aapo Tahkola [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/dvb/dvb-usb/m920x.c |   57 
 drivers/media/dvb/dvb-usb/m920x.h |5 ++-
 2 files changed, 41 insertions(+), 21 deletions(-)

diff --git a/drivers/media/dvb/dvb-usb/m920x.c 
b/drivers/media/dvb/dvb-usb/m920x.c
index c546dde..37e7f58 100644
--- a/drivers/media/dvb/dvb-usb/m920x.c
+++ b/drivers/media/dvb/dvb-usb/m920x.c
@@ -22,6 +22,8 @@ static int dvb_usb_m920x_debug;
 module_param_named(debug,dvb_usb_m920x_debug, int, 0644);
 MODULE_PARM_DESC(debug, set debugging level (1=rc (or-able)). 
DVB_USB_DEBUG_STATUS);
 
+static int m920x_set_filter(struct dvb_usb_device *d, int type, int idx, int 
pid);
+
 static inline int m920x_read(struct usb_device *udev, u8 request, u16 value,
 u16 index, void *data, int size)
 {
@@ -57,7 +59,8 @@ static inline int m920x_write(struct usb_device *udev, u8 
request,
 
 static int m920x_init(struct dvb_usb_device *d, struct m920x_inits *rc_seq)
 {
-   int ret = 0;
+   int ret = 0, i, epi;
+   int adap_enabled[M9206_MAX_ADAPTERS] = { 0 };
 
/* Remote controller init. */
if (d-props.rc_query) {
@@ -76,6 +79,28 @@ static int m920x_init(struct dvb_usb_device *d, struct 
m920x_inits *rc_seq)
deb(Initialising remote control success\n);
}
 
+   for (i = 0; i  d-props.num_adapters; i++) {
+   epi = d-adapter[i].props.stream.endpoint - 0x81;
+
+   if (epi  0 || epi = M9206_MAX_ADAPTERS) {
+   printk(KERN_INFO m920x: Unexpected adapter 
endpoint!\n);
+   return -EINVAL;
+   }
+
+   adap_enabled[epi] = 1;
+   }
+
+   for (i = 0; i  M9206_MAX_ADAPTERS; i++) {
+   if (adap_enabled[i])
+   continue;
+
+   if ((ret = m920x_set_filter(d, 0x81 + i, 0, 0x0)) != 0)
+   return ret;
+
+   if ((ret = m920x_set_filter(d, 0x81 + i, 0, 0x02f5)) != 0)
+   return ret;
+   }
+
return ret;
 }
 
@@ -211,8 +236,7 @@ static struct i2c_algorithm m920x_i2c_algo = {
 };
 
 /* pid filter */
-static int m920x_set_filter(struct dvb_usb_adapter *adap,
-   int type, int idx, int pid)
+static int m920x_set_filter(struct dvb_usb_device *d, int type, int idx, int 
pid)
 {
int ret = 0;
 
@@ -221,10 +245,10 @@ static int m920x_set_filter(struct dvb_usb_adapter *adap,
 
pid |= 0x8000;
 
-   if ((ret = m920x_write(adap-dev-udev, M9206_FILTER, pid, (type  8) 
| (idx * 4) )) != 0)
+   if ((ret = m920x_write(d-udev, M9206_FILTER, pid, (type  8) | (idx * 
4) )) != 0)
return ret;
 
-   if ((ret = m920x_write(adap-dev-udev, M9206_FILTER, 0, (type  8) | 
(idx * 4) )) != 0)
+   if ((ret = m920x_write(d-udev, M9206_FILTER, 0, (type  8) | (idx * 
4) )) != 0)
return ret;
 
return ret;
@@ -233,40 +257,35 @@ static int m920x_set_filter(struct dvb_usb_adapter *adap,
 static int m920x_update_filters(struct dvb_usb_adapter *adap)
 {
struct m920x_state *m = adap-dev-priv;
-   int enabled = m-filtering_enabled;
+   int enabled = m-filtering_enabled[adap-id];
int i, ret = 0, filter = 0;
+   int ep = adap-props.stream.endpoint;
 
for (i = 0; i  M9206_MAX_FILTERS; i++)
-   if (m-filters[i] == 8192)
+   if (m-filters[adap-id][i] == 8192)
enabled = 0;
 
/* Disable all filters */
-   if ((ret = m920x_set_filter(adap, 0x81, 1, enabled)) != 0)
+   if ((ret = m920x_set_filter(adap-dev, ep, 1, enabled)) != 0)
return ret;
 
for (i = 0; i  M9206_MAX_FILTERS; i++)
-   if ((ret = m920x_set_filter(adap, 0x81, i + 2, 0)) != 0)
+   if ((ret = m920x_set_filter(adap-dev, ep, i + 2, 0)) != 0)
return ret;
 
-   if ((ret = m920x_set_filter(adap, 0x82, 0, 0x0)) != 0)
-   return ret;
-
/* Set */
if (enabled) {
for (i = 0; i  M9206_MAX_FILTERS; i++) {
-   if (m-filters[i] == 0)
+   if (m-filters[adap-id][i] == 0)
continue;
 
-   if ((ret = m920x_set_filter(adap, 0x81, filter + 2, 
m-filters[i])) != 0)
+   if 

V4L/DVB (5694): M920x: fix for Dposh devices

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3847b22ab59a9110c9e7433ac75751070047280e
Commit: 3847b22ab59a9110c9e7433ac75751070047280e
Parent: 55bbe5ea203373c07c10a9d1d5088dd013345027
Author: Aapo Tahkola [EMAIL PROTECTED]
AuthorDate: Tue May 8 18:21:47 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:23:43 2007 -0300

V4L/DVB (5694): M920x: fix for Dposh devices

Make sure devices manufactured by Dposh are not affected by previous hw
pid filtering changes

Doing so might crash it.

Signed-off-by: Aapo Tahkola [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/dvb/dvb-usb/m920x.c |   38 +---
 1 files changed, 22 insertions(+), 16 deletions(-)

diff --git a/drivers/media/dvb/dvb-usb/m920x.c 
b/drivers/media/dvb/dvb-usb/m920x.c
index 350cdc9..1156b7d 100644
--- a/drivers/media/dvb/dvb-usb/m920x.c
+++ b/drivers/media/dvb/dvb-usb/m920x.c
@@ -59,7 +59,7 @@ static inline int m920x_write(struct usb_device *udev, u8 
request,
 
 static int m920x_init(struct dvb_usb_device *d, struct m920x_inits *rc_seq)
 {
-   int ret = 0, i, epi;
+   int ret = 0, i, epi, flags = 0;
int adap_enabled[M9206_MAX_ADAPTERS] = { 0 };
 
/* Remote controller init. */
@@ -79,26 +79,32 @@ static int m920x_init(struct dvb_usb_device *d, struct 
m920x_inits *rc_seq)
deb(Initialising remote control success\n);
}
 
-   for (i = 0; i  d-props.num_adapters; i++) {
-   epi = d-adapter[i].props.stream.endpoint - 0x81;
+   for (i = 0; i  d-props.num_adapters; i++)
+   flags |= d-adapter[i].props.caps;
 
-   if (epi  0 || epi = M9206_MAX_ADAPTERS) {
-   printk(KERN_INFO m920x: Unexpected adapter 
endpoint!\n);
-   return -EINVAL;
-   }
+   /* Some devices(Dposh) might crash if we attempt touch at all. */
+   if (flags  DVB_USB_ADAP_HAS_PID_FILTER) {
+   for (i = 0; i  d-props.num_adapters; i++) {
+   epi = d-adapter[i].props.stream.endpoint - 0x81;
 
-   adap_enabled[epi] = 1;
-   }
+   if (epi  0 || epi = M9206_MAX_ADAPTERS) {
+   printk(KERN_INFO m920x: Unexpected adapter 
endpoint!\n);
+   return -EINVAL;
+   }
 
-   for (i = 0; i  M9206_MAX_ADAPTERS; i++) {
-   if (adap_enabled[i])
-   continue;
+   adap_enabled[epi] = 1;
+   }
 
-   if ((ret = m920x_set_filter(d, 0x81 + i, 0, 0x0)) != 0)
-   return ret;
+   for (i = 0; i  M9206_MAX_ADAPTERS; i++) {
+   if (adap_enabled[i])
+   continue;
 
-   if ((ret = m920x_set_filter(d, 0x81 + i, 0, 0x02f5)) != 0)
-   return ret;
+   if ((ret = m920x_set_filter(d, 0x81 + i, 0, 0x0)) != 0)
+   return ret;
+
+   if ((ret = m920x_set_filter(d, 0x81 + i, 0, 0x02f5)) != 
0)
+   return ret;
+   }
}
 
return ret;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


V4L/DVB (5698): Input: drivers/media - switch to using input_dev-dev.parent

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2c8a3a33558d3f5aa18b56eada66fbe712ee6bb7
Commit: 2c8a3a33558d3f5aa18b56eada66fbe712ee6bb7
Parent: afb758c4b03b17ff856f2bd58e488d152b342875
Author: Dmitry Torokhov dtor at mail.ru
AuthorDate: Mon Jul 16 09:28:15 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:23:46 2007 -0300

V4L/DVB (5698): Input: drivers/media - switch to using input_dev-dev.parent

In preparation for struct class_device - struct device input
core conversion switch to using input_dev-dev.parent when
specifying device position in sysfs tree.

Signed-off-by: Dmitry Torokhov dtor at mail.ru
Acked-by: Thierry Merle [EMAIL PROTECTED]
Signed-off-by: Michael Krufky [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/dvb/cinergyT2/cinergyT2.c   |2 +-
 drivers/media/dvb/dvb-usb/dvb-usb-remote.c|2 +-
 drivers/media/dvb/ttpci/av7110_ir.c   |2 +-
 drivers/media/dvb/ttpci/budget-ci.c   |2 +-
 drivers/media/video/bt8xx/bttv-input.c|2 +-
 drivers/media/video/cx88/cx88-input.c |2 +-
 drivers/media/video/saa7134/saa7134-input.c   |2 +-
 drivers/media/video/usbvideo/konicawc.c   |2 +-
 drivers/media/video/usbvideo/quickcam_messenger.c |2 +-
 9 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/media/dvb/cinergyT2/cinergyT2.c 
b/drivers/media/dvb/cinergyT2/cinergyT2.c
index b40af48..bc22064 100644
--- a/drivers/media/dvb/cinergyT2/cinergyT2.c
+++ b/drivers/media/dvb/cinergyT2/cinergyT2.c
@@ -829,7 +829,7 @@ static int cinergyt2_register_rc(struct cinergyt2 
*cinergyt2)
input_dev-id.vendor = cinergyt2-udev-descriptor.idVendor;
input_dev-id.product = cinergyt2-udev-descriptor.idProduct;
input_dev-id.version = 1;
-   input_dev-cdev.dev = cinergyt2-udev-dev;
+   input_dev-dev.parent = cinergyt2-udev-dev;
 
err = input_register_device(input_dev);
if (err) {
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-remote.c 
b/drivers/media/dvb/dvb-usb/dvb-usb-remote.c
index 9200a30..7b9f35b 100644
--- a/drivers/media/dvb/dvb-usb/dvb-usb-remote.c
+++ b/drivers/media/dvb/dvb-usb/dvb-usb-remote.c
@@ -110,7 +110,7 @@ int dvb_usb_remote_init(struct dvb_usb_device *d)
input_dev-name = IR-receiver inside an USB DVB receiver;
input_dev-phys = d-rc_phys;
usb_to_input_id(d-udev, input_dev-id);
-   input_dev-cdev.dev = d-udev-dev;
+   input_dev-dev.parent = d-udev-dev;
 
/* set the bits for the keys */
deb_rc(key map size: %d\n, d-props.rc_key_map_size);
diff --git a/drivers/media/dvb/ttpci/av7110_ir.c 
b/drivers/media/dvb/ttpci/av7110_ir.c
index a97f166..6322800 100644
--- a/drivers/media/dvb/ttpci/av7110_ir.c
+++ b/drivers/media/dvb/ttpci/av7110_ir.c
@@ -356,7 +356,7 @@ int __devinit av7110_ir_init(struct av7110 *av7110)
input_dev-id.vendor = av7110-dev-pci-vendor;
input_dev-id.product = av7110-dev-pci-device;
}
-   input_dev-cdev.dev = av7110-dev-pci-dev;
+   input_dev-dev.parent = av7110-dev-pci-dev;
/* initial keymap */
memcpy(av7110-ir.key_map, default_key_map, sizeof av7110-ir.key_map);
input_register_keys(av7110-ir);
diff --git a/drivers/media/dvb/ttpci/budget-ci.c 
b/drivers/media/dvb/ttpci/budget-ci.c
index 9d42f88..873c3ba 100644
--- a/drivers/media/dvb/ttpci/budget-ci.c
+++ b/drivers/media/dvb/ttpci/budget-ci.c
@@ -206,7 +206,7 @@ static int msp430_ir_init(struct budget_ci *budget_ci)
input_dev-id.vendor = saa-pci-vendor;
input_dev-id.product = saa-pci-device;
}
-   input_dev-cdev.dev = saa-pci-dev;
+   input_dev-dev.parent = saa-pci-dev;
 
/* Select keymap and address */
switch (budget_ci-budget.dev-pci-subsystem_device) {
diff --git a/drivers/media/video/bt8xx/bttv-input.c 
b/drivers/media/video/bt8xx/bttv-input.c
index 6f74c80..94a13d0 100644
--- a/drivers/media/video/bt8xx/bttv-input.c
+++ b/drivers/media/video/bt8xx/bttv-input.c
@@ -313,7 +313,7 @@ int bttv_input_init(struct bttv *btv)
input_dev-id.vendor  = btv-c.pci-vendor;
input_dev-id.product = btv-c.pci-device;
}
-   input_dev-cdev.dev = btv-c.pci-dev;
+   input_dev-dev.parent = btv-c.pci-dev;
 
btv-remote = ir;
bttv_ir_start(btv, ir);
diff --git a/drivers/media/video/cx88/cx88-input.c 
b/drivers/media/video/cx88/cx88-input.c
index 7ff901f..ddfae9f 100644
--- a/drivers/media/video/cx88/cx88-input.c
+++ b/drivers/media/video/cx88/cx88-input.c
@@ -324,7 +324,7 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev 
*pci)
input_dev-id.vendor = pci-vendor;
input_dev-id.product = pci-device;
}
-   input_dev-cdev.dev = pci-dev;
+ 

V4L/DVB (5701): Documentation/dvb/bt8xx.txt update

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=afb758c4b03b17ff856f2bd58e488d152b342875
Commit: afb758c4b03b17ff856f2bd58e488d152b342875
Parent: d577ee004d1bb4620ae43758ca7a0aa35319faaa
Author: Uwe Bugla [EMAIL PROTECTED]
AuthorDate: Sat May 26 07:56:29 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:23:45 2007 -0300

V4L/DVB (5701): Documentation/dvb/bt8xx.txt update

This patch synchronizes the Documentation for bt8xx-based cards to the
actual state of kernel 2.6.22-rc1.

Signed-off-by: Uwe Bugla [EMAIL PROTECTED]
Signed-off-by: Manu Abraham [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 Documentation/dvb/bt8xx.txt |   32 
 1 files changed, 20 insertions(+), 12 deletions(-)

diff --git a/Documentation/dvb/bt8xx.txt b/Documentation/dvb/bt8xx.txt
index 4e7614e..ecb47ad 100644
--- a/Documentation/dvb/bt8xx.txt
+++ b/Documentation/dvb/bt8xx.txt
@@ -9,19 +9,29 @@ for accessing the i2c bus and the gpio pins of the bt8xx 
chipset.
 Please see Documentation/dvb/cards.txt = o Cards based on the Conexant Bt8xx 
PCI bridge:
 
 Compiling kernel please enable:
-a.)Device drivers = Multimedia devices = Video For Linux = BT848 
Video For Linux
-b.)Device drivers = Multimedia devices = Digital Video Broadcasting 
Devices
- = DVB for Linux DVB Core Support Bt8xx based PCI Cards
+a.)Device drivers = Multimedia devices = Video For Linux = Enable 
Video for Linux API 1 (DEPRECATED)
+b.)Device drivers = Multimedia devices = Video For Linux = Video 
Capture Adapters = BT848 Video For Linux
+c.)Device drivers = Multimedia devices = Digital Video Broadcasting 
Devices = DVB for Linux DVB Core Support Bt8xx based PCI Cards
 
-2) Loading Modules
-==
+Please use the following options with care as deselection of drivers which are 
in fact necessary
+may result in DVB devices that cannot be tuned due to lack of driver support:
+You can save RAM by deselecting every frontend module that your DVB card does 
not need.
+
+First please remove the static dependency of DVB card drivers on all frontend 
modules for all possible card variants by enabling:
+d.) Device drivers = Multimedia devices = Digital Video Broadcasting 
Devices
+ = DVB for Linux DVB Core Support Load and attach frontend modules as 
needed
 
-In default cases bttv is loaded automatically.
-To load the backend either place dvb-bt8xx in etc/modules, or apply manually:
+If you know the frontend driver that your card needs please enable:
+e.)Device drivers = Multimedia devices = Digital Video Broadcasting 
Devices
+ = DVB for Linux DVB Core Support Customise DVB Frontends = Customise 
the frontend modules to build
+ Then please select your card-specific frontend module.
 
-   $ modprobe dvb-bt8xx
+2) Loading Modules
+==
 
-All frontends will be loaded automatically.
+Regular case: If the bttv driver detects a bt8xx-based DVB card, all frontend 
and backend modules will be loaded automatically.
+Exceptions are:
+- Old TwinHan DST cards or clones with or without CA slot and not containing 
an Eeprom.
 People running udev please see Documentation/dvb/udev.txt.
 
 In the following cases overriding the PCI type detection for dvb-bt8xx might 
be necessary:
@@ -30,7 +40,6 @@ In the following cases overriding the PCI type detection for 
dvb-bt8xx might be
 --
 
$ modprobe bttv card=113
-   $ modprobe dvb-bt8xx
$ modprobe dst
 
 Useful parameters for verbosity level and debugging the dst module:
@@ -65,10 +74,9 @@ DViCO FusionHDTV 5 Lite: 135
 Notice: The order of the card ID should be uprising:
 Example:
$ modprobe bttv card=113 card=135
-   $ modprobe dvb-bt8xx
 
 For a full list of card ID's please see 
Documentation/video4linux/CARDLIST.bttv.
-In case of further problems send questions to the mailing list: 
www.linuxdvb.org.
+In case of further problems please subscribe and send questions to the mailing 
list: [EMAIL PROTECTED]
 
 Authors: Richard Walker,
 Jamie Honan,
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


V4L/DVB (5704): Remove worthless references to obsolete MODULE_PARM macro.

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=805b35634b6c349738664619a6d2eb8ece02fe63
Commit: 805b35634b6c349738664619a6d2eb8ece02fe63
Parent: 2c8a3a33558d3f5aa18b56eada66fbe712ee6bb7
Author: Robert P. J. Day [EMAIL PROTECTED]
AuthorDate: Mon May 28 16:21:40 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:23:46 2007 -0300

V4L/DVB (5704): Remove worthless references to obsolete MODULE_PARM macro.

Remove the long-dead references to the obsolete MODULE_PARM macro.
Given that the first one of those is actually misspelled as
MODULE_PARAM, it's clear that they can't have been doing any good.
Acked-by: Thierry Merle [EMAIL PROTECTED]

Signed-off-by: Robert P. J. Day [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/video/usbvision/usbvision-video.c |   23 ---
 1 files changed, 0 insertions(+), 23 deletions(-)

diff --git a/drivers/media/video/usbvision/usbvision-video.c 
b/drivers/media/video/usbvision/usbvision-video.c
index 6b185a9..8d53c8a 100644
--- a/drivers/media/video/usbvision/usbvision-video.c
+++ b/drivers/media/video/usbvision/usbvision-video.c
@@ -149,35 +149,12 @@ static int vbi_nr = -1;
 /* Grab parameters for the device driver */
 
 /* Showing parameters under SYSFS */
-#if defined(module_param)
 module_param(isocMode, int, 0444);
 module_param(video_debug, int, 0444);
 module_param(PowerOnAtOpen, int, 0444);
 module_param(video_nr, int, 0444);
 module_param(radio_nr, int, 0444);
 module_param(vbi_nr, int, 0444);
-#else
-/* Old Style */
-MODULE_PARAM(isocMode, i);
-/* Grab the Debug Mode of the device driver */
-MODULE_PARM(video_debug, i);
-/* Grab the compression to be adaptive */
-MODULE_PARM(adjustCompression, i);
-/* Grab the device to power on at startup */
-MODULE_PARM(PowerOnAtOpen, i);
-/* To help people with Black and White output with using s-video input.
-   Some cables and input device are wired differently. */
-MODULE_PARM(SwitchSVideoInput, i);
-/* video_nr option allows to specify a certain /dev/videoX device
-   (like /dev/video0 or /dev/video1 ...) */
-MODULE_PARM(video_nr, i);
-/* radio_nr option allows to specify a certain /dev/radioX device
-   (like /dev/radio0 or /dev/radio1 ...) */
-MODULE_PARM(radio_nr, i);
-/* vbi_nr option allows to specify a certain /dev/vbiX device
-   (like /dev/vbi0 or /dev/vbi1 ...) */
-MODULE_PARM(vbi_nr, i);
-#endif
 
 MODULE_PARM_DESC(isocMode,  Set the default format for ISOC endpoint.  
Default: 0x60 (Compression On));
 MODULE_PARM_DESC(video_debug,  Set the default Debug Mode of the device 
driver.  Default: 0 (Off));
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


V4L/DVB (5705): Removed unnecessary .hardware from video_device struct.

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2e02b9a717388c99f2c2ef0aa03f86334bbf8fc7
Commit: 2e02b9a717388c99f2c2ef0aa03f86334bbf8fc7
Parent: 805b35634b6c349738664619a6d2eb8ece02fe63
Author: Douglas Schilling Landgraf [EMAIL PROTECTED]
AuthorDate: Sun May 27 14:05:01 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:23:47 2007 -0300

V4L/DVB (5705): Removed unnecessary .hardware from video_device struct.

From: Douglas Schilling Landgraf [EMAIL PROTECTED]

Signed-off-by: Douglas Schilling Landgraf [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/radio/radio-aimslab.c|1 -
 drivers/media/radio/radio-aztech.c |1 -
 drivers/media/radio/radio-gemtek-pci.c |1 -
 drivers/media/radio/radio-gemtek.c |1 -
 drivers/media/radio/radio-rtrack2.c|1 -
 drivers/media/radio/radio-sf16fmi.c|1 -
 drivers/media/radio/radio-sf16fmr2.c   |1 -
 drivers/media/radio/radio-terratec.c   |1 -
 drivers/media/radio/radio-trust.c  |1 -
 drivers/media/radio/radio-typhoon.c|1 -
 10 files changed, 0 insertions(+), 10 deletions(-)

diff --git a/drivers/media/radio/radio-aimslab.c 
b/drivers/media/radio/radio-aimslab.c
index 5adc27c..ce940b1 100644
--- a/drivers/media/radio/radio-aimslab.c
+++ b/drivers/media/radio/radio-aimslab.c
@@ -392,7 +392,6 @@ static struct video_device rtrack_radio=
.owner  = THIS_MODULE,
.name   = RadioTrack radio,
.type   = VID_TYPE_TUNER,
-   .hardware   = 0,
.fops   = rtrack_fops,
.vidioc_querycap= vidioc_querycap,
.vidioc_g_tuner = vidioc_g_tuner,
diff --git a/drivers/media/radio/radio-aztech.c 
b/drivers/media/radio/radio-aztech.c
index 9f1adda..9b1f7a9 100644
--- a/drivers/media/radio/radio-aztech.c
+++ b/drivers/media/radio/radio-aztech.c
@@ -355,7 +355,6 @@ static struct video_device aztech_radio=
.owner  = THIS_MODULE,
.name   = Aztech radio,
.type   = VID_TYPE_TUNER,
-   .hardware   = 0,
.fops   = aztech_fops,
.vidioc_querycap= vidioc_querycap,
.vidioc_g_tuner = vidioc_g_tuner,
diff --git a/drivers/media/radio/radio-gemtek-pci.c 
b/drivers/media/radio/radio-gemtek-pci.c
index 5e6f17d..4db05b2 100644
--- a/drivers/media/radio/radio-gemtek-pci.c
+++ b/drivers/media/radio/radio-gemtek-pci.c
@@ -377,7 +377,6 @@ static struct video_device vdev_template = {
.owner = THIS_MODULE,
.name  = Gemtek PCI Radio,
.type  = VID_TYPE_TUNER,
-   .hardware  = 0,
.fops  = gemtek_pci_fops,
.vidioc_querycap= vidioc_querycap,
.vidioc_g_tuner = vidioc_g_tuner,
diff --git a/drivers/media/radio/radio-gemtek.c 
b/drivers/media/radio/radio-gemtek.c
index b04b6a7..eab8c80 100644
--- a/drivers/media/radio/radio-gemtek.c
+++ b/drivers/media/radio/radio-gemtek.c
@@ -330,7 +330,6 @@ static struct video_device gemtek_radio=
.owner  = THIS_MODULE,
.name   = GemTek radio,
.type   = VID_TYPE_TUNER,
-   .hardware   = 0,
.fops   = gemtek_fops,
.vidioc_querycap= vidioc_querycap,
.vidioc_g_tuner = vidioc_g_tuner,
diff --git a/drivers/media/radio/radio-rtrack2.c 
b/drivers/media/radio/radio-rtrack2.c
index 9b493b3..82aedfc 100644
--- a/drivers/media/radio/radio-rtrack2.c
+++ b/drivers/media/radio/radio-rtrack2.c
@@ -297,7 +297,6 @@ static struct video_device rtrack2_radio=
.owner  = THIS_MODULE,
.name   = RadioTrack II radio,
.type   = VID_TYPE_TUNER,
-   .hardware   = 0,
.fops   = rtrack2_fops,
.vidioc_querycap= vidioc_querycap,
.vidioc_g_tuner = vidioc_g_tuner,
diff --git a/drivers/media/radio/radio-sf16fmi.c 
b/drivers/media/radio/radio-sf16fmi.c
index dc33f19..3951653 100644
--- a/drivers/media/radio/radio-sf16fmi.c
+++ b/drivers/media/radio/radio-sf16fmi.c
@@ -297,7 +297,6 @@ static struct video_device fmi_radio=
.owner  = THIS_MODULE,
.name   = SF16FMx radio,
.type   = VID_TYPE_TUNER,
-   .hardware   = 0,
.fops   = fmi_fops,
.vidioc_querycap= vidioc_querycap,
.vidioc_g_tuner = vidioc_g_tuner,
diff --git a/drivers/media/radio/radio-sf16fmr2.c 
b/drivers/media/radio/radio-sf16fmr2.c
index e6c125d..c432c44 100644
--- a/drivers/media/radio/radio-sf16fmr2.c
+++ b/drivers/media/radio/radio-sf16fmr2.c
@@ -442,7 +442,6 @@ static struct video_device fmr2_radio=
.owner  = THIS_MODULE,
.name   = SF16FMR2 radio,
. type  = VID_TYPE_TUNER,
-   .hardware   = 0,
.fops   = 

V4L/DVB (5695): M920x: enable second adapter on LifeView TV Walker Twin

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3ab3b69de52460ee676304aa773cd37b0b952905
Commit: 3ab3b69de52460ee676304aa773cd37b0b952905
Parent: 3847b22ab59a9110c9e7433ac75751070047280e
Author: Aapo Tahkola [EMAIL PROTECTED]
AuthorDate: Tue May 8 18:23:38 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:23:44 2007 -0300

V4L/DVB (5695): M920x: enable second adapter on LifeView TV Walker Twin

Enable second adapter on LifeView TV Walker Twin DVB-T USB2.0

Signed-off-by: Aapo Tahkola [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/dvb/dvb-usb/m920x.c |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/media/dvb/dvb-usb/m920x.c 
b/drivers/media/dvb/dvb-usb/m920x.c
index 1156b7d..c9f1cec 100644
--- a/drivers/media/dvb/dvb-usb/m920x.c
+++ b/drivers/media/dvb/dvb-usb/m920x.c
@@ -765,9 +765,9 @@ static struct dvb_usb_device_properties 
digivox_mini_ii_properties = {
  *
  * LifeView TV Walker Twin has 1 x M9206, 2 x TDA10046, 2 x TDA8275A
  * TDA10046 #0 is located at i2c address 0x08
- * TDA10046 #1 is located at i2c address 0x0b (presently disabled - not yet 
working)
+ * TDA10046 #1 is located at i2c address 0x0b
  * TDA8275A #0 is located at i2c address 0x60
- * TDA8275A #1 is located at i2c address 0x61 (presently disabled - not yet 
working)
+ * TDA8275A #1 is located at i2c address 0x61
  */
 static struct dvb_usb_device_properties tvwalkertwin_properties = {
.caps = DVB_USB_IS_AN_I2C_ADAPTER,
@@ -784,7 +784,7 @@ static struct dvb_usb_device_properties 
tvwalkertwin_properties = {
.size_of_priv = sizeof(struct m920x_state),
 
.identify_state   = m920x_identify_state,
-   .num_adapters = 1,
+   .num_adapters = 2,
.adapter = {{
.caps = DVB_USB_ADAP_HAS_PID_FILTER |
DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


V4L/DVB (5719): Tuner: Move device-specific private data out of tuner struct

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b208319993ceff7ebfcc6bb914fe94d29e48a891
Commit: b208319993ceff7ebfcc6bb914fe94d29e48a891
Parent: 56584c9ea9a6dcd672f97ebfeebc4903e8b903bc
Author: Michael Krufky [EMAIL PROTECTED]
AuthorDate: Tue May 29 22:54:06 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:23:48 2007 -0300

V4L/DVB (5719): Tuner: Move device-specific private data out of tuner struct

Create private data struct for device specific private data.

Signed-off-by: Michael Krufky [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/video/mt20xx.c |   33 +---
 drivers/media/video/tda8290.c|  105 +++--
 drivers/media/video/tda9887.c|   33 
 drivers/media/video/tuner-core.c |5 ++-
 include/media/tuner.h|   13 +
 5 files changed, 117 insertions(+), 72 deletions(-)

diff --git a/drivers/media/video/mt20xx.c b/drivers/media/video/mt20xx.c
index 2987c16..d7e68a6 100644
--- a/drivers/media/video/mt20xx.c
+++ b/drivers/media/video/mt20xx.c
@@ -37,6 +37,11 @@ static char *microtune_part[] = {
[ MT2050 ] = MT2050,
 };
 
+struct microtune_priv {
+   unsigned int xogc;
+   unsigned int radio_if2;
+};
+
 // IsSpurInBand()?
 static int mt2032_spurcheck(struct i2c_client *c,
int f1, int f2, int spectrum_from,int spectrum_to)
@@ -218,6 +223,7 @@ static void mt2032_set_if_freq(struct i2c_client *c, 
unsigned int rfin,
unsigned char buf[21];
int lint_try,ret,sel,lock=0;
struct tuner *t = i2c_get_clientdata(c);
+   struct microtune_priv *priv = t-priv;
 
tuner_dbg(mt2032_set_if_freq rfin=%d if1=%d if2=%d from=%d to=%d\n,
  rfin,if1,if2,from,to);
@@ -227,7 +233,7 @@ static void mt2032_set_if_freq(struct i2c_client *c, 
unsigned int rfin,
i2c_master_recv(c,buf,21);
 
buf[0]=0;
-   ret=mt2032_compute_freq(c,rfin,if1,if2,from,to,buf[1],sel,t-xogc);
+   ret=mt2032_compute_freq(c,rfin,if1,if2,from,to,buf[1],sel,priv-xogc);
if (ret0)
return;
 
@@ -251,10 +257,10 @@ static void mt2032_set_if_freq(struct i2c_client *c, 
unsigned int rfin,
 
tuner_dbg(mt2032: re-init PLLs by LINT\n);
buf[0]=7;
-   buf[1]=0x80 +8+t-xogc; // set LINT to re-init PLLs
+   buf[1]=0x80 +8+priv-xogc; // set LINT to re-init PLLs
i2c_master_send(c,buf,2);
mdelay(10);
-   buf[1]=8+t-xogc;
+   buf[1]=8+priv-xogc;
i2c_master_send(c,buf,2);
}
 
@@ -294,7 +300,8 @@ static void mt2032_set_tv_freq(struct i2c_client *c, 
unsigned int freq)
 static void mt2032_set_radio_freq(struct i2c_client *c, unsigned int freq)
 {
struct tuner *t = i2c_get_clientdata(c);
-   int if2 = t-radio_if2;
+   struct microtune_priv *priv = t-priv;
+   int if2 = priv-radio_if2;
 
// per Manual for FM tuning: first if center freq. 1085 MHz
mt2032_set_if_freq(c, freq * 1000 / 16,
@@ -305,6 +312,7 @@ static void mt2032_set_radio_freq(struct i2c_client *c, 
unsigned int freq)
 static int mt2032_init(struct i2c_client *c)
 {
struct tuner *t = i2c_get_clientdata(c);
+   struct microtune_priv *priv = t-priv;
unsigned char buf[21];
int ret,xogc,xok=0;
 
@@ -351,7 +359,7 @@ static int mt2032_init(struct i2c_client *c)
if (ret!=2)
tuner_warn(i2c i/o error: rc == %d (should be 
2)\n,ret);
} while (xok != 1 );
-   t-xogc=xogc;
+   priv-xogc=xogc;
 
t-set_tv_freq= mt2032_set_tv_freq;
t-set_radio_freq = mt2032_set_radio_freq;
@@ -456,7 +464,8 @@ static void mt2050_set_tv_freq(struct i2c_client *c, 
unsigned int freq)
 static void mt2050_set_radio_freq(struct i2c_client *c, unsigned int freq)
 {
struct tuner *t = i2c_get_clientdata(c);
-   int if2 = t-radio_if2;
+   struct microtune_priv *priv = t-priv;
+   int if2 = priv-radio_if2;
 
mt2050_set_if_freq(c, freq * 1000 / 16, if2);
mt2050_set_antenna(c, radio_antenna);
@@ -488,21 +497,29 @@ static int mt2050_init(struct i2c_client *c)
 
 int microtune_init(struct i2c_client *c)
 {
+   struct microtune_priv *priv = NULL;
struct tuner *t = i2c_get_clientdata(c);
char *name;
unsigned char buf[21];
int company_code;
 
+   priv = kzalloc(sizeof(struct microtune_priv), GFP_KERNEL);
+   if (priv == NULL)
+   return -ENOMEM;
+   t-priv = priv;
+
+   priv-radio_if2 = 10700 * 1000; /* 10.7MHz - FM radio */
+
memset(buf,0,sizeof(buf));
t-set_tv_freq= NULL;
t-set_radio_freq = NULL;
t-standby= NULL;
if (t-std  V4L2_STD_525_60) {
tuner_dbg(pinnacle 

V4L/DVB (5724): Saa7134-tvaudio: kthread conversion

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3e0e38e6e4b6f64f22f2fb6aca36b25f10f779cb
Commit: 3e0e38e6e4b6f64f22f2fb6aca36b25f10f779cb
Parent: b208319993ceff7ebfcc6bb914fe94d29e48a891
Author: Christoph Hellwig [EMAIL PROTECTED]
AuthorDate: Fri Jun 1 20:15:26 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:23:48 2007 -0300

V4L/DVB (5724): Saa7134-tvaudio: kthread conversion

Acked-by: Hermann Pitton [EMAIL PROTECTED]
Signed-off-by: Christoph Hellwig [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/video/saa7134/saa7134-tvaudio.c |   42 +---
 drivers/media/video/saa7134/saa7134.h |5 +--
 2 files changed, 17 insertions(+), 30 deletions(-)

diff --git a/drivers/media/video/saa7134/saa7134-tvaudio.c 
b/drivers/media/video/saa7134/saa7134-tvaudio.c
index 30395d6..18b4817 100644
--- a/drivers/media/video/saa7134/saa7134-tvaudio.c
+++ b/drivers/media/video/saa7134/saa7134-tvaudio.c
@@ -25,6 +25,7 @@
 #include linux/module.h
 #include linux/moduleparam.h
 #include linux/kernel.h
+#include linux/kthread.h
 #include linux/slab.h
 #include linux/delay.h
 #include asm/div64.h
@@ -341,10 +342,8 @@ static void tvaudio_setmode(struct saa7134_dev *dev,
 
 static int tvaudio_sleep(struct saa7134_dev *dev, int timeout)
 {
-   DECLARE_WAITQUEUE(wait, current);
-
-   add_wait_queue(dev-thread.wq, wait);
-   if (dev-thread.scan1 == dev-thread.scan2  !dev-thread.shutdown) {
+   if (dev-thread.scan1 == dev-thread.scan2 
+   !kthread_should_stop()) {
if (timeout  0) {
set_current_state(TASK_INTERRUPTIBLE);
schedule();
@@ -353,7 +352,6 @@ static int tvaudio_sleep(struct saa7134_dev *dev, int 
timeout)
(msecs_to_jiffies(timeout));
}
}
-   remove_wait_queue(dev-thread.wq, wait);
return dev-thread.scan1 != dev-thread.scan2;
 }
 
@@ -505,11 +503,10 @@ static int tvaudio_thread(void *data)
unsigned int i, audio, nscan;
int max1,max2,carrier,rx,mode,lastmode,default_carrier;
 
-   daemonize(%s, dev-name);
allow_signal(SIGTERM);
for (;;) {
tvaudio_sleep(dev,-1);
-   if (dev-thread.shutdown || signal_pending(current))
+   if (kthread_should_stop() || signal_pending(current))
goto done;
 
restart:
@@ -618,7 +615,7 @@ static int tvaudio_thread(void *data)
for (;;) {
if (tvaudio_sleep(dev,5000))
goto restart;
-   if (dev-thread.shutdown || signal_pending(current))
+   if (kthread_should_stop() || signal_pending(current))
break;
if (UNSET == dev-thread.mode) {
rx = tvaudio_getstereo(dev,tvaudio[i]);
@@ -634,7 +631,6 @@ static int tvaudio_thread(void *data)
}
 
  done:
-   complete_and_exit(dev-thread.exit, 0);
return 0;
 }
 
@@ -782,7 +778,6 @@ static int tvaudio_thread_ddep(void *data)
struct saa7134_dev *dev = data;
u32 value, norms, clock;
 
-   daemonize(%s, dev-name);
allow_signal(SIGTERM);
 
clock = saa7134_boards[dev-board].audio_clock;
@@ -796,7 +791,7 @@ static int tvaudio_thread_ddep(void *data)
 
for (;;) {
tvaudio_sleep(dev,-1);
-   if (dev-thread.shutdown || signal_pending(current))
+   if (kthread_should_stop() || signal_pending(current))
goto done;
 
restart:
@@ -876,7 +871,6 @@ static int tvaudio_thread_ddep(void *data)
}
 
  done:
-   complete_and_exit(dev-thread.exit, 0);
return 0;
 }
 
@@ -973,7 +967,6 @@ int saa7134_tvaudio_getstereo(struct saa7134_dev *dev)
 
 int saa7134_tvaudio_init2(struct saa7134_dev *dev)
 {
-   DECLARE_MUTEX_LOCKED(sem);
int (*my_thread)(void *data) = NULL;
 
switch (dev-pci-device) {
@@ -986,15 +979,15 @@ int saa7134_tvaudio_init2(struct saa7134_dev *dev)
break;
}
 
-   dev-thread.pid = -1;
+   dev-thread.thread = NULL;
if (my_thread) {
/* start tvaudio thread */
-   init_waitqueue_head(dev-thread.wq);
-   init_completion(dev-thread.exit);
-   dev-thread.pid = kernel_thread(my_thread,dev,0);
-   if (dev-thread.pid  0)
+   dev-thread.thread = kthread_run(my_thread, dev, %s, 
dev-name);
+   if (IS_ERR(dev-thread.thread)) {
printk(KERN_WARNING %s: kernel_thread() failed\n,
   dev-name);
+   /* XXX: missing error 

V4L/DVB (5727): Remove VIVI_SCATTER

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=74fa39e5902faf1f5eb3ee642e2e069875a0343e
Commit: 74fa39e5902faf1f5eb3ee642e2e069875a0343e
Parent: 3e0e38e6e4b6f64f22f2fb6aca36b25f10f779cb
Author: Mauro Carvalho Chehab [EMAIL PROTECTED]
AuthorDate: Tue May 29 07:14:59 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:23:49 2007 -0300

V4L/DVB (5727): Remove VIVI_SCATTER

vivi scatter method were used as a proof of concept. It can be
safelly removed from mainstream, since the current method is
faster and better than the previous solution.

Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/video/vivi.c |  163 
 1 files changed, 0 insertions(+), 163 deletions(-)

diff --git a/drivers/media/video/vivi.c b/drivers/media/video/vivi.c
index 3ef4d01..582c6ba 100644
--- a/drivers/media/video/vivi.c
+++ b/drivers/media/video/vivi.c
@@ -145,9 +145,6 @@ struct vivi_buffer {
 
struct vivi_fmt*fmt;
 
-#ifdef CONFIG_VIVI_SCATTER
-   struct sg_to_addr  *to_addr;
-#endif
 };
 
 struct vivi_dmaqueue {
@@ -232,68 +229,13 @@ static u8 bars[8][3] = {
 #define TSTAMP_MAX_Y TSTAMP_MIN_Y+15
 #define TSTAMP_MIN_X 64
 
-#ifdef CONFIG_VIVI_SCATTER
-static void prep_to_addr(struct sg_to_addr to_addr[],
-struct videobuf_buffer *vb)
-{
-   int i, pos=0;
-
-   for (i=0;ivb-dma.nr_pages;i++) {
-   to_addr[i].sg=vb-dma.sglist[i];
-   to_addr[i].pos=pos;
-   pos += vb-dma.sglist[i].length;
-   }
-}
-
-static int get_addr_pos(int pos, int pages, struct sg_to_addr to_addr[])
-{
-   int p1=0,p2=pages-1,p3=pages/2;
-
-   /* Sanity test */
-   BUG_ON (pos=to_addr[p2].pos+to_addr[p2].sg-length);
-
-   while (p1+1p2) {
-   if (pos  to_addr[p3].pos) {
-   p2=p3;
-   } else {
-   p1=p3;
-   }
-   p3=(p1+p2)/2;
-   }
-   if (pos = to_addr[p2].pos)
-   p1=p2;
-
-   return (p1);
-}
-#endif
 
-#ifdef CONFIG_VIVI_SCATTER
-static void gen_line(struct sg_to_addr to_addr[],int inipos,int pages,int wmax,
-int hmax, int line, char *timestr)
-#else
 static void gen_line(char *basep,int inipos,int wmax,
 int hmax, int line, char *timestr)
-#endif
 {
int  w,i,j,pos=inipos,y;
char *p,*s;
u8   chr,r,g,b,color;
-#ifdef CONFIG_VIVI_SCATTER
-   int pgpos,oldpg;
-   char *basep;
-   struct page *pg;
-
-   unsigned long flags;
-   spinlock_t spinlock;
-
-   spin_lock_init(spinlock);
-
-   /* Get first addr pointed to pixel position */
-   oldpg=get_addr_pos(pos,pages,to_addr);
-   pg=pfn_to_page(sg_dma_address(to_addr[oldpg].sg)  PAGE_SHIFT);
-   spin_lock_irqsave(spinlock,flags);
-   basep = kmap_atomic(pg, KM_BOUNCE_READ)+to_addr[oldpg].sg-offset;
-#endif
 
/* We will just duplicate the second pixel at the packet */
wmax/=2;
@@ -305,18 +247,7 @@ static void gen_line(char *basep,int inipos,int wmax,
b=bars[w*7/wmax][2];
 
for (color=0;color4;color++) {
-#ifdef CONFIG_VIVI_SCATTER
-   pgpos=get_addr_pos(pos,pages,to_addr);
-   if (pgpos!=oldpg) {
-   
pg=pfn_to_page(sg_dma_address(to_addr[pgpos].sg)  PAGE_SHIFT);
-   kunmap_atomic(basep, KM_BOUNCE_READ);
-   basep= kmap_atomic(pg, 
KM_BOUNCE_READ)+to_addr[pgpos].sg-offset;
-   oldpg=pgpos;
-   }
-   p=basep+pos-to_addr[pgpos].pos;
-#else
p=basep+pos;
-#endif
 
switch (color) {
case 0:
@@ -361,23 +292,7 @@ static void gen_line(char *basep,int inipos,int wmax,
 
pos=inipos+j*2;
for (color=0;color4;color++) {
-#ifdef CONFIG_VIVI_SCATTER
-   pgpos=get_addr_pos(pos,pages,to_addr);
-   if (pgpos!=oldpg) {
-   pg=pfn_to_page(sg_dma_address(
-   
to_addr[pgpos].sg)
-PAGE_SHIFT);
-   kunmap_atomic(basep,
-   KM_BOUNCE_READ);
-   basep= kmap_atomic(pg,
-   KM_BOUNCE_READ)+
-   
to_addr[pgpos].sg-offset;
-   

V4L/DVB (5729): Remove support for 256 Kb firmware files.

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a957641bbafc9f44050c965fe1ddc0f7b771d416
Commit: a957641bbafc9f44050c965fe1ddc0f7b771d416
Parent: 74fa39e5902faf1f5eb3ee642e2e069875a0343e
Author: Hans Verkuil [EMAIL PROTECTED]
AuthorDate: Tue May 29 07:18:55 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:23:50 2007 -0300

V4L/DVB (5729): Remove support for 256 Kb firmware files.

For backwards compatibility firmware files of 256 Kb were allowed: all
drivers have now been updated to support the newer larger firmwares so
remove this compatibility code and only support the newer firmware.

Signed-off-by: Hans Verkuil [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/video/ivtv/ivtv-firmware.c |4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/drivers/media/video/ivtv/ivtv-firmware.c 
b/drivers/media/video/ivtv/ivtv-firmware.c
index d4c910b..2b6208a 100644
--- a/drivers/media/video/ivtv/ivtv-firmware.c
+++ b/drivers/media/video/ivtv/ivtv-firmware.c
@@ -56,9 +56,7 @@ retry:
volatile u32 __iomem *dst = (volatile u32 __iomem *)mem;
const u32 *src = (const u32 *)fw-data;
 
-   /* temporarily allow 256 KB encoding firmwares as well for
-  compatibility with blackbird cards */
-   if (fw-size != size  fw-size != 256 * 1024) {
+   if (fw-size != size) {
/* Due to race conditions in firmware loading (esp. 
with udev 0.95)
   the wrong file was sometimes loaded. So we check 
filesizes to
   see if at least the right-sized file was loaded. If 
not, then we
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


V4L/DVB (5733): Blackbird should accept only new cx2341x encoding firmwares

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=25472237320b4979d38eb15bc842f592c94d20f5
Commit: 25472237320b4979d38eb15bc842f592c94d20f5
Parent: a957641bbafc9f44050c965fe1ddc0f7b771d416
Author: Hans Verkuil [EMAIL PROTECTED]
AuthorDate: Wed May 30 09:39:46 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:23:51 2007 -0300

V4L/DVB (5733): Blackbird should accept only new cx2341x encoding firmwares

Remove temporary support for older 256 kB firmwares.
ivtv, pvrusb2 and blackbird can now all handle the newer larger firmwares,
so support for the older (buggier) firmware can be removed.

Signed-off-by: Hans Verkuil [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/video/cx88/cx88-blackbird.c |   11 ---
 1 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/media/video/cx88/cx88-blackbird.c 
b/drivers/media/video/cx88/cx88-blackbird.c
index a80b1cb..df700cf 100644
--- a/drivers/media/video/cx88/cx88-blackbird.c
+++ b/drivers/media/video/cx88/cx88-blackbird.c
@@ -56,8 +56,7 @@ MODULE_PARM_DESC(debug,enable debug messages [blackbird]);
 
 /* -- */
 
-#define OLD_BLACKBIRD_FIRM_IMAGE_SIZE 262144
-#define BLACKBIRD_FIRM_IMAGE_SIZE 376836
+#define BLACKBIRD_FIRM_IMAGE_SIZE 376836
 
 /* defines below are from ivtv-driver.h */
 
@@ -453,11 +452,9 @@ static int blackbird_load_firmware(struct cx8802_dev *dev)
return -1;
}
 
-   if ((firmware-size != BLACKBIRD_FIRM_IMAGE_SIZE) 
-   (firmware-size != OLD_BLACKBIRD_FIRM_IMAGE_SIZE)) {
-   dprintk(0, ERROR: Firmware size mismatch (have %zd, expected 
%d or %d)\n,
-   firmware-size, BLACKBIRD_FIRM_IMAGE_SIZE,
-   OLD_BLACKBIRD_FIRM_IMAGE_SIZE);
+   if (firmware-size != BLACKBIRD_FIRM_IMAGE_SIZE) {
+   dprintk(0, ERROR: Firmware size mismatch (have %zd, expected 
%d)\n,
+   firmware-size, BLACKBIRD_FIRM_IMAGE_SIZE);
release_firmware(firmware);
return -1;
}
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


V4L/DVB (5734): Cx88: kill dev-fw_size

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e0099e9edabd855bf83d3f57b1843f0b06bfb19d
Commit: e0099e9edabd855bf83d3f57b1843f0b06bfb19d
Parent: 25472237320b4979d38eb15bc842f592c94d20f5
Author: Michael Krufky [EMAIL PROTECTED]
AuthorDate: Wed May 30 13:29:32 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:23:52 2007 -0300

V4L/DVB (5734): Cx88: kill dev-fw_size

Now that cx88-blackbird is only accepting the official firmware image,
we no longer have any need to store the size of the firmware inside the
cx88 data structure.

Signed-off-by: Michael Krufky [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/video/cx88/cx88-blackbird.c |3 +--
 drivers/media/video/cx88/cx88.h   |1 -
 2 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/drivers/media/video/cx88/cx88-blackbird.c 
b/drivers/media/video/cx88/cx88-blackbird.c
index df700cf..f2fcdb9 100644
--- a/drivers/media/video/cx88/cx88-blackbird.c
+++ b/drivers/media/video/cx88/cx88-blackbird.c
@@ -404,7 +404,7 @@ static int blackbird_find_mailbox(struct cx8802_dev *dev)
u32 value;
int i;
 
-   for (i = 0; i  dev-fw_size; i++) {
+   for (i = 0; i  BLACKBIRD_FIRM_IMAGE_SIZE; i++) {
memory_read(dev-core, i, value);
if (value == signature[signaturecnt])
signaturecnt++;
@@ -458,7 +458,6 @@ static int blackbird_load_firmware(struct cx8802_dev *dev)
release_firmware(firmware);
return -1;
}
-   dev-fw_size = firmware-size;
 
if (0 != memcmp(firmware-data, magic, 8)) {
dprintk(0, ERROR: Firmware magic mismatch, wrong file?\n);
diff --git a/drivers/media/video/cx88/cx88.h b/drivers/media/video/cx88/cx88.h
index d773b6e..e0290ba 100644
--- a/drivers/media/video/cx88/cx88.h
+++ b/drivers/media/video/cx88/cx88.h
@@ -462,7 +462,6 @@ struct cx8802_dev {
u32mailbox;
intwidth;
intheight;
-   intfw_size;
 
 #if defined(CONFIG_VIDEO_BUF_DVB) || defined(CONFIG_VIDEO_BUF_DVB_MODULE)
/* for dvb only */
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


V4L/DVB (5739): Replace C code with calls to ARRAY_SIZE macro.

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0c71bf1c3065e80cc3ab91293829169bdeda2c42
Commit: 0c71bf1c3065e80cc3ab91293829169bdeda2c42
Parent: e0099e9edabd855bf83d3f57b1843f0b06bfb19d
Author: Robert P. J. Day [EMAIL PROTECTED]
AuthorDate: Tue Jun 5 05:20:56 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:23:52 2007 -0300

V4L/DVB (5739): Replace C code with calls to ARRAY_SIZE macro.

Signed-off-by: Robert P. J. Day [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/dvb/frontends/tda10023.c|2 +-
 drivers/media/video/cpia2/cpia2_v4l.c |8 
 drivers/media/video/ov7670.c  |4 ++--
 drivers/media/video/tveeprom.c|6 +++---
 drivers/media/video/tvp5150.c |2 +-
 drivers/media/video/usbvideo/quickcam_messenger.c |2 +-
 6 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/media/dvb/frontends/tda10023.c 
b/drivers/media/dvb/frontends/tda10023.c
index da796e7..4bb06f9 100644
--- a/drivers/media/dvb/frontends/tda10023.c
+++ b/drivers/media/dvb/frontends/tda10023.c
@@ -478,7 +478,7 @@ struct dvb_frontend* tda10023_attach(const struct 
tda1002x_config* config,
state-i2c = i2c;
memcpy(state-frontend.ops, tda10023_ops, sizeof(struct 
dvb_frontend_ops));
state-pwm = pwm;
-   for (i=0; i  sizeof(tda10023_inittab)/sizeof(*tda10023_inittab);i+=3) {
+   for (i=0; i  ARRAY_SIZE(tda10023_inittab);i+=3) {
if (tda10023_inittab[i] == 0x00) {
state-reg0 = tda10023_inittab[i+2];
break;
diff --git a/drivers/media/video/cpia2/cpia2_v4l.c 
b/drivers/media/video/cpia2/cpia2_v4l.c
index 1bda7ad..92778cd 100644
--- a/drivers/media/video/cpia2/cpia2_v4l.c
+++ b/drivers/media/video/cpia2/cpia2_v4l.c
@@ -105,7 +105,7 @@ static struct control_menu_info framerate_controls[] =
{ CPIA2_VP_FRAMERATE_25,   25 fps   },
{ CPIA2_VP_FRAMERATE_30,   30 fps   },
 };
-#define NUM_FRAMERATE_CONTROLS 
(sizeof(framerate_controls)/sizeof(framerate_controls[0]))
+#define NUM_FRAMERATE_CONTROLS (ARRAY_SIZE(framerate_controls))
 
 static struct control_menu_info flicker_controls[] =
 {
@@ -113,7 +113,7 @@ static struct control_menu_info flicker_controls[] =
{ FLICKER_50,50 Hz },
{ FLICKER_60,60 Hz  },
 };
-#define NUM_FLICKER_CONTROLS 
(sizeof(flicker_controls)/sizeof(flicker_controls[0]))
+#define NUM_FLICKER_CONTROLS (ARRAY_SIZE(flicker_controls))
 
 static struct control_menu_info lights_controls[] =
 {
@@ -122,7 +122,7 @@ static struct control_menu_info lights_controls[] =
{ 128, Bottom  },
{ 192, Both  },
 };
-#define NUM_LIGHTS_CONTROLS 
(sizeof(lights_controls)/sizeof(lights_controls[0]))
+#define NUM_LIGHTS_CONTROLS (ARRAY_SIZE(lights_controls))
 #define GPIO_LIGHTS_MASK 192
 
 static struct v4l2_queryctrl controls[] = {
@@ -235,7 +235,7 @@ static struct v4l2_queryctrl controls[] = {
.default_value = 0,
},
 };
-#define NUM_CONTROLS (sizeof(controls)/sizeof(controls[0]))
+#define NUM_CONTROLS (ARRAY_SIZE(controls))
 
 
 /**
diff --git a/drivers/media/video/ov7670.c b/drivers/media/video/ov7670.c
index 3ceb8a6..f8f21dd 100644
--- a/drivers/media/video/ov7670.c
+++ b/drivers/media/video/ov7670.c
@@ -617,7 +617,7 @@ static struct ov7670_win_size {
},
 };
 
-#define N_WIN_SIZES (sizeof(ov7670_win_sizes)/sizeof(ov7670_win_sizes[0]))
+#define N_WIN_SIZES (ARRAY_SIZE(ov7670_win_sizes))
 
 
 /*
@@ -1183,7 +1183,7 @@ static struct ov7670_control {
.query = ov7670_q_hflip,
},
 };
-#define N_CONTROLS (sizeof(ov7670_controls)/sizeof(ov7670_controls[0]))
+#define N_CONTROLS (ARRAY_SIZE(ov7670_controls))
 
 static struct ov7670_control *ov7670_find_control(__u32 id)
 {
diff --git a/drivers/media/video/tveeprom.c b/drivers/media/video/tveeprom.c
index a1136da..5203683 100644
--- a/drivers/media/video/tveeprom.c
+++ b/drivers/media/video/tveeprom.c
@@ -490,7 +490,7 @@ void tveeprom_hauppauge_analog(struct i2c_client *c, struct 
tveeprom *tvee,
to indicate 4052 mux was removed in favor of using MSP
inputs directly. */
audioic = eeprom_data[i+2]  0x7f;
-   if (audioic  sizeof(audioIC)/sizeof(*audioIC))
+   if (audioic  ARRAY_SIZE(audioIC))
tvee-audio_processor = audioIC[audioic].id;
else
tvee-audio_processor = AUDIO_CHIP_UNKNOWN;
@@ -523,7 +523,7 @@ void tveeprom_hauppauge_analog(struct i2c_client *c, struct 
tveeprom *tvee,
to indicate 4052 mux was removed in favor of using MSP
 

V4L/DVB (5742): Tuner: define release callback for mt20xx, tda9887 and tda8290

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=024cf53089f7c8e58934407f07ca2a7b5bed3b06
Commit: 024cf53089f7c8e58934407f07ca2a7b5bed3b06
Parent: be2b85a13543bbaf1a141b3a54f84c1e3b059e69
Author: Michael Krufky [EMAIL PROTECTED]
AuthorDate: Mon Jun 4 15:20:11 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:23:55 2007 -0300

V4L/DVB (5742): Tuner: define release callback for mt20xx, tda9887 and 
tda8290

Define tuner release callbacks for mt20xx, tda9887 and tda8290, so that
these drivers can release their own private structures themselves.

Signed-off-by: Michael Krufky [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/video/mt20xx.c  |9 +
 drivers/media/video/tda8290.c |9 +
 drivers/media/video/tda9887.c |9 +
 3 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/drivers/media/video/mt20xx.c b/drivers/media/video/mt20xx.c
index d7e68a6..5b33be8 100644
--- a/drivers/media/video/mt20xx.c
+++ b/drivers/media/video/mt20xx.c
@@ -495,6 +495,14 @@ static int mt2050_init(struct i2c_client *c)
return 0;
 }
 
+static void microtune_release(struct i2c_client *c)
+{
+   struct tuner *t = i2c_get_clientdata(c);
+
+   kfree(t-priv);
+   t-priv = NULL;
+}
+
 int microtune_init(struct i2c_client *c)
 {
struct microtune_priv *priv = NULL;
@@ -514,6 +522,7 @@ int microtune_init(struct i2c_client *c)
t-set_tv_freq= NULL;
t-set_radio_freq = NULL;
t-standby= NULL;
+   t-release= microtune_release;
if (t-std  V4L2_STD_525_60) {
tuner_dbg(pinnacle ntsc\n);
priv-radio_if2 = 41300 * 1000;
diff --git a/drivers/media/video/tda8290.c b/drivers/media/video/tda8290.c
index 7bdf968..2614ea9 100644
--- a/drivers/media/video/tda8290.c
+++ b/drivers/media/video/tda8290.c
@@ -595,6 +595,14 @@ static void tda8290_init_tuner(struct i2c_client *c)
 
 /*-*/
 
+static void tda8290_release(struct i2c_client *c)
+{
+   struct tuner *t = i2c_get_clientdata(c);
+
+   kfree(t-priv);
+   t-priv = NULL;
+}
+
 int tda8290_init(struct i2c_client *c)
 {
struct tda8290_priv *priv = NULL;
@@ -663,6 +671,7 @@ int tda8290_init(struct i2c_client *c)
t-set_radio_freq = set_radio_freq;
t-has_signal = has_signal;
t-standby = standby;
+   t-release = tda8290_release;
priv-tda827x_lpsel = 0;
t-mode = V4L2_TUNER_ANALOG_TV;
 
diff --git a/drivers/media/video/tda9887.c b/drivers/media/video/tda9887.c
index 01f18b0..f0443cc 100644
--- a/drivers/media/video/tda9887.c
+++ b/drivers/media/video/tda9887.c
@@ -591,6 +591,14 @@ static void tda9887_set_freq(struct i2c_client *client, 
unsigned int freq)
tda9887_configure(client);
 }
 
+static void tda9887_release(struct i2c_client *c)
+{
+   struct tuner *t = i2c_get_clientdata(c);
+
+   kfree(t-priv);
+   t-priv = NULL;
+}
+
 int tda9887_tuner_init(struct i2c_client *c)
 {
struct tda9887_priv *priv = NULL;
@@ -611,6 +619,7 @@ int tda9887_tuner_init(struct i2c_client *c)
t-standby = tda9887_standby;
t-tuner_status = tda9887_tuner_status;
t-get_afc = tda9887_get_afc;
+   t-release = tda9887_release;
 
return 0;
 }
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


V4L/DVB (5743): Tuner: clean up kfree() after release

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=052c50d91642f10e10c3c10837c89a7355881e76
Commit: 052c50d91642f10e10c3c10837c89a7355881e76
Parent: 024cf53089f7c8e58934407f07ca2a7b5bed3b06
Author: Michael Krufky [EMAIL PROTECTED]
AuthorDate: Mon Jun 4 16:00:45 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:23:56 2007 -0300

V4L/DVB (5743): Tuner: clean up kfree() after release

Although it is safe to kfree(NULL), We only need to kfree(priv)
if the release callback is undefined.  As it stands now, there
is some redundancy in the operation of releasing the priv data
structures. This patch will call kfree(priv) and set priv to NULL,
if the release callback isnt defined.  Otherwise, let the release
callback handle this itself.
Thanks to Mauro Carvalho Chehab for suggesting this.

Signed-off-by: Michael Krufky [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/video/tuner-core.c |   10 +++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c
index 0e71a22..acbffbf 100644
--- a/drivers/media/video/tuner-core.c
+++ b/drivers/media/video/tuner-core.c
@@ -180,8 +180,10 @@ static void set_type(struct i2c_client *c, unsigned int 
type,
/* discard private data, in case set_type() was previously called */
if (t-release)
t-release(c);
-   kfree(t-priv);
-   t-priv = NULL;
+   else {
+   kfree(t-priv);
+   t-priv = NULL;
+   }
 
switch (t-type) {
case TUNER_MT2032:
@@ -566,7 +568,9 @@ static int tuner_detach(struct i2c_client *client)
 
if (t-release)
t-release(client);
-   kfree(t-priv);
+   else {
+   kfree(t-priv);
+   }
kfree(t);
return 0;
 }
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


V4L/DVB (5745): Dvb: use '+=' instead of '=' for EXTRA_CFLAGS

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f3a0d86f1dc60c3ae13ccde188c533e58e7e3197
Commit: f3a0d86f1dc60c3ae13ccde188c533e58e7e3197
Parent: 052c50d91642f10e10c3c10837c89a7355881e76
Author: Trent Piepho [EMAIL PROTECTED]
AuthorDate: Mon Jun 4 20:18:51 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:23:56 2007 -0300

V4L/DVB (5745): Dvb: use '+=' instead of '=' for EXTRA_CFLAGS

The Makefiles in the dvb directory tree used '=' when defining EXTRA_CFLAGS
rather than '+=', which is far more common in the rest of the kernel source.
  =  14 times (9 of which this patch removes)
 :=  25 times
 += 123 times
This change also has certain advantages for the out of kernel v4l-dvb build
system.

Signed-off-by: Trent Piepho [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/dvb/b2c2/Makefile |2 +-
 drivers/media/dvb/bt8xx/Makefile|2 +-
 drivers/media/dvb/cinergyT2/Makefile|2 +-
 drivers/media/dvb/dvb-usb/Makefile  |2 +-
 drivers/media/dvb/frontends/Makefile|2 +-
 drivers/media/dvb/pluto2/Makefile   |2 +-
 drivers/media/dvb/ttpci/Makefile|2 +-
 drivers/media/dvb/ttusb-budget/Makefile |2 +-
 drivers/media/dvb/ttusb-dec/Makefile|2 +-
 9 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/media/dvb/b2c2/Makefile b/drivers/media/dvb/b2c2/Makefile
index bff00b5..e97ff60 100644
--- a/drivers/media/dvb/b2c2/Makefile
+++ b/drivers/media/dvb/b2c2/Makefile
@@ -12,4 +12,4 @@ obj-$(CONFIG_DVB_B2C2_FLEXCOP_PCI) += b2c2-flexcop-pci.o
 b2c2-flexcop-usb-objs = flexcop-usb.o
 obj-$(CONFIG_DVB_B2C2_FLEXCOP_USB) += b2c2-flexcop-usb.o
 
-EXTRA_CFLAGS = -Idrivers/media/dvb/dvb-core/ -Idrivers/media/dvb/frontends/
+EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core/ -Idrivers/media/dvb/frontends/
diff --git a/drivers/media/dvb/bt8xx/Makefile b/drivers/media/dvb/bt8xx/Makefile
index 9d197ef..84cf705 100644
--- a/drivers/media/dvb/bt8xx/Makefile
+++ b/drivers/media/dvb/bt8xx/Makefile
@@ -1,3 +1,3 @@
 obj-$(CONFIG_DVB_BT8XX) += bt878.o dvb-bt8xx.o dst.o dst_ca.o
 
-EXTRA_CFLAGS = -Idrivers/media/dvb/dvb-core/ -Idrivers/media/video/bt8xx 
-Idrivers/media/dvb/frontends
+EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core/ -Idrivers/media/video/bt8xx 
-Idrivers/media/dvb/frontends
diff --git a/drivers/media/dvb/cinergyT2/Makefile 
b/drivers/media/dvb/cinergyT2/Makefile
index c51aece..d762d8c 100644
--- a/drivers/media/dvb/cinergyT2/Makefile
+++ b/drivers/media/dvb/cinergyT2/Makefile
@@ -1,3 +1,3 @@
 obj-$(CONFIG_DVB_CINERGYT2) += cinergyT2.o
 
-EXTRA_CFLAGS = -Idrivers/media/dvb/dvb-core/
+EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core/
diff --git a/drivers/media/dvb/dvb-usb/Makefile 
b/drivers/media/dvb/dvb-usb/Makefile
index 6e0a9c0..73ac0a9 100644
--- a/drivers/media/dvb/dvb-usb/Makefile
+++ b/drivers/media/dvb/dvb-usb/Makefile
@@ -61,4 +61,4 @@ obj-$(CONFIG_DVB_USB_AF9005) += dvb-usb-af9005.o
 dvb-usb-af9005-remote-objs = af9005-remote.o
 obj-$(CONFIG_DVB_USB_AF9005_REMOTE) += dvb-usb-af9005-remote.o
 
-EXTRA_CFLAGS = -Idrivers/media/dvb/dvb-core/ -Idrivers/media/dvb/frontends/
+EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core/ -Idrivers/media/dvb/frontends/
diff --git a/drivers/media/dvb/frontends/Makefile 
b/drivers/media/dvb/frontends/Makefile
index 27f3865..156b062 100644
--- a/drivers/media/dvb/frontends/Makefile
+++ b/drivers/media/dvb/frontends/Makefile
@@ -2,7 +2,7 @@
 # Makefile for the kernel DVB frontend device drivers.
 #
 
-EXTRA_CFLAGS = -Idrivers/media/dvb/dvb-core/
+EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core/
 
 obj-$(CONFIG_DVB_PLL) += dvb-pll.o
 obj-$(CONFIG_DVB_STV0299) += stv0299.o
diff --git a/drivers/media/dvb/pluto2/Makefile 
b/drivers/media/dvb/pluto2/Makefile
index ce6a9aa..7ac1287 100644
--- a/drivers/media/dvb/pluto2/Makefile
+++ b/drivers/media/dvb/pluto2/Makefile
@@ -1,3 +1,3 @@
 obj-$(CONFIG_DVB_PLUTO2) += pluto2.o
 
-EXTRA_CFLAGS = -Idrivers/media/dvb/dvb-core/ -Idrivers/media/dvb/frontends/
+EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core/ -Idrivers/media/dvb/frontends/
diff --git a/drivers/media/dvb/ttpci/Makefile b/drivers/media/dvb/ttpci/Makefile
index aa85ecd..2c11452 100644
--- a/drivers/media/dvb/ttpci/Makefile
+++ b/drivers/media/dvb/ttpci/Makefile
@@ -11,7 +11,7 @@ obj-$(CONFIG_DVB_BUDGET_CI) += budget-core.o budget-ci.o 
ttpci-eeprom.o
 obj-$(CONFIG_DVB_BUDGET_PATCH) += budget-core.o budget-patch.o ttpci-eeprom.o
 obj-$(CONFIG_DVB_AV7110) += dvb-ttpci.o ttpci-eeprom.o
 
-EXTRA_CFLAGS = -Idrivers/media/dvb/dvb-core/ -Idrivers/media/dvb/frontends/
+EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core/ -Idrivers/media/dvb/frontends/
 
 hostprogs-y:= fdump
 
diff --git a/drivers/media/dvb/ttusb-budget/Makefile 
b/drivers/media/dvb/ttusb-budget/Makefile
index 6ab97f6..fbe2b95 100644
--- a/drivers/media/dvb/ttusb-budget/Makefile
+++ 

V4L/DVB (5747): Tea5761: remove duplicated #include media/tuner.h

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b7c97abd8171709cc35d8aab70b9962fcad9f9fa
Commit: b7c97abd8171709cc35d8aab70b9962fcad9f9fa
Parent: f3a0d86f1dc60c3ae13ccde188c533e58e7e3197
Author: Michael Krufky [EMAIL PROTECTED]
AuthorDate: Wed Jun 6 15:28:10 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:23:57 2007 -0300

V4L/DVB (5747): Tea5761: remove duplicated #include media/tuner.h

The line, #include media/tuner.h appears twice.
This patch removes the second occurance.

Signed-off-by: Michael Krufky [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/video/tea5761.c |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/media/video/tea5761.c b/drivers/media/video/tea5761.c
index 4d2d3ef..1479f16 100644
--- a/drivers/media/video/tea5761.c
+++ b/drivers/media/video/tea5761.c
@@ -11,7 +11,6 @@
 #include linux/videodev.h
 #include linux/delay.h
 #include media/tuner.h
-#include media/tuner.h
 
 #define PREFIX TEA5761 
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


V4L/DVB (5750): Remove obsoleted support for PROC_FS on vicam.c

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=018ec5440b4994f560cdde78be6fb10d7ab370d7
Commit: 018ec5440b4994f560cdde78be6fb10d7ab370d7
Parent: 890be2bb55774290479672b98fcb0486b57e758e
Author: Mauro Carvalho Chehab [EMAIL PROTECTED]
AuthorDate: Thu Jun 7 08:26:37 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:23:59 2007 -0300

V4L/DVB (5750): Remove obsoleted support for PROC_FS on vicam.c

Procfs support on V4L were converted to sysfs support by a pre-2.6 patch:

http://www.ussg.iu.edu/hypermail/linux/kernel/0307.1/2356.html

There's no sense on keeping the dead code inside vicam.c. Also,it won't
work anyway, as part of proc_fs support were previously inside
videodev.c.

Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/video/usbvideo/vicam.c |  181 --
 1 files changed, 0 insertions(+), 181 deletions(-)

diff --git a/drivers/media/video/usbvideo/vicam.c 
b/drivers/media/video/usbvideo/vicam.c
index 982b115..2d9c0dd 100644
--- a/drivers/media/video/usbvideo/vicam.c
+++ b/drivers/media/video/usbvideo/vicam.c
@@ -42,7 +42,6 @@
 #include linux/usb.h
 #include linux/vmalloc.h
 #include linux/slab.h
-#include linux/proc_fs.h
 #include linux/mutex.h
 #include usbvideo.h
 
@@ -417,11 +416,6 @@ struct vicam_camera {
u8 open_count;
u8 bulkEndpoint;
int needsDummyRead;
-
-#if defined(CONFIG_VIDEO_PROC_FS)
-   struct proc_dir_entry *proc_dir;
-#endif
-
 };
 
 static int vicam_probe( struct usb_interface *intf, const struct usb_device_id 
*id);
@@ -1065,175 +1059,6 @@ vicam_mmap(struct file *file, struct vm_area_struct 
*vma)
return 0;
 }
 
-#if defined(CONFIG_VIDEO_PROC_FS)
-
-static struct proc_dir_entry *vicam_proc_root = NULL;
-
-static int vicam_read_helper(char *page, char **start, off_t off,
-   int count, int *eof, int value)
-{
-   char *out = page;
-   int len;
-
-   out += sprintf(out, %d,value);
-
-   len = out - page;
-   len -= off;
-   if (len  count) {
-   *eof = 1;
-   if (len = 0)
-   return 0;
-   } else
-   len = count;
-
-   *start = page + off;
-   return len;
-}
-
-static int vicam_read_proc_shutter(char *page, char **start, off_t off,
-   int count, int *eof, void *data)
-{
-   return vicam_read_helper(page,start,off,count,eof,
-   ((struct vicam_camera *)data)-shutter_speed);
-}
-
-static int vicam_read_proc_gain(char *page, char **start, off_t off,
-   int count, int *eof, void *data)
-{
-   return vicam_read_helper(page,start,off,count,eof,
-   ((struct vicam_camera *)data)-gain);
-}
-
-static int
-vicam_write_proc_shutter(struct file *file, const char *buffer,
-unsigned long count, void *data)
-{
-   u16 stmp;
-   char kbuf[8];
-   struct vicam_camera *cam = (struct vicam_camera *) data;
-
-   if (count  6)
-   return -EINVAL;
-
-   if (copy_from_user(kbuf, buffer, count))
-   return -EFAULT;
-
-   stmp = (u16) simple_strtoul(kbuf, NULL, 10);
-   if (stmp  4 || stmp  32000)
-   return -EINVAL;
-
-   cam-shutter_speed = stmp;
-
-   return count;
-}
-
-static int
-vicam_write_proc_gain(struct file *file, const char *buffer,
- unsigned long count, void *data)
-{
-   u16 gtmp;
-   char kbuf[8];
-
-   struct vicam_camera *cam = (struct vicam_camera *) data;
-
-   if (count  4)
-   return -EINVAL;
-
-   if (copy_from_user(kbuf, buffer, count))
-   return -EFAULT;
-
-   gtmp = (u16) simple_strtoul(kbuf, NULL, 10);
-   if (gtmp  255)
-   return -EINVAL;
-   cam-gain = gtmp;
-
-   return count;
-}
-
-static void
-vicam_create_proc_root(void)
-{
-   vicam_proc_root = proc_mkdir(video/vicam, NULL);
-
-   if (vicam_proc_root)
-   vicam_proc_root-owner = THIS_MODULE;
-   else
-   printk(KERN_ERR
-  could not create /proc entry for vicam!);
-}
-
-static void
-vicam_destroy_proc_root(void)
-{
-   if (vicam_proc_root)
-   remove_proc_entry(video/vicam, 0);
-}
-
-static void
-vicam_create_proc_entry(struct vicam_camera *cam)
-{
-   char name[64];
-   struct proc_dir_entry *ent;
-
-   DBG(KERN_INFO vicam: creating proc entry\n);
-
-   if (!vicam_proc_root || !cam) {
-   printk(KERN_INFO
-  vicam: could not create proc entry, %s pointer is 
null.\n,
-  (!cam ? camera : root));
-   return;
-   }
-
-   sprintf(name, video%d, cam-vdev.minor);
-
-   cam-proc_dir = proc_mkdir(name, 

V4L/DVB (5753): Tuner: create struct tuner_operations

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7a91a80a0d1a0a83a94e773ec6245b31b7c4ceed
Commit: 7a91a80a0d1a0a83a94e773ec6245b31b7c4ceed
Parent: 018ec5440b4994f560cdde78be6fb10d7ab370d7
Author: Michael Krufky [EMAIL PROTECTED]
AuthorDate: Wed Jun 6 16:10:39 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:24:02 2007 -0300

V4L/DVB (5753): Tuner: create struct tuner_operations

Move tuner callback function pointers out of struct tuner, into
struct tuner_operations.

Signed-off-by: Michael Krufky [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/video/mt20xx.c   |   16 +-
 drivers/media/video/tda8290.c  |   10 +++---
 drivers/media/video/tda9887.c  |   12 +++---
 drivers/media/video/tea5761.c  |8 ++--
 drivers/media/video/tea5767.c  |   10 +++---
 drivers/media/video/tuner-core.c   |   62 ++--
 drivers/media/video/tuner-simple.c |   10 +++---
 include/media/tuner.h  |   21 +++-
 8 files changed, 76 insertions(+), 73 deletions(-)

diff --git a/drivers/media/video/mt20xx.c b/drivers/media/video/mt20xx.c
index 5b33be8..846c623 100644
--- a/drivers/media/video/mt20xx.c
+++ b/drivers/media/video/mt20xx.c
@@ -361,8 +361,8 @@ static int mt2032_init(struct i2c_client *c)
} while (xok != 1 );
priv-xogc=xogc;
 
-   t-set_tv_freq= mt2032_set_tv_freq;
-   t-set_radio_freq = mt2032_set_radio_freq;
+   t-ops.set_tv_freq= mt2032_set_tv_freq;
+   t-ops.set_radio_freq = mt2032_set_radio_freq;
return(1);
 }
 
@@ -490,8 +490,8 @@ static int mt2050_init(struct i2c_client *c)
i2c_master_recv(c,buf,1);
 
tuner_dbg(mt2050: sro is %x\n,buf[0]);
-   t-set_tv_freq= mt2050_set_tv_freq;
-   t-set_radio_freq = mt2050_set_radio_freq;
+   t-ops.set_tv_freq= mt2050_set_tv_freq;
+   t-ops.set_radio_freq = mt2050_set_radio_freq;
return 0;
 }
 
@@ -519,10 +519,10 @@ int microtune_init(struct i2c_client *c)
priv-radio_if2 = 10700 * 1000; /* 10.7MHz - FM radio */
 
memset(buf,0,sizeof(buf));
-   t-set_tv_freq= NULL;
-   t-set_radio_freq = NULL;
-   t-standby= NULL;
-   t-release= microtune_release;
+   t-ops.set_tv_freq= NULL;
+   t-ops.set_radio_freq = NULL;
+   t-ops.standby= NULL;
+   t-ops.release= microtune_release;
if (t-std  V4L2_STD_525_60) {
tuner_dbg(pinnacle ntsc\n);
priv-radio_if2 = 41300 * 1000;
diff --git a/drivers/media/video/tda8290.c b/drivers/media/video/tda8290.c
index 2614ea9..99122ff 100644
--- a/drivers/media/video/tda8290.c
+++ b/drivers/media/video/tda8290.c
@@ -667,11 +667,11 @@ int tda8290_init(struct i2c_client *c)
}
tuner_info(type set to %s\n, c-name);
 
-   t-set_tv_freq= set_tv_freq;
-   t-set_radio_freq = set_radio_freq;
-   t-has_signal = has_signal;
-   t-standby = standby;
-   t-release = tda8290_release;
+   t-ops.set_tv_freq= set_tv_freq;
+   t-ops.set_radio_freq = set_radio_freq;
+   t-ops.has_signal = has_signal;
+   t-ops.standby = standby;
+   t-ops.release = tda8290_release;
priv-tda827x_lpsel = 0;
t-mode = V4L2_TUNER_ANALOG_TV;
 
diff --git a/drivers/media/video/tda9887.c b/drivers/media/video/tda9887.c
index f0443cc..5bb7d19 100644
--- a/drivers/media/video/tda9887.c
+++ b/drivers/media/video/tda9887.c
@@ -614,12 +614,12 @@ int tda9887_tuner_init(struct i2c_client *c)
tda9887_info(tda988[5/6/7] found @ 0x%x (%s)\n, t-i2c.addr,
t-i2c.driver-driver.name);
 
-   t-set_tv_freq = tda9887_set_freq;
-   t-set_radio_freq = tda9887_set_freq;
-   t-standby = tda9887_standby;
-   t-tuner_status = tda9887_tuner_status;
-   t-get_afc = tda9887_get_afc;
-   t-release = tda9887_release;
+   t-ops.set_tv_freq = tda9887_set_freq;
+   t-ops.set_radio_freq = tda9887_set_freq;
+   t-ops.standby = tda9887_standby;
+   t-ops.tuner_status = tda9887_tuner_status;
+   t-ops.get_afc = tda9887_get_afc;
+   t-ops.release = tda9887_release;
 
return 0;
 }
diff --git a/drivers/media/video/tea5761.c b/drivers/media/video/tea5761.c
index 1479f16..858f2d1 100644
--- a/drivers/media/video/tea5761.c
+++ b/drivers/media/video/tea5761.c
@@ -229,10 +229,10 @@ int tea5761_tuner_init(struct i2c_client *c)
tuner_info(type set to %d (%s)\n, t-type, Philips TEA5761HN FM 
Radio);
strlcpy(c-name, tea5761, sizeof(c-name));
 
-   t-set_tv_freq = set_tv_freq;
-   t-set_radio_freq = set_radio_freq;
-   t-has_signal = tea5761_signal;
-   t-is_stereo = tea5761_stereo;
+   t-ops.set_tv_freq = set_tv_freq;
+   t-ops.set_radio_freq = set_radio_freq;
+   

V4L/DVB (5754): Mt20xx: store tuning operations in tuner_operations structure

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c22bcb07ad4555fe7ac4ce724c8ad1de889f9477
Commit: c22bcb07ad4555fe7ac4ce724c8ad1de889f9477
Parent: 7a91a80a0d1a0a83a94e773ec6245b31b7c4ceed
Author: Michael Krufky [EMAIL PROTECTED]
AuthorDate: Wed Jun 6 16:14:18 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:24:03 2007 -0300

V4L/DVB (5754): Mt20xx: store tuning operations in tuner_operations 
structure

Create static struct tuner_operations mt2050_tuner_ops and mt2032_tuner_ops
for mt20xx tuning function callback pointers

Signed-off-by: Michael Krufky [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/video/mt20xx.c |   40 +---
 1 files changed, 25 insertions(+), 15 deletions(-)

diff --git a/drivers/media/video/mt20xx.c b/drivers/media/video/mt20xx.c
index 846c623..8a838bd 100644
--- a/drivers/media/video/mt20xx.c
+++ b/drivers/media/video/mt20xx.c
@@ -42,6 +42,14 @@ struct microtune_priv {
unsigned int radio_if2;
 };
 
+static void microtune_release(struct i2c_client *c)
+{
+   struct tuner *t = i2c_get_clientdata(c);
+
+   kfree(t-priv);
+   t-priv = NULL;
+}
+
 // IsSpurInBand()?
 static int mt2032_spurcheck(struct i2c_client *c,
int f1, int f2, int spectrum_from,int spectrum_to)
@@ -308,6 +316,12 @@ static void mt2032_set_radio_freq(struct i2c_client *c, 
unsigned int freq)
  1085*1000*1000,if2,if2,if2);
 }
 
+static struct tuner_operations mt2032_tuner_ops = {
+   .set_tv_freq= mt2032_set_tv_freq,
+   .set_radio_freq = mt2032_set_radio_freq,
+   .release= microtune_release,
+};
+
 // Initalization as described in MT203x Programming Procedures, Rev 1.2, 
Feb.2001
 static int mt2032_init(struct i2c_client *c)
 {
@@ -361,8 +375,8 @@ static int mt2032_init(struct i2c_client *c)
} while (xok != 1 );
priv-xogc=xogc;
 
-   t-ops.set_tv_freq= mt2032_set_tv_freq;
-   t-ops.set_radio_freq = mt2032_set_radio_freq;
+   memcpy(t-ops, mt2032_tuner_ops, sizeof(struct tuner_operations));
+
return(1);
 }
 
@@ -471,6 +485,12 @@ static void mt2050_set_radio_freq(struct i2c_client *c, 
unsigned int freq)
mt2050_set_antenna(c, radio_antenna);
 }
 
+static struct tuner_operations mt2050_tuner_ops = {
+   .set_tv_freq= mt2050_set_tv_freq,
+   .set_radio_freq = mt2050_set_radio_freq,
+   .release= microtune_release,
+};
+
 static int mt2050_init(struct i2c_client *c)
 {
struct tuner *t = i2c_get_clientdata(c);
@@ -490,17 +510,10 @@ static int mt2050_init(struct i2c_client *c)
i2c_master_recv(c,buf,1);
 
tuner_dbg(mt2050: sro is %x\n,buf[0]);
-   t-ops.set_tv_freq= mt2050_set_tv_freq;
-   t-ops.set_radio_freq = mt2050_set_radio_freq;
-   return 0;
-}
 
-static void microtune_release(struct i2c_client *c)
-{
-   struct tuner *t = i2c_get_clientdata(c);
+   memcpy(t-ops, mt2050_tuner_ops, sizeof(struct tuner_operations));
 
-   kfree(t-priv);
-   t-priv = NULL;
+   return 0;
 }
 
 int microtune_init(struct i2c_client *c)
@@ -519,10 +532,7 @@ int microtune_init(struct i2c_client *c)
priv-radio_if2 = 10700 * 1000; /* 10.7MHz - FM radio */
 
memset(buf,0,sizeof(buf));
-   t-ops.set_tv_freq= NULL;
-   t-ops.set_radio_freq = NULL;
-   t-ops.standby= NULL;
-   t-ops.release= microtune_release;
+
if (t-std  V4L2_STD_525_60) {
tuner_dbg(pinnacle ntsc\n);
priv-radio_if2 = 41300 * 1000;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


V4L/DVB (5756): Tda9887: store tuning operations in tuner_operations structure

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9af596ebc7ad3afb0df520b4becad915dd5a5584
Commit: 9af596ebc7ad3afb0df520b4becad915dd5a5584
Parent: 7fd8b263678ab8430b49c99976ade681f8a78439
Author: Michael Krufky [EMAIL PROTECTED]
AuthorDate: Wed Jun 6 16:15:48 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:24:04 2007 -0300

V4L/DVB (5756): Tda9887: store tuning operations in tuner_operations 
structure

Create static struct tuner_operations tda9887_tuner_ops
for tda9887 tuning function callback pointers

Signed-off-by: Michael Krufky [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/video/tda9887.c |   16 ++--
 1 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/drivers/media/video/tda9887.c b/drivers/media/video/tda9887.c
index 5bb7d19..caca109 100644
--- a/drivers/media/video/tda9887.c
+++ b/drivers/media/video/tda9887.c
@@ -599,6 +599,15 @@ static void tda9887_release(struct i2c_client *c)
t-priv = NULL;
 }
 
+static struct tuner_operations tda9887_tuner_ops = {
+   .set_tv_freq= tda9887_set_freq,
+   .set_radio_freq = tda9887_set_freq,
+   .standby= tda9887_standby,
+   .tuner_status   = tda9887_tuner_status,
+   .get_afc= tda9887_get_afc,
+   .release= tda9887_release,
+};
+
 int tda9887_tuner_init(struct i2c_client *c)
 {
struct tda9887_priv *priv = NULL;
@@ -614,12 +623,7 @@ int tda9887_tuner_init(struct i2c_client *c)
tda9887_info(tda988[5/6/7] found @ 0x%x (%s)\n, t-i2c.addr,
t-i2c.driver-driver.name);
 
-   t-ops.set_tv_freq = tda9887_set_freq;
-   t-ops.set_radio_freq = tda9887_set_freq;
-   t-ops.standby = tda9887_standby;
-   t-ops.tuner_status = tda9887_tuner_status;
-   t-ops.get_afc = tda9887_get_afc;
-   t-ops.release = tda9887_release;
+   memcpy(t-ops, tda9887_tuner_ops, sizeof(struct tuner_operations));
 
return 0;
 }
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


V4L/DVB (5757): Tea5761: store tuning operations in tuner_operations structure

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e407cd54eecc955b2658106403a294612bf4ed66
Commit: e407cd54eecc955b2658106403a294612bf4ed66
Parent: 9af596ebc7ad3afb0df520b4becad915dd5a5584
Author: Michael Krufky [EMAIL PROTECTED]
AuthorDate: Wed Jun 6 16:16:29 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:24:05 2007 -0300

V4L/DVB (5757): Tea5761: store tuning operations in tuner_operations 
structure

Create static struct tuner_operations tea5761_tuner_ops
for tea5761 tuning function callback pointers

Signed-off-by: Michael Krufky [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/video/tea5761.c |   12 
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/media/video/tea5761.c b/drivers/media/video/tea5761.c
index 858f2d1..2fcb81d 100644
--- a/drivers/media/video/tea5761.c
+++ b/drivers/media/video/tea5761.c
@@ -219,6 +219,13 @@ int tea5761_autodetection(struct i2c_client *c)
return 0;
 }
 
+static struct tuner_operations tea5761_tuner_ops = {
+   .set_tv_freq= set_tv_freq,
+   .set_radio_freq = set_radio_freq,
+   .has_signal = tea5761_signal,
+   .is_stereo  = tea5761_stereo,
+};
+
 int tea5761_tuner_init(struct i2c_client *c)
 {
struct tuner *t = i2c_get_clientdata(c);
@@ -229,10 +236,7 @@ int tea5761_tuner_init(struct i2c_client *c)
tuner_info(type set to %d (%s)\n, t-type, Philips TEA5761HN FM 
Radio);
strlcpy(c-name, tea5761, sizeof(c-name));
 
-   t-ops.set_tv_freq = set_tv_freq;
-   t-ops.set_radio_freq = set_radio_freq;
-   t-ops.has_signal = tea5761_signal;
-   t-ops.is_stereo = tea5761_stereo;
+   memcpy(t-ops, tea5761_tuner_ops, sizeof(struct tuner_operations));
 
return (0);
 }
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


V4L/DVB (5758): Tea5767: store tuning operations in tuner_operations structure

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0f838f8d02415a25358850cc32d36cd72c2a798b
Commit: 0f838f8d02415a25358850cc32d36cd72c2a798b
Parent: e407cd54eecc955b2658106403a294612bf4ed66
Author: Michael Krufky [EMAIL PROTECTED]
AuthorDate: Wed Jun 6 16:17:17 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:24:05 2007 -0300

V4L/DVB (5758): Tea5767: store tuning operations in tuner_operations 
structure

Create static struct tuner_operations tea5767_tuner_ops for tea5767
tuning function callback pointers

Signed-off-by: Michael Krufky [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/video/tea5767.c |   14 +-
 1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/media/video/tea5767.c b/drivers/media/video/tea5767.c
index c551042..9cce9be 100644
--- a/drivers/media/video/tea5767.c
+++ b/drivers/media/video/tea5767.c
@@ -343,6 +343,14 @@ int tea5767_autodetection(struct i2c_client *c)
return 0;
 }
 
+static struct tuner_operations tea5767_tuner_ops = {
+   .set_tv_freq= set_tv_freq,
+   .set_radio_freq = set_radio_freq,
+   .has_signal = tea5767_signal,
+   .is_stereo  = tea5767_stereo,
+   .standby= tea5767_standby,
+};
+
 int tea5767_tuner_init(struct i2c_client *c)
 {
struct tuner *t = i2c_get_clientdata(c);
@@ -350,11 +358,7 @@ int tea5767_tuner_init(struct i2c_client *c)
tuner_info(type set to %d (%s)\n, t-type, Philips TEA5767HN FM 
Radio);
strlcpy(c-name, tea5767, sizeof(c-name));
 
-   t-ops.set_tv_freq = set_tv_freq;
-   t-ops.set_radio_freq = set_radio_freq;
-   t-ops.has_signal = tea5767_signal;
-   t-ops.is_stereo = tea5767_stereo;
-   t-ops.standby = tea5767_standby;
+   memcpy(t-ops, tea5767_tuner_ops, sizeof(struct tuner_operations));
 
return (0);
 }
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


V4L/DVB (5759): Tuner-simple: store tuning operations in tuner_operations struct

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5d807c9fc3fe8a88f1bb95a54da11cebed1612a6
Commit: 5d807c9fc3fe8a88f1bb95a54da11cebed1612a6
Parent: 0f838f8d02415a25358850cc32d36cd72c2a798b
Author: Michael Krufky [EMAIL PROTECTED]
AuthorDate: Wed Jun 6 16:17:57 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:24:06 2007 -0300

V4L/DVB (5759): Tuner-simple: store tuning operations in tuner_operations 
struct

Create static struct tuner_operations simple_tuner_ops
for tuner-simple tuning function callback pointers

Signed-off-by: Michael Krufky [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/video/tuner-simple.c |   13 -
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/media/video/tuner-simple.c 
b/drivers/media/video/tuner-simple.c
index fb4addb..fd23c1d 100644
--- a/drivers/media/video/tuner-simple.c
+++ b/drivers/media/video/tuner-simple.c
@@ -479,6 +479,13 @@ static void default_set_radio_freq(struct i2c_client *c, 
unsigned int freq)
tuner_warn(i2c i/o error: rc == %d (should be 4)\n,rc);
 }
 
+static struct tuner_operations simple_tuner_ops = {
+   .set_tv_freq= default_set_tv_freq,
+   .set_radio_freq = default_set_radio_freq,
+   .has_signal = tuner_signal,
+   .is_stereo  = tuner_stereo,
+};
+
 int default_tuner_init(struct i2c_client *c)
 {
struct tuner *t = i2c_get_clientdata(c);
@@ -487,11 +494,7 @@ int default_tuner_init(struct i2c_client *c)
   t-type, tuners[t-type].name);
strlcpy(c-name, tuners[t-type].name, sizeof(c-name));
 
-   t-ops.set_tv_freq = default_set_tv_freq;
-   t-ops.set_radio_freq = default_set_radio_freq;
-   t-ops.has_signal = tuner_signal;
-   t-ops.is_stereo = tuner_stereo;
-   t-ops.standby = NULL;
+   memcpy(t-ops, simple_tuner_ops, sizeof(struct tuner_operations));
 
return 0;
 }
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


V4L/DVB (5765): SN9C1xx driver updates

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3770be34199ace8c497ce454cebd7d63347dc4c3
Commit: 3770be34199ace8c497ce454cebd7d63347dc4c3
Parent: a6e2b40cb430e1e3a22fbb56807edebf71bf6188
Author: Luca Risolia [EMAIL PROTECTED]
AuthorDate: Wed Jun 13 14:37:50 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:24:07 2007 -0300

V4L/DVB (5765): SN9C1xx driver updates

- Add support for pair OV7630+SN9C120
- Better and safe locking mechanism of the device structure on open(),
  close() and disconnect()
- Use kref for handling device deallocation
- Generic cleanups

Signed-off-by: Luca Risolia [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 Documentation/video4linux/sn9c102.txt|3 +-
 drivers/media/video/sn9c102/sn9c102.h|9 +-
 drivers/media/video/sn9c102/sn9c102_core.c   |  173 -
 drivers/media/video/sn9c102/sn9c102_ov7630.c |  214 --
 drivers/media/video/sn9c102/sn9c102_ov7660.c |   88 ++--
 5 files changed, 358 insertions(+), 129 deletions(-)

diff --git a/Documentation/video4linux/sn9c102.txt 
b/Documentation/video4linux/sn9c102.txt
index 279717c..1ffad19 100644
--- a/Documentation/video4linux/sn9c102.txt
+++ b/Documentation/video4linux/sn9c102.txt
@@ -436,7 +436,7 @@ HV7131DHynix Semiconductor | Yes No   
No   No
 HV7131RHynix Semiconductor | No  Yes  Yes  Yes
 MI-0343Micron Technology   | Yes No   No   No
 MI-0360Micron Technology   | No  Yes  Yes  Yes
-OV7630 OmniVision Technologies | Yes Yes  No   No
+OV7630 OmniVision Technologies | Yes Yes  Yes  Yes
 OV7660 OmniVision Technologies | No  No   Yes  Yes
 PAS106BPixArt Imaging  | Yes No   No   No
 PAS202BPixArt Imaging  | Yes Yes  No   No
@@ -583,6 +583,7 @@ order):
 - Bertrik Sikken, who reverse-engineered and documented the Huffman compression
   algorithm used in the SN9C101, SN9C102 and SN9C103 controllers and
   implemented the first decoder;
+- Ronny Standke for the donation of a webcam;
 - Mizuno Takafumi for the donation of a webcam;
 - an anonymous donator (who didn't want his name to be revealed) for the
   donation of a webcam.
diff --git a/drivers/media/video/sn9c102/sn9c102.h 
b/drivers/media/video/sn9c102/sn9c102.h
index 11fcb49..2e3c3de 100644
--- a/drivers/media/video/sn9c102/sn9c102.h
+++ b/drivers/media/video/sn9c102/sn9c102.h
@@ -36,6 +36,7 @@
 #include linux/mutex.h
 #include linux/string.h
 #include linux/stddef.h
+#include linux/kref.h
 
 #include sn9c102_config.h
 #include sn9c102_sensor.h
@@ -94,7 +95,7 @@ struct sn9c102_module_param {
 };
 
 static DEFINE_MUTEX(sn9c102_sysfs_lock);
-static DECLARE_RWSEM(sn9c102_disconnect);
+static DECLARE_RWSEM(sn9c102_dev_lock);
 
 struct sn9c102_device {
struct video_device* v4ldev;
@@ -122,12 +123,14 @@ struct sn9c102_device {
 
struct sn9c102_module_param module_param;
 
+   struct kref kref;
enum sn9c102_dev_state state;
u8 users;
 
-   struct mutex dev_mutex, fileop_mutex;
+   struct completion probe;
+   struct mutex open_mutex, fileop_mutex;
spinlock_t queue_lock;
-   wait_queue_head_t open, wait_frame, wait_stream;
+   wait_queue_head_t wait_open, wait_frame, wait_stream;
 };
 
 /*/
diff --git a/drivers/media/video/sn9c102/sn9c102_core.c 
b/drivers/media/video/sn9c102/sn9c102_core.c
index 74a204f..36d8a45 100644
--- a/drivers/media/video/sn9c102/sn9c102_core.c
+++ b/drivers/media/video/sn9c102/sn9c102_core.c
@@ -48,8 +48,8 @@
 #define SN9C102_MODULE_AUTHOR   (C) 2004-2007 Luca Risolia
 #define SN9C102_AUTHOR_EMAIL[EMAIL PROTECTED]
 #define SN9C102_MODULE_LICENSE  GPL
-#define SN9C102_MODULE_VERSION  1:1.44
-#define SN9C102_MODULE_VERSION_CODE  KERNEL_VERSION(1, 1, 44)
+#define SN9C102_MODULE_VERSION  1:1.47
+#define SN9C102_MODULE_VERSION_CODE  KERNEL_VERSION(1, 1, 47)
 
 /*/
 
@@ -64,9 +64,10 @@ MODULE_LICENSE(SN9C102_MODULE_LICENSE);
 static short video_nr[] = {[0 ... SN9C102_MAX_DEVICES-1] = -1};
 module_param_array(video_nr, short, NULL, 0444);
 MODULE_PARM_DESC(video_nr,
-\n-1|n[,...] Specify V4L2 minor mode number.
-\n -1 = use next available (default)
-\n  n = use minor number n (integer = 0)
+ -1|n[,...]
+\nSpecify V4L2 minor mode number.
+\n-1 = use next available (default)
+\n n = use minor number n (integer = 0)
 \nYou can specify up to __MODULE_STRING(SN9C102_MAX_DEVICES)
  

V4L/DVB (5766): ET61x251 driver updates

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3b2ae0be9e246974db65a5bf4ccd2de328f3dede
Commit: 3b2ae0be9e246974db65a5bf4ccd2de328f3dede
Parent: 3770be34199ace8c497ce454cebd7d63347dc4c3
Author: Luca Risolia [EMAIL PROTECTED]
AuthorDate: Wed Jun 13 14:52:01 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:24:08 2007 -0300

V4L/DVB (5766): ET61x251 driver updates

- Make the driver depend on V4L2 only (KConfig)
- Better and safe locking mechanism of the device structure on open(),
  close() and disconnect()
- Use kref for handling device deallocation
- Generic cleanups

Signed-off-by: Luca Risolia [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/video/et61x251/Kconfig   |2 +-
 drivers/media/video/et61x251/et61x251.h|   23 ++-
 drivers/media/video/et61x251/et61x251_core.c   |  189 +++-
 drivers/media/video/et61x251/et61x251_sensor.h |8 +-
 drivers/media/video/et61x251/et61x251_tas5130d1b.c |2 +-
 5 files changed, 120 insertions(+), 104 deletions(-)

diff --git a/drivers/media/video/et61x251/Kconfig 
b/drivers/media/video/et61x251/Kconfig
index 664676f..dcc1a03 100644
--- a/drivers/media/video/et61x251/Kconfig
+++ b/drivers/media/video/et61x251/Kconfig
@@ -1,6 +1,6 @@
 config USB_ET61X251
tristate USB ET61X[12]51 PC Camera Controller support
-   depends on VIDEO_V4L1
+   depends on VIDEO_V4L2
---help---
  Say Y here if you want support for cameras based on Etoms ET61X151
  or ET61X251 PC Camera Controllers.
diff --git a/drivers/media/video/et61x251/et61x251.h 
b/drivers/media/video/et61x251/et61x251.h
index 262f98e..02c741d 100644
--- a/drivers/media/video/et61x251/et61x251.h
+++ b/drivers/media/video/et61x251/et61x251.h
@@ -36,6 +36,7 @@
 #include linux/mutex.h
 #include linux/stddef.h
 #include linux/string.h
+#include linux/kref.h
 
 #include et61x251_sensor.h
 
@@ -134,7 +135,7 @@ struct et61x251_module_param {
 };
 
 static DEFINE_MUTEX(et61x251_sysfs_lock);
-static DECLARE_RWSEM(et61x251_disconnect);
+static DECLARE_RWSEM(et61x251_dev_lock);
 
 struct et61x251_device {
struct video_device* v4ldev;
@@ -158,12 +159,14 @@ struct et61x251_device {
struct et61x251_sysfs_attr sysfs;
struct et61x251_module_param module_param;
 
+   struct kref kref;
enum et61x251_dev_state state;
u8 users;
 
-   struct mutex dev_mutex, fileop_mutex;
+   struct completion probe;
+   struct mutex open_mutex, fileop_mutex;
spinlock_t queue_lock;
-   wait_queue_head_t open, wait_frame, wait_stream;
+   wait_queue_head_t wait_open, wait_frame, wait_stream;
 };
 
 /*/
@@ -177,7 +180,7 @@ et61x251_match_id(struct et61x251_device* cam, const struct 
usb_device_id *id)
 
 void
 et61x251_attach_sensor(struct et61x251_device* cam,
-  struct et61x251_sensor* sensor)
+  const struct et61x251_sensor* sensor)
 {
memcpy(cam-sensor, sensor, sizeof(struct et61x251_sensor));
 }
@@ -195,8 +198,8 @@ do {
  \
else if ((level) == 2)\
dev_info(cam-usbdev-dev, fmt \n, ## args);   \
else if ((level) = 3)\
-   dev_info(cam-usbdev-dev, [%s:%d]  fmt \n,  \
-__FUNCTION__, __LINE__ , ## args);   \
+   dev_info(cam-usbdev-dev, [%s:%s:%d]  fmt \n,   \
+__FILE__, __FUNCTION__, __LINE__ , ## args); \
} \
 } while (0)
 #  define KDBG(level, fmt, args...)  \
@@ -205,8 +208,8 @@ do {
  \
if ((level) == 1 || (level) == 2) \
pr_info(et61x251:  fmt \n, ## args);  \
else if ((level) == 3)\
-   pr_debug(et61x251: [%s:%d]  fmt \n, __FUNCTION__, \
-__LINE__ , ## args); \
+   pr_debug(sn9c102: [%s:%s:%d]  fmt \n, __FILE__,   \
+__FUNCTION__, __LINE__ , ## args);   \
} \
 } while (0)
 #  define V4LDBG(level, name, cmd)   \
@@ -222,8 +225,8 @@ do {
 

V4L/DVB (5768): Ivtv: fix converity warning

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=27b5a3957a205bcaa07952ed27981f69b2b2f764
Commit: 27b5a3957a205bcaa07952ed27981f69b2b2f764
Parent: 4052fcc7ba32ebd54cc907991cb855d909ce9d1c
Author: Hans Verkuil [EMAIL PROTECTED]
AuthorDate: Sat Jun 16 16:46:56 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:24:10 2007 -0300

V4L/DVB (5768): Ivtv: fix converity warning

Signed-off-by: Hans Verkuil [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/video/ivtv/ivtv-driver.c |5 +
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/drivers/media/video/ivtv/ivtv-driver.c 
b/drivers/media/video/ivtv/ivtv-driver.c
index 67d9a8f..28a53c4 100644
--- a/drivers/media/video/ivtv/ivtv-driver.c
+++ b/drivers/media/video/ivtv/ivtv-driver.c
@@ -1289,10 +1289,7 @@ static void ivtv_remove(struct pci_dev *pci_dev)
 
IVTV_DEBUG_INFO( Releasing irq.\n);
free_irq(itv-dev-irq, (void *)itv);
-
-   if (itv-dev) {
-   ivtv_iounmap(itv);
-   }
+   ivtv_iounmap(itv);
 
IVTV_DEBUG_INFO( Releasing mem.\n);
release_mem_region(itv-base_addr, IVTV_ENCODER_SIZE);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


V4L/DVB (5769): Ivtv: fix broken VBI output support

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=47fd3ba9fc62d23a985f4969719c3091438d21c5
Commit: 47fd3ba9fc62d23a985f4969719c3091438d21c5
Parent: 27b5a3957a205bcaa07952ed27981f69b2b2f764
Author: Hans Verkuil [EMAIL PROTECTED]
AuthorDate: Sat Jun 16 17:02:11 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:24:10 2007 -0300

V4L/DVB (5769): Ivtv: fix broken VBI output support

The old service_set_out setting was still tested, even though it no longer
was ever set and was in fact obsolete. This meant that everything that was
written to /dev/vbi16 was ignored. Removed the service_set_out variable
altogether and now it works again.

Signed-off-by: Hans Verkuil [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/video/ivtv/ivtv-driver.h |1 -
 drivers/media/video/ivtv/ivtv-vbi.c|   31 +++
 2 files changed, 11 insertions(+), 21 deletions(-)

diff --git a/drivers/media/video/ivtv/ivtv-driver.h 
b/drivers/media/video/ivtv/ivtv-driver.h
index e6e56f1..48afd42 100644
--- a/drivers/media/video/ivtv/ivtv-driver.h
+++ b/drivers/media/video/ivtv/ivtv-driver.h
@@ -650,7 +650,6 @@ struct vbi_info {
/* convenience pointer to sliced struct in vbi_in union */
struct v4l2_sliced_vbi_format *sliced_in;
u32 service_set_in;
-   u32 service_set_out;
int insert_mpeg;
 
/* Buffer for the maximum of 2 * 18 * packet_size sliced VBI lines.
diff --git a/drivers/media/video/ivtv/ivtv-vbi.c 
b/drivers/media/video/ivtv/ivtv-vbi.c
index 3ba46e0..a7282a9 100644
--- a/drivers/media/video/ivtv/ivtv-vbi.c
+++ b/drivers/media/video/ivtv/ivtv-vbi.c
@@ -219,31 +219,23 @@ ssize_t ivtv_write_vbi(struct ivtv *itv, const char 
__user *ubuf, size_t count)
int found_cc = 0;
int cc_pos = itv-vbi.cc_pos;
 
-   if (itv-vbi.service_set_out == 0)
-   return -EPERM;
-
while (count = sizeof(struct v4l2_sliced_vbi_data)) {
switch (p-id) {
case V4L2_SLICED_CAPTION_525:
-   if (p-id == V4L2_SLICED_CAPTION_525 
-   p-line == 21 
-   (itv-vbi.service_set_out 
-   V4L2_SLICED_CAPTION_525) == 0) {
-   break;
-   }
-   found_cc = 1;
-   if (p-field) {
-   cc[2] = p-data[0];
-   cc[3] = p-data[1];
-   } else {
-   cc[0] = p-data[0];
-   cc[1] = p-data[1];
+   if (p-line == 21) {
+   found_cc = 1;
+   if (p-field) {
+   cc[2] = p-data[0];
+   cc[3] = p-data[1];
+   } else {
+   cc[0] = p-data[0];
+   cc[1] = p-data[1];
+   }
}
break;
 
case V4L2_SLICED_VPS:
-   if (p-line == 16  p-field == 0 
-   (itv-vbi.service_set_out  V4L2_SLICED_VPS)) {
+   if (p-line == 16  p-field == 0) {
itv-vbi.vps[0] = p-data[2];
itv-vbi.vps[1] = p-data[8];
itv-vbi.vps[2] = p-data[9];
@@ -255,8 +247,7 @@ ssize_t ivtv_write_vbi(struct ivtv *itv, const char __user 
*ubuf, size_t count)
break;
 
case V4L2_SLICED_WSS_625:
-   if (p-line == 23  p-field == 0 
-   (itv-vbi.service_set_out  V4L2_SLICED_WSS_625)) {
+   if (p-line == 23  p-field == 0) {
/* No lock needed for WSS */
itv-vbi.wss = p-data[0] | (p-data[1]  8);
itv-vbi.wss_found = 1;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


V4L/DVB (5770): Ivtv: fix return code of VIDIOC_G/S_FBUF when no FB is present

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f5948bbab04988f2b58e1a7ca893ffcf5dcfa243
Commit: f5948bbab04988f2b58e1a7ca893ffcf5dcfa243
Parent: 47fd3ba9fc62d23a985f4969719c3091438d21c5
Author: Hans Verkuil [EMAIL PROTECTED]
AuthorDate: Sat Jun 16 18:24:47 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:24:11 2007 -0300

V4L/DVB (5770): Ivtv: fix return code of VIDIOC_G/S_FBUF when no FB is 
present

Signed-off-by: Hans Verkuil [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/video/ivtv/ivtv-ioctl.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/video/ivtv/ivtv-ioctl.c 
b/drivers/media/video/ivtv/ivtv-ioctl.c
index 57af176..4773453 100644
--- a/drivers/media/video/ivtv/ivtv-ioctl.c
+++ b/drivers/media/video/ivtv/ivtv-ioctl.c
@@ -1159,7 +1159,7 @@ int ivtv_v4l2_ioctls(struct ivtv *itv, struct file *filp, 
unsigned int cmd, void
 
memset(fb, 0, sizeof(*fb));
if (!(itv-v4l2_cap  V4L2_CAP_VIDEO_OUTPUT_OVERLAY))
-   break;
+   return -EINVAL;
fb-capability = V4L2_FBUF_CAP_EXTERNOVERLAY | 
V4L2_FBUF_CAP_CHROMAKEY |
V4L2_FBUF_CAP_LOCAL_ALPHA | V4L2_FBUF_CAP_GLOBAL_ALPHA;
fb-fmt.pixelformat = itv-osd_pixelformat;
@@ -1179,7 +1179,7 @@ int ivtv_v4l2_ioctls(struct ivtv *itv, struct file *filp, 
unsigned int cmd, void
struct v4l2_framebuffer *fb = arg;
 
if (!(itv-v4l2_cap  V4L2_CAP_VIDEO_OUTPUT_OVERLAY))
-   break;
+   return -EINVAL;
itv-osd_global_alpha_state = (fb-flags  
V4L2_FBUF_FLAG_GLOBAL_ALPHA) != 0;
itv-osd_local_alpha_state = (fb-flags  
V4L2_FBUF_FLAG_LOCAL_ALPHA) != 0;
itv-osd_color_key_state = (fb-flags  
V4L2_FBUF_FLAG_CHROMAKEY) != 0;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


V4L/DVB (5771): Get_dvb_firmware: update script for new location

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=302170a4b47e869372974abd885dd11d5536b64a
Commit: 302170a4b47e869372974abd885dd11d5536b64a
Parent: f5948bbab04988f2b58e1a7ca893ffcf5dcfa243
Author: Michael Krufky [EMAIL PROTECTED]
AuthorDate: Fri Jun 15 19:14:52 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:24:12 2007 -0300

V4L/DVB (5771): Get_dvb_firmware: update script for new location

Get_dvb_firmware: update script for new location of sp8870 firmware

This url is no longer valid:
http://www.technotrend.de/new/217g/tt_Premium_217g.zip

Replace with:

http://www.softwarepatch.pl/ccd06a4813cb827dbb0005071c71/tt_Premium_217g.zip

Thanks-to: Tobias Stoeber [EMAIL PROTECTED]

Signed-off-by: Michael Krufky [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 Documentation/dvb/get_dvb_firmware |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Documentation/dvb/get_dvb_firmware 
b/Documentation/dvb/get_dvb_firmware
index 4820366..e32f79e 100644
--- a/Documentation/dvb/get_dvb_firmware
+++ b/Documentation/dvb/get_dvb_firmware
@@ -56,7 +56,7 @@ syntax();
 
 sub sp8870 {
 my $sourcefile = tt_Premium_217g.zip;
-my $url = http://www.technotrend.de/new/217g/$sourcefile;;
+my $url = 
http://www.softwarepatch.pl/ccd06a4813cb827dbb0005071c71/$sourcefile;;
 my $hash = 53970ec17a538945a6d8cb608a7b3899;
 my $outfile = dvb-fe-sp8870.fw;
 my $tmpdir = tempdir(DIR = /tmp, CLEANUP = 1);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


V4L/DVB (5772): Cx88: remove two unused pointers from struct cx8802_dev

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6d7930e0cde1b27c3beca399e233be058ac0b93f
Commit: 6d7930e0cde1b27c3beca399e233be058ac0b93f
Parent: 302170a4b47e869372974abd885dd11d5536b64a
Author: Michael Krufky [EMAIL PROTECTED]
AuthorDate: Fri Jun 15 19:17:46 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:24:13 2007 -0300

V4L/DVB (5772): Cx88: remove two unused pointers from struct cx8802_dev

The following two pointers in struct cx8802_dev are unused - remove them:

void* fe_handle;
int   (*fe_release)(void *handle);

Signed-off-by: Michael Krufky [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/video/cx88/cx88.h |2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/drivers/media/video/cx88/cx88.h b/drivers/media/video/cx88/cx88.h
index e0290ba..c4f656e 100644
--- a/drivers/media/video/cx88/cx88.h
+++ b/drivers/media/video/cx88/cx88.h
@@ -466,8 +466,6 @@ struct cx8802_dev {
 #if defined(CONFIG_VIDEO_BUF_DVB) || defined(CONFIG_VIDEO_BUF_DVB_MODULE)
/* for dvb only */
struct videobuf_dvbdvb;
-   void*  fe_handle;
-   int(*fe_release)(void *handle);
 
void   *card_priv;
 #endif
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


V4L/DVB (5777): Dvb-pll digitv dvb-usb: Eliminate last user of dvb_pll_configure

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4ce15678926cef4886df46964142fc2520c216cd
Commit: 4ce15678926cef4886df46964142fc2520c216cd
Parent: b784e526a8333db57d1b9f385a12553066bdba64
Author: Trent Piepho [EMAIL PROTECTED]
AuthorDate: Sat Jun 2 16:30:46 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:24:15 2007 -0300

V4L/DVB (5777): Dvb-pll digitv dvb-usb: Eliminate last user of 
dvb_pll_configure

The last user of dvb_pll_configure was the dvb-usb function
dvb_usb_tuner_calc_regs(), which was nothing more than a wrapper around
dvb_pll_configure().  It's just a copy of the functionality provided by
the tuner_ops calc_regs method, and can be deleted.

There were two users of dvb_usb_tuner_calc_regs().
One was dvb_usb_tuner_set_params_i2c(), which is converted to use
fe-ops.tuner_ops.calc_regs().

The other was the digitv driver.  This driver can use one of two demods,
mt352 or nxt6000.

For the mt352, the driver would set tuner_ops.calc_regs to
dvb_usb_tuner_calc_regs().

We can just attach dvb_pll and use the tuner_ops.calc_regs() provided by
that module. For the nxt600, the driver would set tuner_ops.set_params
to digitv_nxt6000_tuner_set_params.

That function would in turn use dvb_usb_tuner_calc_regs().

We convert it to use tuner_ops.calc_regs() instead, and use
dvb_pll_attach.

The digitv_tuner_attach() needs to know which frontend was attached by
digitv_frontend_attach(), since the nxt6000 needs tuner_ops.set_params()
to be overridden with digitv_nxt6000_tuner_set_params().

So, to do this a digitv_state that says which frontend was used is added
to the dvb_usb_device private state field.

Signed-off-by: Trent Piepho [EMAIL PROTECTED]
Signed-off-by: Michael Krufky [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/dvb/dvb-usb/digitv.c  |   21 -
 drivers/media/dvb/dvb-usb/digitv.h  |4 
 drivers/media/dvb/dvb-usb/dvb-usb-i2c.c |   22 +-
 drivers/media/dvb/dvb-usb/dvb-usb.h |1 -
 drivers/media/dvb/frontends/dvb-pll.c   |4 ++--
 drivers/media/dvb/frontends/dvb-pll.h   |3 ---
 6 files changed, 23 insertions(+), 32 deletions(-)

diff --git a/drivers/media/dvb/dvb-usb/digitv.c 
b/drivers/media/dvb/dvb-usb/digitv.c
index b5acb11..36e0f8f 100644
--- a/drivers/media/dvb/dvb-usb/digitv.c
+++ b/drivers/media/dvb/dvb-usb/digitv.c
@@ -118,7 +118,8 @@ static int digitv_nxt6000_tuner_set_params(struct 
dvb_frontend *fe, struct dvb_f
 {
struct dvb_usb_adapter *adap = fe-dvb-priv;
u8 b[5];
-   dvb_usb_tuner_calc_regs(fe,fep,b, 5);
+
+   fe-ops.tuner_ops.calc_regs(fe, fep, b, sizeof(b));
if (fe-ops.i2c_gate_ctrl)
fe-ops.i2c_gate_ctrl(fe, 1);
return digitv_ctrl_msg(adap-dev, USB_WRITE_TUNER, 0, b[1], 4, NULL, 
0);
@@ -130,12 +131,14 @@ static struct nxt6000_config digitv_nxt6000_config = {
 
 static int digitv_frontend_attach(struct dvb_usb_adapter *adap)
 {
+   struct digitv_state *st = adap-dev-priv;
+
if ((adap-fe = dvb_attach(mt352_attach, digitv_mt352_config, 
adap-dev-i2c_adap)) != NULL) {
-   adap-fe-ops.tuner_ops.calc_regs = dvb_usb_tuner_calc_regs;
+   st-is_nxt6000 = 0;
return 0;
}
if ((adap-fe = dvb_attach(nxt6000_attach, digitv_nxt6000_config, 
adap-dev-i2c_adap)) != NULL) {
-   adap-fe-ops.tuner_ops.set_params = 
digitv_nxt6000_tuner_set_params;
+   st-is_nxt6000 = 1;
return 0;
}
return -EIO;
@@ -143,8 +146,14 @@ static int digitv_frontend_attach(struct dvb_usb_adapter 
*adap)
 
 static int digitv_tuner_attach(struct dvb_usb_adapter *adap)
 {
-   adap-pll_addr = 0x60;
-   adap-pll_desc = dvb_pll_tded4;
+   struct digitv_state *st = adap-dev-priv;
+
+   if (!dvb_attach(dvb_pll_attach, adap-fe, 0x60, NULL, dvb_pll_tded4))
+   return -ENODEV;
+
+   if (st-is_nxt6000)
+   adap-fe-ops.tuner_ops.set_params = 
digitv_nxt6000_tuner_set_params;
+
return 0;
 }
 
@@ -273,6 +282,8 @@ static struct dvb_usb_device_properties digitv_properties = 
{
.usb_ctrl = CYPRESS_FX2,
.firmware = dvb-usb-digitv-02.fw,
 
+   .size_of_priv = sizeof(struct digitv_state),
+
.num_adapters = 1,
.adapter = {
{
diff --git a/drivers/media/dvb/dvb-usb/digitv.h 
b/drivers/media/dvb/dvb-usb/digitv.h
index 477ee42..8b43e3d 100644
--- a/drivers/media/dvb/dvb-usb/digitv.h
+++ b/drivers/media/dvb/dvb-usb/digitv.h
@@ -4,6 +4,10 @@
 #define DVB_USB_LOG_PREFIX digitv
 #include dvb-usb.h
 
+struct digitv_state {
+int is_nxt6000;
+};
+
 extern int dvb_usb_digitv_debug;
 #define deb_rc(args...)   

V4L/DVB (5778): Dvb-usb: kill unused tuner/i2c functions

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=865dd115c95df6997f3d9dd638e6f92298f0422f
Commit: 865dd115c95df6997f3d9dd638e6f92298f0422f
Parent: 4ce15678926cef4886df46964142fc2520c216cd
Author: Michael Krufky [EMAIL PROTECTED]
AuthorDate: Tue Jun 12 12:40:35 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:24:15 2007 -0300

V4L/DVB (5778): Dvb-usb: kill unused tuner/i2c functions

These two functions are no longer being used:
dvb_usb_tuner_init_i2c
dvb_usb_tuner_set_params_i2c

This functionality has been taken over by dvb-pll

Signed-off-by: Michael Krufky [EMAIL PROTECTED]
Signed-off-by: Patrick Boettcher [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/dvb/dvb-usb/dvb-usb-i2c.c |   59 ---
 drivers/media/dvb/dvb-usb/dvb-usb.h |8 
 2 files changed, 0 insertions(+), 67 deletions(-)

diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-i2c.c 
b/drivers/media/dvb/dvb-usb/dvb-usb-i2c.c
index 5792951..23428cd 100644
--- a/drivers/media/dvb/dvb-usb/dvb-usb-i2c.c
+++ b/drivers/media/dvb/dvb-usb/dvb-usb-i2c.c
@@ -46,62 +46,3 @@ int dvb_usb_i2c_exit(struct dvb_usb_device *d)
d-state = ~DVB_USB_STATE_I2C;
return 0;
 }
-
-int dvb_usb_tuner_init_i2c(struct dvb_frontend *fe)
-{
-   struct dvb_usb_adapter *adap = fe-dvb-priv;
-   struct i2c_msg msg = { .addr = adap-pll_addr, .flags = 0, .buf = 
adap-pll_init, .len = 4 };
-   int ret = 0;
-
-   /* if pll_desc is not used */
-   if (adap-pll_desc == NULL)
-   return 0;
-
-   if (adap-tuner_pass_ctrl)
-   adap-tuner_pass_ctrl(fe, 1, adap-pll_addr);
-
-   deb_pll(pll init: %x\n,adap-pll_addr);
-   deb_pll(pll-buf: %x %x %x %x\n,adap-pll_init[0], adap-pll_init[1],
-   adap-pll_init[2], adap-pll_init[3]);
-
-   if (fe-ops.i2c_gate_ctrl)
-   fe-ops.i2c_gate_ctrl(fe, 1);
-   if (i2c_transfer (adap-dev-i2c_adap, msg, 1) != 1) {
-   err(tuner i2c write failed for pll_init.);
-   ret = -EREMOTEIO;
-   }
-   msleep(1);
-
-   if (adap-tuner_pass_ctrl)
-   adap-tuner_pass_ctrl(fe,0,adap-pll_addr);
-   return ret;
-}
-EXPORT_SYMBOL(dvb_usb_tuner_init_i2c);
-
-int dvb_usb_tuner_set_params_i2c(struct dvb_frontend *fe, struct 
dvb_frontend_parameters *fep)
-{
-   struct dvb_usb_adapter *adap = fe-dvb-priv;
-   int ret = 0;
-   u8 b[5];
-   struct i2c_msg msg = { .addr = adap-pll_addr, .flags = 0, .buf = 
b[1], .len = 4 };
-
-   fe-ops.tuner_ops.calc_regs(fe, fep, b, sizeof(b));
-
-   if (adap-tuner_pass_ctrl)
-   adap-tuner_pass_ctrl(fe, 1, adap-pll_addr);
-
-   if (fe-ops.i2c_gate_ctrl)
-   fe-ops.i2c_gate_ctrl(fe, 1);
-
-   if (i2c_transfer(adap-dev-i2c_adap, msg, 1) != 1) {
-   err(tuner i2c write failed for pll_set.);
-   ret = -EREMOTEIO;
-   }
-   msleep(1);
-
-   if (adap-tuner_pass_ctrl)
-   adap-tuner_pass_ctrl(fe, 0, adap-pll_addr);
-
-   return ret;
-}
-EXPORT_SYMBOL(dvb_usb_tuner_set_params_i2c);
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb.h 
b/drivers/media/dvb/dvb-usb/dvb-usb.h
index d008a24..70be200 100644
--- a/drivers/media/dvb/dvb-usb/dvb-usb.h
+++ b/drivers/media/dvb/dvb-usb/dvb-usb.h
@@ -297,10 +297,6 @@ struct dvb_usb_adapter {
int feedcount;
int pid_filtering;
 
-   /* tuner programming information */
-   u8 pll_addr;
-   u8 pll_init[4];
-   struct dvb_pll_desc *pll_desc;
int (*tuner_pass_ctrl) (struct dvb_frontend *, int, u8);
 
/* dvb */
@@ -388,10 +384,6 @@ extern int dvb_usb_generic_write(struct dvb_usb_device *, 
u8 *, u16);
 /* commonly used remote control parsing */
 extern int dvb_usb_nec_rc_key_to_event(struct dvb_usb_device *, u8[], u32 *, 
int *);
 
-/* commonly used pll init and set functions */
-extern int dvb_usb_tuner_init_i2c(struct dvb_frontend *);
-extern int dvb_usb_tuner_set_params_i2c(struct dvb_frontend *, struct 
dvb_frontend_parameters *);
-
 /* commonly used firmware download types and function */
 struct hexline {
u8 len;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


V4L/DVB (5779): Dibusb-mb: fix broken 'tuner_pass_ctrl' functionality

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6c08d9290e2fc87b217d0f7c9cd67c9240ad7147
Commit: 6c08d9290e2fc87b217d0f7c9cd67c9240ad7147
Parent: 865dd115c95df6997f3d9dd638e6f92298f0422f
Author: Michael Krufky [EMAIL PROTECTED]
AuthorDate: Tue Jun 12 12:43:25 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:24:16 2007 -0300

V4L/DVB (5779): Dibusb-mb: fix broken 'tuner_pass_ctrl' functionality

'tuner_pass_ctrl' functionality of the dib3000-mb devices was broken in
the previous changeset:

dibusb-mb: convert pll handling to properly use dvb-pll

This patch fixes this problem by assigning this functionality to the
i2c_gate_ctrl callback

Signed-off-by: Michael Krufky [EMAIL PROTECTED]
Signed-off-by: Patrick Boettcher [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/dvb/dvb-usb/dibusb-mb.c |   29 +++--
 drivers/media/dvb/dvb-usb/dibusb.h|1 +
 drivers/media/dvb/dvb-usb/dvb-usb.h   |2 --
 3 files changed, 24 insertions(+), 8 deletions(-)

diff --git a/drivers/media/dvb/dvb-usb/dibusb-mb.c 
b/drivers/media/dvb/dvb-usb/dibusb-mb.c
index a171900..67cd484 100644
--- a/drivers/media/dvb/dvb-usb/dibusb-mb.c
+++ b/drivers/media/dvb/dvb-usb/dibusb-mb.c
@@ -14,6 +14,14 @@
  */
 #include dibusb.h
 
+static int dib3000mb_i2c_gate_ctrl(struct dvb_frontend* fe, int enable)
+{
+   struct dvb_usb_adapter *adap = fe-dvb-priv;
+   struct dibusb_state *st = adap-priv;
+
+   return st-ops.tuner_pass_ctrl(fe, enable, st-tuner_addr);
+}
+
 static int dibusb_dib3000mb_frontend_attach(struct dvb_usb_adapter *adap)
 {
struct dib3000_config demod_cfg;
@@ -25,13 +33,17 @@ static int dibusb_dib3000mb_frontend_attach(struct 
dvb_usb_adapter *adap)
   adap-dev-i2c_adap, st-ops)) == NULL)
return -ENODEV;
 
-   adap-tuner_pass_ctrl = st-ops.tuner_pass_ctrl;
+   adap-fe-ops.i2c_gate_ctrl = dib3000mb_i2c_gate_ctrl;
 
return 0;
 }
 
 static int dibusb_thomson_tuner_attach(struct dvb_usb_adapter *adap)
 {
+   struct dibusb_state *st = adap-priv;
+
+   st-tuner_addr = 0x61;
+
dvb_attach(dvb_pll_attach, adap-fe, 0x61, adap-dev-i2c_adap,
   dvb_pll_tua6010xs);
return 0;
@@ -39,6 +51,10 @@ static int dibusb_thomson_tuner_attach(struct 
dvb_usb_adapter *adap)
 
 static int dibusb_panasonic_tuner_attach(struct dvb_usb_adapter *adap)
 {
+   struct dibusb_state *st = adap-priv;
+
+   st-tuner_addr = 0x60;
+
dvb_attach(dvb_pll_attach, adap-fe, 0x60, adap-dev-i2c_adap,
   dvb_pll_tda665x);
return 0;
@@ -55,20 +71,21 @@ static int dibusb_tuner_probe_and_attach(struct 
dvb_usb_adapter *adap)
{ .flags = 0,.buf = b,  .len = 2 },
{ .flags = I2C_M_RD, .buf = b2, .len = 1 },
};
+   struct dibusb_state *st = adap-priv;
 
/* the Panasonic sits on I2C addrass 0x60, the Thomson on 0x61 */
-   msg[0].addr = msg[1].addr = 0x60;
+   st-tuner_addr = 0x60;
 
-   if (adap-tuner_pass_ctrl)
-   adap-tuner_pass_ctrl(adap-fe,1,msg[0].addr);
+   if (adap-fe-ops.i2c_gate_ctrl)
+   adap-fe-ops.i2c_gate_ctrl(adap-fe,1);
 
if (i2c_transfer(adap-dev-i2c_adap, msg, 2) != 2) {
err(tuner i2c write failed.);
ret = -EREMOTEIO;
}
 
-   if (adap-tuner_pass_ctrl)
-   adap-tuner_pass_ctrl(adap-fe,0,msg[0].addr);
+   if (adap-fe-ops.i2c_gate_ctrl)
+   adap-fe-ops.i2c_gate_ctrl(adap-fe,0);
 
if (b2[0] == 0xfe) {
info(This device has the Thomson Cable onboard. Which is 
default.);
diff --git a/drivers/media/dvb/dvb-usb/dibusb.h 
b/drivers/media/dvb/dvb-usb/dibusb.h
index b607810..8e847aa 100644
--- a/drivers/media/dvb/dvb-usb/dibusb.h
+++ b/drivers/media/dvb/dvb-usb/dibusb.h
@@ -99,6 +99,7 @@
 struct dibusb_state {
struct dib_fe_xfer_ops ops;
int mt2060_present;
+   u8 tuner_addr;
 };
 
 struct dibusb_device_state {
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb.h 
b/drivers/media/dvb/dvb-usb/dvb-usb.h
index 70be200..d1b3c7b 100644
--- a/drivers/media/dvb/dvb-usb/dvb-usb.h
+++ b/drivers/media/dvb/dvb-usb/dvb-usb.h
@@ -297,8 +297,6 @@ struct dvb_usb_adapter {
int feedcount;
int pid_filtering;
 
-   int (*tuner_pass_ctrl) (struct dvb_frontend *, int, u8);
-
/* dvb */
struct dvb_adapter   dvb_adap;
struct dmxdevdmxdev;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


V4L/DVB (5783): Fix excess of debug messages on cx88-mpeg

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7d816b256df83070e75d4f738c10d66bfc192040
Commit: 7d816b256df83070e75d4f738c10d66bfc192040
Parent: 47a9991e806940f400f90d7b9cbcf7c2925e4fce
Author: Mauro Carvalho Chehab [EMAIL PROTECTED]
AuthorDate: Fri Jun 22 17:26:54 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:24:18 2007 -0300

V4L/DVB (5783): Fix excess of debug messages on cx88-mpeg

Closes the issue opened on Kernel bugzilla:
http://bugzilla.kernel.org/show_bug.cgi?id=8383
There's no need to print timeout without debug turned on:
Apr 27 23:02:14 video kernel: cx88[1]/2-mpeg: cx8802_timeout

Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/video/cx88/cx88-mpeg.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/media/video/cx88/cx88-mpeg.c 
b/drivers/media/video/cx88/cx88-mpeg.c
index 543b05e..317a2a3 100644
--- a/drivers/media/video/cx88/cx88-mpeg.c
+++ b/drivers/media/video/cx88/cx88-mpeg.c
@@ -336,7 +336,7 @@ static void cx8802_timeout(unsigned long data)
 {
struct cx8802_dev *dev = (struct cx8802_dev*)data;
 
-   dprintk(0, %s\n,__FUNCTION__);
+   dprintk(1, %s\n,__FUNCTION__);
 
if (debug)
cx88_sram_channel_dump(dev-core, 
cx88_sram_channels[SRAM_CH28]);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


V4L/DVB (5785): Revisited: 3dfx Voodoo TV 200 (US)

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=434b25263a236c9dd980617d69863ba0eff8c744
Commit: 434b25263a236c9dd980617d69863ba0eff8c744
Parent: 096bb77abac4e44c37870f4f8adaec813295eb23
Author: Wade Berrier [EMAIL PROTECTED]
AuthorDate: Mon Jun 25 13:02:16 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:24:19 2007 -0300

V4L/DVB (5785): Revisited: 3dfx Voodoo TV 200 (US)

Fix support for 3dfx Voodoo TV 200 variant

Signed-off-by: Wade Berrier [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/video/bt8xx/bttv-cards.c  |   33 --
 drivers/media/video/bt8xx/bttv-driver.c |   12 +-
 drivers/media/video/bt8xx/bttv.h|1 +
 3 files changed, 41 insertions(+), 5 deletions(-)

diff --git a/drivers/media/video/bt8xx/bttv-cards.c 
b/drivers/media/video/bt8xx/bttv-cards.c
index 6b31e50..a5e0200 100644
--- a/drivers/media/video/bt8xx/bttv-cards.c
+++ b/drivers/media/video/bt8xx/bttv-cards.c
@@ -178,8 +178,8 @@ static struct CARD {
/* this seems to happen as well ... */
{ 0xff1211bd, BTTV_BOARD_PINNACLE,  Pinnacle PCTV },
 
-   { 0x3000121a, BTTV_BOARD_VOODOOTV_FM,   3Dfx VoodooTV FM/ VoodooTV 
200 },
-   { 0x263710b4, BTTV_BOARD_VOODOOTV_FM,   3Dfx VoodooTV FM/ VoodooTV 
200 },
+   { 0x3000121a, BTTV_BOARD_VOODOOTV_200,  3Dfx VoodooTV 200 },
+   { 0x263710b4, BTTV_BOARD_VOODOOTV_FM,   3Dfx VoodooTV FM },
{ 0x3060121a, BTTV_BOARD_STB2,3Dfx VoodooTV 100/ STB OEM },
 
{ 0x3000144f, BTTV_BOARD_MAGICTVIEW063, (Askey Magic/others) TView99 
CPH06x },
@@ -1517,7 +1517,29 @@ struct tvcard bttv_tvcards[] = {
 
/*  card 0x44 -- */
[BTTV_BOARD_VOODOOTV_FM] = {
-   .name   = 3Dfx VoodooTV FM (Euro), VoodooTV 200 (USA),
+   .name   = 3Dfx VoodooTV FM (Euro),
+   /* try insmod msp3400 simple=0 if you have
+   * sound problems with this card. */
+   .video_inputs   = 4,
+   .audio_inputs   = 1,
+   .tuner  = 0,
+   .svhs   = -1,
+   .gpiomask   = 0x4f8a00,
+   /* 0x10: 1=MSP enabled (0=disable again)
+   * 0x01: Connected to S0 on tda9880 (0=Pal/BG, 1=NTSC) */
+   .gpiomux= {0x947fff, 0x987fff,0x947fff,0x947fff },
+   .gpiomute   = 0x947fff,
+   /* tvtuner, radio,   external,internal, mute,  stereo
+   * tuner, Composit, SVid, Composit-on-Svid-adapter */
+   .muxsel = { 2, 3 ,0 ,1 },
+   .tuner_type = TUNER_MT2032,
+   .tuner_addr = ADDR_UNSET,
+   .radio_addr = ADDR_UNSET,
+   .pll= PLL_28,
+   .has_radio  = 1,
+   },
+   [BTTV_BOARD_VOODOOTV_200] = {
+   .name   = VoodooTV 200 (USA),
/* try insmod msp3400 simple=0 if you have
* sound problems with this card. */
.video_inputs   = 4,
@@ -3302,6 +3324,7 @@ void __devinit bttv_init_card1(struct bttv *btv)
case BTTV_BOARD_HAUPPAUGE878:
boot_msp34xx(btv,5);
break;
+   case BTTV_BOARD_VOODOOTV_200:
case BTTV_BOARD_VOODOOTV_FM:
boot_msp34xx(btv,20);
break;
@@ -3865,11 +3888,15 @@ void bttv_tda9880_setnorm(struct bttv *btv, int norm)
if(norm==VIDEO_MODE_NTSC) {

bttv_tvcards[BTTV_BOARD_VOODOOTV_FM].gpiomux[TVAUDIO_INPUT_TUNER]=0x957fff;
bttv_tvcards[BTTV_BOARD_VOODOOTV_FM].gpiomute=0x957fff;
+   
bttv_tvcards[BTTV_BOARD_VOODOOTV_200].gpiomux[TVAUDIO_INPUT_TUNER]=0x957fff;
+   bttv_tvcards[BTTV_BOARD_VOODOOTV_200].gpiomute=0x957fff;
dprintk(bttv_tda9880_setnorm to NTSC\n);
}
else {

bttv_tvcards[BTTV_BOARD_VOODOOTV_FM].gpiomux[TVAUDIO_INPUT_TUNER]=0x947fff;
bttv_tvcards[BTTV_BOARD_VOODOOTV_FM].gpiomute=0x947fff;
+   
bttv_tvcards[BTTV_BOARD_VOODOOTV_200].gpiomux[TVAUDIO_INPUT_TUNER]=0x947fff;
+   bttv_tvcards[BTTV_BOARD_VOODOOTV_200].gpiomute=0x947fff;
dprintk(bttv_tda9880_setnorm to PAL\n);
}
/* set GPIO according */
diff --git a/drivers/media/video/bt8xx/bttv-driver.c 
b/drivers/media/video/bt8xx/bttv-driver.c
index b1fedb0..284bdf2 100644
--- a/drivers/media/video/bt8xx/bttv-driver.c
+++ b/drivers/media/video/bt8xx/bttv-driver.c
@@ -1218,7 +1218,14 @@ audio_mux(struct bttv *btv, int input, int mute)
break;
case TVAUDIO_INPUT_TUNER:
default:
-   route.input = MSP_INPUT_DEFAULT;
+   /* This is the only card 

V4L/DVB (5786): Ir-kbd-i2c: add support for Hauppauge HVR1300 remote

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=39cf1e810a6b464a8469bf318f21206d84ffb1d8
Commit: 39cf1e810a6b464a8469bf318f21206d84ffb1d8
Parent: 434b25263a236c9dd980617d69863ba0eff8c744
Author: Jan Frey [EMAIL PROTECTED]
AuthorDate: Mon Jun 25 14:34:06 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:24:20 2007 -0300

V4L/DVB (5786): Ir-kbd-i2c: add support for Hauppauge HVR1300 remote

- add support for the I2C based IR transceiver of the Hauppauge HVR-1300
- remove bad code from cx88-input.c

Signed-off-by: Jan Frey [EMAIL PROTECTED]
Signed-off-by: Michael Krufky [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/video/cx88/cx88-input.c |2 -
 drivers/media/video/ir-kbd-i2c.c  |   50 +---
 2 files changed, 39 insertions(+), 13 deletions(-)

diff --git a/drivers/media/video/cx88/cx88-input.c 
b/drivers/media/video/cx88/cx88-input.c
index ddfae9f..5915dba 100644
--- a/drivers/media/video/cx88/cx88-input.c
+++ b/drivers/media/video/cx88/cx88-input.c
@@ -218,7 +218,6 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev 
*pci)
case CX88_BOARD_HAUPPAUGE_NOVASE2_S1:
case CX88_BOARD_HAUPPAUGE_NOVASPLUS_S1:
case CX88_BOARD_HAUPPAUGE_HVR1100:
-   case CX88_BOARD_HAUPPAUGE_HVR1300:
case CX88_BOARD_HAUPPAUGE_HVR3000:
ir_codes = ir_codes_hauppauge_new;
ir_type = IR_TYPE_RC5;
@@ -438,7 +437,6 @@ void cx88_ir_irq(struct cx88_core *core)
case CX88_BOARD_HAUPPAUGE_NOVASE2_S1:
case CX88_BOARD_HAUPPAUGE_NOVASPLUS_S1:
case CX88_BOARD_HAUPPAUGE_HVR1100:
-   case CX88_BOARD_HAUPPAUGE_HVR1300:
case CX88_BOARD_HAUPPAUGE_HVR3000:
ircode = ir_decode_biphase(ir-samples, ir-scount, 5, 7);
ir_dprintk(biphase decoded: %x\n, ircode);
diff --git a/drivers/media/video/ir-kbd-i2c.c b/drivers/media/video/ir-kbd-i2c.c
index cd84d06..2d709e0 100644
--- a/drivers/media/video/ir-kbd-i2c.c
+++ b/drivers/media/video/ir-kbd-i2c.c
@@ -37,6 +37,7 @@
 #include linux/errno.h
 #include linux/slab.h
 #include linux/i2c.h
+#include linux/i2c-id.h
 #include linux/workqueue.h
 #include asm/semaphore.h
 
@@ -60,21 +61,22 @@ MODULE_PARM_DESC(hauppauge, Specify Hauppauge remote: 
0=black, 1=grey (defaults
 
 /* --- */
 
-static int get_key_haup(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw)
+static int get_key_haup_common(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw,
+  int size, int offset)
 {
-   unsigned char buf[3];
+   unsigned char buf[6];
int start, range, toggle, dev, code;
 
/* poll IR chip */
-   if (3 != i2c_master_recv(ir-c,buf,3))
+   if (size != i2c_master_recv(ir-c,buf,size))
return -EIO;
 
/* split rc5 data block ... */
-   start  = (buf[0]  7) 1;
-   range  = (buf[0]  6) 1;
-   toggle = (buf[0]  5) 1;
-   dev=  buf[0]0x1f;
-   code   = (buf[1]  2)  0x3f;
+   start  = (buf[offset]  7) 1;
+   range  = (buf[offset]  6) 1;
+   toggle = (buf[offset]  5) 1;
+   dev=  buf[offset]0x1f;
+   code   = (buf[offset+1]  2)  0x3f;
 
/* rc5 has two start bits
 * the first bit must be one
@@ -96,6 +98,16 @@ static int get_key_haup(struct IR_i2c *ir, u32 *ir_key, u32 
*ir_raw)
return 1;
 }
 
+static inline int get_key_haup(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw)
+{
+   return get_key_haup_common (ir, ir_key, ir_raw, 3, 0);
+}
+
+static inline int get_key_haup_xvr(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw)
+{
+   return get_key_haup_common (ir, ir_key, ir_raw, 6, 3);
+}
+
 static int get_key_pixelview(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw)
 {
unsigned char b;
@@ -355,9 +367,21 @@ static int ir_attach(struct i2c_adapter *adap, int addr,
case 0x7a:
case 0x47:
case 0x71:
-   /* Handled by saa7134-input */
-   name= SAA713x remote;
-   ir_type = IR_TYPE_OTHER;
+   if (adap-id == I2C_HW_B_CX2388x) {
+   /* Handled by cx88-input */
+   name= CX2388x remote;
+   ir_type = IR_TYPE_RC5;
+   ir-get_key = get_key_haup_xvr;
+   if (hauppauge == 1) {
+   ir_codes= ir_codes_hauppauge_new;
+   } else {
+   ir_codes= ir_codes_rc5_tv;
+   }
+   } else {
+   /* Handled by saa7134-input */
+   name= SAA713x remote;
+   ir_type = IR_TYPE_OTHER;
+   }
  

V4L/DVB (5787): Cx88: add remote control support for Leadtek Winfast DTV1000

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e7d11ecbde987e56845cff012b4a28d7001667b8
Commit: e7d11ecbde987e56845cff012b4a28d7001667b8
Parent: 39cf1e810a6b464a8469bf318f21206d84ffb1d8
Author: Edgar Pisani [EMAIL PROTECTED]
AuthorDate: Mon Jun 25 14:46:05 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:24:20 2007 -0300

V4L/DVB (5787): Cx88: add remote control support for Leadtek Winfast DTV1000

Signed-off-by: Edgar Pisani [EMAIL PROTECTED]
Signed-off-by: Michael Krufky [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/video/cx88/cx88-input.c |4 
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/media/video/cx88/cx88-input.c 
b/drivers/media/video/cx88/cx88-input.c
index 5915dba..22cbdf2 100644
--- a/drivers/media/video/cx88/cx88-input.c
+++ b/drivers/media/video/cx88/cx88-input.c
@@ -90,6 +90,9 @@ static void cx88_ir_handle_key(struct cx88_IR *ir)
auxgpio = cx_read(MO_GP1_IO);
/* Take out the parity part */
gpio=(gpio  0x7fd) + (auxgpio  0xef);
+   } else if (core-board == CX88_BOARD_WINFAST_DTV1000) {
+   gpio = (gpio  0x6ff) | ((cx_read(MO_GP1_IO)  8)  0x900);
+   auxgpio = gpio;
} else
auxgpio = gpio;
 
@@ -231,6 +234,7 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev 
*pci)
ir-polling = 50; /* ms */
break;
case CX88_BOARD_WINFAST2000XP_EXPERT:
+   case CX88_BOARD_WINFAST_DTV1000:
ir_codes = ir_codes_winfast;
ir-gpio_addr = MO_GP0_IO;
ir-mask_keycode = 0x8f8;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


V4L/DVB (5788): Cx88-input: convert nested if's to switch..case

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=829ea96477e775df0698b54dbfa913b6b55a4d6d
Commit: 829ea96477e775df0698b54dbfa913b6b55a4d6d
Parent: e7d11ecbde987e56845cff012b4a28d7001667b8
Author: Michael Krufky [EMAIL PROTECTED]
AuthorDate: Mon Jun 25 14:54:09 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:24:20 2007 -0300

V4L/DVB (5788): Cx88-input: convert nested if's to switch..case

In the function, cx88_ir_handle_key:
- convert nested if statement to a switch..case block

Signed-off-by: Michael Krufky [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/video/cx88/cx88-input.c |   11 +++
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/media/video/cx88/cx88-input.c 
b/drivers/media/video/cx88/cx88-input.c
index 22cbdf2..f5d4a56 100644
--- a/drivers/media/video/cx88/cx88-input.c
+++ b/drivers/media/video/cx88/cx88-input.c
@@ -74,7 +74,8 @@ static void cx88_ir_handle_key(struct cx88_IR *ir)
 
/* read gpio value */
gpio = cx_read(ir-gpio_addr);
-   if (core-board == CX88_BOARD_NPGTECH_REALTV_TOP10FM) {
+   switch (core-board) {
+   case CX88_BOARD_NPGTECH_REALTV_TOP10FM:
/* This board apparently uses a combination of 2 GPIO
   to represent the keys. Additionally, the second GPIO
   can be used for parity.
@@ -90,12 +91,14 @@ static void cx88_ir_handle_key(struct cx88_IR *ir)
auxgpio = cx_read(MO_GP1_IO);
/* Take out the parity part */
gpio=(gpio  0x7fd) + (auxgpio  0xef);
-   } else if (core-board == CX88_BOARD_WINFAST_DTV1000) {
+   break;
+   case CX88_BOARD_WINFAST_DTV1000:
gpio = (gpio  0x6ff) | ((cx_read(MO_GP1_IO)  8)  0x900);
auxgpio = gpio;
-   } else
+   break;
+   default:
auxgpio = gpio;
-
+   }
if (ir-polling) {
if (ir-last_gpio == auxgpio)
return;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


V4L/DVB (5789): Fix 3dfx Voodoo entries on Cardlist

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2d9078f73eafb2606e1adbb4e551d0cf1f5daf89
Commit: 2d9078f73eafb2606e1adbb4e551d0cf1f5daf89
Parent: 829ea96477e775df0698b54dbfa913b6b55a4d6d
Author: Mauro Carvalho Chehab [EMAIL PROTECTED]
AuthorDate: Mon Jun 25 15:21:05 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:24:21 2007 -0300

V4L/DVB (5789): Fix 3dfx Voodoo entries on Cardlist

Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 Documentation/video4linux/CARDLIST.bttv |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/Documentation/video4linux/CARDLIST.bttv 
b/Documentation/video4linux/CARDLIST.bttv
index b606391..e04acc6 100644
--- a/Documentation/video4linux/CARDLIST.bttv
+++ b/Documentation/video4linux/CARDLIST.bttv
@@ -66,7 +66,7 @@
  65 - Lifeview FlyVideo 2000S LR90
  66 - Terratec TValueRadio
[153b:1135,153b:ff3b]
  67 - IODATA GV-BCTV4/PCI [10fc:4050]
- 68 - 3Dfx VoodooTV FM (Euro), VoodooTV 200 (USA) 
[121a:3000,10b4:2637]
+ 68 - 3Dfx VoodooTV FM (Euro) [10b4:2637]
  69 - Active Imaging AIMMS
  70 - Prolink Pixelview PV-BT878P+ (Rev.4C,8E)
  71 - Lifeview FlyVideo 98EZ (capture only) LR51  [1851:1851]
@@ -145,3 +145,4 @@
 144 - MagicTV
 145 - SSAI Security Video Interface   [4149:5353]
 146 - SSAI Ultrasound Video Interface [414a:5353]
+147 - VoodooTV 200 (USA)  [121a:3000]
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


V4L/DVB (5790): Fix error handling for stv680

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2f3ed0538b2ac6d63b95c04b0ee0e7b9ac1ee220
Commit: 2f3ed0538b2ac6d63b95c04b0ee0e7b9ac1ee220
Parent: 2d9078f73eafb2606e1adbb4e551d0cf1f5daf89
Author: Mauro Carvalho Chehab [EMAIL PROTECTED]
AuthorDate: Mon Jun 25 15:33:41 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:24:21 2007 -0300

V4L/DVB (5790): Fix error handling for stv680

Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/video/stv680.c |7 +--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/media/video/stv680.c b/drivers/media/video/stv680.c
index bf3aa8d..4dc5bc7 100644
--- a/drivers/media/video/stv680.c
+++ b/drivers/media/video/stv680.c
@@ -715,8 +715,11 @@ static int stv680_start_stream (struct usb_stv *stv680)
   stv680_video_irq, stv680);
stv680-urb[i] = urb;
err = usb_submit_urb (stv680-urb[i], GFP_KERNEL);
-   if (err)
-   PDEBUG (0, STV(e): urb burned down in start stream);
+   if (err) {
+   PDEBUG (0, STV(e): urb burned down with err 
+  %d in start stream %d, err, i);
+   goto nomem_err;
+   }
}   /* i STV680_NUMSBUF */
 
stv680-framecount = 0;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


V4L/DVB (5791): Fix Kbuild for kbd-ir-i2c

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ea6337417da26a74a3b91c554ae9823995f8a84d
Commit: ea6337417da26a74a3b91c554ae9823995f8a84d
Parent: 2f3ed0538b2ac6d63b95c04b0ee0e7b9ac1ee220
Author: Mauro Carvalho Chehab [EMAIL PROTECTED]
AuthorDate: Mon Jun 25 15:42:01 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:24:22 2007 -0300

V4L/DVB (5791): Fix Kbuild for kbd-ir-i2c

Potentially, all board types with I2C and IR support can use an i2c
based IR. Currently, the driver is selected only if bt848 or saa7134
boards are selected.

Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/Kconfig|4 
 drivers/media/video/Makefile |4 ++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/media/Kconfig b/drivers/media/Kconfig
index 624b21c..d9d033e 100644
--- a/drivers/media/Kconfig
+++ b/drivers/media/Kconfig
@@ -80,8 +80,12 @@ config VIDEO_BUF_DVB
 config VIDEO_BTCX
tristate
 
+config VIDEO_IR_I2C
+   tristate
+
 config VIDEO_IR
tristate
+   select VIDEO_IR_I2C if I2C
 
 config VIDEO_TVEEPROM
tristate
diff --git a/drivers/media/video/Makefile b/drivers/media/video/Makefile
index cb942fb..4cddc8c 100644
--- a/drivers/media/video/Makefile
+++ b/drivers/media/video/Makefile
@@ -20,7 +20,7 @@ ifeq ($(CONFIG_VIDEO_V4L1_COMPAT),y)
 endif
 
 obj-$(CONFIG_VIDEO_BT848) += bt8xx/
-obj-$(CONFIG_VIDEO_BT848) += ir-kbd-i2c.o
+obj-$(CONFIG_VIDEO_IR_I2C)  += ir-kbd-i2c.o
 obj-$(CONFIG_VIDEO_TVAUDIO) += tvaudio.o
 obj-$(CONFIG_VIDEO_TDA7432) += tda7432.o
 obj-$(CONFIG_VIDEO_TDA9875) += tda9875.o
@@ -63,7 +63,7 @@ obj-$(CONFIG_VIDEO_CPIA) += cpia.o
 obj-$(CONFIG_VIDEO_CPIA_PP) += cpia_pp.o
 obj-$(CONFIG_VIDEO_CPIA_USB) += cpia_usb.o
 obj-$(CONFIG_VIDEO_MEYE) += meye.o
-obj-$(CONFIG_VIDEO_SAA7134) += ir-kbd-i2c.o saa7134/
+obj-$(CONFIG_VIDEO_SAA7134) += saa7134/
 obj-$(CONFIG_VIDEO_CX88) += cx88/
 obj-$(CONFIG_VIDEO_IVTV) += ivtv/
 obj-$(CONFIG_VIDEO_EM28XX) += em28xx/
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


V4L/DVB (5795): Fix: remove unused struct that could avoiding load the firmware

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d06cdbe59068a143ff2de2474fea62923cb7026f
Commit: d06cdbe59068a143ff2de2474fea62923cb7026f
Parent: 8218b0b2caecf4af55742e12e9986c15605bb197
Author: Marco Gittler [EMAIL PROTECTED]
AuthorDate: Thu Jun 28 10:10:00 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:24:23 2007 -0300

V4L/DVB (5795): Fix: remove unused struct that could avoiding load the 
firmware

The dvb_usb_device* d is not used anymore and can be removed.

Signed-off-by: Marco Gittler [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/dvb/dvb-usb/opera1.c |8 +++-
 1 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/media/dvb/dvb-usb/opera1.c 
b/drivers/media/dvb/dvb-usb/opera1.c
index ee6bf29..cdb0221 100644
--- a/drivers/media/dvb/dvb-usb/opera1.c
+++ b/drivers/media/dvb/dvb-usb/opera1.c
@@ -534,18 +534,16 @@ static struct dvb_usb_device_properties opera1_properties 
= {
 static int opera1_probe(struct usb_interface *intf,
const struct usb_device_id *id)
 {
-   struct dvb_usb_device *d;
struct usb_device *udev = interface_to_usbdev(intf);
 
if (udev-descriptor.idProduct == USB_PID_OPERA1_WARM 
udev-descriptor.idVendor == USB_VID_OPERA1 
-   (d == NULL
-   || opera1_xilinx_load_firmware(udev, 
dvb-usb-opera1-fpga.fw) != 0)
-   ) {
+   opera1_xilinx_load_firmware(udev, dvb-usb-opera1-fpga.fw) != 0
+   ) {
return -EINVAL;
}
 
-   if (dvb_usb_device_init(intf, opera1_properties, THIS_MODULE, d) != 0)
+   if (dvb_usb_device_init(intf, opera1_properties, THIS_MODULE, NULL) != 
0)
return -EINVAL;
return 0;
 }
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


V4L/DVB (5798): Dvb-pll: add support for Philips fcv1236d

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f1b24397e86c4c5b6984e2e67c17a53cdab14b35
Commit: f1b24397e86c4c5b6984e2e67c17a53cdab14b35
Parent: d06cdbe59068a143ff2de2474fea62923cb7026f
Author: Michael Krufky [EMAIL PROTECTED]
AuthorDate: Fri Oct 13 22:18:01 2006 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:24:24 2007 -0300

V4L/DVB (5798): Dvb-pll: add support for Philips fcv1236d

This patch adds support to the dvb-pll library for the
Philips fcv1236d tuner, based on the FCV1236D datasheet.

Signed-off-by: Michael Krufky [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/dvb/frontends/dvb-pll.c |   19 +++
 drivers/media/dvb/frontends/dvb-pll.h |1 +
 2 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/drivers/media/dvb/frontends/dvb-pll.c 
b/drivers/media/dvb/frontends/dvb-pll.c
index 01a1126..f3d500e 100644
--- a/drivers/media/dvb/frontends/dvb-pll.c
+++ b/drivers/media/dvb/frontends/dvb-pll.c
@@ -499,6 +499,24 @@ static struct dvb_pll_desc dvb_pll_opera1 = {
}
 };
 
+/* Philips FCV1236D
+ */
+struct dvb_pll_desc dvb_pll_fcv1236d = {
+/* Bit_0: RF Input select
+ * Bit_1: 0=digital, 1=analog
+ */
+   .name  = Philips FCV1236D,
+   .min   =  5300,
+   .max   = 80300,
+   .iffreq= 4400,
+   .count = 3,
+   .entries = {
+   { 15900, 62500, 0x8e, 0xa0 },
+   { 45300, 62500, 0x8e, 0x90 },
+   { 9, 62500, 0x8e, 0x30 },
+   },
+};
+
 /* --- */
 
 static struct dvb_pll_desc *pll_list[] = {
@@ -524,6 +542,7 @@ static struct dvb_pll_desc *pll_list[] = {
[DVB_PLL_PHILIPS_TD1316] = dvb_pll_philips_td1316,
[DVB_PLL_THOMSON_FE6600] = dvb_pll_thomson_fe6600,
[DVB_PLL_OPERA1] = dvb_pll_opera1,
+   [DVB_PLL_FCV1236D]   = dvb_pll_fcv1236d,
 };
 
 /* --- */
diff --git a/drivers/media/dvb/frontends/dvb-pll.h 
b/drivers/media/dvb/frontends/dvb-pll.h
index 66464e1..e93a810 100644
--- a/drivers/media/dvb/frontends/dvb-pll.h
+++ b/drivers/media/dvb/frontends/dvb-pll.h
@@ -30,6 +30,7 @@
 #define DVB_PLL_PHILIPS_TD1316 19
 #define DVB_PLL_THOMSON_FE6600 20
 #define DVB_PLL_OPERA1 21
+#define DVB_PLL_FCV1236D   22
 
 /**
  * Attach a dvb-pll to the supplied frontend structure.
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


V4L/DVB (5801): Tuner: update FCV1236D ranges to match the datasheet

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c350f617ff5440dedea63b9d7826644742ec215d
Commit: c350f617ff5440dedea63b9d7826644742ec215d
Parent: b82736362b24046d6d2279260ce0b88653dc43da
Author: Michael Krufky [EMAIL PROTECTED]
AuthorDate: Wed Jun 27 16:26:32 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:24:25 2007 -0300

V4L/DVB (5801): Tuner: update FCV1236D ranges to match the datasheet

Signed-off-by: Michael Krufky [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/video/tuner-types.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/media/video/tuner-types.c 
b/drivers/media/video/tuner-types.c
index e761244..417f642 100644
--- a/drivers/media/video/tuner-types.c
+++ b/drivers/media/video/tuner-types.c
@@ -598,7 +598,7 @@ static struct tuner_params tuner_philips_pal_mk_params[] = {
 
 static struct tuner_range tuner_philips_fcv1236d_ranges[] = {
{ 16 * 157.25 /*MHz*/, 0x8e, 0xa0, },
-   { 16 * 454.00 /*MHz*/, 0x8e, 0x90, },
+   { 16 * 451.25 /*MHz*/, 0x8e, 0x90, },
{ 16 * 999.99, 0x8e, 0x30, },
 };
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


V4L/DVB (5803): Bttv: add support for DViCO FusionHDTV 2

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=27cb786f4ec5fe85e9e2deffa4d33eed2f588cb0
Commit: 27cb786f4ec5fe85e9e2deffa4d33eed2f588cb0
Parent: c350f617ff5440dedea63b9d7826644742ec215d
Author: Michael Krufky [EMAIL PROTECTED]
AuthorDate: Thu Jun 28 12:19:20 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:24:26 2007 -0300

V4L/DVB (5803): Bttv: add support for DViCO FusionHDTV 2

add analog video support for DViCO FusionHDTV 2
Thanks to Todd Ignasiak for donating the card.

Signed-off-by: Michael Krufky [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 Documentation/video4linux/CARDLIST.bttv |1 +
 drivers/media/video/bt8xx/bttv-cards.c  |   19 +++
 drivers/media/video/bt8xx/bttv.h|1 +
 3 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/Documentation/video4linux/CARDLIST.bttv 
b/Documentation/video4linux/CARDLIST.bttv
index e04acc6..177159c 100644
--- a/Documentation/video4linux/CARDLIST.bttv
+++ b/Documentation/video4linux/CARDLIST.bttv
@@ -146,3 +146,4 @@
 145 - SSAI Security Video Interface   [4149:5353]
 146 - SSAI Ultrasound Video Interface [414a:5353]
 147 - VoodooTV 200 (USA)  [121a:3000]
+148 - DViCO FusionHDTV 2  [dbc0:d200]
diff --git a/drivers/media/video/bt8xx/bttv-cards.c 
b/drivers/media/video/bt8xx/bttv-cards.c
index a5e0200..2d61ed6 100644
--- a/drivers/media/video/bt8xx/bttv-cards.c
+++ b/drivers/media/video/bt8xx/bttv-cards.c
@@ -313,6 +313,7 @@ static struct CARD {
{ 0xdb1118ac, BTTV_BOARD_DVICO_DVBT_LITE,Ultraview DVB-T Lite },
{ 0xd50018ac, BTTV_BOARD_DVICO_FUSIONHDTV_5_LITE,DViCO FusionHDTV 
5 Lite },
{ 0x00261822, BTTV_BOARD_TWINHAN_DST,   DNTV Live! Mini },
+   { 0xd200dbc0, BTTV_BOARD_DVICO_FUSIONHDTV_2,DViCO FusionHDTV 2 },
 
{ 0, -1, NULL }
 };
@@ -2954,6 +2955,24 @@ struct tvcard bttv_tvcards[] = {
.tuner_addr = ADDR_UNSET,
.radio_addr = ADDR_UNSET,
},
+   /*  card 0x94-- */
+   [BTTV_BOARD_DVICO_FUSIONHDTV_2] = {
+   .name   = DViCO FusionHDTV 2,
+   .tuner  = 0,
+   .tuner_type = TUNER_PHILIPS_ATSC, /* FCV1236D */
+   .tuner_addr = ADDR_UNSET,
+   .radio_addr = ADDR_UNSET,
+   .video_inputs   = 3,
+   .audio_inputs   = 1,
+   .svhs   = 2,
+   .muxsel = { 2, 3, 1 },
+   .gpiomask   = 0x00e7,
+   .gpiomux= { 0x0045, 0, 0x0001, 0 },
+   .gpiomute   = 0x00c7,
+   .no_msp34xx = 1,
+   .no_tda9875 = 1,
+   .no_tda7432 = 1,
+   },
 };
 
 static const unsigned int bttv_num_tvcards = ARRAY_SIZE(bttv_tvcards);
diff --git a/drivers/media/video/bt8xx/bttv.h b/drivers/media/video/bt8xx/bttv.h
index 0b4e9f0..dcc847d 100644
--- a/drivers/media/video/bt8xx/bttv.h
+++ b/drivers/media/video/bt8xx/bttv.h
@@ -171,6 +171,7 @@
 #define BTTV_BOARD_SSAI_SECURITY  0x91
 #define BTTV_BOARD_SSAI_ULTRASOUND0x92
 #define BTTV_BOARD_VOODOOTV_200   0x93
+#define BTTV_BOARD_DVICO_FUSIONHDTV_2 0x94
 
 /* more card-specific defines */
 #define PT2254_L_CHANNEL 0x10
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


V4L/DVB (5807): Bttv: Add support for DBG_[SG]_REGISTER ioctls

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=55c0d1005a0e5f590f71f918e49bdc81362f93a6
Commit: 55c0d1005a0e5f590f71f918e49bdc81362f93a6
Parent: 8c2c0dfe4da28a152c0de2c2ca3a66c1bc2fef7c
Author: Trent Piepho [EMAIL PROTECTED]
AuthorDate: Fri Jun 29 00:17:36 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:24:28 2007 -0300

V4L/DVB (5807): Bttv: Add support for DBG_[SG]_REGISTER ioctls

Adds the advanced debugging register read/write ioctl support to the bttv
driver.

Signed-off-by: Trent Piepho [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/video/bt8xx/bttv-driver.c |   22 ++
 1 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/drivers/media/video/bt8xx/bttv-driver.c 
b/drivers/media/video/bt8xx/bttv-driver.c
index 284bdf2..cb555f2 100644
--- a/drivers/media/video/bt8xx/bttv-driver.c
+++ b/drivers/media/video/bt8xx/bttv-driver.c
@@ -2259,6 +2259,24 @@ static int bttv_common_ioctls(struct bttv *btv, unsigned 
int cmd, void *arg)
printk(KERN_INFO bttv%d: ==  END STATUS CARD 
#%d  ==\n, btv-c.nr, btv-c.nr);
return 0;
}
+#ifdef CONFIG_VIDEO_ADV_DEBUG
+   case VIDIOC_DBG_G_REGISTER:
+   case VIDIOC_DBG_S_REGISTER:
+   {
+   struct v4l2_register *reg = arg;
+   if (!capable(CAP_SYS_ADMIN))
+   return -EPERM;
+   if (!v4l2_chip_match_host(reg-match_type, reg-match_chip))
+   return -EINVAL;
+   /* bt848 has a 12-bit register space */
+   reg-reg = 0xfff;
+   if (cmd == VIDIOC_DBG_G_REGISTER)
+   reg-val = btread(reg-reg);
+   else
+   btwrite(reg-val, reg-reg);
+   return 0;
+   }
+#endif
 
default:
return -ENOIOCTLCMD;
@@ -3569,6 +3587,8 @@ static int bttv_do_ioctl(struct inode *inode, struct file 
*file,
case VIDIOC_G_FREQUENCY:
case VIDIOC_S_FREQUENCY:
case VIDIOC_LOG_STATUS:
+   case VIDIOC_DBG_G_REGISTER:
+   case VIDIOC_DBG_S_REGISTER:
return bttv_common_ioctls(btv,cmd,arg);
 
default:
@@ -3951,6 +3971,8 @@ static int radio_do_ioctl(struct inode *inode, struct 
file *file,
case VIDIOCGAUDIO:
case VIDIOCSAUDIO:
case VIDIOC_LOG_STATUS:
+   case VIDIOC_DBG_G_REGISTER:
+   case VIDIOC_DBG_S_REGISTER:
return bttv_common_ioctls(btv,cmd,arg);
 
default:
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


V4L/DVB (5806): Bttv: Be consistent in using symbolic names instead of constants

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8c2c0dfe4da28a152c0de2c2ca3a66c1bc2fef7c
Commit: 8c2c0dfe4da28a152c0de2c2ca3a66c1bc2fef7c
Parent: ac7dc84584310a836d13236767d71545f5b695b3
Author: Trent Piepho [EMAIL PROTECTED]
AuthorDate: Thu Jun 28 18:30:36 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:24:27 2007 -0300

V4L/DVB (5806): Bttv: Be consistent in using symbolic names instead of 
constants

For svhs, tuner, and tuner_type, be consistent in using UNSET instead of -1.

For tuner_type also consistently use the existing constants:
0  = TUNER_TEMIC_PAL
1  = TUNER_PHILIPS_PAL_I
2  = TUNER_PHILIPS_NTSC
4  = TUNER_ABSENT
5  = TUNER_PHILIPS_PAL
21 = TUNER_TEMIC_4039FR5_NTSC
25 = TUNER_LG_PAL_I_FM

Signed-off-by: Trent Piepho [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/video/bt8xx/bttv-cards.c |  364 
 1 files changed, 182 insertions(+), 182 deletions(-)

diff --git a/drivers/media/video/bt8xx/bttv-cards.c 
b/drivers/media/video/bt8xx/bttv-cards.c
index e6cdc99..2aea09c 100644
--- a/drivers/media/video/bt8xx/bttv-cards.c
+++ b/drivers/media/video/bt8xx/bttv-cards.c
@@ -330,7 +330,7 @@ struct tvcard bttv_tvcards[] = {
.tuner  = 0,
.svhs   = 2,
.muxsel = { 2, 3, 1, 0 },
-   .tuner_type = -1,
+   .tuner_type = UNSET,
.tuner_addr = ADDR_UNSET,
.radio_addr = ADDR_UNSET,
},
@@ -345,7 +345,7 @@ struct tvcard bttv_tvcards[] = {
.gpiomux= { 2, 0, 0, 0 },
.gpiomute   = 10,
.needs_tvaudio  = 1,
-   .tuner_type = -1,
+   .tuner_type = UNSET,
.tuner_addr = ADDR_UNSET,
.radio_addr = ADDR_UNSET,
},
@@ -360,7 +360,7 @@ struct tvcard bttv_tvcards[] = {
.gpiomux= { 0, 1, 2, 3 },
.gpiomute   = 4,
.needs_tvaudio  = 1,
-   .tuner_type = -1,
+   .tuner_type = UNSET,
.tuner_addr = ADDR_UNSET,
.radio_addr = ADDR_UNSET,
},
@@ -388,13 +388,13 @@ struct tvcard bttv_tvcards[] = {
.name   = Intel Create and Share PCI/ Smart Video 
Recorder III,
.video_inputs   = 4,
.audio_inputs   = 0,
-   .tuner  = -1,
+   .tuner  = UNSET,
.svhs   = 2,
.gpiomask   = 0,
.muxsel = { 2, 3, 1, 1 },
.gpiomux= { 0 },
.needs_tvaudio  = 0,
-   .tuner_type = 4,
+   .tuner_type = TUNER_ABSENT,
.tuner_addr = ADDR_UNSET,
.radio_addr = ADDR_UNSET,
},
@@ -409,7 +409,7 @@ struct tvcard bttv_tvcards[] = {
.gpiomux= { 0, 1, 0, 1 },
.gpiomute   = 3,
.needs_tvaudio  = 1,
-   .tuner_type = -1,
+   .tuner_type = UNSET,
.tuner_addr = ADDR_UNSET,
.radio_addr = ADDR_UNSET,
},
@@ -424,7 +424,7 @@ struct tvcard bttv_tvcards[] = {
.gpiomux= { 0x0c, 0x04, 0x08, 0x04 },
/*0x04 for some cards ?? */
.needs_tvaudio  = 1,
-   .tuner_type = -1,
+   .tuner_type = UNSET,
.tuner_addr = ADDR_UNSET,
.radio_addr = ADDR_UNSET,
.audio_hook = avermedia_tvphone_audio,
@@ -434,13 +434,13 @@ struct tvcard bttv_tvcards[] = {
.name   = MATRIX-Vision MV-Delta,
.video_inputs   = 5,
.audio_inputs   = 1,
-   .tuner  = -1,
+   .tuner  = UNSET,
.svhs   = 3,
.gpiomask   = 0,
.muxsel = { 2, 3, 1, 0, 0 },
.gpiomux= { 0 },
.needs_tvaudio  = 1,
-   .tuner_type = -1,
+   .tuner_type = UNSET,
.tuner_addr = ADDR_UNSET,
.radio_addr = ADDR_UNSET,
},
@@ -458,7 +458,7 @@ struct tvcard bttv_tvcards[] = {
.gpiomute   = 0xc00,
.needs_tvaudio  = 1,
.pll= PLL_28,
-   .tuner_type = -1,
+   .tuner_type = UNSET,
.tuner_addr = ADDR_UNSET,
.radio_addr = ADDR_UNSET,
},
@@ -489,7 +489,7 @@ struct tvcard bttv_tvcards[] = {
.gpiomute   = 4,

V4L/DVB (5809): Use mutex instead of semaphore in Philips webcam driver

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b9378fdbc334d1575b492108eac822a78c0c46d9
Commit: b9378fdbc334d1575b492108eac822a78c0c46d9
Parent: 55c0d1005a0e5f590f71f918e49bdc81362f93a6
Author: Matthias Kaehlcke [EMAIL PROTECTED]
AuthorDate: Mon Jul 2 10:04:52 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:24:28 2007 -0300

V4L/DVB (5809): Use mutex instead of semaphore in Philips webcam driver

The Philips webcam driver uses a semaphore as mutex. Use the mutex API
instead of the (binary) semaphore.
--

Signed-off-by: Matthias Kaehlcke [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/video/pwc/pwc-if.c |   12 ++--
 drivers/media/video/pwc/pwc.h|4 ++--
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/media/video/pwc/pwc-if.c b/drivers/media/video/pwc/pwc-if.c
index 085332a..9c0e8d1 100644
--- a/drivers/media/video/pwc/pwc-if.c
+++ b/drivers/media/video/pwc/pwc-if.c
@@ -1099,7 +1099,7 @@ static int pwc_video_open(struct inode *inode, struct 
file *file)
return -EBUSY;
}
 
-   down(pdev-modlock);
+   mutex_lock(pdev-modlock);
if (!pdev-usb_init) {
PWC_DEBUG_OPEN(Doing first time initialization.\n);
pdev-usb_init = 1;
@@ -1131,7 +1131,7 @@ static int pwc_video_open(struct inode *inode, struct 
file *file)
if (i  0) {
PWC_DEBUG_OPEN(Failed to allocate buffers memory.\n);
pwc_free_buffers(pdev);
-   up(pdev-modlock);
+   mutex_unlock(pdev-modlock);
return i;
}
 
@@ -1172,7 +1172,7 @@ static int pwc_video_open(struct inode *inode, struct 
file *file)
if (i) {
PWC_DEBUG_OPEN(Second attempt at set_video_mode failed.\n);
pwc_free_buffers(pdev);
-   up(pdev-modlock);
+   mutex_unlock(pdev-modlock);
return i;
}
 
@@ -1181,7 +1181,7 @@ static int pwc_video_open(struct inode *inode, struct 
file *file)
PWC_DEBUG_OPEN(Failed to init ISOC stuff = %d.\n, i);
pwc_isoc_cleanup(pdev);
pwc_free_buffers(pdev);
-   up(pdev-modlock);
+   mutex_unlock(pdev-modlock);
return i;
}
 
@@ -1191,7 +1191,7 @@ static int pwc_video_open(struct inode *inode, struct 
file *file)
 
pdev-vopen++;
file-private_data = vdev;
-   up(pdev-modlock);
+   mutex_unlock(pdev-modlock);
PWC_DEBUG_OPEN( video_open() returns 0.\n);
return 0;
 }
@@ -1685,7 +1685,7 @@ static int usb_pwc_probe(struct usb_interface *intf, 
const struct usb_device_id
pdev-angle_range.tilt_max =  2500;
}
 
-   init_MUTEX(pdev-modlock);
+   mutex_init(pdev-modlock);
spin_lock_init(pdev-ptrlock);
 
pdev-udev = udev;
diff --git a/drivers/media/video/pwc/pwc.h b/drivers/media/video/pwc/pwc.h
index acbb931..910a04f 100644
--- a/drivers/media/video/pwc/pwc.h
+++ b/drivers/media/video/pwc/pwc.h
@@ -31,7 +31,7 @@
 #include linux/wait.h
 #include linux/smp_lock.h
 #include linux/version.h
-#include asm/semaphore.h
+#include linux/mutex.h
 #include asm/errno.h
 #include linux/videodev.h
 #include media/v4l2-common.h
@@ -244,7 +244,7 @@ struct pwc_device
int image_read_pos; /* In case we read data in pieces, keep 
track of were we are in the imagebuffer */
int image_used[MAX_IMAGES]; /* For MCAPTURE and SYNC */
 
-   struct semaphore modlock;   /* to prevent races in video_open(), 
etc */
+   struct mutex modlock;   /* to prevent races in video_open(), 
etc */
spinlock_t ptrlock; /* for manipulating the buffer pointers 
*/
 
/*** motorized pan/tilt feature */
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


V4L/DVB (5811): Use mutex instead of semaphore in Virtual Video driver

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=51b540292a349b380ccc0572401c6ac343acdf4a
Commit: 51b540292a349b380ccc0572401c6ac343acdf4a
Parent: b9378fdbc334d1575b492108eac822a78c0c46d9
Author: Matthias Kaehlcke [EMAIL PROTECTED]
AuthorDate: Mon Jul 2 10:19:38 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:24:29 2007 -0300

V4L/DVB (5811): Use mutex instead of semaphore in Virtual Video driver

The Virtual Video driver uses a semaphore as mutex. Use the mutex API
instead of the (binary) semaphore.

Signed-off-by: Matthias Kaehlcke [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/video/vivi.c |   15 ---
 1 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/media/video/vivi.c b/drivers/media/video/vivi.c
index 582c6ba..f6d3a94 100644
--- a/drivers/media/video/vivi.c
+++ b/drivers/media/video/vivi.c
@@ -25,6 +25,7 @@
 #include linux/pci.h
 #include linux/random.h
 #include linux/version.h
+#include linux/mutex.h
 #include linux/videodev2.h
 #include linux/dma-mapping.h
 #ifdef CONFIG_VIDEO_V4L1_COMPAT
@@ -165,7 +166,7 @@ static LIST_HEAD(vivi_devlist);
 struct vivi_dev {
struct list_head   vivi_devlist;
 
-   struct semaphore   lock;
+   struct mutex   lock;
 
intusers;
 
@@ -738,16 +739,16 @@ static struct videobuf_queue_ops vivi_video_qops = {
 static int res_get(struct vivi_dev *dev, struct vivi_fh *fh)
 {
/* is it free? */
-   down(dev-lock);
+   mutex_lock(dev-lock);
if (dev-resources) {
/* no, someone else uses it */
-   up(dev-lock);
+   mutex_unlock(dev-lock);
return 0;
}
/* it's free, grab it */
dev-resources =1;
dprintk(1,res: get\n);
-   up(dev-lock);
+   mutex_unlock(dev-lock);
return 1;
 }
 
@@ -758,10 +759,10 @@ static int res_locked(struct vivi_dev *dev)
 
 static void res_free(struct vivi_dev *dev, struct vivi_fh *fh)
 {
-   down(dev-lock);
+   mutex_lock(dev-lock);
dev-resources = 0;
dprintk(1,res: put\n);
-   up(dev-lock);
+   mutex_lock(dev-lock);
 }
 
 /* --
@@ -1260,7 +1261,7 @@ static int __init vivi_init(void)
init_waitqueue_head(dev-vidq.wq);
 
/* initialize locks */
-   init_MUTEX(dev-lock);
+   mutex_init(dev-lock);
 
dev-vidq.timeout.function = vivi_vid_timeout;
dev-vidq.timeout.data = (unsigned long)dev;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


V4L/DVB (5813): TUNER_TEA5761 kconfig fixes

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8fb2191a74a0e2a29002c06084e015d33d2ecdda
Commit: 8fb2191a74a0e2a29002c06084e015d33d2ecdda
Parent: 51b540292a349b380ccc0572401c6ac343acdf4a
Author: Adrian Bunk [EMAIL PROTECTED]
AuthorDate: Sun Jul 1 18:22:00 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:24:33 2007 -0300

V4L/DVB (5813): TUNER_TEA5761 kconfig fixes

The following doesn't make much sense:
drivers/media/video/Kconfig:
...
config TUNER_TEA5761
tristate TEA 5761 radio tuner (EXPERIMENTAL)
...
drivers/media/video/Makefile:
...
ifneq ($(CONFIG_TUNER_TEA5761),)
  tuner-objs += tea5761.o
endif
...
With this setup, TUNER_TEA5761=m is equivalent to TUNER_TEA5761=y.
This patch therefore changes TUNER_TEA5761 to a bool.
The missing dependency on EXPERIMENTAL the prompt text indicates also
gets added by this patch.
Additionally, the Makefile entry can now be written in a more compact way.

Signed-off-by: Adrian Bunk [EMAIL PROTECTED]
Signed-off-by: Michael Krufky [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/video/Kconfig  |3 ++-
 drivers/media/video/Makefile |4 +---
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig
index bb072ab..9dcbffd 100644
--- a/drivers/media/video/Kconfig
+++ b/drivers/media/video/Kconfig
@@ -490,7 +490,8 @@ config TUNER_3036
  If in doubt, say N.
 
 config TUNER_TEA5761
-   tristate TEA 5761 radio tuner (EXPERIMENTAL)
+   bool TEA 5761 radio tuner (EXPERIMENTAL)
+   depends on EXPERIMENTAL
depends on I2C
select VIDEO_TUNER
help
diff --git a/drivers/media/video/Makefile b/drivers/media/video/Makefile
index 4cddc8c..10b4d44 100644
--- a/drivers/media/video/Makefile
+++ b/drivers/media/video/Makefile
@@ -7,9 +7,7 @@ zr36067-objs:=  zoran_procfs.o zoran_device.o \
 tuner-objs :=  tuner-core.o tuner-types.o tuner-simple.o \
mt20xx.o tda8290.o tea5767.o tda9887.o
 
-ifneq ($(CONFIG_TUNER_TEA5761),)
-  tuner-objs += tea5761.o
-endif
+tuner-$(CONFIG_TUNER_TEA5761)  += tea5761.o
 
 msp3400-objs   :=  msp3400-driver.o msp3400-kthreads.o
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


V4L/DVB (5814): Unexport dvb_pll_configure

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4de7bb44cc6aa6e0a74f80c628f600da5b8fcd47
Commit: 4de7bb44cc6aa6e0a74f80c628f600da5b8fcd47
Parent: 8fb2191a74a0e2a29002c06084e015d33d2ecdda
Author: Adrian Bunk [EMAIL PROTECTED]
AuthorDate: Sun Jul 1 18:24:33 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:24:34 2007 -0300

V4L/DVB (5814): Unexport dvb_pll_configure

Now that it's static, it should no longer be exported to modules...

Signed-off-by: Adrian Bunk [EMAIL PROTECTED]
Signed-off-by: Michael Krufky [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/dvb/frontends/dvb-pll.c |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/media/dvb/frontends/dvb-pll.c 
b/drivers/media/dvb/frontends/dvb-pll.c
index f3d500e..0c0b947 100644
--- a/drivers/media/dvb/frontends/dvb-pll.c
+++ b/drivers/media/dvb/frontends/dvb-pll.c
@@ -606,7 +606,6 @@ static int dvb_pll_configure(struct dvb_pll_desc *desc, u8 
*buf,
// calculate the frequency we set it to
return (div * desc-entries[i].stepsize) - desc-iffreq;
 }
-EXPORT_SYMBOL(dvb_pll_configure);
 
 static int dvb_pll_release(struct dvb_frontend *fe)
 {
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


V4L/DVB (5815): Cx88: i2c structure templates clean-up

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7e520d09f1a4b3da1d09a4540e3f4fa852658a0d
Commit: 7e520d09f1a4b3da1d09a4540e3f4fa852658a0d
Parent: 4de7bb44cc6aa6e0a74f80c628f600da5b8fcd47
Author: Jean Delvare [EMAIL PROTECTED]
AuthorDate: Sun Jul 1 18:37:51 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:24:34 2007 -0300

V4L/DVB (5815): Cx88: i2c structure templates clean-up

Clean up the use of structure templates in cx88-i2c and cx88-vp3054-i2c.
For one thing, a real template is supposed to be read-only. And in some
cases it's more efficient to initialize the few fields we need
individually.

This clean-up shrinks cx88-i2c.o by 33% and cx88-vp3054-i2c.o by 49%
(x86_64).

Signed-off-by: Jean Delvare [EMAIL PROTECTED]
Signed-off-by: Michael Krufky [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/video/cx88/cx88-i2c.c|   25 +++--
 drivers/media/video/cx88/cx88-vp3054-i2c.c |   12 +++-
 2 files changed, 10 insertions(+), 27 deletions(-)

diff --git a/drivers/media/video/cx88/cx88-i2c.c 
b/drivers/media/video/cx88/cx88-i2c.c
index 7919a1f..78bbcfa 100644
--- a/drivers/media/video/cx88/cx88-i2c.c
+++ b/drivers/media/video/cx88/cx88-i2c.c
@@ -160,7 +160,7 @@ void cx88_call_i2c_clients(struct cx88_core *core, unsigned 
int cmd, void *arg)
i2c_clients_command(core-i2c_adap, cmd, arg);
 }
 
-static struct i2c_algo_bit_data cx8800_i2c_algo_template = {
+static const struct i2c_algo_bit_data cx8800_i2c_algo_template = {
.setsda  = cx8800_bit_setsda,
.setscl  = cx8800_bit_setscl,
.getsda  = cx8800_bit_getsda,
@@ -171,18 +171,6 @@ static struct i2c_algo_bit_data cx8800_i2c_algo_template = 
{
 
 /* --- */
 
-static struct i2c_adapter cx8800_i2c_adap_template = {
-   .name  = cx2388x,
-   .owner = THIS_MODULE,
-   .id= I2C_HW_B_CX2388x,
-   .client_register   = attach_inform,
-   .client_unregister = detach_inform,
-};
-
-static struct i2c_client cx8800_i2c_client_template = {
-   .name   = cx88xx internal,
-};
-
 static char *i2c_devs[128] = {
[ 0x1c  1 ] = lgdt330x,
[ 0x86  1 ] = tda9887/cx22702,
@@ -212,14 +200,9 @@ int cx88_i2c_init(struct cx88_core *core, struct pci_dev 
*pci)
/* Prevents usage of invalid delay values */
if (i2c_udelay5)
i2c_udelay=5;
-   cx8800_i2c_algo_template.udelay=i2c_udelay;
 
-   memcpy(core-i2c_adap, cx8800_i2c_adap_template,
-  sizeof(core-i2c_adap));
memcpy(core-i2c_algo, cx8800_i2c_algo_template,
   sizeof(core-i2c_algo));
-   memcpy(core-i2c_client, cx8800_i2c_client_template,
-  sizeof(core-i2c_client));
 
if (core-tuner_type != TUNER_ABSENT)
core-i2c_adap.class |= I2C_CLASS_TV_ANALOG;
@@ -228,10 +211,16 @@ int cx88_i2c_init(struct cx88_core *core, struct pci_dev 
*pci)
 
core-i2c_adap.dev.parent = pci-dev;
strlcpy(core-i2c_adap.name,core-name,sizeof(core-i2c_adap.name));
+   core-i2c_adap.owner = THIS_MODULE;
+   core-i2c_adap.id = I2C_HW_B_CX2388x;
+   core-i2c_adap.client_register = attach_inform;
+   core-i2c_adap.client_unregister = detach_inform;
+   core-i2c_algo.udelay = i2c_udelay;
core-i2c_algo.data = core;
i2c_set_adapdata(core-i2c_adap,core);
core-i2c_adap.algo_data = core-i2c_algo;
core-i2c_client.adapter = core-i2c_adap;
+   strlcpy(core-i2c_client.name, cx88xx internal, I2C_NAME_SIZE);
 
cx8800_bit_setscl(core,1);
cx8800_bit_setsda(core,1);
diff --git a/drivers/media/video/cx88/cx88-vp3054-i2c.c 
b/drivers/media/video/cx88/cx88-vp3054-i2c.c
index 82bc3a2..cd08776 100644
--- a/drivers/media/video/cx88/cx88-vp3054-i2c.c
+++ b/drivers/media/video/cx88/cx88-vp3054-i2c.c
@@ -94,7 +94,7 @@ static int vp3054_bit_getsda(void *data)
 
 /* --- */
 
-static struct i2c_algo_bit_data vp3054_i2c_algo_template = {
+static const struct i2c_algo_bit_data vp3054_i2c_algo_template = {
.setsda  = vp3054_bit_setsda,
.setscl  = vp3054_bit_setscl,
.getsda  = vp3054_bit_getsda,
@@ -105,12 +105,6 @@ static struct i2c_algo_bit_data vp3054_i2c_algo_template = 
{
 
 /* --- */
 
-static struct i2c_adapter vp3054_i2c_adap_template = {
-   .name  = cx2388x,
-   .owner = THIS_MODULE,
-   .id= I2C_HW_B_CX2388x,
-};
-
 int vp3054_i2c_probe(struct cx8802_dev *dev)
 {
struct cx88_core *core = dev-core;
@@ -125,8 +119,6 @@ int vp3054_i2c_probe(struct cx8802_dev *dev)

V4L/DVB (5819): Cleanup: reorder some includes

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=18f3fa1e2eab297a2f7ec704385fa0ecfda0de55
Commit: 18f3fa1e2eab297a2f7ec704385fa0ecfda0de55
Parent: 7e520d09f1a4b3da1d09a4540e3f4fa852658a0d
Author: Mauro Carvalho Chehab [EMAIL PROTECTED]
AuthorDate: Mon Jul 2 15:39:57 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:24:35 2007 -0300

V4L/DVB (5819): Cleanup: reorder some includes

Some includes were added after some non-include macros, on old drivers.
Better to keep all includes at the beginning of the files. This change
also helps to make backports to properly work at the development tree.

Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/video/adv7170.c |8 
 drivers/media/video/adv7175.c |8 
 drivers/media/video/bt819.c   |9 +
 drivers/media/video/bt856.c   |8 
 drivers/media/video/bt8xx/bttvp.h |2 +-
 drivers/media/video/saa7111.c |8 
 drivers/media/video/saa7114.c |   10 --
 drivers/media/video/saa7185.c |8 
 8 files changed, 30 insertions(+), 31 deletions(-)

diff --git a/drivers/media/video/adv7170.c b/drivers/media/video/adv7170.c
index 823cd6c..cbab53f 100644
--- a/drivers/media/video/adv7170.c
+++ b/drivers/media/video/adv7170.c
@@ -38,23 +38,23 @@
 #include linux/slab.h
 #include linux/mm.h
 #include linux/signal.h
+#include linux/types.h
+#include linux/i2c.h
 #include asm/io.h
 #include asm/pgtable.h
 #include asm/page.h
-#include linux/types.h
+#include asm/uaccess.h
 
 #include linux/videodev.h
-#include asm/uaccess.h
+#include linux/video_encoder.h
 
 MODULE_DESCRIPTION(Analog Devices ADV7170 video encoder driver);
 MODULE_AUTHOR(Maxim Yevtyushkin);
 MODULE_LICENSE(GPL);
 
-#include linux/i2c.h
 
 #define I2C_NAME(x) (x)-name
 
-#include linux/video_encoder.h
 
 static int debug = 0;
 module_param(debug, int, 0);
diff --git a/drivers/media/video/adv7175.c b/drivers/media/video/adv7175.c
index 05c7820..0d0c554 100644
--- a/drivers/media/video/adv7175.c
+++ b/drivers/media/video/adv7175.c
@@ -34,23 +34,23 @@
 #include linux/slab.h
 #include linux/mm.h
 #include linux/signal.h
+#include linux/types.h
+#include linux/i2c.h
 #include asm/io.h
 #include asm/pgtable.h
 #include asm/page.h
-#include linux/types.h
+#include asm/uaccess.h
 
 #include linux/videodev.h
-#include asm/uaccess.h
+#include linux/video_encoder.h
 
 MODULE_DESCRIPTION(Analog Devices ADV7175 video encoder driver);
 MODULE_AUTHOR(Dave Perks);
 MODULE_LICENSE(GPL);
 
-#include linux/i2c.h
 
 #define I2C_NAME(s) (s)-name
 
-#include linux/video_encoder.h
 
 static int debug = 0;
 module_param(debug, int, 0);
diff --git a/drivers/media/video/bt819.c b/drivers/media/video/bt819.c
index 59a4360..12d1b92 100644
--- a/drivers/media/video/bt819.c
+++ b/drivers/media/video/bt819.c
@@ -38,23 +38,24 @@
 #include linux/slab.h
 #include linux/mm.h
 #include linux/signal.h
+#include linux/types.h
+#include linux/i2c.h
 #include asm/io.h
 #include asm/pgtable.h
 #include asm/page.h
-#include linux/types.h
+#include asm/uaccess.h
 
 #include linux/videodev.h
-#include asm/uaccess.h
+#include linux/video_decoder.h
+
 
 MODULE_DESCRIPTION(Brooktree-819 video decoder driver);
 MODULE_AUTHOR(Mike Bernson  Dave Perks);
 MODULE_LICENSE(GPL);
 
-#include linux/i2c.h
 
 #define I2C_NAME(s) (s)-name
 
-#include linux/video_decoder.h
 
 static int debug = 0;
 module_param(debug, int, 0);
diff --git a/drivers/media/video/bt856.c b/drivers/media/video/bt856.c
index 853b1a3..e1028a7 100644
--- a/drivers/media/video/bt856.c
+++ b/drivers/media/video/bt856.c
@@ -38,23 +38,23 @@
 #include linux/slab.h
 #include linux/mm.h
 #include linux/signal.h
+#include linux/types.h
+#include linux/i2c.h
+#include linux/video_encoder.h
 #include asm/io.h
 #include asm/pgtable.h
 #include asm/page.h
-#include linux/types.h
+#include asm/uaccess.h
 
 #include linux/videodev.h
-#include asm/uaccess.h
 
 MODULE_DESCRIPTION(Brooktree-856A video encoder driver);
 MODULE_AUTHOR(Mike Bernson  Dave Perks);
 MODULE_LICENSE(GPL);
 
-#include linux/i2c.h
 
 #define I2C_NAME(s) (s)-name
 
-#include linux/video_encoder.h
 
 static int debug = 0;
 module_param(debug, int, 0);
diff --git a/drivers/media/video/bt8xx/bttvp.h 
b/drivers/media/video/bt8xx/bttvp.h
index 8f44f02..bd85f6d 100644
--- a/drivers/media/video/bt8xx/bttvp.h
+++ b/drivers/media/video/bt8xx/bttvp.h
@@ -33,12 +33,12 @@
 #include linux/i2c.h
 #include linux/i2c-algo-bit.h
 #include linux/videodev.h
-#include media/v4l2-common.h
 #include linux/pci.h
 #include linux/input.h
 #include linux/mutex.h
 #include asm/scatterlist.h
 #include asm/io.h
+#include media/v4l2-common.h
 
 #include linux/device.h
 #include media/video-buf.h
diff --git a/drivers/media/video/saa7111.c b/drivers/media/video/saa7111.c
index c1a392e..7ae2d64 100644
--- a/drivers/media/video/saa7111.c

V4L/DVB (5820): Cleanup on cinergyT2: Remove unneeded if(1)

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9b7cc42917ed07ab75269d35cd7709a5fd6336e0
Commit: 9b7cc42917ed07ab75269d35cd7709a5fd6336e0
Parent: 18f3fa1e2eab297a2f7ec704385fa0ecfda0de55
Author: Mauro Carvalho Chehab [EMAIL PROTECTED]
AuthorDate: Mon Jul 2 15:48:40 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:24:35 2007 -0300

V4L/DVB (5820): Cleanup on cinergyT2: Remove unneeded if(1)

Before kernel 2.6.14, the driver checked for status before stopping the
thread. So, a compatibility test did exist. After 2.6.14, the
if (state)
were replaced by:
if (1)
However, it makes no sense to keep the if(1).

Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/dvb/cinergyT2/cinergyT2.c |   17 +++--
 1 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/drivers/media/dvb/cinergyT2/cinergyT2.c 
b/drivers/media/dvb/cinergyT2/cinergyT2.c
index bc22064..5a1449f 100644
--- a/drivers/media/dvb/cinergyT2/cinergyT2.c
+++ b/drivers/media/dvb/cinergyT2/cinergyT2.c
@@ -1000,18 +1000,15 @@ static int cinergyt2_suspend (struct usb_interface 
*intf, pm_message_t state)
if (cinergyt2-disconnect_pending || 
mutex_lock_interruptible(cinergyt2-wq_sem))
return -ERESTARTSYS;
 
-   if (1) {
-   cinergyt2_suspend_rc(cinergyt2);
-   cancel_rearming_delayed_work(cinergyt2-query_work);
+   cinergyt2_suspend_rc(cinergyt2);
+   cancel_rearming_delayed_work(cinergyt2-query_work);
 
-   mutex_lock(cinergyt2-sem);
-   if (cinergyt2-streaming)
-   cinergyt2_stop_stream_xfer(cinergyt2);
-   cinergyt2_sleep(cinergyt2, 1);
-   mutex_unlock(cinergyt2-sem);
-   }
+   mutex_lock(cinergyt2-sem);
+   if (cinergyt2-streaming)
+   cinergyt2_stop_stream_xfer(cinergyt2);
+   cinergyt2_sleep(cinergyt2, 1);
+   mutex_unlock(cinergyt2-sem);
 
-   mutex_unlock(cinergyt2-wq_sem);
return 0;
 }
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


V4L/DVB (5821): Saa7134: add remote control support for LifeView FlyDVB-S LR300

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f5c965abdf44ee6983712e54bbbcc7905af56d39
Commit: f5c965abdf44ee6983712e54bbbcc7905af56d39
Parent: 9b7cc42917ed07ab75269d35cd7709a5fd6336e0
Author: James Le Cuirot chewi at aura-online.co.uk
AuthorDate: Mon Jul 2 12:53:25 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:24:36 2007 -0300

V4L/DVB (5821): Saa7134: add remote control support for LifeView FlyDVB-S 
LR300

It has been confirmed that the FlyDVB IR codes currently in the kernel
work with the LifeView FlyDVB-S LR300. This one line addition adds it
to the list of supported cards.

Signed-off-by: James Le Cuirot [EMAIL PROTECTED]
Signed-off-by: Michael Krufky [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/video/saa7134/saa7134-input.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/media/video/saa7134/saa7134-input.c 
b/drivers/media/video/saa7134/saa7134-input.c
index 063487e..1b6dfd8 100644
--- a/drivers/media/video/saa7134/saa7134-input.c
+++ b/drivers/media/video/saa7134/saa7134-input.c
@@ -311,6 +311,7 @@ int saa7134_input_init1(struct saa7134_dev *dev)
mask_keycode = 0x003F00;
mask_keyup   = 0x04;
break;
+   case SAA7134_BOARD_FLYDVBS_LR300:
case SAA7134_BOARD_FLYDVBT_LR301:
case SAA7134_BOARD_FLYDVBTDUO:
ir_codes = ir_codes_flydvb;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


V4L/DVB (5825): Alter the tuner type for the WinTV USB UK PAL model.

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ffddcaa6ec4e85ed8504deac1f51f44c86ec1d23
Commit: ffddcaa6ec4e85ed8504deac1f51f44c86ec1d23
Parent: a1bad7773e562f331b5951def24f73c38579e0cb
Author: Matthew Garrett [EMAIL PROTECTED]
AuthorDate: Sat Jun 30 15:41:27 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:24:37 2007 -0300

V4L/DVB (5825): Alter the tuner type for the WinTV USB UK PAL model.

Alter the tuner type for the WinTV USB UK PAL model.

Signed-off-by: Matthew Garrett [EMAIL PROTECTED]
Signed-off-by: Thierry MERLE [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/video/usbvision/usbvision-cards.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/media/video/usbvision/usbvision-cards.c 
b/drivers/media/video/usbvision/usbvision-cards.c
index eaae6f4..380564c 100644
--- a/drivers/media/video/usbvision/usbvision-cards.c
+++ b/drivers/media/video/usbvision/usbvision-cards.c
@@ -586,7 +586,7 @@ struct usbvision_device_data_st  usbvision_device_data[] = {
.Radio = 0,
.vbi   = 1,
.Tuner = 1,
-   .TunerType = TUNER_PHILIPS_PAL,
+   .TunerType = TUNER_LG_PAL_NEW_TAPC,
.X_Offset  = 0,
.Y_Offset  = 3,
.Dvi_yuv_override = 1,
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


V4L/DVB (5826): Usbvision: video mux cleanup

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=66a17879e9f18a38c4ca5e6ba600a3f5b1b51188
Commit: 66a17879e9f18a38c4ca5e6ba600a3f5b1b51188
Parent: ffddcaa6ec4e85ed8504deac1f51f44c86ec1d23
Author: Thierry MERLE [EMAIL PROTECTED]
AuthorDate: Tue Jun 26 16:35:30 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:24:38 2007 -0300

V4L/DVB (5826): Usbvision: video mux cleanup

- usbvision_muxsel simplified, now uses some well known constants.
- since the decoder needs to change input norm, call to muxsel added when
  changing video standard.

Signed-off-by: Thierry MERLE [EMAIL PROTECTED]
Acked-by: Dwaine Garden [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/video/usbvision/usbvision-core.c  |   33 ++
 drivers/media/video/usbvision/usbvision-video.c |5 ++-
 drivers/media/video/usbvision/usbvision.h   |1 -
 3 files changed, 18 insertions(+), 21 deletions(-)

diff --git a/drivers/media/video/usbvision/usbvision-core.c 
b/drivers/media/video/usbvision/usbvision-core.c
index 0127be9..5b1e346 100644
--- a/drivers/media/video/usbvision/usbvision-core.c
+++ b/drivers/media/video/usbvision/usbvision-core.c
@@ -2537,7 +2537,9 @@ void usbvision_stop_isoc(struct usb_usbvision *usbvision)
 
 int usbvision_muxsel(struct usb_usbvision *usbvision, int channel)
 {
-   int mode[4];
+   /* inputs #0 and #3 are constant for every SAA711x. */
+   /* inputs #1 and #2 are variable for SAA7111 and SAA7113 */
+   int mode[4]= {SAA7115_COMPOSITE0, 0, 0, SAA7115_COMPOSITE3};
int audio[]= {1, 0, 0, 0};
struct v4l2_routing route;
//channel 0 is TV with audiochannel 1 (tuner mono)
@@ -2547,10 +2549,6 @@ int usbvision_muxsel(struct usb_usbvision *usbvision, 
int channel)
 
RESTRICT_TO_RANGE(channel, 0, usbvision-video_inputs);
usbvision-ctl_input = channel;
- route.input = SAA7115_COMPOSITE1;
- route.output = 0;
- call_i2c_clients(usbvision, VIDIOC_INT_S_VIDEO_ROUTING,route);
- call_i2c_clients(usbvision, VIDIOC_S_INPUT, usbvision-ctl_input);
 
// set the new channel
// Regular USB TV Tuners - channel: 0 = Television, 1 = Composite, 2 = 
S-Video
@@ -2558,28 +2556,27 @@ int usbvision_muxsel(struct usb_usbvision *usbvision, 
int channel)
 
switch (usbvision_device_data[usbvision-DevModel].Codec) {
case CODEC_SAA7113:
-   if (SwitchSVideoInput) { // To handle problems with 
S-Video Input for some devices.  Use SwitchSVideoInput parameter when loading 
the module.
-   mode[2] = 1;
+   mode[1] = SAA7115_COMPOSITE2;
+   if (SwitchSVideoInput) {
+   /* To handle problems with S-Video Input for
+* some devices.  Use SwitchSVideoInput
+* parameter when loading the module.*/
+   mode[2] = SAA7115_COMPOSITE1;
}
else {
-   mode[2] = 7;
-   }
-   if 
(usbvision_device_data[usbvision-DevModel].VideoChannels == 4) {
-   mode[0] = 0; mode[1] = 2; mode[3] = 3;  // 
Special for four input devices
-   }
-   else {
-   mode[0] = 0; mode[1] = 2; //modes for regular 
saa7113 devices
+   mode[2] = SAA7115_SVIDEO1;
}
break;
case CODEC_SAA7111:
-   mode[0] = 0; mode[1] = 1; mode[2] = 7; //modes for 
saa7111
-   break;
default:
-   mode[0] = 0; mode[1] = 1; mode[2] = 7; //default modes
+   /* modes for saa7111 */
+   mode[1] = SAA7115_COMPOSITE1;
+   mode[2] = SAA7115_SVIDEO1;
+   break;
}
route.input = mode[channel];
+   route.output = 0;
call_i2c_clients(usbvision, VIDIOC_INT_S_VIDEO_ROUTING,route);
-   usbvision-channel = channel;
usbvision_set_audio(usbvision, audio[channel]);
return 0;
 }
diff --git a/drivers/media/video/usbvision/usbvision-video.c 
b/drivers/media/video/usbvision/usbvision-video.c
index 8d53c8a..868b688 100644
--- a/drivers/media/video/usbvision/usbvision-video.c
+++ b/drivers/media/video/usbvision/usbvision-video.c
@@ -637,10 +637,9 @@ static int vidioc_s_input (struct file *file, void *priv, 
unsigned int input)
 
if ((input = usbvision-video_inputs) || (input  0) )
return -EINVAL;
-   usbvision-ctl_input = input;
 
down(usbvision-lock);
-   usbvision_muxsel(usbvision, 

V4L/DVB (5828): Kconfig: Added GemTek USB radio and removed experimental dependency.

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b31c33bd8b339e426138dd267ec969291f802a0d
Commit: b31c33bd8b339e426138dd267ec969291f802a0d
Parent: 66a17879e9f18a38c4ca5e6ba600a3f5b1b51188
Author: Douglas Schilling Landgraf [EMAIL PROTECTED]
AuthorDate: Mon Jul 2 23:16:17 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:24:39 2007 -0300

V4L/DVB (5828): Kconfig: Added GemTek USB radio and removed experimental 
dependency.

Added GemTek USB radio and removed experimental dependency.

Signed-off-by: Douglas Schilling Landgraf [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/radio/Kconfig |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/radio/Kconfig b/drivers/media/radio/Kconfig
index 194b102..f8bf9fe 100644
--- a/drivers/media/radio/Kconfig
+++ b/drivers/media/radio/Kconfig
@@ -324,8 +324,8 @@ config RADIO_ZOLTRIX_PORT
  Enter the I/O port of your Zoltrix radio card.
 
 config USB_DSBR
-   tristate D-Link USB FM radio support (EXPERIMENTAL)
-   depends on USB  VIDEO_V4L2  EXPERIMENTAL
+   tristate D-Link/GemTek USB FM radio support
+   depends on USB  VIDEO_V4L2
---help---
  Say Y here if you want to connect this type of radio to your
  computer's USB port. Note that the audio is not digital, and
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


V4L/DVB (5829): Firmware extract and loading for opera dvb-usb update

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=59800555f79a52394c3c29e19e448b4635daf14c
Commit: 59800555f79a52394c3c29e19e448b4635daf14c
Parent: b31c33bd8b339e426138dd267ec969291f802a0d
Author: Marco Gittler [EMAIL PROTECTED]
AuthorDate: Wed Jul 4 19:18:34 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:24:41 2007 -0300

V4L/DVB (5829): Firmware extract and loading for opera dvb-usb update

Better way of creating and loading the firmware used.
Update for get_dvb_firmware script to extract the files for opera usb-box
Help file for creating the firmware added

Signed-off-by: Marco Gittler [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 Documentation/dvb/get_dvb_firmware   |   61 +-
 Documentation/dvb/opera-firmware.txt |   27 +++
 drivers/media/dvb/dvb-usb/opera1.c   |   17 +
 3 files changed, 97 insertions(+), 8 deletions(-)

diff --git a/Documentation/dvb/get_dvb_firmware 
b/Documentation/dvb/get_dvb_firmware
index e32f79e..b4d306a 100644
--- a/Documentation/dvb/get_dvb_firmware
+++ b/Documentation/dvb/get_dvb_firmware
@@ -24,7 +24,8 @@ use IO::Handle;
 @components = ( sp8870, sp887x, tda10045, tda10046,
tda10046lifeview, av7110, dec2000t, dec2540t,
dec3000s, vp7041, dibusb, nxt2002, nxt2004,
-   or51211, or51132_qam, or51132_vsb, bluebird);
+   or51211, or51132_qam, or51132_vsb, bluebird,
+   opera1);
 
 # Check args
 syntax() if (scalar(@ARGV) != 1);
@@ -210,6 +211,45 @@ sub dec3000s {
 
 $outfile;
 }
+sub opera1{
+   my $tmpdir = tempdir(DIR = /tmp, CLEANUP = 0);
+
+   checkstandard();
+   my $fwfile1=dvb-usb-opera1-fpga-01.fw;
+   my $fwfile2=dvb-usb-opera-01.fw;
+   extract(2830SCap2.sys, 0x62e8, 55024, $tmpdir/opera1-fpga.fw);
+   extract(2830SLoad2.sys,0x3178,0x3685-0x3178,$tmpdir/fw1part1);
+   extract(2830SLoad2.sys,0x0980,0x3150-0x0980,$tmpdir/fw1part2);
+   delzero($tmpdir/fw1part1,$tmpdir/fw1part1-1);
+   delzero($tmpdir/fw1part2,$tmpdir/fw1part2-1);
+   verify($tmpdir/fw1part1-1,5e0909858fdf0b5b09ad48b9fe622e70);
+   verify($tmpdir/fw1part2-1,d6e146f321427e931df2c6fcadac37a1);
+   verify($tmpdir/opera1-fpga.fw,0f8133f5e9051f5f3c1928f7e5a1b07d);
+
+   my $RES1=\x01\x92\x7f\x00\x01\x00;
+   my $RES0=\x01\x92\x7f\x00\x00\x00;
+   my $DAT1=\x01\x00\xe6\x00\x01\x00;
+   my $DAT0=\x01\x00\xe6\x00\x00\x00;
+   open FW,$tmpdir/opera.fw;
+   print FW $RES1;
+   print FW $DAT1;
+   print FW $RES1;
+   print FW $DAT1;
+   appendfile(FW,$tmpdir/fw1part1-1);
+   print FW $RES0;
+   print FW $DAT0;
+   print FW $RES1;
+   print FW $DAT1;
+   appendfile(FW,$tmpdir/fw1part2-1);
+   print FW $RES1;
+   print FW $DAT1;
+   print FW $RES0;
+   print FW $DAT0;
+   copy ($tmpdir/opera1-fpga.fw,$fwfile1);
+   copy ($tmpdir/opera.fw,$fwfile2);
+
+   $fwfile1.,.$fwfile2;
+}
 
 sub vp7041 {
 my $sourcefile = 2.422.zip;
@@ -440,6 +480,25 @@ sub appendfile {
 close(INFILE);
 }
 
+sub delzero{
+   my ($infile,$outfile) [EMAIL PROTECTED];
+
+   open INFILE,$infile;
+   open OUTFILE,$outfile;
+   while (1){
+   $rcount=sysread(INFILE,$buf,22);
+   $len=ord(substr($buf,0,1));
+   print OUTFILE substr($buf,0,1);
+   print OUTFILE substr($buf,2,$len+3);
+   last if ($rcount1);
+   printf OUTFILE %c,0;
+#print $len. .length($buf).\n;
+
+   }
+   close(INFILE);
+   close(OUTFILE);
+}
+
 sub syntax() {
 print STDERR syntax: get_dvb_firmware component\n;
 print STDERR Supported components:\n;
diff --git a/Documentation/dvb/opera-firmware.txt 
b/Documentation/dvb/opera-firmware.txt
new file mode 100644
index 000..93e784c
--- /dev/null
+++ b/Documentation/dvb/opera-firmware.txt
@@ -0,0 +1,27 @@
+To extract the firmware for the Opera DVB-S1 USB-Box
+you need to copy the files:
+
+2830SCap2.sys
+2830SLoad2.sys
+
+from the windriver disk into this directory.
+
+Then run
+
+./get_dvb_firware opera1
+
+and after that you have 2 files:
+
+dvb-usb-opera-01.fw
+dvb-usb-opera1-fpga-01.fw
+
+in here.
+
+Copy them into /lib/firmware/ .
+
+After that the driver can load the firmware
+(if you have enabled firmware loading
+in kernel config and have hotplug running).
+
+
+Marco Gittler [EMAIL PROTECTED]
\ No newline at end of file
diff --git a/drivers/media/dvb/dvb-usb/opera1.c 
b/drivers/media/dvb/dvb-usb/opera1.c
index cdb0221..d7c0495 100644
--- a/drivers/media/dvb/dvb-usb/opera1.c
+++ b/drivers/media/dvb/dvb-usb/opera1.c
@@ -435,9 +435,9 @@ static int opera1_xilinx_load_firmware(struct usb_device 
*dev,
 {
const struct firmware *fw = NULL;
u8 *b, *p;
-   int ret = 0, i;
+   int ret = 0, i,fpgasize=40;
 

V4L/DVB (5832): ir-common: optimize bit extract function

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d67be61ebe5efaf9c4c11bf168781d678854c966
Commit: d67be61ebe5efaf9c4c11bf168781d678854c966
Parent: ba2cf98249795f03792d1409a3b6aaa589ea0745
Author: Trent Piepho [EMAIL PROTECTED]
AuthorDate: Wed Jul 11 20:28:44 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:24:42 2007 -0300

V4L/DVB (5832): ir-common: optimize bit extract function

New code is simpler, shorter, compiles to about half the size, and is 2
to 4 times faster depending on how many bits in the mask are set.

Signed-off-by: Trent Piepho [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/common/ir-functions.c |   23 +++
 1 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/drivers/media/common/ir-functions.c 
b/drivers/media/common/ir-functions.c
index fcb1941..fe447a0 100644
--- a/drivers/media/common/ir-functions.c
+++ b/drivers/media/common/ir-functions.c
@@ -107,21 +107,20 @@ void ir_input_keydown(struct input_dev *dev, struct 
ir_input_state *ir,
 }
 
 /* -- 
*/
-
+/* extract mask bits out of data and pack them into the result */
 u32 ir_extract_bits(u32 data, u32 mask)
 {
-   int mbit, vbit;
-   u32 value;
+   u32 vbit = 1, value = 0;
+
+   do {
+   if (mask1) {
+   if (data1)
+   value |= vbit;
+   vbit=1;
+   }
+   data=1;
+   } while (mask=1);
 
-   value = 0;
-   vbit  = 0;
-   for (mbit = 0; mbit  32; mbit++) {
-   if (!(mask  ((u32)1  mbit)))
-   continue;
-   if (data  ((u32)1  mbit))
-   value |= (1  vbit);
-   vbit++;
-   }
return value;
 }
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


V4L/DVB (5835): saa7146/dvb-ttpci: Fix signedness warnings (gcc 4.1.1, kernel 2.6.22)

2007-07-18 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=804b4458943f14bf144d3c3ba50097ced9b27b29
Commit: 804b4458943f14bf144d3c3ba50097ced9b27b29
Parent: 372280d2a3593e90d8849a5dc5676d2e9799e3a3
Author: Oliver Endriss [EMAIL PROTECTED]
AuthorDate: Thu Jul 12 20:37:50 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Wed Jul 18 14:24:44 2007 -0300

V4L/DVB (5835): saa7146/dvb-ttpci: Fix signedness warnings (gcc 4.1.1, 
kernel 2.6.22)

Fix signedness warnings (gcc 4.1.1, kernel 2.6.22).

Signed-off-by: Oliver Endriss [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/common/saa7146_core.c  |8 
 drivers/media/common/saa7146_video.c |8 
 drivers/media/dvb/ttpci/av7110_av.c  |8 
 drivers/media/dvb/ttpci/av7110_ca.c  |4 ++--
 drivers/media/dvb/ttpci/av7110_hw.c  |8 
 drivers/media/dvb/ttpci/av7110_hw.h  |2 +-
 drivers/media/dvb/ttpci/av7110_v4l.c |2 +-
 include/media/saa7146.h  |6 +++---
 8 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/drivers/media/common/saa7146_core.c 
b/drivers/media/common/saa7146_core.c
index ef3e54c..ba6701e 100644
--- a/drivers/media/common/saa7146_core.c
+++ b/drivers/media/common/saa7146_core.c
@@ -27,7 +27,7 @@ static int saa7146_num;
 
 unsigned int saa7146_debug;
 
-module_param(saa7146_debug, int, 0644);
+module_param(saa7146_debug, uint, 0644);
 MODULE_PARM_DESC(saa7146_debug, debug level (default: 0));
 
 #if 0
@@ -130,10 +130,10 @@ static struct scatterlist* vmalloc_to_sg(unsigned char 
*virt, int nr_pages)
 
//
 /* common page table functions */
 
-char *saa7146_vmalloc_build_pgtable(struct pci_dev *pci, long length, struct 
saa7146_pgtable *pt)
+void *saa7146_vmalloc_build_pgtable(struct pci_dev *pci, long length, struct 
saa7146_pgtable *pt)
 {
int pages = (length+PAGE_SIZE-1)/PAGE_SIZE;
-   char *mem = vmalloc_32(length);
+   void *mem = vmalloc_32(length);
int slen = 0;
 
if (NULL == mem)
@@ -168,7 +168,7 @@ err_null:
return NULL;
 }
 
-void saa7146_vfree_destroy_pgtable(struct pci_dev *pci, char *mem, struct 
saa7146_pgtable *pt)
+void saa7146_vfree_destroy_pgtable(struct pci_dev *pci, void *mem, struct 
saa7146_pgtable *pt)
 {
pci_unmap_sg(pci, pt-slist, pt-nents, PCI_DMA_FROMDEVICE);
saa7146_pgtable_free(pci, pt);
diff --git a/drivers/media/common/saa7146_video.c 
b/drivers/media/common/saa7146_video.c
index e3d04a4..664280c 100644
--- a/drivers/media/common/saa7146_video.c
+++ b/drivers/media/common/saa7146_video.c
@@ -889,9 +889,9 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file 
*file, unsigned int
 
DEB_EE((VIDIOC_QUERYCAP\n));
 
-   strcpy(cap-driver, saa7146 v4l2);
-   strlcpy(cap-card, dev-ext-name, sizeof(cap-card));
-   sprintf(cap-bus_info,PCI:%s, pci_name(dev-pci));
+   strcpy((char *)cap-driver, saa7146 v4l2);
+   strlcpy((char *)cap-card, dev-ext-name, sizeof(cap-card));
+   sprintf((char *)cap-bus_info,PCI:%s, pci_name(dev-pci));
cap-version = SAA7146_VERSION_CODE;
cap-capabilities =
V4L2_CAP_VIDEO_CAPTURE |
@@ -968,7 +968,7 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file 
*file, unsigned int
}
memset(f,0,sizeof(*f));
f-index = index;
-   
strlcpy(f-description,formats[index].name,sizeof(f-description));
+   strlcpy((char 
*)f-description,formats[index].name,sizeof(f-description));
f-pixelformat = formats[index].pixelformat;
break;
}
diff --git a/drivers/media/dvb/ttpci/av7110_av.c 
b/drivers/media/dvb/ttpci/av7110_av.c
index 58678c0..f7a8219 100644
--- a/drivers/media/dvb/ttpci/av7110_av.c
+++ b/drivers/media/dvb/ttpci/av7110_av.c
@@ -391,7 +391,7 @@ static int get_video_format(struct av7110 *av7110, u8 *buf, 
int count)
  /
 
 static inline long aux_ring_buffer_write(struct dvb_ringbuffer *rbuf,
-const char *buf, unsigned long count)
+const u8 *buf, unsigned long count)
 {
unsigned long todo = count;
int free;
@@ -436,7 +436,7 @@ static void play_audio_cb(u8 *buf, int count, void *priv)
 #define FREE_COND (dvb_ringbuffer_free(av7110-avout) = 20 * 1024  \
   dvb_ringbuffer_free(av7110-aout) = 20 * 1024)
 
-static ssize_t dvb_play(struct av7110 *av7110, const u8 __user *buf,
+static ssize_t dvb_play(struct av7110 *av7110, const char __user *buf,

<    1   2   3   4   >