From 6eb300d28fd2622e8135d3b3af9dd3b6c2a772a1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E5=BC=A0=E6=99=B4?= Date: Sat, 11 Aug 2012 10:05:07 +0800 Subject: [PATCH] rk30:phone:Solve the power button interrupt failure --- arch/arm/mach-rk30/board-rk30-phone-twl60xx.c | 10 ++++++---- drivers/mfd/twl6030-irq.c | 6 ++++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/arch/arm/mach-rk30/board-rk30-phone-twl60xx.c b/arch/arm/mach-rk30/board-rk30-phone-twl60xx.c index aa12cf7d7015..e4b54ef1577a 100755 --- a/arch/arm/mach-rk30/board-rk30-phone-twl60xx.c +++ b/arch/arm/mach-rk30/board-rk30-phone-twl60xx.c @@ -743,14 +743,16 @@ static struct twl4030_power_data tps80032_scripts_data __initdata = { void twl60xx_pmu_early_suspend(struct regulator_dev *rdev) { printk("%s\n", __func__); - - twl_reg_write(REG_INT_MSK_STS_A,TWL_MODULE_PIH, 0x00); //open vlow interrupt + int ret; + ret = twl_reg_read(REG_INT_MSK_STS_A,TWL_MODULE_PIH); + twl_reg_write(REG_INT_MSK_STS_A,TWL_MODULE_PIH, ret & (~(1 << 2))); //open vlow interrupt } void twl60xx_pmu_early_resume(struct regulator_dev *rdev) { printk("%s\n", __func__); - - twl_reg_write(REG_INT_MSK_STS_A,TWL_MODULE_PIH, 0x04); //close vlow interrupt + int ret; + ret = twl_reg_read(REG_INT_MSK_STS_A,TWL_MODULE_PIH); + twl_reg_write(REG_INT_MSK_STS_A,TWL_MODULE_PIH, ret |(1 << 2)); //close vlow interrupt } #else void twl60xx_pmu_early_suspend(struct regulator_dev *rdev) diff --git a/drivers/mfd/twl6030-irq.c b/drivers/mfd/twl6030-irq.c index 4d306b6273d0..36688ed208b1 100755 --- a/drivers/mfd/twl6030-irq.c +++ b/drivers/mfd/twl6030-irq.c @@ -496,6 +496,7 @@ int twl6030_init_irq(int irq_num, unsigned irq_base, unsigned irq_end, int i; int ret; u8 mask[4]; + u8 reg; static struct irq_chip twl6030_irq_chip; @@ -556,8 +557,9 @@ int twl6030_init_irq(int irq_num, unsigned irq_base, unsigned irq_end, status = twl6030_vlow_init(twl6030_irq_base + TWL_VLOW_INTR_OFFSET); if (status < 0) goto fail_vlow; - - twl_i2c_write_u8(TWL_MODULE_PIH, 0x04,REG_INT_MSK_STS_A); //close vlow interrupt + + twl_i2c_write_u8(TWL_MODULE_PIH, ®,REG_INT_MSK_STS_A); + twl_i2c_write_u8(TWL_MODULE_PIH, reg | (1 << 2),REG_INT_MSK_STS_A); //close vlow interrupt return status; -- 2.34.1