fsm_dfe_hh.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved.
  2. *
  3. * This program is free software; you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License version 2 and
  5. * only version 2 as published by the Free Software Foundation.
  6. *
  7. * This program is distributed in the hope that it will be useful,
  8. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. * GNU General Public License for more details.
  11. */
  12. #ifndef _FSM_DFE_HH_H_
  13. #define _FSM_DFE_HH_H_
  14. #include <linux/ioctl.h>
  15. /*
  16. * Device interface
  17. */
  18. #define DFE_HH_DEVICE_NAME "dfe_hh"
  19. /*
  20. * IOCTL interface
  21. */
  22. enum {
  23. DFE_IOCTL_COMMAND_CODE_WRITE,
  24. DFE_IOCTL_COMMAND_CODE_WRITE_WITH_MASK,
  25. };
  26. struct dfe_write_register_param {
  27. unsigned int offset;
  28. unsigned int value;
  29. };
  30. struct dfe_write_register_mask_param {
  31. unsigned int offset;
  32. unsigned int value;
  33. unsigned int mask;
  34. };
  35. struct dfe_read_write_array_param {
  36. unsigned int offset;
  37. unsigned int num; /* number of 16 bit registers */
  38. unsigned int *pArray;
  39. };
  40. struct dfe_command_entry {
  41. unsigned int code;
  42. unsigned int offset;
  43. unsigned int value;
  44. unsigned int mask; /* DFE_IOCTL_COMMAND_CODE_WRITE_WITH_MASK only */
  45. };
  46. struct dfe_command_param {
  47. unsigned int num;
  48. struct dfe_command_entry *pEntry;
  49. };
  50. #define DFE_IOCTL_MAGIC 'h'
  51. #define DFE_IOCTL_READ_REGISTER \
  52. _IOC(_IOC_READ, DFE_IOCTL_MAGIC, 0x01, \
  53. sizeof(unsigned int *))
  54. #define DFE_IOCTL_WRITE_REGISTER \
  55. _IOC(_IOC_WRITE, DFE_IOCTL_MAGIC, 0x02, \
  56. sizeof(struct dfe_write_register_param *))
  57. #define DFE_IOCTL_WRITE_REGISTER_WITH_MASK \
  58. _IOC(_IOC_WRITE, DFE_IOCTL_MAGIC, 0x03, \
  59. sizeof(struct dfe_write_register_mask_param *))
  60. #define DFE_IOCTL_READ_REGISTER_ARRAY \
  61. _IOC(_IOC_READ, DFE_IOCTL_MAGIC, 0x04, \
  62. sizeof(struct dfe_read_write_array_param *))
  63. #define DFE_IOCTL_WRITE_REGISTER_ARRAY \
  64. _IOC(_IOC_WRITE, DFE_IOCTL_MAGIC, 0x05, \
  65. sizeof(struct dfe_read_write_array_param *))
  66. #define DFE_IOCTL_COMMAND \
  67. _IOC(_IOC_WRITE, DFE_IOCTL_MAGIC, 0x10, \
  68. sizeof(struct dfe_command_param *))
  69. #endif /* _FSM_DFE_HH_H_ */