sdio.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. * include/linux/mmc/sdio.h
  3. *
  4. * Copyright 2006-2007 Pierre Ossman
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or (at
  9. * your option) any later version.
  10. */
  11. #ifndef MMC_SDIO_H
  12. #define MMC_SDIO_H
  13. /* SDIO commands type argument response */
  14. #define SD_IO_SEND_OP_COND 5 /* bcr [23:0] OCR R4 */
  15. #define SD_IO_RW_DIRECT 52 /* ac [31:0] See below R5 */
  16. /*
  17. * SD_IO_RW_DIRECT argument format:
  18. *
  19. * [31] R/W flag
  20. * [30:28] Function number
  21. * [27] RAW flag
  22. * [25:9] Register address
  23. * [7:0] Data
  24. */
  25. /*
  26. SDIO status in R5
  27. Type
  28. e : error bit
  29. s : status bit
  30. r : detected and set for the actual command response
  31. x : detected and set during command execution. the host must poll
  32. the card by sending status command in order to read these bits.
  33. Clear condition
  34. a : according to the card state
  35. b : always related to the previous command. Reception of
  36. a valid command will clear it (with a delay of one command)
  37. c : clear by read
  38. */
  39. #define R5_COM_CRC_ERROR (1 << 15) /* er, b */
  40. #define R5_ILLEGAL_COMMAND (1 << 14) /* er, b */
  41. #define R5_ERROR (1 << 11) /* erx, c */
  42. #define R5_FUNCTION_NUMBER (1 << 9) /* er, c */
  43. #define R5_OUT_OF_RANGE (1 << 8) /* er, c */
  44. #define R5_STATUS(x) (x & 0xCB00)
  45. #define R5_IO_CURRENT_STATE(x) ((x & 0x3000) >> 12) /* s, b */
  46. #endif