mc13xxx.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * Copyright 2012 Creative Product Design
  3. * Marc Reilly <marc@cpdesign.com.au>
  4. *
  5. * This program is free software; you can redistribute it and/or modify it under
  6. * the terms of the GNU General Public License version 2 as published by the
  7. * Free Software Foundation.
  8. */
  9. #ifndef __DRIVERS_MFD_MC13XXX_H
  10. #define __DRIVERS_MFD_MC13XXX_H
  11. #include <linux/mutex.h>
  12. #include <linux/regmap.h>
  13. #include <linux/mfd/mc13xxx.h>
  14. #define MC13XXX_NUMREGS 0x3f
  15. struct mc13xxx;
  16. struct mc13xxx_variant {
  17. const char *name;
  18. void (*print_revision)(struct mc13xxx *mc13xxx, u32 revision);
  19. };
  20. extern struct mc13xxx_variant
  21. mc13xxx_variant_mc13783,
  22. mc13xxx_variant_mc13892,
  23. mc13xxx_variant_mc34708;
  24. struct mc13xxx {
  25. struct regmap *regmap;
  26. struct device *dev;
  27. const struct mc13xxx_variant *variant;
  28. struct mutex lock;
  29. int irq;
  30. int flags;
  31. irq_handler_t irqhandler[MC13XXX_NUM_IRQ];
  32. void *irqdata[MC13XXX_NUM_IRQ];
  33. int adcflags;
  34. };
  35. int mc13xxx_common_init(struct mc13xxx *mc13xxx,
  36. struct mc13xxx_platform_data *pdata, int irq);
  37. void mc13xxx_common_cleanup(struct mc13xxx *mc13xxx);
  38. #endif /* __DRIVERS_MFD_MC13XXX_H */