void BingoPgIndex::readConfigParameters(BingoPgConfig& bingo_config) { /* * Read configuration page */ BingoPgBuffer config_buffer(_index, BINGO_CONFIG_PAGE, BINGO_PG_READ); /* * Deserialize binary stored parameters */ int data_len; void* data = config_buffer.getIndexData(data_len); bingo_config.deserialize(data, data_len); }
irqreturn_t vc_handler(struct vcap_dev *dev) { uint32_t irq, timestamp; enum rdy_buf vc_buf_status, buf_ind; struct vcap_buffer *buf; struct vb2_buffer *vb = NULL; struct vcap_client_data *c_data; struct v4l2_event v4l2_evt; irq = readl_relaxed(VCAP_VC_INT_STATUS); dprintk(1, "%s: irq=0x%08x\n", __func__, irq); v4l2_evt.id = 0; if (irq & 0x8000200) { v4l2_evt.type = V4L2_EVENT_PRIVATE_START + VCAP_VC_PIX_ERR_EVENT; v4l2_event_queue(dev->vfd, &v4l2_evt); } if (irq & 0x40000200) { v4l2_evt.type = V4L2_EVENT_PRIVATE_START + VCAP_VC_LINE_ERR_EVENT; v4l2_event_queue(dev->vfd, &v4l2_evt); } if (irq & 0x20000200) { v4l2_evt.type = V4L2_EVENT_PRIVATE_START + VCAP_VC_VSYNC_ERR_EVENT; v4l2_event_queue(dev->vfd, &v4l2_evt); } if (irq & 0x00000800) { v4l2_evt.type = V4L2_EVENT_PRIVATE_START + VCAP_VC_NPL_OFLOW_ERR_EVENT; v4l2_event_queue(dev->vfd, &v4l2_evt); } if (irq & 0x00000400) { v4l2_evt.type = V4L2_EVENT_PRIVATE_START + VCAP_VC_LBUF_OFLOW_ERR_EVENT; v4l2_event_queue(dev->vfd, &v4l2_evt); } vc_buf_status = irq & VC_BUFFER_WRITTEN; dprintk(1, "Done buf status = %d\n", vc_buf_status); if (vc_buf_status == VC_NO_BUF) { writel_relaxed(irq, VCAP_VC_INT_CLEAR); pr_err("VC IRQ shows some error\n"); return IRQ_HANDLED; } if (dev->vc_client == NULL) { writel_relaxed(irq, VCAP_VC_INT_CLEAR); pr_err("VC: There is no active vc client\n"); return IRQ_HANDLED; } c_data = dev->vc_client; spin_lock(&dev->vc_client->cap_slock); if (list_empty(&dev->vc_client->vid_vc_action.active)) { /* Just leave we have no new queued buffers */ spin_unlock(&dev->vc_client->cap_slock); writel_relaxed(irq, VCAP_VC_INT_CLEAR); v4l2_evt.type = V4L2_EVENT_PRIVATE_START + VCAP_VC_BUF_OVERWRITE_EVENT; v4l2_event_queue(dev->vfd, &v4l2_evt); dprintk(1, "We have no more avilable buffers\n"); return IRQ_HANDLED; } spin_unlock(&dev->vc_client->cap_slock); timestamp = readl_relaxed(VCAP_VC_TIMESTAMP); buf_ind = dev->vc_client->vid_vc_action.buf_ind; if (vc_buf_status == VC_BUF1N2) { /* There are 2 buffer ready */ writel_relaxed(irq, VCAP_VC_INT_CLEAR); return IRQ_HANDLED; } else if (buf_ind != vc_buf_status) { /* buffer is out of sync */ writel_relaxed(irq, VCAP_VC_INT_CLEAR); return IRQ_HANDLED; } if (buf_ind == VC_BUF1) { dprintk(1, "Got BUF1\n"); vb = &dev->vc_client->vid_vc_action.buf1->vb; spin_lock(&dev->vc_client->cap_slock); if (list_empty(&dev->vc_client->vid_vc_action.active)) { spin_unlock(&dev->vc_client->cap_slock); v4l2_evt.type = V4L2_EVENT_PRIVATE_START + VCAP_VC_BUF_OVERWRITE_EVENT; v4l2_event_queue(dev->vfd, &v4l2_evt); writel_relaxed(irq, VCAP_VC_INT_CLEAR); return IRQ_HANDLED; } buf = list_entry(dev->vc_client->vid_vc_action.active.next, struct vcap_buffer, list); list_del(&buf->list); spin_unlock(&dev->vc_client->cap_slock); /* Config vc with this new buffer */ config_buffer(c_data, buf, VCAP_VC_Y_ADDR_1, VCAP_VC_C_ADDR_1); vb->v4l2_buf.timestamp.tv_usec = timestamp; vb2_buffer_done(vb, VB2_BUF_STATE_DONE); dev->vc_client->vid_vc_action.buf1 = buf; dev->vc_client->vid_vc_action.buf_ind = VC_BUF2; irq = VC_BUF1; } else {