.. | .. |
---|
40 | 40 | |
---|
41 | 41 | #define PIXEL_RATE_WITH_405M_10BIT (SC223A_LINK_FREQ_405 * 2 * \ |
---|
42 | 42 | SC223A_LANES / SC223A_BITS_PER_SAMPLE) |
---|
| 43 | +/* 79.2Mhz */ |
---|
| 44 | +#define SC223A_PIXEL_RATE (79200000) |
---|
43 | 45 | #define SC223A_XVCLK_FREQ 24000000 |
---|
44 | 46 | |
---|
45 | 47 | #define CHIP_ID 0xcb3e |
---|
.. | .. |
---|
93 | 95 | #define SC223A_REG_VALUE_16BIT 2 |
---|
94 | 96 | #define SC223A_REG_VALUE_24BIT 3 |
---|
95 | 97 | |
---|
| 98 | +#define RKMODULE_CAMERA_MODULE_MODE "rockchip,camera_mode" |
---|
96 | 99 | #define OF_CAMERA_PINCTRL_STATE_DEFAULT "rockchip,camera_default" |
---|
97 | 100 | #define OF_CAMERA_PINCTRL_STATE_SLEEP "rockchip,camera_sleep" |
---|
98 | 101 | #define SC223A_NAME "sc223a" |
---|
99 | | - |
---|
| 102 | +#define CAMERA_MIPI_MODE "mipi_mode" |
---|
| 103 | +#define CAMERA_DVP_MODE "dvp_mode" |
---|
100 | 104 | static const char * const sc223a_supply_names[] = { |
---|
101 | 105 | "avdd", /* Analog power */ |
---|
102 | 106 | "dovdd", /* Digital I/O power */ |
---|
.. | .. |
---|
104 | 108 | }; |
---|
105 | 109 | |
---|
106 | 110 | #define SC223A_NUM_SUPPLIES ARRAY_SIZE(sc223a_supply_names) |
---|
| 111 | + |
---|
| 112 | +enum sc223a_support_mode_id { |
---|
| 113 | + SC223A_MIPI_1920X1080 = 0, |
---|
| 114 | + SC223A_DVP_1920X1080, |
---|
| 115 | + SC223A_MODE_ID_MAX = SC223A_DVP_1920X1080, |
---|
| 116 | +}; |
---|
| 117 | + |
---|
| 118 | +enum sc223a_mode_id { |
---|
| 119 | + SC223A_MIPI_MODE = 0, |
---|
| 120 | + SC223A_DVP_MODE, |
---|
| 121 | +}; |
---|
107 | 122 | |
---|
108 | 123 | struct regval { |
---|
109 | 124 | u16 addr; |
---|
.. | .. |
---|
121 | 136 | const struct regval *reg_list; |
---|
122 | 137 | u32 hdr_mode; |
---|
123 | 138 | u32 vc[PAD_MAX]; |
---|
| 139 | + u8 mode_id; |
---|
124 | 140 | }; |
---|
125 | 141 | |
---|
126 | 142 | struct sc223a { |
---|
.. | .. |
---|
152 | 168 | const char *module_facing; |
---|
153 | 169 | const char *module_name; |
---|
154 | 170 | const char *len_name; |
---|
| 171 | + const char *mode; |
---|
155 | 172 | u32 cur_vts; |
---|
156 | 173 | bool has_init_exp; |
---|
157 | 174 | bool is_thunderboot; |
---|
.. | .. |
---|
353 | 370 | {REG_NULL, 0x00}, |
---|
354 | 371 | }; |
---|
355 | 372 | |
---|
| 373 | +/* |
---|
| 374 | + * Xclk 24Mhz |
---|
| 375 | + * Pclk 79.2Mhz |
---|
| 376 | + * max_framerate 30fps |
---|
| 377 | + * 1920x1080 |
---|
| 378 | + * dvp 10bit, 2lane |
---|
| 379 | + */ |
---|
| 380 | +static const struct regval sc223a_linear_10_1920x1080_dvp_30fps_regs[] = { |
---|
| 381 | + {0x0100, 0x00}, |
---|
| 382 | + {0x36e9, 0x80}, |
---|
| 383 | + {0x37f9, 0x80}, |
---|
| 384 | + {0x3001, 0xff}, |
---|
| 385 | + {0x3002, 0xf0}, |
---|
| 386 | + {0x300a, 0x24}, |
---|
| 387 | + {0x3018, 0x0f}, |
---|
| 388 | + {0x301a, 0xf8}, |
---|
| 389 | + {0x301c, 0x94}, |
---|
| 390 | + {0x301f, 0x40}, |
---|
| 391 | + {0x303f, 0x81}, |
---|
| 392 | + {0x30b8, 0x44}, |
---|
| 393 | + {0x3200, 0x00}, |
---|
| 394 | + {0x3201, 0x00}, |
---|
| 395 | + {0x3202, 0x00}, |
---|
| 396 | + {0x3203, 0x00}, |
---|
| 397 | + {0x3204, 0x07}, |
---|
| 398 | + {0x3205, 0x87}, |
---|
| 399 | + {0x3206, 0x04}, |
---|
| 400 | + {0x3207, 0x3f}, |
---|
| 401 | + {0x3208, 0x07}, |
---|
| 402 | + {0x3209, 0x80}, |
---|
| 403 | + {0x320a, 0x04}, |
---|
| 404 | + {0x320b, 0x38}, |
---|
| 405 | + {0x320c, 0x09}, |
---|
| 406 | + {0x320d, 0x60}, |
---|
| 407 | + {0x320e, 0x04}, |
---|
| 408 | + {0x320f, 0x65}, |
---|
| 409 | + {0x3210, 0x00}, |
---|
| 410 | + {0x3211, 0x04}, |
---|
| 411 | + {0x3212, 0x00}, |
---|
| 412 | + {0x3213, 0x04}, |
---|
| 413 | + {0x3227, 0x03}, |
---|
| 414 | + {0x3250, 0x00}, |
---|
| 415 | + {0x3253, 0x0c}, |
---|
| 416 | + {0x3281, 0x80}, |
---|
| 417 | + {0x3301, 0x06}, |
---|
| 418 | + {0x3302, 0x12}, |
---|
| 419 | + {0x3306, 0x84}, |
---|
| 420 | + {0x3309, 0x60}, |
---|
| 421 | + {0x330a, 0x00}, |
---|
| 422 | + {0x330b, 0xe0}, |
---|
| 423 | + {0x330d, 0x20}, |
---|
| 424 | + {0x3314, 0x15}, |
---|
| 425 | + {0x331e, 0x41}, |
---|
| 426 | + {0x331f, 0x51}, |
---|
| 427 | + {0x3320, 0x0a}, |
---|
| 428 | + {0x3326, 0x0e}, |
---|
| 429 | + {0x3333, 0x10}, |
---|
| 430 | + {0x3334, 0x40}, |
---|
| 431 | + {0x335d, 0x60}, |
---|
| 432 | + {0x335e, 0x06}, |
---|
| 433 | + {0x335f, 0x08}, |
---|
| 434 | + {0x3364, 0x56}, |
---|
| 435 | + {0x337a, 0x06}, |
---|
| 436 | + {0x337b, 0x0e}, |
---|
| 437 | + {0x337c, 0x02}, |
---|
| 438 | + {0x337d, 0x0a}, |
---|
| 439 | + {0x3390, 0x03}, |
---|
| 440 | + {0x3391, 0x0f}, |
---|
| 441 | + {0x3392, 0x1f}, |
---|
| 442 | + {0x3393, 0x06}, |
---|
| 443 | + {0x3394, 0x06}, |
---|
| 444 | + {0x3395, 0x06}, |
---|
| 445 | + {0x3396, 0x48}, |
---|
| 446 | + {0x3397, 0x4b}, |
---|
| 447 | + {0x3398, 0x5f}, |
---|
| 448 | + {0x3399, 0x06}, |
---|
| 449 | + {0x339a, 0x06}, |
---|
| 450 | + {0x339b, 0x9c}, |
---|
| 451 | + {0x339c, 0x9c}, |
---|
| 452 | + {0x33a2, 0x04}, |
---|
| 453 | + {0x33a3, 0x0a}, |
---|
| 454 | + {0x33ad, 0x1c}, |
---|
| 455 | + {0x33af, 0x40}, |
---|
| 456 | + {0x33b1, 0x80}, |
---|
| 457 | + {0x33b3, 0x20}, |
---|
| 458 | + {0x349f, 0x02}, |
---|
| 459 | + {0x34a6, 0x48}, |
---|
| 460 | + {0x34a7, 0x4b}, |
---|
| 461 | + {0x34a8, 0x20}, |
---|
| 462 | + {0x34a9, 0x20}, |
---|
| 463 | + {0x34f8, 0x5f}, |
---|
| 464 | + {0x34f9, 0x10}, |
---|
| 465 | + {0x3616, 0xac}, |
---|
| 466 | + {0x3630, 0xc0}, |
---|
| 467 | + {0x3631, 0x86}, |
---|
| 468 | + {0x3632, 0x26}, |
---|
| 469 | + {0x3633, 0x32}, |
---|
| 470 | + {0x3637, 0x29}, |
---|
| 471 | + {0x363a, 0x84}, |
---|
| 472 | + {0x363b, 0x04}, |
---|
| 473 | + {0x363c, 0x08}, |
---|
| 474 | + {0x3641, 0x3a}, |
---|
| 475 | + {0x364f, 0x39}, |
---|
| 476 | + {0x3670, 0xce}, |
---|
| 477 | + {0x3674, 0xc0}, |
---|
| 478 | + {0x3675, 0xc0}, |
---|
| 479 | + {0x3676, 0xc0}, |
---|
| 480 | + {0x3677, 0x86}, |
---|
| 481 | + {0x3678, 0x8b}, |
---|
| 482 | + {0x3679, 0x8c}, |
---|
| 483 | + {0x367c, 0x4b}, |
---|
| 484 | + {0x367d, 0x5f}, |
---|
| 485 | + {0x367e, 0x4b}, |
---|
| 486 | + {0x367f, 0x5f}, |
---|
| 487 | + {0x3690, 0x62}, |
---|
| 488 | + {0x3691, 0x63}, |
---|
| 489 | + {0x3692, 0x63}, |
---|
| 490 | + {0x3699, 0x86}, |
---|
| 491 | + {0x369a, 0x92}, |
---|
| 492 | + {0x369b, 0xa4}, |
---|
| 493 | + {0x369c, 0x48}, |
---|
| 494 | + {0x369d, 0x4b}, |
---|
| 495 | + {0x36a2, 0x4b}, |
---|
| 496 | + {0x36a3, 0x4f}, |
---|
| 497 | + {0x36ea, 0x09}, |
---|
| 498 | + {0x36eb, 0x0c}, |
---|
| 499 | + {0x36ec, 0x1c}, |
---|
| 500 | + {0x36ed, 0x28}, |
---|
| 501 | + {0x370f, 0x01}, |
---|
| 502 | + {0x3721, 0x6c}, |
---|
| 503 | + {0x3722, 0x09}, |
---|
| 504 | + {0x3724, 0x41}, |
---|
| 505 | + {0x3725, 0xc4}, |
---|
| 506 | + {0x37b0, 0x09}, |
---|
| 507 | + {0x37b1, 0x09}, |
---|
| 508 | + {0x37b2, 0x09}, |
---|
| 509 | + {0x37b3, 0x48}, |
---|
| 510 | + {0x37b4, 0x5f}, |
---|
| 511 | + {0x37fa, 0x09}, |
---|
| 512 | + {0x37fb, 0x32}, |
---|
| 513 | + {0x37fc, 0x10}, |
---|
| 514 | + {0x37fd, 0x37}, |
---|
| 515 | + {0x3900, 0x19}, |
---|
| 516 | + {0x3901, 0x02}, |
---|
| 517 | + {0x3905, 0xb8}, |
---|
| 518 | + {0x391b, 0x82}, |
---|
| 519 | + {0x391c, 0x00}, |
---|
| 520 | + {0x391f, 0x04}, |
---|
| 521 | + {0x3928, 0xc1}, |
---|
| 522 | + {0x3933, 0x81}, |
---|
| 523 | + {0x3934, 0x4c}, |
---|
| 524 | + {0x393f, 0xff}, |
---|
| 525 | + {0x3940, 0x73}, |
---|
| 526 | + {0x3942, 0x01}, |
---|
| 527 | + {0x3943, 0x4d}, |
---|
| 528 | + {0x3946, 0x20}, |
---|
| 529 | + {0x3957, 0x86}, |
---|
| 530 | + {0x3e01, 0x8c}, |
---|
| 531 | + {0x3e02, 0x00}, |
---|
| 532 | + {0x3e28, 0xc4}, |
---|
| 533 | + {0x440e, 0x02}, |
---|
| 534 | + {0x4501, 0xc0}, |
---|
| 535 | + {0x4509, 0x14}, |
---|
| 536 | + {0x450d, 0x11}, |
---|
| 537 | + {0x4518, 0x00}, |
---|
| 538 | + {0x451b, 0x0a}, |
---|
| 539 | + {0x4603, 0x09}, |
---|
| 540 | + {0x4819, 0x07}, |
---|
| 541 | + {0x481b, 0x04}, |
---|
| 542 | + {0x481d, 0x0e}, |
---|
| 543 | + {0x3000, 0xff}, |
---|
| 544 | + {0x481f, 0x03}, |
---|
| 545 | + {0x4821, 0x09}, |
---|
| 546 | + {0x4823, 0x04}, |
---|
| 547 | + {0x4825, 0x03}, |
---|
| 548 | + {0x4827, 0x03}, |
---|
| 549 | + {0x4829, 0x06}, |
---|
| 550 | + {0x501c, 0x00}, |
---|
| 551 | + {0x501d, 0x60}, |
---|
| 552 | + {0x501e, 0x00}, |
---|
| 553 | + {0x501f, 0x40}, |
---|
| 554 | + {0x5799, 0x06}, |
---|
| 555 | + {0x5ae0, 0xfe}, |
---|
| 556 | + {0x5ae1, 0x40}, |
---|
| 557 | + {0x5ae2, 0x38}, |
---|
| 558 | + {0x5ae3, 0x30}, |
---|
| 559 | + {0x5ae4, 0x28}, |
---|
| 560 | + {0x5ae5, 0x38}, |
---|
| 561 | + {0x5ae6, 0x30}, |
---|
| 562 | + {0x5ae7, 0x28}, |
---|
| 563 | + {0x5ae8, 0x3f}, |
---|
| 564 | + {0x5ae9, 0x34}, |
---|
| 565 | + {0x5aea, 0x2c}, |
---|
| 566 | + {0x5aeb, 0x3f}, |
---|
| 567 | + {0x5aec, 0x34}, |
---|
| 568 | + {0x5aed, 0x2c}, |
---|
| 569 | + {0x5aee, 0xfe}, |
---|
| 570 | + {0x5aef, 0x40}, |
---|
| 571 | + {0x5af4, 0x38}, |
---|
| 572 | + {0x5af5, 0x30}, |
---|
| 573 | + {0x5af6, 0x28}, |
---|
| 574 | + {0x5af7, 0x38}, |
---|
| 575 | + {0x5af8, 0x30}, |
---|
| 576 | + {0x5af9, 0x28}, |
---|
| 577 | + {0x5afa, 0x3f}, |
---|
| 578 | + {0x5afb, 0x34}, |
---|
| 579 | + {0x5afc, 0x2c}, |
---|
| 580 | + {0x5afd, 0x3f}, |
---|
| 581 | + {0x5afe, 0x34}, |
---|
| 582 | + {0x5aff, 0x2c}, |
---|
| 583 | + {0x36e9, 0x53}, |
---|
| 584 | + {0x37f9, 0x53}, |
---|
| 585 | + {REG_NULL, 0x00}, |
---|
| 586 | +}; |
---|
| 587 | + |
---|
356 | 588 | static const struct sc223a_mode supported_modes[] = { |
---|
357 | | - { |
---|
| 589 | + [SC223A_MIPI_1920X1080] = { |
---|
358 | 590 | .width = 1920, |
---|
359 | 591 | .height = 1080, |
---|
360 | 592 | .max_fps = { |
---|
.. | .. |
---|
367 | 599 | .bus_fmt = MEDIA_BUS_FMT_SBGGR10_1X10, |
---|
368 | 600 | .reg_list = sc223a_linear_10_1920x1080_30fps_regs, |
---|
369 | 601 | .hdr_mode = NO_HDR, |
---|
| 602 | + .mode_id = SC223A_MIPI_MODE, |
---|
370 | 603 | .vc[PAD0] = V4L2_MBUS_CSI2_CHANNEL_0, |
---|
371 | | - } |
---|
| 604 | + }, |
---|
| 605 | + [SC223A_DVP_1920X1080] = { |
---|
| 606 | + .width = 1920, |
---|
| 607 | + .height = 1080, |
---|
| 608 | + .max_fps = { |
---|
| 609 | + .numerator = 10000, |
---|
| 610 | + .denominator = 300000, |
---|
| 611 | + }, |
---|
| 612 | + .exp_def = 0x0080, |
---|
| 613 | + .hts_def = 0x0960, |
---|
| 614 | + .vts_def = 0x0465, |
---|
| 615 | + .bus_fmt = MEDIA_BUS_FMT_SBGGR8_1X8, |
---|
| 616 | + .reg_list = sc223a_linear_10_1920x1080_dvp_30fps_regs, |
---|
| 617 | + .hdr_mode = NO_HDR, |
---|
| 618 | + .mode_id = SC223A_DVP_MODE, |
---|
| 619 | + .vc[PAD0] = 0, |
---|
| 620 | + }, |
---|
372 | 621 | }; |
---|
373 | 622 | |
---|
374 | | -static const s64 link_freq_menu_items[] = { |
---|
| 623 | +static const __maybe_unused s64 link_freq_menu_items[] = { |
---|
375 | 624 | SC223A_LINK_FREQ_405 |
---|
376 | 625 | }; |
---|
377 | 626 | |
---|
.. | .. |
---|
694 | 943 | struct sc223a *sc223a = to_sc223a(sd); |
---|
695 | 944 | const struct sc223a_mode *mode = sc223a->cur_mode; |
---|
696 | 945 | |
---|
697 | | - u32 val = 1 << (SC223A_LANES - 1) | |
---|
698 | | - V4L2_MBUS_CSI2_CHANNEL_0 | |
---|
699 | | - V4L2_MBUS_CSI2_CONTINUOUS_CLOCK; |
---|
| 946 | + u32 val; |
---|
700 | 947 | |
---|
701 | | - if (mode->hdr_mode != NO_HDR) |
---|
702 | | - val |= V4L2_MBUS_CSI2_CHANNEL_1; |
---|
703 | | - if (mode->hdr_mode == HDR_X3) |
---|
704 | | - val |= V4L2_MBUS_CSI2_CHANNEL_2; |
---|
| 948 | + if (!strcmp(sc223a->mode, CAMERA_MIPI_MODE)) { |
---|
| 949 | + val = 1 << (SC223A_LANES - 1) | |
---|
| 950 | + V4L2_MBUS_CSI2_CHANNEL_0 | |
---|
| 951 | + V4L2_MBUS_CSI2_CONTINUOUS_CLOCK; |
---|
| 952 | + if (mode->hdr_mode != NO_HDR) |
---|
| 953 | + val |= V4L2_MBUS_CSI2_CHANNEL_1; |
---|
| 954 | + if (mode->hdr_mode == HDR_X3) |
---|
| 955 | + val |= V4L2_MBUS_CSI2_CHANNEL_2; |
---|
705 | 956 | |
---|
706 | | - config->type = V4L2_MBUS_CSI2_DPHY; |
---|
707 | | - config->flags = val; |
---|
| 957 | + config->type = V4L2_MBUS_CSI2_DPHY; |
---|
| 958 | + config->flags = val; |
---|
| 959 | + } else if (!strcmp(sc223a->mode, CAMERA_DVP_MODE)) { |
---|
| 960 | + config->type = V4L2_MBUS_PARALLEL; |
---|
| 961 | + config->flags = V4L2_MBUS_HSYNC_ACTIVE_HIGH | |
---|
| 962 | + V4L2_MBUS_VSYNC_ACTIVE_LOW | |
---|
| 963 | + V4L2_MBUS_PCLK_SAMPLE_RISING; |
---|
| 964 | + } |
---|
708 | 965 | |
---|
709 | 966 | return 0; |
---|
710 | 967 | } |
---|
.. | .. |
---|
724 | 981 | struct sc223a *sc223a = to_sc223a(sd); |
---|
725 | 982 | struct rkmodule_hdr_cfg *hdr; |
---|
726 | 983 | u32 i, h, w; |
---|
| 984 | + u8 mode; |
---|
727 | 985 | long ret = 0; |
---|
728 | 986 | u32 stream = 0; |
---|
729 | 987 | |
---|
.. | .. |
---|
740 | 998 | hdr = (struct rkmodule_hdr_cfg *)arg; |
---|
741 | 999 | w = sc223a->cur_mode->width; |
---|
742 | 1000 | h = sc223a->cur_mode->height; |
---|
| 1001 | + mode = sc223a->cur_mode->mode_id; |
---|
743 | 1002 | for (i = 0; i < ARRAY_SIZE(supported_modes); i++) { |
---|
744 | 1003 | if (w == supported_modes[i].width && |
---|
745 | 1004 | h == supported_modes[i].height && |
---|
| 1005 | + mode == supported_modes[i].mode_id && |
---|
746 | 1006 | supported_modes[i].hdr_mode == hdr->hdr_mode) { |
---|
747 | 1007 | sc223a->cur_mode = &supported_modes[i]; |
---|
748 | 1008 | break; |
---|
.. | .. |
---|
889 | 1149 | } |
---|
890 | 1150 | } |
---|
891 | 1151 | } |
---|
| 1152 | + |
---|
892 | 1153 | return sc223a_write_reg(sc223a->client, SC223A_REG_CTRL_MODE, |
---|
893 | 1154 | SC223A_REG_VALUE_08BIT, SC223A_MODE_STREAMING); |
---|
894 | 1155 | } |
---|
.. | .. |
---|
1293 | 1554 | return ret; |
---|
1294 | 1555 | handler->lock = &sc223a->mutex; |
---|
1295 | 1556 | |
---|
1296 | | - ctrl = v4l2_ctrl_new_int_menu(handler, NULL, V4L2_CID_LINK_FREQ, |
---|
1297 | | - 0, 0, link_freq_menu_items); |
---|
1298 | | - if (ctrl) |
---|
1299 | | - ctrl->flags |= V4L2_CTRL_FLAG_READ_ONLY; |
---|
| 1557 | + if (!strcmp(sc223a->mode, CAMERA_MIPI_MODE)) { |
---|
| 1558 | + ctrl = v4l2_ctrl_new_int_menu(handler, NULL, V4L2_CID_LINK_FREQ, |
---|
| 1559 | + 0, 0, link_freq_menu_items); |
---|
| 1560 | + if (ctrl) |
---|
| 1561 | + ctrl->flags |= V4L2_CTRL_FLAG_READ_ONLY; |
---|
| 1562 | + v4l2_ctrl_new_std(handler, NULL, V4L2_CID_PIXEL_RATE, |
---|
| 1563 | + 0, PIXEL_RATE_WITH_405M_10BIT, 1, PIXEL_RATE_WITH_405M_10BIT); |
---|
| 1564 | + } else if (!strcmp(sc223a->mode, CAMERA_DVP_MODE)) { |
---|
| 1565 | + v4l2_ctrl_new_std(handler, NULL, V4L2_CID_PIXEL_RATE, |
---|
| 1566 | + 0, SC223A_PIXEL_RATE, 1, SC223A_PIXEL_RATE); |
---|
| 1567 | + } |
---|
1300 | 1568 | |
---|
1301 | | - v4l2_ctrl_new_std(handler, NULL, V4L2_CID_PIXEL_RATE, |
---|
1302 | | - 0, PIXEL_RATE_WITH_405M_10BIT, 1, PIXEL_RATE_WITH_405M_10BIT); |
---|
1303 | 1569 | |
---|
1304 | 1570 | h_blank = mode->hts_def - mode->width; |
---|
1305 | 1571 | sc223a->hblank = v4l2_ctrl_new_std(handler, NULL, V4L2_CID_HBLANK, |
---|
.. | .. |
---|
1412 | 1678 | &sc223a->module_name); |
---|
1413 | 1679 | ret |= of_property_read_string(node, RKMODULE_CAMERA_LENS_NAME, |
---|
1414 | 1680 | &sc223a->len_name); |
---|
| 1681 | + ret |= of_property_read_string(node, RKMODULE_CAMERA_MODULE_MODE, |
---|
| 1682 | + &sc223a->mode); |
---|
1415 | 1683 | if (ret) { |
---|
1416 | 1684 | dev_err(dev, "could not get module information!\n"); |
---|
1417 | 1685 | return -EINVAL; |
---|
.. | .. |
---|
1420 | 1688 | sc223a->is_thunderboot = IS_ENABLED(CONFIG_VIDEO_ROCKCHIP_THUNDER_BOOT_ISP); |
---|
1421 | 1689 | |
---|
1422 | 1690 | sc223a->client = client; |
---|
1423 | | - for (i = 0; i < ARRAY_SIZE(supported_modes); i++) { |
---|
1424 | | - if (hdr_mode == supported_modes[i].hdr_mode) { |
---|
1425 | | - sc223a->cur_mode = &supported_modes[i]; |
---|
1426 | | - break; |
---|
| 1691 | + if (!strcmp(sc223a->mode, CAMERA_MIPI_MODE)) { |
---|
| 1692 | + for (i = 0; i < ARRAY_SIZE(supported_modes); i++) { |
---|
| 1693 | + if (hdr_mode == supported_modes[i].hdr_mode) { |
---|
| 1694 | + sc223a->cur_mode = &supported_modes[i]; |
---|
| 1695 | + break; |
---|
| 1696 | + } |
---|
1427 | 1697 | } |
---|
| 1698 | + if (i == ARRAY_SIZE(supported_modes)) |
---|
| 1699 | + sc223a->cur_mode = &supported_modes[SC223A_MIPI_1920X1080]; |
---|
| 1700 | + } else if (!strcmp(sc223a->mode, CAMERA_DVP_MODE)) { |
---|
| 1701 | + sc223a->cur_mode = &supported_modes[SC223A_DVP_1920X1080]; |
---|
1428 | 1702 | } |
---|
1429 | | - if (i == ARRAY_SIZE(supported_modes)) |
---|
1430 | | - sc223a->cur_mode = &supported_modes[0]; |
---|
1431 | 1703 | |
---|
1432 | 1704 | sc223a->xvclk = devm_clk_get(dev, "xvclk"); |
---|
1433 | 1705 | if (IS_ERR(sc223a->xvclk)) { |
---|