mmc.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. #include <mach/board.h>
  16. #define OMAP_MMC_MAX_SLOTS 2
  17. struct omap_mmc_platform_data {
  18. struct omap_mmc_conf conf;
  19. /* number of slots on board */
  20. unsigned nr_slots:2;
  21. /* set if your board has components or wiring that limits the
  22. * maximum frequency on the MMC bus */
  23. unsigned int max_freq;
  24. /* switch the bus to a new slot */
  25. int (* switch_slot)(struct device *dev, int slot);
  26. /* initialize board-specific MMC functionality, can be NULL if
  27. * not supported */
  28. int (* init)(struct device *dev);
  29. void (* cleanup)(struct device *dev);
  30. void (* shutdown)(struct device *dev);
  31. /* To handle board related suspend/resume functionality for MMC */
  32. int (*suspend)(struct device *dev, int slot);
  33. int (*resume)(struct device *dev, int slot);
  34. struct omap_mmc_slot_data {
  35. int (* set_bus_mode)(struct device *dev, int slot, int bus_mode);
  36. int (* set_power)(struct device *dev, int slot, int power_on, int vdd);
  37. int (* get_ro)(struct device *dev, int slot);
  38. /* return MMC cover switch state, can be NULL if not supported.
  39. *
  40. * possible return values:
  41. * 0 - open
  42. * 1 - closed
  43. */
  44. int (* get_cover_state)(struct device *dev, int slot);
  45. const char *name;
  46. u32 ocr_mask;
  47. /* Card detection IRQs */
  48. int card_detect_irq;
  49. int (* card_detect)(int irq);
  50. unsigned int ban_openended:1;
  51. } slots[OMAP_MMC_MAX_SLOTS];
  52. };
  53. extern void omap_set_mmc_info(int host, const struct omap_mmc_platform_data *info);
  54. /* called from board-specific card detection service routine */
  55. extern void omap_mmc_notify_cover_event(struct device *dev, int slot, int is_closed);
  56. #endif