lens_info.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. #ifndef _MAIN_LENS_H
  2. #define _MAIN_LENS_H
  3. #include <linux/ioctl.h>
  4. #define MAX_NUM_OF_LENS 32
  5. #define AF_MAGIC 'A'
  6. /* AFDRV_XXXX be the same as AF_DRVNAME in (*af).c */
  7. #define AFDRV_AD5820AF "AD5820AF"
  8. #define AFDRV_AD5823 "AD5823"
  9. #define AFDRV_AD5823AF "AD5823AF"
  10. #define AFDRV_AK7345AF "AK7345AF"
  11. #define AFDRV_BU63165AF "BU63165AF"
  12. #define AFDRV_BU6424AF "BU6424AF"
  13. #define AFDRV_BU6429AF "BU6429AF"
  14. #define AFDRV_BU64745GWZAF "BU64745GWZAF"
  15. #define AFDRV_DW9714A "DW9714A"
  16. #define AFDRV_DW9714AF "DW9714AF"
  17. #define AFDRV_DW9718AF "DW9718AF"
  18. #define AFDRV_DW9814AF "DW9814AF"
  19. #define AFDRV_FM50AF "FM50AF"
  20. #define AFDRV_GAF001AF "GAF001AF"
  21. #define AFDRV_GAF002AF "GAF002AF"
  22. #define AFDRV_GAF008AF "GAF008AF"
  23. #define AFDRV_LC898122AF "LC898122AF"
  24. #define AFDRV_LC898212AF "LC898212AF"
  25. #define AFDRV_LC898212XDAF "LC898212XDAF"
  26. #define AFDRV_MT9P017AF "MT9P017AF"
  27. #define AFDRV_OV8825AF "OV8825AF"
  28. #define AFDRV_WV511AAF "WV511AAF"
  29. /* Structures */
  30. typedef struct {
  31. /* current position */
  32. u32 u4CurrentPosition;
  33. /* macro position */
  34. u32 u4MacroPosition;
  35. /* Infiniti position */
  36. u32 u4InfPosition;
  37. /* Motor Status */
  38. bool bIsMotorMoving;
  39. /* Motor Open? */
  40. bool bIsMotorOpen;
  41. /* Support SR? */
  42. bool bIsSupportSR;
  43. } stAF_MotorInfo;
  44. /* Structures */
  45. typedef struct {
  46. u8 uMotorName[32];
  47. } stAF_MotorName;
  48. /* Structures */
  49. typedef struct {
  50. u8 uEnable;
  51. u8 uDrvName[32];
  52. void (*pAF_SetI2Cclient)(struct i2c_client *pstAF_I2Cclient, spinlock_t *pAF_SpinLock, int *pAF_Opened);
  53. long (*pAF_Ioctl)(struct file *a_pstFile, unsigned int a_u4Command, unsigned long a_u4Param);
  54. int (*pAF_Release)(struct inode *a_pstInode, struct file *a_pstFile);
  55. } stAF_DrvList;
  56. /* Control commnad */
  57. /* S means "set through a ptr" */
  58. /* T means "tell by a arg value" */
  59. /* G means "get by a ptr" */
  60. /* Q means "get by return a value" */
  61. /* X means "switch G and S atomically" */
  62. /* H means "switch T and Q atomically" */
  63. #define AFIOC_G_MOTORINFO _IOR(AF_MAGIC, 0, stAF_MotorInfo)
  64. #define AFIOC_T_MOVETO _IOW(AF_MAGIC, 1, u32)
  65. #define AFIOC_T_SETINFPOS _IOW(AF_MAGIC, 2, u32)
  66. #define AFIOC_T_SETMACROPOS _IOW(AF_MAGIC, 3, u32)
  67. #define AFIOC_S_SETDRVNAME _IOW(AF_MAGIC, 10, stAF_MotorName)
  68. #endif