mmc.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*
  2. * MMC definitions for OMAP2
  3. *
  4. * Copyright (C) 2006 Nokia Corporation
  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 version 2 as
  8. * published by the Free Software Foundation.
  9. */
  10. #ifndef __OMAP2_MMC_H
  11. #define __OMAP2_MMC_H
  12. #include <linux/types.h>
  13. #include <linux/device.h>
  14. #include <linux/mmc/host.h>
  15. #define OMAP_MMC_MAX_SLOTS 2
  16. struct omap_mmc_platform_data {
  17. unsigned enabled:1;
  18. /* number of slots on board */
  19. unsigned nr_slots:2;
  20. /* nomux means "standard" muxing is wrong on this board, and that
  21. * board-specific code handled it before common init logic.
  22. */
  23. unsigned nomux:1;
  24. /* 4 wire signaling is optional, and is only used for SD/SDIO and
  25. * MMCv4 */
  26. unsigned wire4:1;
  27. /* set if your board has components or wiring that limits the
  28. * maximum frequency on the MMC bus */
  29. unsigned int max_freq;
  30. /* switch the bus to a new slot */
  31. int (* switch_slot)(struct device *dev, int slot);
  32. /* initialize board-specific MMC functionality, can be NULL if
  33. * not supported */
  34. int (* init)(struct device *dev);
  35. void (* cleanup)(struct device *dev);
  36. struct omap_mmc_slot_data {
  37. int (* set_bus_mode)(struct device *dev, int slot, int bus_mode);
  38. int (* set_power)(struct device *dev, int slot, int power_on, int vdd);
  39. int (* get_ro)(struct device *dev, int slot);
  40. /* return MMC cover switch state, can be NULL if not supported.
  41. *
  42. * possible return values:
  43. * 0 - open
  44. * 1 - closed
  45. */
  46. int (* get_cover_state)(struct device *dev, int slot);
  47. const char *name;
  48. u32 ocr_mask;
  49. } slots[OMAP_MMC_MAX_SLOTS];
  50. };
  51. extern void omap_set_mmc_info(int host, const struct omap_mmc_platform_data *info);
  52. /* called from board-specific card detection service routine */
  53. extern void omap_mmc_notify_card_detect(struct device *dev, int slot, int detected);
  54. extern void omap_mmc_notify_cover_event(struct device *dev, int slot, int is_closed);
  55. #endif