diff options
| -rw-r--r-- | drivers/mfd/asic3.c | 4 | ||||
| -rw-r--r-- | drivers/mfd/davinci_voicecodec.c | 4 | ||||
| -rw-r--r-- | drivers/mfd/tps6586x.c | 10 | ||||
| -rw-r--r-- | drivers/mfd/ucb1x00-ts.c | 12 | ||||
| -rw-r--r-- | drivers/mfd/wm8994-core.c | 18 | ||||
| -rw-r--r-- | include/linux/mfd/wm8994/core.h | 1 |
6 files changed, 37 insertions, 12 deletions
diff --git a/drivers/mfd/asic3.c b/drivers/mfd/asic3.c index 6a1f94042612..c45e6305b26f 100644 --- a/drivers/mfd/asic3.c +++ b/drivers/mfd/asic3.c | |||
| @@ -143,9 +143,9 @@ static void asic3_irq_demux(unsigned int irq, struct irq_desc *desc) | |||
| 143 | unsigned long flags; | 143 | unsigned long flags; |
| 144 | struct asic3 *asic; | 144 | struct asic3 *asic; |
| 145 | 145 | ||
| 146 | desc->chip->ack(irq); | 146 | desc->irq_data.chip->irq_ack(&desc->irq_data); |
| 147 | 147 | ||
| 148 | asic = desc->handler_data; | 148 | asic = get_irq_data(irq); |
| 149 | 149 | ||
| 150 | for (iter = 0 ; iter < MAX_ASIC_ISR_LOOPS; iter++) { | 150 | for (iter = 0 ; iter < MAX_ASIC_ISR_LOOPS; iter++) { |
| 151 | u32 status; | 151 | u32 status; |
diff --git a/drivers/mfd/davinci_voicecodec.c b/drivers/mfd/davinci_voicecodec.c index 33c923d215c7..fdd8a1b8bc67 100644 --- a/drivers/mfd/davinci_voicecodec.c +++ b/drivers/mfd/davinci_voicecodec.c | |||
| @@ -118,12 +118,12 @@ static int __init davinci_vc_probe(struct platform_device *pdev) | |||
| 118 | 118 | ||
| 119 | /* Voice codec interface client */ | 119 | /* Voice codec interface client */ |
| 120 | cell = &davinci_vc->cells[DAVINCI_VC_VCIF_CELL]; | 120 | cell = &davinci_vc->cells[DAVINCI_VC_VCIF_CELL]; |
| 121 | cell->name = "davinci_vcif"; | 121 | cell->name = "davinci-vcif"; |
| 122 | cell->driver_data = davinci_vc; | 122 | cell->driver_data = davinci_vc; |
| 123 | 123 | ||
| 124 | /* Voice codec CQ93VC client */ | 124 | /* Voice codec CQ93VC client */ |
| 125 | cell = &davinci_vc->cells[DAVINCI_VC_CQ93VC_CELL]; | 125 | cell = &davinci_vc->cells[DAVINCI_VC_CQ93VC_CELL]; |
| 126 | cell->name = "cq93vc"; | 126 | cell->name = "cq93vc-codec"; |
| 127 | cell->driver_data = davinci_vc; | 127 | cell->driver_data = davinci_vc; |
| 128 | 128 | ||
| 129 | ret = mfd_add_devices(&pdev->dev, pdev->id, davinci_vc->cells, | 129 | ret = mfd_add_devices(&pdev->dev, pdev->id, davinci_vc->cells, |
diff --git a/drivers/mfd/tps6586x.c b/drivers/mfd/tps6586x.c index 627cf577b16d..e9018d1394ee 100644 --- a/drivers/mfd/tps6586x.c +++ b/drivers/mfd/tps6586x.c | |||
| @@ -150,12 +150,12 @@ static inline int __tps6586x_write(struct i2c_client *client, | |||
| 150 | static inline int __tps6586x_writes(struct i2c_client *client, int reg, | 150 | static inline int __tps6586x_writes(struct i2c_client *client, int reg, |
| 151 | int len, uint8_t *val) | 151 | int len, uint8_t *val) |
| 152 | { | 152 | { |
| 153 | int ret; | 153 | int ret, i; |
| 154 | 154 | ||
| 155 | ret = i2c_smbus_write_i2c_block_data(client, reg, len, val); | 155 | for (i = 0; i < len; i++) { |
| 156 | if (ret < 0) { | 156 | ret = __tps6586x_write(client, reg + i, *(val + i)); |
| 157 | dev_err(&client->dev, "failed writings to 0x%02x\n", reg); | 157 | if (ret < 0) |
| 158 | return ret; | 158 | return ret; |
| 159 | } | 159 | } |
| 160 | 160 | ||
| 161 | return 0; | 161 | return 0; |
diff --git a/drivers/mfd/ucb1x00-ts.c b/drivers/mfd/ucb1x00-ts.c index 000cb414a78a..92b85e28a15e 100644 --- a/drivers/mfd/ucb1x00-ts.c +++ b/drivers/mfd/ucb1x00-ts.c | |||
| @@ -385,12 +385,18 @@ static int ucb1x00_ts_add(struct ucb1x00_dev *dev) | |||
| 385 | idev->close = ucb1x00_ts_close; | 385 | idev->close = ucb1x00_ts_close; |
| 386 | 386 | ||
| 387 | __set_bit(EV_ABS, idev->evbit); | 387 | __set_bit(EV_ABS, idev->evbit); |
| 388 | __set_bit(ABS_X, idev->absbit); | ||
| 389 | __set_bit(ABS_Y, idev->absbit); | ||
| 390 | __set_bit(ABS_PRESSURE, idev->absbit); | ||
| 391 | 388 | ||
| 392 | input_set_drvdata(idev, ts); | 389 | input_set_drvdata(idev, ts); |
| 393 | 390 | ||
| 391 | ucb1x00_adc_enable(ts->ucb); | ||
| 392 | ts->x_res = ucb1x00_ts_read_xres(ts); | ||
| 393 | ts->y_res = ucb1x00_ts_read_yres(ts); | ||
| 394 | ucb1x00_adc_disable(ts->ucb); | ||
| 395 | |||
| 396 | input_set_abs_params(idev, ABS_X, 0, ts->x_res, 0, 0); | ||
| 397 | input_set_abs_params(idev, ABS_Y, 0, ts->y_res, 0, 0); | ||
| 398 | input_set_abs_params(idev, ABS_PRESSURE, 0, 0, 0, 0); | ||
| 399 | |||
| 394 | err = input_register_device(idev); | 400 | err = input_register_device(idev); |
| 395 | if (err) | 401 | if (err) |
| 396 | goto fail; | 402 | goto fail; |
diff --git a/drivers/mfd/wm8994-core.c b/drivers/mfd/wm8994-core.c index 41233c7fa581..f4016a075fd6 100644 --- a/drivers/mfd/wm8994-core.c +++ b/drivers/mfd/wm8994-core.c | |||
| @@ -246,6 +246,16 @@ static int wm8994_suspend(struct device *dev) | |||
| 246 | struct wm8994 *wm8994 = dev_get_drvdata(dev); | 246 | struct wm8994 *wm8994 = dev_get_drvdata(dev); |
| 247 | int ret; | 247 | int ret; |
| 248 | 248 | ||
| 249 | /* Don't actually go through with the suspend if the CODEC is | ||
| 250 | * still active (eg, for audio passthrough from CP. */ | ||
| 251 | ret = wm8994_reg_read(wm8994, WM8994_POWER_MANAGEMENT_1); | ||
| 252 | if (ret < 0) { | ||
| 253 | dev_err(dev, "Failed to read power status: %d\n", ret); | ||
| 254 | } else if (ret & WM8994_VMID_SEL_MASK) { | ||
| 255 | dev_dbg(dev, "CODEC still active, ignoring suspend\n"); | ||
| 256 | return 0; | ||
| 257 | } | ||
| 258 | |||
| 249 | /* GPIO configuration state is saved here since we may be configuring | 259 | /* GPIO configuration state is saved here since we may be configuring |
| 250 | * the GPIO alternate functions even if we're not using the gpiolib | 260 | * the GPIO alternate functions even if we're not using the gpiolib |
| 251 | * driver for them. | 261 | * driver for them. |
| @@ -261,6 +271,8 @@ static int wm8994_suspend(struct device *dev) | |||
| 261 | if (ret < 0) | 271 | if (ret < 0) |
| 262 | dev_err(dev, "Failed to save LDO registers: %d\n", ret); | 272 | dev_err(dev, "Failed to save LDO registers: %d\n", ret); |
| 263 | 273 | ||
| 274 | wm8994->suspended = true; | ||
| 275 | |||
| 264 | ret = regulator_bulk_disable(wm8994->num_supplies, | 276 | ret = regulator_bulk_disable(wm8994->num_supplies, |
| 265 | wm8994->supplies); | 277 | wm8994->supplies); |
| 266 | if (ret != 0) { | 278 | if (ret != 0) { |
| @@ -276,6 +288,10 @@ static int wm8994_resume(struct device *dev) | |||
| 276 | struct wm8994 *wm8994 = dev_get_drvdata(dev); | 288 | struct wm8994 *wm8994 = dev_get_drvdata(dev); |
| 277 | int ret; | 289 | int ret; |
| 278 | 290 | ||
| 291 | /* We may have lied to the PM core about suspending */ | ||
| 292 | if (!wm8994->suspended) | ||
| 293 | return 0; | ||
| 294 | |||
| 279 | ret = regulator_bulk_enable(wm8994->num_supplies, | 295 | ret = regulator_bulk_enable(wm8994->num_supplies, |
| 280 | wm8994->supplies); | 296 | wm8994->supplies); |
| 281 | if (ret != 0) { | 297 | if (ret != 0) { |
| @@ -298,6 +314,8 @@ static int wm8994_resume(struct device *dev) | |||
| 298 | if (ret < 0) | 314 | if (ret < 0) |
| 299 | dev_err(dev, "Failed to restore GPIO registers: %d\n", ret); | 315 | dev_err(dev, "Failed to restore GPIO registers: %d\n", ret); |
| 300 | 316 | ||
| 317 | wm8994->suspended = false; | ||
| 318 | |||
| 301 | return 0; | 319 | return 0; |
| 302 | } | 320 | } |
| 303 | #endif | 321 | #endif |
diff --git a/include/linux/mfd/wm8994/core.h b/include/linux/mfd/wm8994/core.h index 3fd36845ca45..ef4f0b6083a3 100644 --- a/include/linux/mfd/wm8994/core.h +++ b/include/linux/mfd/wm8994/core.h | |||
| @@ -71,6 +71,7 @@ struct wm8994 { | |||
| 71 | u16 irq_masks_cache[WM8994_NUM_IRQ_REGS]; | 71 | u16 irq_masks_cache[WM8994_NUM_IRQ_REGS]; |
| 72 | 72 | ||
| 73 | /* Used over suspend/resume */ | 73 | /* Used over suspend/resume */ |
| 74 | bool suspended; | ||
| 74 | u16 ldo_regs[WM8994_NUM_LDO_REGS]; | 75 | u16 ldo_regs[WM8994_NUM_LDO_REGS]; |
| 75 | u16 gpio_regs[WM8994_NUM_GPIO_REGS]; | 76 | u16 gpio_regs[WM8994_NUM_GPIO_REGS]; |
| 76 | 77 | ||
