Skip to content

Commit

Permalink
Merge branch 'work'
Browse files Browse the repository at this point in the history
  • Loading branch information
Mauro Carvalho Chehab committed Jan 15, 2006
2 parents f1dcced + e0ad848 commit d04ae27
Show file tree
Hide file tree
Showing 15 changed files with 99 additions and 78 deletions.
22 changes: 11 additions & 11 deletions drivers/media/dvb/dvb-core/dvbdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#include <linux/device.h>
#include <linux/fs.h>
#include <linux/cdev.h>

#include <linux/mutex.h>
#include "dvbdev.h"

static int dvbdev_debug;
Expand All @@ -44,7 +44,7 @@ MODULE_PARM_DESC(dvbdev_debug, "Turn on/off device debugging (default:off).");
#define dprintk if (dvbdev_debug) printk

static LIST_HEAD(dvb_adapter_list);
static DECLARE_MUTEX(dvbdev_register_lock);
static DEFINE_MUTEX(dvbdev_register_lock);

static const char * const dnames[] = {
"video", "audio", "sec", "frontend", "demux", "dvr", "ca",
Expand Down Expand Up @@ -202,11 +202,11 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev,
struct dvb_device *dvbdev;
int id;

if (down_interruptible (&dvbdev_register_lock))
if (mutex_lock_interruptible(&dvbdev_register_lock))
return -ERESTARTSYS;

if ((id = dvbdev_get_free_id (adap, type)) < 0) {
up (&dvbdev_register_lock);
mutex_unlock(&dvbdev_register_lock);
*pdvbdev = NULL;
printk ("%s: could get find free device id...\n", __FUNCTION__);
return -ENFILE;
Expand All @@ -215,11 +215,11 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev,
*pdvbdev = dvbdev = kmalloc(sizeof(struct dvb_device), GFP_KERNEL);

if (!dvbdev) {
up(&dvbdev_register_lock);
mutex_unlock(&dvbdev_register_lock);
return -ENOMEM;
}

up (&dvbdev_register_lock);
mutex_unlock(&dvbdev_register_lock);

memcpy(dvbdev, template, sizeof(struct dvb_device));
dvbdev->type = type;
Expand Down Expand Up @@ -289,11 +289,11 @@ int dvb_register_adapter(struct dvb_adapter *adap, const char *name, struct modu
{
int num;

if (down_interruptible (&dvbdev_register_lock))
if (mutex_lock_interruptible(&dvbdev_register_lock))
return -ERESTARTSYS;

if ((num = dvbdev_get_free_adapter_num ()) < 0) {
up (&dvbdev_register_lock);
mutex_unlock(&dvbdev_register_lock);
return -ENFILE;
}

Expand All @@ -309,7 +309,7 @@ int dvb_register_adapter(struct dvb_adapter *adap, const char *name, struct modu

list_add_tail (&adap->list_head, &dvb_adapter_list);

up (&dvbdev_register_lock);
mutex_unlock(&dvbdev_register_lock);

return num;
}
Expand All @@ -320,10 +320,10 @@ int dvb_unregister_adapter(struct dvb_adapter *adap)
{
devfs_remove("dvb/adapter%d", adap->num);

if (down_interruptible (&dvbdev_register_lock))
if (mutex_lock_interruptible(&dvbdev_register_lock))
return -ERESTARTSYS;
list_del (&adap->list_head);
up (&dvbdev_register_lock);
mutex_unlock(&dvbdev_register_lock);
return 0;
}
EXPORT_SYMBOL(dvb_unregister_adapter);
Expand Down
40 changes: 20 additions & 20 deletions drivers/media/dvb/ttpci/av7110_hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,52 +146,52 @@ static int load_dram(struct av7110 *av7110, u32 *data, int len)
{
int i;
int blocks, rest;
u32 base, bootblock = BOOT_BLOCK;
u32 base, bootblock = AV7110_BOOT_BLOCK;

dprintk(4, "%p\n", av7110);

blocks = len / BOOT_MAX_SIZE;
rest = len % BOOT_MAX_SIZE;
blocks = len / AV7110_BOOT_MAX_SIZE;
rest = len % AV7110_BOOT_MAX_SIZE;
base = DRAM_START_CODE;

for (i = 0; i < blocks; i++) {
if (waitdebi(av7110, BOOT_STATE, BOOTSTATE_BUFFER_EMPTY) < 0) {
if (waitdebi(av7110, AV7110_BOOT_STATE, BOOTSTATE_BUFFER_EMPTY) < 0) {
printk(KERN_ERR "dvb-ttpci: load_dram(): timeout at block %d\n", i);
return -ETIMEDOUT;
}
dprintk(4, "writing DRAM block %d\n", i);
mwdebi(av7110, DEBISWAB, bootblock,
((char*)data) + i * BOOT_MAX_SIZE, BOOT_MAX_SIZE);
((char*)data) + i * AV7110_BOOT_MAX_SIZE, AV7110_BOOT_MAX_SIZE);
bootblock ^= 0x1400;
iwdebi(av7110, DEBISWAB, BOOT_BASE, swab32(base), 4);
iwdebi(av7110, DEBINOSWAP, BOOT_SIZE, BOOT_MAX_SIZE, 2);
iwdebi(av7110, DEBINOSWAP, BOOT_STATE, BOOTSTATE_BUFFER_FULL, 2);
base += BOOT_MAX_SIZE;
iwdebi(av7110, DEBISWAB, AV7110_BOOT_BASE, swab32(base), 4);
iwdebi(av7110, DEBINOSWAP, AV7110_BOOT_SIZE, AV7110_BOOT_MAX_SIZE, 2);
iwdebi(av7110, DEBINOSWAP, AV7110_BOOT_STATE, BOOTSTATE_BUFFER_FULL, 2);
base += AV7110_BOOT_MAX_SIZE;
}

if (rest > 0) {
if (waitdebi(av7110, BOOT_STATE, BOOTSTATE_BUFFER_EMPTY) < 0) {
if (waitdebi(av7110, AV7110_BOOT_STATE, BOOTSTATE_BUFFER_EMPTY) < 0) {
printk(KERN_ERR "dvb-ttpci: load_dram(): timeout at last block\n");
return -ETIMEDOUT;
}
if (rest > 4)
mwdebi(av7110, DEBISWAB, bootblock,
((char*)data) + i * BOOT_MAX_SIZE, rest);
((char*)data) + i * AV7110_BOOT_MAX_SIZE, rest);
else
mwdebi(av7110, DEBISWAB, bootblock,
((char*)data) + i * BOOT_MAX_SIZE - 4, rest + 4);
((char*)data) + i * AV7110_BOOT_MAX_SIZE - 4, rest + 4);

iwdebi(av7110, DEBISWAB, BOOT_BASE, swab32(base), 4);
iwdebi(av7110, DEBINOSWAP, BOOT_SIZE, rest, 2);
iwdebi(av7110, DEBINOSWAP, BOOT_STATE, BOOTSTATE_BUFFER_FULL, 2);
iwdebi(av7110, DEBISWAB, AV7110_BOOT_BASE, swab32(base), 4);
iwdebi(av7110, DEBINOSWAP, AV7110_BOOT_SIZE, rest, 2);
iwdebi(av7110, DEBINOSWAP, AV7110_BOOT_STATE, BOOTSTATE_BUFFER_FULL, 2);
}
if (waitdebi(av7110, BOOT_STATE, BOOTSTATE_BUFFER_EMPTY) < 0) {
if (waitdebi(av7110, AV7110_BOOT_STATE, BOOTSTATE_BUFFER_EMPTY) < 0) {
printk(KERN_ERR "dvb-ttpci: load_dram(): timeout after last block\n");
return -ETIMEDOUT;
}
iwdebi(av7110, DEBINOSWAP, BOOT_SIZE, 0, 2);
iwdebi(av7110, DEBINOSWAP, BOOT_STATE, BOOTSTATE_BUFFER_FULL, 2);
if (waitdebi(av7110, BOOT_STATE, BOOTSTATE_BOOT_COMPLETE) < 0) {
iwdebi(av7110, DEBINOSWAP, AV7110_BOOT_SIZE, 0, 2);
iwdebi(av7110, DEBINOSWAP, AV7110_BOOT_STATE, BOOTSTATE_BUFFER_FULL, 2);
if (waitdebi(av7110, AV7110_BOOT_STATE, BOOTSTATE_AV7110_BOOT_COMPLETE) < 0) {
printk(KERN_ERR "dvb-ttpci: load_dram(): final handshake timeout\n");
return -ETIMEDOUT;
}
Expand Down Expand Up @@ -262,7 +262,7 @@ int av7110_bootarm(struct av7110 *av7110)
//saa7146_setgpio(dev, 3, SAA7146_GPIO_INPUT);

mwdebi(av7110, DEBISWAB, DPRAM_BASE, bootcode, sizeof(bootcode));
iwdebi(av7110, DEBINOSWAP, BOOT_STATE, BOOTSTATE_BUFFER_FULL, 2);
iwdebi(av7110, DEBINOSWAP, AV7110_BOOT_STATE, BOOTSTATE_BUFFER_FULL, 2);

if (saa7146_wait_for_debi_done(av7110->dev, 1)) {
printk(KERN_ERR "dvb-ttpci: av7110_bootarm(): "
Expand Down
12 changes: 6 additions & 6 deletions drivers/media/dvb/ttpci/av7110_hw.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ enum av7110_bootstate
{
BOOTSTATE_BUFFER_EMPTY = 0,
BOOTSTATE_BUFFER_FULL = 1,
BOOTSTATE_BOOT_COMPLETE = 2
BOOTSTATE_AV7110_BOOT_COMPLETE = 2
};

enum av7110_type_rec_play_format
Expand Down Expand Up @@ -295,11 +295,11 @@ enum av7110_command_type {
#define DPRAM_BASE 0x4000

/* boot protocol area */
#define BOOT_STATE (DPRAM_BASE + 0x3F8)
#define BOOT_SIZE (DPRAM_BASE + 0x3FA)
#define BOOT_BASE (DPRAM_BASE + 0x3FC)
#define BOOT_BLOCK (DPRAM_BASE + 0x400)
#define BOOT_MAX_SIZE 0xc00
#define AV7110_BOOT_STATE (DPRAM_BASE + 0x3F8)
#define AV7110_BOOT_SIZE (DPRAM_BASE + 0x3FA)
#define AV7110_BOOT_BASE (DPRAM_BASE + 0x3FC)
#define AV7110_BOOT_BLOCK (DPRAM_BASE + 0x400)
#define AV7110_BOOT_MAX_SIZE 0xc00

/* firmware command protocol area */
#define IRQ_STATE (DPRAM_BASE + 0x0F4)
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/video/cx25840/cx25840-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ MODULE_LICENSE("GPL");
static unsigned short normal_i2c[] = { 0x88 >> 1, I2C_CLIENT_END };


int cx25840_debug;
static int cx25840_debug;

module_param_named(debug,cx25840_debug, int, 0644);

Expand Down
3 changes: 1 addition & 2 deletions drivers/media/video/cx88/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ config VIDEO_CX88_DVB

config VIDEO_CX88_ALSA
tristate "ALSA DMA audio support"
depends on VIDEO_CX88 && SND
select SND_PCM_OSS
depends on VIDEO_CX88 && SND && EXPERIMENTAL
---help---
This is a video4linux driver for direct (DMA) audio on
Conexant 2388x based TV cards.
Expand Down
1 change: 0 additions & 1 deletion drivers/media/video/cx88/cx88-alsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -805,7 +805,6 @@ static struct pci_driver cx88_audio_pci_driver = {
.id_table = cx88_audio_pci_tbl,
.probe = cx88_audio_initdev,
.remove = cx88_audio_finidev,
SND_PCI_PM_CALLBACKS
};

/****************************************************************************
Expand Down
15 changes: 8 additions & 7 deletions drivers/media/video/cx88/cx88-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <linux/pci.h>
#include <linux/delay.h>
#include <linux/videodev2.h>
#include <linux/mutex.h>

#include "cx88.h"
#include <media/v4l2-common.h>
Expand Down Expand Up @@ -75,7 +76,7 @@ MODULE_PARM_DESC(nocomb,"disable comb filter");

static unsigned int cx88_devcount;
static LIST_HEAD(cx88_devlist);
static DECLARE_MUTEX(devlist);
static DEFINE_MUTEX(devlist);

#define NO_SYNC_LINE (-1U)

Expand Down Expand Up @@ -1036,7 +1037,7 @@ struct cx88_core* cx88_core_get(struct pci_dev *pci)
struct list_head *item;
int i;

down(&devlist);
mutex_lock(&devlist);
list_for_each(item,&cx88_devlist) {
core = list_entry(item, struct cx88_core, devlist);
if (pci->bus->number != core->pci_bus)
Expand All @@ -1047,7 +1048,7 @@ struct cx88_core* cx88_core_get(struct pci_dev *pci)
if (0 != get_ressources(core,pci))
goto fail_unlock;
atomic_inc(&core->refcount);
up(&devlist);
mutex_unlock(&devlist);
return core;
}
core = kzalloc(sizeof(*core),GFP_KERNEL);
Expand Down Expand Up @@ -1122,13 +1123,13 @@ struct cx88_core* cx88_core_get(struct pci_dev *pci)
cx88_card_setup(core);
cx88_ir_init(core,pci);

up(&devlist);
mutex_unlock(&devlist);
return core;

fail_free:
kfree(core);
fail_unlock:
up(&devlist);
mutex_unlock(&devlist);
return NULL;
}

Expand All @@ -1140,14 +1141,14 @@ void cx88_core_put(struct cx88_core *core, struct pci_dev *pci)
if (!atomic_dec_and_test(&core->refcount))
return;

down(&devlist);
mutex_lock(&devlist);
cx88_ir_fini(core);
if (0 == core->i2c_rc)
i2c_bit_del_bus(&core->i2c_adap);
list_del(&core->devlist);
iounmap(core->lmmio);
cx88_devcount--;
up(&devlist);
mutex_unlock(&devlist);
kfree(core);
}

Expand Down
8 changes: 7 additions & 1 deletion drivers/media/video/cx88/cx88-tvaudio.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ static unsigned int audio_debug = 0;
module_param(audio_debug, int, 0644);
MODULE_PARM_DESC(audio_debug, "enable debug messages [audio]");

static unsigned int always_analog = 0;
module_param(always_analog,int,0644);
MODULE_PARM_DESC(always_analog,"force analog audio out");


#define dprintk(fmt, arg...) if (audio_debug) \
printk(KERN_DEBUG "%s/0: " fmt, core->name , ## arg)

Expand Down Expand Up @@ -155,7 +160,8 @@ static void set_audio_finish(struct cx88_core *core, u32 ctl)
cx_write(AUD_I2SOUTPUTCNTL, 1);
cx_write(AUD_I2SCNTL, 0);
/* cx_write(AUD_APB_IN_RATE_ADJ, 0); */
} else {
}
if ((always_analog) || (!cx88_boards[core->board].blackbird)) {
ctl |= EN_DAC_ENABLE;
cx_write(AUD_CTL, ctl);
}
Expand Down
7 changes: 4 additions & 3 deletions drivers/media/video/em28xx/em28xx-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include <linux/i2c.h>
#include <linux/version.h>
#include <linux/video_decoder.h>
#include <linux/mutex.h>

#include "em28xx.h"
#include <media/tuner.h>
Expand Down Expand Up @@ -191,7 +192,7 @@ static struct v4l2_queryctrl saa711x_qctrl[] = {

static struct usb_driver em28xx_usb_driver;

static DECLARE_MUTEX(em28xx_sysfs_lock);
static DEFINE_MUTEX(em28xx_sysfs_lock);
static DECLARE_RWSEM(em28xx_disconnect);

/********************* v4l2 interface ******************************************/
Expand Down Expand Up @@ -394,7 +395,7 @@ static int em28xx_v4l2_open(struct inode *inode, struct file *filp)
*/
static void em28xx_release_resources(struct em28xx *dev)
{
down(&em28xx_sysfs_lock);
mutex_lock(&em28xx_sysfs_lock);

em28xx_info("V4L2 device /dev/video%d deregistered\n",
dev->vdev->minor);
Expand All @@ -403,7 +404,7 @@ static void em28xx_release_resources(struct em28xx *dev)
/* video_unregister_device(dev->vbi_dev); */
em28xx_i2c_unregister(dev);
usb_put_dev(dev->udev);
up(&em28xx_sysfs_lock);
mutex_unlock(&em28xx_sysfs_lock);
}

/*
Expand Down
6 changes: 6 additions & 0 deletions drivers/media/video/saa7134/saa7134-cards.c
Original file line number Diff line number Diff line change
Expand Up @@ -2515,6 +2515,7 @@ struct saa7134_board saa7134_boards[] = {
.tuner_addr = ADDR_UNSET,
.radio_addr = ADDR_UNSET,
.mpeg = SAA7134_MPEG_DVB,
.gpiomask = 1 << 21,
.inputs = {{
.name = name_tv,
.vmux = 1,
Expand All @@ -2529,6 +2530,11 @@ struct saa7134_board saa7134_boards[] = {
.vmux = 8,
.amux = LINE1,
}},
.radio = {
.name = name_radio,
.amux = TV,
.gpio = 0x0200000,
},
},
[SAA7134_BOARD_MSI_TVATANYWHERE_PLUS] = {
.name = "MSI TV@Anywhere plus",
Expand Down
Loading

0 comments on commit d04ae27

Please sign in to comment.