diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-10-04 23:01:30 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-10-04 23:01:30 -0400 |
commit | 578f1ef91aa92beb571bfb9af8f4d18f405f3b9e (patch) | |
tree | 8ff59e772d09180b7e7f952a8c90a1bcf25e1d19 /drivers/input | |
parent | ecefbd94b834fa32559d854646d777c56749ef1c (diff) | |
parent | 74d8378159de16a0a1d1975d4778120d263d6000 (diff) |
Merge tag 'mfd-3.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6
Pull MFD changes from Samuel Ortiz:
"MFD bits for the 3.7 merge window.
As usual we have a few new drivers:
- TI LP8788
- TI OMAP USB TLL
- Maxim MAX8907
- SMSC ECE1099
- Dialog Semiconductor DA9055
- A simpler syscon driver that allow us to get rid of the anatop one.
Drivers are also gradually getting Device Tree and IRQ domain support.
The following drivers got DT support:
- palmas, 88pm860x, tc3589x and twl4030-audio
And those ones now use the IRQ domain APIs:
- 88pm860x, tc3589x, db8500_prcmu
Also some other interesting changes:
- Intel's ICH LPC now supports Lynx Point
- TI's twl4030-audio added a GPO child
- tps6527 enabled its backlight subdevice
- The twl6030 pwm driver moved to the new PWM subsystem
And finally a bunch of cleanup and casual fixes for mc13xxx, 88pm860x,
palmas, ab8500, wm8994, wm5110, max8907 and the tps65xxx family."
Fix up various annoying conflicts: the DT and IRQ domain support came in
twice and was already in 3.6. And then it was apparently rebased.
Guys, DON'T REBASE!
* tag 'mfd-3.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6: (89 commits)
ARM: dts: Enable 88pm860x pmic
mfd: 88pm860x: Move gpadc init into touch
mfd: 88pm860x: Device tree support
mfd: 88pm860x: Use irqdomain
mfd: smsc: Add support for smsc gpio io/keypad driver
backlight: tps65217_bl: Add missing platform_set_drvdata in tps65217_bl_probe
mfd: DA9055 core driver
mfd: tps65910: Add alarm interrupt of TPS65910 RTC to mfd device list
mfd: wm5110: Add register patches for revision B
mfd: wm5110: Disable control interface error report for WM5110 rev B
mfd: max8907: Remove regulator-compatible from DT docs
backlight: Add TPS65217 WLED driver
mfd: Add backlight as subdevice to the tps65217
mfd: Provide the PRCMU with its own IRQ domain
mfd: Fix max8907 sparse warning
mfd: Add lp8788 mfd driver
mfd: dbx500: Provide a more accurate smp_twd clock
mfd: rc5t583: Fix warning messages
regulator: palmas: Add DT support
mfd: palmas: Change regulator defns to better suite DT
...
Diffstat (limited to 'drivers/input')
-rw-r--r-- | drivers/input/misc/twl4030-vibra.c | 18 | ||||
-rw-r--r-- | drivers/input/touchscreen/88pm860x-ts.c | 127 |
2 files changed, 127 insertions, 18 deletions
diff --git a/drivers/input/misc/twl4030-vibra.c b/drivers/input/misc/twl4030-vibra.c index fc0ed9b43424..2194a3c7236a 100644 --- a/drivers/input/misc/twl4030-vibra.c +++ b/drivers/input/misc/twl4030-vibra.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <linux/module.h> | 26 | #include <linux/module.h> |
27 | #include <linux/jiffies.h> | 27 | #include <linux/jiffies.h> |
28 | #include <linux/platform_device.h> | 28 | #include <linux/platform_device.h> |
29 | #include <linux/of.h> | ||
29 | #include <linux/workqueue.h> | 30 | #include <linux/workqueue.h> |
30 | #include <linux/i2c/twl.h> | 31 | #include <linux/i2c/twl.h> |
31 | #include <linux/mfd/twl4030-audio.h> | 32 | #include <linux/mfd/twl4030-audio.h> |
@@ -194,13 +195,26 @@ static int twl4030_vibra_resume(struct device *dev) | |||
194 | static SIMPLE_DEV_PM_OPS(twl4030_vibra_pm_ops, | 195 | static SIMPLE_DEV_PM_OPS(twl4030_vibra_pm_ops, |
195 | twl4030_vibra_suspend, twl4030_vibra_resume); | 196 | twl4030_vibra_suspend, twl4030_vibra_resume); |
196 | 197 | ||
198 | static bool twl4030_vibra_check_coexist(struct twl4030_vibra_data *pdata, | ||
199 | struct device_node *node) | ||
200 | { | ||
201 | if (pdata && pdata->coexist) | ||
202 | return true; | ||
203 | |||
204 | if (of_find_node_by_name(node, "codec")) | ||
205 | return true; | ||
206 | |||
207 | return false; | ||
208 | } | ||
209 | |||
197 | static int __devinit twl4030_vibra_probe(struct platform_device *pdev) | 210 | static int __devinit twl4030_vibra_probe(struct platform_device *pdev) |
198 | { | 211 | { |
199 | struct twl4030_vibra_data *pdata = pdev->dev.platform_data; | 212 | struct twl4030_vibra_data *pdata = pdev->dev.platform_data; |
213 | struct device_node *twl4030_core_node = pdev->dev.parent->of_node; | ||
200 | struct vibra_info *info; | 214 | struct vibra_info *info; |
201 | int ret; | 215 | int ret; |
202 | 216 | ||
203 | if (!pdata) { | 217 | if (!pdata && !twl4030_core_node) { |
204 | dev_dbg(&pdev->dev, "platform_data not available\n"); | 218 | dev_dbg(&pdev->dev, "platform_data not available\n"); |
205 | return -EINVAL; | 219 | return -EINVAL; |
206 | } | 220 | } |
@@ -210,7 +224,7 @@ static int __devinit twl4030_vibra_probe(struct platform_device *pdev) | |||
210 | return -ENOMEM; | 224 | return -ENOMEM; |
211 | 225 | ||
212 | info->dev = &pdev->dev; | 226 | info->dev = &pdev->dev; |
213 | info->coexist = pdata->coexist; | 227 | info->coexist = twl4030_vibra_check_coexist(pdata, twl4030_core_node); |
214 | INIT_WORK(&info->play_work, vibra_play_work); | 228 | INIT_WORK(&info->play_work, vibra_play_work); |
215 | 229 | ||
216 | info->input_dev = input_allocate_device(); | 230 | info->input_dev = input_allocate_device(); |
diff --git a/drivers/input/touchscreen/88pm860x-ts.c b/drivers/input/touchscreen/88pm860x-ts.c index 05f30b73c3c3..326218dbd6e6 100644 --- a/drivers/input/touchscreen/88pm860x-ts.c +++ b/drivers/input/touchscreen/88pm860x-ts.c | |||
@@ -10,6 +10,7 @@ | |||
10 | */ | 10 | */ |
11 | #include <linux/kernel.h> | 11 | #include <linux/kernel.h> |
12 | #include <linux/module.h> | 12 | #include <linux/module.h> |
13 | #include <linux/of.h> | ||
13 | #include <linux/platform_device.h> | 14 | #include <linux/platform_device.h> |
14 | #include <linux/i2c.h> | 15 | #include <linux/i2c.h> |
15 | #include <linux/input.h> | 16 | #include <linux/input.h> |
@@ -113,14 +114,69 @@ static void pm860x_touch_close(struct input_dev *dev) | |||
113 | pm860x_set_bits(touch->i2c, MEAS_EN3, data, 0); | 114 | pm860x_set_bits(touch->i2c, MEAS_EN3, data, 0); |
114 | } | 115 | } |
115 | 116 | ||
117 | #ifdef CONFIG_OF | ||
118 | static int __devinit pm860x_touch_dt_init(struct platform_device *pdev, | ||
119 | struct pm860x_chip *chip, | ||
120 | int *res_x) | ||
121 | { | ||
122 | struct device_node *np = pdev->dev.parent->of_node; | ||
123 | struct i2c_client *i2c = (chip->id == CHIP_PM8607) ? chip->client \ | ||
124 | : chip->companion; | ||
125 | int data, n, ret; | ||
126 | if (!np) | ||
127 | return -ENODEV; | ||
128 | np = of_find_node_by_name(np, "touch"); | ||
129 | if (!np) { | ||
130 | dev_err(&pdev->dev, "Can't find touch node\n"); | ||
131 | return -EINVAL; | ||
132 | } | ||
133 | /* set GPADC MISC1 register */ | ||
134 | data = 0; | ||
135 | if (!of_property_read_u32(np, "marvell,88pm860x-gpadc-prebias", &n)) | ||
136 | data |= (n << 1) & PM8607_GPADC_PREBIAS_MASK; | ||
137 | if (!of_property_read_u32(np, "marvell,88pm860x-gpadc-slot-cycle", &n)) | ||
138 | data |= (n << 3) & PM8607_GPADC_SLOT_CYCLE_MASK; | ||
139 | if (!of_property_read_u32(np, "marvell,88pm860x-gpadc-off-scale", &n)) | ||
140 | data |= (n << 5) & PM8607_GPADC_OFF_SCALE_MASK; | ||
141 | if (!of_property_read_u32(np, "marvell,88pm860x-gpadc-sw-cal", &n)) | ||
142 | data |= (n << 7) & PM8607_GPADC_SW_CAL_MASK; | ||
143 | if (data) { | ||
144 | ret = pm860x_reg_write(i2c, PM8607_GPADC_MISC1, data); | ||
145 | if (ret < 0) | ||
146 | return -EINVAL; | ||
147 | } | ||
148 | /* set tsi prebias time */ | ||
149 | if (!of_property_read_u32(np, "marvell,88pm860x-tsi-prebias", &data)) { | ||
150 | ret = pm860x_reg_write(i2c, PM8607_TSI_PREBIAS, data); | ||
151 | if (ret < 0) | ||
152 | return -EINVAL; | ||
153 | } | ||
154 | /* set prebias & prechg time of pen detect */ | ||
155 | data = 0; | ||
156 | if (!of_property_read_u32(np, "marvell,88pm860x-pen-prebias", &n)) | ||
157 | data |= n & PM8607_PD_PREBIAS_MASK; | ||
158 | if (!of_property_read_u32(np, "marvell,88pm860x-pen-prechg", &n)) | ||
159 | data |= n & PM8607_PD_PRECHG_MASK; | ||
160 | if (data) { | ||
161 | ret = pm860x_reg_write(i2c, PM8607_PD_PREBIAS, data); | ||
162 | if (ret < 0) | ||
163 | return -EINVAL; | ||
164 | } | ||
165 | of_property_read_u32(np, "marvell,88pm860x-resistor-X", res_x); | ||
166 | return 0; | ||
167 | } | ||
168 | #else | ||
169 | #define pm860x_touch_dt_init(x, y, z) (-1) | ||
170 | #endif | ||
171 | |||
116 | static int __devinit pm860x_touch_probe(struct platform_device *pdev) | 172 | static int __devinit pm860x_touch_probe(struct platform_device *pdev) |
117 | { | 173 | { |
118 | struct pm860x_chip *chip = dev_get_drvdata(pdev->dev.parent); | 174 | struct pm860x_chip *chip = dev_get_drvdata(pdev->dev.parent); |
119 | struct pm860x_platform_data *pm860x_pdata = \ | 175 | struct pm860x_touch_pdata *pdata = pdev->dev.platform_data; |
120 | pdev->dev.parent->platform_data; | ||
121 | struct pm860x_touch_pdata *pdata = NULL; | ||
122 | struct pm860x_touch *touch; | 176 | struct pm860x_touch *touch; |
123 | int irq, ret; | 177 | struct i2c_client *i2c = (chip->id == CHIP_PM8607) ? chip->client \ |
178 | : chip->companion; | ||
179 | int irq, ret, res_x = 0, data = 0; | ||
124 | 180 | ||
125 | irq = platform_get_irq(pdev, 0); | 181 | irq = platform_get_irq(pdev, 0); |
126 | if (irq < 0) { | 182 | if (irq < 0) { |
@@ -128,16 +184,55 @@ static int __devinit pm860x_touch_probe(struct platform_device *pdev) | |||
128 | return -EINVAL; | 184 | return -EINVAL; |
129 | } | 185 | } |
130 | 186 | ||
131 | if (!pm860x_pdata) { | 187 | if (pm860x_touch_dt_init(pdev, chip, &res_x)) { |
132 | dev_err(&pdev->dev, "platform data is missing\n"); | 188 | if (pdata) { |
133 | return -EINVAL; | 189 | /* set GPADC MISC1 register */ |
134 | } | 190 | data = 0; |
135 | 191 | data |= (pdata->gpadc_prebias << 1) | |
136 | pdata = pm860x_pdata->touch; | 192 | & PM8607_GPADC_PREBIAS_MASK; |
137 | if (!pdata) { | 193 | data |= (pdata->slot_cycle << 3) |
138 | dev_err(&pdev->dev, "touchscreen data is missing\n"); | 194 | & PM8607_GPADC_SLOT_CYCLE_MASK; |
139 | return -EINVAL; | 195 | data |= (pdata->off_scale << 5) |
196 | & PM8607_GPADC_OFF_SCALE_MASK; | ||
197 | data |= (pdata->sw_cal << 7) | ||
198 | & PM8607_GPADC_SW_CAL_MASK; | ||
199 | if (data) { | ||
200 | ret = pm860x_reg_write(i2c, | ||
201 | PM8607_GPADC_MISC1, data); | ||
202 | if (ret < 0) | ||
203 | return -EINVAL; | ||
204 | } | ||
205 | /* set tsi prebias time */ | ||
206 | if (pdata->tsi_prebias) { | ||
207 | data = pdata->tsi_prebias; | ||
208 | ret = pm860x_reg_write(i2c, | ||
209 | PM8607_TSI_PREBIAS, data); | ||
210 | if (ret < 0) | ||
211 | return -EINVAL; | ||
212 | } | ||
213 | /* set prebias & prechg time of pen detect */ | ||
214 | data = 0; | ||
215 | data |= pdata->pen_prebias | ||
216 | & PM8607_PD_PREBIAS_MASK; | ||
217 | data |= (pdata->pen_prechg << 5) | ||
218 | & PM8607_PD_PRECHG_MASK; | ||
219 | if (data) { | ||
220 | ret = pm860x_reg_write(i2c, | ||
221 | PM8607_PD_PREBIAS, data); | ||
222 | if (ret < 0) | ||
223 | return -EINVAL; | ||
224 | } | ||
225 | res_x = pdata->res_x; | ||
226 | } else { | ||
227 | dev_err(&pdev->dev, "failed to get platform data\n"); | ||
228 | return -EINVAL; | ||
229 | } | ||
140 | } | 230 | } |
231 | /* enable GPADC */ | ||
232 | ret = pm860x_set_bits(i2c, PM8607_GPADC_MISC1, PM8607_GPADC_EN, | ||
233 | PM8607_GPADC_EN); | ||
234 | if (ret) | ||
235 | return ret; | ||
141 | 236 | ||
142 | touch = kzalloc(sizeof(struct pm860x_touch), GFP_KERNEL); | 237 | touch = kzalloc(sizeof(struct pm860x_touch), GFP_KERNEL); |
143 | if (touch == NULL) | 238 | if (touch == NULL) |
@@ -158,9 +253,9 @@ static int __devinit pm860x_touch_probe(struct platform_device *pdev) | |||
158 | touch->idev->open = pm860x_touch_open; | 253 | touch->idev->open = pm860x_touch_open; |
159 | touch->idev->close = pm860x_touch_close; | 254 | touch->idev->close = pm860x_touch_close; |
160 | touch->chip = chip; | 255 | touch->chip = chip; |
161 | touch->i2c = (chip->id == CHIP_PM8607) ? chip->client : chip->companion; | 256 | touch->i2c = i2c; |
162 | touch->irq = irq + chip->irq_base; | 257 | touch->irq = irq; |
163 | touch->res_x = pdata->res_x; | 258 | touch->res_x = res_x; |
164 | input_set_drvdata(touch->idev, touch); | 259 | input_set_drvdata(touch->idev, touch); |
165 | 260 | ||
166 | ret = request_threaded_irq(touch->irq, NULL, pm860x_touch_handler, | 261 | ret = request_threaded_irq(touch->irq, NULL, pm860x_touch_handler, |