Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
[linux-block.git] / include / linux / mfd / da9063 / pdata.h
CommitLineData
8e685483
KG
1/*
2 * Platform configuration options for DA9063
3 *
4 * Copyright 2012 Dialog Semiconductor Ltd.
5 *
37778d83
ST
6 * Author: Michal Hajduk, Dialog Semiconductor
7 * Author: Krystian Garbaciak, Dialog Semiconductor
8e685483
KG
8 *
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation; either version 2 of the License, or (at your
12 * option) any later version.
13 *
14 */
15
16#ifndef __MFD_DA9063_PDATA_H__
17#define __MFD_DA9063_PDATA_H__
18
19#include <linux/regulator/machine.h>
20
21/*
22 * Regulator configuration
23 */
a318c243 24/* DA9063 and DA9063L regulator IDs */
8e685483
KG
25enum {
26 /* BUCKs */
27 DA9063_ID_BCORE1,
28 DA9063_ID_BCORE2,
29 DA9063_ID_BPRO,
30 DA9063_ID_BMEM,
31 DA9063_ID_BIO,
32 DA9063_ID_BPERI,
33
34 /* BCORE1 and BCORE2 in merged mode */
35 DA9063_ID_BCORES_MERGED,
36 /* BMEM and BIO in merged mode */
37 DA9063_ID_BMEM_BIO_MERGED,
38 /* When two BUCKs are merged, they cannot be reused separately */
39
a318c243
PZ
40 /* LDOs on both DA9063 and DA9063L */
41 DA9063_ID_LDO3,
42 DA9063_ID_LDO7,
43 DA9063_ID_LDO8,
44 DA9063_ID_LDO9,
45 DA9063_ID_LDO11,
46
47 /* DA9063-only LDOs */
8e685483
KG
48 DA9063_ID_LDO1,
49 DA9063_ID_LDO2,
8e685483
KG
50 DA9063_ID_LDO4,
51 DA9063_ID_LDO5,
52 DA9063_ID_LDO6,
8e685483 53 DA9063_ID_LDO10,
8e685483
KG
54};
55
56/* Regulators platform data */
57struct da9063_regulator_data {
58 int id;
59 struct regulator_init_data *initdata;
60};
61
62struct da9063_regulators_pdata {
63 unsigned n_regulators;
64 struct da9063_regulator_data *regulator_data;
65};
66
67
68/*
69 * RGB LED configuration
70 */
71/* LED IDs for flags in struct led_info. */
72enum {
73 DA9063_GPIO11_LED,
74 DA9063_GPIO14_LED,
75 DA9063_GPIO15_LED,
76
77 DA9063_LED_NUM
78};
79#define DA9063_LED_ID_MASK 0x3
80
81/* LED polarity for flags in struct led_info. */
82#define DA9063_LED_HIGH_LEVEL_ACTIVE 0x0
83#define DA9063_LED_LOW_LEVEL_ACTIVE 0x4
84
85
86/*
87 * General PMIC configuration
88 */
89/* HWMON ADC channels configuration */
90#define DA9063_FLG_FORCE_IN0_MANUAL_MODE 0x0010
91#define DA9063_FLG_FORCE_IN0_AUTO_MODE 0x0020
92#define DA9063_FLG_FORCE_IN1_MANUAL_MODE 0x0040
93#define DA9063_FLG_FORCE_IN1_AUTO_MODE 0x0080
94#define DA9063_FLG_FORCE_IN2_MANUAL_MODE 0x0100
95#define DA9063_FLG_FORCE_IN2_AUTO_MODE 0x0200
96#define DA9063_FLG_FORCE_IN3_MANUAL_MODE 0x0400
97#define DA9063_FLG_FORCE_IN3_AUTO_MODE 0x0800
98
99/* Disable register caching. */
100#define DA9063_FLG_NO_CACHE 0x0008
101
102struct da9063;
103
104/* DA9063 platform data */
105struct da9063_pdata {
106 int (*init)(struct da9063 *da9063);
107 int irq_base;
5179f0ce 108 bool key_power;
8e685483
KG
109 unsigned flags;
110 struct da9063_regulators_pdata *regulators_pdata;
111 struct led_platform_data *leds_pdata;
112};
113
114#endif /* __MFD_DA9063_PDATA_H__ */