Loading...
1/*
2 * axp20x power button driver.
3 *
4 * Copyright (C) 2013 Carlo Caione <carlo@caione.org>
5 *
6 * This file is subject to the terms and conditions of the GNU General
7 * Public License. See the file "COPYING" in the main directory of this
8 * archive for more details.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 */
15
16#include <linux/errno.h>
17#include <linux/irq.h>
18#include <linux/init.h>
19#include <linux/input.h>
20#include <linux/interrupt.h>
21#include <linux/kernel.h>
22#include <linux/mfd/axp20x.h>
23#include <linux/module.h>
24#include <linux/platform_device.h>
25#include <linux/regmap.h>
26#include <linux/slab.h>
27
28#define AXP20X_PEK_STARTUP_MASK (0xc0)
29#define AXP20X_PEK_SHUTDOWN_MASK (0x03)
30
31struct axp20x_pek {
32 struct axp20x_dev *axp20x;
33 struct input_dev *input;
34 int irq_dbr;
35 int irq_dbf;
36};
37
38struct axp20x_time {
39 unsigned int time;
40 unsigned int idx;
41};
42
43static const struct axp20x_time startup_time[] = {
44 { .time = 128, .idx = 0 },
45 { .time = 1000, .idx = 2 },
46 { .time = 3000, .idx = 1 },
47 { .time = 2000, .idx = 3 },
48};
49
50static const struct axp20x_time shutdown_time[] = {
51 { .time = 4000, .idx = 0 },
52 { .time = 6000, .idx = 1 },
53 { .time = 8000, .idx = 2 },
54 { .time = 10000, .idx = 3 },
55};
56
57struct axp20x_pek_ext_attr {
58 const struct axp20x_time *p_time;
59 unsigned int mask;
60};
61
62static struct axp20x_pek_ext_attr axp20x_pek_startup_ext_attr = {
63 .p_time = startup_time,
64 .mask = AXP20X_PEK_STARTUP_MASK,
65};
66
67static struct axp20x_pek_ext_attr axp20x_pek_shutdown_ext_attr = {
68 .p_time = shutdown_time,
69 .mask = AXP20X_PEK_SHUTDOWN_MASK,
70};
71
72static struct axp20x_pek_ext_attr *get_axp_ext_attr(struct device_attribute *attr)
73{
74 return container_of(attr, struct dev_ext_attribute, attr)->var;
75}
76
77static ssize_t axp20x_show_ext_attr(struct device *dev,
78 struct device_attribute *attr, char *buf)
79{
80 struct axp20x_pek *axp20x_pek = dev_get_drvdata(dev);
81 struct axp20x_pek_ext_attr *axp20x_ea = get_axp_ext_attr(attr);
82 unsigned int val;
83 int ret, i;
84
85 ret = regmap_read(axp20x_pek->axp20x->regmap, AXP20X_PEK_KEY, &val);
86 if (ret != 0)
87 return ret;
88
89 val &= axp20x_ea->mask;
90 val >>= ffs(axp20x_ea->mask) - 1;
91
92 for (i = 0; i < 4; i++)
93 if (val == axp20x_ea->p_time[i].idx)
94 val = axp20x_ea->p_time[i].time;
95
96 return sprintf(buf, "%u\n", val);
97}
98
99static ssize_t axp20x_store_ext_attr(struct device *dev,
100 struct device_attribute *attr,
101 const char *buf, size_t count)
102{
103 struct axp20x_pek *axp20x_pek = dev_get_drvdata(dev);
104 struct axp20x_pek_ext_attr *axp20x_ea = get_axp_ext_attr(attr);
105 char val_str[20];
106 size_t len;
107 int ret, i;
108 unsigned int val, idx = 0;
109 unsigned int best_err = UINT_MAX;
110
111 val_str[sizeof(val_str) - 1] = '\0';
112 strncpy(val_str, buf, sizeof(val_str) - 1);
113 len = strlen(val_str);
114
115 if (len && val_str[len - 1] == '\n')
116 val_str[len - 1] = '\0';
117
118 ret = kstrtouint(val_str, 10, &val);
119 if (ret)
120 return ret;
121
122 for (i = 3; i >= 0; i--) {
123 unsigned int err;
124
125 err = abs(axp20x_ea->p_time[i].time - val);
126 if (err < best_err) {
127 best_err = err;
128 idx = axp20x_ea->p_time[i].idx;
129 }
130
131 if (!err)
132 break;
133 }
134
135 idx <<= ffs(axp20x_ea->mask) - 1;
136 ret = regmap_update_bits(axp20x_pek->axp20x->regmap,
137 AXP20X_PEK_KEY,
138 axp20x_ea->mask, idx);
139 if (ret != 0)
140 return -EINVAL;
141
142 return count;
143}
144
145static struct dev_ext_attribute axp20x_dev_attr_startup = {
146 .attr = __ATTR(startup, 0644, axp20x_show_ext_attr, axp20x_store_ext_attr),
147 .var = &axp20x_pek_startup_ext_attr,
148};
149
150static struct dev_ext_attribute axp20x_dev_attr_shutdown = {
151 .attr = __ATTR(shutdown, 0644, axp20x_show_ext_attr, axp20x_store_ext_attr),
152 .var = &axp20x_pek_shutdown_ext_attr,
153};
154
155static struct attribute *axp20x_attributes[] = {
156 &axp20x_dev_attr_startup.attr.attr,
157 &axp20x_dev_attr_shutdown.attr.attr,
158 NULL,
159};
160
161static const struct attribute_group axp20x_attribute_group = {
162 .attrs = axp20x_attributes,
163};
164
165static irqreturn_t axp20x_pek_irq(int irq, void *pwr)
166{
167 struct input_dev *idev = pwr;
168 struct axp20x_pek *axp20x_pek = input_get_drvdata(idev);
169
170 /*
171 * The power-button is connected to ground so a falling edge (dbf)
172 * means it is pressed.
173 */
174 if (irq == axp20x_pek->irq_dbf)
175 input_report_key(idev, KEY_POWER, true);
176 else if (irq == axp20x_pek->irq_dbr)
177 input_report_key(idev, KEY_POWER, false);
178
179 input_sync(idev);
180
181 return IRQ_HANDLED;
182}
183
184static void axp20x_remove_sysfs_group(void *_data)
185{
186 struct device *dev = _data;
187
188 sysfs_remove_group(&dev->kobj, &axp20x_attribute_group);
189}
190
191static int axp20x_pek_probe(struct platform_device *pdev)
192{
193 struct axp20x_pek *axp20x_pek;
194 struct axp20x_dev *axp20x;
195 struct input_dev *idev;
196 int error;
197
198 axp20x_pek = devm_kzalloc(&pdev->dev, sizeof(struct axp20x_pek),
199 GFP_KERNEL);
200 if (!axp20x_pek)
201 return -ENOMEM;
202
203 axp20x_pek->axp20x = dev_get_drvdata(pdev->dev.parent);
204 axp20x = axp20x_pek->axp20x;
205
206 axp20x_pek->irq_dbr = platform_get_irq_byname(pdev, "PEK_DBR");
207 if (axp20x_pek->irq_dbr < 0) {
208 dev_err(&pdev->dev, "No IRQ for PEK_DBR, error=%d\n",
209 axp20x_pek->irq_dbr);
210 return axp20x_pek->irq_dbr;
211 }
212 axp20x_pek->irq_dbr = regmap_irq_get_virq(axp20x->regmap_irqc,
213 axp20x_pek->irq_dbr);
214
215 axp20x_pek->irq_dbf = platform_get_irq_byname(pdev, "PEK_DBF");
216 if (axp20x_pek->irq_dbf < 0) {
217 dev_err(&pdev->dev, "No IRQ for PEK_DBF, error=%d\n",
218 axp20x_pek->irq_dbf);
219 return axp20x_pek->irq_dbf;
220 }
221 axp20x_pek->irq_dbf = regmap_irq_get_virq(axp20x->regmap_irqc,
222 axp20x_pek->irq_dbf);
223
224 axp20x_pek->input = devm_input_allocate_device(&pdev->dev);
225 if (!axp20x_pek->input)
226 return -ENOMEM;
227
228 idev = axp20x_pek->input;
229
230 idev->name = "axp20x-pek";
231 idev->phys = "m1kbd/input2";
232 idev->dev.parent = &pdev->dev;
233
234 input_set_capability(idev, EV_KEY, KEY_POWER);
235
236 input_set_drvdata(idev, axp20x_pek);
237
238 error = devm_request_any_context_irq(&pdev->dev, axp20x_pek->irq_dbr,
239 axp20x_pek_irq, 0,
240 "axp20x-pek-dbr", idev);
241 if (error < 0) {
242 dev_err(axp20x->dev, "Failed to request dbr IRQ#%d: %d\n",
243 axp20x_pek->irq_dbr, error);
244 return error;
245 }
246
247 error = devm_request_any_context_irq(&pdev->dev, axp20x_pek->irq_dbf,
248 axp20x_pek_irq, 0,
249 "axp20x-pek-dbf", idev);
250 if (error < 0) {
251 dev_err(axp20x->dev, "Failed to request dbf IRQ#%d: %d\n",
252 axp20x_pek->irq_dbf, error);
253 return error;
254 }
255
256 error = sysfs_create_group(&pdev->dev.kobj, &axp20x_attribute_group);
257 if (error) {
258 dev_err(axp20x->dev, "Failed to create sysfs attributes: %d\n",
259 error);
260 return error;
261 }
262
263 error = devm_add_action(&pdev->dev,
264 axp20x_remove_sysfs_group, &pdev->dev);
265 if (error) {
266 axp20x_remove_sysfs_group(&pdev->dev);
267 dev_err(&pdev->dev, "Failed to add sysfs cleanup action: %d\n",
268 error);
269 return error;
270 }
271
272 error = input_register_device(idev);
273 if (error) {
274 dev_err(axp20x->dev, "Can't register input device: %d\n",
275 error);
276 return error;
277 }
278
279 platform_set_drvdata(pdev, axp20x_pek);
280
281 return 0;
282}
283
284static struct platform_driver axp20x_pek_driver = {
285 .probe = axp20x_pek_probe,
286 .driver = {
287 .name = "axp20x-pek",
288 },
289};
290module_platform_driver(axp20x_pek_driver);
291
292MODULE_DESCRIPTION("axp20x Power Button");
293MODULE_AUTHOR("Carlo Caione <carlo@caione.org>");
294MODULE_LICENSE("GPL");
295MODULE_ALIAS("platform:axp20x-pek");
1/*
2 * axp20x power button driver.
3 *
4 * Copyright (C) 2013 Carlo Caione <carlo@caione.org>
5 *
6 * This file is subject to the terms and conditions of the GNU General
7 * Public License. See the file "COPYING" in the main directory of this
8 * archive for more details.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 */
15
16#include <linux/acpi.h>
17#include <linux/errno.h>
18#include <linux/irq.h>
19#include <linux/init.h>
20#include <linux/input.h>
21#include <linux/interrupt.h>
22#include <linux/kernel.h>
23#include <linux/mfd/axp20x.h>
24#include <linux/module.h>
25#include <linux/platform_data/x86/soc.h>
26#include <linux/platform_device.h>
27#include <linux/regmap.h>
28#include <linux/slab.h>
29
30#define AXP20X_PEK_STARTUP_MASK (0xc0)
31#define AXP20X_PEK_SHUTDOWN_MASK (0x03)
32
33struct axp20x_info {
34 const struct axp20x_time *startup_time;
35 unsigned int startup_mask;
36 const struct axp20x_time *shutdown_time;
37 unsigned int shutdown_mask;
38};
39
40struct axp20x_pek {
41 struct axp20x_dev *axp20x;
42 struct input_dev *input;
43 struct axp20x_info *info;
44 int irq_dbr;
45 int irq_dbf;
46};
47
48struct axp20x_time {
49 unsigned int time;
50 unsigned int idx;
51};
52
53static const struct axp20x_time startup_time[] = {
54 { .time = 128, .idx = 0 },
55 { .time = 1000, .idx = 2 },
56 { .time = 3000, .idx = 1 },
57 { .time = 2000, .idx = 3 },
58};
59
60static const struct axp20x_time axp221_startup_time[] = {
61 { .time = 128, .idx = 0 },
62 { .time = 1000, .idx = 1 },
63 { .time = 2000, .idx = 2 },
64 { .time = 3000, .idx = 3 },
65};
66
67static const struct axp20x_time shutdown_time[] = {
68 { .time = 4000, .idx = 0 },
69 { .time = 6000, .idx = 1 },
70 { .time = 8000, .idx = 2 },
71 { .time = 10000, .idx = 3 },
72};
73
74static const struct axp20x_info axp20x_info = {
75 .startup_time = startup_time,
76 .startup_mask = AXP20X_PEK_STARTUP_MASK,
77 .shutdown_time = shutdown_time,
78 .shutdown_mask = AXP20X_PEK_SHUTDOWN_MASK,
79};
80
81static const struct axp20x_info axp221_info = {
82 .startup_time = axp221_startup_time,
83 .startup_mask = AXP20X_PEK_STARTUP_MASK,
84 .shutdown_time = shutdown_time,
85 .shutdown_mask = AXP20X_PEK_SHUTDOWN_MASK,
86};
87
88static ssize_t axp20x_show_attr(struct device *dev,
89 const struct axp20x_time *time,
90 unsigned int mask, char *buf)
91{
92 struct axp20x_pek *axp20x_pek = dev_get_drvdata(dev);
93 unsigned int val;
94 int ret, i;
95
96 ret = regmap_read(axp20x_pek->axp20x->regmap, AXP20X_PEK_KEY, &val);
97 if (ret != 0)
98 return ret;
99
100 val &= mask;
101 val >>= ffs(mask) - 1;
102
103 for (i = 0; i < 4; i++)
104 if (val == time[i].idx)
105 val = time[i].time;
106
107 return sprintf(buf, "%u\n", val);
108}
109
110static ssize_t axp20x_show_attr_startup(struct device *dev,
111 struct device_attribute *attr,
112 char *buf)
113{
114 struct axp20x_pek *axp20x_pek = dev_get_drvdata(dev);
115
116 return axp20x_show_attr(dev, axp20x_pek->info->startup_time,
117 axp20x_pek->info->startup_mask, buf);
118}
119
120static ssize_t axp20x_show_attr_shutdown(struct device *dev,
121 struct device_attribute *attr,
122 char *buf)
123{
124 struct axp20x_pek *axp20x_pek = dev_get_drvdata(dev);
125
126 return axp20x_show_attr(dev, axp20x_pek->info->shutdown_time,
127 axp20x_pek->info->shutdown_mask, buf);
128}
129
130static ssize_t axp20x_store_attr(struct device *dev,
131 const struct axp20x_time *time,
132 unsigned int mask, const char *buf,
133 size_t count)
134{
135 struct axp20x_pek *axp20x_pek = dev_get_drvdata(dev);
136 int ret, i;
137 unsigned int val, idx = 0;
138 unsigned int best_err = UINT_MAX;
139
140 ret = kstrtouint(buf, 10, &val);
141 if (ret)
142 return ret;
143
144 for (i = 3; i >= 0; i--) {
145 unsigned int err;
146
147 err = abs(time[i].time - val);
148 if (err < best_err) {
149 best_err = err;
150 idx = time[i].idx;
151 }
152
153 if (!err)
154 break;
155 }
156
157 idx <<= ffs(mask) - 1;
158 ret = regmap_update_bits(axp20x_pek->axp20x->regmap, AXP20X_PEK_KEY,
159 mask, idx);
160 if (ret != 0)
161 return -EINVAL;
162
163 return count;
164}
165
166static ssize_t axp20x_store_attr_startup(struct device *dev,
167 struct device_attribute *attr,
168 const char *buf, size_t count)
169{
170 struct axp20x_pek *axp20x_pek = dev_get_drvdata(dev);
171
172 return axp20x_store_attr(dev, axp20x_pek->info->startup_time,
173 axp20x_pek->info->startup_mask, buf, count);
174}
175
176static ssize_t axp20x_store_attr_shutdown(struct device *dev,
177 struct device_attribute *attr,
178 const char *buf, size_t count)
179{
180 struct axp20x_pek *axp20x_pek = dev_get_drvdata(dev);
181
182 return axp20x_store_attr(dev, axp20x_pek->info->shutdown_time,
183 axp20x_pek->info->shutdown_mask, buf, count);
184}
185
186static DEVICE_ATTR(startup, 0644, axp20x_show_attr_startup,
187 axp20x_store_attr_startup);
188static DEVICE_ATTR(shutdown, 0644, axp20x_show_attr_shutdown,
189 axp20x_store_attr_shutdown);
190
191static struct attribute *axp20x_attrs[] = {
192 &dev_attr_startup.attr,
193 &dev_attr_shutdown.attr,
194 NULL,
195};
196ATTRIBUTE_GROUPS(axp20x);
197
198static irqreturn_t axp20x_pek_irq(int irq, void *pwr)
199{
200 struct input_dev *idev = pwr;
201 struct axp20x_pek *axp20x_pek = input_get_drvdata(idev);
202
203 /*
204 * The power-button is connected to ground so a falling edge (dbf)
205 * means it is pressed.
206 */
207 if (irq == axp20x_pek->irq_dbf)
208 input_report_key(idev, KEY_POWER, true);
209 else if (irq == axp20x_pek->irq_dbr)
210 input_report_key(idev, KEY_POWER, false);
211
212 input_sync(idev);
213
214 return IRQ_HANDLED;
215}
216
217static int axp20x_pek_probe_input_device(struct axp20x_pek *axp20x_pek,
218 struct platform_device *pdev)
219{
220 struct axp20x_dev *axp20x = axp20x_pek->axp20x;
221 struct input_dev *idev;
222 int error;
223
224 axp20x_pek->irq_dbr = platform_get_irq_byname(pdev, "PEK_DBR");
225 if (axp20x_pek->irq_dbr < 0)
226 return axp20x_pek->irq_dbr;
227 axp20x_pek->irq_dbr = regmap_irq_get_virq(axp20x->regmap_irqc,
228 axp20x_pek->irq_dbr);
229
230 axp20x_pek->irq_dbf = platform_get_irq_byname(pdev, "PEK_DBF");
231 if (axp20x_pek->irq_dbf < 0)
232 return axp20x_pek->irq_dbf;
233 axp20x_pek->irq_dbf = regmap_irq_get_virq(axp20x->regmap_irqc,
234 axp20x_pek->irq_dbf);
235
236 axp20x_pek->input = devm_input_allocate_device(&pdev->dev);
237 if (!axp20x_pek->input)
238 return -ENOMEM;
239
240 idev = axp20x_pek->input;
241
242 idev->name = "axp20x-pek";
243 idev->phys = "m1kbd/input2";
244 idev->dev.parent = &pdev->dev;
245
246 input_set_capability(idev, EV_KEY, KEY_POWER);
247
248 input_set_drvdata(idev, axp20x_pek);
249
250 error = devm_request_any_context_irq(&pdev->dev, axp20x_pek->irq_dbr,
251 axp20x_pek_irq, 0,
252 "axp20x-pek-dbr", idev);
253 if (error < 0) {
254 dev_err(&pdev->dev, "Failed to request dbr IRQ#%d: %d\n",
255 axp20x_pek->irq_dbr, error);
256 return error;
257 }
258
259 error = devm_request_any_context_irq(&pdev->dev, axp20x_pek->irq_dbf,
260 axp20x_pek_irq, 0,
261 "axp20x-pek-dbf", idev);
262 if (error < 0) {
263 dev_err(&pdev->dev, "Failed to request dbf IRQ#%d: %d\n",
264 axp20x_pek->irq_dbf, error);
265 return error;
266 }
267
268 error = input_register_device(idev);
269 if (error) {
270 dev_err(&pdev->dev, "Can't register input device: %d\n",
271 error);
272 return error;
273 }
274
275 device_init_wakeup(&pdev->dev, true);
276
277 return 0;
278}
279
280static bool axp20x_pek_should_register_input(struct axp20x_pek *axp20x_pek)
281{
282 if (IS_ENABLED(CONFIG_INPUT_SOC_BUTTON_ARRAY) &&
283 axp20x_pek->axp20x->variant == AXP288_ID) {
284 /*
285 * On Cherry Trail platforms (hrv == 3), do not register the
286 * input device if there is an "INTCFD9" or "ACPI0011" gpio
287 * button ACPI device, as that handles the power button too,
288 * and otherwise we end up reporting all presses twice.
289 */
290 if (soc_intel_is_cht() &&
291 (acpi_dev_present("INTCFD9", NULL, -1) ||
292 acpi_dev_present("ACPI0011", NULL, -1)))
293 return false;
294 }
295
296 return true;
297}
298
299static int axp20x_pek_probe(struct platform_device *pdev)
300{
301 struct axp20x_pek *axp20x_pek;
302 const struct platform_device_id *match = platform_get_device_id(pdev);
303 int error;
304
305 if (!match) {
306 dev_err(&pdev->dev, "Failed to get platform_device_id\n");
307 return -EINVAL;
308 }
309
310 axp20x_pek = devm_kzalloc(&pdev->dev, sizeof(struct axp20x_pek),
311 GFP_KERNEL);
312 if (!axp20x_pek)
313 return -ENOMEM;
314
315 axp20x_pek->axp20x = dev_get_drvdata(pdev->dev.parent);
316
317 if (axp20x_pek_should_register_input(axp20x_pek)) {
318 error = axp20x_pek_probe_input_device(axp20x_pek, pdev);
319 if (error)
320 return error;
321 }
322
323 axp20x_pek->info = (struct axp20x_info *)match->driver_data;
324
325 platform_set_drvdata(pdev, axp20x_pek);
326
327 return 0;
328}
329
330static int axp20x_pek_suspend(struct device *dev)
331{
332 struct axp20x_pek *axp20x_pek = dev_get_drvdata(dev);
333
334 /*
335 * As nested threaded IRQs are not automatically disabled during
336 * suspend, we must explicitly disable non-wakeup IRQs.
337 */
338 if (device_may_wakeup(dev)) {
339 enable_irq_wake(axp20x_pek->irq_dbf);
340 enable_irq_wake(axp20x_pek->irq_dbr);
341 } else {
342 disable_irq(axp20x_pek->irq_dbf);
343 disable_irq(axp20x_pek->irq_dbr);
344 }
345
346 return 0;
347}
348
349static int axp20x_pek_resume(struct device *dev)
350{
351 struct axp20x_pek *axp20x_pek = dev_get_drvdata(dev);
352
353 if (device_may_wakeup(dev)) {
354 disable_irq_wake(axp20x_pek->irq_dbf);
355 disable_irq_wake(axp20x_pek->irq_dbr);
356 } else {
357 enable_irq(axp20x_pek->irq_dbf);
358 enable_irq(axp20x_pek->irq_dbr);
359 }
360
361 return 0;
362}
363
364static int __maybe_unused axp20x_pek_resume_noirq(struct device *dev)
365{
366 struct axp20x_pek *axp20x_pek = dev_get_drvdata(dev);
367
368 if (axp20x_pek->axp20x->variant != AXP288_ID)
369 return 0;
370
371 /*
372 * Clear interrupts from button presses during suspend, to avoid
373 * a wakeup power-button press getting reported to userspace.
374 */
375 regmap_write(axp20x_pek->axp20x->regmap,
376 AXP20X_IRQ1_STATE + AXP288_IRQ_POKN / 8,
377 BIT(AXP288_IRQ_POKN % 8));
378
379 return 0;
380}
381
382static const struct dev_pm_ops axp20x_pek_pm_ops = {
383 SYSTEM_SLEEP_PM_OPS(axp20x_pek_suspend, axp20x_pek_resume)
384 .resume_noirq = pm_sleep_ptr(axp20x_pek_resume_noirq),
385};
386
387static const struct platform_device_id axp_pek_id_match[] = {
388 {
389 .name = "axp20x-pek",
390 .driver_data = (kernel_ulong_t)&axp20x_info,
391 },
392 {
393 .name = "axp221-pek",
394 .driver_data = (kernel_ulong_t)&axp221_info,
395 },
396 { /* sentinel */ }
397};
398MODULE_DEVICE_TABLE(platform, axp_pek_id_match);
399
400static struct platform_driver axp20x_pek_driver = {
401 .probe = axp20x_pek_probe,
402 .id_table = axp_pek_id_match,
403 .driver = {
404 .name = "axp20x-pek",
405 .pm = pm_sleep_ptr(&axp20x_pek_pm_ops),
406 .dev_groups = axp20x_groups,
407 },
408};
409module_platform_driver(axp20x_pek_driver);
410
411MODULE_DESCRIPTION("axp20x Power Button");
412MODULE_AUTHOR("Carlo Caione <carlo@caione.org>");
413MODULE_LICENSE("GPL");