Lines Matching +full:0 +full:x31000000
125 u8 buf[4] = { addr >> 8, addr & 0xff, data >> 8, data & 0xff }; in s5c73m3_i2c_write()
129 v4l_dbg(4, s5c73m3_dbg, client, "%s: addr 0x%04x, data 0x%04x\n", in s5c73m3_i2c_write()
133 return 0; in s5c73m3_i2c_write()
135 return ret < 0 ? ret : -EREMOTEIO; in s5c73m3_i2c_write()
141 u8 rbuf[2], wbuf[2] = { addr >> 8, addr & 0xff }; in s5c73m3_i2c_read()
145 .flags = 0, in s5c73m3_i2c_read()
163 "%s: addr: 0x%04x, data: 0x%04x\n", in s5c73m3_i2c_read()
165 return 0; in s5c73m3_i2c_read()
170 return ret >= 0 ? -EREMOTEIO : ret; in s5c73m3_i2c_read()
178 if ((addr ^ state->i2c_write_address) & 0xffff0000) { in s5c73m3_write()
180 if (ret < 0) { in s5c73m3_write()
181 state->i2c_write_address = 0; in s5c73m3_write()
186 if ((addr ^ state->i2c_write_address) & 0xffff) { in s5c73m3_write()
187 ret = s5c73m3_i2c_write(client, REG_CMDWR_ADDRL, addr & 0xffff); in s5c73m3_write()
188 if (ret < 0) { in s5c73m3_write()
189 state->i2c_write_address = 0; in s5c73m3_write()
197 if (ret < 0) in s5c73m3_write()
210 if ((addr ^ state->i2c_read_address) & 0xffff0000) { in s5c73m3_read()
212 if (ret < 0) { in s5c73m3_read()
213 state->i2c_read_address = 0; in s5c73m3_read()
218 if ((addr ^ state->i2c_read_address) & 0xffff) { in s5c73m3_read()
219 ret = s5c73m3_i2c_write(client, REG_CMDRD_ADDRL, addr & 0xffff); in s5c73m3_read()
220 if (ret < 0) { in s5c73m3_read()
221 state->i2c_read_address = 0; in s5c73m3_read()
229 if (ret < 0) in s5c73m3_read()
243 int count = 0; in s5c73m3_check_status()
247 if (ret < 0 || status == value) in s5c73m3_check_status()
253 if (count > 0) in s5c73m3_check_status()
258 if (ret == 0 && status != value) { in s5c73m3_check_status()
259 u16 i2c_status = 0; in s5c73m3_check_status()
260 u16 i2c_seq_status = 0; in s5c73m3_check_status()
280 if (ret < 0) in s5c73m3_isp_command()
283 ret = s5c73m3_write(state, 0x00095000, command); in s5c73m3_isp_command()
284 if (ret < 0) in s5c73m3_isp_command()
287 ret = s5c73m3_write(state, 0x00095002, data); in s5c73m3_isp_command()
288 if (ret < 0) in s5c73m3_isp_command()
291 return s5c73m3_write(state, REG_STATUS, 0x0001); in s5c73m3_isp_command()
304 int count = 0; in s5c73m3_set_af_softlanding()
310 if (ret < 0) { in s5c73m3_set_af_softlanding()
318 if (ret < 0) { in s5c73m3_set_af_softlanding()
351 if (ret < 0) { in s5c73m3_load_fw()
360 if (ret >= 0) in s5c73m3_load_fw()
379 "Preview size: %dx%d, reg_val: 0x%x\n", in s5c73m3_set_frame_size()
386 "Capture size: %dx%d, reg_val: 0x%x\n", in s5c73m3_set_frame_size()
399 return 0; in s5c73m3_set_frame_rate()
406 state->apply_fiv = 0; in s5c73m3_set_frame_rate()
428 state->apply_fmt = 0; in __s5c73m3_s_stream()
438 return 0; in __s5c73m3_s_stream()
442 if (ret < 0) in __s5c73m3_s_stream()
464 u16 reg = 0; in s5c73m3_system_status_wait()
466 while (steps-- > 0) { in s5c73m3_system_status_wait()
467 int ret = s5c73m3_read(state, 0x30100010, ®); in s5c73m3_system_status_wait()
468 if (ret < 0) in s5c73m3_system_status_wait()
471 return 0; in s5c73m3_system_status_wait()
484 offset = state->isp_ready ? 0x60 : 0; in s5c73m3_read_fw_version()
486 for (i = 0; i < S5C73M3_SENSOR_FW_LEN / 2; i++) { in s5c73m3_read_fw_version()
488 if (ret < 0) in s5c73m3_read_fw_version()
490 state->sensor_fw[i * 2] = (char)(*data & 0xff); in s5c73m3_read_fw_version()
493 state->sensor_fw[S5C73M3_SENSOR_FW_LEN] = '\0'; in s5c73m3_read_fw_version()
496 for (i = 0; i < S5C73M3_SENSOR_TYPE_LEN / 2; i++) { in s5c73m3_read_fw_version()
498 if (ret < 0) in s5c73m3_read_fw_version()
500 state->sensor_type[i * 2] = (char)(*data & 0xff); in s5c73m3_read_fw_version()
503 state->sensor_type[S5C73M3_SENSOR_TYPE_LEN] = '\0'; in s5c73m3_read_fw_version()
505 ret = s5c73m3_read(state, offset + 0x14, data); in s5c73m3_read_fw_version()
506 if (ret >= 0) { in s5c73m3_read_fw_version()
507 ret = s5c73m3_read(state, offset + 0x16, data + 1); in s5c73m3_read_fw_version()
508 if (ret >= 0) in s5c73m3_read_fw_version()
509 state->fw_size = data[0] + (data[1] << 16); in s5c73m3_read_fw_version()
522 int count = 0; in s5c73m3_fw_update_from()
527 ret = s5c73m3_isp_command(state, COMM_FW_UPDATE, 0); in s5c73m3_fw_update_from()
528 if (ret < 0) in s5c73m3_fw_update_from()
532 ret = s5c73m3_read(state, 0x00095906, &status); in s5c73m3_fw_update_from()
533 if (ret < 0) in s5c73m3_fw_update_from()
541 return 0; in s5c73m3_fw_update_from()
557 ret = s5c73m3_write(state, 0x30000004, 0xffff); in s5c73m3_spi_boot()
558 if (ret < 0) in s5c73m3_spi_boot()
564 ret = s5c73m3_system_status_wait(state, 0x0c, 100, 3); in s5c73m3_spi_boot()
565 if (ret < 0) { in s5c73m3_spi_boot()
571 ret = s5c73m3_write(state, 0x30100014, 0x2146); in s5c73m3_spi_boot()
572 if (ret < 0) in s5c73m3_spi_boot()
575 ret = s5c73m3_write(state, 0x30100010, 0x210c); in s5c73m3_spi_boot()
576 if (ret < 0) in s5c73m3_spi_boot()
582 ret = s5c73m3_system_status_wait(state, 0x210d, 100, 300); in s5c73m3_spi_boot()
583 if (ret < 0) in s5c73m3_spi_boot()
591 ret = s5c73m3_write(state, 0x30000004, 0xfffd); in s5c73m3_spi_boot()
592 if (ret < 0) in s5c73m3_spi_boot()
596 ret = s5c73m3_write(state, 0x301000a4, 0x0183); in s5c73m3_spi_boot()
597 if (ret < 0) in s5c73m3_spi_boot()
601 ret = s5c73m3_write(state, 0x30000004, 0xffff); in s5c73m3_spi_boot()
602 if (ret < 0 || !load_fw) in s5c73m3_spi_boot()
606 if (ret < 0) in s5c73m3_spi_boot()
611 update_fw = 0; in s5c73m3_spi_boot()
620 { 0x30100018, 0x0618 }, in s5c73m3_set_timing_register_for_vdd()
621 { 0x3010001c, 0x10c1 }, in s5c73m3_set_timing_register_for_vdd()
622 { 0x30100020, 0x249e } in s5c73m3_set_timing_register_for_vdd()
627 for (i = 0; i < ARRAY_SIZE(regs); i++) { in s5c73m3_set_timing_register_for_vdd()
628 ret = s5c73m3_write(state, regs[i][0], regs[i][1]); in s5c73m3_set_timing_register_for_vdd()
629 if (ret < 0) in s5c73m3_set_timing_register_for_vdd()
633 return 0; in s5c73m3_set_timing_register_for_vdd()
638 switch (state->sensor_fw[0]) { in s5c73m3_set_fw_file_version()
641 state->fw_file_version[0] = 'G'; in s5c73m3_set_fw_file_version()
645 state->fw_file_version[0] = 'Z'; in s5c73m3_set_fw_file_version()
662 ret = s5c73m3_write(state, 0x30000004, 0xffff); in s5c73m3_get_fw_version()
663 if (ret < 0) in s5c73m3_get_fw_version()
668 ret = s5c73m3_system_status_wait(state, 0x0c, 100, 3); in s5c73m3_get_fw_version()
669 if (ret < 0) { in s5c73m3_get_fw_version()
676 ret = s5c73m3_write(state, 0x30100120, 0x0820); in s5c73m3_get_fw_version()
677 ret = s5c73m3_write(state, 0x30100124, 0x0820); in s5c73m3_get_fw_version()
680 ret = s5c73m3_write(state, 0x00010418, 0x0008); in s5c73m3_get_fw_version()
683 ret = s5c73m3_write(state, 0x30100014, 0x2146); in s5c73m3_get_fw_version()
684 if (ret < 0) in s5c73m3_get_fw_version()
686 ret = s5c73m3_write(state, 0x30100010, 0x230c); in s5c73m3_get_fw_version()
687 if (ret < 0) in s5c73m3_get_fw_version()
693 ret = s5c73m3_system_status_wait(state, 0x230e, 100, 300); in s5c73m3_get_fw_version()
694 if (ret < 0) in s5c73m3_get_fw_version()
698 ret = s5c73m3_write(state, 0x30000004, 0xfffd); in s5c73m3_get_fw_version()
699 if (ret < 0) in s5c73m3_get_fw_version()
703 ret = s5c73m3_write(state, 0x301000a4, 0x0183); in s5c73m3_get_fw_version()
704 if (ret < 0) in s5c73m3_get_fw_version()
719 { 0x3100010c, 0x0044 }, in s5c73m3_rom_boot()
720 { 0x31000108, 0x000d }, in s5c73m3_rom_boot()
721 { 0x31000304, 0x0001 }, in s5c73m3_rom_boot()
722 { 0x00010000, 0x5800 }, in s5c73m3_rom_boot()
723 { 0x00010002, 0x0002 }, in s5c73m3_rom_boot()
724 { 0x31000000, 0x0001 }, in s5c73m3_rom_boot()
725 { 0x30100014, 0x1b85 }, in s5c73m3_rom_boot()
726 { 0x30100010, 0x230c } in s5c73m3_rom_boot()
732 ret = s5c73m3_write(state, 0x30000004, 0xffff); in s5c73m3_rom_boot()
733 if (ret < 0) in s5c73m3_rom_boot()
738 ret = s5c73m3_system_status_wait(state, 0x0c, 100, 4); in s5c73m3_rom_boot()
739 if (ret < 0) { in s5c73m3_rom_boot()
744 for (i = 0; i < ARRAY_SIZE(boot_regs); i++) { in s5c73m3_rom_boot()
745 ret = s5c73m3_write(state, boot_regs[i][0], boot_regs[i][1]); in s5c73m3_rom_boot()
746 if (ret < 0) in s5c73m3_rom_boot()
752 ret = s5c73m3_system_status_wait(state, 0x230e, 1000, 150); in s5c73m3_rom_boot()
753 if (ret < 0) { in s5c73m3_rom_boot()
759 ret = s5c73m3_write(state, 0x30000004, 0xfffd); in s5c73m3_rom_boot()
760 if (ret < 0) in s5c73m3_rom_boot()
763 ret = s5c73m3_write(state, 0x301000a4, 0x0183); in s5c73m3_rom_boot()
764 if (ret < 0) in s5c73m3_rom_boot()
767 ret = s5c73m3_write(state, 0x30000004, 0xffff); in s5c73m3_rom_boot()
768 if (ret < 0) in s5c73m3_rom_boot()
780 state->i2c_read_address = 0; in s5c73m3_isp_init()
781 state->i2c_write_address = 0; in s5c73m3_isp_init()
783 ret = s5c73m3_i2c_write(state->i2c_client, AHB_MSB_ADDR_PTR, 0x3310); in s5c73m3_isp_init()
784 if (ret < 0) in s5c73m3_isp_init()
804 for (i = 0; i < s5c73m3_resolutions_len[idx]; ++i) { in s5c73m3_find_frame_size()
889 return 0; in s5c73m3_oif_get_frame_interval()
897 const struct s5c73m3_interval *fiv = &s5c73m3_intervals[0]; in __s5c73m3_set_frame_interval()
901 if (fi->interval.denominator == 0) in __s5c73m3_set_frame_interval()
906 for (i = 0; i < ARRAY_SIZE(s5c73m3_intervals); i++) { in __s5c73m3_set_frame_interval()
923 return 0; in __s5c73m3_set_frame_interval()
965 int ret = 0; in s5c73m3_oif_enum_frame_interval()
988 return (index == 0) ? S5C73M3_ISP_FMT : S5C73M3_JPEG_FMT; in s5c73m3_oif_get_pad_code()
991 if (index > 0) in s5c73m3_oif_get_pad_code()
1008 return 0; in s5c73m3_get_fmt()
1029 return 0; in s5c73m3_get_fmt()
1043 return 0; in s5c73m3_oif_get_fmt()
1068 return 0; in s5c73m3_oif_get_fmt()
1078 int ret = 0; in s5c73m3_set_fmt()
1117 int ret = 0; in s5c73m3_oif_set_fmt()
1169 for (i = 0; i < fd->num_entries; i++) in s5c73m3_oif_get_frame_desc()
1173 return 0; in s5c73m3_oif_get_frame_desc()
1186 fd->entry[0].length = 10 * SZ_1M; in s5c73m3_oif_set_frame_desc()
1192 for (i = 0; i < fd->num_entries; i++) in s5c73m3_oif_set_frame_desc()
1196 return 0; in s5c73m3_oif_set_frame_desc()
1207 if (code->index > 0 || code->pad >= S5C73M3_NUM_PADS) in s5c73m3_enum_mbus_code()
1212 return 0; in s5c73m3_enum_mbus_code()
1222 if (ret < 0) in s5c73m3_oif_enum_mbus_code()
1227 return 0; in s5c73m3_oif_enum_mbus_code()
1254 return 0; in s5c73m3_enum_frame_size()
1265 if (fse->index > 0) in s5c73m3_oif_enum_frame_size()
1290 return 0; in s5c73m3_oif_enum_frame_size()
1297 if (fse->code != s5c73m3_oif_get_pad_code(fse->pad, 0)) in s5c73m3_oif_enum_frame_size()
1313 return 0; in s5c73m3_oif_enum_frame_size()
1325 return 0; in s5c73m3_oif_log_status()
1340 return 0; in s5c73m3_open()
1358 return 0; in s5c73m3_oif_open()
1365 for (i = 0; i < S5C73M3_MAX_SUPPLIES; i++) { in __s5c73m3_power_on()
1372 if (ret < 0) in __s5c73m3_power_on()
1376 if (ret < 0) in __s5c73m3_power_on()
1382 gpiod_set_value(state->stby, 0); in __s5c73m3_power_on()
1384 gpiod_set_value(state->reset, 0); in __s5c73m3_power_on()
1387 return 0; in __s5c73m3_power_on()
1390 for (--i; i >= 0; i--) in __s5c73m3_power_on()
1416 state->streaming = 0; in __s5c73m3_power_off()
1417 state->isp_ready = 0; in __s5c73m3_power_off()
1419 for (i = S5C73M3_MAX_SUPPLIES - 1; i >= 0; i--) { in __s5c73m3_power_off()
1425 return 0; in __s5c73m3_power_off()
1429 if (r < 0) in __s5c73m3_power_off()
1442 int ret = 0; in s5c73m3_oif_set_power()
1553 struct v4l2_fwnode_endpoint ep = { .bus_type = 0 }; in s5c73m3_get_dt_data()
1582 node_ep = of_graph_get_endpoint_by_regs(node, 0, -1); in s5c73m3_get_dt_data()
1585 return 0; in s5c73m3_get_dt_data()
1604 return 0; in s5c73m3_get_dt_data()
1621 if (ret < 0) in s5c73m3_probe()
1642 if (ret < 0) in s5c73m3_probe()
1659 if (ret < 0) in s5c73m3_probe()
1662 for (i = 0; i < S5C73M3_MAX_SUPPLIES; i++) in s5c73m3_probe()
1685 state->fw_file_version[0] = 'G'; in s5c73m3_probe()
1689 if (ret < 0) in s5c73m3_probe()
1695 if (ret < 0) in s5c73m3_probe()
1701 if (ret < 0) { in s5c73m3_probe()
1707 if (ret < 0) in s5c73m3_probe()
1711 return 0; in s5c73m3_probe()