tuner_drv_sys.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. /*
  2. *
  3. * drivers/media/isdbtmm/tuner_drv_sys.h
  4. *
  5. * MM Tuner Driver
  6. *
  7. * Copyright (C) (2013, Samsung Electronics)
  8. *
  9. * This program is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License as published by
  11. * the Free Software Foundation version 2.
  12. *
  13. * This program is distributed "as is" WITHOUT ANY WARRANTY of any
  14. * kind, whether express or implied; without even the implied warranty
  15. * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. */
  19. #ifndef _TUNER_DRV_SYS_H
  20. #define _TUNER_DRV_SYS_H
  21. #include <linux/ioctl.h>
  22. /******************************************************************************
  23. * define
  24. ******************************************************************************/
  25. /* IOCTL parameters ( I2C ) */
  26. #define TUNER_IOC_MAGIC 'd'
  27. #define TUNER_IOCTL_VALGET _IOW(TUNER_IOC_MAGIC, \
  28. 0x01, \
  29. struct _tuner_data_rw)
  30. #define TUNER_IOCTL_VALSET _IOR(TUNER_IOC_MAGIC, \
  31. 0x02, \
  32. struct _tuner_data_rw)
  33. #define TUNER_IOCTL_VALGET_EVENT _IOR(TUNER_IOC_MAGIC, \
  34. 0x03, \
  35. struct _tuner_data_rw)
  36. #define TUNER_IOCTL_VALSET_POWER _IOR(TUNER_IOC_MAGIC, \
  37. 0x04, \
  38. struct _tuner_data_rw)
  39. #define TUNER_IOCTL_VALSET_EVENT _IOW(TUNER_IOC_MAGIC, \
  40. 0x05, \
  41. struct _tuner_data_rw)
  42. #define TUNER_IOCTL_VALREL_EVENT _IOW(TUNER_IOC_MAGIC, \
  43. 0x06, \
  44. struct _tuner_data_rw)
  45. /* Add Start 20121218 No_1 */
  46. #define TUNER_IOCTL_VALGET_OPENCNT _IOW(TUNER_IOC_MAGIC, \
  47. 0x07, \
  48. struct _tuner_sts_data)
  49. #define TUNER_IOCTL_VALSET_MONICNT _IOW(TUNER_IOC_MAGIC, \
  50. 0x08, \
  51. struct _tuner_sts_data)
  52. /* Add End 20121218 No_1 */
  53. /* IOCTL parameters ( SPI ) */
  54. #define TUNER_IOC_MAGIC_SPI 's'
  55. #define TUNER_SPI_IOCTL_INIT _IOR(TUNER_IOC_MAGIC_SPI, \
  56. 0x01, \
  57. struct _ioctl_cmd)
  58. #define TUNER_SPI_IOCTL_PKTSYNC _IOR(TUNER_IOC_MAGIC_SPI, \
  59. 0x02, \
  60. struct _ioctl_cmd)
  61. #define TUNER_SPI_IOCTL_BUFSTAT _IOW(TUNER_IOC_MAGIC_SPI, \
  62. 0x03, \
  63. struct _ioctl_cmd)
  64. #define TUNER_SPI_IOCTL_READPKT _IOW(TUNER_IOC_MAGIC_SPI, \
  65. 0x04, \
  66. struct _ioctl_cmd)
  67. #define TUNER_SPI_IOCTL_PKTANSYNC _IOR(TUNER_IOC_MAGIC_SPI, \
  68. 0x05, \
  69. struct _ioctl_cmd)
  70. /*** SPI Sync Run or Stop Define ***/
  71. #define SMT113J_SPI_SYNC_STOP 0
  72. #define SMT113J_SPI_SYNC_RUN 1
  73. /* power supply parameters */
  74. #define TUNER_DRV_CTL_POWON 0 /* Power ON */
  75. #define TUNER_DRV_CTL_POWOFF 1 /* Power OFF */
  76. /* enabit enable */
  77. #define TUNER_SET_ENADATA 0xFF /* enabit */
  78. /******************************************************************************
  79. * data
  80. ******************************************************************************/
  81. /* structure for register Read/Write I2C */
  82. typedef struct _tuner_data_rw {
  83. unsigned short slave_adr; /* I2C slave address */
  84. unsigned short adr; /* reg. address */
  85. unsigned short sbit; /* start bit position */
  86. unsigned short ebit; /* end bit position */
  87. unsigned short param; /* write/read value */
  88. unsigned short enabit; /* enable bit mask */
  89. } TUNER_DATA_RW;
  90. typedef struct _tuner_sts_data {
  91. unsigned long open_cnt;
  92. unsigned long moni_cnt;
  93. } TUNER_STS_DATA;
  94. /* for SPI ioctl data storage */
  95. typedef struct _ioctl_cmd {
  96. unsigned int val; /* value */
  97. unsigned char *buf; /* buffer */
  98. } TUNER_DATA_SPI_RW;
  99. #endif/* _TUNER_DRV_SYS_H */