sdhci-dove.c 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /*
  2. * sdhci-dove.c Support for SDHCI on Marvell's Dove SoC
  3. *
  4. * Author: Saeed Bishara <saeed@marvell.com>
  5. * Mike Rapoport <mike@compulab.co.il>
  6. * Based on sdhci-cns3xxx.c
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License version 2 as
  10. * published by the Free Software Foundation.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  20. */
  21. #include <linux/io.h>
  22. #include <linux/mmc/host.h>
  23. #include "sdhci.h"
  24. #include "sdhci-pltfm.h"
  25. static u16 sdhci_dove_readw(struct sdhci_host *host, int reg)
  26. {
  27. u16 ret;
  28. switch (reg) {
  29. case SDHCI_HOST_VERSION:
  30. case SDHCI_SLOT_INT_STATUS:
  31. /* those registers don't exist */
  32. return 0;
  33. default:
  34. ret = readw(host->ioaddr + reg);
  35. }
  36. return ret;
  37. }
  38. static u32 sdhci_dove_readl(struct sdhci_host *host, int reg)
  39. {
  40. u32 ret;
  41. switch (reg) {
  42. case SDHCI_CAPABILITIES:
  43. ret = readl(host->ioaddr + reg);
  44. /* Mask the support for 3.0V */
  45. ret &= ~SDHCI_CAN_VDD_300;
  46. break;
  47. default:
  48. ret = readl(host->ioaddr + reg);
  49. }
  50. return ret;
  51. }
  52. static struct sdhci_ops sdhci_dove_ops = {
  53. .read_w = sdhci_dove_readw,
  54. .read_l = sdhci_dove_readl,
  55. };
  56. struct sdhci_pltfm_data sdhci_dove_pdata = {
  57. .ops = &sdhci_dove_ops,
  58. .quirks = SDHCI_QUIRK_NO_SIMULT_VDD_AND_POWER |
  59. SDHCI_QUIRK_NO_BUSY_IRQ |
  60. SDHCI_QUIRK_BROKEN_TIMEOUT_VAL |
  61. SDHCI_QUIRK_FORCE_DMA,
  62. };