Lines Matching refs:dev
84 static int tw68_hw_init1(struct tw68_dev *dev) in tw68_hw_init1() argument
178 mutex_init(&dev->lock); in tw68_hw_init1()
179 spin_lock_init(&dev->slock); in tw68_hw_init1()
182 tw68_video_init1(dev); in tw68_hw_init1()
188 struct tw68_dev *dev = dev_id; in tw68_irq() local
192 status = orig = tw_readl(TW68_INTSTAT) & dev->pci_irqmask; in tw68_irq()
197 if (status & dev->board_virqmask) /* video interrupt */ in tw68_irq()
198 tw68_irq_video_done(dev, status); in tw68_irq()
199 status = tw_readl(TW68_INTSTAT) & dev->pci_irqmask; in tw68_irq()
203 dev_dbg(&dev->pci->dev, "%s: **** INTERRUPT NOT HANDLED - clearing mask (orig 0x%08x, cur 0x%08x)", in tw68_irq()
204 dev->name, orig, tw_readl(TW68_INTSTAT)); in tw68_irq()
205 dev_dbg(&dev->pci->dev, "%s: pci_irqmask 0x%08x; board_virqmask 0x%08x ****\n", in tw68_irq()
206 dev->name, dev->pci_irqmask, dev->board_virqmask); in tw68_irq()
207 tw_clearl(TW68_INTMASK, dev->pci_irqmask); in tw68_irq()
214 struct tw68_dev *dev; in tw68_initdev() local
218 dev = devm_kzalloc(&pci_dev->dev, sizeof(*dev), GFP_KERNEL); in tw68_initdev()
219 if (NULL == dev) in tw68_initdev()
222 dev->instance = v4l2_device_set_name(&dev->v4l2_dev, "tw68", in tw68_initdev()
225 err = v4l2_device_register(&pci_dev->dev, &dev->v4l2_dev); in tw68_initdev()
230 dev->pci = pci_dev; in tw68_initdev()
236 dev->name = dev->v4l2_dev.name; in tw68_initdev()
240 dev->name, latency); in tw68_initdev()
245 pci_read_config_byte(pci_dev, PCI_CLASS_REVISION, &dev->pci_rev); in tw68_initdev()
246 pci_read_config_byte(pci_dev, PCI_LATENCY_TIMER, &dev->pci_lat); in tw68_initdev()
248 dev->name, pci_name(pci_dev), dev->pci_rev, pci_dev->irq, in tw68_initdev()
249 dev->pci_lat, (u64)pci_resource_start(pci_dev, 0)); in tw68_initdev()
251 err = dma_set_mask(&pci_dev->dev, DMA_BIT_MASK(32)); in tw68_initdev()
253 pr_info("%s: Oops: no 32bit PCI DMA ???\n", dev->name); in tw68_initdev()
259 dev->vdecoder = TW6800; in tw68_initdev()
260 dev->board_virqmask = TW68_VID_INTS; in tw68_initdev()
263 dev->vdecoder = TW6801; in tw68_initdev()
264 dev->board_virqmask = TW68_VID_INTS | TW68_VID_INTSX; in tw68_initdev()
267 dev->vdecoder = TW6804; in tw68_initdev()
268 dev->board_virqmask = TW68_VID_INTS | TW68_VID_INTSX; in tw68_initdev()
271 dev->vdecoder = TWXXXX; /* To be announced */ in tw68_initdev()
272 dev->board_virqmask = TW68_VID_INTS | TW68_VID_INTSX; in tw68_initdev()
279 dev->name)) { in tw68_initdev()
282 dev->name, in tw68_initdev()
286 dev->lmmio = ioremap(pci_resource_start(pci_dev, 0), in tw68_initdev()
288 dev->bmmio = (__u8 __iomem *)dev->lmmio; in tw68_initdev()
289 if (NULL == dev->lmmio) { in tw68_initdev()
292 dev->name); in tw68_initdev()
297 tw68_hw_init1(dev); in tw68_initdev()
300 err = devm_request_irq(&pci_dev->dev, pci_dev->irq, tw68_irq, in tw68_initdev()
301 IRQF_SHARED, dev->name, dev); in tw68_initdev()
304 dev->name, pci_dev->irq); in tw68_initdev()
312 if (dev->instance < TW68_MAXBOARDS) in tw68_initdev()
313 vidnr = video_nr[dev->instance]; in tw68_initdev()
315 err = tw68_video_init2(dev, vidnr); in tw68_initdev()
318 dev->name); in tw68_initdev()
321 tw_setl(TW68_INTMASK, dev->pci_irqmask); in tw68_initdev()
324 dev->name, video_device_node_name(&dev->vdev)); in tw68_initdev()
329 video_unregister_device(&dev->vdev); in tw68_initdev()
331 iounmap(dev->lmmio); in tw68_initdev()
336 v4l2_device_unregister(&dev->v4l2_dev); in tw68_initdev()
343 struct tw68_dev *dev = in tw68_finidev() local
351 video_unregister_device(&dev->vdev); in tw68_finidev()
352 v4l2_ctrl_handler_free(&dev->hdl); in tw68_finidev()
355 iounmap(dev->lmmio); in tw68_finidev()
359 v4l2_device_unregister(&dev->v4l2_dev); in tw68_finidev()
366 struct tw68_dev *dev = container_of(v4l2_dev, in tw68_suspend() local
370 dev->pci_irqmask &= ~TW68_VID_INTS; in tw68_suspend()
375 vb2_discard_done(&dev->vidq); in tw68_suspend()
383 struct tw68_dev *dev = container_of(v4l2_dev, in tw68_resume() local
393 tw68_set_tvnorm_hw(dev); in tw68_resume()
396 spin_lock_irqsave(&dev->slock, flags); in tw68_resume()
397 buf = container_of(dev->active.next, struct tw68_buf, list); in tw68_resume()
399 tw68_video_start_dma(dev, buf); in tw68_resume()
401 spin_unlock_irqrestore(&dev->slock, flags); in tw68_resume()