Lines Matching refs:state
76 * Removed STOP state irq as this will keep driver in irq handler only
230 * @streaming: Flag for storing streaming state
328 * @state: Xilinx CSI-2 Rx Subsystem structure pointer
335 static int xcsi2rxss_soft_reset(struct xcsi2rxss_state *state)
339 xcsi2rxss_set(state, XCSI_CCR_OFFSET, XCSI_CCR_SOFTRESET);
341 while (xcsi2rxss_read(state, XCSI_CSR_OFFSET) & XCSI_CSR_RIPCD) {
343 dev_err(state->dev, "soft reset timed out!\n");
351 xcsi2rxss_clr(state, XCSI_CCR_OFFSET, XCSI_CCR_SOFTRESET);
355 static void xcsi2rxss_hard_reset(struct xcsi2rxss_state *state)
357 if (!state->rst_gpio)
361 gpiod_set_value_cansleep(state->rst_gpio, 1);
363 gpiod_set_value_cansleep(state->rst_gpio, 0);
366 static void xcsi2rxss_reset_event_counters(struct xcsi2rxss_state *state)
371 state->events[i] = 0;
374 state->vcx_events[i] = 0;
378 static void xcsi2rxss_log_counters(struct xcsi2rxss_state *state)
380 struct device *dev = state->dev;
384 if (state->events[i] > 0) {
387 state->events[i]);
391 if (state->en_vcx) {
393 if (state->vcx_events[i] > 0) {
398 state->vcx_events[i]);
500 static int xcsi2rxss_start_stream(struct xcsi2rxss_state *state)
505 xcsi2rxss_set(state, XCSI_CCR_OFFSET, XCSI_CCR_ENABLE);
507 ret = xcsi2rxss_soft_reset(state);
509 state->streaming = false;
514 xcsi2rxss_clr(state, XCSI_GIER_OFFSET, XCSI_GIER_GIE);
515 xcsi2rxss_write(state, XCSI_IER_OFFSET, XCSI_IER_INTR_MASK);
516 xcsi2rxss_set(state, XCSI_GIER_OFFSET, XCSI_GIER_GIE);
518 state->streaming = true;
520 state->rsubdev =
521 xcsi2rxss_get_remote_subdev(&state->pads[XVIP_PAD_SINK]);
523 ret = v4l2_subdev_call(state->rsubdev, video, s_stream, 1);
526 xcsi2rxss_clr(state, XCSI_IER_OFFSET, XCSI_IER_INTR_MASK);
527 xcsi2rxss_clr(state, XCSI_GIER_OFFSET, XCSI_GIER_GIE);
530 xcsi2rxss_clr(state, XCSI_CCR_OFFSET, XCSI_CCR_ENABLE);
531 state->streaming = false;
537 static void xcsi2rxss_stop_stream(struct xcsi2rxss_state *state)
539 v4l2_subdev_call(state->rsubdev, video, s_stream, 0);
542 xcsi2rxss_clr(state, XCSI_IER_OFFSET, XCSI_IER_INTR_MASK);
543 xcsi2rxss_clr(state, XCSI_GIER_OFFSET, XCSI_GIER_GIE);
546 xcsi2rxss_clr(state, XCSI_CCR_OFFSET, XCSI_CCR_ENABLE);
547 state->streaming = false;
553 * @data: Pointer to device state
562 struct xcsi2rxss_state *state = (struct xcsi2rxss_state *)data;
563 struct device *dev = state->dev;
566 status = xcsi2rxss_read(state, XCSI_ISR_OFFSET) & XCSI_ISR_ALLINTR_MASK;
567 xcsi2rxss_write(state, XCSI_ISR_OFFSET, status);
580 spkt = xcsi2rxss_read(state, XCSI_SPKTR_OFFSET);
582 spfifostat = xcsi2rxss_read(state, XCSI_ISR_OFFSET);
586 xcsi2rxss_write(state, XCSI_ISR_OFFSET, spfifostat);
602 xcsi2rxss_clr(state, XCSI_IER_OFFSET, XCSI_IER_INTR_MASK);
603 xcsi2rxss_clr(state, XCSI_GIER_OFFSET, XCSI_GIER_GIE);
606 xcsi2rxss_clr(state, XCSI_CCR_OFFSET, XCSI_CCR_ENABLE);
626 state->events[i]++;
629 state->events[i]);
632 if (status & XCSI_ISR_VCXFE && state->en_vcx) {
635 vcxstatus = xcsi2rxss_read(state, XCSI_VCXR_OFFSET);
640 state->vcx_events[i]++;
642 xcsi2rxss_write(state, XCSI_VCXR_OFFSET, vcxstatus);
817 struct xcsi2rxss_state *state = to_xcsi2rxssstate(sd);
825 } else if (state->datatype != XCSI_DT_RAW8) {
827 dt = state->datatype;