Lines Matching full:state
204 int (*init)(struct adv7180_state *state);
232 static int adv7180_select_page(struct adv7180_state *state, unsigned int page) in adv7180_select_page() argument
234 if (state->register_page != page) { in adv7180_select_page()
235 i2c_smbus_write_byte_data(state->client, ADV7180_REG_CTRL, in adv7180_select_page()
237 state->register_page = page; in adv7180_select_page()
243 static int adv7180_write(struct adv7180_state *state, unsigned int reg, in adv7180_write() argument
246 lockdep_assert_held(&state->mutex); in adv7180_write()
247 adv7180_select_page(state, reg >> 8); in adv7180_write()
248 return i2c_smbus_write_byte_data(state->client, reg & 0xff, value); in adv7180_write()
251 static int adv7180_read(struct adv7180_state *state, unsigned int reg) in adv7180_read() argument
253 lockdep_assert_held(&state->mutex); in adv7180_read()
254 adv7180_select_page(state, reg >> 8); in adv7180_read()
255 return i2c_smbus_read_byte_data(state->client, reg & 0xff); in adv7180_read()
258 static int adv7180_csi_write(struct adv7180_state *state, unsigned int reg, in adv7180_csi_write() argument
261 return i2c_smbus_write_byte_data(state->csi_client, reg, value); in adv7180_csi_write()
264 static int adv7180_set_video_standard(struct adv7180_state *state, in adv7180_set_video_standard() argument
267 return state->chip_info->set_std(state, std); in adv7180_set_video_standard()
270 static int adv7180_vpp_write(struct adv7180_state *state, unsigned int reg, in adv7180_vpp_write() argument
273 return i2c_smbus_write_byte_data(state->vpp_client, reg, value); in adv7180_vpp_write()
335 static int __adv7180_status(struct adv7180_state *state, u32 *status, in __adv7180_status() argument
338 int status1 = adv7180_read(state, ADV7180_REG_STATUS1); in __adv7180_status()
358 struct adv7180_state *state = to_state(sd); in adv7180_querystd() local
359 int err = mutex_lock_interruptible(&state->mutex); in adv7180_querystd()
363 if (state->streaming) { in adv7180_querystd()
368 err = adv7180_set_video_standard(state, in adv7180_querystd()
374 __adv7180_status(state, NULL, std); in adv7180_querystd()
376 err = v4l2_std_to_adv7180(state->curr_norm); in adv7180_querystd()
380 err = adv7180_set_video_standard(state, err); in adv7180_querystd()
383 mutex_unlock(&state->mutex); in adv7180_querystd()
390 struct adv7180_state *state = to_state(sd); in adv7180_s_routing() local
391 int ret = mutex_lock_interruptible(&state->mutex); in adv7180_s_routing()
396 if (input > 31 || !(BIT(input) & state->chip_info->valid_input_mask)) { in adv7180_s_routing()
401 ret = state->chip_info->select_input(state, input); in adv7180_s_routing()
404 state->input = input; in adv7180_s_routing()
406 mutex_unlock(&state->mutex); in adv7180_s_routing()
412 struct adv7180_state *state = to_state(sd); in adv7180_g_input_status() local
413 int ret = mutex_lock_interruptible(&state->mutex); in adv7180_g_input_status()
417 ret = __adv7180_status(state, status, NULL); in adv7180_g_input_status()
418 mutex_unlock(&state->mutex); in adv7180_g_input_status()
422 static int adv7180_program_std(struct adv7180_state *state) in adv7180_program_std() argument
426 ret = v4l2_std_to_adv7180(state->curr_norm); in adv7180_program_std()
430 ret = adv7180_set_video_standard(state, ret); in adv7180_program_std()
438 struct adv7180_state *state = to_state(sd); in adv7180_s_std() local
439 int ret = mutex_lock_interruptible(&state->mutex); in adv7180_s_std()
449 state->curr_norm = std; in adv7180_s_std()
451 ret = adv7180_program_std(state); in adv7180_s_std()
453 mutex_unlock(&state->mutex); in adv7180_s_std()
459 struct adv7180_state *state = to_state(sd); in adv7180_g_std() local
461 *norm = state->curr_norm; in adv7180_g_std()
470 struct adv7180_state *state = to_state(sd); in adv7180_get_frame_interval() local
474 * subdev active state API. in adv7180_get_frame_interval()
479 if (state->curr_norm & V4L2_STD_525_60) { in adv7180_get_frame_interval()
490 static void adv7180_set_power_pin(struct adv7180_state *state, bool on) in adv7180_set_power_pin() argument
492 if (!state->pwdn_gpio) in adv7180_set_power_pin()
496 gpiod_set_value_cansleep(state->pwdn_gpio, 0); in adv7180_set_power_pin()
499 gpiod_set_value_cansleep(state->pwdn_gpio, 1); in adv7180_set_power_pin()
503 static void adv7180_set_reset_pin(struct adv7180_state *state, bool on) in adv7180_set_reset_pin() argument
505 if (!state->rst_gpio) in adv7180_set_reset_pin()
509 gpiod_set_value_cansleep(state->rst_gpio, 1); in adv7180_set_reset_pin()
511 gpiod_set_value_cansleep(state->rst_gpio, 0); in adv7180_set_reset_pin()
516 static int adv7180_set_power(struct adv7180_state *state, bool on) in adv7180_set_power() argument
526 ret = adv7180_write(state, ADV7180_REG_PWR_MAN, val); in adv7180_set_power()
530 if (state->chip_info->flags & ADV7180_FLAG_MIPI_CSI2) { in adv7180_set_power()
532 adv7180_csi_write(state, 0xDE, 0x02); in adv7180_set_power()
533 adv7180_csi_write(state, 0xD2, 0xF7); in adv7180_set_power()
534 adv7180_csi_write(state, 0xD8, 0x65); in adv7180_set_power()
535 adv7180_csi_write(state, 0xE0, 0x09); in adv7180_set_power()
536 adv7180_csi_write(state, 0x2C, 0x00); in adv7180_set_power()
537 if (state->field == V4L2_FIELD_NONE) in adv7180_set_power()
538 adv7180_csi_write(state, 0x1D, 0x80); in adv7180_set_power()
539 adv7180_csi_write(state, 0x00, 0x00); in adv7180_set_power()
541 adv7180_csi_write(state, 0x00, 0x80); in adv7180_set_power()
550 struct adv7180_state *state = to_state(sd); in adv7180_s_power() local
553 ret = mutex_lock_interruptible(&state->mutex); in adv7180_s_power()
557 ret = adv7180_set_power(state, on); in adv7180_s_power()
559 state->powered = on; in adv7180_s_power()
561 mutex_unlock(&state->mutex); in adv7180_s_power()
573 static int adv7180_test_pattern(struct adv7180_state *state, int value) in adv7180_test_pattern() argument
583 adv7180_write(state, ADV7180_REG_ANALOG_CLAMP_CTL, reg); in adv7180_test_pattern()
586 reg = adv7180_read(state, ADV7180_REG_DEF_VALUE_Y); in adv7180_test_pattern()
588 adv7180_write(state, ADV7180_REG_DEF_VALUE_Y, reg); in adv7180_test_pattern()
592 reg = adv7180_read(state, ADV7180_REG_DEF_VALUE_Y); in adv7180_test_pattern()
594 adv7180_write(state, ADV7180_REG_DEF_VALUE_Y, reg); in adv7180_test_pattern()
602 struct adv7180_state *state = to_state(sd); in adv7180_s_ctrl() local
603 int ret = mutex_lock_interruptible(&state->mutex); in adv7180_s_ctrl()
611 ret = adv7180_write(state, ADV7180_REG_BRI, val); in adv7180_s_ctrl()
615 ret = adv7180_write(state, ADV7180_REG_HUE, -val); in adv7180_s_ctrl()
618 ret = adv7180_write(state, ADV7180_REG_CON, val); in adv7180_s_ctrl()
625 ret = adv7180_write(state, ADV7180_REG_SD_SAT_CB, val); in adv7180_s_ctrl()
628 ret = adv7180_write(state, ADV7180_REG_SD_SAT_CR, val); in adv7180_s_ctrl()
633 adv7180_write(state, 0x80d9, 0x44); in adv7180_s_ctrl()
634 adv7180_write(state, ADV7180_REG_FLCONTROL, in adv7180_s_ctrl()
638 adv7180_write(state, 0x80d9, 0xc4); in adv7180_s_ctrl()
639 adv7180_write(state, ADV7180_REG_FLCONTROL, 0x00); in adv7180_s_ctrl()
643 ret = adv7180_test_pattern(state, val); in adv7180_s_ctrl()
649 mutex_unlock(&state->mutex); in adv7180_s_ctrl()
667 static int adv7180_init_controls(struct adv7180_state *state) in adv7180_init_controls() argument
669 v4l2_ctrl_handler_init(&state->ctrl_hdl, 4); in adv7180_init_controls()
671 v4l2_ctrl_new_std(&state->ctrl_hdl, &adv7180_ctrl_ops, in adv7180_init_controls()
674 v4l2_ctrl_new_std(&state->ctrl_hdl, &adv7180_ctrl_ops, in adv7180_init_controls()
677 v4l2_ctrl_new_std(&state->ctrl_hdl, &adv7180_ctrl_ops, in adv7180_init_controls()
680 v4l2_ctrl_new_std(&state->ctrl_hdl, &adv7180_ctrl_ops, in adv7180_init_controls()
683 v4l2_ctrl_new_custom(&state->ctrl_hdl, &adv7180_ctrl_fast_switch, NULL); in adv7180_init_controls()
685 v4l2_ctrl_new_std_menu_items(&state->ctrl_hdl, &adv7180_ctrl_ops, in adv7180_init_controls()
691 state->sd.ctrl_handler = &state->ctrl_hdl; in adv7180_init_controls()
692 if (state->ctrl_hdl.error) { in adv7180_init_controls()
693 int err = state->ctrl_hdl.error; in adv7180_init_controls()
695 v4l2_ctrl_handler_free(&state->ctrl_hdl); in adv7180_init_controls()
698 v4l2_ctrl_handler_setup(&state->ctrl_hdl); in adv7180_init_controls()
702 static void adv7180_exit_controls(struct adv7180_state *state) in adv7180_exit_controls() argument
704 v4l2_ctrl_handler_free(&state->ctrl_hdl); in adv7180_exit_controls()
722 struct adv7180_state *state = to_state(sd); in adv7180_mbus_fmt() local
727 fmt->height = state->curr_norm & V4L2_STD_525_60 ? 480 : 576; in adv7180_mbus_fmt()
729 if (state->field == V4L2_FIELD_ALTERNATE) in adv7180_mbus_fmt()
735 static int adv7180_set_field_mode(struct adv7180_state *state) in adv7180_set_field_mode() argument
737 if (!(state->chip_info->flags & ADV7180_FLAG_I2P)) in adv7180_set_field_mode()
740 if (state->field == V4L2_FIELD_NONE) { in adv7180_set_field_mode()
741 if (state->chip_info->flags & ADV7180_FLAG_MIPI_CSI2) { in adv7180_set_field_mode()
742 adv7180_csi_write(state, 0x01, 0x20); in adv7180_set_field_mode()
743 adv7180_csi_write(state, 0x02, 0x28); in adv7180_set_field_mode()
744 adv7180_csi_write(state, 0x03, 0x38); in adv7180_set_field_mode()
745 adv7180_csi_write(state, 0x04, 0x30); in adv7180_set_field_mode()
746 adv7180_csi_write(state, 0x05, 0x30); in adv7180_set_field_mode()
747 adv7180_csi_write(state, 0x06, 0x80); in adv7180_set_field_mode()
748 adv7180_csi_write(state, 0x07, 0x70); in adv7180_set_field_mode()
749 adv7180_csi_write(state, 0x08, 0x50); in adv7180_set_field_mode()
751 adv7180_vpp_write(state, 0xa3, 0x00); in adv7180_set_field_mode()
752 adv7180_vpp_write(state, 0x5b, 0x00); in adv7180_set_field_mode()
753 adv7180_vpp_write(state, 0x55, 0x80); in adv7180_set_field_mode()
755 if (state->chip_info->flags & ADV7180_FLAG_MIPI_CSI2) { in adv7180_set_field_mode()
756 adv7180_csi_write(state, 0x01, 0x18); in adv7180_set_field_mode()
757 adv7180_csi_write(state, 0x02, 0x18); in adv7180_set_field_mode()
758 adv7180_csi_write(state, 0x03, 0x30); in adv7180_set_field_mode()
759 adv7180_csi_write(state, 0x04, 0x20); in adv7180_set_field_mode()
760 adv7180_csi_write(state, 0x05, 0x28); in adv7180_set_field_mode()
761 adv7180_csi_write(state, 0x06, 0x40); in adv7180_set_field_mode()
762 adv7180_csi_write(state, 0x07, 0x58); in adv7180_set_field_mode()
763 adv7180_csi_write(state, 0x08, 0x30); in adv7180_set_field_mode()
765 adv7180_vpp_write(state, 0xa3, 0x70); in adv7180_set_field_mode()
766 adv7180_vpp_write(state, 0x5b, 0x80); in adv7180_set_field_mode()
767 adv7180_vpp_write(state, 0x55, 0x00); in adv7180_set_field_mode()
777 struct adv7180_state *state = to_state(sd); in adv7180_get_pad_format() local
783 format->format.field = state->field; in adv7180_get_pad_format()
793 struct adv7180_state *state = to_state(sd); in adv7180_set_pad_format() local
799 if (state->chip_info->flags & ADV7180_FLAG_I2P) in adv7180_set_pad_format()
810 if (state->field != format->format.field) { in adv7180_set_pad_format()
811 state->field = format->format.field; in adv7180_set_pad_format()
812 adv7180_set_power(state, false); in adv7180_set_pad_format()
813 adv7180_set_field_mode(state); in adv7180_set_pad_format()
814 adv7180_set_power(state, true); in adv7180_set_pad_format()
839 struct adv7180_state *state = to_state(sd); in adv7180_get_mbus_config() local
841 if (state->chip_info->flags & ADV7180_FLAG_MIPI_CSI2) { in adv7180_get_mbus_config()
868 struct adv7180_state *state = to_state(sd); in adv7180_g_pixelaspect() local
870 if (state->curr_norm & V4L2_STD_525_60) { in adv7180_g_pixelaspect()
889 struct adv7180_state *state = to_state(sd); in adv7180_s_stream() local
894 state->streaming = enable; in adv7180_s_stream()
899 ret = mutex_lock_interruptible(&state->mutex); in adv7180_s_stream()
902 state->streaming = enable; in adv7180_s_stream()
903 mutex_unlock(&state->mutex); in adv7180_s_stream()
963 struct adv7180_state *state = devid; in adv7180_irq() local
966 mutex_lock(&state->mutex); in adv7180_irq()
967 isr3 = adv7180_read(state, ADV7180_REG_ISR3); in adv7180_irq()
969 adv7180_write(state, ADV7180_REG_ICR3, isr3); in adv7180_irq()
977 v4l2_subdev_notify_event(&state->sd, &src_ch); in adv7180_irq()
979 mutex_unlock(&state->mutex); in adv7180_irq()
984 static int adv7180_init(struct adv7180_state *state) in adv7180_init() argument
989 ret = adv7180_write(state, ADV7180_REG_EXTENDED_OUTPUT_CONTROL, in adv7180_init()
995 return adv7180_write(state, ADV7180_REG_NTSC_V_BIT_END, in adv7180_init()
999 static int adv7180_set_std(struct adv7180_state *state, unsigned int std) in adv7180_set_std() argument
1001 return adv7180_write(state, ADV7180_REG_INPUT_CONTROL, in adv7180_set_std()
1002 (std << 4) | state->input); in adv7180_set_std()
1005 static int adv7180_select_input(struct adv7180_state *state, unsigned int input) in adv7180_select_input() argument
1009 ret = adv7180_read(state, ADV7180_REG_INPUT_CONTROL); in adv7180_select_input()
1015 return adv7180_write(state, ADV7180_REG_INPUT_CONTROL, ret); in adv7180_select_input()
1018 static int adv7182_init(struct adv7180_state *state) in adv7182_init() argument
1020 if (state->chip_info->flags & ADV7180_FLAG_MIPI_CSI2) in adv7182_init()
1021 adv7180_write(state, ADV7180_REG_CSI_SLAVE_ADDR, in adv7182_init()
1024 if (state->chip_info->flags & ADV7180_FLAG_I2P) in adv7182_init()
1025 adv7180_write(state, ADV7180_REG_VPP_SLAVE_ADDR, in adv7182_init()
1028 if (state->chip_info->flags & ADV7180_FLAG_V2) { in adv7182_init()
1030 adv7180_write(state, 0x0080, 0x51); in adv7182_init()
1031 adv7180_write(state, 0x0081, 0x51); in adv7182_init()
1032 adv7180_write(state, 0x0082, 0x68); in adv7182_init()
1036 if (state->chip_info->flags & ADV7180_FLAG_MIPI_CSI2) { in adv7182_init()
1037 adv7180_write(state, ADV7180_REG_OUTPUT_CONTROL, 0x4e); in adv7182_init()
1038 adv7180_write(state, ADV7180_REG_EXTENDED_OUTPUT_CONTROL, 0x57); in adv7182_init()
1039 adv7180_write(state, ADV7180_REG_CTRL_2, 0xc0); in adv7182_init()
1041 if (state->chip_info->flags & ADV7180_FLAG_V2) { in adv7182_init()
1042 if (state->force_bt656_4) { in adv7182_init()
1044 adv7180_write(state, in adv7182_init()
1048 adv7180_write(state, in adv7182_init()
1052 adv7180_write(state, in adv7182_init()
1056 adv7180_write(state, in adv7182_init()
1061 adv7180_write(state, in adv7182_init()
1065 adv7180_write(state, ADV7180_REG_OUTPUT_CONTROL, 0x0c); in adv7182_init()
1066 adv7180_write(state, ADV7180_REG_CTRL_2, 0x40); in adv7182_init()
1069 adv7180_write(state, 0x0013, 0x00); in adv7182_init()
1074 static int adv7182_set_std(struct adv7180_state *state, unsigned int std) in adv7182_set_std() argument
1077 return adv7180_write(state, ADV7182_REG_INPUT_VIDSEL, in adv7182_set_std()
1133 static int adv7182_select_input(struct adv7180_state *state, unsigned int input) in adv7182_select_input() argument
1140 ret = adv7180_write(state, ADV7180_REG_INPUT_CONTROL, input); in adv7182_select_input()
1145 adv7180_write(state, ADV7180_REG_RST_CLAMP, 0x00); in adv7182_select_input()
1146 adv7180_write(state, ADV7180_REG_RST_CLAMP, 0xff); in adv7182_select_input()
1154 adv7180_write(state, ADV7180_REG_SHAP_FILTER_CTL_1, 0x41); in adv7182_select_input()
1157 adv7180_write(state, ADV7180_REG_SHAP_FILTER_CTL_1, 0x01); in adv7182_select_input()
1161 if (state->chip_info->flags & ADV7180_FLAG_V2) in adv7182_select_input()
1167 adv7180_write(state, ADV7180_REG_CVBS_TRIM + i, lbias[i]); in adv7182_select_input()
1171 adv7180_write(state, ADV7180_REG_RES_CIR, 0xa8); in adv7182_select_input()
1172 adv7180_write(state, ADV7180_REG_CLAMP_ADJ, 0x90); in adv7182_select_input()
1173 adv7180_write(state, ADV7180_REG_DIFF_MODE, 0xb0); in adv7182_select_input()
1174 adv7180_write(state, ADV7180_REG_AGC_ADJ1, 0x08); in adv7182_select_input()
1175 adv7180_write(state, ADV7180_REG_AGC_ADJ2, 0xa0); in adv7182_select_input()
1177 adv7180_write(state, ADV7180_REG_RES_CIR, 0xf0); in adv7182_select_input()
1178 adv7180_write(state, ADV7180_REG_CLAMP_ADJ, 0xd0); in adv7182_select_input()
1179 adv7180_write(state, ADV7180_REG_DIFF_MODE, 0x10); in adv7182_select_input()
1180 adv7180_write(state, ADV7180_REG_AGC_ADJ1, 0x9c); in adv7182_select_input()
1181 adv7180_write(state, ADV7180_REG_AGC_ADJ2, 0x00); in adv7182_select_input()
1352 static int init_device(struct adv7180_state *state) in init_device() argument
1356 mutex_lock(&state->mutex); in init_device()
1358 adv7180_set_power_pin(state, true); in init_device()
1359 adv7180_set_reset_pin(state, false); in init_device()
1361 adv7180_write(state, ADV7180_REG_PWR_MAN, ADV7180_PWR_MAN_RES); in init_device()
1364 ret = state->chip_info->init(state); in init_device()
1368 ret = adv7180_program_std(state); in init_device()
1372 adv7180_set_field_mode(state); in init_device()
1375 if (state->irq > 0) { in init_device()
1377 ret = adv7180_write(state, ADV7180_REG_ICONF1, in init_device()
1383 ret = adv7180_write(state, ADV7180_REG_IMR1, 0); in init_device()
1387 ret = adv7180_write(state, ADV7180_REG_IMR2, 0); in init_device()
1392 ret = adv7180_write(state, ADV7180_REG_IMR3, in init_device()
1397 ret = adv7180_write(state, ADV7180_REG_IMR4, 0); in init_device()
1403 mutex_unlock(&state->mutex); in init_device()
1411 struct adv7180_state *state; in adv7180_probe() local
1419 state = devm_kzalloc(&client->dev, sizeof(*state), GFP_KERNEL); in adv7180_probe()
1420 if (state == NULL) in adv7180_probe()
1423 state->client = client; in adv7180_probe()
1424 state->field = V4L2_FIELD_ALTERNATE; in adv7180_probe()
1425 state->chip_info = i2c_get_match_data(client); in adv7180_probe()
1427 state->pwdn_gpio = devm_gpiod_get_optional(&client->dev, "powerdown", in adv7180_probe()
1429 if (IS_ERR(state->pwdn_gpio)) { in adv7180_probe()
1430 ret = PTR_ERR(state->pwdn_gpio); in adv7180_probe()
1435 state->rst_gpio = devm_gpiod_get_optional(&client->dev, "reset", in adv7180_probe()
1437 if (IS_ERR(state->rst_gpio)) { in adv7180_probe()
1438 ret = PTR_ERR(state->rst_gpio); in adv7180_probe()
1444 state->force_bt656_4 = true; in adv7180_probe()
1446 if (state->chip_info->flags & ADV7180_FLAG_MIPI_CSI2) { in adv7180_probe()
1447 state->csi_client = i2c_new_dummy_device(client->adapter, in adv7180_probe()
1449 if (IS_ERR(state->csi_client)) in adv7180_probe()
1450 return PTR_ERR(state->csi_client); in adv7180_probe()
1453 if (state->chip_info->flags & ADV7180_FLAG_I2P) { in adv7180_probe()
1454 state->vpp_client = i2c_new_dummy_device(client->adapter, in adv7180_probe()
1456 if (IS_ERR(state->vpp_client)) { in adv7180_probe()
1457 ret = PTR_ERR(state->vpp_client); in adv7180_probe()
1462 state->irq = client->irq; in adv7180_probe()
1463 mutex_init(&state->mutex); in adv7180_probe()
1464 state->curr_norm = V4L2_STD_NTSC; in adv7180_probe()
1465 if (state->chip_info->flags & ADV7180_FLAG_RESET_POWERED) in adv7180_probe()
1466 state->powered = true; in adv7180_probe()
1468 state->powered = false; in adv7180_probe()
1469 state->input = 0; in adv7180_probe()
1470 sd = &state->sd; in adv7180_probe()
1475 ret = adv7180_init_controls(state); in adv7180_probe()
1479 state->pad.flags = MEDIA_PAD_FL_SOURCE; in adv7180_probe()
1481 ret = media_entity_pads_init(&sd->entity, 1, &state->pad); in adv7180_probe()
1485 ret = init_device(state); in adv7180_probe()
1489 if (state->irq > 0) { in adv7180_probe()
1492 KBUILD_MODNAME, state); in adv7180_probe()
1501 mutex_lock(&state->mutex); in adv7180_probe()
1502 ret = adv7180_read(state, ADV7180_REG_IDENT); in adv7180_probe()
1503 mutex_unlock(&state->mutex); in adv7180_probe()
1515 if (state->irq > 0) in adv7180_probe()
1516 free_irq(client->irq, state); in adv7180_probe()
1520 adv7180_exit_controls(state); in adv7180_probe()
1522 i2c_unregister_device(state->vpp_client); in adv7180_probe()
1524 i2c_unregister_device(state->csi_client); in adv7180_probe()
1525 mutex_destroy(&state->mutex); in adv7180_probe()
1532 struct adv7180_state *state = to_state(sd); in adv7180_remove() local
1536 if (state->irq > 0) in adv7180_remove()
1537 free_irq(client->irq, state); in adv7180_remove()
1540 adv7180_exit_controls(state); in adv7180_remove()
1542 i2c_unregister_device(state->vpp_client); in adv7180_remove()
1543 i2c_unregister_device(state->csi_client); in adv7180_remove()
1545 adv7180_set_reset_pin(state, true); in adv7180_remove()
1546 adv7180_set_power_pin(state, false); in adv7180_remove()
1548 mutex_destroy(&state->mutex); in adv7180_remove()
1555 struct adv7180_state *state = to_state(sd); in adv7180_suspend() local
1557 return adv7180_set_power(state, false); in adv7180_suspend()
1563 struct adv7180_state *state = to_state(sd); in adv7180_resume() local
1566 ret = init_device(state); in adv7180_resume()
1570 ret = adv7180_set_power(state, state->powered); in adv7180_resume()