Initial clean ups
[AGL/meta-agl-refhw.git] / meta-agl-refhw-gen3 / recipes-kernel / linux / files / 0002-agl-reference-hardware-sample-bsp.patch
1 ---
2  .../arm64/boot/dts/renesas/r8a7795-salvator-xs.dts |  10 -
3  arch/arm64/boot/dts/renesas/salvator-common.dtsi   | 431 ++++++++++-----------
4  drivers/iio/imu/Kconfig                            |   1 +
5  drivers/iio/imu/Makefile                           |   1 +
6  drivers/media/i2c/adv748x/adv748x-core.c           |  48 ++-
7  drivers/media/i2c/adv748x/adv748x.h                |  12 +
8  drivers/pinctrl/sh-pfc/pfc-r8a7795.c               |   6 +-
9  7 files changed, 260 insertions(+), 249 deletions(-)
10
11 diff --git a/arch/arm64/boot/dts/renesas/r8a7795-salvator-xs.dts b/arch/arm64/boot/dts/renesas/r8a7795-salvator-xs.dts
12 index 498f788..b4236a5 100644
13 --- a/arch/arm64/boot/dts/renesas/r8a7795-salvator-xs.dts
14 +++ b/arch/arm64/boot/dts/renesas/r8a7795-salvator-xs.dts
15 @@ -166,16 +166,6 @@
16         remote-endpoint = <&rcar_dw_hdmi1_out>;
17  };
18  
19 -&lvds0 {
20 -       ports {
21 -               port@1 {
22 -                       lvds0_out: endpoint {
23 -                               remote-endpoint = <&lvds_in>;
24 -                       };
25 -               };
26 -       };
27 -};
28 -
29  &ohci2 {
30         status = "okay";
31  };
32 diff --git a/arch/arm64/boot/dts/renesas/salvator-common.dtsi b/arch/arm64/boot/dts/renesas/salvator-common.dtsi
33 index 878ed7c..32d19d9 100644
34 --- a/arch/arm64/boot/dts/renesas/salvator-common.dtsi
35 +++ b/arch/arm64/boot/dts/renesas/salvator-common.dtsi
36 @@ -34,6 +34,10 @@
37         aliases {
38                 serial0 = &scif2;
39                 serial1 = &scif1;
40 +               serial2 = &scif5;
41 +               serial3 = &hscif1;
42 +               serial4 = &hscif0;
43 +               serial5 = &hscif2;
44                 ethernet0 = &avb;
45         };
46  
47 @@ -62,65 +66,26 @@
48                 resets = <&cpg 922>;
49         };
50  
51 -       backlight: backlight {
52 -               compatible = "pwm-backlight";
53 -               pwms = <&pwm1 0 50000>;
54 -
55 -               brightness-levels = <256 128 64 16 8 4 0>;
56 -               default-brightness-level = <6>;
57 -
58 -               power-supply = <&reg_12v>;
59 -               enable-gpios = <&gpio6 7 GPIO_ACTIVE_HIGH>;
60 -       };
61 -
62 -       cvbs-in {
63 -               compatible = "composite-video-connector";
64 -               label = "CVBS IN";
65 -
66 -               port {
67 -                       cvbs_con: endpoint {
68 -                               remote-endpoint = <&adv7482_ain7>;
69 -                       };
70 -               };
71 -       };
72 -
73 -       hdmi-in {
74 +       hdmi0-in {
75                 compatible = "hdmi-connector";
76 -               label = "HDMI IN";
77 +               label = "HDMI0 IN";
78                 type = "a";
79  
80                 port {
81                         hdmi_in_con: endpoint {
82 -                               remote-endpoint = <&adv7482_hdmi>;
83 +                               remote-endpoint = <&adv7481_hdmi>;
84                         };
85                 };
86         };
87  
88 -       lvds {
89 -               compatible = "panel-lvds";
90 -
91 -               width-mm = <210>;
92 -               height-mm = <158>;
93 -
94 -               data-mapping = "jeida-24";
95 -               enable-gpios = <&gpio6 7 GPIO_ACTIVE_HIGH>;
96 -
97 -               panel-timing {
98 -                       /* 1024x768 @60Hz */
99 -                       clock-frequency = <65000000>;
100 -                       hactive = <1024>;
101 -                       vactive = <768>;
102 -                       hsync-len = <136>;
103 -                       hfront-porch = <20>;
104 -                       hback-porch = <160>;
105 -                       vfront-porch = <3>;
106 -                       vback-porch = <29>;
107 -                       vsync-len = <6>;
108 -               };
109 +       hdmi2-in {
110 +               compatible = "hdmi-connector";
111 +               label = "HDMI2 IN";
112 +               type = "a";
113  
114                 port {
115 -                       lvds_in: endpoint {
116 -                               remote-endpoint = <&lvds0_out>;
117 +                       hdmi_in_con2: endpoint {
118 +                               remote-endpoint = <&adv7481_hdmi2>;
119                         };
120                 };
121         };
122 @@ -160,17 +125,6 @@
123                 dais = <&rsnd_port0>;
124         };
125  
126 -       vbus0_usb2: regulator-vbus0-usb2 {
127 -               compatible = "regulator-fixed";
128 -
129 -               regulator-name = "USB20_VBUS0";
130 -               regulator-min-microvolt = <5000000>;
131 -               regulator-max-microvolt = <5000000>;
132 -
133 -               gpio = <&gpio6 16 GPIO_ACTIVE_HIGH>;
134 -               enable-active-high;
135 -       };
136 -
137         vcc_sdhi0: regulator-vcc-sdhi0 {
138                 compatible = "regulator-fixed";
139  
140 @@ -241,40 +195,6 @@
141                 };
142         };
143  
144 -       vga {
145 -               compatible = "vga-connector";
146 -               no-use-ddc;
147 -               max-pixelclock = <100000>;
148 -
149 -               port {
150 -                       vga_in: endpoint {
151 -                               remote-endpoint = <&adv7123_out>;
152 -                       };
153 -               };
154 -       };
155 -
156 -       vga-encoder {
157 -               compatible = "adi,adv7123";
158 -
159 -               ports {
160 -                       #address-cells = <1>;
161 -                       #size-cells = <0>;
162 -
163 -                       port@0 {
164 -                               reg = <0>;
165 -                               adv7123_in: endpoint {
166 -                                       remote-endpoint = <&du_out_rgb>;
167 -                               };
168 -                       };
169 -                       port@1 {
170 -                               reg = <1>;
171 -                               adv7123_out: endpoint {
172 -                                       remote-endpoint = <&vga_in>;
173 -                               };
174 -                       };
175 -               };
176 -       };
177 -
178         x12_clk: x12 {
179                 compatible = "fixed-clock";
180                 #clock-cells = <0>;
181 @@ -325,49 +245,41 @@
182         };
183  };
184  
185 -&csi20 {
186 +&csi40 {
187         status = "okay";
188  
189         ports {
190                 port@0 {
191                         reg = <0>;
192 -                       csi20_in: endpoint {
193 +
194 +                       csi40_in: endpoint {
195                                 clock-lanes = <0>;
196 -                               data-lanes = <1>;
197 -                               remote-endpoint = <&adv7482_txb>;
198 +                               data-lanes = <1 2 3 4>;
199 +                               remote-endpoint = <&adv7481_txa>;
200                         };
201                 };
202         };
203  };
204  
205 -&csi40 {
206 +&csi41 {
207         status = "okay";
208  
209         ports {
210                 port@0 {
211                         reg = <0>;
212  
213 -                       csi40_in: endpoint {
214 +                       csi41_in: endpoint {
215                                 clock-lanes = <0>;
216                                 data-lanes = <1 2 3 4>;
217 -                               remote-endpoint = <&adv7482_txa>;
218 +                               remote-endpoint = <&adv7481_txa2>;
219                         };
220                 };
221         };
222  };
223  
224  &du {
225 -       pinctrl-0 = <&du_pins>;
226 -       pinctrl-names = "default";
227         status = "okay";
228  
229 -       ports {
230 -               port@0 {
231 -                       endpoint {
232 -                               remote-endpoint = <&adv7123_in>;
233 -                       };
234 -               };
235 -       };
236  };
237  
238  &ehci0 {
239 @@ -383,12 +295,27 @@
240         clock-frequency = <32768>;
241  };
242  
243 +&hscif0 {
244 +       pinctrl-0 = <&hscif0_pins>;
245 +       pinctrl-names = "default";
246 +       uart-has-rtscts;
247 +
248 +       status = "okay";
249 +};
250 +
251  &hscif1 {
252         pinctrl-0 = <&hscif1_pins>;
253         pinctrl-names = "default";
254  
255         /* Please use exclusively to the scif1 node */
256 -       /* status = "okay"; */
257 +       status = "okay";
258 +};
259 +
260 +&hscif2 {
261 +       pinctrl-0 = <&hscif2_pins>;
262 +       pinctrl-names = "default";
263 +
264 +       status = "okay";
265  };
266  
267  &hsusb {
268 @@ -404,24 +331,65 @@
269  
270         clock-frequency = <100000>;
271  
272 -       ak4613: codec@10 {
273 -               compatible = "asahi-kasei,ak4613";
274 -               #sound-dai-cells = <0>;
275 -               reg = <0x10>;
276 -               clocks = <&rcar_sound 3>;
277 +       video-receiver@70 {
278 +               compatible = "adi,adv7481";
279 +               reg = <0x70>;
280  
281 -               asahi-kasei,in1-single-end;
282 -               asahi-kasei,in2-single-end;
283 -               asahi-kasei,out1-single-end;
284 -               asahi-kasei,out2-single-end;
285 -               asahi-kasei,out3-single-end;
286 -               asahi-kasei,out4-single-end;
287 -               asahi-kasei,out5-single-end;
288 -               asahi-kasei,out6-single-end;
289 +               #address-cells = <1>;
290 +               #size-cells = <0>;
291  
292 -               port {
293 -                       ak4613_endpoint: endpoint {
294 -                               remote-endpoint = <&rsnd_endpoint0>;
295 +               interrupt-parent = <&gpio0>;
296 +               interrupt-names = "intrq1", "intrq3";
297 +               interrupts = <4 IRQ_TYPE_LEVEL_LOW>,
298 +                            <5 IRQ_TYPE_LEVEL_LOW>;
299 +
300 +               port@8 {
301 +                       reg = <8>;
302 +
303 +                       adv7481_hdmi: endpoint {
304 +                               remote-endpoint = <&hdmi_in_con>;
305 +                       };
306 +               };
307 +
308 +               port@a {
309 +                       reg = <10>;
310 +
311 +                       adv7481_txa: endpoint {
312 +                               clock-lanes = <0>;
313 +                               data-lanes = <1 2 3 4>;
314 +                               remote-endpoint = <&csi40_in>;
315 +                       };
316 +               };
317 +
318 +       };
319 +
320 +       video-receiver@71 {
321 +               compatible = "adi,adv7481";
322 +               reg = <0x71>;
323 +
324 +               #address-cells = <1>;
325 +               #size-cells = <0>;
326 +
327 +               interrupt-parent = <&gpio6>;
328 +               interrupt-names = "intrq1", "intrq3";
329 +               interrupts = <0 IRQ_TYPE_LEVEL_LOW>,
330 +                            <1 IRQ_TYPE_LEVEL_LOW>;
331 +
332 +               port@8 {
333 +                       reg = <8>;
334 +
335 +                       adv7481_hdmi2: endpoint {
336 +                               remote-endpoint = <&hdmi_in_con2>;
337 +                       };
338 +               };
339 +
340 +               port@a {
341 +                       reg = <10>;
342 +
343 +                       adv7481_txa2: endpoint {
344 +                               clock-lanes = <0>;
345 +                               data-lanes = <1 2 3 4>;
346 +                               remote-endpoint = <&csi41_in>;
347                         };
348                 };
349         };
350 @@ -438,75 +406,62 @@
351         };
352  };
353  
354 -&i2c4 {
355 +&i2c3 {
356 +       pinctrl-0 = <&i2c3_pins>;
357 +       pinctrl-names = "default";
358 +
359         status = "okay";
360  
361 -       pca9654: gpio@20 {
362 -               compatible = "onnn,pca9654";
363 -               reg = <0x20>;
364 -               gpio-controller;
365 -               #gpio-cells = <2>;
366 -       };
367 +       clock-frequency = <100000>;
368  
369 -       csa_vdd: adc@7c {
370 -               compatible = "maxim,max9611";
371 -               reg = <0x7c>;
372 +       asm330lhh@6a {
373 +               compatible = "st,asm330lhh";
374 +               reg = <0x6a>;
375  
376 -               shunt-resistor-micro-ohms = <5000>;
377 +               interrupt-names = "int1", "int2";
378 +               interrupts = <&gpio6 23 IRQ_TYPE_EDGE_RISING>,
379 +                            <&gpio2 6 IRQ_TYPE_EDGE_RISING>;
380         };
381 +};
382  
383 -       csa_dvfs: adc@7f {
384 -               compatible = "maxim,max9611";
385 -               reg = <0x7f>;
386 +&i2c4 {
387 +       status = "okay";
388  
389 -               shunt-resistor-micro-ohms = <5000>;
390 +       versaclock5: clock-generator@68 {
391 +               compatible = "idt,9fgv0841";
392 +               reg = <0x68>;
393 +               #clock-cells = <1>;
394 +               clocks = <&x23_clk>;
395 +               clock-names = "xin";
396         };
397 +};
398  
399 -       video-receiver@70 {
400 -               compatible = "adi,adv7482";
401 -               reg = <0x70>;
402 -
403 -               #address-cells = <1>;
404 -               #size-cells = <0>;
405 -
406 -               interrupt-parent = <&gpio6>;
407 -               interrupt-names = "intrq1", "intrq2";
408 -               interrupts = <30 IRQ_TYPE_LEVEL_LOW>,
409 -                            <31 IRQ_TYPE_LEVEL_LOW>;
410 -
411 -               port@7 {
412 -                       reg = <7>;
413 -
414 -                       adv7482_ain7: endpoint {
415 -                               remote-endpoint = <&cvbs_con>;
416 -                       };
417 -               };
418 -
419 -               port@8 {
420 -                       reg = <8>;
421 +&i2c5 {
422 +       pinctrl-0 = <&i2c5_pins>;
423 +       pinctrl-names = "default";
424  
425 -                       adv7482_hdmi: endpoint {
426 -                               remote-endpoint = <&hdmi_in_con>;
427 -                       };
428 -               };
429 +       status = "okay";
430  
431 -               port@a {
432 -                       reg = <10>;
433 +       clock-frequency = <100000>;
434  
435 -                       adv7482_txa: endpoint {
436 -                               clock-lanes = <0>;
437 -                               data-lanes = <1 2 3 4>;
438 -                               remote-endpoint = <&csi40_in>;
439 -                       };
440 -               };
441 +       ak4613: codec@10 {
442 +               compatible = "asahi-kasei,ak4613";
443 +               #sound-dai-cells = <0>;
444 +               reg = <0x10>;
445 +               clocks = <&rcar_sound 3>;
446  
447 -               port@b {
448 -                       reg = <11>;
449 +               asahi-kasei,in1-single-end;
450 +               asahi-kasei,in2-single-end;
451 +               asahi-kasei,out1-single-end;
452 +               asahi-kasei,out2-single-end;
453 +               asahi-kasei,out3-single-end;
454 +               asahi-kasei,out4-single-end;
455 +               asahi-kasei,out5-single-end;
456 +               asahi-kasei,out6-single-end;
457  
458 -                       adv7482_txb: endpoint {
459 -                               clock-lanes = <0>;
460 -                               data-lanes = <1>;
461 -                               remote-endpoint = <&csi20_in>;
462 +               port {
463 +                       ak4613_endpoint: endpoint {
464 +                               remote-endpoint = <&rsnd_endpoint0>;
465                         };
466                 };
467         };
468 @@ -550,10 +505,6 @@
469         };
470  };
471  
472 -&lvds0 {
473 -       status = "okay";
474 -};
475 -
476  &ohci0 {
477         dr_mode = "otg";
478         status = "okay";
479 @@ -565,6 +516,7 @@
480  
481  &pcie_bus_clk {
482         clock-frequency = <100000000>;
483 +       status = "okay";
484  };
485  
486  &pciec0 {
487 @@ -575,6 +527,21 @@
488         status = "okay";
489  };
490  
491 +&canfd {
492 +       pinctrl-0 = <&canfd0_pins &canfd1_pins>;
493 +       pinctrl-names = "default";
494 +
495 +       status = "okay";
496 +
497 +       channel0 {
498 +               status = "okay";
499 +       };
500 +
501 +       channel1 {
502 +               status = "okay";
503 +       };
504 +};
505 +
506  &pfc {
507         pinctrl-0 = <&scif_clk_pins>;
508         pinctrl-names = "default";
509 @@ -597,38 +564,43 @@
510                 };
511         };
512  
513 -       du_pins: du {
514 -               groups = "du_rgb888", "du_sync", "du_oddf", "du_clk_out_0";
515 -               function = "du";
516 +       hscif0_pins: hscif0 {
517 +               groups = "hscif0_data", "hscif0_ctrl";
518 +               function = "hscif0";
519         };
520  
521         hscif1_pins: hscif1 {
522 -               groups = "hscif1_data_a", "hscif1_ctrl_a";
523 +               groups = "hscif1_data_a";
524                 function = "hscif1";
525         };
526  
527 +       hscif2_pins: hscif2 {
528 +               groups = "hscif2_data_c";
529 +               function = "hscif2";
530 +       };
531 +
532         i2c2_pins: i2c2 {
533                 groups = "i2c2_a";
534                 function = "i2c2";
535         };
536  
537 -       irq0_pins: irq0 {
538 -               groups = "intc_ex_irq0";
539 -               function = "intc_ex";
540 +       i2c3_pins: i2c3 {
541 +               groups = "i2c3";
542 +               function = "i2c3";
543         };
544  
545 -       pwm1_pins: pwm1 {
546 -               groups = "pwm1_a";
547 -               function = "pwm1";
548 +       i2c5_pins: i2c5 {
549 +               groups = "i2c5";
550 +               function = "i2c5";
551         };
552  
553 -       pwm2_pins: pwm2 {
554 -               groups = "pwm2_a";
555 -               function = "pwm2";
556 +       irq0_pins: irq0 {
557 +               groups = "intc_ex_irq0";
558 +               function = "intc_ex";
559         };
560  
561         scif1_pins: scif1 {
562 -               groups = "scif1_data_a", "scif1_ctrl";
563 +               groups = "scif1_data_b";
564                 function = "scif1";
565         };
566  
567 @@ -637,6 +609,11 @@
568                 function = "scif2";
569         };
570  
571 +       scif5_pins: scif5 {
572 +               groups = "scif5_data_a";
573 +               function = "scif5";
574 +       };
575 +
576         scif_clk_pins: scif_clk {
577                 groups = "scif_clk_a";
578                 function = "scif_clk";
579 @@ -679,13 +656,13 @@
580         };
581  
582         sound_pins: sound {
583 -               groups = "ssi01239_ctrl", "ssi0_data", "ssi1_data_a";
584 +               groups = "ssi349_ctrl", "ssi3_data", "ssi4_data";
585                 function = "ssi";
586         };
587  
588         sound_clk_pins: sound_clk {
589 -               groups = "audio_clk_a_a", "audio_clk_b_a", "audio_clk_c_a",
590 -                        "audio_clkout_a", "audio_clkout3_a";
591 +               groups = "audio_clk_a_a", "audio_clk_b_a",
592 +                        "audio_clkout_a", "audio_clkout3_b";
593                 function = "audio_clk";
594         };
595  
596 @@ -695,40 +672,24 @@
597         };
598  
599         usb1_pins: usb1 {
600 -               mux {
601 -                       groups = "usb1";
602 -                       function = "usb1";
603 -               };
604 -
605 -               ovc {
606 -                       pins = "GP_6_27";
607 -                       bias-pull-up;
608 -               };
609 -
610 -               pwen {
611 -                       pins = "GP_6_26";
612 -                       bias-pull-down;
613 -               };
614 +               groups = "usb1";
615 +               function = "usb1";
616         };
617  
618         usb30_pins: usb30 {
619                 groups = "usb30";
620                 function = "usb30";
621         };
622 -};
623 -
624 -&pwm1 {
625 -       pinctrl-0 = <&pwm1_pins>;
626 -       pinctrl-names = "default";
627 -
628 -       status = "okay";
629 -};
630  
631 -&pwm2 {
632 -       pinctrl-0 = <&pwm2_pins>;
633 -       pinctrl-names = "default";
634 +       canfd0_pins: canfd0 {
635 +               groups = "canfd0_data_a";
636 +               function = "canfd0";
637 +       };
638  
639 -       status = "okay";
640 +       canfd1_pins: canfd1 {
641 +               groups = "canfd1_data";
642 +               function = "canfd1";
643 +       };
644  };
645  
646  &rcar_sound {
647 @@ -775,8 +736,8 @@
648                                 bitclock-master = <&rsnd_endpoint0>;
649                                 frame-master = <&rsnd_endpoint0>;
650  
651 -                               playback = <&ssi0 &src0 &dvc0>;
652 -                               capture  = <&ssi1 &src1 &dvc1>;
653 +                               playback = <&ssi3>; //ssi0 -> ssi3
654 +                               capture  = <&ssi4>; //ssi1 -> ssi4
655                         };
656                 };
657         };
658 @@ -803,6 +764,13 @@
659         status = "okay";
660  };
661  
662 +&scif5 {
663 +       pinctrl-0 = <&scif5_pins>;
664 +       pinctrl-names = "default";
665 +
666 +       status = "okay";
667 +};
668 +
669  &scif_clk {
670         clock-frequency = <14745600>;
671  };
672 @@ -857,7 +825,7 @@
673         status = "okay";
674  };
675  
676 -&ssi1 {
677 +&ssi4 {
678         shared-pin;
679  };
680  
681 @@ -869,7 +837,6 @@
682         pinctrl-0 = <&usb0_pins>;
683         pinctrl-names = "default";
684  
685 -       vbus-supply = <&vbus0_usb2>;
686         status = "okay";
687  };
688  
689 diff --git a/drivers/iio/imu/Kconfig b/drivers/iio/imu/Kconfig
690 index 156630a..463210d 100644
691 --- a/drivers/iio/imu/Kconfig
692 +++ b/drivers/iio/imu/Kconfig
693 @@ -40,6 +40,7 @@ config KMX61
694  
695  source "drivers/iio/imu/inv_mpu6050/Kconfig"
696  source "drivers/iio/imu/st_lsm6dsx/Kconfig"
697 +source "drivers/iio/imu/st_asm330lhh/Kconfig"
698  
699  endmenu
700  
701 diff --git a/drivers/iio/imu/Makefile b/drivers/iio/imu/Makefile
702 index 68629c68..349a7de 100644
703 --- a/drivers/iio/imu/Makefile
704 +++ b/drivers/iio/imu/Makefile
705 @@ -20,3 +20,4 @@ obj-y += inv_mpu6050/
706  obj-$(CONFIG_KMX61) += kmx61.o
707  
708  obj-y += st_lsm6dsx/
709 +obj-y += st_asm330lhh/
710 diff --git a/drivers/media/i2c/adv748x/adv748x-core.c b/drivers/media/i2c/adv748x/adv748x-core.c
711 index da8f062..c2b37f7 100644
712 --- a/drivers/media/i2c/adv748x/adv748x-core.c
713 +++ b/drivers/media/i2c/adv748x/adv748x-core.c
714 @@ -165,6 +165,21 @@ static int adv748x_i2c_addresses[ADV748X_PAGE_MAX] = {
715         ADV748X_I2C_TXA,
716  };
717  
718 +/* Default addresses for the I2C pages 0x71*/
719 +static int adv748x_i2c_addresses2[ADV748X_PAGE_MAX] = {
720 +       ADV748X_I2C_IO2,
721 +       ADV748X_I2C_DPLL2,
722 +       ADV748X_I2C_CP2,
723 +       ADV748X_I2C_HDMI2,
724 +       ADV748X_I2C_EDID2,
725 +       ADV748X_I2C_REPEATER2,
726 +       ADV748X_I2C_INFOFRAME2,
727 +       ADV748X_I2C_CEC2,
728 +       ADV748X_I2C_SDP2,
729 +       ADV748X_I2C_TXB2,
730 +       ADV748X_I2C_TXA2,
731 +};
732 +
733  static int adv748x_read_check(struct adv748x_state *state,
734                               int client_page, u8 reg)
735  {
736 @@ -238,9 +253,16 @@ static int adv748x_initialise_clients(struct adv748x_state *state)
737         int ret;
738  
739         for (i = ADV748X_PAGE_DPLL; i < ADV748X_PAGE_MAX; ++i) {
740 -               state->i2c_clients[i] =
741 -                       adv748x_dummy_client(state, adv748x_i2c_addresses[i],
742 -                                            ADV748X_IO_SLAVE_ADDR_BASE + i);
743 +               if((state->client->addr << 1) == 0xe0) {
744 +                       state->i2c_clients[i] =
745 +                               adv748x_dummy_client(state, adv748x_i2c_addresses[i],
746 +                                               ADV748X_IO_SLAVE_ADDR_BASE + i);
747 +               } else {
748 +                       state->i2c_clients[i] =
749 +                               adv748x_dummy_client(state, adv748x_i2c_addresses2[i],
750 +                                               ADV748X_IO_SLAVE_ADDR_BASE + i);
751 +               }
752 +
753                 if (state->i2c_clients[i] == NULL) {
754                         adv_err(state, "failed to create i2c client %u\n", i);
755                         return -ENOMEM;
756 @@ -508,6 +530,20 @@ static const struct adv748x_reg_value adv748x_set_slave_address[] = {
757         {ADV748X_PAGE_EOR, 0xff, 0xff}  /* End of register table */
758  };
759  
760 +static const struct adv748x_reg_value adv748x_set_slave_address2[] = {
761 +       {ADV748X_PAGE_IO, 0xf3, ADV748X_I2C_DPLL2 << 1},
762 +       {ADV748X_PAGE_IO, 0xf4, ADV748X_I2C_CP2 << 1},
763 +       {ADV748X_PAGE_IO, 0xf5, ADV748X_I2C_HDMI2 << 1},
764 +       {ADV748X_PAGE_IO, 0xf6, ADV748X_I2C_EDID2 << 1},
765 +       {ADV748X_PAGE_IO, 0xf7, ADV748X_I2C_REPEATER2 << 1},
766 +       {ADV748X_PAGE_IO, 0xf8, ADV748X_I2C_INFOFRAME2 << 1},
767 +       {ADV748X_PAGE_IO, 0xfa, ADV748X_I2C_CEC2 << 1},
768 +       {ADV748X_PAGE_IO, 0xfb, ADV748X_I2C_SDP2 << 1},
769 +       {ADV748X_PAGE_IO, 0xfc, ADV748X_I2C_TXB2 << 1},
770 +       {ADV748X_PAGE_IO, 0xfd, ADV748X_I2C_TXA2 << 1},
771 +       {ADV748X_PAGE_EOR, 0xff, 0xff}  /* End of register table */
772 +};
773 +
774  /* Supported Formats For Script Below */
775  /* - 01-29 HDMI to MIPI TxA CSI 4-Lane - RGB888: */
776  static const struct adv748x_reg_value adv748x_init_txa_4lane[] = {
777 @@ -683,7 +719,11 @@ static int adv748x_reset(struct adv748x_state *state)
778         if (ret < 0)
779                 return ret;
780  
781 -       ret = adv748x_write_regs(state, adv748x_set_slave_address);
782 +       if((state->client->addr << 1) == 0xe0) {
783 +               ret = adv748x_write_regs(state, adv748x_set_slave_address);     //i2c address 0x70
784 +       } else {
785 +               ret = adv748x_write_regs(state, adv748x_set_slave_address2);    //i2c address 0x71
786 +       }
787         if (ret < 0)
788                 return ret;
789  
790 diff --git a/drivers/media/i2c/adv748x/adv748x.h b/drivers/media/i2c/adv748x/adv748x.h
791 index fb30bfa..ac50a9e 100644
792 --- a/drivers/media/i2c/adv748x/adv748x.h
793 +++ b/drivers/media/i2c/adv748x/adv748x.h
794 @@ -40,6 +40,18 @@
795  #define ADV748X_I2C_TXB                        0x48    /* CSI-TXB Map */
796  #define ADV748X_I2C_TXA                        0x4a    /* CSI-TXA Map */
797  
798 +#define ADV748X_I2C_IO2                        0x71    /* IO Map */
799 +#define ADV748X_I2C_DPLL2              0x27    /* DPLL Map */
800 +#define ADV748X_I2C_CP2                        0x23    /* CP Map */
801 +#define ADV748X_I2C_HDMI2              0x35    /* HDMI Map */
802 +#define ADV748X_I2C_EDID2              0x37    /* EDID Map */
803 +#define ADV748X_I2C_REPEATER2          0x33    /* HDMI RX Repeater Map */
804 +#define ADV748X_I2C_INFOFRAME2         0x30    /* HDMI RX InfoFrame Map */
805 +#define ADV748X_I2C_CEC2               0x42    /* CEC Map */
806 +#define ADV748X_I2C_SDP2               0x78    /* SDP Map */
807 +#define ADV748X_I2C_TXB2               0x49    /* CSI-TXB Map */
808 +#define ADV748X_I2C_TXA2               0x4b    /* CSI-TXA Map */
809 +
810  enum adv748x_page {
811         ADV748X_PAGE_IO,
812         ADV748X_PAGE_DPLL,
813 diff --git a/drivers/pinctrl/sh-pfc/pfc-r8a7795.c b/drivers/pinctrl/sh-pfc/pfc-r8a7795.c
814 index 3ebe8de..546761c 100644
815 --- a/drivers/pinctrl/sh-pfc/pfc-r8a7795.c
816 +++ b/drivers/pinctrl/sh-pfc/pfc-r8a7795.c
817 @@ -3912,7 +3912,7 @@ static const unsigned int tmu_tclk2_b_mux[] = {
818  /* - USB0 ------------------------------------------------------------------- */
819  static const unsigned int usb0_pins[] = {
820         /* PWEN, OVC */
821 -       RCAR_GP_PIN(6, 24), RCAR_GP_PIN(6, 25),
822 +       RCAR_GP_PIN(6, 24),
823  };
824  static const unsigned int usb0_mux[] = {
825         USB0_PWEN_MARK, USB0_OVC_MARK,
826 @@ -3920,7 +3920,7 @@ static const unsigned int usb0_mux[] = {
827  /* - USB1 ------------------------------------------------------------------- */
828  static const unsigned int usb1_pins[] = {
829         /* PWEN, OVC */
830 -       RCAR_GP_PIN(6, 26), RCAR_GP_PIN(6, 27),
831 +       RCAR_GP_PIN(6, 27),
832  };
833  static const unsigned int usb1_mux[] = {
834         USB1_PWEN_MARK, USB1_OVC_MARK,
835 @@ -3936,7 +3936,7 @@ static const unsigned int usb2_mux[] = {
836  /* - USB2_CH3 --------------------------------------------------------------- */
837  static const unsigned int usb2_ch3_pins[] = {
838         /* PWEN, OVC */
839 -       RCAR_GP_PIN(6, 30), RCAR_GP_PIN(6, 31),
840 +       RCAR_GP_PIN(6, 30),
841  };
842  static const unsigned int usb2_ch3_mux[] = {
843         USB2_CH3_PWEN_MARK, USB2_CH3_OVC_MARK,
844 -- 
845 2.7.4
846