Commit 06f9a73f authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6:
  mfd: Avoid tps6586x burst writes
  mfd: Don't suspend WM8994 if the CODEC is not suspended
  mfd: Fix DaVinci voice codec device name
  mfd: Fix NULL pointer due to non-initialized ucb1x00-ts absinfo
  mfd: Fix ASIC3 build with GENERIC_HARDIRQS_NO_DEPRECATED
parents 25271d8c 4b57018d
...@@ -143,9 +143,9 @@ static void asic3_irq_demux(unsigned int irq, struct irq_desc *desc) ...@@ -143,9 +143,9 @@ static void asic3_irq_demux(unsigned int irq, struct irq_desc *desc)
unsigned long flags; unsigned long flags;
struct asic3 *asic; struct asic3 *asic;
desc->chip->ack(irq); desc->irq_data.chip->irq_ack(&desc->irq_data);
asic = desc->handler_data; asic = get_irq_data(irq);
for (iter = 0 ; iter < MAX_ASIC_ISR_LOOPS; iter++) { for (iter = 0 ; iter < MAX_ASIC_ISR_LOOPS; iter++) {
u32 status; u32 status;
......
...@@ -118,12 +118,12 @@ static int __init davinci_vc_probe(struct platform_device *pdev) ...@@ -118,12 +118,12 @@ static int __init davinci_vc_probe(struct platform_device *pdev)
/* Voice codec interface client */ /* Voice codec interface client */
cell = &davinci_vc->cells[DAVINCI_VC_VCIF_CELL]; cell = &davinci_vc->cells[DAVINCI_VC_VCIF_CELL];
cell->name = "davinci_vcif"; cell->name = "davinci-vcif";
cell->driver_data = davinci_vc; cell->driver_data = davinci_vc;
/* Voice codec CQ93VC client */ /* Voice codec CQ93VC client */
cell = &davinci_vc->cells[DAVINCI_VC_CQ93VC_CELL]; cell = &davinci_vc->cells[DAVINCI_VC_CQ93VC_CELL];
cell->name = "cq93vc"; cell->name = "cq93vc-codec";
cell->driver_data = davinci_vc; cell->driver_data = davinci_vc;
ret = mfd_add_devices(&pdev->dev, pdev->id, davinci_vc->cells, ret = mfd_add_devices(&pdev->dev, pdev->id, davinci_vc->cells,
......
...@@ -150,12 +150,12 @@ static inline int __tps6586x_write(struct i2c_client *client, ...@@ -150,12 +150,12 @@ static inline int __tps6586x_write(struct i2c_client *client,
static inline int __tps6586x_writes(struct i2c_client *client, int reg, static inline int __tps6586x_writes(struct i2c_client *client, int reg,
int len, uint8_t *val) int len, uint8_t *val)
{ {
int ret; int ret, i;
ret = i2c_smbus_write_i2c_block_data(client, reg, len, val); for (i = 0; i < len; i++) {
if (ret < 0) { ret = __tps6586x_write(client, reg + i, *(val + i));
dev_err(&client->dev, "failed writings to 0x%02x\n", reg); if (ret < 0)
return ret; return ret;
} }
return 0; return 0;
......
...@@ -385,12 +385,18 @@ static int ucb1x00_ts_add(struct ucb1x00_dev *dev) ...@@ -385,12 +385,18 @@ static int ucb1x00_ts_add(struct ucb1x00_dev *dev)
idev->close = ucb1x00_ts_close; idev->close = ucb1x00_ts_close;
__set_bit(EV_ABS, idev->evbit); __set_bit(EV_ABS, idev->evbit);
__set_bit(ABS_X, idev->absbit);
__set_bit(ABS_Y, idev->absbit);
__set_bit(ABS_PRESSURE, idev->absbit);
input_set_drvdata(idev, ts); input_set_drvdata(idev, ts);
ucb1x00_adc_enable(ts->ucb);
ts->x_res = ucb1x00_ts_read_xres(ts);
ts->y_res = ucb1x00_ts_read_yres(ts);
ucb1x00_adc_disable(ts->ucb);
input_set_abs_params(idev, ABS_X, 0, ts->x_res, 0, 0);
input_set_abs_params(idev, ABS_Y, 0, ts->y_res, 0, 0);
input_set_abs_params(idev, ABS_PRESSURE, 0, 0, 0, 0);
err = input_register_device(idev); err = input_register_device(idev);
if (err) if (err)
goto fail; goto fail;
......
...@@ -246,6 +246,16 @@ static int wm8994_suspend(struct device *dev) ...@@ -246,6 +246,16 @@ static int wm8994_suspend(struct device *dev)
struct wm8994 *wm8994 = dev_get_drvdata(dev); struct wm8994 *wm8994 = dev_get_drvdata(dev);
int ret; int ret;
/* Don't actually go through with the suspend if the CODEC is
* still active (eg, for audio passthrough from CP. */
ret = wm8994_reg_read(wm8994, WM8994_POWER_MANAGEMENT_1);
if (ret < 0) {
dev_err(dev, "Failed to read power status: %d\n", ret);
} else if (ret & WM8994_VMID_SEL_MASK) {
dev_dbg(dev, "CODEC still active, ignoring suspend\n");
return 0;
}
/* GPIO configuration state is saved here since we may be configuring /* GPIO configuration state is saved here since we may be configuring
* the GPIO alternate functions even if we're not using the gpiolib * the GPIO alternate functions even if we're not using the gpiolib
* driver for them. * driver for them.
...@@ -261,6 +271,8 @@ static int wm8994_suspend(struct device *dev) ...@@ -261,6 +271,8 @@ static int wm8994_suspend(struct device *dev)
if (ret < 0) if (ret < 0)
dev_err(dev, "Failed to save LDO registers: %d\n", ret); dev_err(dev, "Failed to save LDO registers: %d\n", ret);
wm8994->suspended = true;
ret = regulator_bulk_disable(wm8994->num_supplies, ret = regulator_bulk_disable(wm8994->num_supplies,
wm8994->supplies); wm8994->supplies);
if (ret != 0) { if (ret != 0) {
...@@ -276,6 +288,10 @@ static int wm8994_resume(struct device *dev) ...@@ -276,6 +288,10 @@ static int wm8994_resume(struct device *dev)
struct wm8994 *wm8994 = dev_get_drvdata(dev); struct wm8994 *wm8994 = dev_get_drvdata(dev);
int ret; int ret;
/* We may have lied to the PM core about suspending */
if (!wm8994->suspended)
return 0;
ret = regulator_bulk_enable(wm8994->num_supplies, ret = regulator_bulk_enable(wm8994->num_supplies,
wm8994->supplies); wm8994->supplies);
if (ret != 0) { if (ret != 0) {
...@@ -298,6 +314,8 @@ static int wm8994_resume(struct device *dev) ...@@ -298,6 +314,8 @@ static int wm8994_resume(struct device *dev)
if (ret < 0) if (ret < 0)
dev_err(dev, "Failed to restore GPIO registers: %d\n", ret); dev_err(dev, "Failed to restore GPIO registers: %d\n", ret);
wm8994->suspended = false;
return 0; return 0;
} }
#endif #endif
......
...@@ -71,6 +71,7 @@ struct wm8994 { ...@@ -71,6 +71,7 @@ struct wm8994 {
u16 irq_masks_cache[WM8994_NUM_IRQ_REGS]; u16 irq_masks_cache[WM8994_NUM_IRQ_REGS];
/* Used over suspend/resume */ /* Used over suspend/resume */
bool suspended;
u16 ldo_regs[WM8994_NUM_LDO_REGS]; u16 ldo_regs[WM8994_NUM_LDO_REGS];
u16 gpio_regs[WM8994_NUM_GPIO_REGS]; u16 gpio_regs[WM8994_NUM_GPIO_REGS];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment