diff options
author | Gerd Knorr <devnull@localhost> | 2004-10-13 10:38:59 +0000 |
---|---|---|
committer | Gerd Knorr <devnull@localhost> | 2004-10-13 10:38:59 +0000 |
commit | edd4507a9edff255a67ce707442560a4ec4b3b14 (patch) | |
tree | d7c709acacb87b01d70340692df17aebcfbe2913 /linux/drivers/media/video/saa7134 | |
parent | c391a6857f19bd7eb8b9a40dc238242c34332f7a (diff) | |
download | mediapointer-dvb-s2-edd4507a9edff255a67ce707442560a4ec4b3b14.tar.gz mediapointer-dvb-s2-edd4507a9edff255a67ce707442560a4ec4b3b14.tar.bz2 |
- kill trailing whitespaces.
Diffstat (limited to 'linux/drivers/media/video/saa7134')
-rw-r--r-- | linux/drivers/media/video/saa7134/saa6752hs.c | 94 | ||||
-rw-r--r-- | linux/drivers/media/video/saa7134/saa7134-cards.c | 10 | ||||
-rw-r--r-- | linux/drivers/media/video/saa7134/saa7134-core.c | 30 | ||||
-rw-r--r-- | linux/drivers/media/video/saa7134/saa7134-i2c.c | 16 | ||||
-rw-r--r-- | linux/drivers/media/video/saa7134/saa7134-input.c | 24 | ||||
-rw-r--r-- | linux/drivers/media/video/saa7134/saa7134-oss.c | 22 | ||||
-rw-r--r-- | linux/drivers/media/video/saa7134/saa7134-ts.c | 50 | ||||
-rw-r--r-- | linux/drivers/media/video/saa7134/saa7134-tvaudio.c | 40 | ||||
-rw-r--r-- | linux/drivers/media/video/saa7134/saa7134-vbi.c | 10 | ||||
-rw-r--r-- | linux/drivers/media/video/saa7134/saa7134-video.c | 82 | ||||
-rw-r--r-- | linux/drivers/media/video/saa7134/saa7134.h | 12 |
11 files changed, 195 insertions, 195 deletions
diff --git a/linux/drivers/media/video/saa7134/saa6752hs.c b/linux/drivers/media/video/saa7134/saa6752hs.c index bfe47f293..915d418bd 100644 --- a/linux/drivers/media/video/saa7134/saa6752hs.c +++ b/linux/drivers/media/video/saa7134/saa6752hs.c @@ -43,7 +43,7 @@ enum saa6752hs_command { SAA6752HS_COMMAND_RECONFIGURE = 4, SAA6752HS_COMMAND_SLEEP = 5, SAA6752HS_COMMAND_RECONFIGURE_FORCE = 6, - + SAA6752HS_COMMAND_MAX }; @@ -53,24 +53,24 @@ enum saa6752hs_command { static u8 PAT[] = { 0xc2, // i2c register 0x00, // table number for encoder - + 0x47, // sync 0x40, 0x00, // transport_error_indicator(0), payload_unit_start(1), transport_priority(0), pid(0) 0x10, // transport_scrambling_control(00), adaptation_field_control(01), continuity_counter(0) - + 0x00, // PSI pointer to start of table - + 0x00, // tid(0) 0xb0, 0x0d, // section_syntax_indicator(1), section_length(13) - + 0x00, 0x01, // transport_stream_id(1) - + 0xc1, // version_number(0), current_next_indicator(1) - + 0x00, 0x00, // section_number(0), last_section_number(0) 0x00, 0x01, // program_number(1) - + 0xe0, 0x10, // PMT PID(0x10) 0x76, 0xf1, 0x44, 0xd1 // CRC32 @@ -79,29 +79,29 @@ static u8 PAT[] = { static u8 PMT[] = { 0xc2, // i2c register 0x01, // table number for encoder - + 0x47, // sync 0x40, 0x10, // transport_error_indicator(0), payload_unit_start(1), transport_priority(0), pid(0x10) 0x10, // transport_scrambling_control(00), adaptation_field_control(01), continuity_counter(0) - + 0x00, // PSI pointer to start of table - + 0x02, // tid(2) 0xb0, 0x17, // section_syntax_indicator(1), section_length(23) 0x00, 0x01, // program_number(1) - + 0xc1, // version_number(0), current_next_indicator(1) - + 0x00, 0x00, // section_number(0), last_section_number(0) - + 0xe1, 0x04, // PCR_PID (0x104) - + 0xf0, 0x00, // program_info_length(0) - + 0x02, 0xe1, 0x00, 0xf0, 0x00, // video stream type(2), pid(0x100) 0x04, 0xe1, 0x03, 0xf0, 0x00, // audio stream type(4), pid(0x103) - + 0xa1, 0xca, 0x0f, 0x82 // CRC32 }; @@ -113,7 +113,7 @@ static struct mpeg_params mpeg_params_template = .total_bitrate = 6000, }; - + /* ---------------------------------------------------------------------- */ @@ -129,11 +129,11 @@ static int saa6752hs_chip_command(struct i2c_client* client, case SAA6752HS_COMMAND_RESET: buf[0] = 0x00; break; - + case SAA6752HS_COMMAND_STOP: buf[0] = 0x03; break; - + case SAA6752HS_COMMAND_START: buf[0] = 0x02; break; @@ -141,11 +141,11 @@ static int saa6752hs_chip_command(struct i2c_client* client, case SAA6752HS_COMMAND_PAUSE: buf[0] = 0x04; break; - + case SAA6752HS_COMMAND_RECONFIGURE: buf[0] = 0x05; break; - + case SAA6752HS_COMMAND_SLEEP: buf[0] = 0x06; break; @@ -153,11 +153,11 @@ static int saa6752hs_chip_command(struct i2c_client* client, case SAA6752HS_COMMAND_RECONFIGURE_FORCE: buf[0] = 0x07; break; - + default: - return -EINVAL; + return -EINVAL; } - + // set it and wait for it to be so i2c_master_send(client, buf, 1); timeout = jiffies + HZ * 3; @@ -173,14 +173,14 @@ static int saa6752hs_chip_command(struct i2c_client* client, status = -ETIMEDOUT; break; } - + // wait a bit msleep(10); } // delay a bit to let encoder settle msleep(50); - + // done return status; } @@ -190,12 +190,12 @@ static int saa6752hs_set_bitrate(struct i2c_client* client, struct mpeg_params* params) { u8 buf[3]; - + // set the bitrate mode buf[0] = 0x71; buf[1] = params->bitrate_mode; i2c_master_send(client, buf, 2); - + // set the video bitrate if (params->bitrate_mode == MPEG_BITRATE_MODE_VBR) { // set the target bitrate @@ -216,24 +216,24 @@ static int saa6752hs_set_bitrate(struct i2c_client* client, buf[2] = params->video_target_bitrate & 0xff; i2c_master_send(client, buf, 3); } - + // set the audio bitrate buf[0] = 0x94; buf[1] = params->audio_bitrate; i2c_master_send(client, buf, 2); - + // set the total bitrate buf[0] = 0xb1; buf[1] = params->total_bitrate >> 8; buf[2] = params->total_bitrate & 0xff; i2c_master_send(client, buf, 3); - + return 0; } static int saa6752hs_init(struct i2c_client* client, struct mpeg_params* params) -{ +{ unsigned char buf[3]; void *data; @@ -251,41 +251,41 @@ static int saa6752hs_init(struct i2c_client* client, struct mpeg_params* params) return -EINVAL; if (params->bitrate_mode == MPEG_BITRATE_MODE_MAX && params->video_target_bitrate <= params->video_max_bitrate) - return -EINVAL; + return -EINVAL; } - + // Set GOP structure {3, 13} buf[0] = 0x72; buf[1] = 0x03; buf[2] = 0x0D; i2c_master_send(client,buf,3); - + // Set minimum Q-scale {4} buf[0] = 0x82; buf[1] = 0x04; i2c_master_send(client,buf,2); - + // Set maximum Q-scale {12} buf[0] = 0x83; buf[1] = 0x0C; i2c_master_send(client,buf,2); - + // Set Output Protocol buf[0] = 0xD0; buf[1] = 0x01; i2c_master_send(client,buf,2); - + // Set video output stream format {TS} buf[0] = 0xB0; buf[1] = 0x05; i2c_master_send(client,buf,2); - + // Set Audio PID {0x103} buf[0] = 0xC1; buf[1] = 0x01; buf[2] = 0x03; i2c_master_send(client,buf,3); - + // setup bitrate settings data = i2c_get_clientdata(client); if (params) { @@ -295,18 +295,18 @@ static int saa6752hs_init(struct i2c_client* client, struct mpeg_params* params) // parameters were not supplied. use the previous set saa6752hs_set_bitrate(client, (struct mpeg_params*) data); } - + // Send SI tables i2c_master_send(client,PAT,sizeof(PAT)); i2c_master_send(client,PMT,sizeof(PMT)); - + // mute then unmute audio. This removes buzzing artefacts buf[0] = 0xa4; buf[1] = 1; i2c_master_send(client, buf, 2); buf[1] = 0; i2c_master_send(client, buf, 2); - + // start it going saa6752hs_chip_command(client, SAA6752HS_COMMAND_START); @@ -332,14 +332,14 @@ static int saa6752hs_attach(struct i2c_adapter *adap, int addr, return -ENOMEM; memcpy(client,&client_template,sizeof(struct i2c_client)); strlcpy(client->name, "saa6752hs", sizeof(client->name)); - + if (NULL == (params = kmalloc(sizeof(struct mpeg_params), GFP_KERNEL))) return -ENOMEM; memcpy(params,&mpeg_params_template,sizeof(struct mpeg_params)); i2c_set_clientdata(client, params); i2c_attach_client(client); - + #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) MOD_INC_USE_COUNT; #endif @@ -388,7 +388,7 @@ saa6752hs_command(struct i2c_client *client, unsigned int cmd, void *arg) /* nothing */ break; } - + return 0; } diff --git a/linux/drivers/media/video/saa7134/saa7134-cards.c b/linux/drivers/media/video/saa7134/saa7134-cards.c index b68ef8236..bddf64d4a 100644 --- a/linux/drivers/media/video/saa7134/saa7134-cards.c +++ b/linux/drivers/media/video/saa7134/saa7134-cards.c @@ -1,5 +1,5 @@ /* - * $Id: saa7134-cards.c,v 1.28 2004/10/12 17:08:43 kraxel Exp $ + * $Id: saa7134-cards.c,v 1.29 2004/10/13 10:39:00 kraxel Exp $ * * device driver for philips saa7134 based TV cards * card-specific stuff. @@ -838,7 +838,7 @@ struct saa7134_board saa7134_boards[] = { .name = name_svideo, .vmux = 8, .amux = LINE1, - },{ + },{ .name = name_comp1, .vmux = 1, .amux = LINE1, @@ -1420,14 +1420,14 @@ struct pci_device_id saa7134_pci_tbl[] = { .subvendor = 0x153B, .subdevice = 0x1152, .driver_data = SAA7134_BOARD_CINERGY200, - + },{ .vendor = PCI_VENDOR_ID_PHILIPS, .device = PCI_DEVICE_ID_PHILIPS_SAA7130, .subvendor = 0x185b, .subdevice = 0xc100, .driver_data = SAA7134_BOARD_VIDEOMATE_TV_PVR, - + },{ /* --- boards without eeprom + subsystem ID --- */ .vendor = PCI_VENDOR_ID_PHILIPS, @@ -1442,7 +1442,7 @@ struct pci_device_id saa7134_pci_tbl[] = { .subdevice = 0, .driver_data = SAA7134_BOARD_NOAUTO, },{ - + /* --- default catch --- */ .vendor = PCI_VENDOR_ID_PHILIPS, .device = PCI_DEVICE_ID_PHILIPS_SAA7130, diff --git a/linux/drivers/media/video/saa7134/saa7134-core.c b/linux/drivers/media/video/saa7134/saa7134-core.c index 4aa0a441c..7f5b65776 100644 --- a/linux/drivers/media/video/saa7134/saa7134-core.c +++ b/linux/drivers/media/video/saa7134/saa7134-core.c @@ -1,5 +1,5 @@ /* - * $Id: saa7134-core.c,v 1.11 2004/10/12 17:08:43 kraxel Exp $ + * $Id: saa7134-core.c,v 1.12 2004/10/13 10:39:00 kraxel Exp $ * * device driver for philips saa7134 based TV cards * driver core @@ -246,7 +246,7 @@ int saa7134_buffer_pages(int size) int saa7134_buffer_count(unsigned int size, unsigned int count) { unsigned int maxcount; - + maxcount = 1024 / saa7134_buffer_pages(size); if (count > maxcount) count = maxcount; @@ -273,7 +273,7 @@ int saa7134_pgtable_alloc(struct pci_dev *pci, struct saa7134_pgtable *pt) { u32 *cpu; dma_addr_t dma_addr; - + cpu = pci_alloc_consistent(pci, SAA7134_PGTABLE_SIZE, &dma_addr); if (NULL == cpu) return -ENOMEM; @@ -330,7 +330,7 @@ int saa7134_buffer_queue(struct saa7134_dev *dev, #ifdef DEBUG_SPINLOCKS BUG_ON(!spin_is_locked(&dev->slock)); #endif - + dprintk("buffer_queue %p\n",buf); if (NULL == q->curr) { if (!q->need_two) { @@ -360,7 +360,7 @@ void saa7134_buffer_finish(struct saa7134_dev *dev, BUG_ON(!spin_is_locked(&dev->slock)); #endif dprintk("buffer_finish %p\n",q->curr); - + /* finish current buffer */ q->curr->vb.state = state; do_gettimeofday(&q->curr->vb.ts); @@ -483,7 +483,7 @@ int saa7134_set_dmabits(struct saa7134_dev *dev) SAA7134_IRQ1_INTE_RA2_1 | SAA7134_IRQ1_INTE_RA2_0; } - + /* set task conditions + field handling */ if (V4L2_FIELD_HAS_BOTH(cap) || V4L2_FIELD_HAS_BOTH(ov) || cap == ov) { /* default config -- use full frames */ @@ -507,7 +507,7 @@ int saa7134_set_dmabits(struct saa7134_dev *dev) saa_writeb(SAA7134_FIELD_HANDLING(TASK_B), 0x01); split = 1; } - + /* irqs */ saa_writeb(SAA7134_REGION_ENABLE, task); saa_writel(SAA7134_IRQ1, irq); @@ -541,7 +541,7 @@ static void print_irqstatus(struct saa7134_dev *dev, int loop, unsigned long report, unsigned long status) { unsigned int i; - + printk(KERN_DEBUG "%s/irq[%d,%ld]: r=0x%lx s=0x%02lx", dev->name,loop,jiffies,report,status); for (i = 0; i < IRQBITS; i++) { @@ -654,11 +654,11 @@ static int saa7134_hwinit1(struct saa7134_dev *dev) saa7134_oss_init1(dev); break; } - + /* RAM FIFO config */ saa_writel(SAA7134_FIFO_SIZE, 0x08070503); saa_writel(SAA7134_THRESHOULD,0x02020202); - + /* enable audio + video processing */ saa_writel(SAA7134_MAIN_CTRL, SAA7134_MAIN_CTRL_VPLLE | @@ -675,7 +675,7 @@ static int saa7134_hwinit1(struct saa7134_dev *dev) /* set vertical line numbering start (vbi needs this) */ saa_writeb(SAA7134_SOURCE_TIMING2, 0x20); - + return 0; } @@ -760,7 +760,7 @@ static struct video_device *vdev_init(struct saa7134_dev *dev, char *type) { struct video_device *vfd; - + vfd = video_device_alloc(); if (NULL == vfd) return NULL; @@ -917,7 +917,7 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev, /* wait a bit, register i2c bus */ msleep(100); saa7134_i2c_register(dev); - + /* initialize hardware #2 */ saa7134_board_init2(dev); saa7134_hwinit2(dev); @@ -958,7 +958,7 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev, printk(KERN_INFO "%s: registered device video%d [mpeg]\n", dev->name,dev->ts_dev->minor & 0x1f); } - + dev->vbi_dev = vdev_init(dev,&saa7134_vbi_template,"vbi"); err = video_register_device(dev->vbi_dev,VFL_TYPE_VBI, vbi_nr[saa7134_devcount]); @@ -991,7 +991,7 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev, } printk(KERN_INFO "%s: registered device dsp%d\n", dev->name,dev->oss.minor_dsp >> 4); - + err = dev->oss.minor_mixer = register_sound_mixer(&saa7134_mixer_fops, mixer_nr[saa7134_devcount]); diff --git a/linux/drivers/media/video/saa7134/saa7134-i2c.c b/linux/drivers/media/video/saa7134/saa7134-i2c.c index 7a7ed31ee..bcba52ba0 100644 --- a/linux/drivers/media/video/saa7134/saa7134-i2c.c +++ b/linux/drivers/media/video/saa7134/saa7134-i2c.c @@ -1,5 +1,5 @@ /* - * $Id: saa7134-i2c.c,v 1.5 2004/10/06 17:30:51 kraxel Exp $ + * $Id: saa7134-i2c.c,v 1.6 2004/10/13 10:39:00 kraxel Exp $ * * device driver for philips saa7134 based TV cards * i2c interface support @@ -88,7 +88,7 @@ enum i2c_attr { static inline enum i2c_status i2c_get_status(struct saa7134_dev *dev) { enum i2c_status status; - + status = saa_readb(SAA7134_I2C_ATTR_STATUS) & 0x0f; d2printk(KERN_DEBUG "%s: i2c stat <= %s\n",dev->name, str_i2c_status[status]); @@ -184,7 +184,7 @@ static int i2c_reset(struct saa7134_dev *dev) if (!i2c_is_idle(status)) return FALSE; - + i2c_set_attr(dev,NOP); return TRUE; } @@ -210,7 +210,7 @@ static inline int i2c_send_byte(struct saa7134_dev *dev, saa_writel(SAA7134_I2C_ATTR_STATUS >> 2, dword); #endif d2printk(KERN_DEBUG "%s: i2c data => 0x%x\n",dev->name,data); - + if (!i2c_is_busy_wait(dev)) return -EIO; status = i2c_get_status(dev); @@ -223,7 +223,7 @@ static inline int i2c_recv_byte(struct saa7134_dev *dev) { enum i2c_status status; unsigned char data; - + i2c_set_attr(dev,CONTINUE); if (!i2c_is_busy_wait(dev)) return -EIO; @@ -302,7 +302,7 @@ static int saa7134_i2c_xfer(struct i2c_adapter *i2c_adap, /* ----------------------------------------------------------- */ -static int algo_control(struct i2c_adapter *adapter, +static int algo_control(struct i2c_adapter *adapter, unsigned int cmd, unsigned long arg) { return 0; @@ -433,10 +433,10 @@ int saa7134_i2c_register(struct saa7134_dev *dev) strcpy(dev->i2c_adap.name,dev->name); dev->i2c_adap.algo_data = dev; i2c_add_adapter(&dev->i2c_adap); - + dev->i2c_client = saa7134_client_template; dev->i2c_client.adapter = &dev->i2c_adap; - + saa7134_i2c_eeprom(dev,dev->eedata,sizeof(dev->eedata)); if (i2c_scan) do_i2c_scan(dev->name,&dev->i2c_client); diff --git a/linux/drivers/media/video/saa7134/saa7134-input.c b/linux/drivers/media/video/saa7134/saa7134-input.c index 65068ae94..ff0582136 100644 --- a/linux/drivers/media/video/saa7134/saa7134-input.c +++ b/linux/drivers/media/video/saa7134/saa7134-input.c @@ -1,5 +1,5 @@ /* - * $Id: saa7134-input.c,v 1.9 2004/09/15 16:15:24 kraxel Exp $ + * $Id: saa7134-input.c,v 1.10 2004/10/13 10:39:00 kraxel Exp $ * * handle saa7134 IR remotes via linux kernel input layer. * @@ -63,7 +63,7 @@ static IR_KEYTAB_TYPE flyvideo_codes[IR_KEYTAB_SIZE] = { [ 20 ] = KEY_VOLUMEUP, [ 23 ] = KEY_VOLUMEDOWN, [ 18 ] = KEY_CHANNELUP, // Channel + - [ 19 ] = KEY_CHANNELDOWN, // Channel - + [ 19 ] = KEY_CHANNELDOWN, // Channel - [ 6 ] = KEY_AGAIN, // Recal [ 16 ] = KEY_KPENTER, // Enter @@ -160,7 +160,7 @@ static IR_KEYTAB_TYPE eztv_codes[IR_KEYTAB_SIZE] = { [ 13 ] = KEY_KP7, [ 14 ] = KEY_KP8, [ 15 ] = KEY_KP9, - + [ 42 ] = KEY_VOLUMEUP, [ 17 ] = KEY_VOLUMEDOWN, [ 24 ] = KEY_CHANNELUP, // CH.tracking up @@ -174,13 +174,13 @@ static IR_KEYTAB_TYPE avacssmart_codes[IR_KEYTAB_SIZE] = { [ 30 ] = KEY_POWER, // power [ 28 ] = KEY_SEARCH, // scan [ 7 ] = KEY_SELECT, // source - + [ 22 ] = KEY_VOLUMEUP, [ 20 ] = KEY_VOLUMEDOWN, [ 31 ] = KEY_CHANNELUP, [ 23 ] = KEY_CHANNELDOWN, [ 24 ] = KEY_MUTE, - + [ 2 ] = KEY_KP0, [ 1 ] = KEY_KP1, [ 11 ] = KEY_KP2, @@ -192,21 +192,21 @@ static IR_KEYTAB_TYPE avacssmart_codes[IR_KEYTAB_SIZE] = { [ 10 ] = KEY_KP8, [ 18 ] = KEY_KP9, [ 16 ] = KEY_KPDOT, - + [ 3 ] = KEY_TUNER, // tv/fm [ 4 ] = KEY_REWIND, // fm tuning left or function left [ 12 ] = KEY_FORWARD, // fm tuning right or function right - + [ 0 ] = KEY_RECORD, [ 8 ] = KEY_STOP, [ 17 ] = KEY_PLAY, - + [ 25 ] = KEY_ZOOM, [ 14 ] = KEY_MENU, // function [ 19 ] = KEY_AGAIN, // recall [ 29 ] = KEY_RESTART, // reset - -// FIXME + +// FIXME [ 13 ] = KEY_F21, // mts [ 15 ] = KEY_F22, // min [ 26 ] = KEY_F23, // freeze @@ -378,7 +378,7 @@ int saa7134_input_init1(struct saa7134_dev *dev) ir->mask_keydown = mask_keydown; ir->mask_keyup = mask_keyup; ir->polling = polling; - + /* init input device */ snprintf(ir->name, sizeof(ir->name), "saa7134 IR (%s)", saa7134_boards[dev->board].name); @@ -419,7 +419,7 @@ void saa7134_input_fini(struct saa7134_dev *dev) { if (NULL == dev->remote) return; - + input_unregister_device(&dev->remote->dev); if (dev->remote->polling) del_timer_sync(&dev->remote->timer); diff --git a/linux/drivers/media/video/saa7134/saa7134-oss.c b/linux/drivers/media/video/saa7134/saa7134-oss.c index 608c5d21e..4612eb399 100644 --- a/linux/drivers/media/video/saa7134/saa7134-oss.c +++ b/linux/drivers/media/video/saa7134/saa7134-oss.c @@ -1,5 +1,5 @@ /* - * $Id: saa7134-oss.c,v 1.9 2004/09/15 16:15:24 kraxel Exp $ + * $Id: saa7134-oss.c,v 1.10 2004/10/13 10:39:00 kraxel Exp $ * * device driver for philips saa7134 based TV cards * oss dsp interface @@ -140,7 +140,7 @@ static int dsp_rec_start(struct saa7134_dev *dev) } switch (dev->oss.afmt) { - case AFMT_S8: + case AFMT_S8: case AFMT_S16_LE: case AFMT_S16_BE: sign = 1; break; default: sign = 0; break; @@ -161,7 +161,7 @@ static int dsp_rec_start(struct saa7134_dev *dev) if (sign) fmt |= 0x04; fmt |= (TV == dev->oss.input) ? 0xc0 : 0x80; - + saa_writeb(SAA7134_NUM_SAMPLES0, (dev->oss.blksize & 0x0000ff)); saa_writeb(SAA7134_NUM_SAMPLES1, (dev->oss.blksize & 0x00ff00) >> 8); saa_writeb(SAA7134_NUM_SAMPLES2, (dev->oss.blksize & 0xff0000) >> 16); @@ -193,7 +193,7 @@ static int dsp_rec_start(struct saa7134_dev *dev) saa_writel(SAA7134_RS_BA2(6),dev->oss.blksize); saa_writel(SAA7134_RS_PITCH(6),0); saa_writel(SAA7134_RS_CONTROL(6),control); - + /* start dma */ dev->oss.recording_on = 1; spin_lock_irqsave(&dev->slock,flags); @@ -369,7 +369,7 @@ static int dsp_ioctl(struct inode *inode, struct file *file, void __user *argp = (void __user *) arg; int __user *p = argp; int val = 0; - + if (oss_debug > 1) saa7134_print_ioctl(dev->name,cmd); switch (cmd) { @@ -412,7 +412,7 @@ static int dsp_ioctl(struct inode *inode, struct file *file, /* fall through */ case SOUND_PCM_READ_CHANNELS: return put_user(dev->oss.channels, p); - + case SNDCTL_DSP_GETFMTS: /* Returns a mask */ return put_user(AFMT_U8 | AFMT_S8 | AFMT_U16_LE | AFMT_U16_BE | @@ -535,7 +535,7 @@ static int mixer_recsrc_7134(struct saa7134_dev *dev) { int analog_io,rate; - + switch (dev->oss.input) { case TV: saa_andorb(SAA7134_AUDIO_FORMAT_CTRL, 0xc0, 0xc0); @@ -557,7 +557,7 @@ static int mixer_recsrc_7133(struct saa7134_dev *dev) { u32 value = 0xbbbbbb; - + switch (dev->oss.input) { case TV: value = 0xbbbb10; /* MAIN */ @@ -655,7 +655,7 @@ static int mixer_ioctl(struct inode *inode, struct file *file, int val,ret; void __user *argp = (void __user *) arg; int __user *p = argp; - + if (oss_debug > 1) saa7134_print_ioctl(dev->name,cmd); switch (cmd) { @@ -786,7 +786,7 @@ int saa7134_oss_init1(struct saa7134_dev *dev) mixer_level(dev,LINE1,dev->oss.line1); mixer_level(dev,LINE2,dev->oss.line2); mixer_recsrc(dev, (dev->oss.rate == 32000) ? TV : LINE2); - + return 0; } @@ -840,7 +840,7 @@ void saa7134_irq_oss_done(struct saa7134_dev *dev, unsigned long status) dev->oss.dma_blk = (dev->oss.dma_blk + 1) % dev->oss.blocks; dev->oss.read_count += dev->oss.blksize; wake_up(&dev->oss.wq); - + done: spin_unlock(&dev->slock); } diff --git a/linux/drivers/media/video/saa7134/saa7134-ts.c b/linux/drivers/media/video/saa7134/saa7134-ts.c index 3c36c3cc9..01e93a720 100644 --- a/linux/drivers/media/video/saa7134/saa7134-ts.c +++ b/linux/drivers/media/video/saa7134/saa7134-ts.c @@ -1,5 +1,5 @@ /* - * $Id: saa7134-ts.c,v 1.9 2004/10/11 14:53:13 kraxel Exp $ + * $Id: saa7134-ts.c,v 1.10 2004/10/13 10:39:00 kraxel Exp $ * * device driver for philips saa7134 based TV cards * video4linux video interface @@ -63,11 +63,11 @@ static int buffer_activate(struct saa7134_dev *dev, struct saa7134_buf *next) { u32 control; - + dprintk("buffer_activate [%p]",buf); buf->vb.state = STATE_ACTIVE; buf->top_seen = 0; - + /* dma: setup channel 5 (= TS) */ control = SAA7134_RS_CONTROL_BURST_16 | SAA7134_RS_CONTROL_ME | @@ -89,7 +89,7 @@ static int buffer_activate(struct saa7134_dev *dev, /* start DMA */ saa7134_set_dmabits(dev); - + mod_timer(&dev->ts_q.timeout, jiffies+BUFFER_TIMEOUT); return 0; } @@ -101,12 +101,12 @@ static int buffer_prepare(void *priv, struct videobuf_buffer *vb, struct saa7134_buf *buf = (struct saa7134_buf *)vb; unsigned int lines, llength, size; int err; - + dprintk("buffer_prepare [%p,%s]\n",buf,v4l2_field_names[field]); llength = TS_PACKET_SIZE; lines = ts_nr_packets; - + size = lines * llength; if (0 != buf->vb.baddr && buf->vb.bsize < size) return -EINVAL; @@ -155,7 +155,7 @@ static void buffer_queue(void *priv, struct videobuf_buffer *vb) { struct saa7134_dev *dev = priv; struct saa7134_buf *buf = (struct saa7134_buf *)vb; - + saa7134_buffer_queue(dev,&dev->ts_q,buf); } @@ -163,7 +163,7 @@ static void buffer_release(void *priv, struct videobuf_buffer *vb) { struct saa7134_dev *dev = priv; struct saa7134_buf *buf = (struct saa7134_buf *)vb; - + saa7134_dma_free(dev,buf); } @@ -177,7 +177,7 @@ static struct videobuf_queue_ops ts_qops = { /* ------------------------------------------------------------------ */ -static void ts_reset_encoder(struct saa7134_dev* dev) +static void ts_reset_encoder(struct saa7134_dev* dev) { saa_writeb(SAA7134_SPECIAL_MODE, 0x00); msleep(10); @@ -185,7 +185,7 @@ static void ts_reset_encoder(struct saa7134_dev* dev) msleep(100); } -static int ts_init_encoder(struct saa7134_dev* dev, void* arg) +static int ts_init_encoder(struct saa7134_dev* dev, void* arg) { ts_reset_encoder(dev); saa7134_i2c_call_clients(dev, MPEG_SETPARAMS, arg); @@ -201,7 +201,7 @@ static int ts_open(struct inode *inode, struct file *file) struct saa7134_dev *h,*dev = NULL; struct list_head *list; int err; - + list_for_each(list,&saa7134_devlist) { h = list_entry(list, struct saa7134_dev, devlist); if (h->ts_dev && h->ts_dev->minor == minor) @@ -240,7 +240,7 @@ static int ts_release(struct inode *inode, struct file *file) /* stop the encoder */ if (dev->ts.started) ts_reset_encoder(dev); - + up(&dev->ts.ts.lock); return 0; } @@ -254,7 +254,7 @@ ts_read(struct file *file, char __user *data, size_t count, loff_t *ppos) ts_init_encoder(dev, NULL); dev->ts.started = 1; } - + return videobuf_read_stream(file->private_data, &dev->ts.ts, data, count, ppos, 0, file->f_flags & O_NONBLOCK); @@ -312,7 +312,7 @@ static int ts_do_ioctl(struct inode *inode, struct file *file, case VIDIOC_ENUMINPUT: { struct v4l2_input *i = arg; - + if (i->index != 0) return -EINVAL; i->type = V4L2_INPUT_TYPE_CAMERA; @@ -328,13 +328,13 @@ static int ts_do_ioctl(struct inode *inode, struct file *file, case VIDIOC_S_INPUT: { int *i = arg; - + if (*i != 0) return -EINVAL; return 0; } /* --- capture ioctls ---------------------------------------- */ - + case VIDIOC_ENUM_FMT: { struct v4l2_fmtdesc *f = arg; @@ -343,7 +343,7 @@ static int ts_do_ioctl(struct inode *inode, struct file *file, index = f->index; if (index != 0) return -EINVAL; - + memset(f,0,sizeof(*f)); f->index = index; strlcpy(f->description, "MPEG TS", sizeof(f->description)); @@ -358,7 +358,7 @@ static int ts_do_ioctl(struct inode *inode, struct file *file, memset(f,0,sizeof(*f)); f->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; - + /* FIXME: translate subsampling type EMPRESS into * width/height: */ f->fmt.pix.width = 720; /* D1 */ @@ -367,7 +367,7 @@ static int ts_do_ioctl(struct inode *inode, struct file *file, f->fmt.pix.sizeimage = TS_PACKET_SIZE*ts_nr_packets; return 0; } - + case VIDIOC_S_FMT: { struct v4l2_format *f = arg; @@ -375,11 +375,11 @@ static int ts_do_ioctl(struct inode *inode, struct file *file, if (f->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) return -EINVAL; - /* + /* FIXME: translate and round width/height into EMPRESS subsample type: - - type | PAL | NTSC + + type | PAL | NTSC --------------------------- SIF | 352x288 | 352x240 1/2 D1 | 352x576 | 352x480 @@ -420,7 +420,7 @@ static int ts_do_ioctl(struct inode *inode, struct file *file, case MPEG_SETPARAMS: return ts_init_encoder(dev, arg); - + default: return -ENOIOCTLCMD; } @@ -490,8 +490,8 @@ int saa7134_ts_init1(struct saa7134_dev *dev) saa_writeb(SAA7134_TS_PARALLEL_SERIAL, (TS_PACKET_SIZE-1)); saa_writeb(SAA7134_TS_DMA0, ((ts_nr_packets-1)&0xff)); saa_writeb(SAA7134_TS_DMA1, (((ts_nr_packets-1)>>8)&0xff)); - saa_writeb(SAA7134_TS_DMA2, ((((ts_nr_packets-1)>>16)&0x3f) | 0x00)); /* TSNOPIT=0, TSCOLAP=0 */ - + saa_writeb(SAA7134_TS_DMA2, ((((ts_nr_packets-1)>>16)&0x3f) | 0x00)); /* TSNOPIT=0, TSCOLAP=0 */ + return 0; } diff --git a/linux/drivers/media/video/saa7134/saa7134-tvaudio.c b/linux/drivers/media/video/saa7134/saa7134-tvaudio.c index 2e8b3d0b0..682c79857 100644 --- a/linux/drivers/media/video/saa7134/saa7134-tvaudio.c +++ b/linux/drivers/media/video/saa7134/saa7134-tvaudio.c @@ -1,5 +1,5 @@ /* - * $Id: saa7134-tvaudio.c,v 1.13 2004/09/22 11:47:11 kraxel Exp $ + * $Id: saa7134-tvaudio.c,v 1.14 2004/10/13 10:39:00 kraxel Exp $ * * device driver for philips saa7134 based TV cards * tv audio decoder (fm stereo, nicam, ...) @@ -169,7 +169,7 @@ static void tvaudio_init(struct saa7134_dev *dev) if (UNSET != audio_clock_override) clock = audio_clock_override; - + /* init all audio registers */ saa_writeb(SAA7134_AUDIO_PLL_CTRL, 0x00); if (need_resched()) @@ -284,7 +284,7 @@ static void tvaudio_setmode(struct saa7134_dev *dev, saa_writeb(SAA7134_AUDIO_CLOCKS_PER_FIELD1, (acpf & 0x00ff00) >> 8); saa_writeb(SAA7134_AUDIO_CLOCKS_PER_FIELD2, (acpf & 0x030000) >> 16); tvaudio_setcarrier(dev,audio->carr1,audio->carr2); - + switch (audio->mode) { case TVAUDIO_FM_MONO: case TVAUDIO_FM_BG_STEREO: @@ -324,7 +324,7 @@ 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 (timeout < 0) { @@ -364,13 +364,13 @@ static int tvaudio_checkcarrier(struct saa7134_dev *dev, struct mainscan *scan) if (tvaudio_sleep(dev,SCAN_SAMPLE_DELAY)) return -1; left = saa_readl(SAA7134_LEVEL_READOUT1 >> 2); - + tvaudio_setcarrier(dev,scan->carr+90,scan->carr+90); saa_readl(SAA7134_LEVEL_READOUT1 >> 2); if (tvaudio_sleep(dev,SCAN_SAMPLE_DELAY)) return -1; right = saa_readl(SAA7134_LEVEL_READOUT1 >> 2); - + left >>= 16; right >>= 16; value = left > right ? left - right : right - left; @@ -407,7 +407,7 @@ static int tvaudio_getstereo(struct saa7134_dev *dev, struct saa7134_tvaudio *au { __u32 idp,nicam; int retval = -1; - + switch (audio->mode) { case TVAUDIO_FM_MONO: return V4L2_TUNER_SUB_MONO; @@ -652,7 +652,7 @@ static char *stdres[0x20] = { [0x09] = "D/K NICAM", [0x0a] = "L NICAM", [0x0b] = "I NICAM", - + [0x0c] = "M Korea", [0x0d] = "M BTSC ", [0x0e] = "M EIAJ", @@ -747,7 +747,7 @@ static int mute_input_7133(struct saa7134_dev *dev) { u32 reg = 0; int mask; - + switch (dev->input->amux) { case TV: reg = 0x02; break; case LINE1: reg = 0x00; break; @@ -787,11 +787,11 @@ static int tvaudio_thread_ddep(void *data) if (UNSET != audio_clock_override) clock = audio_clock_override; saa_writel(0x598 >> 2, clock); - + /* unmute */ saa_dsp_writel(dev, 0x474 >> 2, 0x00); saa_dsp_writel(dev, 0x450 >> 2, 0x00); - + for (;;) { tvaudio_sleep(dev,-1); if (dev->thread.shutdown || signal_pending(current)) @@ -840,7 +840,7 @@ static int tvaudio_thread_ddep(void *data) /* setup crossbars */ saa_dsp_writel(dev, 0x464 >> 2, 0x000000); saa_dsp_writel(dev, 0x470 >> 2, 0x101010); - + if (tvaudio_sleep(dev,3000)) goto restart; value = saa_readl(0x528 >> 2) & 0xffffff; @@ -861,12 +861,12 @@ static int tvaudio_thread_ddep(void *data) (value & 0x002000) ? " BTSC stereo noise mute " : "", (value & 0x004000) ? " SAP noise mute " : "", (value & 0x008000) ? " VDSP " : "", - + (value & 0x010000) ? " NICST " : "", (value & 0x020000) ? " NICDU " : "", (value & 0x040000) ? " NICAM muted " : "", (value & 0x080000) ? " NICAM reserve sound " : "", - + (value & 0x100000) ? " init done " : ""); } @@ -881,7 +881,7 @@ static int tvaudio_thread_ddep(void *data) int saa7134_tvaudio_rx2mode(u32 rx) { u32 mode; - + mode = V4L2_TUNER_MODE_MONO; if (rx & V4L2_TUNER_SUB_STEREO) mode = V4L2_TUNER_MODE_STEREO; @@ -891,7 +891,7 @@ int saa7134_tvaudio_rx2mode(u32 rx) mode = V4L2_TUNER_MODE_LANG2; return mode; } - + void saa7134_tvaudio_setmute(struct saa7134_dev *dev) { switch (dev->pci->device) { @@ -959,11 +959,11 @@ int saa7134_tvaudio_init2(struct saa7134_dev *dev) if (saa7134_boards[dev->board].has_ts) { int i2sform = (48000 == dev->oss.rate) ? 0x01 : 0x00; - + /* enable I2S output */ - saa_writeb(SAA7134_I2S_OUTPUT_SELECT, 0x80); - saa_writeb(SAA7134_I2S_OUTPUT_FORMAT, i2sform); - saa_writeb(SAA7134_I2S_OUTPUT_LEVEL, 0x0F); + saa_writeb(SAA7134_I2S_OUTPUT_SELECT, 0x80); + saa_writeb(SAA7134_I2S_OUTPUT_FORMAT, i2sform); + saa_writeb(SAA7134_I2S_OUTPUT_LEVEL, 0x0F); saa_writeb(SAA7134_I2S_AUDIO_OUTPUT, 0x01); } diff --git a/linux/drivers/media/video/saa7134/saa7134-vbi.c b/linux/drivers/media/video/saa7134/saa7134-vbi.c index 312da9bf7..ee4806d54 100644 --- a/linux/drivers/media/video/saa7134/saa7134-vbi.c +++ b/linux/drivers/media/video/saa7134/saa7134-vbi.c @@ -1,5 +1,5 @@ /* - * $Id: saa7134-vbi.c,v 1.3 2004/09/23 13:58:19 kraxel Exp $ + * $Id: saa7134-vbi.c,v 1.4 2004/10/13 10:39:00 kraxel Exp $ * * device driver for philips saa7134 based TV cards * video4linux video interface @@ -53,7 +53,7 @@ static void task_init(struct saa7134_dev *dev, struct saa7134_buf *buf, int task) { struct saa7134_tvnorm *norm = dev->tvnorm; - + /* setup video scaler */ saa_writeb(SAA7134_VBI_H_START1(task), norm->h_start & 0xff); saa_writeb(SAA7134_VBI_H_START2(task), norm->h_start >> 8); @@ -174,7 +174,7 @@ buffer_setup(void *priv, unsigned int *count, unsigned int *size) struct saa7134_fh *fh = priv; struct saa7134_dev *dev = fh->dev; int llength,lines; - + lines = dev->tvnorm->vbi_v_stop - dev->tvnorm->vbi_v_start +1; #if 1 llength = VBI_LINE_LENGTH; @@ -195,7 +195,7 @@ static void buffer_queue(void *priv, struct videobuf_buffer *vb) struct saa7134_fh *fh = priv; struct saa7134_dev *dev = fh->dev; struct saa7134_buf *buf = (struct saa7134_buf *)vb; - + saa7134_buffer_queue(dev,&dev->vbi_q,buf); } @@ -204,7 +204,7 @@ static void buffer_release(void *priv, struct videobuf_buffer *vb) struct saa7134_fh *fh = priv; struct saa7134_dev *dev = fh->dev; struct saa7134_buf *buf = (struct saa7134_buf *)vb; - + saa7134_dma_free(dev,buf); } diff --git a/linux/drivers/media/video/saa7134/saa7134-video.c b/linux/drivers/media/video/saa7134/saa7134-video.c index 4d79c3dc6..3995f062b 100644 --- a/linux/drivers/media/video/saa7134/saa7134-video.c +++ b/linux/drivers/media/video/saa7134/saa7134-video.c @@ -1,5 +1,5 @@ /* - * $Id: saa7134-video.c,v 1.15 2004/10/11 14:53:13 kraxel Exp $ + * $Id: saa7134-video.c,v 1.16 2004/10/13 10:39:00 kraxel Exp $ * * device driver for philips saa7134 based TV cards * video4linux video interface @@ -55,7 +55,7 @@ MODULE_PARM_DESC(noninterlaced,"video input is noninterlaced"); static int video_out[][9] = { [CCIR656] = { 0x00, 0xb1, 0x00, 0xa1, 0x00, 0x04, 0x06, 0x00, 0x00 }, }; - + static struct saa7134_format formats[] = { { .name = "8 bpp gray", @@ -373,7 +373,7 @@ static const unsigned int CTRLS = ARRAY_SIZE(video_ctrls); static const struct v4l2_queryctrl* ctrl_by_id(unsigned int id) { unsigned int i; - + for (i = 0; i < CTRLS; i++) if (video_ctrls[i].id == id) return video_ctrls+i; @@ -482,12 +482,12 @@ static void set_tvnorm(struct saa7134_dev *dev, struct saa7134_tvnorm *norm) saa_writeb(SAA7134_HSYNC_START, 0xeb); saa_writeb(SAA7134_HSYNC_STOP, 0xe0); saa_writeb(SAA7134_SOURCE_TIMING1, norm->src_timing); - + saa_writeb(SAA7134_SYNC_CTRL, sync_control); saa_writeb(SAA7134_LUMA_CTRL, luma_control); saa_writeb(SAA7134_DEC_LUMA_BRIGHT, dev->ctl_bright); saa_writeb(SAA7134_DEC_LUMA_CONTRAST, dev->ctl_contrast); - + saa_writeb(SAA7134_DEC_CHROMA_SATURATION, dev->ctl_saturation); saa_writeb(SAA7134_DEC_CHROMA_HUE, dev->ctl_hue); saa_writeb(SAA7134_CHROMA_CTRL1, norm->chroma_ctrl1); @@ -570,7 +570,7 @@ static void set_h_prescale(struct saa7134_dev *dev, int task, int prescale) static void set_v_scale(struct saa7134_dev *dev, int task, int yscale) { int val,mirror; - + saa_writeb(SAA7134_V_SCALE_RATIO1(task), yscale & 0xff); saa_writeb(SAA7134_V_SCALE_RATIO2(task), yscale >> 8); @@ -604,7 +604,7 @@ static void set_size(struct saa7134_dev *dev, int task, v_start = dev->crop_current.top/2; h_stop = (dev->crop_current.left + dev->crop_current.width -1); v_stop = (dev->crop_current.top + dev->crop_current.height -1)/2; - + saa_writeb(SAA7134_VIDEO_H_START1(task), h_start & 0xff); saa_writeb(SAA7134_VIDEO_H_START2(task), h_start >> 8); saa_writeb(SAA7134_VIDEO_H_STOP1(task), h_stop & 0xff); @@ -624,7 +624,7 @@ static void set_size(struct saa7134_dev *dev, int task, saa_writeb(SAA7134_H_SCALE_INC1(task), xscale & 0xff); saa_writeb(SAA7134_H_SCALE_INC2(task), xscale >> 8); set_v_scale(dev,task,yscale); - + saa_writeb(SAA7134_VIDEO_PIXELS1(task), width & 0xff); saa_writeb(SAA7134_VIDEO_PIXELS2(task), width >> 8); saa_writeb(SAA7134_VIDEO_LINES1(task), height/div & 0xff); @@ -651,7 +651,7 @@ static void sort_cliplist(struct cliplist *cl, int entries) { struct cliplist swap; int i,j,n; - + for (i = entries-2; i >= 0; i--) { for (n = 0, j = 0; j <= i; j++) { if (cl[j].position > cl[j+1].position) { @@ -846,7 +846,7 @@ static int buffer_activate(struct saa7134_dev *dev, dprintk("buffer_activate buf=%p\n",buf); buf->vb.state = STATE_ACTIVE; buf->top_seen = 0; - + set_size(dev,TASK_A,buf->vb.width,buf->vb.height, V4L2_FIELD_HAS_BOTH(buf->vb.field)); if (buf->fmt->yuv) @@ -926,7 +926,7 @@ static int buffer_prepare(void *priv, struct videobuf_buffer *vb, struct saa7134_buf *buf = (struct saa7134_buf *)vb; unsigned int size; int err; - + /* sanity checks */ if (NULL == fh->fmt) return -EINVAL; @@ -995,7 +995,7 @@ static void buffer_queue(void *priv, struct videobuf_buffer *vb) { struct saa7134_fh *fh = priv; struct saa7134_buf *buf = (struct saa7134_buf *)vb; - + saa7134_buffer_queue(fh->dev,&fh->dev->video_q,buf); } @@ -1003,7 +1003,7 @@ static void buffer_release(void *priv, struct videobuf_buffer *vb) { struct saa7134_fh *fh = priv; struct saa7134_buf *buf = (struct saa7134_buf *)vb; - + saa7134_dma_free(fh->dev,buf); } @@ -1160,7 +1160,7 @@ static int set_control(struct saa7134_dev *dev, struct saa7134_fh *fh, static struct videobuf_queue* saa7134_queue(struct saa7134_fh *fh) { struct videobuf_queue* q = NULL; - + switch (fh->type) { case V4L2_BUF_TYPE_VIDEO_CAPTURE: q = &fh->cap; @@ -1177,7 +1177,7 @@ static struct videobuf_queue* saa7134_queue(struct saa7134_fh *fh) static int saa7134_resource(struct saa7134_fh *fh) { int res = 0; - + switch (fh->type) { case V4L2_BUF_TYPE_VIDEO_CAPTURE: res = RESOURCE_VIDEO; @@ -1199,7 +1199,7 @@ static int video_open(struct inode *inode, struct file *file) struct list_head *list; enum v4l2_buf_type type = V4L2_BUF_TYPE_VIDEO_CAPTURE; int radio = 0; - + list_for_each(list,&saa7134_devlist) { h = list_entry(list, struct saa7134_dev, devlist); if (h->video_dev && (h->video_dev->minor == minor)) @@ -1377,7 +1377,7 @@ static int video_mmap(struct file *file, struct vm_area_struct * vma) { struct saa7134_fh *fh = file->private_data; - + return videobuf_mmap_mapper(vma,saa7134_queue(fh)); } @@ -1436,7 +1436,7 @@ int saa7134_try_fmt(struct saa7134_dev *dev, struct saa7134_fh *fh, struct v4l2_format *f) { int err; - + switch (f->type) { case V4L2_BUF_TYPE_VIDEO_CAPTURE: { @@ -1451,7 +1451,7 @@ int saa7134_try_fmt(struct saa7134_dev *dev, struct saa7134_fh *fh, field = f->fmt.pix.field; maxw = min(dev->crop_current.width*4, dev->crop_bounds.width); maxh = min(dev->crop_current.height*4, dev->crop_bounds.height); - + if (V4L2_FIELD_ANY == field) { field = (f->fmt.pix.height > maxh/2) ? V4L2_FIELD_INTERLACED @@ -1481,7 +1481,7 @@ int saa7134_try_fmt(struct saa7134_dev *dev, struct saa7134_fh *fh, (f->fmt.pix.width * fmt->depth) >> 3; f->fmt.pix.sizeimage = f->fmt.pix.height * f->fmt.pix.bytesperline; - + return 0; } case V4L2_BUF_TYPE_VIDEO_OVERLAY: @@ -1502,13 +1502,13 @@ int saa7134_s_fmt(struct saa7134_dev *dev, struct saa7134_fh *fh, { unsigned long flags; int err; - + switch (f->type) { case V4L2_BUF_TYPE_VIDEO_CAPTURE: err = saa7134_try_fmt(dev,fh,f); if (0 != err) return err; - + fh->fmt = format_by_fourcc(f->fmt.pix.pixelformat); fh->width = f->fmt.pix.width; fh->height = f->fmt.pix.height; @@ -1550,7 +1550,7 @@ int saa7134_common_ioctl(struct saa7134_dev *dev, unsigned int cmd, void *arg) { int err; - + switch (cmd) { case VIDIOC_QUERYCTRL: { @@ -1617,7 +1617,7 @@ int saa7134_common_ioctl(struct saa7134_dev *dev, case VIDIOC_S_INPUT: { int *i = arg; - + if (*i < 0 || *i >= SAA7134_INPUT_MAX) return -EINVAL; if (NULL == card_in(dev,*i).name) @@ -1665,7 +1665,7 @@ static int video_do_ioctl(struct inode *inode, struct file *file, case VIDIOC_QUERYCAP: { struct v4l2_capability *cap = arg; - + memset(cap,0,sizeof(*cap)); strcpy(cap->driver, "saa7134"); strlcpy(cap->card, saa7134_boards[dev->board].name, @@ -1677,7 +1677,7 @@ static int video_do_ioctl(struct inode *inode, struct file *file, V4L2_CAP_VIDEO_OVERLAY | V4L2_CAP_VBI_CAPTURE | V4L2_CAP_TUNER | - V4L2_CAP_READWRITE | + V4L2_CAP_READWRITE | V4L2_CAP_STREAMING; return 0; } @@ -1727,7 +1727,7 @@ static int video_do_ioctl(struct inode *inode, struct file *file, set_tvnorm(dev,&tvnorms[i]); start_preview(dev,fh); spin_unlock_irqrestore(&dev->slock,flags); - } else + } else set_tvnorm(dev,&tvnorms[i]); saa7134_tvaudio_do_scan(dev); up(&dev->lock); @@ -1759,7 +1759,7 @@ static int video_do_ioctl(struct inode *inode, struct file *file, case VIDIOC_G_CROP: { struct v4l2_crop * crop = arg; - + if (crop->type != V4L2_BUF_TYPE_VIDEO_CAPTURE && crop->type != V4L2_BUF_TYPE_VIDEO_OVERLAY) return -EINVAL; @@ -1770,7 +1770,7 @@ static int video_do_ioctl(struct inode *inode, struct file *file, { struct v4l2_crop *crop = arg; struct v4l2_rect *b = &dev->crop_bounds; - + if (crop->type != V4L2_BUF_TYPE_VIDEO_CAPTURE && crop->type != V4L2_BUF_TYPE_VIDEO_OVERLAY) return -EINVAL; @@ -1790,7 +1790,7 @@ static int video_do_ioctl(struct inode *inode, struct file *file, crop->c.top = b->top + b->height; if (crop->c.height > b->top - crop->c.top + b->height) crop->c.height = b->top - crop->c.top + b->height; - + if (crop->c.left < b->left) crop->c.top = b->left; if (crop->c.left > b->left + b->width) @@ -1873,7 +1873,7 @@ static int video_do_ioctl(struct inode *inode, struct file *file, up(&dev->lock); return 0; } - + /* --- control ioctls ---------------------------------------- */ case VIDIOC_ENUMINPUT: case VIDIOC_G_INPUT: @@ -1949,7 +1949,7 @@ static int video_do_ioctl(struct inode *inode, struct file *file, strcpy(f->description,"vbi data"); break; default: - return -EINVAL; + return -EINVAL; } return 0; } @@ -1965,7 +1965,7 @@ static int video_do_ioctl(struct inode *inode, struct file *file, { struct v4l2_framebuffer *fb = arg; struct saa7134_format *fmt; - + if(!capable(CAP_SYS_ADMIN) && !capable(CAP_SYS_RAWIO)) return -EPERM; @@ -2021,7 +2021,7 @@ static int video_do_ioctl(struct inode *inode, struct file *file, struct v4l2_format *f = arg; return saa7134_try_fmt(dev,fh,f); } - + case VIDIOCGMBUF: { struct video_mbuf *mbuf = arg; @@ -2096,7 +2096,7 @@ static int radio_do_ioctl(struct inode *inode, struct file *file, { struct saa7134_fh *fh = file->private_data; struct saa7134_dev *dev = fh->dev; - + if (video_debug > 1) saa7134_print_ioctl(dev->name,cmd); switch (cmd) { @@ -2127,7 +2127,7 @@ static int radio_do_ioctl(struct inode *inode, struct file *file, #ifdef V4L2_I2C_CLIENTS saa7134_i2c_call_clients(dev,VIDIOC_G_TUNER,t); -#else +#else { struct video_tuner vt; memset(&vt,0,sizeof(vt)); @@ -2140,7 +2140,7 @@ static int radio_do_ioctl(struct inode *inode, struct file *file, case VIDIOC_ENUMINPUT: { struct v4l2_input *i = arg; - + if (i->index != 0) return -EINVAL; strcpy(i->name,"Radio"); @@ -2194,7 +2194,7 @@ static int radio_do_ioctl(struct inode *inode, struct file *file, case VIDIOC_G_FREQUENCY: case VIDIOC_S_FREQUENCY: return video_do_ioctl(inode,file,cmd,arg); - + default: return v4l_compat_translate_ioctl(inode,file,cmd,arg, radio_do_ioctl); @@ -2302,7 +2302,7 @@ int saa7134_video_init1(struct saa7134_dev *dev) saa_writeb(SAA7134_VIDEO_PORT_CTRL7, video_out[vo][7]); saa_writeb(SAA7134_VIDEO_PORT_CTRL8, video_out[vo][8]); } - + return 0; } @@ -2330,7 +2330,7 @@ void saa7134_irq_video_intl(struct saa7134_dev *dev) norm = saa_readb(SAA7134_STATUS_VIDEO1) & 0x03; dprintk("DCSDT: %s\n",st[norm]); - + if (0 != norm) { /* wake up tvaudio audio carrier scan thread */ saa7134_tvaudio_do_scan(dev); @@ -2348,7 +2348,7 @@ void saa7134_irq_video_intl(struct saa7134_dev *dev) void saa7134_irq_video_done(struct saa7134_dev *dev, unsigned long status) { enum v4l2_field field; - + spin_lock(&dev->slock); if (dev->video_q.curr) { dev->video_fieldcount++; diff --git a/linux/drivers/media/video/saa7134/saa7134.h b/linux/drivers/media/video/saa7134/saa7134.h index 89c0813c4..8a4446703 100644 --- a/linux/drivers/media/video/saa7134/saa7134.h +++ b/linux/drivers/media/video/saa7134/saa7134.h @@ -1,5 +1,5 @@ /* - * $Id: saa7134.h,v 1.21 2004/10/12 17:08:43 kraxel Exp $ + * $Id: saa7134.h,v 1.22 2004/10/13 10:39:00 kraxel Exp $ * * v4l2 device driver for philips saa7134 based TV cards * @@ -204,7 +204,7 @@ struct saa7134_board { struct saa7134_input inputs[SAA7134_INPUT_MAX]; struct saa7134_input radio; struct saa7134_input mute; - + /* peripheral I/O */ unsigned int has_ts; enum saa7134_video_out video_out; @@ -283,7 +283,7 @@ struct saa7134_fh { unsigned int radio; enum v4l2_buf_type type; unsigned int resources; -#ifdef VIDIOC_G_PRIORITY +#ifdef VIDIOC_G_PRIORITY enum v4l2_priority prio; #endif @@ -362,7 +362,7 @@ struct saa7134_dev { struct list_head devlist; struct semaphore lock; spinlock_t slock; -#ifdef VIDIOC_G_PRIORITY +#ifdef VIDIOC_G_PRIORITY struct v4l2_prio_state prio; #endif @@ -426,12 +426,12 @@ struct saa7134_dev { int ctl_y_odd; int ctl_y_even; int ctl_automute; - + /* crop */ struct v4l2_rect crop_bounds; struct v4l2_rect crop_defrect; struct v4l2_rect crop_current; - + /* other global state info */ unsigned int automute; struct saa7134_thread thread; |