dw200_ioctl.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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 _DWE_IOC_H_
  54. #define _DWE_IOC_H_
  55. #include "dw200_subdev.h"
  56. #include "dwe_regs.h"
  57. #include "vse_regs.h"
  58. enum {
  59. DWEIOC_RESET = 0x100,
  60. DWEIOC_S_PARAMS,
  61. DWEIOC_ENABLE_BUS,
  62. DWEIOC_DISABLE_BUS,
  63. DWEIOC_DISABLE_IRQ,
  64. DWEIOC_CLEAR_IRQ,
  65. DWEIOC_READ_IRQ,
  66. DWEIOC_START_DMA_READ,
  67. DWEIOC_SET_BUFFER,
  68. DWEIOC_SET_LUT,
  69. DWEIOC_START,
  70. // vse
  71. VSEIOC_RESET,
  72. VSEIOC_S_PARAMS,
  73. VSEIOC_U_BUFFER,
  74. VSEIOC_U_MI_INFO,
  75. VSEIOC_MASK_IRQ,
  76. VSEIOC_READ_IRQ,
  77. VSEIOC_CLEAR_IRQ,
  78. VSEIOC_START_DMA_READ,
  79. DW200IOC_LOCK, // 113
  80. DW200IOC_UNLOCK,
  81. DW200IOC_UPDATECURR,
  82. DW200IOC_VISYS_RESET,
  83. DW200IOC_GET_RESERVE_ADDR,
  84. DW200IOC_RUNTIME_RESUME,
  85. DW200IOC_RUNTIME_SUSPEND,
  86. };
  87. typedef struct dw_src_addr {
  88. u64 y_addr;
  89. u64 uv_addr;
  90. } dw_src_addr_t;
  91. long dw200_priv_ioctl(struct dw200_subdev *dev, unsigned int cmd, void *args);
  92. int dwe_reset(struct dw200_subdev *dev);
  93. int dwe_s_params(struct dw200_subdev *dev);
  94. int dwe_enable_bus(struct dw200_subdev *dev, bool enable);
  95. int dwe_disable_irq(struct dw200_subdev *dev);
  96. int dwe_clear_irq(struct dw200_subdev *dev, u32 mis);
  97. int dwe_clear_irq_1(struct dw200_subdev *dev);
  98. int dwe_read_irq(struct dw200_subdev *dev, u32 *ret);
  99. int dwe_start_dma_read(struct dw200_subdev *dev, dw_src_addr_t src_addr);
  100. int dwe_set_buffer(struct dw200_subdev *dev, u64 addr);
  101. int dwe_set_lut(struct dw200_subdev *dev, u64 addr);
  102. int vse_reset(struct dw200_subdev *dev);
  103. int vse_s_params(struct dw200_subdev *dev);
  104. int vse_update_mi_info(struct dw200_subdev *dev);
  105. int vse_mask_irq(struct dw200_subdev *dev, u32 mask);
  106. int vse_clear_irq(struct dw200_subdev *dev, u32 mis);
  107. int vse_read_irq(struct dw200_subdev *dev, u32 *ret);
  108. /* dma input pa */
  109. int vse_start_dma_read(struct dw200_subdev *dev, u64 addr);
  110. /* mi output pa */
  111. int vse_update_buffers(struct dw200_subdev *dev, u64 *addr);
  112. #endif // _DWE_IOC_H_