subdev.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. /*
  2. * Copyright (c) 2021 Alibaba Group. All rights reserved.
  3. * License-Identifier: Apache-2.0
  4. *
  5. * Licensed under the Apache License, Version 2.0 (the "License"); you may
  6. * not use this file except in compliance with the License.
  7. * You may obtain a copy of the License at
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  13. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. * See the License for the specific language governing permissions and
  15. * limitations under the License.
  16. *
  17. */
  18. #ifndef _THEAD_SUBDEV_H_
  19. #define _THEAD_SUBDEV_H_
  20. #ifdef __KERNEL__
  21. #include <asm/io.h>
  22. #include <linux/cdev.h>
  23. #include <linux/module.h>
  24. #include <linux/platform_device.h>
  25. #include <linux/delay.h>
  26. #include <linux/clk.h>
  27. #include <linux/io.h>
  28. #include <linux/mm.h>
  29. #include <linux/timer.h>
  30. #include <linux/kernel.h>
  31. #include <linux/init.h>
  32. #include <linux/ioctl.h>
  33. #include <linux/poll.h>
  34. #include <linux/workqueue.h>
  35. #include <linux/slab.h>
  36. #include <linux/proc_fs.h>
  37. #include <linux/debugfs.h>
  38. #include <linux/miscdevice.h>
  39. #include <linux/uaccess.h>
  40. #include <linux/interrupt.h>
  41. #include <linux/of.h>
  42. typedef struct {
  43. char name[40];
  44. int path;
  45. int idx;
  46. int param_size;
  47. char param[400];
  48. } sub_dev_info_t;
  49. typedef struct {
  50. char subdev_name[40];
  51. int (*press)(struct fwnode_handle *node, sub_dev_info_t *subdev);
  52. } subdev_dts_press_t;
  53. int video_subdev_press_dts(struct fwnode_handle *node, sub_dev_info_t *subdev);
  54. #endif // __KERNEL__
  55. typedef enum {
  56. VIPRE_MFRAME,
  57. VIPRE_NLINE,
  58. } vipre_dam_mode_e;
  59. typedef struct {
  60. vipre_dam_mode_e dma_mode;
  61. } vipre_ipi_dts_arg_t;
  62. typedef struct {
  63. // Converting refer to TuningRyChlCfg
  64. // Field Default Value (init_dts_frame_cfg) Sample
  65. uint32_t idx; // default: 0 idx = <0>;
  66. uint32_t max_width; // default: 0 (same as input) max_width = <640>;
  67. uint32_t max_height; // default: 0 (same as input) max_height = <480>;
  68. uint32_t frame_count; // default: 2 frame_count = <2>;
  69. uint32_t bit_per_pixel; // default: 12 bit_per_pixel = 12;
  70. char output_name[32]; // default: "unknown" name = "isp0:output[0]";
  71. } subdev_dts_frame_cfg_t;
  72. typedef struct {
  73. subdev_dts_frame_cfg_t dts_path_frame_cfg;
  74. } isp_dts_arg_t;
  75. typedef struct {
  76. subdev_dts_frame_cfg_t dts_path_frame_cfg;
  77. } ry_dts_arg_t;
  78. typedef struct {
  79. uint32_t dw_dst_depth;
  80. } dw_dts_arg_t;
  81. typedef struct {
  82. subdev_dts_frame_cfg_t dts_path_frame_cfg;
  83. } dsp_dts_arg_t;
  84. #endif /*_THEAD_SUBDEV_H_*/