This repository has been archived by the owner on Jul 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
0060-media-platform-add-IPU-platform-configuration-data.patch
1660 lines (1654 loc) · 40.8 KB
/
0060-media-platform-add-IPU-platform-configuration-data.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Meng Wei <[email protected]>
Date: Fri, 26 Oct 2018 09:53:06 +0800
Subject: [PATCH] media: platform: add IPU platform configuration data
These data are used for i2c device detection and resource
revervation.
Signed-off-by: Chang Ying <[email protected]>
Signed-off-by: Meng Wei <[email protected]>
---
drivers/media/platform/Kconfig | 1 +
drivers/media/platform/Makefile | 1 +
drivers/media/platform/intel/Kconfig | 95 ++
drivers/media/platform/intel/Makefile | 21 +
.../media/platform/intel/ipu4-bxt-gp-pdata.c | 123 ++
.../media/platform/intel/ipu4-bxt-p-pdata.c | 1161 +++++++++++++++++
.../platform/intel/ipu4p-icl-rvp-pdata.c | 181 +++
7 files changed, 1583 insertions(+)
create mode 100644 drivers/media/platform/intel/Kconfig
create mode 100644 drivers/media/platform/intel/Makefile
create mode 100644 drivers/media/platform/intel/ipu4-bxt-gp-pdata.c
create mode 100644 drivers/media/platform/intel/ipu4-bxt-p-pdata.c
create mode 100644 drivers/media/platform/intel/ipu4p-icl-rvp-pdata.c
diff --git a/drivers/media/platform/Kconfig b/drivers/media/platform/Kconfig
index 54fe90acb5b2..76b67179062d 100644
--- a/drivers/media/platform/Kconfig
+++ b/drivers/media/platform/Kconfig
@@ -137,6 +137,7 @@ source "drivers/media/platform/am437x/Kconfig"
source "drivers/media/platform/xilinx/Kconfig"
source "drivers/media/platform/rcar-vin/Kconfig"
source "drivers/media/platform/atmel/Kconfig"
+source "drivers/media/platform/intel/Kconfig"
config VIDEO_TI_CAL
tristate "TI CAL (Camera Adaptation Layer) driver"
diff --git a/drivers/media/platform/Makefile b/drivers/media/platform/Makefile
index 41322ab65802..f8c6a9c14add 100644
--- a/drivers/media/platform/Makefile
+++ b/drivers/media/platform/Makefile
@@ -96,3 +96,4 @@ obj-$(CONFIG_VIDEO_QCOM_VENUS) += qcom/venus/
obj-y += meson/
obj-y += cros-ec-cec/
+obj-y += intel/
diff --git a/drivers/media/platform/intel/Kconfig b/drivers/media/platform/intel/Kconfig
new file mode 100644
index 000000000000..7dc176af66f2
--- /dev/null
+++ b/drivers/media/platform/intel/Kconfig
@@ -0,0 +1,95 @@
+config INTEL_IPU4_BXT_P_PDATA
+ bool "Enable built in platform data for Broxton-P"
+ depends on VIDEO_INTEL_IPU && VIDEO_INTEL_IPU4
+ ---help---
+ Pre-ACPI system platform data is compiled inside kernel
+
+config INTEL_IPU4_BXT_GP_PDATA
+ bool "Enable built in platform data for Broxton-P"
+ depends on VIDEO_INTEL_IPU && VIDEO_INTEL_IPU4
+ ---help---
+ Pre-ACPI system platform data is compiled inside kernel
+
+config INTEL_IPU4P_ICL_RVP_PDATA
+ bool "Enable built in platform data for ipu4p"
+ depends on VIDEO_INTEL_IPU && VIDEO_INTEL_IPU4P
+ ---help---
+ Pre-ACPI system platform data is compiled inside kernel
+
+config INTEL_IPU4_OV2740
+ bool "Compile platform data for OV2740"
+ depends on INTEL_IPU4_BXT_P_PDATA
+
+config INTEL_IPU4_IMX185
+ bool "Compile platform data for IMX185"
+ depends on INTEL_IPU4_BXT_P_PDATA
+
+config INTEL_IPU4_AR023Z
+ bool "Compile platform data for AR023Z"
+ ---help---
+ Onsemi 2MP AR023Z camera sensor
+
+config INTEL_IPU4_IMX477
+ bool "Compile platform data for IMX477 camera sensor"
+ depends on INTEL_IPU4_BXT_P_PDATA
+ ---help---
+ Sony IMX477 sensor is enabled for DUAL Camera input.
+
+config INTEL_IPU4_OV13860
+ bool "Compile platform data for OV13860"
+ ---help---
+ Omnivision 13MP camera sensor
+
+config INTEL_IPU4_OV9281
+ bool "Compile platform data for OV9281"
+ ---help---
+ Omnivision 1MP camera sensor
+
+config INTEL_IPU4_OV10635
+ bool "Compile platform data for OV10635"
+ ---help---
+ Omnivision 1MP camera sensor
+
+config INTEL_IPU4_AR0231AT
+ bool "Compile platform data for AR0231AT"
+ ---help---
+ AR0231 camera sensor for MAXIM 9286
+
+config INTEL_IPU4_MAGNA
+ bool "Compile platform data for MAGNA"
+ depends on INTEL_IPU4_BXT_P_PDATA
+ ---help---
+ MAGNA Camera Sensor
+
+config INTEL_IPU4_IMX274
+ bool "Compile platform data for IMX274 camera sensor"
+ depends on INTEL_IPU4_BXT_P_PDATA
+ ---help---
+ Sony 14MP camera sensor is enabled for HDR function.
+
+config INTEL_IPU4_OV10640
+ bool "Compile platform data for OV10640"
+ ---help---
+ Omnivision 1.4MP camera sensor
+
+config INTEL_IPU4_ADV7481
+ bool "Compile platform data for ADV7481"
+ ---help---
+ HDMI2MIPI convertor device ADV7481
+
+config INTEL_IPU4_ADV7481_EVAL
+ bool "Compile platform data for ADV7481 evaluation board"
+ ---help---
+ HDMI2MIPI convertor device ADV7481 eval board
+
+config INTEL_IPU4_IMX290
+ bool "Compile platform data for IMX290"
+ depends on INTEL_IPU4_BXT_P_PDATA
+ ---help---
+ "Sony 8MB camera sensor is enabled for HDR function"
+
+config INTEL_IPU4_OX03A10
+ bool "Compile platorm data for OX03A10"
+ depends on INTEL_IPU4_BXT_P_PDATA
+ ---help---
+ "ox03a10 camera sensor"
diff --git a/drivers/media/platform/intel/Makefile b/drivers/media/platform/intel/Makefile
new file mode 100644
index 000000000000..b6d4f786f20b
--- /dev/null
+++ b/drivers/media/platform/intel/Makefile
@@ -0,0 +1,21 @@
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (c) 2010 - 2018, Intel Corporation.
+
+ifneq ($(EXTERNAL_BUILD), 1)
+srcpath := $(srctree)
+endif
+
+# force check the compile warning to make sure zero warnings
+# note we may have build issue when gcc upgraded.
+ccflags-y := -Wall -Wextra
+ccflags-y += $(call cc-disable-warning, unused-parameter)
+ccflags-y += $(call cc-disable-warning, implicit-fallthrough)
+ccflags-y += $(call cc-disable-warning, missing-field-initializers)
+ccflags-$(CONFIG_VIDEO_INTEL_IPU_WERROR) += -Werror
+
+ccflags-y += -I$(srcpath)/$(src)/../../../../include/
+ccflags-y += -I$(srcpath)/$(src)/../../pci/intel/
+
+obj-$(CONFIG_INTEL_IPU4_BXT_P_PDATA) += ipu4-bxt-p-pdata.o
+obj-$(CONFIG_INTEL_IPU4_BXT_GP_PDATA) += ipu4-bxt-gp-pdata.o
+obj-$(CONFIG_INTEL_IPU4P_ICL_RVP_PDATA) += ipu4p-icl-rvp-pdata.o
diff --git a/drivers/media/platform/intel/ipu4-bxt-gp-pdata.c b/drivers/media/platform/intel/ipu4-bxt-gp-pdata.c
new file mode 100644
index 000000000000..9acfafc9cf42
--- /dev/null
+++ b/drivers/media/platform/intel/ipu4-bxt-gp-pdata.c
@@ -0,0 +1,123 @@
+/*
+ * Copyright (c) 2016--2017 Intel Corporation.
+ *
+ * Author: Jouni Ukkonen <[email protected]>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version
+ * 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ */
+#include <linux/clk.h>
+#include <linux/clkdev.h>
+#include <linux/gpio.h>
+#include <linux/kernel.h>
+#include <linux/pci.h>
+
+#include <media/ipu-isys.h>
+#include <media/crlmodule.h>
+#include "ipu.h"
+
+#define ADV7481_HDMI_LANES 4
+#define ADV7481_HDMI_I2C_ADDRESS 0xe0
+
+#define ADV7481_LANES 1
+/*
+ * below i2c address is dummy one, to be able to register single
+ * ADV7481 chip as two sensors
+ */
+#define ADV7481_I2C_ADDRESS 0xe1
+
+
+#define GPIO_BASE 434
+
+
+static struct crlmodule_platform_data adv7481_cvbs_pdata = {
+ .ext_clk = 286363636,
+ .xshutdown = GPIO_BASE + 64, /*dummy for now*/
+ .lanes = ADV7481_LANES,
+ .module_name = "ADV7481 CVBS",
+ .suffix = 'a',
+};
+
+static struct ipu_isys_csi2_config adv7481_cvbs_csi2_cfg = {
+ .nlanes = ADV7481_LANES,
+ .port = 4,
+};
+
+static struct ipu_isys_subdev_info adv7481_cvbs_crl_sd = {
+ .csi2 = &adv7481_cvbs_csi2_cfg,
+ .i2c = {
+ .board_info = {
+ .type = CRLMODULE_NAME,
+ .flags = I2C_CLIENT_TEN,
+ .addr = ADV7481_I2C_ADDRESS,
+ .platform_data = &adv7481_cvbs_pdata,
+ },
+ .i2c_adapter_id = 0,
+ }
+};
+
+static struct crlmodule_platform_data adv7481_hdmi_pdata = {
+ /* FIXME: may need to revisit */
+ .ext_clk = 286363636,
+ .xshutdown = GPIO_BASE + 30,
+ .lanes = ADV7481_HDMI_LANES,
+ .module_name = "ADV7481 HDMI",
+ .crl_irq_pin = GPIO_BASE + 22,
+ .irq_pin_flags = (IRQF_TRIGGER_RISING | IRQF_ONESHOT),
+ .irq_pin_name = "ADV7481_HDMI_IRQ",
+ .suffix = 'a',
+};
+
+static struct ipu_isys_csi2_config adv7481_hdmi_csi2_cfg = {
+ .nlanes = ADV7481_HDMI_LANES,
+ .port = 0,
+};
+
+static struct ipu_isys_subdev_info adv7481_hdmi_crl_sd = {
+ .csi2 = &adv7481_hdmi_csi2_cfg,
+ .i2c = {
+ .board_info = {
+ .type = CRLMODULE_NAME,
+ .flags = I2C_CLIENT_TEN,
+ .addr = ADV7481_HDMI_I2C_ADDRESS,
+ .platform_data = &adv7481_hdmi_pdata,
+ },
+ .i2c_adapter_id = 0,
+ }
+};
+
+
+
+/*
+ * Map buttress output sensor clocks to sensors -
+ * this should be coming from ACPI, in Gordon Peak
+ * ADV7481 have its own oscillator, no buttres clock
+ * needed.
+ */
+struct ipu_isys_clk_mapping gp_mapping[] = {
+ { CLKDEV_INIT(NULL, NULL, NULL), NULL }
+};
+
+static struct ipu_isys_subdev_pdata pdata = {
+ .subdevs = (struct ipu_isys_subdev_info *[]) {
+ &adv7481_hdmi_crl_sd,
+ &adv7481_cvbs_crl_sd,
+ NULL,
+ },
+ .clk_map = gp_mapping,
+};
+
+static void ipu4_quirk(struct pci_dev *pci_dev)
+{
+ pci_dev->dev.platform_data = &pdata;
+}
+
+DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, IPU_PCI_ID,
+ ipu4_quirk);
diff --git a/drivers/media/platform/intel/ipu4-bxt-p-pdata.c b/drivers/media/platform/intel/ipu4-bxt-p-pdata.c
new file mode 100644
index 000000000000..ba5707adebdc
--- /dev/null
+++ b/drivers/media/platform/intel/ipu4-bxt-p-pdata.c
@@ -0,0 +1,1161 @@
+// SPDX-License-Identifier: GPL-2.0
+// Copyright (C) 2015 - 2018 Intel Corporation
+
+#include <linux/clk.h>
+#include <linux/clkdev.h>
+#include <linux/gpio.h>
+#include <linux/kernel.h>
+#include <linux/pci.h>
+
+#include <media/ipu-isys.h>
+#include <media/crlmodule.h>
+#include <media/ti964.h>
+#include <media/ti960.h>
+#include <media/max9286.h>
+#include "ipu.h"
+
+#define GPIO_BASE 422
+
+#ifdef CONFIG_INTEL_IPU4_OV2740
+#define OV2740_LANES 2
+#define OV2740_I2C_ADDRESS 0x36
+static struct crlmodule_platform_data ov2740_pdata = {
+ .xshutdown = GPIO_BASE + 64,
+ .lanes = OV2740_LANES,
+ .ext_clk = 19200000,
+ .op_sys_clock = (uint64_t []){ 72000000 },
+ .module_name = "INT3474",
+ .id_string = "0x27 0x40",
+ .suffix = 'a',
+};
+
+static struct ipu_isys_csi2_config ov2740_csi2_cfg = {
+ .nlanes = OV2740_LANES,
+ .port = 0,
+};
+
+static struct ipu_isys_subdev_info ov2740_crl_sd = {
+ .csi2 = &ov2740_csi2_cfg,
+ .i2c = {
+ .board_info = {
+ I2C_BOARD_INFO(CRLMODULE_NAME, OV2740_I2C_ADDRESS),
+ .platform_data = &ov2740_pdata,
+ },
+ .i2c_adapter_id = 2,
+ }
+};
+#endif
+
+#ifdef CONFIG_INTEL_IPU4_IMX185
+#define IMX185_LANES 4
+#define IMX185_I2C_ADDRESS 0x1a
+
+static struct crlmodule_platform_data imx185_pdata = {
+ .xshutdown = GPIO_BASE + 71,
+ .lanes = IMX185_LANES,
+ .ext_clk = 27000000,
+ .op_sys_clock = (uint64_t []){ 55687500, 111375000,
+ 111375000, 222750000 },
+ .module_name = "IMX185",
+ .id_string = "0x1 0x85",
+ .suffix = 'a',
+};
+
+static struct ipu_isys_csi2_config imx185_csi2_cfg = {
+ .nlanes = IMX185_LANES,
+ .port = 0,
+};
+
+static struct ipu_isys_subdev_info imx185_crl_sd = {
+ .csi2 = &imx185_csi2_cfg,
+ .i2c = {
+ .board_info = {
+ I2C_BOARD_INFO(CRLMODULE_NAME, IMX185_I2C_ADDRESS),
+ .platform_data = &imx185_pdata,
+ },
+ .i2c_adapter_id = 2,
+ }
+};
+
+static struct crlmodule_platform_data imx185_b_pdata = {
+ .xshutdown = GPIO_BASE + 73,
+ .lanes = IMX185_LANES,
+ .ext_clk = 27000000,
+ .op_sys_clock = (uint64_t []){ 55687500, 111375000,
+ 111375000, 222750000 },
+ .module_name = "IMX185",
+ .id_string = "0x1 0x85",
+ .suffix = 'b',
+};
+
+static struct ipu_isys_csi2_config imx185_b_csi2_cfg = {
+ .nlanes = IMX185_LANES,
+ .port = 4,
+};
+
+static struct ipu_isys_subdev_info imx185_b_crl_sd = {
+ .csi2 = &imx185_b_csi2_cfg,
+ .i2c = {
+ .board_info = {
+ I2C_BOARD_INFO(CRLMODULE_NAME, IMX185_I2C_ADDRESS),
+ .platform_data = &imx185_b_pdata,
+ },
+ .i2c_adapter_id = 4,
+ }
+};
+
+#endif
+
+#ifdef CONFIG_INTEL_IPU4_AR023Z
+#define AR023Z_MIPI_LANES 2
+/* Toshiba TC358778 Parallel-MIPI Bridge */
+#define TC358778_I2C_ADDRESS 0x0e
+
+static struct crlmodule_platform_data ar023z_pdata = {
+ .xshutdown = GPIO_BASE + 64,
+ .lanes = AR023Z_MIPI_LANES,
+ .ext_clk = 27000000,
+ .op_sys_clock = (uint64_t []){317250000},
+ .module_name = "AR023Z",
+ .id_string = "0x4401 0x64",
+ .suffix = 'a',
+};
+
+static struct ipu_isys_csi2_config ar023z_csi2_cfg = {
+ .nlanes = AR023Z_MIPI_LANES,
+ .port = 0,
+};
+
+static struct ipu_isys_subdev_info ar023z_crl_sd = {
+ .csi2 = &ar023z_csi2_cfg,
+ .i2c = {
+ .board_info = {
+ I2C_BOARD_INFO(CRLMODULE_NAME, TC358778_I2C_ADDRESS),
+ .platform_data = &ar023z_pdata,
+ },
+ .i2c_adapter_id = 2,
+ }
+};
+
+static struct crlmodule_platform_data ar023z_b_pdata = {
+ .xshutdown = GPIO_BASE + 67,
+ .lanes = AR023Z_MIPI_LANES,
+ .ext_clk = 27000000,
+ .op_sys_clock = (uint64_t []){317250000},
+ .module_name = "AR023Z",
+ .id_string = "0x4401 0x64",
+ .suffix = 'b',
+};
+
+static struct ipu_isys_csi2_config ar023z_b_csi2_cfg = {
+ .nlanes = AR023Z_MIPI_LANES,
+ .port = 4,
+};
+
+static struct ipu_isys_subdev_info ar023z_b_crl_sd = {
+ .csi2 = &ar023z_b_csi2_cfg,
+ .i2c = {
+ .board_info = {
+ I2C_BOARD_INFO(CRLMODULE_NAME, TC358778_I2C_ADDRESS),
+ .platform_data = &ar023z_b_pdata,
+ },
+ .i2c_adapter_id = 4,
+ }
+};
+#endif
+
+#ifdef CONFIG_INTEL_IPU4_IMX477
+#define IMX477_LANES 2
+
+#define IMX477_I2C_ADDRESS 0x10
+
+static struct crlmodule_platform_data imx477_pdata_master = {
+ .xshutdown = GPIO_BASE + 64,
+ .lanes = IMX477_LANES,
+ .ext_clk = 19200000,
+ .op_sys_clock = (uint64_t []){600000000},
+ .module_name = "IMX477-MASTER",
+ .id_string = "0x4 0x77",
+ .suffix = 'a',
+};
+
+static struct ipu_isys_csi2_config imx477_csi2_cfg_master = {
+ .nlanes = IMX477_LANES,
+ .port = 0,
+};
+
+static struct ipu_isys_subdev_info imx477_crl_sd_master = {
+ .csi2 = &imx477_csi2_cfg_master,
+ .i2c = {
+ .board_info = {
+ I2C_BOARD_INFO(CRLMODULE_NAME, IMX477_I2C_ADDRESS),
+ .platform_data = &imx477_pdata_master,
+ },
+ .i2c_adapter_id = 2,
+ }
+};
+
+static struct crlmodule_platform_data imx477_pdata_slave_1 = {
+ .xshutdown = GPIO_BASE + 67,
+ .lanes = IMX477_LANES,
+ .ext_clk = 19200000,
+ .op_sys_clock = (uint64_t []){600000000},
+ .module_name = "IMX477-SLAVE-1",
+ .id_string = "0x4 0x77",
+ .suffix = 'b',
+};
+
+static struct ipu_isys_csi2_config imx477_csi2_cfg_slave_1 = {
+ .nlanes = IMX477_LANES,
+ .port = 4,
+};
+
+static struct ipu_isys_subdev_info imx477_crl_sd_slave_1 = {
+ .csi2 = &imx477_csi2_cfg_slave_1,
+ .i2c = {
+ .board_info = {
+ I2C_BOARD_INFO(CRLMODULE_NAME, IMX477_I2C_ADDRESS),
+ .platform_data = &imx477_pdata_slave_1,
+ },
+ .i2c_adapter_id = 4,
+ }
+};
+#endif
+
+#ifdef CONFIG_INTEL_IPU4_IMX274
+
+#define IMX274_LANES 4
+#define IMX274_I2C_ADDRESS 0x1a
+
+static struct crlmodule_platform_data imx274_pdata = {
+ .xshutdown = GPIO_BASE + 64,
+ .lanes = IMX274_LANES,
+ .ext_clk = 24000000,
+ .op_sys_clock = (uint64_t []){720000000},
+ .module_name = "IMX274",
+ .id_string = "0x6 0x9",
+ .suffix = 'a',
+};
+
+static struct ipu_isys_csi2_config imx274_csi2_cfg = {
+ .nlanes = IMX274_LANES,
+ .port = 0,
+};
+
+static struct ipu_isys_subdev_info imx274_crl_sd = {
+ .csi2 = &imx274_csi2_cfg,
+ .i2c = {
+ .board_info = {
+ I2C_BOARD_INFO(CRLMODULE_NAME, IMX274_I2C_ADDRESS),
+ .platform_data = &imx274_pdata
+ },
+ .i2c_adapter_id = 2,
+ }
+};
+
+static struct crlmodule_platform_data imx274_b_pdata = {
+ .xshutdown = GPIO_BASE + 67,
+ .lanes = IMX274_LANES,
+ .ext_clk = 24000000,
+ .op_sys_clock = (uint64_t []){720000000},
+ .module_name = "IMX274",
+ .id_string = "0x6 0x9",
+ .suffix = 'b',
+};
+
+static struct ipu_isys_csi2_config imx274_b_csi2_cfg = {
+ .nlanes = IMX274_LANES,
+ .port = 4,
+};
+
+static struct ipu_isys_subdev_info imx274_b_crl_sd = {
+ .csi2 = &imx274_b_csi2_cfg,
+ .i2c = {
+ .board_info = {
+ I2C_BOARD_INFO(CRLMODULE_NAME, IMX274_I2C_ADDRESS),
+ .platform_data = &imx274_b_pdata
+ },
+ .i2c_adapter_id = 4,
+ }
+};
+#endif
+
+#ifdef CONFIG_INTEL_IPU4_IMX290
+
+#define IMX290_LANES 4
+#define IMX290_I2C_ADDRESS 0x1a
+
+static struct crlmodule_platform_data imx290_pdata = {
+ .xshutdown = GPIO_BASE + 64,
+ .lanes = IMX290_LANES,
+ .ext_clk = 37125000,
+ .op_sys_clock = (uint64_t []){222750000, 445500000},
+ .module_name = "IMX290",
+ .id_string = "0x2 0x90",
+ .suffix = 'a',
+};
+
+static struct ipu_isys_csi2_config imx290_csi2_cfg = {
+ .nlanes = IMX290_LANES,
+ .port = 0,
+};
+
+static struct ipu_isys_subdev_info imx290_crl_sd = {
+ .csi2 = &imx290_csi2_cfg,
+ .i2c = {
+ .board_info = {
+ I2C_BOARD_INFO(CRLMODULE_NAME, IMX290_I2C_ADDRESS),
+ .platform_data = &imx290_pdata
+ },
+ .i2c_adapter_id = 2,
+ }
+};
+#endif
+
+#ifdef CONFIG_INTEL_IPU4_OV13860
+
+#define OV13860_LANES 2
+#define OV13860_I2C_ADDRESS 0x10
+
+static struct crlmodule_platform_data ov13860_pdata = {
+ .xshutdown = GPIO_BASE + 71,
+ .lanes = OV13860_LANES,
+ .ext_clk = 24000000,
+ .op_sys_clock = (uint64_t []){ 600000000, 300000000},
+ .module_name = "OV13860",
+ .suffix = 'a',
+};
+
+static struct ipu_isys_csi2_config ov13860_csi2_cfg = {
+ .nlanes = OV13860_LANES,
+ .port = 0,
+};
+
+static struct ipu_isys_subdev_info ov13860_crl_sd = {
+ .csi2 = &ov13860_csi2_cfg,
+ .i2c = {
+ .board_info = {
+ I2C_BOARD_INFO(CRLMODULE_NAME, OV13860_I2C_ADDRESS),
+ .platform_data = &ov13860_pdata,
+ },
+ .i2c_adapter_id = 2,
+ }
+};
+#endif
+
+#ifdef CONFIG_INTEL_IPU4_OV9281
+
+#define OV9281_LANES 2
+#define OV9281_I2C_ADDRESS 0x10
+
+static struct crlmodule_platform_data ov9281_pdata = {
+ .xshutdown = GPIO_BASE + 71,
+ .lanes = OV9281_LANES,
+ .ext_clk = 24000000,
+ .op_sys_clock = (uint64_t []){400000000},
+ .module_name = "OV9281",
+ .id_string = "0x92 0x81",
+ .suffix = 'a',
+};
+
+static struct ipu_isys_csi2_config ov9281_csi2_cfg = {
+ .nlanes = OV9281_LANES,
+ .port = 0,
+};
+
+static struct ipu_isys_subdev_info ov9281_crl_sd = {
+ .csi2 = &ov9281_csi2_cfg,
+ .i2c = {
+ .board_info = {
+ I2C_BOARD_INFO(CRLMODULE_NAME, OV9281_I2C_ADDRESS),
+ .platform_data = &ov9281_pdata,
+ },
+ .i2c_adapter_id = 0,
+ }
+};
+#endif
+
+#if IS_ENABLED(CONFIG_VIDEO_BU64295)
+
+#define BU64295_VCM_ADDR 0x0c
+#define BU64295_NAME "bu64295"
+
+static struct ipu_isys_subdev_info bu64295_sd = {
+ .i2c = {
+ .board_info = {
+ I2C_BOARD_INFO(BU64295_NAME, BU64295_VCM_ADDR),
+ },
+ .i2c_adapter_id = 2,
+ }
+};
+#endif
+
+#ifdef CONFIG_INTEL_IPU4_ADV7481
+
+#define ADV7481_LANES 4
+#define ADV7481_I2C_ADDRESS 0xe0
+#define ADV7481B_I2C_ADDRESS 0xe2
+
+static struct crlmodule_platform_data adv7481_pdata = {
+ .xshutdown = GPIO_BASE + 63,
+ .lanes = ADV7481_LANES,
+ .ext_clk = 24000000,
+ .op_sys_clock = (uint64_t []){600000000},
+ .module_name = "ADV7481",
+ .suffix = 'a',
+};
+
+static struct ipu_isys_csi2_config adv7481_csi2_cfg = {
+ .nlanes = ADV7481_LANES,
+ .port = 0,
+};
+
+static struct ipu_isys_subdev_info adv7481_crl_sd = {
+ .csi2 = &adv7481_csi2_cfg,
+ .i2c = {
+ .board_info = {
+ .type = CRLMODULE_NAME,
+ .flags = I2C_CLIENT_TEN,
+ .addr = ADV7481_I2C_ADDRESS,
+ .platform_data = &adv7481_pdata,
+ },
+ .i2c_adapter_id = 2,
+ }
+};
+#endif
+
+#ifdef CONFIG_INTEL_IPU4_ADV7481_EVAL
+
+#define ADV7481_LANES 4
+#define ADV7481_I2C_ADDRESS 0xe0
+#define ADV7481B_I2C_ADDRESS 0xe2
+
+static struct crlmodule_platform_data adv7481_eval_pdata = {
+ .xshutdown = GPIO_BASE + 63,
+ .lanes = ADV7481_LANES,
+ .ext_clk = 24000000,
+ .op_sys_clock = (uint64_t []){600000000},
+ .module_name = "ADV7481_EVAL",
+ .suffix = 'a',
+};
+
+static struct ipu_isys_csi2_config adv7481_eval_csi2_cfg = {
+ .nlanes = ADV7481_LANES,
+ .port = 0,
+};
+
+static struct ipu_isys_subdev_info adv7481_eval_crl_sd = {
+ .csi2 = &adv7481_eval_csi2_cfg,
+ .i2c = {
+ .board_info = {
+ .type = CRLMODULE_NAME,
+ .flags = I2C_CLIENT_TEN,
+ .addr = ADV7481_I2C_ADDRESS,
+ .platform_data = &adv7481_eval_pdata,
+ },
+ .i2c_adapter_id = 2,
+ }
+};
+
+static struct crlmodule_platform_data adv7481b_eval_pdata = {
+ .xshutdown = GPIO_BASE + 63,
+ .lanes = ADV7481_LANES,
+ .ext_clk = 24000000,
+ .op_sys_clock = (uint64_t []){600000000},
+ .module_name = "ADV7481B_EVAL",
+ .suffix = 'b',
+};
+
+static struct ipu_isys_csi2_config adv7481b_eval_csi2_cfg = {
+ .nlanes = ADV7481_LANES,
+ .port = 4,
+};
+
+static struct ipu_isys_subdev_info adv7481b_eval_crl_sd = {
+ .csi2 = &adv7481b_eval_csi2_cfg,
+ .i2c = {
+ .board_info = {
+ .type = CRLMODULE_NAME,
+ .flags = I2C_CLIENT_TEN,
+ .addr = ADV7481B_I2C_ADDRESS,
+ .platform_data = &adv7481b_eval_pdata,
+ },
+ .i2c_adapter_id = 2,
+ }
+};
+#endif
+
+#if IS_ENABLED(CONFIG_VIDEO_AGGREGATOR_STUB)
+
+#define VIDEO_AGGRE_LANES 4
+#define VIDEO_AGGRE_I2C_ADDRESS 0x3b
+#define VIDEO_AGGRE_B_I2C_ADDRESS 0x3c
+
+static struct ipu_isys_csi2_config video_aggre_csi2_cfg = {
+ .nlanes = VIDEO_AGGRE_LANES,
+ .port = 0,
+};
+
+static struct ipu_isys_subdev_info video_aggre_stub_sd = {
+ .csi2 = &video_aggre_csi2_cfg,
+ .i2c = {
+ .board_info = {
+ .type = "video-aggre",
+ .addr = VIDEO_AGGRE_I2C_ADDRESS,
+ },
+ .i2c_adapter_id = 2,
+ }
+};
+
+static struct ipu_isys_csi2_config video_aggre_b_csi2_cfg = {
+ .nlanes = VIDEO_AGGRE_LANES,
+ .port = 4,
+};
+
+static struct ipu_isys_subdev_info video_aggre_b_stub_sd = {
+ .csi2 = &video_aggre_b_csi2_cfg,
+ .i2c = {
+ .board_info = {
+ .type = "video-aggre",
+ .addr = VIDEO_AGGRE_B_I2C_ADDRESS,
+ },
+ .i2c_adapter_id = 2,
+ }
+};
+#endif
+
+#ifdef CONFIG_INTEL_IPU4_MAGNA
+#define MAGNA_LANES 4
+#define MAGNA_PHY_ADDR 0x60 /* 0x30 for 7bit addr */
+#define MAGNA_ADDRESS_A 0x61
+
+static struct crlmodule_platform_data magna_pdata = {
+ .lanes = MAGNA_LANES,
+ .ext_clk = 24000000,
+ .op_sys_clock = (uint64_t []){ 400000000 },
+ .module_name = "MAGNA",
+ .id_string = "0xa6 0x35",
+ /*
+ * The pin number of xshutdown will be determined
+ * and replaced inside TI964 driver.
+ * The number here stands for which GPIO to connect with.
+ * 1 means to connect sensor xshutdown to GPIO1
+ */
+ .xshutdown = 1,
+ /*
+ * this flags indicates the expected polarity for the LineValid
+ * indication received in Raw mode.
+ * 1 means LineValid is high for the duration of the video frame.
+ */
+ .high_framevalid_flags = 1,
+};
+#endif
+
+#ifdef CONFIG_INTEL_IPU4_OV10635
+#define OV10635_LANES 4
+#define OV10635_I2C_PHY_ADDR 0x60 /* 0x30 for 7bit addr */
+#define OV10635A_I2C_ADDRESS 0x61
+#define OV10635B_I2C_ADDRESS 0x62
+#define OV10635C_I2C_ADDRESS 0x63
+#define OV10635D_I2C_ADDRESS 0x64
+
+static struct crlmodule_platform_data ov10635_pdata = {
+ .lanes = OV10635_LANES,
+ .ext_clk = 24000000,
+ .op_sys_clock = (uint64_t []){ 400000000 },
+ .module_name = "OV10635",
+ .id_string = "0xa6 0x35",
+ /*
+ * The pin number of xshutdown will be determined
+ * and replaced inside TI964 driver.
+ * The number here stands for which GPIO to connect with.
+ * 1 means to connect sensor xshutdown to GPIO1
+ */
+ .xshutdown = 0,
+};
+#endif
+
+#ifdef CONFIG_INTEL_IPU4_OV10640
+#define OV10640_LANES 4
+#define OV10640_I2C_PHY_ADDR 0x60 /* 0x30 for 7bit addr */
+#define OV10640A_I2C_ADDRESS 0x61
+#define OV10640B_I2C_ADDRESS 0x62
+#define OV10640C_I2C_ADDRESS 0x63
+#define OV10640D_I2C_ADDRESS 0x64
+
+static struct crlmodule_platform_data ov10640_pdata = {
+ .lanes = OV10640_LANES,
+ .ext_clk = 24000000,
+ .op_sys_clock = (uint64_t []){ 400000000 },
+ .module_name = "OV10640",
+ .id_string = "0xa6 0x40",
+ /*
+ * The pin number of xshutdown will be determined
+ * and replaced inside TI964 driver.
+ * The number here stands for which GPIO to connect with.
+ * 1 means to connect sensor xshutdown to GPIO1
+ */
+ .xshutdown = 1,
+};
+#endif
+
+#if IS_ENABLED(CONFIG_VIDEO_TI964)
+#define TI964_I2C_ADAPTER 0
+#define TI964_I2C_ADAPTER_2 7
+#define TI964_I2C_ADDRESS 0x3d
+#define TI964_LANES 4
+
+static struct ipu_isys_csi2_config ti964_csi2_cfg = {
+ .nlanes = TI964_LANES,
+ .port = 0,
+};
+
+static struct ipu_isys_csi2_config ti964_csi2_cfg_2 = {
+ .nlanes = TI964_LANES,
+ .port = 4,
+};
+
+static struct ti964_subdev_info ti964_subdevs[] = {
+#ifdef CONFIG_INTEL_IPU4_OV10635
+ {
+ .board_info = {
+ .type = CRLMODULE_NAME,
+ .addr = OV10635A_I2C_ADDRESS,
+ .platform_data = &ov10635_pdata,
+ },
+ .i2c_adapter_id = TI964_I2C_ADAPTER,
+ .rx_port = 0,
+ .phy_i2c_addr = OV10635_I2C_PHY_ADDR,
+ .suffix = 'a',
+ },
+ {
+ .board_info = {
+ .type = CRLMODULE_NAME,
+ .addr = OV10635B_I2C_ADDRESS,
+ .platform_data = &ov10635_pdata,
+ },
+ .i2c_adapter_id = TI964_I2C_ADAPTER,
+ .rx_port = 1,
+ .phy_i2c_addr = OV10635_I2C_PHY_ADDR,
+ .suffix = 'b',
+ },
+ {
+ .board_info = {
+ .type = CRLMODULE_NAME,
+ .addr = OV10635C_I2C_ADDRESS,
+ .platform_data = &ov10635_pdata,
+ },
+ .i2c_adapter_id = TI964_I2C_ADAPTER,
+ .rx_port = 2,
+ .phy_i2c_addr = OV10635_I2C_PHY_ADDR,
+ .suffix = 'c',
+ },
+ {
+ .board_info = {
+ .type = CRLMODULE_NAME,
+ .addr = OV10635D_I2C_ADDRESS,
+ .platform_data = &ov10635_pdata,
+ },
+ .i2c_adapter_id = TI964_I2C_ADAPTER,
+ .rx_port = 3,
+ .phy_i2c_addr = OV10635_I2C_PHY_ADDR,
+ .suffix = 'd',
+ },
+#endif
+#ifdef CONFIG_INTEL_IPU4_OV10640
+ {
+ .board_info = {
+ .type = CRLMODULE_NAME,
+ .addr = OV10640A_I2C_ADDRESS,
+ .platform_data = &ov10640_pdata,
+ },
+ .i2c_adapter_id = TI964_I2C_ADAPTER,
+ .rx_port = 0,
+ .phy_i2c_addr = OV10640_I2C_PHY_ADDR,
+ .suffix = 'a',
+ },
+ {
+ .board_info = {
+ .type = CRLMODULE_NAME,
+ .addr = OV10640B_I2C_ADDRESS,
+ .platform_data = &ov10640_pdata,
+ },
+ .i2c_adapter_id = TI964_I2C_ADAPTER,
+ .rx_port = 1,
+ .phy_i2c_addr = OV10640_I2C_PHY_ADDR,
+ .suffix = 'b',
+ },
+ {
+ .board_info = {
+ .type = CRLMODULE_NAME,
+ .addr = OV10640C_I2C_ADDRESS,