tdc: reorder IRQ enable and setup some constants

parent b0bdfd58
......@@ -93,6 +93,8 @@
#define TDC_INPUT_ENABLE_FLAG BIT(7)
/* IRQ register*/
#define TDC_IRQ_REG 0xA0000
#define TDC_IRQ_STATUS_REG 0xA0004
#define TDC_IRQ_ENABLE_REG 0xA0008
#define TDC_IRQ_GNUM_CORE_0 BIT(0)
#define TDC_IRQ_GNUM_CORE_1 BIT(1)
#define TDC_IRQ_TDC_TSTAMP BIT(2)
......
......@@ -87,8 +87,6 @@ int tdc_activate_acquisition(struct spec_tdc *tdc)
return -EBUSY;
}
/* Enable IRQ */
writel(0xC, tdc->base + TDC_IRQ_REG + 0x8);
writel(TDC_CTRL_EN_ACQ, tdc->base + TDC_CTRL_REG);
return 0;
}
......
......@@ -166,7 +166,7 @@ irqreturn_t tdc_fmc_irq_handler(int irq, void *dev_id)
u32 irq_code;
/* Check the source of the interrupt */
irq_code = readl(fmc->base + TDC_IRQ_REG + 0x4);
irq_code = readl(fmc->base + TDC_IRQ_STATUS_REG);
/* Tstamp threshold or time threshold */
if((irq_code & TDC_IRQ_TDC_TSTAMP) ||
......@@ -247,6 +247,8 @@ int tdc_fmc_probe(struct fmc_device *dev)
INIT_WORK(&tdc->irq_work, tdc_fmc_irq_work);
/* Request the IRQ */
dev->op->irq_request(dev, tdc_fmc_irq_handler, "spec-tdc", IRQF_SHARED);
/* Enable IRQ */
writel(0xC, tdc->base + TDC_IRQ_ENABLE_REG); /* FIXME: define constant 0xC */
return tdc_zio_register_device(tdc);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment