[PATCH 2/3] Adapt existing drivers to TWL4030 power IRQs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patch adapts the existing drivers to the TWL4030 power IRQ implementation


Signed-off-by: Peter 'p2' De Schrijver <peter.de-schrijver@xxxxxxxxx>
---
 drivers/i2c/chips/twl4030_usb.c |    5 ++---
 drivers/rtc/rtc-twl4030.c       |   17 ++---------------
 2 files changed, 4 insertions(+), 18 deletions(-)

diff --git a/drivers/i2c/chips/twl4030_usb.c b/drivers/i2c/chips/twl4030_usb.c
index b3365f6..4674781 100644
--- a/drivers/i2c/chips/twl4030_usb.c
+++ b/drivers/i2c/chips/twl4030_usb.c
@@ -622,11 +622,10 @@ static int __init twl4030_usb_init(void)
 
 	the_transceiver = twl;
 
-	twl->irq = TWL4030_MODIRQ_PWR;
+	twl->irq = TWL4030_PWRIRQ_USB_PRES;
 
 	usb_irq_disable();
-	status = request_irq(twl->irq, twl4030_usb_irq,
-		IRQF_DISABLED | IRQF_SHARED, "twl4030_usb", twl);
+	status = request_irq(twl->irq, twl4030_usb_irq, 0, "twl4030_usb", twl);
 	if (status < 0) {
 		printk(KERN_DEBUG "can't get IRQ %d, err %d\n",
 			twl->irq, status);
diff --git a/drivers/rtc/rtc-twl4030.c b/drivers/rtc/rtc-twl4030.c
index b50de5f..0a2d04b 100644
--- a/drivers/rtc/rtc-twl4030.c
+++ b/drivers/rtc/rtc-twl4030.c
@@ -426,19 +426,6 @@ static irqreturn_t twl4030_rtc_interrupt(int irq, void *rtc)
 	int res;
 	u8 rd_reg;
 	
-	/* clear the RTC interrupt in TWL4030 power module */
-	res = twl4030_i2c_read_u8(TWL4030_MODULE_INT, &rd_reg, REG_PWR_ISR1);
-	if (res)
-		goto out;
-
-	/* Check if interrupt is sourced by RTC */
-	if (!(rd_reg & PWR_RTC_INT_CLR))
-		goto out;
-
-	res = twl4030_i2c_write_u8(TWL4030_MODULE_INT, PWR_RTC_INT_CLR, REG_PWR_ISR1);
-	if (res)
-		goto out;
-
 	res = twl4030_rtc_read_u8(&rd_reg, REG_RTC_STATUS_REG);
 	if (res)
 		goto out;
@@ -528,8 +515,8 @@ static int __devinit twl4030_rtc_probe(struct platform_device *pdev)
 	if (ret < 0)
 		goto out1;
 
-	ret = request_irq(TWL4030_MODIRQ_PWR, twl4030_rtc_interrupt,
-			  IRQF_DISABLED | IRQF_SHARED, rtc->dev.bus_id, rtc);
+	ret = request_irq(TWL4030_PWRIRQ_RTC, twl4030_rtc_interrupt,
+				0, rtc->dev.bus_id, rtc);
 	if (ret < 0) {
 		dev_err(&pdev->dev, "IRQ is not free.\n");
 		goto out1;

diff --git a/drivers/i2c/chips/twl4030_usb.c b/drivers/i2c/chips/twl4030_usb.c
index 4674781..2b1bf43 100644
--- a/drivers/i2c/chips/twl4030_usb.c
+++ b/drivers/i2c/chips/twl4030_usb.c
@@ -481,19 +481,6 @@ static irqreturn_t twl4030_usb_irq(int irq, void *_twl)
 	int ret = IRQ_NONE;
 	u8 val;
 
-	if (twl4030_i2c_read_u8(TWL4030_MODULE_INT, &val, REG_PWR_ISR1) < 0) {
-		printk(KERN_ERR "twl4030_usb: i2c read failed,"
-				" line %d\n", __LINE__);
-		goto done;
-	}
-
-	/* this interrupt line may be shared */
-	if (!(val & USB_PRES))
-		goto done;
-
-	/* clear the interrupt */
-	twl4030_i2c_write_u8(TWL4030_MODULE_INT, USB_PRES, REG_PWR_ISR1);
-
 	/* action based on cable attach or detach */
 	if (twl4030_i2c_read_u8(TWL4030_MODULE_INT, &val, REG_PWR_EDR1) < 0) {
 		printk(KERN_ERR "twl4030_usb: i2c read failed,"
-- 
1.5.3.4

-- 
goa is a state of mind
-
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux