mc13xxx.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. #define MC13XXX_IRQ_REG_CNT 2
  16. #define MC13XXX_IRQ_PER_REG 24
  17. struct mc13xxx;
  18. struct mc13xxx_variant {
  19. const char *name;
  20. void (*print_revision)(struct mc13xxx *mc13xxx, u32 revision);
  21. };
  22. extern struct mc13xxx_variant
  23. mc13xxx_variant_mc13783,
  24. mc13xxx_variant_mc13892,
  25. mc13xxx_variant_mc34708;
  26. struct mc13xxx {
  27. struct regmap *regmap;
  28. struct device *dev;
  29. const struct mc13xxx_variant *variant;
  30. struct regmap_irq irqs[MC13XXX_IRQ_PER_REG * MC13XXX_IRQ_REG_CNT];
  31. struct regmap_irq_chip irq_chip;
  32. struct regmap_irq_chip_data *irq_data;
  33. struct mutex lock;
  34. int irq;
  35. int flags;
  36. int adcflags;
  37. };
  38. int mc13xxx_common_init(struct device *dev);
  39. int mc13xxx_common_exit(struct device *dev);
  40. #endif /* __DRIVERS_MFD_MC13XXX_H */