core.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * drivers/mfd/mfd-core.h
  3. *
  4. * core MFD support
  5. * Copyright (c) 2006 Ian Molton
  6. * Copyright (c) 2007 Dmitry Baryshkov
  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. */
  13. #ifndef MFD_CORE_H
  14. #define MFD_CORE_H
  15. #include <linux/platform_device.h>
  16. /*
  17. * This struct describes the MFD part ("cell").
  18. * After registration the copy of this structure will become the platform data
  19. * of the resulting platform_device
  20. */
  21. struct mfd_cell {
  22. const char *name;
  23. int (*enable)(struct platform_device *dev);
  24. int (*disable)(struct platform_device *dev);
  25. int (*suspend)(struct platform_device *dev);
  26. int (*resume)(struct platform_device *dev);
  27. /* driver-specific data for MFD-aware "cell" drivers */
  28. void *driver_data;
  29. /* platform_data can be used to either pass data to "generic"
  30. driver or as a hook to mfd_cell for the "cell" drivers */
  31. void *platform_data;
  32. size_t data_size;
  33. /*
  34. * This resources can be specified relatievly to the parent device.
  35. * For accessing device you should use resources from device
  36. */
  37. int num_resources;
  38. const struct resource *resources;
  39. };
  40. extern int mfd_add_devices(struct device *parent, int id,
  41. const struct mfd_cell *cells, int n_devs,
  42. struct resource *mem_base,
  43. int irq_base);
  44. extern void mfd_remove_devices(struct device *parent);
  45. #endif