core.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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 id;
  24. int (*enable)(struct platform_device *dev);
  25. int (*disable)(struct platform_device *dev);
  26. int (*suspend)(struct platform_device *dev);
  27. int (*resume)(struct platform_device *dev);
  28. /* driver-specific data for MFD-aware "cell" drivers */
  29. void *driver_data;
  30. /* platform_data can be used to either pass data to "generic"
  31. driver or as a hook to mfd_cell for the "cell" drivers */
  32. void *platform_data;
  33. size_t data_size;
  34. /*
  35. * This resources can be specified relatievly to the parent device.
  36. * For accessing device you should use resources from device
  37. */
  38. int num_resources;
  39. const struct resource *resources;
  40. };
  41. extern int mfd_add_devices(struct device *parent, int id,
  42. const struct mfd_cell *cells, int n_devs,
  43. struct resource *mem_base,
  44. int irq_base);
  45. extern void mfd_remove_devices(struct device *parent);
  46. #endif