libra_sdioif.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /* Copyright (c) 2009-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. */
  13. #ifndef __LIBRA_SDIOIF_H__
  14. #define __LIBRA_SDIOIF_H__
  15. /*
  16. * Header for SDIO Card Interface Functions
  17. */
  18. #include <linux/kthread.h>
  19. #include <linux/mmc/card.h>
  20. #include <linux/mmc/host.h>
  21. #include <linux/mmc/sdio_func.h>
  22. /*
  23. * Common Defines
  24. */
  25. #define LIBRA_MAN_ID 0x70
  26. #define LIBRA_REV_1_0_CARD_ID 0x0
  27. #define VOLANS_MAN_ID 0x70
  28. #define VOLANS_REV_1_0_CARD_ID 0x0
  29. #define VOLANS_REV_2_0_CARD_ID 0x2881
  30. typedef int (suspend_handler_t)(struct sdio_func *);
  31. typedef void (resume_handler_t)(struct sdio_func *);
  32. typedef void (notify_card_removal_t)(void);
  33. typedef void (shutdown_handler_t)(void);
  34. int libra_enable_sdio_irq_in_chip(struct sdio_func *func, u8 enable);
  35. int libra_sdio_configure(sdio_irq_handler_t libra_sdio_rxhandler,
  36. void (*func_drv_fn)(int *status),
  37. u32 funcdrv_timeout, u32 blksize);
  38. void libra_sdio_deconfigure(struct sdio_func *func);
  39. struct sdio_func *libra_getsdio_funcdev(void);
  40. void libra_sdio_setprivdata(struct sdio_func *sdio_func_dev,
  41. void *padapter);
  42. void *libra_sdio_getprivdata(struct sdio_func *sdio_func_dev);
  43. void libra_claim_host(struct sdio_func *sdio_func_dev,
  44. pid_t *curr_claimed, pid_t current_pid,
  45. atomic_t *claim_count);
  46. void libra_release_host(struct sdio_func *sdio_func_dev,
  47. pid_t *curr_claimed, pid_t current_pid,
  48. atomic_t *claim_count);
  49. void libra_sdiocmd52(struct sdio_func *sdio_func_dev,
  50. u32 addr, u8 *b, int write, int *err_ret);
  51. u8 libra_sdio_readsb(struct sdio_func *func, void *dst,
  52. unsigned int addr, int count);
  53. int libra_sdio_memcpy_fromio(struct sdio_func *func,
  54. void *dst, unsigned int addr, int count);
  55. int libra_sdio_writesb(struct sdio_func *func,
  56. unsigned int addr, void *src, int count);
  57. int libra_sdio_memcpy_toio(struct sdio_func *func,
  58. unsigned int addr, void *src, int count);
  59. int libra_sdio_enable_polling(void);
  60. int libra_sdio_configure_suspend_resume(
  61. suspend_handler_t *libra_sdio_suspend_hdlr,
  62. resume_handler_t *libra_sdio_resume_hdlr);
  63. int libra_detect_card_change(void);
  64. void libra_sdio_set_clock(struct sdio_func *func, unsigned int clk_freq);
  65. void libra_sdio_get_card_id(struct sdio_func *func, unsigned short *card_id);
  66. void libra_sdio_release_irq(struct sdio_func *func);
  67. int libra_enable_sdio_irq(struct sdio_func *func, u8 enable);
  68. void libra_sdio_disable_func(struct sdio_func *func);
  69. int libra_disable_sdio_irq_capability(struct sdio_func *func, u8 disable);
  70. int libra_sdio_notify_card_removal(
  71. notify_card_removal_t *libra_sdio_notify_card_removal_hdlr);
  72. int libra_sdio_register_shutdown_hdlr(
  73. shutdown_handler_t *libra_shutdown_hdlr);
  74. #endif /* __LIBRA_SDIOIF_H__ */