• Home
  • Raw
  • Download

Lines Matching refs:cam

133 #define cam_err(cam, fmt, arg...) \  argument
134 dev_err(&(cam)->pdev->dev, fmt, ##arg);
135 #define cam_warn(cam, fmt, arg...) \ argument
136 dev_warn(&(cam)->pdev->dev, fmt, ##arg);
170 static int cafe_smbus_write_data(struct cafe_camera *cam, in cafe_smbus_write_data() argument
175 struct mcam_camera *mcam = &cam->mcam; in cafe_smbus_write_data()
208 wait_event_timeout(cam->smbus_wait, cafe_smbus_write_done(mcam), in cafe_smbus_write_data()
216 cam_err(cam, "SMBUS write (%02x/%02x/%02x) timed out\n", addr, in cafe_smbus_write_data()
221 cam_err(cam, "SMBUS write (%02x/%02x/%02x) error\n", addr, in cafe_smbus_write_data()
249 static int cafe_smbus_read_data(struct cafe_camera *cam, in cafe_smbus_read_data() argument
254 struct mcam_camera *mcam = &cam->mcam; in cafe_smbus_read_data()
269 wait_event_timeout(cam->smbus_wait, in cafe_smbus_read_data()
276 cam_err(cam, "SMBUS read (%02x/%02x) error\n", addr, command); in cafe_smbus_read_data()
280 cam_err(cam, "SMBUS read (%02x/%02x) timed out\n", addr, in cafe_smbus_read_data()
296 struct cafe_camera *cam = i2c_get_adapdata(adapter); in cafe_smbus_xfer() local
304 cam_err(cam, "funky xfer size %d\n", size); in cafe_smbus_xfer()
309 ret = cafe_smbus_write_data(cam, addr, command, data->byte); in cafe_smbus_xfer()
311 ret = cafe_smbus_read_data(cam, addr, command, &data->byte); in cafe_smbus_xfer()
316 static void cafe_smbus_enable_irq(struct cafe_camera *cam) in cafe_smbus_enable_irq() argument
320 spin_lock_irqsave(&cam->mcam.dev_lock, flags); in cafe_smbus_enable_irq()
321 mcam_reg_set_bit(&cam->mcam, REG_IRQMASK, TWSIIRQS); in cafe_smbus_enable_irq()
322 spin_unlock_irqrestore(&cam->mcam.dev_lock, flags); in cafe_smbus_enable_irq()
336 static int cafe_smbus_setup(struct cafe_camera *cam) in cafe_smbus_setup() argument
347 adap->dev.parent = &cam->pdev->dev; in cafe_smbus_setup()
348 i2c_set_adapdata(adap, cam); in cafe_smbus_setup()
356 cam->i2c_adapter = adap; in cafe_smbus_setup()
357 cafe_smbus_enable_irq(cam); in cafe_smbus_setup()
361 static void cafe_smbus_shutdown(struct cafe_camera *cam) in cafe_smbus_shutdown() argument
363 i2c_del_adapter(cam->i2c_adapter); in cafe_smbus_shutdown()
364 kfree(cam->i2c_adapter); in cafe_smbus_shutdown()
441 struct cafe_camera *cam = data; in cafe_irq() local
442 struct mcam_camera *mcam = &cam->mcam; in cafe_irq()
447 handled = cam->registered && mccic_irq(mcam, irqs); in cafe_irq()
450 wake_up(&cam->smbus_wait); in cafe_irq()
490 struct cafe_camera *cam; in cafe_pci_probe() local
497 cam = kzalloc(sizeof(struct cafe_camera), GFP_KERNEL); in cafe_pci_probe()
498 if (cam == NULL) in cafe_pci_probe()
500 pci_set_drvdata(pdev, cam); in cafe_pci_probe()
501 cam->pdev = pdev; in cafe_pci_probe()
502 mcam = &cam->mcam; in cafe_pci_probe()
505 init_waitqueue_head(&cam->smbus_wait); in cafe_pci_probe()
531 ret = request_irq(pdev->irq, cafe_irq, IRQF_SHARED, "cafe-ccic", cam); in cafe_pci_probe()
545 ret = cafe_smbus_setup(cam); in cafe_pci_probe()
550 mcam->asd.match.i2c.adapter_id = i2c_adapter_id(cam->i2c_adapter); in cafe_pci_probe()
558 i2c_adapter_id(cam->i2c_adapter), ov7670_info.addr); in cafe_pci_probe()
560 if (!IS_ERR(i2c_new_client_device(cam->i2c_adapter, &ov7670_info))) { in cafe_pci_probe()
561 cam->registered = 1; in cafe_pci_probe()
567 cafe_smbus_shutdown(cam); in cafe_pci_probe()
570 free_irq(pdev->irq, cam); in cafe_pci_probe()
576 kfree(cam); in cafe_pci_probe()
585 static void cafe_shutdown(struct cafe_camera *cam) in cafe_shutdown() argument
587 mccic_shutdown(&cam->mcam); in cafe_shutdown()
588 cafe_smbus_shutdown(cam); in cafe_shutdown()
589 free_irq(cam->pdev->irq, cam); in cafe_shutdown()
590 pci_iounmap(cam->pdev, cam->mcam.regs); in cafe_shutdown()
596 struct cafe_camera *cam = pci_get_drvdata(pdev); in cafe_pci_remove() local
598 if (cam == NULL) { in cafe_pci_remove()
602 cafe_shutdown(cam); in cafe_pci_remove()
603 kfree(cam); in cafe_pci_remove()
612 struct cafe_camera *cam = dev_get_drvdata(dev); in cafe_pci_suspend() local
614 mccic_suspend(&cam->mcam); in cafe_pci_suspend()
621 struct cafe_camera *cam = dev_get_drvdata(dev); in cafe_pci_resume() local
623 cafe_ctlr_init(&cam->mcam); in cafe_pci_resume()
624 return mccic_resume(&cam->mcam); in cafe_pci_resume()