m5602_sensor.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /*
  2. * USB Driver for ALi m5602 based webcams
  3. *
  4. * Copyright (C) 2008 Erik Andrén
  5. * Copyright (C) 2007 Ilyes Gouta. Based on the m5603x Linux Driver Project.
  6. * Copyright (C) 2005 m5603x Linux Driver Project <m5602@x3ng.com.br>
  7. *
  8. * Portions of code to USB interface and ALi driver software,
  9. * Copyright (c) 2006 Willem Duinker
  10. * v4l2 interface modeled after the V4L2 driver
  11. * for SN9C10x PC Camera Controllers
  12. *
  13. * This program is free software; you can redistribute it and/or
  14. * modify it under the terms of the GNU General Public License as
  15. * published by the Free Software Foundation, version 2.
  16. *
  17. */
  18. #ifndef M5602_SENSOR_H_
  19. #define M5602_SENSOR_H_
  20. #include "m5602_bridge.h"
  21. /* Enumerates all supported sensors */
  22. enum sensors {
  23. OV9650_SENSOR = 1,
  24. S5K83A_SENSOR = 2,
  25. S5K4AA_SENSOR = 3,
  26. MT9M111_SENSOR = 4,
  27. PO1030_SENSOR = 5
  28. };
  29. /* Enumerates all possible instruction types */
  30. enum instruction {
  31. BRIDGE,
  32. SENSOR,
  33. SENSOR_LONG
  34. };
  35. struct m5602_sensor {
  36. /* Defines the name of a sensor */
  37. char name[32];
  38. /* What i2c address the sensor is connected to */
  39. u8 i2c_slave_id;
  40. /* Width of each i2c register (in bytes) */
  41. u8 i2c_regW;
  42. /* Probes if the sensor is connected */
  43. int (*probe)(struct sd *sd);
  44. /* Performs a initialization sequence */
  45. int (*init)(struct sd *sd);
  46. /* Executed when the camera starts to send data */
  47. int (*start)(struct sd *sd);
  48. /* Executed when the camera ends to send data */
  49. int (*stop)(struct sd *sd);
  50. /* Executed when the device is disconnected */
  51. void (*disconnect)(struct sd *sd);
  52. /* Performs a power down sequence */
  53. int (*power_down)(struct sd *sd);
  54. };
  55. #endif