tuner.c 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. /*
  2. *
  3. * drivers/media/isdbtmm/tuner.c
  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. * include
  21. ******************************************************************************/
  22. #include <linux/module.h>
  23. #include <linux/kernel.h>
  24. #include <linux/init.h>
  25. #include <linux/types.h>
  26. #include <linux/err.h>
  27. #include <linux/mm.h>
  28. #include <linux/vmalloc.h>
  29. #include <linux/version.h>
  30. #include <linux/wakelock.h>
  31. #include <linux/kthread.h>
  32. #include <linux/spinlock.h>
  33. #include <linux/sched.h>
  34. #include "tuner_drv.h"
  35. #include "tuner_spi.h"
  36. #include "tuner.h"
  37. #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)
  38. #include <linux/mutex.h>
  39. #endif
  40. /******************************************************************************
  41. * data
  42. ******************************************************************************/
  43. /*** thread control ***/
  44. smt113j_spi_thread_t *spi_work_thread = NULL;
  45. /******************************************************************************
  46. * function
  47. ******************************************************************************/
  48. extern void driver_config_during_boot_up(void);
  49. /******************************************************************************
  50. * code area
  51. ******************************************************************************/
  52. /******************************************************************************
  53. * function: smt113J_tuner_start
  54. * brief : initialization control of a driver
  55. * date : 2011.08.02
  56. * author : K.Kitamura(*)
  57. *
  58. * return : 0 normal exit
  59. * : -1 error exit
  60. * input : none
  61. * output : none
  62. ******************************************************************************/
  63. static int __init smt113J_tuner_start (void)
  64. {
  65. /* I2C Driver initialization module */
  66. tuner_drv_start();
  67. /* SPI Driver initialization module */
  68. SMT113J_SPI_init();
  69. printk("smt113J_tuner_start: End\n");
  70. driver_config_during_boot_up();
  71. return 0;
  72. }
  73. /******************************************************************************
  74. * function: smt113J_tuner_end
  75. * brief : exit control of a driver
  76. * date : 2011.08.02
  77. * author : K.Kitamura(*)
  78. *
  79. * return : none
  80. * input : none
  81. * output : none
  82. ******************************************************************************/
  83. static void __exit smt113J_tuner_end ( void )
  84. {
  85. /* I2C Driver exit module */
  86. tuner_drv_end();
  87. /* SPI Driver exit module */
  88. SMT113J_SPI_exit();
  89. printk("smt113J_tuner_end: End\n");
  90. return;
  91. }
  92. /******************************************************************************/
  93. /*** ***/
  94. /******************************************************************************/
  95. module_init ( smt113J_tuner_start );
  96. module_exit ( smt113J_tuner_end );
  97. /******************************************************************************/
  98. /*** ***/
  99. /******************************************************************************/
  100. MODULE_AUTHOR("Samsung");
  101. MODULE_DESCRIPTION("MM Tuner Driver");
  102. MODULE_LICENSE("GPL v2");