isp_irq_queue.h 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. /****************************************************************************
  2. *
  3. * The MIT License (MIT)
  4. *
  5. * Copyright (c) 2020 VeriSilicon Holdings Co., Ltd.
  6. *
  7. * Permission is hereby granted, free of charge, to any person obtaining a
  8. * copy of this software and associated documentation files (the "Software"),
  9. * to deal in the Software without restriction, including without limitation
  10. * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  11. * and/or sell copies of the Software, and to permit persons to whom the
  12. * Software is furnished to do so, subject to the following conditions:
  13. *
  14. * The above copyright notice and this permission notice shall be included in
  15. * all copies or substantial portions of the Software.
  16. *
  17. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  18. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  19. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  20. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  21. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  22. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  23. * DEALINGS IN THE SOFTWARE.
  24. *
  25. *****************************************************************************
  26. *
  27. * The GPL License (GPL)
  28. *
  29. * Copyright (c) 2020 VeriSilicon Holdings Co., Ltd.
  30. *
  31. * This program is free software; you can redistribute it and/or
  32. * modify it under the terms of the GNU General Public License
  33. * as published by the Free Software Foundation; either version 2
  34. * of the License, or (at your option) any later version.
  35. *
  36. * This program is distributed in the hope that it will be useful,
  37. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  38. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  39. * GNU General Public License for more details.
  40. *
  41. * You should have received a copy of the GNU General Public License
  42. * along with this program;
  43. *
  44. *****************************************************************************
  45. *
  46. * Note: This software is released under dual MIT and GPL licenses. A
  47. * recipient may use this file under the terms of either the MIT license or
  48. * GPL License. If you wish to use only one license not the other, you can
  49. * indicate your decision by deleting one of the above license notices in your
  50. * version of this file.
  51. *
  52. *****************************************************************************/
  53. #ifndef _ISP_IRQ_QUEUE_H_
  54. #define _ISP_IRQ_QUEUE_H_
  55. #ifdef __KERNEL__
  56. #include <linux/list.h>
  57. #endif
  58. //#include "isp_ioctl.h"
  59. typedef enum isp_src_e
  60. {
  61. SRC_ISP_IRQ = 0X0000,
  62. SRC_JPE_STATUS_IRQ,
  63. SRC_JPE_ERROR_IRQ,
  64. SRC_MI_IRQ,
  65. SRC_MI1_IRQ,
  66. SRC_MI2_IRQ,
  67. SRC_MIPI_IRQ,
  68. SRC_IRQ_MAX,
  69. } isp_src_t;
  70. typedef struct isp_mis_s {
  71. unsigned int irq_src;
  72. unsigned int val;
  73. #ifdef __KERNEL__
  74. struct list_head list;
  75. #endif
  76. }isp_mis_t;
  77. typedef struct isp_mis_list_s {
  78. isp_mis_t* pHead;
  79. isp_mis_t* pRead;
  80. isp_mis_t* pWrite;
  81. }isp_mis_list_t;
  82. int isp_irq_enqueue(isp_mis_t *new,isp_mis_t* head);
  83. int isp_irq_dequeue(isp_mis_t* data, isp_mis_t* head);
  84. bool isp_irq_is_queue_empty( isp_mis_t* head);
  85. #define QUEUE_NODE_COUNT 15
  86. int isp_irq_create_circle_queue(isp_mis_list_t* pCList, int number);
  87. int isp_irq_destroy_circle_queue(isp_mis_list_t* pCList);
  88. int isp_irq_read_circle_queue(isp_mis_t* data, isp_mis_list_t* pCList);
  89. int isp_irq_write_circle_queue(isp_mis_t* data, isp_mis_list_t* pCList);
  90. #endif