Changeset 1629
- Timestamp:
- 04/02/07 19:34:25 (3 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/target/kernel/patches/gta01-pcf50606.patch
r1598 r1629 4 4 =================================================================== 5 5 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 6 +++ linux-2.6.20.4/drivers/i2c/chips/pcf50606.c 2007-04-0 1 13:09:02.000000000 +02007 @@ -0,0 +1,1 896@@6 +++ linux-2.6.20.4/drivers/i2c/chips/pcf50606.c 2007-04-02 19:12:27.000000000 +0200 7 @@ -0,0 +1,1921 @@ 8 8 +/* Philips PCF50606 Power Management Unit (PMU) driver 9 9 + * … … 107 107 + int allow_close; 108 108 + int onkey_seconds; 109 + int irq; 109 110 +#ifdef CONFIG_PM 110 111 + struct { … … 371 372 + if (reg >= __NUM_PCF50606_REGULATORS) 372 373 + return -EINVAL; 374 + 375 + /* IOREG cannot be powered off since it powers the PMU I2C */ 376 + if (reg == PCF50606_REGULATOR_IOREG) 377 + return -EIO; 373 378 + 374 379 + addr = regulator_registers[reg]; … … 732 737 + input_sync(pcf->input_dev); 733 738 + put_device(&pcf->client.dev); 739 + 740 + enable_irq(pcf->irq); 734 741 +} 735 742 + … … 752 759 + irq, _pcf); 753 760 + pcf50606_schedule_work(pcf); 761 + 762 + /* Disable any further interrupts until we have processed 763 + * the current one */ 764 + disable_irq(irq); 754 765 + 755 766 + return IRQ_HANDLED; … … 1577 1588 + mutex_init(&data->lock); 1578 1589 + INIT_WORK(&data->work, pcf50606_work); 1590 + data->irq = irq; 1579 1591 + data->working = 0; 1580 1592 + data->onkey_seconds = -1; … … 1793 1805 + /* switch off power supplies that are not needed during suspend */ 1794 1806 + for (i = 0; i < __NUM_PCF50606_REGULATORS; i++) { 1795 + if (!(pcf->pdata->rails[i].flags & PMU_VRAIL_F_SUSPEND_ON)) 1796 + pcf50606_onoff_set(pcf, i, 0); 1807 + if (!(pcf->pdata->rails[i].flags & PMU_VRAIL_F_SUSPEND_ON)) { 1808 + u_int8_t tmp; 1809 + 1810 + /* IOREG powers the I@C interface so we cannot switch 1811 + * it off */ 1812 + if (i == PCF50606_REGULATOR_IOREG) 1813 + continue; 1814 + 1815 + DEBUGP("disabling pcf50606 regulator %u\n", i); 1816 + /* we cannot use pcf50606_onoff_set() because we're 1817 + * already under the mutex */ 1818 + tmp = __reg_read(pcf, regulator_registers[i]); 1819 + tmp &= 0x1f; 1820 + __reg_write(pcf, regulator_registers[i], tmp); 1821 + } 1797 1822 + } 1798 1823 +
