Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/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
  • Loading branch information
Linus Torvalds committed Mar 3, 2011
2 parents 25271d8 + 4b57018 commit 06f9a73
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 12 deletions.
4 changes: 2 additions & 2 deletions drivers/mfd/asic3.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,9 @@ static void asic3_irq_demux(unsigned int irq, struct irq_desc *desc)
unsigned long flags;
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++) {
u32 status;
Expand Down
4 changes: 2 additions & 2 deletions drivers/mfd/davinci_voicecodec.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,12 @@ static int __init davinci_vc_probe(struct platform_device *pdev)

/* Voice codec interface client */
cell = &davinci_vc->cells[DAVINCI_VC_VCIF_CELL];
cell->name = "davinci_vcif";
cell->name = "davinci-vcif";
cell->driver_data = davinci_vc;

/* Voice codec CQ93VC client */
cell = &davinci_vc->cells[DAVINCI_VC_CQ93VC_CELL];
cell->name = "cq93vc";
cell->name = "cq93vc-codec";
cell->driver_data = davinci_vc;

ret = mfd_add_devices(&pdev->dev, pdev->id, davinci_vc->cells,
Expand Down
10 changes: 5 additions & 5 deletions drivers/mfd/tps6586x.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,12 @@ static inline int __tps6586x_write(struct i2c_client *client,
static inline int __tps6586x_writes(struct i2c_client *client, int reg,
int len, uint8_t *val)
{
int ret;
int ret, i;

ret = i2c_smbus_write_i2c_block_data(client, reg, len, val);
if (ret < 0) {
dev_err(&client->dev, "failed writings to 0x%02x\n", reg);
return ret;
for (i = 0; i < len; i++) {
ret = __tps6586x_write(client, reg + i, *(val + i));
if (ret < 0)
return ret;
}

return 0;
Expand Down
12 changes: 9 additions & 3 deletions drivers/mfd/ucb1x00-ts.c
Original file line number Diff line number Diff line change
Expand Up @@ -385,12 +385,18 @@ static int ucb1x00_ts_add(struct ucb1x00_dev *dev)
idev->close = ucb1x00_ts_close;

__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);

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);
if (err)
goto fail;
Expand Down
18 changes: 18 additions & 0 deletions drivers/mfd/wm8994-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,16 @@ static int wm8994_suspend(struct device *dev)
struct wm8994 *wm8994 = dev_get_drvdata(dev);
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
* the GPIO alternate functions even if we're not using the gpiolib
* driver for them.
Expand All @@ -261,6 +271,8 @@ static int wm8994_suspend(struct device *dev)
if (ret < 0)
dev_err(dev, "Failed to save LDO registers: %d\n", ret);

wm8994->suspended = true;

ret = regulator_bulk_disable(wm8994->num_supplies,
wm8994->supplies);
if (ret != 0) {
Expand All @@ -276,6 +288,10 @@ static int wm8994_resume(struct device *dev)
struct wm8994 *wm8994 = dev_get_drvdata(dev);
int ret;

/* We may have lied to the PM core about suspending */
if (!wm8994->suspended)
return 0;

ret = regulator_bulk_enable(wm8994->num_supplies,
wm8994->supplies);
if (ret != 0) {
Expand All @@ -298,6 +314,8 @@ static int wm8994_resume(struct device *dev)
if (ret < 0)
dev_err(dev, "Failed to restore GPIO registers: %d\n", ret);

wm8994->suspended = false;

return 0;
}
#endif
Expand Down
1 change: 1 addition & 0 deletions include/linux/mfd/wm8994/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ struct wm8994 {
u16 irq_masks_cache[WM8994_NUM_IRQ_REGS];

/* Used over suspend/resume */
bool suspended;
u16 ldo_regs[WM8994_NUM_LDO_REGS];
u16 gpio_regs[WM8994_NUM_GPIO_REGS];

Expand Down

0 comments on commit 06f9a73

Please sign in to comment.