r1629 - trunk/src/target/kernel/patches

laforge at sita.openmoko.org laforge at sita.openmoko.org
Mon Apr 2 19:34:26 CEST 2007


Author: laforge
Date: 2007-04-02 19:34:25 +0200 (Mon, 02 Apr 2007)
New Revision: 1629

Modified:
   trunk/src/target/kernel/patches/gta01-pcf50606.patch
Log:
* resolve mutex deadlock in suspend path
* disable interrupt until we've been scheduled to serve last one
* make sure we cannot disable IOREG, since that powers PCF50606 I2C interface


Modified: trunk/src/target/kernel/patches/gta01-pcf50606.patch
===================================================================
--- trunk/src/target/kernel/patches/gta01-pcf50606.patch	2007-04-02 16:46:49 UTC (rev 1628)
+++ trunk/src/target/kernel/patches/gta01-pcf50606.patch	2007-04-02 17:34:25 UTC (rev 1629)
@@ -3,8 +3,8 @@
 Index: linux-2.6.20.4/drivers/i2c/chips/pcf50606.c
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.20.4/drivers/i2c/chips/pcf50606.c	2007-04-01 13:09:02.000000000 +0200
-@@ -0,0 +1,1896 @@
++++ linux-2.6.20.4/drivers/i2c/chips/pcf50606.c	2007-04-02 19:12:27.000000000 +0200
+@@ -0,0 +1,1921 @@
 +/* Philips PCF50606 Power Management Unit (PMU) driver
 + *
 + * (C) 2006 by OpenMoko, Inc.
@@ -106,6 +106,7 @@
 +	struct input_dev *input_dev;
 +	int allow_close;
 +	int onkey_seconds;
++	int irq;
 +#ifdef CONFIG_PM
 +	struct {
 +		u_int8_t dcdc1, dcdc2;
@@ -371,6 +372,10 @@
 +	if (reg >= __NUM_PCF50606_REGULATORS)
 +		return -EINVAL;
 +
++	/* IOREG cannot be powered off since it powers the PMU I2C */
++	if (reg == PCF50606_REGULATOR_IOREG)
++		return -EIO;
++
 +	addr = regulator_registers[reg];
 +
 +	if (on == 0)
@@ -731,6 +736,8 @@
 +	pcf->working = 0;
 +	input_sync(pcf->input_dev);
 +	put_device(&pcf->client.dev);
++
++	enable_irq(pcf->irq);
 +}
 +
 +static void pcf50606_schedule_work(struct pcf50606_data *pcf)
@@ -752,6 +759,10 @@
 +		irq, _pcf);
 +	pcf50606_schedule_work(pcf);
 +
++	/* Disable any further interrupts until we have processed
++	 * the current one */
++	disable_irq(irq);
++
 +	return IRQ_HANDLED;
 +}
 +
@@ -1576,6 +1587,7 @@
 +
 +	mutex_init(&data->lock);
 +	INIT_WORK(&data->work, pcf50606_work);
++	data->irq = irq;
 +	data->working = 0;
 +	data->onkey_seconds = -1;
 +	data->pdata = pcf50606_pdev->dev.platform_data;
@@ -1792,8 +1804,21 @@
 +
 +	/* switch off power supplies that are not needed during suspend */
 +	for (i = 0; i < __NUM_PCF50606_REGULATORS; i++) {
-+		if (!(pcf->pdata->rails[i].flags & PMU_VRAIL_F_SUSPEND_ON))
-+			pcf50606_onoff_set(pcf, i, 0);
++		if (!(pcf->pdata->rails[i].flags & PMU_VRAIL_F_SUSPEND_ON)) {
++			u_int8_t tmp;
++
++			/* IOREG powers the I at C interface so we cannot switch
++			 * it off */
++			if (i == PCF50606_REGULATOR_IOREG)
++				continue;
++
++			DEBUGP("disabling pcf50606 regulator %u\n", i);
++			/* we cannot use pcf50606_onoff_set() because we're
++			 * already under the mutex */
++			tmp = __reg_read(pcf, regulator_registers[i]);
++			tmp &= 0x1f;
++			__reg_write(pcf, regulator_registers[i], tmp);
++		}
 +	}
 +
 +	pcf->standby_regs.int1m = __reg_read(pcf, PCF50606_REG_INT1M);





More information about the commitlog mailing list