diff options
-rw-r--r-- | linux/drivers/media/video/tvaudio.c | 63 | ||||
-rw-r--r-- | v4l/ChangeLog | 10 |
2 files changed, 40 insertions, 33 deletions
diff --git a/linux/drivers/media/video/tvaudio.c b/linux/drivers/media/video/tvaudio.c index e93e08d52..80a021ea3 100644 --- a/linux/drivers/media/video/tvaudio.c +++ b/linux/drivers/media/video/tvaudio.c @@ -182,24 +182,23 @@ static int chip_write(struct CHIPSTATE *chip, int subaddr, int val) unsigned char buffer[2]; if (-1 == subaddr) { - tvaudio_dbg("%s: chip_write: 0x%x\n", - i2c_clientname(&chip->c), val); + tvaudio_dbg("%s: chip_write: 0x%x\n", chip->c.name, val); chip->shadow.bytes[1] = val; buffer[0] = val; if (1 != i2c_master_send(&chip->c,buffer,1)) { tvaudio_warn("%s: I/O error (write 0x%x)\n", - i2c_clientname(&chip->c), val); + chip->c.name, val); return -1; } } else { tvaudio_dbg("%s: chip_write: reg%d=0x%x\n", - i2c_clientname(&chip->c), subaddr, val); + chip->c.name, subaddr, val); chip->shadow.bytes[subaddr+1] = val; buffer[0] = subaddr; buffer[1] = val; if (2 != i2c_master_send(&chip->c,buffer,2)) { tvaudio_warn("%s: I/O error (write reg%d=0x%x)\n", - i2c_clientname(&chip->c), subaddr, val); + chip->c.name, subaddr, val); return -1; } } @@ -223,11 +222,10 @@ static int chip_read(struct CHIPSTATE *chip) unsigned char buffer; if (1 != i2c_master_recv(&chip->c,&buffer,1)) { - tvaudio_warn("%s: I/O error (read)\n", - i2c_clientname(&chip->c)); + tvaudio_warn("%s: I/O error (read)\n", chip->c.name); return -1; } - tvaudio_dbg("%s: chip_read: 0x%x\n",i2c_clientname(&chip->c),buffer); + tvaudio_dbg("%s: chip_read: 0x%x\n",chip->c.name, buffer); return buffer; } @@ -242,12 +240,11 @@ static int chip_read2(struct CHIPSTATE *chip, int subaddr) write[0] = subaddr; if (2 != i2c_transfer(chip->c.adapter,msgs,2)) { - tvaudio_warn("%s: I/O error (read2)\n", - i2c_clientname(&chip->c)); + tvaudio_warn("%s: I/O error (read2)\n", chip->c.name); return -1; } tvaudio_dbg("%s: chip_read2: reg%d=0x%x\n", - i2c_clientname(&chip->c),subaddr,read[0]); + chip->c.name, subaddr,read[0]); return read[0]; } @@ -260,7 +257,7 @@ static int chip_cmd(struct CHIPSTATE *chip, char *name, audiocmd *cmd) /* update our shadow register set; print bytes if (debug > 0) */ tvaudio_dbg("%s: chip_cmd(%s): reg=%d, data:", - i2c_clientname(&chip->c),name,cmd->bytes[0]); + chip->c.name, name,cmd->bytes[0]); for (i = 1; i < cmd->count; i++) { if (debug) printk(" 0x%x",cmd->bytes[i]); @@ -271,7 +268,7 @@ static int chip_cmd(struct CHIPSTATE *chip, char *name, audiocmd *cmd) /* send data to the chip */ if (cmd->count != i2c_master_send(&chip->c,cmd->bytes,cmd->count)) { - tvaudio_warn("%s: I/O error (%s)\n", i2c_clientname(&chip->c), name); + tvaudio_warn("%s: I/O error (%s)\n", chip->c.name, name); return -1; } return 0; @@ -296,17 +293,9 @@ static int chip_thread(void *data) struct CHIPSTATE *chip = data; struct CHIPDESC *desc = chiplist + chip->type; -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,61) - lock_kernel(); - daemonize(); - sigfillset(¤t->blocked); - strcpy(current->comm,i2c_clientname(&chip->c)); - unlock_kernel(); -#else - daemonize("%s",i2c_clientname(&chip->c)); + daemonize("%s", chip->c.name); allow_signal(SIGTERM); -#endif - tvaudio_dbg("%s: thread started\n", i2c_clientname(&chip->c)); + tvaudio_dbg("%s: thread started\n", chip->c.name); for (;;) { add_wait_queue(&chip->wq, &wait); @@ -320,7 +309,7 @@ static int chip_thread(void *data) #endif if (chip->done || signal_pending(current)) break; - tvaudio_dbg("%s: thread wakeup\n", i2c_clientname(&chip->c)); + tvaudio_dbg("%s: thread wakeup\n", chip->c.name); /* don't do anything for radio or if mode != auto */ if (chip->norm == VIDEO_MODE_RADIO || chip->mode != 0) @@ -333,7 +322,7 @@ static int chip_thread(void *data) mod_timer(&chip->wt, jiffies+2*HZ); } - tvaudio_dbg("%s: thread exiting\n", i2c_clientname(&chip->c)); + tvaudio_dbg("%s: thread exiting\n", chip->c.name); complete_and_exit(&chip->texit, 0); return 0; } @@ -346,7 +335,7 @@ static void generic_checkmode(struct CHIPSTATE *chip) if (mode == chip->prevmode) return; - tvaudio_dbg("%s: thread checkmode\n", i2c_clientname(&chip->c)); + tvaudio_dbg("%s: thread checkmode\n", chip->c.name); chip->prevmode = mode; if (mode & VIDEO_SOUND_STEREO) @@ -1135,7 +1124,7 @@ static int tda8425_initialize(struct CHIPSTATE *chip) /* extern */ TDA8425_S1_CH1, /* intern */ TDA8425_S1_OFF, /* off */ TDA8425_S1_OFF, /* on */ TDA8425_S1_CH2}; - if (chip->c.adapter->id == (I2C_ALGO_BIT | I2C_HW_B_RIVA)) { + if (chip->c.adapter->id == I2C_HW_B_RIVA) { memcpy (desc->inputmap, inputmap, sizeof (inputmap)); } return 0; @@ -1546,7 +1535,7 @@ static int chip_attach(struct i2c_adapter *adap, int addr, } /* fill required data structures */ - strcpy(i2c_clientname(&chip->c),desc->name); + strcpy(chip->c.name, desc->name); chip->type = desc-chiplist; chip->shadow.count = desc->registers+1; chip->prevmode = -1; @@ -1586,7 +1575,7 @@ static int chip_attach(struct i2c_adapter *adap, int addr, chip->tpid = kernel_thread(chip_thread,(void *)chip,0); if (chip->tpid < 0) tvaudio_warn("%s: kernel_thread() failed\n", - i2c_clientname(&chip->c)); + chip->c.name); wake_up_interruptible(&chip->wq); } return 0; @@ -1596,16 +1585,24 @@ static int chip_probe(struct i2c_adapter *adap) { /* don't attach on saa7146 based cards, because dedicated drivers are used */ +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,13) + if ((adap->id & I2C_HW_SAA7146)) +#else if ((adap->id & I2C_ALGO_SAA7146)) +#endif return 0; #ifdef I2C_CLASS_TV_ANALOG if (adap->class & I2C_CLASS_TV_ANALOG) return i2c_probe(adap, &addr_data, chip_attach); #else switch (adap->id) { - case I2C_ALGO_BIT | I2C_HW_B_BT848: - case I2C_ALGO_BIT | I2C_HW_B_RIVA: + case I2C_HW_B_BT848: + case I2C_HW_B_RIVA: +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,13) + case I2C_HW_SAA7134: +#else case I2C_ALGO_SAA7134: +#endif return i2c_probe(adap, &addr_data, chip_attach); } #endif @@ -1642,7 +1639,7 @@ static int chip_command(struct i2c_client *client, struct CHIPSTATE *chip = i2c_get_clientdata(client); struct CHIPDESC *desc = chiplist + chip->type; - tvaudio_dbg("%s: chip_command 0x%x\n",i2c_clientname(&chip->c),cmd); + tvaudio_dbg("%s: chip_command 0x%x\n", chip->c.name, cmd); switch (cmd) { case AUDC_SET_INPUT: @@ -1753,7 +1750,7 @@ static struct i2c_driver driver = { static struct i2c_client client_template = { - I2C_DEVNAME("(unset)"), + .name = "(unset)", .flags = I2C_CLIENT_ALLOW_USE, .driver = &driver, }; diff --git a/v4l/ChangeLog b/v4l/ChangeLog index 3663a081b..8ca0c3a7d 100644 --- a/v4l/ChangeLog +++ b/v4l/ChangeLog @@ -1,3 +1,13 @@ +2005-09-15 03:01 mkrufky + + * tvaudio.c: (chip_write), (chip_read), (chip_read2), (chip_cmd), + (chip_thread), (generic_checkmode), (tda8425_initialize), + (chip_attach), (chip_probe), (chip_command): + - Step three (final step) in upstream changes for + kernel 2.6.14-rc1 compatability. + + Signed-off-by: Michael Krufky <mkrufky@m1k.net> + 2005-09-15 23:42 nshmyrev * cx88-core.c: |