diff options
author | Holger Waechtler <devnull@localhost> | 2002-12-19 16:21:57 +0000 |
---|---|---|
committer | Holger Waechtler <devnull@localhost> | 2002-12-19 16:21:57 +0000 |
commit | 3d655690f529744e69295509a77747ce7a17bde6 (patch) | |
tree | 4b7d01ba7aca5a93f4d4f969f7b273a1e7d7fa8f /linux/drivers/media/common/saa7146_core.c | |
parent | 85319bae240dc06f7e455239b22b1d85d0f77467 (diff) | |
download | mediapointer-dvb-s2-3d655690f529744e69295509a77747ce7a17bde6.tar.gz mediapointer-dvb-s2-3d655690f529744e69295509a77747ce7a17bde6.tar.bz2 |
removed bogus whitespaces
Diffstat (limited to 'linux/drivers/media/common/saa7146_core.c')
-rw-r--r-- | linux/drivers/media/common/saa7146_core.c | 108 |
1 files changed, 54 insertions, 54 deletions
diff --git a/linux/drivers/media/common/saa7146_core.c b/linux/drivers/media/common/saa7146_core.c index d2485dfbd..6bfd7e30d 100644 --- a/linux/drivers/media/common/saa7146_core.c +++ b/linux/drivers/media/common/saa7146_core.c @@ -1,11 +1,11 @@ /* saa7146.c - video4linux driver for saa7146-based video hardware - + Copyright (C) 1998-2002 Michael Hunold <michael@mihu.de> With ideas taken from: "device driver for philips saa7134 based TV cards" - (c) 2001,02 Gerd Knorr <kraxel@bytesex.org> [SuSE Labs] - + (c) 2001,02 Gerd Knorr <kraxel@bytesex.org> [SuSE Labs] + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or @@ -41,7 +41,7 @@ MODULE_PARM_DESC(debug, "debug level (default: 0)"); static void dump_registers(struct saa7146_dev* dev) { int i = 0; - + INFO((" @ %li jiffies:\n",jiffies)); for(i = 0; i <= 0x148; i+=4) { printk("0x%03x: 0x%08x\n",i,saa7146_read(dev,i)); @@ -54,7 +54,7 @@ static void dump_registers(struct saa7146_dev* dev) void saa7146_dma_free(struct saa7146_dev *dev,struct saa7146_buf *buf) { DEB_EE(("dev:%p, buf:%p\n",dev,buf)); - + if (in_interrupt()) BUG(); @@ -91,7 +91,7 @@ int saa7146_pgtable_alloc(struct pci_dev *pci, struct saa7146_pgtable *pt) pt->size = SAA7146_PGTABLE_SIZE; pt->cpu = cpu; pt->dma = dma_addr; - + return 0; } @@ -99,7 +99,7 @@ void saa7146_pgtable_build_single(struct pci_dev *pci, struct saa7146_pgtable *p { u32 *ptr, fill; int i,p; - + //fm DEB_EE(("pci:%p, pt:%p, sl:%p, len:%d\n",pci,pt,list,length)); /* if we have a user buffer, the first page may not be @@ -112,7 +112,7 @@ void saa7146_pgtable_build_single(struct pci_dev *pci, struct saa7146_pgtable *p *ptr = sg_dma_address(list) - list->offset; } } - + /* safety; fill the page table up with the last valid page */ fill = *(ptr-1); @@ -138,7 +138,7 @@ int video_open(struct inode *inode, struct file *file) struct list_head *list; struct saa7146_fh *fh = NULL; int result = 0; - + enum v4l2_buf_type type = V4L2_BUF_TYPE_VIDEO_CAPTURE; DEB_EE(("inode:%p, file:%p, minor:%d\n",inode,file,minor)); @@ -158,13 +158,13 @@ int video_open(struct inode *inode, struct file *file) } } DEB_D(("using: %p\n",dev)); - + if (NULL == dev) { DEB_S(("no such video device.\n")); result = -ENODEV; goto out; } - + /* check if an extension is registered */ if( NULL == dev->ext ) { DEB_S(("no extension registered for this device.\n")); @@ -194,7 +194,7 @@ int video_open(struct inode *inode, struct file *file) file->private_data = fh; fh->dev = dev; fh->type = type; - + dev->current_hps_source = SAA7146_HPS_SOURCE_PORT_A; dev->current_hps_sync = SAA7146_HPS_SYNC_PORT_A; @@ -226,7 +226,7 @@ static int video_release(struct inode *inode, struct file *file) if( 0 != BOARD_CAN_DO_VBI(dev) ) { saa7146_vbi_uops.release(dev,fh,file); } - + /* fixme: decrease some usage counts */ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,51) dev->ext->dec_use(dev); @@ -291,16 +291,16 @@ static unsigned int video_poll(struct file *file, struct poll_table_struct *wait if (!list_empty(&q->stream)) buf = list_entry(q->stream.next, struct videobuf_buffer, stream); - + if (!buf) { return POLLERR; } - + poll_wait(file, &buf->done, wait); if (buf->state == STATE_DONE || buf->state == STATE_ERROR) { return POLLIN|POLLRDNORM; } - + return 0; } @@ -343,16 +343,16 @@ static void interrupt_hw(int irq, void *dev_id, struct pt_regs *regs) { struct saa7146_dev *dev = (struct saa7146_dev*)dev_id; u32 isr = 0; - + /* read out the interrupt status register */ isr = saa7146_read(dev, ISR); - + /* is this our interrupt? */ if ( 0 == isr ) { /* nope, some other device */ return; } - + saa7146_write(dev, ISR, isr); if( 0 != (dev->ext->irq_mask & isr )) { @@ -381,9 +381,9 @@ static void interrupt_hw(int irq, void *dev_id, struct pt_regs *regs) } if( 0 != isr ) { ERR(("warning: interrupt enabled, but not handled properly.(0x%08x)\n",isr)); - ERR(("disabling interrupt source(s)!\n")); + ERR(("disabling interrupt source(s)!\n")); IER_DISABLE(dev,isr); - } + } } /********************************************************************************/ @@ -402,7 +402,7 @@ int saa7146_buffer_queue(struct saa7146_dev *dev, ERR(("internal error: fatal NULL pointer for q.\n")); return 0; } - + if (NULL == q->curr) { q->curr = buf; DEB_D(("immediately activating buffer %p\n", buf)); @@ -428,12 +428,12 @@ void saa7146_buffer_finish(struct saa7146_dev *dev, } DEB_EE(("dev:%p, dmaq:%p, state:%d\n", dev, q, state)); - + /* finish current buffer */ q->curr->vb.state = state; do_gettimeofday(&q->curr->vb.ts); wake_up(&q->curr->vb.done); - + q->curr = NULL; } @@ -476,7 +476,7 @@ void saa7146_buffer_next(struct saa7146_dev *dev, /* write the address of the rps-program */ saa7146_write(dev, RPS_ADDR0, virt_to_bus(&dev->rps0[ 0])); /* turn on rps */ - saa7146_write(dev, MC1, (MASK_12 | MASK_28)); + saa7146_write(dev, MC1, (MASK_12 | MASK_28)); } del_timer(&q->timeout); } @@ -524,7 +524,7 @@ int saa7146_register_extension(struct saa7146_extension* ext) struct list_head *list = NULL;; DEB_EE(("ext:%p\n",ext)); - + if (down_interruptible(&devices_lock)) return -ERESTARTSYS; @@ -532,7 +532,7 @@ int saa7146_register_extension(struct saa7146_extension* ext) int i = 0; int found = 0; dev = list_entry(list, struct saa7146_dev, item); - + /* check if already handled by extension */ if( 0 != dev->ext ) { continue; @@ -551,7 +551,7 @@ int saa7146_register_extension(struct saa7146_extension* ext) } if( ext->devices[i].subvendor == dev->pci->subsystem_vendor && ext->devices[i].subdevice == dev->pci->subsystem_device ) { - found = 1; + found = 1; break; } } @@ -559,7 +559,7 @@ int saa7146_register_extension(struct saa7146_extension* ext) DEB_S(("extension %p does not handle this device. skipping.\n",ext)); continue; } - + if( 0 != ext->preinit(dev) ) { DEB_S(("ext->preinit() failed for %p. skipping.\n",dev)); continue; @@ -570,9 +570,9 @@ int saa7146_register_extension(struct saa7146_extension* ext) if(i2c_add_adapter(dev->i2c_adapter) < 0) { DEB_S(("cannot register i2c-device. skipping.\n")); continue; - } + } } - + if( 0 != ext->probe(dev, dev->pci->subsystem_vendor, dev->pci->subsystem_device) ) { DEB_D(("ext->probe() failed for %p. skipping device.\n",dev)); if( 0 != ext->use_kernel_i2c ) @@ -589,7 +589,7 @@ int saa7146_register_extension(struct saa7146_extension* ext) dev->ext = NULL; continue; } - + /* v4l2 initialization stuff */ dev->video_dev = device_template; strncpy(dev->video_dev.name, ext->name, 32); @@ -598,7 +598,7 @@ int saa7146_register_extension(struct saa7146_extension* ext) // fixme: -1 should be an insmod parameter *for the extension* (like "video_nr"); if (video_register_device(&dev->video_dev,VFL_TYPE_GRABBER,-1) < 0) { ERR(("cannot register capture v4l2 device. skipping.\n")); - /* in this case the extension has probably + /* in this case the extension has probably already "done something", but the v4l2-device could not be registered. this is not as bad as it looks - you cannot access the device. @@ -634,7 +634,7 @@ int saa7146_unregister_extension(struct saa7146_extension* ext) struct list_head *list = NULL;; DEB_EE(("ext:%p\n",ext)); - + down(&devices_lock); list_for_each(list,&devices) { @@ -658,7 +658,7 @@ int saa7146_unregister_extension(struct saa7146_extension* ext) } dev->ext = NULL; - + /* make sure to erase the minor number... */ dev->video_dev = device_template; @@ -667,7 +667,7 @@ int saa7146_unregister_extension(struct saa7146_extension* ext) } up(&devices_lock); - + return 0; } @@ -696,7 +696,7 @@ static int config_a_device(struct pci_dev *pci) } /* enable bus-mastering */ - pci_set_master(pci); + pci_set_master(pci); dev->pci = pci; /* get chip-revision; this is needed to enable bug-fixes */ @@ -712,14 +712,14 @@ static int config_a_device(struct pci_dev *pci) len = pci_resource_len(pci,0); if (!request_mem_region(pci_resource_start(pci,0), pci_resource_len(pci,0), "saa7146")) { - ERR(("request_mem_region() failed.\n")); + ERR(("request_mem_region() failed.\n")); kfree(dev); return -ENODEV; } if (!(dev->mem = ioremap(adr,len))) { - ERR(("ioremap() failed.\n")); - release_mem_region(adr,len); + ERR(("ioremap() failed.\n")); + release_mem_region(adr,len); kfree(dev); return -ENODEV; } @@ -745,39 +745,39 @@ static int config_a_device(struct pci_dev *pci) if (request_irq(dev->pci->irq, interrupt_hw, SA_SHIRQ | SA_INTERRUPT, dev->name, dev)) { - ERR(("request_irq() failed.\n")); + ERR(("request_irq() failed.\n")); iounmap(dev->mem); - release_mem_region(adr,len); + release_mem_region(adr,len); kfree(dev); return -EINVAL; } - + /* get memory for various stuff */ dev->rps0 = (u32*)kmalloc(SAA7146_RPS_MEM, GFP_KERNEL); if( NULL == dev->rps0 ) goto kmalloc_error_1; - memset(dev->rps0, 0x0, SAA7146_RPS_MEM); + memset(dev->rps0, 0x0, SAA7146_RPS_MEM); dev->rps1 = (u32*)kmalloc(SAA7146_RPS_MEM, GFP_KERNEL); if( NULL == dev->rps1 ) goto kmalloc_error_2; - memset(dev->rps1, 0x0, SAA7146_RPS_MEM); + memset(dev->rps1, 0x0, SAA7146_RPS_MEM); dev->clipping = (u32*)kmalloc(SAA7146_CLIPPING_MEM, GFP_KERNEL); if( NULL == dev->clipping ) goto kmalloc_error_3; - memset(dev->clipping, 0x0, SAA7146_CLIPPING_MEM); + memset(dev->clipping, 0x0, SAA7146_CLIPPING_MEM); dev->i2c_adapter = kmalloc(sizeof(struct i2c_adapter), GFP_KERNEL); if ( NULL == dev->i2c_adapter ) goto kmalloc_error_4; - memset(dev->i2c_adapter, 0x0, sizeof(struct i2c_adapter)); + memset(dev->i2c_adapter, 0x0, sizeof(struct i2c_adapter)); dev->i2c_mem = (u32*)kmalloc(SAA7146_I2C_MEM, GFP_KERNEL); if( NULL == dev->i2c_mem ) goto kmalloc_error_5; - memset(dev->i2c_mem, 0x00, SAA7146_I2C_MEM); - + memset(dev->i2c_mem, 0x00, SAA7146_I2C_MEM); + /* i2c-adapter preparations */ saa7146_i2c_adapter_prepare(dev); @@ -789,7 +789,7 @@ static int config_a_device(struct pci_dev *pci) /* create a nice device name */ sprintf(&dev->name[0], "saa7146 (%d)",saa7146_num); - INFO(("found saa7146 @ mem 0x%08x (revision %d, irq %d) (0x%04x,0x%04x).\n", (unsigned int)dev->mem, dev->revision,dev->pci->irq,dev->pci->subsystem_vendor,dev->pci->subsystem_device)); + INFO(("found saa7146 @ mem 0x%08x (revision %d, irq %d) (0x%04x,0x%04x).\n", (unsigned int)dev->mem, dev->revision,dev->pci->irq,dev->pci->subsystem_vendor,dev->pci->subsystem_device)); dev->ext = NULL; pci_set_drvdata(pci,dev); @@ -809,7 +809,7 @@ static int config_a_device(struct pci_dev *pci) dev->module = THIS_MODULE; return 0; - + kmalloc_error_5: kfree( dev->i2c_adapter ); kmalloc_error_4: @@ -833,14 +833,14 @@ static void unconfig_a_device(struct saa7146_dev* dev) /* shut down all video dma transfers */ saa7146_write(dev, MC1, 0x00ff0000); - + /* disable all irqs, release irq-routine */ saa7146_write(dev, IER, 0); saa7146_write(dev, ISR, 0xffffffff); free_irq(dev->pci->irq, (void *)dev); - /* free kernel memory */ + /* free kernel memory */ kfree(dev->rps0 ); kfree(dev->rps1 ); kfree(dev->clipping); @@ -872,7 +872,7 @@ void __devexit saa7146_remove_one(struct pci_dev *pdev) { struct saa7146_dev* dev = (struct saa7146_dev*) pci_get_drvdata(pdev); - unconfig_a_device(dev); + unconfig_a_device(dev); } |