forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/drivers/media/i2c/ov9650.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Omnivision OV9650/OV9652 CMOS Image Sensor driver
34 *
....@@ -6,10 +7,6 @@
67 * Register definitions and initial settings based on a driver written
78 * by Vladimir Fonov.
89 * Copyright (c) 2010, Vladimir Fonov
9
- *
10
- * This program is free software; you can redistribute it and/or modify
11
- * it under the terms of the GNU General Public License version 2 as
12
- * published by the Free Software Foundation.
1310 */
1411 #include <linux/clk.h>
1512 #include <linux/delay.h>
....@@ -20,6 +17,7 @@
2017 #include <linux/media.h>
2118 #include <linux/module.h>
2219 #include <linux/ratelimit.h>
20
+#include <linux/regmap.h>
2321 #include <linux/slab.h>
2422 #include <linux/string.h>
2523 #include <linux/videodev2.h>
....@@ -44,8 +42,8 @@
4442 * OV9650/OV9652 register definitions
4543 */
4644 #define REG_GAIN 0x00 /* Gain control, AGC[7:0] */
47
-#define REG_BLUE 0x01 /* AWB - Blue chanel gain */
48
-#define REG_RED 0x02 /* AWB - Red chanel gain */
45
+#define REG_BLUE 0x01 /* AWB - Blue channel gain */
46
+#define REG_RED 0x02 /* AWB - Red channel gain */
4947 #define REG_VREF 0x03 /* [7:6] - AGC[9:8], [5:3]/[2:0] */
5048 #define VREF_GAIN_MASK 0xc0 /* - VREF end/start low 3 bits */
5149 #define REG_COM1 0x04
....@@ -259,7 +257,7 @@
259257 /* Protects the struct fields below */
260258 struct mutex lock;
261259
262
- struct i2c_client *client;
260
+ struct regmap *regmap;
263261
264262 /* Exposure row interval in us */
265263 unsigned int exp_row_interval;
....@@ -424,51 +422,42 @@
424422 return container_of(sd, struct ov965x, sd);
425423 }
426424
427
-static int ov965x_read(struct i2c_client *client, u8 addr, u8 *val)
425
+static int ov965x_read(struct ov965x *ov965x, u8 addr, u8 *val)
428426 {
429
- u8 buf = addr;
430
- struct i2c_msg msg = {
431
- .addr = client->addr,
432
- .flags = 0,
433
- .len = 1,
434
- .buf = &buf
435
- };
436427 int ret;
428
+ unsigned int buf;
437429
438
- ret = i2c_transfer(client->adapter, &msg, 1);
439
- if (ret == 1) {
440
- msg.flags = I2C_M_RD;
441
- ret = i2c_transfer(client->adapter, &msg, 1);
430
+ ret = regmap_read(ov965x->regmap, addr, &buf);
431
+ if (!ret)
432
+ *val = buf;
433
+ else
434
+ *val = -1;
442435
443
- if (ret == 1)
444
- *val = buf;
445
- }
446
-
447
- v4l2_dbg(2, debug, client, "%s: 0x%02x @ 0x%02x. (%d)\n",
436
+ v4l2_dbg(2, debug, &ov965x->sd, "%s: 0x%02x @ 0x%02x. (%d)\n",
448437 __func__, *val, addr, ret);
449438
450
- return ret == 1 ? 0 : ret;
439
+ return ret;
451440 }
452441
453
-static int ov965x_write(struct i2c_client *client, u8 addr, u8 val)
442
+static int ov965x_write(struct ov965x *ov965x, u8 addr, u8 val)
454443 {
455
- u8 buf[2] = { addr, val };
444
+ int ret;
456445
457
- int ret = i2c_master_send(client, buf, 2);
446
+ ret = regmap_write(ov965x->regmap, addr, val);
458447
459
- v4l2_dbg(2, debug, client, "%s: 0x%02x @ 0x%02X (%d)\n",
448
+ v4l2_dbg(2, debug, &ov965x->sd, "%s: 0x%02x @ 0x%02X (%d)\n",
460449 __func__, val, addr, ret);
461450
462
- return ret == 2 ? 0 : ret;
451
+ return ret;
463452 }
464453
465
-static int ov965x_write_array(struct i2c_client *client,
454
+static int ov965x_write_array(struct ov965x *ov965x,
466455 const struct i2c_rv *regs)
467456 {
468457 int i, ret = 0;
469458
470459 for (i = 0; ret == 0 && regs[i].addr != REG_NULL; i++)
471
- ret = ov965x_write(client, regs[i].addr, regs[i].value);
460
+ ret = ov965x_write(ov965x, regs[i].addr, regs[i].value);
472461
473462 return ret;
474463 }
....@@ -486,7 +475,7 @@
486475 unsigned int i;
487476
488477 for (i = 0; i < ARRAY_SIZE(gamma_curve); i++) {
489
- int ret = ov965x_write(ov965x->client, addr, gamma_curve[i]);
478
+ int ret = ov965x_write(ov965x, addr, gamma_curve[i]);
490479
491480 if (ret < 0)
492481 return ret;
....@@ -506,7 +495,7 @@
506495 unsigned int i;
507496
508497 for (i = 0; i < ARRAY_SIZE(mtx); i++) {
509
- int ret = ov965x_write(ov965x->client, addr, mtx[i]);
498
+ int ret = ov965x_write(ov965x, addr, mtx[i]);
510499
511500 if (ret < 0)
512501 return ret;
....@@ -542,16 +531,15 @@
542531 static int ov965x_s_power(struct v4l2_subdev *sd, int on)
543532 {
544533 struct ov965x *ov965x = to_ov965x(sd);
545
- struct i2c_client *client = ov965x->client;
546534 int ret = 0;
547535
548
- v4l2_dbg(1, debug, client, "%s: on: %d\n", __func__, on);
536
+ v4l2_dbg(1, debug, sd, "%s: on: %d\n", __func__, on);
549537
550538 mutex_lock(&ov965x->lock);
551539 if (ov965x->power == !on) {
552540 ret = __ov965x_set_power(ov965x, on);
553541 if (!ret && on) {
554
- ret = ov965x_write_array(client,
542
+ ret = ov965x_write_array(ov965x,
555543 ov965x_init_regs);
556544 ov965x->apply_frame_fmt = 1;
557545 ov965x->ctrls.update = 1;
....@@ -609,13 +597,13 @@
609597 int ret;
610598 u8 reg;
611599
612
- ret = ov965x_read(ov965x->client, REG_COM8, &reg);
600
+ ret = ov965x_read(ov965x, REG_COM8, &reg);
613601 if (!ret) {
614602 if (value == V4L2_CID_POWER_LINE_FREQUENCY_DISABLED)
615603 reg &= ~COM8_BFILT;
616604 else
617605 reg |= COM8_BFILT;
618
- ret = ov965x_write(ov965x->client, REG_COM8, reg);
606
+ ret = ov965x_write(ov965x, REG_COM8, reg);
619607 }
620608 if (value == V4L2_CID_POWER_LINE_FREQUENCY_DISABLED)
621609 return 0;
....@@ -631,7 +619,7 @@
631619 ov965x->fiv->interval.numerator;
632620 mbd = ((mbd / (light_freq * 2)) + 500) / 1000UL;
633621
634
- return ov965x_write(ov965x->client, REG_MBD, mbd);
622
+ return ov965x_write(ov965x, REG_MBD, mbd);
635623 }
636624
637625 static int ov965x_set_white_balance(struct ov965x *ov965x, int awb)
....@@ -639,17 +627,17 @@
639627 int ret;
640628 u8 reg;
641629
642
- ret = ov965x_read(ov965x->client, REG_COM8, &reg);
630
+ ret = ov965x_read(ov965x, REG_COM8, &reg);
643631 if (!ret) {
644632 reg = awb ? reg | REG_COM8 : reg & ~REG_COM8;
645
- ret = ov965x_write(ov965x->client, REG_COM8, reg);
633
+ ret = ov965x_write(ov965x, REG_COM8, reg);
646634 }
647635 if (!ret && !awb) {
648
- ret = ov965x_write(ov965x->client, REG_BLUE,
636
+ ret = ov965x_write(ov965x, REG_BLUE,
649637 ov965x->ctrls.blue_balance->val);
650638 if (ret < 0)
651639 return ret;
652
- ret = ov965x_write(ov965x->client, REG_RED,
640
+ ret = ov965x_write(ov965x, REG_RED,
653641 ov965x->ctrls.red_balance->val);
654642 }
655643 return ret;
....@@ -677,14 +665,13 @@
677665 return -EINVAL;
678666
679667 for (i = 0; i < NUM_BR_REGS && !ret; i++)
680
- ret = ov965x_write(ov965x->client, regs[0][i],
668
+ ret = ov965x_write(ov965x, regs[0][i],
681669 regs[val][i]);
682670 return ret;
683671 }
684672
685673 static int ov965x_set_gain(struct ov965x *ov965x, int auto_gain)
686674 {
687
- struct i2c_client *client = ov965x->client;
688675 struct ov965x_ctrls *ctrls = &ov965x->ctrls;
689676 int ret = 0;
690677 u8 reg;
....@@ -693,14 +680,14 @@
693680 * gain value in REG_VREF, REG_GAIN is not overwritten.
694681 */
695682 if (ctrls->auto_gain->is_new) {
696
- ret = ov965x_read(client, REG_COM8, &reg);
683
+ ret = ov965x_read(ov965x, REG_COM8, &reg);
697684 if (ret < 0)
698685 return ret;
699686 if (ctrls->auto_gain->val)
700687 reg |= COM8_AGC;
701688 else
702689 reg &= ~COM8_AGC;
703
- ret = ov965x_write(client, REG_COM8, reg);
690
+ ret = ov965x_write(ov965x, REG_COM8, reg);
704691 if (ret < 0)
705692 return ret;
706693 }
....@@ -724,15 +711,15 @@
724711 rgain = (gain - ((1 << m) * 16)) / (1 << m);
725712 rgain |= (((1 << m) - 1) << 4);
726713
727
- ret = ov965x_write(client, REG_GAIN, rgain & 0xff);
714
+ ret = ov965x_write(ov965x, REG_GAIN, rgain & 0xff);
728715 if (ret < 0)
729716 return ret;
730
- ret = ov965x_read(client, REG_VREF, &reg);
717
+ ret = ov965x_read(ov965x, REG_VREF, &reg);
731718 if (ret < 0)
732719 return ret;
733720 reg &= ~VREF_GAIN_MASK;
734721 reg |= (((rgain >> 8) & 0x3) << 6);
735
- ret = ov965x_write(client, REG_VREF, reg);
722
+ ret = ov965x_write(ov965x, REG_VREF, reg);
736723 if (ret < 0)
737724 return ret;
738725 /* Return updated control's value to userspace */
....@@ -747,10 +734,10 @@
747734 u8 com14, edge;
748735 int ret;
749736
750
- ret = ov965x_read(ov965x->client, REG_COM14, &com14);
737
+ ret = ov965x_read(ov965x, REG_COM14, &com14);
751738 if (ret < 0)
752739 return ret;
753
- ret = ov965x_read(ov965x->client, REG_EDGE, &edge);
740
+ ret = ov965x_read(ov965x, REG_EDGE, &edge);
754741 if (ret < 0)
755742 return ret;
756743 com14 = value ? com14 | COM14_EDGE_EN : com14 & ~COM14_EDGE_EN;
....@@ -761,33 +748,32 @@
761748 } else {
762749 com14 &= ~COM14_EEF_X2;
763750 }
764
- ret = ov965x_write(ov965x->client, REG_COM14, com14);
751
+ ret = ov965x_write(ov965x, REG_COM14, com14);
765752 if (ret < 0)
766753 return ret;
767754
768755 edge &= ~EDGE_FACTOR_MASK;
769756 edge |= ((u8)value & 0x0f);
770757
771
- return ov965x_write(ov965x->client, REG_EDGE, edge);
758
+ return ov965x_write(ov965x, REG_EDGE, edge);
772759 }
773760
774761 static int ov965x_set_exposure(struct ov965x *ov965x, int exp)
775762 {
776
- struct i2c_client *client = ov965x->client;
777763 struct ov965x_ctrls *ctrls = &ov965x->ctrls;
778764 bool auto_exposure = (exp == V4L2_EXPOSURE_AUTO);
779765 int ret;
780766 u8 reg;
781767
782768 if (ctrls->auto_exp->is_new) {
783
- ret = ov965x_read(client, REG_COM8, &reg);
769
+ ret = ov965x_read(ov965x, REG_COM8, &reg);
784770 if (ret < 0)
785771 return ret;
786772 if (auto_exposure)
787773 reg |= (COM8_AEC | COM8_AGC);
788774 else
789775 reg &= ~(COM8_AEC | COM8_AGC);
790
- ret = ov965x_write(client, REG_COM8, reg);
776
+ ret = ov965x_write(ov965x, REG_COM8, reg);
791777 if (ret < 0)
792778 return ret;
793779 }
....@@ -799,12 +785,12 @@
799785 * Manual exposure value
800786 * [b15:b0] - AECHM (b15:b10), AECH (b9:b2), COM1 (b1:b0)
801787 */
802
- ret = ov965x_write(client, REG_COM1, exposure & 0x3);
788
+ ret = ov965x_write(ov965x, REG_COM1, exposure & 0x3);
803789 if (!ret)
804
- ret = ov965x_write(client, REG_AECH,
790
+ ret = ov965x_write(ov965x, REG_AECH,
805791 (exposure >> 2) & 0xff);
806792 if (!ret)
807
- ret = ov965x_write(client, REG_AECHM,
793
+ ret = ov965x_write(ov965x, REG_AECHM,
808794 (exposure >> 10) & 0x3f);
809795 /* Update the value to minimize rounding errors */
810796 ctrls->exposure->val = ((exposure * ov965x->exp_row_interval)
....@@ -827,7 +813,7 @@
827813 if (ov965x->ctrls.vflip->val)
828814 mvfp |= MVFP_FLIP;
829815
830
- return ov965x_write(ov965x->client, REG_MVFP, mvfp);
816
+ return ov965x_write(ov965x, REG_MVFP, mvfp);
831817 }
832818
833819 #define NUM_SAT_LEVELS 5
....@@ -851,7 +837,7 @@
851837 return -EINVAL;
852838
853839 for (i = 0; i < NUM_SAT_REGS && !ret; i++)
854
- ret = ov965x_write(ov965x->client, addr + i, regs[val][i]);
840
+ ret = ov965x_write(ov965x, addr + i, regs[val][i]);
855841
856842 return ret;
857843 }
....@@ -861,16 +847,15 @@
861847 int ret;
862848 u8 reg;
863849
864
- ret = ov965x_read(ov965x->client, REG_COM23, &reg);
850
+ ret = ov965x_read(ov965x, REG_COM23, &reg);
865851 if (ret < 0)
866852 return ret;
867853 reg = value ? reg | COM23_TEST_MODE : reg & ~COM23_TEST_MODE;
868
- return ov965x_write(ov965x->client, REG_COM23, reg);
854
+ return ov965x_write(ov965x, REG_COM23, reg);
869855 }
870856
871857 static int __g_volatile_ctrl(struct ov965x *ov965x, struct v4l2_ctrl *ctrl)
872858 {
873
- struct i2c_client *client = ov965x->client;
874859 unsigned int exposure, gain, m;
875860 u8 reg0, reg1, reg2;
876861 int ret;
....@@ -882,10 +867,10 @@
882867 case V4L2_CID_AUTOGAIN:
883868 if (!ctrl->val)
884869 return 0;
885
- ret = ov965x_read(client, REG_GAIN, &reg0);
870
+ ret = ov965x_read(ov965x, REG_GAIN, &reg0);
886871 if (ret < 0)
887872 return ret;
888
- ret = ov965x_read(client, REG_VREF, &reg1);
873
+ ret = ov965x_read(ov965x, REG_VREF, &reg1);
889874 if (ret < 0)
890875 return ret;
891876 gain = ((reg1 >> 6) << 8) | reg0;
....@@ -896,13 +881,13 @@
896881 case V4L2_CID_EXPOSURE_AUTO:
897882 if (ctrl->val == V4L2_EXPOSURE_MANUAL)
898883 return 0;
899
- ret = ov965x_read(client, REG_COM1, &reg0);
884
+ ret = ov965x_read(ov965x, REG_COM1, &reg0);
900885 if (ret < 0)
901886 return ret;
902
- ret = ov965x_read(client, REG_AECH, &reg1);
887
+ ret = ov965x_read(ov965x, REG_AECH, &reg1);
903888 if (ret < 0)
904889 return ret;
905
- ret = ov965x_read(client, REG_AECHM, &reg2);
890
+ ret = ov965x_read(ov965x, REG_AECHM, &reg2);
906891 if (ret < 0)
907892 return ret;
908893 exposure = ((reg2 & 0x3f) << 10) | (reg1 << 2) |
....@@ -1123,9 +1108,7 @@
11231108 {
11241109 struct ov965x *ov965x = to_ov965x(sd);
11251110
1126
- mutex_lock(&ov965x->lock);
11271111 fi->interval = ov965x->fiv->interval;
1128
- mutex_unlock(&ov965x->lock);
11291112
11301113 return 0;
11311114 }
....@@ -1284,32 +1267,31 @@
12841267 int i, ret = 0;
12851268
12861269 for (i = 0; ret == 0 && i < NUM_FMT_REGS; i++)
1287
- ret = ov965x_write(ov965x->client, frame_size_reg_addr[i],
1270
+ ret = ov965x_write(ov965x, frame_size_reg_addr[i],
12881271 ov965x->frame_size->regs[i]);
12891272 return ret;
12901273 }
12911274
12921275 static int __ov965x_set_params(struct ov965x *ov965x)
12931276 {
1294
- struct i2c_client *client = ov965x->client;
12951277 struct ov965x_ctrls *ctrls = &ov965x->ctrls;
12961278 int ret = 0;
12971279 u8 reg;
12981280
12991281 if (ov965x->apply_frame_fmt) {
13001282 reg = DEF_CLKRC + ov965x->fiv->clkrc_div;
1301
- ret = ov965x_write(client, REG_CLKRC, reg);
1283
+ ret = ov965x_write(ov965x, REG_CLKRC, reg);
13021284 if (ret < 0)
13031285 return ret;
13041286 ret = ov965x_set_frame_size(ov965x);
13051287 if (ret < 0)
13061288 return ret;
1307
- ret = ov965x_read(client, REG_TSLB, &reg);
1289
+ ret = ov965x_read(ov965x, REG_TSLB, &reg);
13081290 if (ret < 0)
13091291 return ret;
13101292 reg &= ~TSLB_YUYV_MASK;
13111293 reg |= ov965x->tslb_reg;
1312
- ret = ov965x_write(client, REG_TSLB, reg);
1294
+ ret = ov965x_write(ov965x, REG_TSLB, reg);
13131295 if (ret < 0)
13141296 return ret;
13151297 }
....@@ -1323,10 +1305,10 @@
13231305 * Select manual banding filter, the filter will
13241306 * be enabled further if required.
13251307 */
1326
- ret = ov965x_read(client, REG_COM11, &reg);
1308
+ ret = ov965x_read(ov965x, REG_COM11, &reg);
13271309 if (!ret)
13281310 reg |= COM11_BANDING;
1329
- ret = ov965x_write(client, REG_COM11, reg);
1311
+ ret = ov965x_write(ov965x, REG_COM11, reg);
13301312 if (ret < 0)
13311313 return ret;
13321314 /*
....@@ -1338,12 +1320,11 @@
13381320
13391321 static int ov965x_s_stream(struct v4l2_subdev *sd, int on)
13401322 {
1341
- struct i2c_client *client = v4l2_get_subdevdata(sd);
13421323 struct ov965x *ov965x = to_ov965x(sd);
13431324 struct ov965x_ctrls *ctrls = &ov965x->ctrls;
13441325 int ret = 0;
13451326
1346
- v4l2_dbg(1, debug, client, "%s: on: %d\n", __func__, on);
1327
+ v4l2_dbg(1, debug, sd, "%s: on: %d\n", __func__, on);
13471328
13481329 mutex_lock(&ov965x->lock);
13491330 if (ov965x->streaming == !on) {
....@@ -1363,7 +1344,7 @@
13631344 ctrls->update = 0;
13641345 }
13651346 if (!ret)
1366
- ret = ov965x_write(client, REG_COM2,
1347
+ ret = ov965x_write(ov965x, REG_COM2,
13671348 on ? 0x01 : 0x11);
13681349 }
13691350 if (!ret)
....@@ -1426,6 +1407,7 @@
14261407 {
14271408 int ret, i;
14281409 int gpios[NUM_GPIOS];
1410
+ struct device *dev = regmap_get_device(ov965x->regmap);
14291411
14301412 gpios[GPIO_PWDN] = pdata->gpio_pwdn;
14311413 gpios[GPIO_RST] = pdata->gpio_reset;
....@@ -1435,7 +1417,7 @@
14351417
14361418 if (!gpio_is_valid(gpio))
14371419 continue;
1438
- ret = devm_gpio_request_one(&ov965x->client->dev, gpio,
1420
+ ret = devm_gpio_request_one(dev, gpio,
14391421 GPIOF_OUT_INIT_HIGH, "OV965X");
14401422 if (ret < 0)
14411423 return ret;
....@@ -1451,7 +1433,7 @@
14511433
14521434 static int ov965x_configure_gpios(struct ov965x *ov965x)
14531435 {
1454
- struct device *dev = &ov965x->client->dev;
1436
+ struct device *dev = regmap_get_device(ov965x->regmap);
14551437
14561438 ov965x->gpios[GPIO_PWDN] = devm_gpiod_get_optional(dev, "powerdown",
14571439 GPIOD_OUT_HIGH);
....@@ -1472,7 +1454,6 @@
14721454
14731455 static int ov965x_detect_sensor(struct v4l2_subdev *sd)
14741456 {
1475
- struct i2c_client *client = v4l2_get_subdevdata(sd);
14761457 struct ov965x *ov965x = to_ov965x(sd);
14771458 u8 pid, ver;
14781459 int ret;
....@@ -1485,9 +1466,9 @@
14851466 msleep(25);
14861467
14871468 /* Check sensor revision */
1488
- ret = ov965x_read(client, REG_PID, &pid);
1469
+ ret = ov965x_read(ov965x, REG_PID, &pid);
14891470 if (!ret)
1490
- ret = ov965x_read(client, REG_VER, &ver);
1471
+ ret = ov965x_read(ov965x, REG_VER, &ver);
14911472
14921473 __ov965x_set_power(ov965x, 0);
14931474
....@@ -1507,19 +1488,27 @@
15071488 return ret;
15081489 }
15091490
1510
-static int ov965x_probe(struct i2c_client *client,
1511
- const struct i2c_device_id *id)
1491
+static int ov965x_probe(struct i2c_client *client)
15121492 {
15131493 const struct ov9650_platform_data *pdata = client->dev.platform_data;
15141494 struct v4l2_subdev *sd;
15151495 struct ov965x *ov965x;
15161496 int ret;
1497
+ static const struct regmap_config ov965x_regmap_config = {
1498
+ .reg_bits = 8,
1499
+ .val_bits = 8,
1500
+ .max_register = 0xab,
1501
+ };
15171502
15181503 ov965x = devm_kzalloc(&client->dev, sizeof(*ov965x), GFP_KERNEL);
15191504 if (!ov965x)
15201505 return -ENOMEM;
15211506
1522
- ov965x->client = client;
1507
+ ov965x->regmap = devm_regmap_init_sccb(client, &ov965x_regmap_config);
1508
+ if (IS_ERR(ov965x->regmap)) {
1509
+ dev_err(&client->dev, "Failed to allocate register map\n");
1510
+ return PTR_ERR(ov965x->regmap);
1511
+ }
15231512
15241513 if (pdata) {
15251514 if (pdata->mclk_frequency == 0) {
....@@ -1532,7 +1521,7 @@
15321521 if (ret < 0)
15331522 return ret;
15341523 } else if (dev_fwnode(&client->dev)) {
1535
- ov965x->clk = devm_clk_get(&ov965x->client->dev, NULL);
1524
+ ov965x->clk = devm_clk_get(&client->dev, NULL);
15361525 if (IS_ERR(ov965x->clk))
15371526 return PTR_ERR(ov965x->clk);
15381527 ov965x->mclk_frequency = clk_get_rate(ov965x->clk);
....@@ -1551,7 +1540,7 @@
15511540
15521541 sd = &ov965x->sd;
15531542 v4l2_i2c_subdev_init(sd, client, &ov965x_subdev_ops);
1554
- strlcpy(sd->name, DRIVER_NAME, sizeof(sd->name));
1543
+ strscpy(sd->name, DRIVER_NAME, sizeof(sd->name));
15551544
15561545 sd->internal_ops = &ov965x_sd_internal_ops;
15571546 sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE |
....@@ -1626,7 +1615,7 @@
16261615 .name = DRIVER_NAME,
16271616 .of_match_table = of_match_ptr(ov965x_of_match),
16281617 },
1629
- .probe = ov965x_probe,
1618
+ .probe_new = ov965x_probe,
16301619 .remove = ov965x_remove,
16311620 .id_table = ov965x_id,
16321621 };