Re: [PATCH 01/25] usb: Add Intel Langwell USB OTG Transceiver Drive

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

 



Hi,

On Wed, Aug 04, 2010 at 12:49:26PM +0200, ext Alan Cox wrote:
From: Hao Wu <hao.wu@xxxxxxxxx>

Signed-off-by: Alek Du <alek.du@xxxxxxxxx>
Signed-off-by: Alan Cox <alan@xxxxxxxxxxxxxxx>

missing author's SOB ?

+static irqreturn_t otg_dummy_irq(int irq, void *_dev)
+{
+       void __iomem    *reg_base = _dev;
+       u32     val;
+       u32     int_mask = 0;
+
+       val = readl(reg_base + CI_USBMODE);
+       if ((val & USBMODE_CM) != USBMODE_DEVICE)
+               return IRQ_NONE;
+
+       val = readl(reg_base + CI_USBSTS);
+       int_mask = val & INTR_DUMMY_MASK;
+
+       if (int_mask == 0)
+               return IRQ_NONE;
+
+       /* clear hsm.b_conn here since host driver can't detect it
+       *  otg_dummy_irq called means B-disconnect happened.
+       */
+       if (the_transceiver->hsm.b_conn) {
+               the_transceiver->hsm.b_conn = 0;
+               if (spin_trylock(&the_transceiver->wq_lock)) {
+                       queue_work(the_transceiver->qwork,
+                               &the_transceiver->work);
+                       spin_unlock(&the_transceiver->wq_lock);
+               }
+       }
+       /* Clear interrupts */
+       writel(int_mask, reg_base + CI_USBSTS);
+       return IRQ_HANDLED;
+}

would it make sense to, instead, use threaded_irq here ? then instead of a queue_work() you would return IRQ_WAKE_THREAD ?

--
balbi

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


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux