tuner_spi.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. /*
  2. *
  3. * drivers/media/isdbtmm/tuner_spi.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. /******************************************************************************/
  20. /*** ***/
  21. /******************************************************************************/
  22. #include <linux/kernel.h>
  23. #include <linux/fs.h>
  24. #include <linux/errno.h>
  25. #include <linux/device.h>
  26. #include <linux/platform_device.h>
  27. #include <linux/init.h>
  28. #include <linux/module.h>
  29. #include <linux/string.h>
  30. #include <linux/types.h>
  31. #include <linux/fcntl.h>
  32. /* for delay(sleep) */
  33. #include <linux/delay.h>
  34. /* for mutex */
  35. #include <linux/mutex.h>
  36. /*using copy to user */
  37. #include <linux/uaccess.h>
  38. #include <linux/clk.h>
  39. #include <linux/mm.h>
  40. #include <linux/slab.h>
  41. #include <linux/workqueue.h>
  42. #include <linux/irq.h>
  43. #include <asm/mach/irq.h>
  44. #include <linux/interrupt.h>
  45. #include <linux/vmalloc.h>
  46. #include <linux/io.h>
  47. #include <mach/gpio.h>
  48. /******************************************************************************/
  49. /*** ***/
  50. /******************************************************************************/
  51. #define NODE_MAJOR 226 /* Major No. */
  52. #define NODE_MINOR 0 /* Minor No. */
  53. #define NODE_PATHNAME "mmtunerspi" /* Device Name */
  54. /******************************************************************************/
  55. /*** ***/
  56. /******************************************************************************/
  57. /*** SPI Internal Register Setting ***/
  58. typedef struct t_ioctl_spi_internal_reg
  59. {
  60. unsigned char cmd; /* 0x01 */
  61. unsigned char data; /* 0xB1 */
  62. } ioctl_spi_internal_reg;
  63. /*** Packet Synchronize ***/
  64. typedef struct t_ioctl_spi_pktsync
  65. {
  66. unsigned char cmd; /* 0xD8 */
  67. unsigned char dum1; /* 0x00 */
  68. unsigned char dum2; /* 0x00 */
  69. unsigned char dum3; /* 0x00 */
  70. } ioctl_spi_pktsync;
  71. /*** TS Buffer Status ***/
  72. typedef struct t_ioctl_spi_bufstatus
  73. {
  74. unsigned char cmd; /* 0x03 */
  75. unsigned char read; /* 0x10 */
  76. unsigned char addr; /* 0x00 */
  77. unsigned char dum; /* 0x00 */
  78. } ioctl_spi_bufstatus;
  79. /*** Read Packet ***/
  80. typedef struct t_ioctl_spi_pktread
  81. {
  82. unsigned char cmd; /* 0x0B */
  83. unsigned char dum1; /* 0x00 */
  84. unsigned char size; /* 0x01 */
  85. unsigned char read_pkt; /* 0xXX */
  86. unsigned char dum2; /* 0x00 */
  87. } ioctl_spi_pktread;
  88. /*** IOCTL Data ***/
  89. typedef struct t_smt113j_ioctl_data
  90. {
  91. unsigned int open_cnt;
  92. } smt113j_ioctl_data;
  93. /******************************************************************************/
  94. /*** ***/
  95. /******************************************************************************/
  96. extern int smt113j_spi_thread ( void *arg );
  97. extern int SMT113J_SPI_init ( void );
  98. extern void SMT113J_SPI_exit ( void );