]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/blob - include/linux/mfd/da9063/pdata.h
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152
[mirror_ubuntu-eoan-kernel.git] / include / linux / mfd / da9063 / pdata.h
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /*
3 * Platform configuration options for DA9063
4 *
5 * Copyright 2012 Dialog Semiconductor Ltd.
6 *
7 * Author: Michal Hajduk, Dialog Semiconductor
8 * Author: Krystian Garbaciak, Dialog Semiconductor
9 */
10
11 #ifndef __MFD_DA9063_PDATA_H__
12 #define __MFD_DA9063_PDATA_H__
13
14 #include <linux/regulator/machine.h>
15
16 /*
17 * Regulator configuration
18 */
19 /* DA9063 and DA9063L regulator IDs */
20 enum {
21 /* BUCKs */
22 DA9063_ID_BCORE1,
23 DA9063_ID_BCORE2,
24 DA9063_ID_BPRO,
25 DA9063_ID_BMEM,
26 DA9063_ID_BIO,
27 DA9063_ID_BPERI,
28
29 /* BCORE1 and BCORE2 in merged mode */
30 DA9063_ID_BCORES_MERGED,
31 /* BMEM and BIO in merged mode */
32 DA9063_ID_BMEM_BIO_MERGED,
33 /* When two BUCKs are merged, they cannot be reused separately */
34
35 /* LDOs on both DA9063 and DA9063L */
36 DA9063_ID_LDO3,
37 DA9063_ID_LDO7,
38 DA9063_ID_LDO8,
39 DA9063_ID_LDO9,
40 DA9063_ID_LDO11,
41
42 /* DA9063-only LDOs */
43 DA9063_ID_LDO1,
44 DA9063_ID_LDO2,
45 DA9063_ID_LDO4,
46 DA9063_ID_LDO5,
47 DA9063_ID_LDO6,
48 DA9063_ID_LDO10,
49 };
50
51 /* Regulators platform data */
52 struct da9063_regulator_data {
53 int id;
54 struct regulator_init_data *initdata;
55 };
56
57 struct da9063_regulators_pdata {
58 unsigned n_regulators;
59 struct da9063_regulator_data *regulator_data;
60 };
61
62
63 /*
64 * RGB LED configuration
65 */
66 /* LED IDs for flags in struct led_info. */
67 enum {
68 DA9063_GPIO11_LED,
69 DA9063_GPIO14_LED,
70 DA9063_GPIO15_LED,
71
72 DA9063_LED_NUM
73 };
74 #define DA9063_LED_ID_MASK 0x3
75
76 /* LED polarity for flags in struct led_info. */
77 #define DA9063_LED_HIGH_LEVEL_ACTIVE 0x0
78 #define DA9063_LED_LOW_LEVEL_ACTIVE 0x4
79
80
81 /*
82 * General PMIC configuration
83 */
84 /* HWMON ADC channels configuration */
85 #define DA9063_FLG_FORCE_IN0_MANUAL_MODE 0x0010
86 #define DA9063_FLG_FORCE_IN0_AUTO_MODE 0x0020
87 #define DA9063_FLG_FORCE_IN1_MANUAL_MODE 0x0040
88 #define DA9063_FLG_FORCE_IN1_AUTO_MODE 0x0080
89 #define DA9063_FLG_FORCE_IN2_MANUAL_MODE 0x0100
90 #define DA9063_FLG_FORCE_IN2_AUTO_MODE 0x0200
91 #define DA9063_FLG_FORCE_IN3_MANUAL_MODE 0x0400
92 #define DA9063_FLG_FORCE_IN3_AUTO_MODE 0x0800
93
94 /* Disable register caching. */
95 #define DA9063_FLG_NO_CACHE 0x0008
96
97 struct da9063;
98
99 /* DA9063 platform data */
100 struct da9063_pdata {
101 int (*init)(struct da9063 *da9063);
102 int irq_base;
103 bool key_power;
104 unsigned flags;
105 struct da9063_regulators_pdata *regulators_pdata;
106 struct led_platform_data *leds_pdata;
107 };
108
109 #endif /* __MFD_DA9063_PDATA_H__ */