dwc_otg_adp.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /* ==========================================================================
  2. * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_adp.h $
  3. * $Revision: #7 $
  4. * $Date: 2011/10/24 $
  5. * $Change: 1871159 $
  6. *
  7. * Synopsys HS OTG Linux Software Driver and documentation (hereinafter,
  8. * "Software") is an Unsupported proprietary work of Synopsys, Inc. unless
  9. * otherwise expressly agreed to in writing between Synopsys and you.
  10. *
  11. * The Software IS NOT an item of Licensed Software or Licensed Product under
  12. * any End User Software License Agreement or Agreement for Licensed Product
  13. * with Synopsys or any supplement thereto. You are permitted to use and
  14. * redistribute this Software in source and binary forms, with or without
  15. * modification, provided that redistributions of source code must retain this
  16. * notice. You may not view, use, disclose, copy or distribute this file or
  17. * any information contained herein except pursuant to this license grant from
  18. * Synopsys. If you do not agree with this notice, including the disclaimer
  19. * below, then you are not authorized to use the Software.
  20. *
  21. * THIS SOFTWARE IS BEING DISTRIBUTED BY SYNOPSYS SOLELY ON AN "AS IS" BASIS
  22. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  23. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  24. * ARE HEREBY DISCLAIMED. IN NO EVENT SHALL SYNOPSYS BE LIABLE FOR ANY DIRECT,
  25. * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  26. * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  27. * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  28. * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  29. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  30. * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
  31. * DAMAGE.
  32. * ========================================================================== */
  33. #ifndef __DWC_OTG_ADP_H__
  34. #define __DWC_OTG_ADP_H__
  35. /**
  36. * @file
  37. *
  38. * This file contains the Attach Detect Protocol interfaces and defines
  39. * (functions) and structures for Linux.
  40. *
  41. */
  42. #define DWC_OTG_ADP_UNATTACHED 0
  43. #define DWC_OTG_ADP_ATTACHED 1
  44. #define DWC_OTG_ADP_UNKOWN 2
  45. typedef struct dwc_otg_adp {
  46. uint32_t adp_started;
  47. uint32_t initial_probe;
  48. int32_t probe_timer_values[2];
  49. uint32_t probe_enabled;
  50. uint32_t sense_enabled;
  51. dwc_timer_t *sense_timer;
  52. uint32_t sense_timer_started;
  53. dwc_timer_t *vbuson_timer;
  54. uint32_t vbuson_timer_started;
  55. uint32_t attached;
  56. uint32_t probe_counter;
  57. uint32_t gpwrdn;
  58. } dwc_otg_adp_t;
  59. /**
  60. * Attach Detect Protocol functions
  61. */
  62. extern void dwc_otg_adp_write_reg(dwc_otg_core_if_t * core_if, uint32_t value);
  63. extern uint32_t dwc_otg_adp_read_reg(dwc_otg_core_if_t * core_if);
  64. extern uint32_t dwc_otg_adp_probe_start(dwc_otg_core_if_t * core_if);
  65. extern uint32_t dwc_otg_adp_sense_start(dwc_otg_core_if_t * core_if);
  66. extern uint32_t dwc_otg_adp_probe_stop(dwc_otg_core_if_t * core_if);
  67. extern uint32_t dwc_otg_adp_sense_stop(dwc_otg_core_if_t * core_if);
  68. extern void dwc_otg_adp_start(dwc_otg_core_if_t * core_if, uint8_t is_host);
  69. extern void dwc_otg_adp_init(dwc_otg_core_if_t * core_if);
  70. extern void dwc_otg_adp_remove(dwc_otg_core_if_t * core_if);
  71. extern int32_t dwc_otg_adp_handle_intr(dwc_otg_core_if_t * core_if);
  72. extern int32_t dwc_otg_adp_handle_srp_intr(dwc_otg_core_if_t * core_if);
  73. #endif //__DWC_OTG_ADP_H__