xref: /linux/include/linux/mfd/da9055/pdata.h (revision e9f0878c4b2004ac19581274c1ae4c61ae3ca70e)
1 /* Copyright (C) 2012 Dialog Semiconductor Ltd.
2  *
3  *  This program is free software; you can redistribute it and/or modify
4  *  it under the terms of the GNU General Public License as published by
5  *  the Free Software Foundation; either version 2 of the License, or
6  *  (at your option) any later version.
7  *
8  */
9 #ifndef __DA9055_PDATA_H
10 #define __DA9055_PDATA_H
11 
12 #define DA9055_MAX_REGULATORS	8
13 
14 struct da9055;
15 struct gpio_desc;
16 
17 enum gpio_select {
18 	NO_GPIO = 0,
19 	GPIO_1,
20 	GPIO_2
21 };
22 
23 struct da9055_pdata {
24 	int (*init) (struct da9055 *da9055);
25 	int irq_base;
26 	int gpio_base;
27 
28 	struct regulator_init_data *regulators[DA9055_MAX_REGULATORS];
29 	/* Enable RTC in RESET Mode */
30 	bool reset_enable;
31 	/*
32 	 * GPI muxed pin to control
33 	 * regulator state A/B, 0 if not available.
34 	 */
35 	int *gpio_ren;
36 	/*
37 	 * GPI muxed pin to control
38 	 * regulator set, 0 if not available.
39 	 */
40 	int *gpio_rsel;
41 	/*
42 	 * Regulator mode control bits value (GPI offset) that
43 	 * that controls the regulator state, 0 if not available.
44 	 */
45 	enum gpio_select *reg_ren;
46 	/*
47 	 * Regulator mode control bits value (GPI offset) that
48 	 * controls the regulator set A/B, 0 if  not available.
49 	 */
50 	enum gpio_select *reg_rsel;
51 	/* GPIO descriptors to enable regulator, NULL if not available */
52 	struct gpio_desc **ena_gpiods;
53 };
54 #endif /* __DA9055_PDATA_H */
55