diff options
-rwxr-xr-x | hgimport | 4 | ||||
-rw-r--r-- | linux/drivers/media/dvb/bt8xx/dst_ca.c | 9 | ||||
-rw-r--r-- | linux/drivers/media/video/cs53l32a.c | 10 | ||||
-rw-r--r-- | linux/drivers/media/video/dabusb.c | 2 | ||||
-rw-r--r-- | linux/drivers/media/video/saa7134/saa6752hs.c | 2 | ||||
-rw-r--r-- | linux/drivers/media/video/saa7134/saa7134-cards.c | 8 | ||||
-rw-r--r-- | linux/drivers/media/video/saa7134/saa7134-core.c | 5 | ||||
-rw-r--r-- | linux/drivers/media/video/saa7134/saa7134-empress.c | 3 | ||||
-rw-r--r-- | linux/drivers/media/video/saa7134/saa7134.h | 1 | ||||
-rw-r--r-- | linux/drivers/media/video/tuner-core.c | 3 | ||||
-rwxr-xr-x | v4l/scripts/do_merge.pl | 175 |
11 files changed, 202 insertions, 20 deletions
@@ -104,5 +104,5 @@ done echo To cherry pick all files, you can do something like: echo "for i in $TMP/*.patch; do ./mailimport \$i; done" -echo "To merge it, the better is to do:" -echo "hg pull $1 && hg merge && hg commit && make && hg push" +echo "To merge it, the better is to run the merge script:" +echo "./v4l/scripts/do_merge.pl $1" diff --git a/linux/drivers/media/dvb/bt8xx/dst_ca.c b/linux/drivers/media/dvb/bt8xx/dst_ca.c index e71c269c1..bdc22a467 100644 --- a/linux/drivers/media/dvb/bt8xx/dst_ca.c +++ b/linux/drivers/media/dvb/bt8xx/dst_ca.c @@ -650,16 +650,17 @@ free_mem_and_exit: static long dst_ca_ioctl(struct file *file, unsigned int cmd, unsigned long ioctl_arg) { - lock_kernel(); - - struct dvb_device* dvbdev = (struct dvb_device*) file->private_data; - struct dst_state* state = (struct dst_state*) dvbdev->priv; + struct dvb_device *dvbdev; + struct dst_state *state; struct ca_slot_info *p_ca_slot_info; struct ca_caps *p_ca_caps; struct ca_msg *p_ca_message; void __user *arg = (void __user *)ioctl_arg; int result = 0; + lock_kernel(); + dvbdev = (struct dvb_device *)file->private_data; + state = (struct dst_state *)dvbdev->priv; p_ca_message = kmalloc(sizeof (struct ca_msg), GFP_KERNEL); p_ca_slot_info = kmalloc(sizeof (struct ca_slot_info), GFP_KERNEL); p_ca_caps = kmalloc(sizeof (struct ca_caps), GFP_KERNEL); diff --git a/linux/drivers/media/video/cs53l32a.c b/linux/drivers/media/video/cs53l32a.c index c8b5fa157..4745fd21c 100644 --- a/linux/drivers/media/video/cs53l32a.c +++ b/linux/drivers/media/video/cs53l32a.c @@ -29,7 +29,7 @@ #include <linux/videodev2.h> #include <media/v4l2-device.h> #include <media/v4l2-chip-ident.h> -#include <media/v4l2-i2c-drv-legacy.h> +#include <media/v4l2-i2c-drv.h> #include "compat.h" MODULE_DESCRIPTION("i2c device driver for cs53l32a Audio ADC"); @@ -42,9 +42,11 @@ module_param(debug, bool, 0644); MODULE_PARM_DESC(debug, "Debugging messages, 0=Off (default), 1=On"); +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 22) static unsigned short normal_i2c[] = { 0x22 >> 1, I2C_CLIENT_END }; I2C_CLIENT_INSMOD; +#endif /* ----------------------------------------------------------------------- */ @@ -123,11 +125,6 @@ static int cs53l32a_log_status(struct v4l2_subdev *sd) return 0; } -static int cs53l32a_command(struct i2c_client *client, unsigned cmd, void *arg) -{ - return v4l2_subdev_command(i2c_get_clientdata(client), cmd, arg); -} - /* ----------------------------------------------------------------------- */ static const struct v4l2_subdev_core_ops cs53l32a_core_ops = { @@ -225,7 +222,6 @@ MODULE_DEVICE_TABLE(i2c, cs53l32a_id); #endif static struct v4l2_i2c_driver_data v4l2_i2c_data = { .name = "cs53l32a", - .command = cs53l32a_command, .remove = cs53l32a_remove, .probe = cs53l32a_probe, #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26) diff --git a/linux/drivers/media/video/dabusb.c b/linux/drivers/media/video/dabusb.c index 5585f46dd..9e9cba431 100644 --- a/linux/drivers/media/video/dabusb.c +++ b/linux/drivers/media/video/dabusb.c @@ -736,7 +736,6 @@ static int dabusb_release (struct inode *inode, struct file *file) static long dabusb_ioctl (struct file *file, unsigned int cmd, unsigned long arg) { - lock_kernel(); pdabusb_t s = (pdabusb_t) file->private_data; pbulk_transfer_t pbulk; int ret = 0; @@ -744,6 +743,7 @@ static long dabusb_ioctl (struct file *file, unsigned int cmd, unsigned long arg dbg("dabusb_ioctl"); + lock_kernel(); if (s->remove_pending) { unlock_kernel(); return -EIO; diff --git a/linux/drivers/media/video/saa7134/saa6752hs.c b/linux/drivers/media/video/saa7134/saa6752hs.c index 3af36d929..2b82466d4 100644 --- a/linux/drivers/media/video/saa7134/saa6752hs.c +++ b/linux/drivers/media/video/saa7134/saa6752hs.c @@ -48,7 +48,7 @@ #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 22) /* Addresses to scan */ -static unsigned short normal_i2c[] = {0x20, I2C_CLIENT_END}; +static unsigned short normal_i2c[] = {0x20, 0x21, I2C_CLIENT_END}; I2C_CLIENT_INSMOD; #endif diff --git a/linux/drivers/media/video/saa7134/saa7134-cards.c b/linux/drivers/media/video/saa7134/saa7134-cards.c index e8efc883c..50d2868ce 100644 --- a/linux/drivers/media/video/saa7134/saa7134-cards.c +++ b/linux/drivers/media/video/saa7134/saa7134-cards.c @@ -273,6 +273,7 @@ struct saa7134_board saa7134_boards[] = { .radio_type = UNSET, .tuner_addr = ADDR_UNSET, .radio_addr = ADDR_UNSET, + .empress_addr = 0x20, .inputs = {{ .name = name_comp1, @@ -409,6 +410,7 @@ struct saa7134_board saa7134_boards[] = { .radio_type = UNSET, .tuner_addr = ADDR_UNSET, .radio_addr = ADDR_UNSET, + .empress_addr = 0x20, .tda9887_conf = TDA9887_PRESENT, .gpiomask = 0x820000, .inputs = {{ @@ -819,6 +821,7 @@ struct saa7134_board saa7134_boards[] = { .radio_type = UNSET, .tuner_addr = ADDR_UNSET, .radio_addr = ADDR_UNSET, + .empress_addr = 0x20, .inputs = {{ .name = name_comp1, .vmux = 4, @@ -978,6 +981,7 @@ struct saa7134_board saa7134_boards[] = { .radio_type = UNSET, .tuner_addr = ADDR_UNSET, .radio_addr = ADDR_UNSET, + .empress_addr = 0x20, .inputs = {{ .name = name_comp1, .vmux = 1, @@ -2365,6 +2369,7 @@ struct saa7134_board saa7134_boards[] = { .radio_type = UNSET, .tuner_addr = ADDR_UNSET, .radio_addr = ADDR_UNSET, + .empress_addr = 0x21, .inputs = {{ .name = "Composite 0", .vmux = 0, @@ -4172,6 +4177,7 @@ struct saa7134_board saa7134_boards[] = { .radio_type = UNSET, .tuner_addr = ADDR_UNSET, .radio_addr = ADDR_UNSET, + .empress_addr = 0x20, .tda9887_conf = TDA9887_PRESENT, .inputs = { { .name = name_tv, @@ -4208,6 +4214,7 @@ struct saa7134_board saa7134_boards[] = { .radio_type = UNSET, .tuner_addr = ADDR_UNSET, .radio_addr = ADDR_UNSET, + .empress_addr = 0x20, .tda9887_conf = TDA9887_PRESENT, .inputs = { { .name = name_tv, @@ -4245,6 +4252,7 @@ struct saa7134_board saa7134_boards[] = { .radio_type = UNSET, .tuner_addr = ADDR_UNSET, .radio_addr = ADDR_UNSET, + .empress_addr = 0x20, .tda9887_conf = TDA9887_PRESENT, .inputs = { { .name = name_tv, diff --git a/linux/drivers/media/video/saa7134/saa7134-core.c b/linux/drivers/media/video/saa7134/saa7134-core.c index b99b1ed1c..71142b53e 100644 --- a/linux/drivers/media/video/saa7134/saa7134-core.c +++ b/linux/drivers/media/video/saa7134/saa7134-core.c @@ -1043,8 +1043,9 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev, /* load i2c helpers */ if (card_is_empress(dev)) { struct v4l2_subdev *sd = - v4l2_i2c_new_subdev(&dev->i2c_adap, "saa6752hs", - "saa6752hs", 0x20); + v4l2_i2c_new_subdev(&dev->i2c_adap, + "saa6752hs", "saa6752hs", + saa7134_boards[dev->board].empress_addr); if (sd) sd->grp_id = GRP_EMPRESS; diff --git a/linux/drivers/media/video/saa7134/saa7134-empress.c b/linux/drivers/media/video/saa7134/saa7134-empress.c index 609342128..bab6b56c8 100644 --- a/linux/drivers/media/video/saa7134/saa7134-empress.c +++ b/linux/drivers/media/video/saa7134/saa7134-empress.c @@ -416,8 +416,7 @@ static int empress_g_chip_ident(struct file *file, void *fh, if (chip->match.type == V4L2_CHIP_MATCH_I2C_DRIVER && !strcmp(chip->match.name, "saa6752hs")) return saa_call_empress(dev, core, g_chip_ident, chip); - if (chip->match.type == V4L2_CHIP_MATCH_I2C_ADDR && - chip->match.addr == 0x20) + if (chip->match.type == V4L2_CHIP_MATCH_I2C_ADDR) return saa_call_empress(dev, core, g_chip_ident, chip); return -EINVAL; } diff --git a/linux/drivers/media/video/saa7134/saa7134.h b/linux/drivers/media/video/saa7134/saa7134.h index d2b29ed9e..2e9c7ed3d 100644 --- a/linux/drivers/media/video/saa7134/saa7134.h +++ b/linux/drivers/media/video/saa7134/saa7134.h @@ -333,6 +333,7 @@ struct saa7134_board { unsigned int radio_type; unsigned char tuner_addr; unsigned char radio_addr; + unsigned char empress_addr; unsigned int tda9887_conf; unsigned int tuner_config; diff --git a/linux/drivers/media/video/tuner-core.c b/linux/drivers/media/video/tuner-core.c index 9a0ddd57c..9960fb357 100644 --- a/linux/drivers/media/video/tuner-core.c +++ b/linux/drivers/media/video/tuner-core.c @@ -365,7 +365,8 @@ static void set_type(struct i2c_client *c, unsigned int type, } t->type = type; - t->config = new_config; + /* prevent invalid config values */ + t->config = ((new_config >= 0) && (new_config < 256)) ? new_config : 0; if (tuner_callback != NULL) { tuner_dbg("defining GPIO callback\n"); t->fe.callback = tuner_callback; diff --git a/v4l/scripts/do_merge.pl b/v4l/scripts/do_merge.pl new file mode 100755 index 000000000..1ceb0ce75 --- /dev/null +++ b/v4l/scripts/do_merge.pl @@ -0,0 +1,175 @@ +#!/usr/bin/perl + +my $merge_tree=shift or die "Should specify the pulled tree"; + +sub hgrcuser($) +{ + my $file = shift; + my $ui = 0; + open IN, '<', $file; + while (<IN>) { + $ui = 1 if (/^\s*\[ui\]/); + if ($ui && /^\s*username\s*=\s*(\S.*?)\s*$/) { + close IN; + return($1); + } + } + close IN; + return(""); +} + +sub check_heads() +{ + my $count=0; + open IN, 'hg heads|'; + while (<IN>) { + if (m/^[Cc]hangeset:/) { + $count++; + } + } + close IN; + return $count; +} + +sub curr_changeset() +{ + my $changeset = -1; + + open IN, 'hg heads|'; + while (<IN>) { + if (m/^[Cc]hangeset:\s*(\d+)/) { + if ($changeset < 0) { + $changeset = $1; + } else { + if ($1 < $changeset) { + $changeset = $1; + } + } + } + } + close IN; + return $changeset; +} + +sub check_status() +{ + my $count=0; + open IN, 'hg status -m -a -d -r|'; + while (<IN>) { + $count++; + } + close IN; + return $count; +} + +sub rollback() +{ + print "Rolling back hg pull $merge_tree\n"; + system("hg rollback"); + system("hg update -C"); + exit -1; +} + +#################### +# Determine username + +# Get Hg username from environment +my $user = $ENV{HGUSER}; + +# Didn't work? Try the repo's .hgrc file +if ($user eq "") { + my $hgroot = `hg root`; + chomp($hgroot); + $user = hgrcuser("$hgroot/.hg/hgrc"); +} +# Ok, try ~/.hgrc next +if ($user eq "") { + $user = hgrcuser("$ENV{HOME}/.hgrc"); +} + +# Still no luck? Try some other environment variables +if ($user eq "") { + my $name = $ENV{CHANGE_LOG_NAME}; + my $email = $ENV{CHANGE_LOG_EMAIL_ADDRESS}; + $user = "$name <$email>" if ($name ne "" || $email ne ""); +} + +# Last try to come up with something +if ($user eq "") { + print "User not known. Can't procceed\n"; + exit -1; +} + +###################### +# Do some sanity tests + +print "Checking if everything is ok, before applying the new tree.\n"; + +my $n_heads = check_heads(); +die "Your tree currently have more than one head (it has $n_heads heads). Can't procceed\n" if ($n_heads > 1); + +my $dirty = check_status(); +die "Your tree currently has changes. Can't procceed\n" if ($dirty); + +my $curr_cs = curr_changeset(); + +########### +# Pull tree + +print "hg pull $merge_tree\n"; + +my $ret = system("hg pull $merge_tree"); +die "Couldn't pull from $merge_tree\n" if ($ret); + +############################# +# Merge and commit, if needed + +$n_heads = check_heads(); +if ($n_heads > 2) { + print "The merged tree have more than one head (it has $n_heads heads). Can't procceed.\n"; + rollback(); +} + +if ($n_heads == 2) { + print "Merging the new changesets\n"; + + $ret = system("hg merge"); + if ($ret) { + print "hg merge failed. Can't procceed.\n"; + rollback(); + } + + print "Committing the new tree\n"; + # Write the commit message + $msg= "merge: $merge_tree\n\nFrom: $user\n\nSigned-off-by: $user\n"; + $ret=system("hg commit -m '$msg'"); + if ($ret) { + print "hg commit failed. Can't procceed.\n"; + rollback(); + } +} + +##################### +# Test resulting tree + +print "Testing if the build didn't break compilation. Only errors and warnings will be displayed. Please wait.\n"; +$ret = system ('make all|grep -v "^ CC"|grep -v "^ LD"'); +if ($ret) { + print "Build failed. Can't procceed.\n"; + + # To avoid the risk of doing something really bad, let's ask the user to run hg strip + print "Your tree is dirty. Since hg has only one rollback level, you'll need to use, instead:"; + print "\thg strip $curr_cs; hg update -C"; + print "You'll need to have hg mq extension enabled for hg strip to work.\n"; + + exit -1; +} + +############################## +# Everything is ok, let's push + +print "Pushing the new tree at the remote repository specified at .hg/hgrc\n"; +$ret=system ("hg push"); +if ($ret) { + print "hg push failed. Don't forget to do the push later.\n"; +} |