/drivers/staging/crystalhd/crystalhd_cmds.h

https://bitbucket.org/cyanogenmod/android_kernel_asus_tf300t · C Header · 87 lines · 45 code · 11 blank · 31 comment · 0 complexity · 17d5f00be8419089ec52255aa017d9aa MD5 · raw file

  1. /***************************************************************************
  2. * Copyright (c) 2005-2009, Broadcom Corporation.
  3. *
  4. * Name: crystalhd_cmds . h
  5. *
  6. * Description:
  7. * BCM70010 Linux driver user command interfaces.
  8. *
  9. * HISTORY:
  10. *
  11. **********************************************************************
  12. * This file is part of the crystalhd device driver.
  13. *
  14. * This driver is free software; you can redistribute it and/or modify
  15. * it under the terms of the GNU General Public License as published by
  16. * the Free Software Foundation, version 2 of the License.
  17. *
  18. * This driver is distributed in the hope that it will be useful,
  19. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  20. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  21. * GNU General Public License for more details.
  22. *
  23. * You should have received a copy of the GNU General Public License
  24. * along with this driver. If not, see <http://www.gnu.org/licenses/>.
  25. **********************************************************************/
  26. #ifndef _CRYSTALHD_CMDS_H_
  27. #define _CRYSTALHD_CMDS_H_
  28. /*
  29. * NOTE:: This is the main interface file between the Linux layer
  30. * and the harware layer. This file will use the definitions
  31. * from _dts_glob and dts_defs etc.. which are defined for
  32. * windows.
  33. */
  34. #include "crystalhd_misc.h"
  35. #include "crystalhd_hw.h"
  36. enum crystalhd_state{
  37. BC_LINK_INVALID = 0x00,
  38. BC_LINK_INIT = 0x01,
  39. BC_LINK_CAP_EN = 0x02,
  40. BC_LINK_FMT_CHG = 0x04,
  41. BC_LINK_SUSPEND = 0x10,
  42. BC_LINK_PAUSED = 0x20,
  43. BC_LINK_READY = (BC_LINK_INIT | BC_LINK_CAP_EN | BC_LINK_FMT_CHG),
  44. };
  45. struct crystalhd_user {
  46. uint32_t uid;
  47. uint32_t in_use;
  48. uint32_t mode;
  49. };
  50. #define DTS_MODE_INV (-1)
  51. struct crystalhd_cmd {
  52. uint32_t state;
  53. struct crystalhd_adp *adp;
  54. struct crystalhd_user user[BC_LINK_MAX_OPENS];
  55. spinlock_t ctx_lock;
  56. uint32_t tx_list_id;
  57. uint32_t cin_wait_exit;
  58. uint32_t pwr_state_change;
  59. struct crystalhd_hw hw_ctx;
  60. };
  61. typedef enum BC_STATUS(*crystalhd_cmd_proc)(struct crystalhd_cmd *, struct crystalhd_ioctl_data *);
  62. struct crystalhd_cmd_tbl {
  63. uint32_t cmd_id;
  64. const crystalhd_cmd_proc cmd_proc;
  65. uint32_t block_mon;
  66. };
  67. enum BC_STATUS crystalhd_suspend(struct crystalhd_cmd *ctx, struct crystalhd_ioctl_data *idata);
  68. enum BC_STATUS crystalhd_resume(struct crystalhd_cmd *ctx);
  69. crystalhd_cmd_proc crystalhd_get_cmd_proc(struct crystalhd_cmd *ctx, uint32_t cmd,
  70. struct crystalhd_user *uc);
  71. enum BC_STATUS crystalhd_user_open(struct crystalhd_cmd *ctx, struct crystalhd_user **user_ctx);
  72. enum BC_STATUS crystalhd_user_close(struct crystalhd_cmd *ctx, struct crystalhd_user *uc);
  73. enum BC_STATUS crystalhd_setup_cmd_context(struct crystalhd_cmd *ctx, struct crystalhd_adp *adp);
  74. enum BC_STATUS crystalhd_delete_cmd_context(struct crystalhd_cmd *ctx);
  75. bool crystalhd_cmd_interrupt(struct crystalhd_cmd *ctx);
  76. #endif