X-Git-Url: http://www.pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fi2c%2Fchips%2Ftwl4030-usb.c;h=46538ed93b2590f469f62705fedeb7aa6abbac5d;hb=8243a8a97282d3cb42e1cd4694d71276cbe2ef4c;hp=7852dca4a6dd9e2d46702422cc6e3d2597a79d50;hpb=8e3d790cd96615ea7421215a71cc666b7ce5c304;p=linux-2.6-omap-h63xx.git diff --git a/drivers/i2c/chips/twl4030-usb.c b/drivers/i2c/chips/twl4030-usb.c index 7852dca4a6d..46538ed93b2 100644 --- a/drivers/i2c/chips/twl4030-usb.c +++ b/drivers/i2c/chips/twl4030-usb.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -409,23 +410,9 @@ static void twl4030_i2c_access(struct twl4030_usb *twl, int on) } } -static void usb_irq_enable(struct twl4030_usb *twl, int rising, int falling) +static void usb_irq_enable(struct twl4030_usb *twl, int trigger) { - u8 val; - - /* FIXME use set_irq_type(...) when that (soon) works */ - - /* edge setup */ - WARN_ON(twl4030_i2c_read_u8(TWL4030_MODULE_INT, - &val, REG_PWR_EDR1) < 0); - - val &= ~(USB_PRES_RISING | USB_PRES_FALLING); - if (rising) - val = val | USB_PRES_RISING; - if (falling) - val = val | USB_PRES_FALLING; - WARN_ON(twl4030_i2c_write_u8_verify(twl, TWL4030_MODULE_INT, - val, REG_PWR_EDR1) < 0); + set_irq_type(twl->irq, trigger); if (!twl->irq_enabled) { enable_irq(twl->irq); @@ -469,7 +456,7 @@ static void twl4030_phy_suspend(struct twl4030_usb *twl, int controller_off) if (!controller_off) /* enable rising edge interrupt to detect cable attach */ - usb_irq_enable(twl, 1, 0); + usb_irq_enable(twl, IRQ_TYPE_EDGE_RISING); twl4030_phy_power(twl, 0); twl->asleep = 1; @@ -481,7 +468,7 @@ static void twl4030_phy_resume(struct twl4030_usb *twl) return; /* enable falling edge interrupt to detect cable detach */ - usb_irq_enable(twl, 0, 1); + usb_irq_enable(twl, IRQ_TYPE_EDGE_FALLING); twl4030_phy_power(twl, 1); twl4030_i2c_access(twl, 1);