Lines Matching refs:state

77  * Removed STOP state irq as this will keep driver in irq handler only
215 * @streaming: Flag for storing streaming state
313 * @state: Xilinx CSI-2 Rx Subsystem structure pointer
320 static int xcsi2rxss_soft_reset(struct xcsi2rxss_state *state)
324 xcsi2rxss_set(state, XCSI_CCR_OFFSET, XCSI_CCR_SOFTRESET);
326 while (xcsi2rxss_read(state, XCSI_CSR_OFFSET) & XCSI_CSR_RIPCD) {
328 dev_err(state->dev, "soft reset timed out!\n");
336 xcsi2rxss_clr(state, XCSI_CCR_OFFSET, XCSI_CCR_SOFTRESET);
340 static void xcsi2rxss_hard_reset(struct xcsi2rxss_state *state)
342 if (!state->rst_gpio)
346 gpiod_set_value_cansleep(state->rst_gpio, 1);
348 gpiod_set_value_cansleep(state->rst_gpio, 0);
351 static void xcsi2rxss_reset_event_counters(struct xcsi2rxss_state *state)
356 state->events[i] = 0;
359 state->vcx_events[i] = 0;
363 static void xcsi2rxss_log_counters(struct xcsi2rxss_state *state)
365 struct device *dev = state->dev;
369 if (state->events[i] > 0) {
372 state->events[i]);
376 if (state->en_vcx) {
378 if (state->vcx_events[i] > 0) {
383 state->vcx_events[i]);
485 static int xcsi2rxss_start_stream(struct xcsi2rxss_state *state)
490 xcsi2rxss_set(state, XCSI_CCR_OFFSET, XCSI_CCR_ENABLE);
492 ret = xcsi2rxss_soft_reset(state);
494 state->streaming = false;
499 xcsi2rxss_clr(state, XCSI_GIER_OFFSET, XCSI_GIER_GIE);
500 xcsi2rxss_write(state, XCSI_IER_OFFSET, XCSI_IER_INTR_MASK);
501 xcsi2rxss_set(state, XCSI_GIER_OFFSET, XCSI_GIER_GIE);
503 state->streaming = true;
505 state->rsubdev =
506 xcsi2rxss_get_remote_subdev(&state->pads[XVIP_PAD_SINK]);
508 ret = v4l2_subdev_call(state->rsubdev, video, s_stream, 1);
511 xcsi2rxss_clr(state, XCSI_IER_OFFSET, XCSI_IER_INTR_MASK);
512 xcsi2rxss_clr(state, XCSI_GIER_OFFSET, XCSI_GIER_GIE);
515 xcsi2rxss_clr(state, XCSI_CCR_OFFSET, XCSI_CCR_ENABLE);
516 state->streaming = false;
522 static void xcsi2rxss_stop_stream(struct xcsi2rxss_state *state)
524 v4l2_subdev_call(state->rsubdev, video, s_stream, 0);
527 xcsi2rxss_clr(state, XCSI_IER_OFFSET, XCSI_IER_INTR_MASK);
528 xcsi2rxss_clr(state, XCSI_GIER_OFFSET, XCSI_GIER_GIE);
531 xcsi2rxss_clr(state, XCSI_CCR_OFFSET, XCSI_CCR_ENABLE);
532 state->streaming = false;
538 * @data: Pointer to device state
547 struct xcsi2rxss_state *state = (struct xcsi2rxss_state *)data;
548 struct device *dev = state->dev;
551 status = xcsi2rxss_read(state, XCSI_ISR_OFFSET) & XCSI_ISR_ALLINTR_MASK;
552 xcsi2rxss_write(state, XCSI_ISR_OFFSET, status);
565 spkt = xcsi2rxss_read(state, XCSI_SPKTR_OFFSET);
567 spfifostat = xcsi2rxss_read(state, XCSI_ISR_OFFSET);
571 xcsi2rxss_write(state, XCSI_ISR_OFFSET, spfifostat);
587 xcsi2rxss_clr(state, XCSI_IER_OFFSET, XCSI_IER_INTR_MASK);
588 xcsi2rxss_clr(state, XCSI_GIER_OFFSET, XCSI_GIER_GIE);
591 xcsi2rxss_clr(state, XCSI_CCR_OFFSET, XCSI_CCR_ENABLE);
611 state->events[i]++;
614 state->events[i]);
617 if (status & XCSI_ISR_VCXFE && state->en_vcx) {
620 vcxstatus = xcsi2rxss_read(state, XCSI_VCXR_OFFSET);
625 state->vcx_events[i]++;
627 xcsi2rxss_write(state, XCSI_VCXR_OFFSET, vcxstatus);
686 * @sd_state: Pointer to sub device state structure
713 * @sd_state: Pointer to sub device state structure
738 * @sd_state: Pointer to sub device state structure
804 struct xcsi2rxss_state *state = to_xcsi2rxssstate(sd);
812 } else if (state->datatype != MIPI_CSI2_DT_RAW8) {
814 dt = state->datatype;