blob: 67aab86048ad73faa1f1af16c1ae1663cf4500f1 [file] [log] [blame]
Trilok Soni92d57a72011-05-13 15:17:51 +05301/* Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
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 version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 */
12
13#include <linux/module.h>
Trilok Soni92d57a72011-05-13 15:17:51 +053014#include <linux/kernel.h>
15#include <linux/errno.h>
16#include <linux/slab.h>
17#include <linux/input.h>
18#include <linux/interrupt.h>
19#include <linux/platform_device.h>
Stephen Boyd1e63bd92013-12-15 03:24:45 -080020#include <linux/regmap.h>
Trilok Soni92d57a72011-05-13 15:17:51 +053021#include <linux/log2.h>
Stephen Boyd57918df2014-03-29 12:39:38 -070022#include <linux/of.h>
Stephen Boyd02b0b792015-07-17 14:59:18 -070023#include <linux/of_device.h>
Trilok Soni92d57a72011-05-13 15:17:51 +053024
25#define PON_CNTL_1 0x1C
26#define PON_CNTL_PULL_UP BIT(7)
27#define PON_CNTL_TRIG_DELAY_MASK (0x7)
Stephen Boyd02b0b792015-07-17 14:59:18 -070028#define PON_CNTL_1_PULL_UP_EN 0xe0
29#define PON_CNTL_1_USB_PWR_EN 0x10
30#define PON_CNTL_1_WD_EN_RESET 0x08
31
32#define PM8058_SLEEP_CTRL 0x02b
33#define PM8921_SLEEP_CTRL 0x10a
34
35#define SLEEP_CTRL_SMPL_EN_RESET 0x04
36
37/* Regulator master enable addresses */
38#define REG_PM8058_VREG_EN_MSM 0x018
39#define REG_PM8058_VREG_EN_GRP_5_4 0x1c8
40
41/* Regulator control registers for shutdown/reset */
42#define PM8058_S0_CTRL 0x004
43#define PM8058_S1_CTRL 0x005
44#define PM8058_S3_CTRL 0x111
45#define PM8058_L21_CTRL 0x120
46#define PM8058_L22_CTRL 0x121
47
48#define PM8058_REGULATOR_ENABLE_MASK 0x80
49#define PM8058_REGULATOR_ENABLE 0x80
50#define PM8058_REGULATOR_DISABLE 0x00
51#define PM8058_REGULATOR_PULL_DOWN_MASK 0x40
52#define PM8058_REGULATOR_PULL_DOWN_EN 0x40
53
54/* Buck CTRL register */
55#define PM8058_SMPS_LEGACY_VREF_SEL 0x20
56#define PM8058_SMPS_LEGACY_VPROG_MASK 0x1f
57#define PM8058_SMPS_ADVANCED_BAND_MASK 0xC0
58#define PM8058_SMPS_ADVANCED_BAND_SHIFT 6
59#define PM8058_SMPS_ADVANCED_VPROG_MASK 0x3f
60
61/* Buck TEST2 registers for shutdown/reset */
62#define PM8058_S0_TEST2 0x084
63#define PM8058_S1_TEST2 0x085
64#define PM8058_S3_TEST2 0x11a
65
66#define PM8058_REGULATOR_BANK_WRITE 0x80
67#define PM8058_REGULATOR_BANK_MASK 0x70
68#define PM8058_REGULATOR_BANK_SHIFT 4
69#define PM8058_REGULATOR_BANK_SEL(n) ((n) << PM8058_REGULATOR_BANK_SHIFT)
70
71/* Buck TEST2 register bank 1 */
72#define PM8058_SMPS_LEGACY_VLOW_SEL 0x01
73
74/* Buck TEST2 register bank 7 */
75#define PM8058_SMPS_ADVANCED_MODE_MASK 0x02
76#define PM8058_SMPS_ADVANCED_MODE 0x02
77#define PM8058_SMPS_LEGACY_MODE 0x00
Trilok Soni92d57a72011-05-13 15:17:51 +053078
79/**
80 * struct pmic8xxx_pwrkey - pmic8xxx pwrkey information
81 * @key_press_irq: key press irq number
Stephen Boyd02b0b792015-07-17 14:59:18 -070082 * @regmap: device regmap
83 * @shutdown_fn: shutdown configuration function
Trilok Soni92d57a72011-05-13 15:17:51 +053084 */
85struct pmic8xxx_pwrkey {
Trilok Soni92d57a72011-05-13 15:17:51 +053086 int key_press_irq;
Stephen Boyd02b0b792015-07-17 14:59:18 -070087 struct regmap *regmap;
88 int (*shutdown_fn)(struct pmic8xxx_pwrkey *, bool);
Trilok Soni92d57a72011-05-13 15:17:51 +053089};
90
Stephen Boydb27f8fe2013-12-15 03:14:47 -080091static irqreturn_t pwrkey_press_irq(int irq, void *_pwr)
Trilok Soni92d57a72011-05-13 15:17:51 +053092{
Stephen Boydb27f8fe2013-12-15 03:14:47 -080093 struct input_dev *pwr = _pwr;
Trilok Soni92d57a72011-05-13 15:17:51 +053094
Stephen Boydb27f8fe2013-12-15 03:14:47 -080095 input_report_key(pwr, KEY_POWER, 1);
96 input_sync(pwr);
Trilok Soni92d57a72011-05-13 15:17:51 +053097
98 return IRQ_HANDLED;
99}
100
Stephen Boydb27f8fe2013-12-15 03:14:47 -0800101static irqreturn_t pwrkey_release_irq(int irq, void *_pwr)
Trilok Soni92d57a72011-05-13 15:17:51 +0530102{
Stephen Boydb27f8fe2013-12-15 03:14:47 -0800103 struct input_dev *pwr = _pwr;
Trilok Soni92d57a72011-05-13 15:17:51 +0530104
Stephen Boydb27f8fe2013-12-15 03:14:47 -0800105 input_report_key(pwr, KEY_POWER, 0);
106 input_sync(pwr);
Trilok Soni92d57a72011-05-13 15:17:51 +0530107
108 return IRQ_HANDLED;
109}
110
Jingoo Han97a652a2014-11-02 00:02:46 -0700111static int __maybe_unused pmic8xxx_pwrkey_suspend(struct device *dev)
Trilok Soni92d57a72011-05-13 15:17:51 +0530112{
113 struct pmic8xxx_pwrkey *pwrkey = dev_get_drvdata(dev);
114
115 if (device_may_wakeup(dev))
116 enable_irq_wake(pwrkey->key_press_irq);
117
118 return 0;
119}
120
Jingoo Han97a652a2014-11-02 00:02:46 -0700121static int __maybe_unused pmic8xxx_pwrkey_resume(struct device *dev)
Trilok Soni92d57a72011-05-13 15:17:51 +0530122{
123 struct pmic8xxx_pwrkey *pwrkey = dev_get_drvdata(dev);
124
125 if (device_may_wakeup(dev))
126 disable_irq_wake(pwrkey->key_press_irq);
127
128 return 0;
129}
Trilok Soni92d57a72011-05-13 15:17:51 +0530130
131static SIMPLE_DEV_PM_OPS(pm8xxx_pwr_key_pm_ops,
132 pmic8xxx_pwrkey_suspend, pmic8xxx_pwrkey_resume);
133
Stephen Boyd02b0b792015-07-17 14:59:18 -0700134static void pmic8xxx_pwrkey_shutdown(struct platform_device *pdev)
135{
136 struct pmic8xxx_pwrkey *pwrkey = platform_get_drvdata(pdev);
137 int error;
138 u8 mask, val;
139 bool reset = system_state == SYSTEM_RESTART;
140
141 if (pwrkey->shutdown_fn) {
142 error = pwrkey->shutdown_fn(pwrkey, reset);
143 if (error)
144 return;
145 }
146
147 /*
148 * Select action to perform (reset or shutdown) when PS_HOLD goes low.
149 * Also ensure that KPD, CBL0, and CBL1 pull ups are enabled and that
150 * USB charging is enabled.
151 */
152 mask = PON_CNTL_1_PULL_UP_EN | PON_CNTL_1_USB_PWR_EN;
153 mask |= PON_CNTL_1_WD_EN_RESET;
154 val = mask;
155 if (!reset)
156 val &= ~PON_CNTL_1_WD_EN_RESET;
157
158 regmap_update_bits(pwrkey->regmap, PON_CNTL_1, mask, val);
159}
160
161/*
162 * Set an SMPS regulator to be disabled in its CTRL register, but enabled
163 * in the master enable register. Also set it's pull down enable bit.
164 * Take care to make sure that the output voltage doesn't change if switching
165 * from advanced mode to legacy mode.
166 */
167static int pm8058_disable_smps_locally_set_pull_down(struct regmap *regmap,
168 u16 ctrl_addr, u16 test2_addr, u16 master_enable_addr,
169 u8 master_enable_bit)
170{
171 int error;
172 u8 vref_sel, vlow_sel, band, vprog, bank;
173 unsigned int reg;
174
175 bank = PM8058_REGULATOR_BANK_SEL(7);
176 error = regmap_write(regmap, test2_addr, bank);
177 if (error)
178 return error;
179
180 error = regmap_read(regmap, test2_addr, &reg);
181 if (error)
182 return error;
183
184 reg &= PM8058_SMPS_ADVANCED_MODE_MASK;
185 /* Check if in advanced mode. */
186 if (reg == PM8058_SMPS_ADVANCED_MODE) {
187 /* Determine current output voltage. */
188 error = regmap_read(regmap, ctrl_addr, &reg);
189 if (error)
190 return error;
191
192 band = reg & PM8058_SMPS_ADVANCED_BAND_MASK;
193 band >>= PM8058_SMPS_ADVANCED_BAND_SHIFT;
194 switch (band) {
195 case 3:
196 vref_sel = 0;
197 vlow_sel = 0;
198 break;
199 case 2:
200 vref_sel = PM8058_SMPS_LEGACY_VREF_SEL;
201 vlow_sel = 0;
202 break;
203 case 1:
204 vref_sel = PM8058_SMPS_LEGACY_VREF_SEL;
205 vlow_sel = PM8058_SMPS_LEGACY_VLOW_SEL;
206 break;
207 default:
208 pr_err("%s: regulator already disabled\n", __func__);
209 return -EPERM;
210 }
211 vprog = reg & PM8058_SMPS_ADVANCED_VPROG_MASK;
212 /* Round up if fine step is in use. */
213 vprog = (vprog + 1) >> 1;
214 if (vprog > PM8058_SMPS_LEGACY_VPROG_MASK)
215 vprog = PM8058_SMPS_LEGACY_VPROG_MASK;
216
217 /* Set VLOW_SEL bit. */
218 bank = PM8058_REGULATOR_BANK_SEL(1);
219 error = regmap_write(regmap, test2_addr, bank);
220 if (error)
221 return error;
222
223 error = regmap_update_bits(regmap, test2_addr,
224 PM8058_REGULATOR_BANK_WRITE | PM8058_REGULATOR_BANK_MASK
225 | PM8058_SMPS_LEGACY_VLOW_SEL,
226 PM8058_REGULATOR_BANK_WRITE |
227 PM8058_REGULATOR_BANK_SEL(1) | vlow_sel);
228 if (error)
229 return error;
230
231 /* Switch to legacy mode */
232 bank = PM8058_REGULATOR_BANK_SEL(7);
233 error = regmap_write(regmap, test2_addr, bank);
234 if (error)
235 return error;
236
237 error = regmap_update_bits(regmap, test2_addr,
238 PM8058_REGULATOR_BANK_WRITE |
239 PM8058_REGULATOR_BANK_MASK |
240 PM8058_SMPS_ADVANCED_MODE_MASK,
241 PM8058_REGULATOR_BANK_WRITE |
242 PM8058_REGULATOR_BANK_SEL(7) |
243 PM8058_SMPS_LEGACY_MODE);
244 if (error)
245 return error;
246
247 /* Enable locally, enable pull down, keep voltage the same. */
248 error = regmap_update_bits(regmap, ctrl_addr,
249 PM8058_REGULATOR_ENABLE_MASK |
250 PM8058_REGULATOR_PULL_DOWN_MASK |
251 PM8058_SMPS_LEGACY_VREF_SEL |
252 PM8058_SMPS_LEGACY_VPROG_MASK,
253 PM8058_REGULATOR_ENABLE | PM8058_REGULATOR_PULL_DOWN_EN
254 | vref_sel | vprog);
255 if (error)
256 return error;
257 }
258
259 /* Enable in master control register. */
260 error = regmap_update_bits(regmap, master_enable_addr,
261 master_enable_bit, master_enable_bit);
262 if (error)
263 return error;
264
265 /* Disable locally and enable pull down. */
266 return regmap_update_bits(regmap, ctrl_addr,
267 PM8058_REGULATOR_ENABLE_MASK | PM8058_REGULATOR_PULL_DOWN_MASK,
268 PM8058_REGULATOR_DISABLE | PM8058_REGULATOR_PULL_DOWN_EN);
269}
270
271static int pm8058_disable_ldo_locally_set_pull_down(struct regmap *regmap,
272 u16 ctrl_addr, u16 master_enable_addr, u8 master_enable_bit)
273{
274 int error;
275
276 /* Enable LDO in master control register. */
277 error = regmap_update_bits(regmap, master_enable_addr,
278 master_enable_bit, master_enable_bit);
279 if (error)
280 return error;
281
282 /* Disable LDO in CTRL register and set pull down */
283 return regmap_update_bits(regmap, ctrl_addr,
284 PM8058_REGULATOR_ENABLE_MASK | PM8058_REGULATOR_PULL_DOWN_MASK,
285 PM8058_REGULATOR_DISABLE | PM8058_REGULATOR_PULL_DOWN_EN);
286}
287
288static int pm8058_pwrkey_shutdown(struct pmic8xxx_pwrkey *pwrkey, bool reset)
289{
290 int error;
291 struct regmap *regmap = pwrkey->regmap;
292 u8 mask, val;
293
294 /* When shutting down, enable active pulldowns on important rails. */
295 if (!reset) {
296 /* Disable SMPS's 0,1,3 locally and set pulldown enable bits. */
297 pm8058_disable_smps_locally_set_pull_down(regmap,
298 PM8058_S0_CTRL, PM8058_S0_TEST2,
299 REG_PM8058_VREG_EN_MSM, BIT(7));
300 pm8058_disable_smps_locally_set_pull_down(regmap,
301 PM8058_S1_CTRL, PM8058_S1_TEST2,
302 REG_PM8058_VREG_EN_MSM, BIT(6));
303 pm8058_disable_smps_locally_set_pull_down(regmap,
304 PM8058_S3_CTRL, PM8058_S3_TEST2,
305 REG_PM8058_VREG_EN_GRP_5_4, BIT(7) | BIT(4));
306 /* Disable LDO 21 locally and set pulldown enable bit. */
307 pm8058_disable_ldo_locally_set_pull_down(regmap,
308 PM8058_L21_CTRL, REG_PM8058_VREG_EN_GRP_5_4,
309 BIT(1));
310 }
311
312 /*
313 * Fix-up: Set regulator LDO22 to 1.225 V in high power mode. Leave its
314 * pull-down state intact. This ensures a safe shutdown.
315 */
316 error = regmap_update_bits(regmap, PM8058_L22_CTRL, 0xbf, 0x93);
317 if (error)
318 return error;
319
320 /* Enable SMPL if resetting is desired */
321 mask = SLEEP_CTRL_SMPL_EN_RESET;
322 val = 0;
323 if (reset)
324 val = mask;
325 return regmap_update_bits(regmap, PM8058_SLEEP_CTRL, mask, val);
326}
327
328static int pm8921_pwrkey_shutdown(struct pmic8xxx_pwrkey *pwrkey, bool reset)
329{
330 struct regmap *regmap = pwrkey->regmap;
331 u8 mask = SLEEP_CTRL_SMPL_EN_RESET;
332 u8 val = 0;
333
334 /* Enable SMPL if resetting is desired */
335 if (reset)
336 val = mask;
337 return regmap_update_bits(regmap, PM8921_SLEEP_CTRL, mask, val);
338}
339
Bill Pemberton5298cc42012-11-23 21:38:25 -0800340static int pmic8xxx_pwrkey_probe(struct platform_device *pdev)
Trilok Soni92d57a72011-05-13 15:17:51 +0530341{
342 struct input_dev *pwr;
343 int key_release_irq = platform_get_irq(pdev, 0);
344 int key_press_irq = platform_get_irq(pdev, 1);
345 int err;
346 unsigned int delay;
Stephen Boyd1e63bd92013-12-15 03:24:45 -0800347 unsigned int pon_cntl;
348 struct regmap *regmap;
Trilok Soni92d57a72011-05-13 15:17:51 +0530349 struct pmic8xxx_pwrkey *pwrkey;
Stephen Boyd57918df2014-03-29 12:39:38 -0700350 u32 kpd_delay;
351 bool pull_up;
Trilok Soni92d57a72011-05-13 15:17:51 +0530352
Stephen Boyd57918df2014-03-29 12:39:38 -0700353 if (of_property_read_u32(pdev->dev.of_node, "debounce", &kpd_delay))
Stephen Boyd70a26072014-05-14 11:58:55 -0700354 kpd_delay = 15625;
Trilok Soni92d57a72011-05-13 15:17:51 +0530355
Stephen Boydeda5ecc2016-04-17 05:21:42 -0700356 /* Valid range of pwr key trigger delay is 1/64 sec to 2 seconds. */
357 if (kpd_delay > USEC_PER_SEC * 2 || kpd_delay < USEC_PER_SEC / 64) {
Trilok Soni92d57a72011-05-13 15:17:51 +0530358 dev_err(&pdev->dev, "invalid power key trigger delay\n");
359 return -EINVAL;
360 }
361
Stephen Boyd70a26072014-05-14 11:58:55 -0700362 pull_up = of_property_read_bool(pdev->dev.of_node, "pull-up");
363
Stephen Boyd1e63bd92013-12-15 03:24:45 -0800364 regmap = dev_get_regmap(pdev->dev.parent, NULL);
365 if (!regmap) {
366 dev_err(&pdev->dev, "failed to locate regmap for the device\n");
367 return -ENODEV;
368 }
369
Dmitry Torokhoveb735d32013-12-15 03:28:26 -0800370 pwrkey = devm_kzalloc(&pdev->dev, sizeof(*pwrkey), GFP_KERNEL);
Trilok Soni92d57a72011-05-13 15:17:51 +0530371 if (!pwrkey)
372 return -ENOMEM;
373
Stephen Boyd02b0b792015-07-17 14:59:18 -0700374 pwrkey->shutdown_fn = of_device_get_match_data(&pdev->dev);
375 pwrkey->regmap = regmap;
Dmitry Torokhoveb735d32013-12-15 03:28:26 -0800376 pwrkey->key_press_irq = key_press_irq;
377
378 pwr = devm_input_allocate_device(&pdev->dev);
Trilok Soni92d57a72011-05-13 15:17:51 +0530379 if (!pwr) {
380 dev_dbg(&pdev->dev, "Can't allocate power button\n");
Dmitry Torokhoveb735d32013-12-15 03:28:26 -0800381 return -ENOMEM;
Trilok Soni92d57a72011-05-13 15:17:51 +0530382 }
383
384 input_set_capability(pwr, EV_KEY, KEY_POWER);
385
386 pwr->name = "pmic8xxx_pwrkey";
387 pwr->phys = "pmic8xxx_pwrkey/input0";
Trilok Soni92d57a72011-05-13 15:17:51 +0530388
Stephen Boydeda5ecc2016-04-17 05:21:42 -0700389 delay = (kpd_delay << 6) / USEC_PER_SEC;
390 delay = ilog2(delay);
Trilok Soni92d57a72011-05-13 15:17:51 +0530391
Stephen Boyd1e63bd92013-12-15 03:24:45 -0800392 err = regmap_read(regmap, PON_CNTL_1, &pon_cntl);
Trilok Soni92d57a72011-05-13 15:17:51 +0530393 if (err < 0) {
394 dev_err(&pdev->dev, "failed reading PON_CNTL_1 err=%d\n", err);
Dmitry Torokhoveb735d32013-12-15 03:28:26 -0800395 return err;
Trilok Soni92d57a72011-05-13 15:17:51 +0530396 }
397
398 pon_cntl &= ~PON_CNTL_TRIG_DELAY_MASK;
399 pon_cntl |= (delay & PON_CNTL_TRIG_DELAY_MASK);
Stephen Boyd57918df2014-03-29 12:39:38 -0700400 if (pull_up)
Trilok Soni92d57a72011-05-13 15:17:51 +0530401 pon_cntl |= PON_CNTL_PULL_UP;
402 else
403 pon_cntl &= ~PON_CNTL_PULL_UP;
404
Stephen Boyd1e63bd92013-12-15 03:24:45 -0800405 err = regmap_write(regmap, PON_CNTL_1, pon_cntl);
Trilok Soni92d57a72011-05-13 15:17:51 +0530406 if (err < 0) {
407 dev_err(&pdev->dev, "failed writing PON_CNTL_1 err=%d\n", err);
Dmitry Torokhoveb735d32013-12-15 03:28:26 -0800408 return err;
409 }
410
411 err = devm_request_irq(&pdev->dev, key_press_irq, pwrkey_press_irq,
412 IRQF_TRIGGER_RISING,
413 "pmic8xxx_pwrkey_press", pwr);
414 if (err) {
415 dev_err(&pdev->dev, "Can't get %d IRQ for pwrkey: %d\n",
416 key_press_irq, err);
417 return err;
418 }
419
420 err = devm_request_irq(&pdev->dev, key_release_irq, pwrkey_release_irq,
421 IRQF_TRIGGER_RISING,
422 "pmic8xxx_pwrkey_release", pwr);
423 if (err) {
424 dev_err(&pdev->dev, "Can't get %d IRQ for pwrkey: %d\n",
425 key_release_irq, err);
426 return err;
Trilok Soni92d57a72011-05-13 15:17:51 +0530427 }
428
429 err = input_register_device(pwr);
430 if (err) {
Dmitry Torokhoveb735d32013-12-15 03:28:26 -0800431 dev_err(&pdev->dev, "Can't register power key: %d\n", err);
432 return err;
Trilok Soni92d57a72011-05-13 15:17:51 +0530433 }
434
Trilok Soni92d57a72011-05-13 15:17:51 +0530435 platform_set_drvdata(pdev, pwrkey);
Stephen Boyd57918df2014-03-29 12:39:38 -0700436 device_init_wakeup(&pdev->dev, 1);
Trilok Soni92d57a72011-05-13 15:17:51 +0530437
438 return 0;
Trilok Soni92d57a72011-05-13 15:17:51 +0530439}
440
Bill Pembertone2619cf2012-11-23 21:50:47 -0800441static int pmic8xxx_pwrkey_remove(struct platform_device *pdev)
Trilok Soni92d57a72011-05-13 15:17:51 +0530442{
Trilok Soni92d57a72011-05-13 15:17:51 +0530443 device_init_wakeup(&pdev->dev, 0);
444
Trilok Soni92d57a72011-05-13 15:17:51 +0530445 return 0;
446}
447
Stephen Boyd57918df2014-03-29 12:39:38 -0700448static const struct of_device_id pm8xxx_pwr_key_id_table[] = {
Stephen Boyd02b0b792015-07-17 14:59:18 -0700449 { .compatible = "qcom,pm8058-pwrkey", .data = &pm8058_pwrkey_shutdown },
450 { .compatible = "qcom,pm8921-pwrkey", .data = &pm8921_pwrkey_shutdown },
Stephen Boyd57918df2014-03-29 12:39:38 -0700451 { }
452};
453MODULE_DEVICE_TABLE(of, pm8xxx_pwr_key_id_table);
454
Trilok Soni92d57a72011-05-13 15:17:51 +0530455static struct platform_driver pmic8xxx_pwrkey_driver = {
456 .probe = pmic8xxx_pwrkey_probe,
Bill Pemberton1cb0aa82012-11-23 21:27:39 -0800457 .remove = pmic8xxx_pwrkey_remove,
Stephen Boyd02b0b792015-07-17 14:59:18 -0700458 .shutdown = pmic8xxx_pwrkey_shutdown,
Trilok Soni92d57a72011-05-13 15:17:51 +0530459 .driver = {
Stephen Boyd57918df2014-03-29 12:39:38 -0700460 .name = "pm8xxx-pwrkey",
Trilok Soni92d57a72011-05-13 15:17:51 +0530461 .pm = &pm8xxx_pwr_key_pm_ops,
Stephen Boyd57918df2014-03-29 12:39:38 -0700462 .of_match_table = pm8xxx_pwr_key_id_table,
Trilok Soni92d57a72011-05-13 15:17:51 +0530463 },
464};
JJ Ding840a7462011-11-29 11:08:40 -0800465module_platform_driver(pmic8xxx_pwrkey_driver);
Trilok Soni92d57a72011-05-13 15:17:51 +0530466
467MODULE_ALIAS("platform:pmic8xxx_pwrkey");
468MODULE_DESCRIPTION("PMIC8XXX Power Key driver");
469MODULE_LICENSE("GPL v2");
470MODULE_AUTHOR("Trilok Soni <tsoni@codeaurora.org>");