tdc: add metadata masks

Signed-off-by: Samuel Iglesias Gonsálvez's avatarSamuel Iglesias Gonsálvez <siglesias@igalia.com>
parent 63e85777
......@@ -103,10 +103,13 @@
#define TDC_MEZZANINE_1WIRE 0x80000
/* Constants */
#define TDC_CHAN_NUMBER 5
#define TDC_CHAN_NUMBER 5
#define TDC_EVENT_BUFFER_SIZE 256
#define TDC_EVENT_CHANNEL_MASK 0x3
#define TDC_EVENT_DACAPO_FLAG BIT(0)
#define TDC_EVENT_BUFFER_SIZE 256
#define TDC_EVENT_CHANNEL_MASK 0xF
#define TDC_EVENT_SLOPE_MASK 0xF0
#define TDC_EVENT_FIFO_LF_MASK 0xF00
#define TDC_EVENT_FIFO_EF_MASK 0xF000
#define TDC_EVENT_DACAPO_FLAG BIT(0)
#endif /* __TDC_REGISTERS_H */
......@@ -137,10 +137,9 @@ static void tdc_fmc_irq_work(struct work_struct *work)
for ( ; count > 0; count--) {
tmp_data = &events[rd_ptr];
/* Check which channel to deliver the data */
chan = tmp_data->metadata & TDC_EVENT_CHANNEL_MASK; /* FIXME: mask to know the channel number */
chan = tmp_data->metadata & TDC_EVENT_CHANNEL_MASK;
/* Add the DaCapo flag to notify the user */
tdc->event[chan].dacapo_flag = dacapo_flag;
/* Copy the data and notify the readers (ZIO trigger) */
tdc->event[chan].data = *tmp_data;
/* XXX: Flag to avoid the ZIO trigger to read always the same element
......
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