blob: 78bf4c3c1fac22eff5b14455e43bd019cd005138 [file] [log] [blame]
Marc Reillya0c7c1d2012-04-01 16:41:38 +10001/*
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
12#include <linux/mutex.h>
13#include <linux/regmap.h>
14#include <linux/mfd/mc13xxx.h>
15
Uwe Kleine-Königcd0f34b2012-07-12 09:57:52 +000016#define MC13XXX_NUMREGS 0x3f
17
18struct mc13xxx;
19
20struct mc13xxx_variant {
21 const char *name;
22 void (*print_revision)(struct mc13xxx *mc13xxx, u32 revision);
Marc Reillya0c7c1d2012-04-01 16:41:38 +100023};
24
Uwe Kleine-Königcd0f34b2012-07-12 09:57:52 +000025extern struct mc13xxx_variant
26 mc13xxx_variant_mc13783,
27 mc13xxx_variant_mc13892;
Marc Reillya0c7c1d2012-04-01 16:41:38 +100028
29struct mc13xxx {
30 struct regmap *regmap;
31
32 struct device *dev;
Uwe Kleine-Königcd0f34b2012-07-12 09:57:52 +000033 const struct mc13xxx_variant *variant;
Marc Reillya0c7c1d2012-04-01 16:41:38 +100034
35 struct mutex lock;
36 int irq;
37 int flags;
38
39 irq_handler_t irqhandler[MC13XXX_NUM_IRQ];
40 void *irqdata[MC13XXX_NUM_IRQ];
41
42 int adcflags;
43};
44
45int mc13xxx_common_init(struct mc13xxx *mc13xxx,
46 struct mc13xxx_platform_data *pdata, int irq);
47
48void mc13xxx_common_cleanup(struct mc13xxx *mc13xxx);
49
50#endif /* __DRIVERS_MFD_MC13XXX_H */