diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-07-30 15:41:17 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-07-30 15:41:17 -0400 |
commit | 3e701cdfe601306817604ca7f79f1d1c1088007c (patch) | |
tree | 1b0a4088a091f035d8be06758a604ca449223fc0 /drivers/input | |
parent | 7d3d09b01a028e9dd1282149fdcd2a6e0edd73e4 (diff) | |
parent | 3c1534c7ecffeb4330bba4c55d17f301528195b6 (diff) |
Merge tag 'mfd-3.6-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6
Pull MFD bits from Samuel Ortiz:
"We have support for a few new drivers:
- Samsung s2mps11
- Wolfson Microelectronics wm5102 and wm5110
- Marvell 88PM800 and 88PM805
- TI twl6041
We also have our regular driver improvements:
- Device tree and IRQ domain support for STE AB8500
- Regmap and devm_* API conversion for TI tps6586x
- Device tree support for Samsung max77686
- devm_* API conversion for STE AB3100
Besides that, quite a lot of fixing and cleanup for mc13xxx, tps65910,
tps65090, da9052 and twl-core."
Fix up mostly trivial conflicts, with the exception of
drivers/usb/host/ehci-omap.c in particular, which had some
re-organization of the reset sequence (commit 1a49e2ac9651: "EHCI:
centralize controller initialization") that clashed with commit
2761a6394516 ("mfd: USB: Fix the omap-usb EHCI ULPI PHY reset fix
issues").
In particular, commit 2761a6394516 moved the usb_add_hcd() to the
*middle* of the reset sequence, which clashes fairly badly with the
reset sequence re-organization (although it could have been done inside
the new omap_ehci_init() function).
I left that part of commit 2761a6394516 just undone.
* tag 'mfd-3.6-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6: (110 commits)
mfd: Ensure AB8500 platform data is passed through db8500-prcmu to MFD Core
mfd: Arizone core should select MFD_CORE
mfd: Fix arizona-irq.c build by selecting REGMAP_IRQ
mfd: Add debug trace on entering and leaving arizone runtime suspend
mfd: Correct tps65090 cell names
mfd: Remove gpio support from tps6586x core driver
ARM: tegra: defconfig: Enable tps6586x gpio
gpio: tps6586x: Add gpio support through platform driver
mfd: Cache tps6586x register through regmap
mfd: Use regmap for tps6586x register access.
mfd: Use devm managed resources for tps6586x
input: Add onkey support for 88PM80X PMIC
mfd: Add support for twl6041
mfd: Fix twl6040 revision information
mfd: Matches should be NULL when populate anatop child devices
input: ab8500-ponkey: Create AB8500 domain IRQ mapping
mfd: Add missing out of memory check for pcf50633
Documentation: Describe the AB8500 Device Tree bindings
mfd: Add tps65910 32-kHz-crystal-input init
mfd: Drop modifying mc13xxx driver's id_table in probe
...
Diffstat (limited to 'drivers/input')
-rw-r--r-- | drivers/input/misc/88pm80x_onkey.c | 168 | ||||
-rw-r--r-- | drivers/input/misc/Kconfig | 10 | ||||
-rw-r--r-- | drivers/input/misc/Makefile | 1 | ||||
-rw-r--r-- | drivers/input/misc/ab8500-ponkey.c | 4 |
4 files changed, 181 insertions, 2 deletions
diff --git a/drivers/input/misc/88pm80x_onkey.c b/drivers/input/misc/88pm80x_onkey.c new file mode 100644 index 000000000000..7f26e7b6c228 --- /dev/null +++ b/drivers/input/misc/88pm80x_onkey.c | |||
@@ -0,0 +1,168 @@ | |||
1 | /* | ||
2 | * Marvell 88PM80x ONKEY driver | ||
3 | * | ||
4 | * Copyright (C) 2012 Marvell International Ltd. | ||
5 | * Haojian Zhuang <haojian.zhuang@marvell.com> | ||
6 | * Qiao Zhou <zhouqiao@marvell.com> | ||
7 | * | ||
8 | * This file is subject to the terms and conditions of the GNU General | ||
9 | * Public License. See the file "COPYING" in the main directory of this | ||
10 | * archive for more details. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU General Public License for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program; if not, write to the Free Software | ||
19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
20 | */ | ||
21 | |||
22 | #include <linux/kernel.h> | ||
23 | #include <linux/module.h> | ||
24 | #include <linux/input.h> | ||
25 | #include <linux/mfd/88pm80x.h> | ||
26 | #include <linux/regmap.h> | ||
27 | #include <linux/slab.h> | ||
28 | |||
29 | #define PM800_LONG_ONKEY_EN (1 << 0) | ||
30 | #define PM800_LONG_KEY_DELAY (8) /* 1 .. 16 seconds */ | ||
31 | #define PM800_LONKEY_PRESS_TIME ((PM800_LONG_KEY_DELAY-1) << 4) | ||
32 | #define PM800_LONKEY_PRESS_TIME_MASK (0xF0) | ||
33 | #define PM800_SW_PDOWN (1 << 5) | ||
34 | |||
35 | struct pm80x_onkey_info { | ||
36 | struct input_dev *idev; | ||
37 | struct pm80x_chip *pm80x; | ||
38 | struct regmap *map; | ||
39 | int irq; | ||
40 | }; | ||
41 | |||
42 | /* 88PM80x gives us an interrupt when ONKEY is held */ | ||
43 | static irqreturn_t pm80x_onkey_handler(int irq, void *data) | ||
44 | { | ||
45 | struct pm80x_onkey_info *info = data; | ||
46 | int ret = 0; | ||
47 | unsigned int val; | ||
48 | |||
49 | ret = regmap_read(info->map, PM800_STATUS_1, &val); | ||
50 | if (ret < 0) { | ||
51 | dev_err(info->idev->dev.parent, "failed to read status: %d\n", ret); | ||
52 | return IRQ_NONE; | ||
53 | } | ||
54 | val &= PM800_ONKEY_STS1; | ||
55 | |||
56 | input_report_key(info->idev, KEY_POWER, val); | ||
57 | input_sync(info->idev); | ||
58 | |||
59 | return IRQ_HANDLED; | ||
60 | } | ||
61 | |||
62 | static SIMPLE_DEV_PM_OPS(pm80x_onkey_pm_ops, pm80x_dev_suspend, | ||
63 | pm80x_dev_resume); | ||
64 | |||
65 | static int __devinit pm80x_onkey_probe(struct platform_device *pdev) | ||
66 | { | ||
67 | |||
68 | struct pm80x_chip *chip = dev_get_drvdata(pdev->dev.parent); | ||
69 | struct pm80x_onkey_info *info; | ||
70 | int err; | ||
71 | |||
72 | info = kzalloc(sizeof(struct pm80x_onkey_info), GFP_KERNEL); | ||
73 | if (!info) | ||
74 | return -ENOMEM; | ||
75 | |||
76 | info->pm80x = chip; | ||
77 | |||
78 | info->irq = platform_get_irq(pdev, 0); | ||
79 | if (info->irq < 0) { | ||
80 | dev_err(&pdev->dev, "No IRQ resource!\n"); | ||
81 | err = -EINVAL; | ||
82 | goto out; | ||
83 | } | ||
84 | |||
85 | info->map = info->pm80x->regmap; | ||
86 | if (!info->map) { | ||
87 | dev_err(&pdev->dev, "no regmap!\n"); | ||
88 | err = -EINVAL; | ||
89 | goto out; | ||
90 | } | ||
91 | |||
92 | info->idev = input_allocate_device(); | ||
93 | if (!info->idev) { | ||
94 | dev_err(&pdev->dev, "Failed to allocate input dev\n"); | ||
95 | err = -ENOMEM; | ||
96 | goto out; | ||
97 | } | ||
98 | |||
99 | info->idev->name = "88pm80x_on"; | ||
100 | info->idev->phys = "88pm80x_on/input0"; | ||
101 | info->idev->id.bustype = BUS_I2C; | ||
102 | info->idev->dev.parent = &pdev->dev; | ||
103 | info->idev->evbit[0] = BIT_MASK(EV_KEY); | ||
104 | __set_bit(KEY_POWER, info->idev->keybit); | ||
105 | |||
106 | err = pm80x_request_irq(info->pm80x, info->irq, pm80x_onkey_handler, | ||
107 | IRQF_ONESHOT, "onkey", info); | ||
108 | if (err < 0) { | ||
109 | dev_err(&pdev->dev, "Failed to request IRQ: #%d: %d\n", | ||
110 | info->irq, err); | ||
111 | goto out_reg; | ||
112 | } | ||
113 | |||
114 | err = input_register_device(info->idev); | ||
115 | if (err) { | ||
116 | dev_err(&pdev->dev, "Can't register input device: %d\n", err); | ||
117 | goto out_irq; | ||
118 | } | ||
119 | |||
120 | platform_set_drvdata(pdev, info); | ||
121 | |||
122 | /* Enable long onkey detection */ | ||
123 | regmap_update_bits(info->map, PM800_RTC_MISC4, PM800_LONG_ONKEY_EN, | ||
124 | PM800_LONG_ONKEY_EN); | ||
125 | /* Set 8-second interval */ | ||
126 | regmap_update_bits(info->map, PM800_RTC_MISC3, | ||
127 | PM800_LONKEY_PRESS_TIME_MASK, | ||
128 | PM800_LONKEY_PRESS_TIME); | ||
129 | |||
130 | device_init_wakeup(&pdev->dev, 1); | ||
131 | return 0; | ||
132 | |||
133 | out_irq: | ||
134 | pm80x_free_irq(info->pm80x, info->irq, info); | ||
135 | out_reg: | ||
136 | input_free_device(info->idev); | ||
137 | out: | ||
138 | kfree(info); | ||
139 | return err; | ||
140 | } | ||
141 | |||
142 | static int __devexit pm80x_onkey_remove(struct platform_device *pdev) | ||
143 | { | ||
144 | struct pm80x_onkey_info *info = platform_get_drvdata(pdev); | ||
145 | |||
146 | device_init_wakeup(&pdev->dev, 0); | ||
147 | pm80x_free_irq(info->pm80x, info->irq, info); | ||
148 | input_unregister_device(info->idev); | ||
149 | kfree(info); | ||
150 | return 0; | ||
151 | } | ||
152 | |||
153 | static struct platform_driver pm80x_onkey_driver = { | ||
154 | .driver = { | ||
155 | .name = "88pm80x-onkey", | ||
156 | .owner = THIS_MODULE, | ||
157 | .pm = &pm80x_onkey_pm_ops, | ||
158 | }, | ||
159 | .probe = pm80x_onkey_probe, | ||
160 | .remove = __devexit_p(pm80x_onkey_remove), | ||
161 | }; | ||
162 | |||
163 | module_platform_driver(pm80x_onkey_driver); | ||
164 | |||
165 | MODULE_LICENSE("GPL"); | ||
166 | MODULE_DESCRIPTION("Marvell 88PM80x ONKEY driver"); | ||
167 | MODULE_AUTHOR("Qiao Zhou <zhouqiao@marvell.com>"); | ||
168 | MODULE_ALIAS("platform:88pm80x-onkey"); | ||
diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig index 7faf4a7fcaa9..7c0f1ecfdd7a 100644 --- a/drivers/input/misc/Kconfig +++ b/drivers/input/misc/Kconfig | |||
@@ -22,6 +22,16 @@ config INPUT_88PM860X_ONKEY | |||
22 | To compile this driver as a module, choose M here: the module | 22 | To compile this driver as a module, choose M here: the module |
23 | will be called 88pm860x_onkey. | 23 | will be called 88pm860x_onkey. |
24 | 24 | ||
25 | config INPUT_88PM80X_ONKEY | ||
26 | tristate "88PM80x ONKEY support" | ||
27 | depends on MFD_88PM800 | ||
28 | help | ||
29 | Support the ONKEY of Marvell 88PM80x PMICs as an input device | ||
30 | reporting power button status. | ||
31 | |||
32 | To compile this driver as a module, choose M here: the module | ||
33 | will be called 88pm80x_onkey. | ||
34 | |||
25 | config INPUT_AB8500_PONKEY | 35 | config INPUT_AB8500_PONKEY |
26 | tristate "AB8500 Pon (PowerOn) Key" | 36 | tristate "AB8500 Pon (PowerOn) Key" |
27 | depends on AB8500_CORE | 37 | depends on AB8500_CORE |
diff --git a/drivers/input/misc/Makefile b/drivers/input/misc/Makefile index f55cdf4916fa..83fe6f5b77d1 100644 --- a/drivers/input/misc/Makefile +++ b/drivers/input/misc/Makefile | |||
@@ -5,6 +5,7 @@ | |||
5 | # Each configuration option enables a list of files. | 5 | # Each configuration option enables a list of files. |
6 | 6 | ||
7 | obj-$(CONFIG_INPUT_88PM860X_ONKEY) += 88pm860x_onkey.o | 7 | obj-$(CONFIG_INPUT_88PM860X_ONKEY) += 88pm860x_onkey.o |
8 | obj-$(CONFIG_INPUT_88PM80X_ONKEY) += 88pm80x_onkey.o | ||
8 | obj-$(CONFIG_INPUT_AB8500_PONKEY) += ab8500-ponkey.o | 9 | obj-$(CONFIG_INPUT_AB8500_PONKEY) += ab8500-ponkey.o |
9 | obj-$(CONFIG_INPUT_AD714X) += ad714x.o | 10 | obj-$(CONFIG_INPUT_AD714X) += ad714x.o |
10 | obj-$(CONFIG_INPUT_AD714X_I2C) += ad714x-i2c.o | 11 | obj-$(CONFIG_INPUT_AD714X_I2C) += ad714x-i2c.o |
diff --git a/drivers/input/misc/ab8500-ponkey.c b/drivers/input/misc/ab8500-ponkey.c index 84ec691c05aa..f06231b7cab1 100644 --- a/drivers/input/misc/ab8500-ponkey.c +++ b/drivers/input/misc/ab8500-ponkey.c | |||
@@ -74,8 +74,8 @@ static int __devinit ab8500_ponkey_probe(struct platform_device *pdev) | |||
74 | 74 | ||
75 | ponkey->idev = input; | 75 | ponkey->idev = input; |
76 | ponkey->ab8500 = ab8500; | 76 | ponkey->ab8500 = ab8500; |
77 | ponkey->irq_dbf = irq_dbf; | 77 | ponkey->irq_dbf = ab8500_irq_get_virq(ab8500, irq_dbf); |
78 | ponkey->irq_dbr = irq_dbr; | 78 | ponkey->irq_dbr = ab8500_irq_get_virq(ab8500, irq_dbr); |
79 | 79 | ||
80 | input->name = "AB8500 POn(PowerOn) Key"; | 80 | input->name = "AB8500 POn(PowerOn) Key"; |
81 | input->dev.parent = &pdev->dev; | 81 | input->dev.parent = &pdev->dev; |