dwe_ioctl.h 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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 "dwe_dev.h"
  56. enum {
  57. DWEIOC_RESET = 0x100,
  58. DWEIOC_S_PARAMS,
  59. DWEIOC_ENABLE_BUS,
  60. DWEIOC_DISABLE_BUS,
  61. DWEIOC_DISABLE_IRQ,
  62. DWEIOC_CLEAR_IRQ,
  63. DWEIOC_READ_IRQ,
  64. DWEIOC_START,
  65. DWEIOC_STOP,
  66. DWEIOC_START_DMA_READ,
  67. DWEIOC_SET_BUFFER,
  68. DWEIOC_SET_LUT,
  69. };
  70. struct lut_info {
  71. u32 port;
  72. u64 addr;
  73. };
  74. long dwe_priv_ioctl(struct dwe_ic_dev *dev, unsigned int cmd, void *args);
  75. int dwe_reset(struct dwe_ic_dev *dev);
  76. int dwe_s_params(struct dwe_ic_dev *dev, struct dwe_hw_info *info);
  77. int dwe_enable_bus(struct dwe_ic_dev *dev, bool enable);
  78. int dwe_disable_irq(struct dwe_ic_dev *dev);
  79. int dwe_clear_irq(struct dwe_ic_dev *dev);
  80. int dwe_read_irq(struct dwe_ic_dev *dev, u32 *ret);
  81. int dwe_start_dma_read(struct dwe_ic_dev *dev,
  82. struct dwe_hw_info *info, u64 addr);
  83. int dwe_set_buffer(struct dwe_ic_dev *dev, struct dwe_hw_info *info, u64 addr);
  84. int dwe_set_lut(struct dwe_ic_dev *dev, u64 addr);
  85. #ifdef __KERNEL__
  86. int dwe_on_buf_update(struct dwe_ic_dev *dev);
  87. irqreturn_t dwe_hw_isr(int irq, void *data);
  88. void dwe_clear_interrupts(struct dwe_ic_dev *dev);
  89. #endif
  90. #endif /* _DWE_IOC_H_ */