1 Add AGL reference hardware support
3 Upstream-Status: pending
5 Signed-off-by: Scott Murray <scott.murray@konsulko.com>
8 arch/arm64/boot/dts/renesas/agl-refhw-common.dtsi | 912 ++++++++++++++++++++++
9 arch/arm64/boot/dts/renesas/r8a7795-agl-refhw.dts | 378 +++++++++
10 drivers/media/i2c/adv748x/adv748x-core.c | 48 +-
11 drivers/media/i2c/adv748x/adv748x.h | 12 +
12 4 files changed, 1346 insertions(+), 4 deletions(-)
14 diff --git a/arch/arm64/boot/dts/renesas/agl-refhw-common.dtsi b/arch/arm64/boot/dts/renesas/agl-refhw-common.dtsi
16 index 000000000000..a35cd24b27b9
18 +++ b/arch/arm64/boot/dts/renesas/agl-refhw-common.dtsi
20 +// SPDX-License-Identifier: GPL-2.0
22 + * Device Tree Source for common parts of AGL Reference Hardware board variants
24 + * Copyright (C) 2015-2017 Renesas Electronics Corp.
25 + * Copyright (C) 2020 Konsulko Group
29 + * This file is derived from salvator-common.dtsi
31 + * It is currently unclear if the modifications made are such that they could
32 + * be done on top of salvator-common.dtsi to allow removing the duplication.
33 + * It is likely that the common pieces with salvator-common.dtsi would need to
34 + * be factored out into a new common file, which is perhaps hard to justify.
40 + * This command is required when Playback/Capture
42 + * amixer set "DVC Out" 100%
43 + * amixer set "DVC In" 100%
47 + * amixer set "DVC Out Mute" on
48 + * amixer set "DVC In Mute" on
50 + * You can use Volume Ramp
52 + * amixer set "DVC Out Ramp Up Rate" "0.125 dB/64 steps"
53 + * amixer set "DVC Out Ramp Down Rate" "0.125 dB/512 steps"
54 + * amixer set "DVC Out Ramp" on
56 + * amixer set "DVC Out" 80% // Volume Down
57 + * amixer set "DVC Out" 100% // Volume Up
60 +#include <dt-bindings/gpio/gpio.h>
74 + bootargs = "ignore_loglevel rw root=/dev/nfs ip=dhcp";
75 + stdout-path = "serial0:115200n8";
78 + audio_clkout: audio-clkout {
80 + * This is same as <&rcar_sound 0>
81 + * but needed to avoid cs2000/rcar_sound probe dead-lock
83 + compatible = "fixed-clock";
85 + clock-frequency = <12288000>;
89 + compatible = "renesas,avb-mch-gen3";
90 + reg = <0 0xec5a0100 0 0x100>; /* ADG_AVB */
91 + reg-name = "adg_avb";
93 + clocks = <&cpg CPG_MOD 922>;
94 + clock-names = "adg";
95 + resets = <&cpg 922>;
99 + compatible = "hdmi-connector";
100 + label = "HDMI0 IN";
104 + hdmi_in_con: endpoint {
105 + remote-endpoint = <&adv7481_hdmi>;
111 + compatible = "hdmi-connector";
112 + label = "HDMI2 IN";
116 + hdmi_in_con2: endpoint {
117 + remote-endpoint = <&adv7481_hdmi2>;
122 + reg_1p8v: regulator0 {
123 + compatible = "regulator-fixed";
124 + regulator-name = "fixed-1.8V";
125 + regulator-min-microvolt = <1800000>;
126 + regulator-max-microvolt = <1800000>;
128 + regulator-always-on;
131 + reg_3p3v: regulator1 {
132 + compatible = "regulator-fixed";
133 + regulator-name = "fixed-3.3V";
134 + regulator-min-microvolt = <3300000>;
135 + regulator-max-microvolt = <3300000>;
137 + regulator-always-on;
140 + reg_12v: regulator2 {
141 + compatible = "regulator-fixed";
142 + regulator-name = "fixed-12V";
143 + regulator-min-microvolt = <12000000>;
144 + regulator-max-microvolt = <12000000>;
146 + regulator-always-on;
149 + sound_card: sound {
150 + compatible = "audio-graph-card";
152 + label = "rcar-sound";
154 + dais = <&rsnd_port0>;
157 + vcc_sdhi0: regulator-vcc-sdhi0 {
158 + compatible = "regulator-fixed";
160 + regulator-name = "SDHI0 Vcc";
161 + regulator-min-microvolt = <3300000>;
162 + regulator-max-microvolt = <3300000>;
164 + gpio = <&gpio5 2 GPIO_ACTIVE_HIGH>;
165 + enable-active-high;
168 + vccq_sdhi0: regulator-vccq-sdhi0 {
169 + compatible = "regulator-gpio";
171 + regulator-name = "SDHI0 VccQ";
172 + regulator-min-microvolt = <1800000>;
173 + regulator-max-microvolt = <3300000>;
175 + gpios = <&gpio5 1 GPIO_ACTIVE_HIGH>;
176 + gpios-states = <1>;
177 + states = <3300000 1
181 + vcc_sdhi3: regulator-vcc-sdhi3 {
182 + compatible = "regulator-fixed";
184 + regulator-name = "SDHI3 Vcc";
185 + regulator-min-microvolt = <3300000>;
186 + regulator-max-microvolt = <3300000>;
188 + gpio = <&gpio3 15 GPIO_ACTIVE_HIGH>;
189 + enable-active-high;
192 + vccq_sdhi3: regulator-vccq-sdhi3 {
193 + compatible = "regulator-gpio";
195 + regulator-name = "SDHI3 VccQ";
196 + regulator-min-microvolt = <1800000>;
197 + regulator-max-microvolt = <3300000>;
199 + gpios = <&gpio3 14 GPIO_ACTIVE_HIGH>;
200 + gpios-states = <1>;
201 + states = <3300000 1
206 + compatible = "hdmi-connector";
207 + label = "HDMI0 OUT";
211 + hdmi0_con: endpoint {
217 + compatible = "hdmi-connector";
218 + label = "HDMI1 OUT";
222 + hdmi1_con: endpoint {
228 + compatible = "fixed-clock";
229 + #clock-cells = <0>;
230 + clock-frequency = <24576000>;
233 + /* External DU dot clocks */
234 + x21_clk: x21-clock {
235 + compatible = "fixed-clock";
236 + #clock-cells = <0>;
237 + clock-frequency = <33000000>;
240 + x22_clk: x22-clock {
241 + compatible = "fixed-clock";
242 + #clock-cells = <0>;
243 + clock-frequency = <33000000>;
246 + x23_clk: x23-clock {
247 + compatible = "fixed-clock";
248 + #clock-cells = <0>;
249 + clock-frequency = <25000000>;
254 + cpu-supply = <&dvfs>;
258 + clock-frequency = <22579200>;
262 + pinctrl-0 = <&avb_pins>;
263 + pinctrl-names = "default";
264 + phy-handle = <&phy0>;
265 + phy-mode = "rgmii-txid";
268 + phy0: ethernet-phy@0 {
269 + rxc-skew-ps = <1500>;
271 + interrupt-parent = <&gpio2>;
272 + interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
273 + reset-gpios = <&gpio2 10 GPIO_ACTIVE_LOW>;
284 + csi40_in: endpoint {
286 + data-lanes = <1 2 3 4>;
287 + remote-endpoint = <&adv7481_txa>;
300 + csi41_in: endpoint {
302 + data-lanes = <1 2 3 4>;
303 + remote-endpoint = <&adv7481_txa2>;
324 + clock-frequency = <32768>;
328 + pinctrl-0 = <&hscif0_pins>;
329 + pinctrl-names = "default";
336 + pinctrl-0 = <&hscif1_pins>;
337 + pinctrl-names = "default";
339 + /* Please use exclusively to the scif1 node */
344 + pinctrl-0 = <&hscif2_pins>;
345 + pinctrl-names = "default";
356 + pinctrl-0 = <&i2c2_pins>;
357 + pinctrl-names = "default";
361 + clock-frequency = <100000>;
363 + video-receiver@70 {
364 + compatible = "adi,adv7481";
367 + #address-cells = <1>;
370 + interrupt-parent = <&gpio0>;
371 + interrupt-names = "intrq1", "intrq3";
372 + interrupts = <4 IRQ_TYPE_LEVEL_LOW>,
373 + <5 IRQ_TYPE_LEVEL_LOW>;
378 + adv7481_hdmi: endpoint {
379 + remote-endpoint = <&hdmi_in_con>;
386 + adv7481_txa: endpoint {
388 + data-lanes = <1 2 3 4>;
389 + remote-endpoint = <&csi40_in>;
395 + video-receiver@71 {
396 + compatible = "adi,adv7481";
399 + #address-cells = <1>;
402 + interrupt-parent = <&gpio6>;
403 + interrupt-names = "intrq1", "intrq3";
404 + interrupts = <0 IRQ_TYPE_LEVEL_LOW>,
405 + <1 IRQ_TYPE_LEVEL_LOW>;
410 + adv7481_hdmi2: endpoint {
411 + remote-endpoint = <&hdmi_in_con2>;
418 + adv7481_txa2: endpoint {
420 + data-lanes = <1 2 3 4>;
421 + remote-endpoint = <&csi41_in>;
426 + cs2000: clk_multiplier@4f {
427 + #clock-cells = <0>;
428 + compatible = "cirrus,cs2000-cp";
430 + clocks = <&audio_clkout>, <&x12_clk>;
431 + clock-names = "clk_in", "ref_clk";
433 + assigned-clocks = <&cs2000>;
434 + assigned-clock-rates = <24576000>; /* 1/1 divide */
439 + pinctrl-0 = <&i2c3_pins>;
440 + pinctrl-names = "default";
444 + clock-frequency = <100000>;
447 + compatible = "st,asm330lhh";
450 + interrupt-names = "int1", "int2";
451 + interrupts = <&gpio6 23 IRQ_TYPE_EDGE_RISING>,
452 + <&gpio2 6 IRQ_TYPE_EDGE_RISING>;
459 + versaclock5: clock-generator@68 {
460 + compatible = "idt,9fgv0841";
462 + #clock-cells = <1>;
463 + clocks = <&x23_clk>;
464 + clock-names = "xin";
469 + pinctrl-0 = <&i2c5_pins>;
470 + pinctrl-names = "default";
474 + clock-frequency = <100000>;
477 + compatible = "asahi-kasei,ak4613";
478 + #sound-dai-cells = <0>;
480 + clocks = <&rcar_sound 3>;
482 + asahi-kasei,in1-single-end;
483 + asahi-kasei,in2-single-end;
484 + asahi-kasei,out1-single-end;
485 + asahi-kasei,out2-single-end;
486 + asahi-kasei,out3-single-end;
487 + asahi-kasei,out4-single-end;
488 + asahi-kasei,out5-single-end;
489 + asahi-kasei,out6-single-end;
492 + ak4613_endpoint: endpoint {
493 + remote-endpoint = <&rsnd_endpoint0>;
502 + clock-frequency = <400000>;
505 + pinctrl-0 = <&irq0_pins>;
506 + pinctrl-names = "default";
508 + compatible = "rohm,bd9571mwv";
510 + interrupt-parent = <&intc_ex>;
511 + interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
512 + interrupt-controller;
513 + #interrupt-cells = <2>;
516 + rohm,ddr-backup-power = <0xf>;
517 + rohm,rstbmode-level;
521 + regulator-name = "dvfs";
522 + regulator-min-microvolt = <750000>;
523 + regulator-max-microvolt = <1030000>;
525 + regulator-always-on;
531 + compatible = "rohm,br24t01", "atmel,24c01";
547 + clock-frequency = <100000000>;
560 + pinctrl-0 = <&canfd0_pins &canfd1_pins>;
561 + pinctrl-names = "default";
575 + pinctrl-0 = <&scif_clk_pins>;
576 + pinctrl-names = "default";
580 + groups = "avb_link", "avb_mdio", "avb_mii";
585 + groups = "avb_mdio";
586 + drive-strength = <24>;
590 + pins = "PIN_AVB_TX_CTL", "PIN_AVB_TXC", "PIN_AVB_TD0",
591 + "PIN_AVB_TD1", "PIN_AVB_TD2", "PIN_AVB_TD3";
592 + drive-strength = <12>;
596 + hscif0_pins: hscif0 {
597 + groups = "hscif0_data", "hscif0_ctrl";
598 + function = "hscif0";
601 + hscif1_pins: hscif1 {
602 + groups = "hscif1_data_a";
603 + function = "hscif1";
606 + hscif2_pins: hscif2 {
607 + groups = "hscif2_data_c";
608 + function = "hscif2";
627 + groups = "intc_ex_irq0";
628 + function = "intc_ex";
631 + scif1_pins: scif1 {
632 + groups = "scif1_data_b";
633 + function = "scif1";
636 + scif2_pins: scif2 {
637 + groups = "scif2_data_a";
638 + function = "scif2";
641 + scif5_pins: scif5 {
642 + groups = "scif5_data_a";
643 + function = "scif5";
646 + scif_clk_pins: scif_clk {
647 + groups = "scif_clk_a";
648 + function = "scif_clk";
652 + groups = "sdhi0_data4", "sdhi0_ctrl";
653 + function = "sdhi0";
654 + power-source = <3300>;
657 + sdhi0_pins_uhs: sd0_uhs {
658 + groups = "sdhi0_data4", "sdhi0_ctrl";
659 + function = "sdhi0";
660 + power-source = <1800>;
664 + groups = "sdhi2_data8", "sdhi2_ctrl", "sdhi2_ds";
665 + function = "sdhi2";
666 + power-source = <3300>;
669 + sdhi2_pins_uhs: sd2_uhs {
670 + groups = "sdhi2_data8", "sdhi2_ctrl", "sdhi2_ds";
671 + function = "sdhi2";
672 + power-source = <1800>;
676 + groups = "sdhi3_data4", "sdhi3_ctrl";
677 + function = "sdhi3";
678 + power-source = <3300>;
681 + sdhi3_pins_uhs: sd3_uhs {
682 + groups = "sdhi3_data4", "sdhi3_ctrl";
683 + function = "sdhi3";
684 + power-source = <1800>;
687 + sound_pins: sound {
688 + groups = "ssi349_ctrl", "ssi3_data", "ssi4_data";
692 + sound_clk_pins: sound_clk {
693 + groups = "audio_clk_a_a", "audio_clk_b_a",
694 + "audio_clkout_a", "audio_clkout3_b";
695 + function = "audio_clk";
708 + usb30_pins: usb30 {
709 + groups = "usb30", "usb30_ovc";
710 + function = "usb30";
713 + canfd0_pins: canfd0 {
714 + groups = "canfd0_data_a";
715 + function = "canfd0";
718 + canfd1_pins: canfd1 {
719 + groups = "canfd1_data";
720 + function = "canfd1";
725 + pinctrl-0 = <&sound_pins &sound_clk_pins>;
726 + pinctrl-names = "default";
729 + #sound-dai-cells = <0>;
731 + /* audio_clkout0/1/2/3 */
732 + #clock-cells = <1>;
733 + clock-frequency = <12288000 11289600>;
737 + /* update <audio_clk_b> to <cs2000> */
738 + clocks = <&cpg CPG_MOD 1005>,
739 + <&cpg CPG_MOD 1006>, <&cpg CPG_MOD 1007>,
740 + <&cpg CPG_MOD 1008>, <&cpg CPG_MOD 1009>,
741 + <&cpg CPG_MOD 1010>, <&cpg CPG_MOD 1011>,
742 + <&cpg CPG_MOD 1012>, <&cpg CPG_MOD 1013>,
743 + <&cpg CPG_MOD 1014>, <&cpg CPG_MOD 1015>,
744 + <&cpg CPG_MOD 1022>, <&cpg CPG_MOD 1023>,
745 + <&cpg CPG_MOD 1024>, <&cpg CPG_MOD 1025>,
746 + <&cpg CPG_MOD 1026>, <&cpg CPG_MOD 1027>,
747 + <&cpg CPG_MOD 1028>, <&cpg CPG_MOD 1029>,
748 + <&cpg CPG_MOD 1030>, <&cpg CPG_MOD 1031>,
749 + <&cpg CPG_MOD 1020>, <&cpg CPG_MOD 1021>,
750 + <&cpg CPG_MOD 1020>, <&cpg CPG_MOD 1021>,
751 + <&cpg CPG_MOD 1019>, <&cpg CPG_MOD 1018>,
752 + <&audio_clk_a>, <&cs2000>,
754 + <&cpg CPG_CORE CPG_AUDIO_CLK_I>;
757 + #address-cells = <1>;
759 + rsnd_port0: port@0 {
761 + rsnd_endpoint0: endpoint {
762 + remote-endpoint = <&ak4613_endpoint>;
764 + dai-format = "left_j";
765 + bitclock-master = <&rsnd_endpoint0>;
766 + frame-master = <&rsnd_endpoint0>;
768 + playback = <&ssi3>; //ssi0 -> ssi3
769 + capture = <&ssi4>; //ssi1 -> ssi4
776 + timeout-sec = <60>;
781 + pinctrl-0 = <&scif1_pins>;
782 + pinctrl-names = "default";
785 + /* Please use exclusively to the hscif1 node */
790 + pinctrl-0 = <&scif2_pins>;
791 + pinctrl-names = "default";
797 + pinctrl-0 = <&scif5_pins>;
798 + pinctrl-names = "default";
804 + clock-frequency = <14745600>;
808 + pinctrl-0 = <&sdhi0_pins>;
809 + pinctrl-1 = <&sdhi0_pins_uhs>;
810 + pinctrl-names = "default", "state_uhs";
812 + vmmc-supply = <&vcc_sdhi0>;
813 + vqmmc-supply = <&vccq_sdhi0>;
814 + cd-gpios = <&gpio3 12 GPIO_ACTIVE_LOW>;
815 + wp-gpios = <&gpio3 13 GPIO_ACTIVE_HIGH>;
823 + /* used for on-board 8bit eMMC */
824 + pinctrl-0 = <&sdhi2_pins>;
825 + pinctrl-1 = <&sdhi2_pins_uhs>;
826 + pinctrl-names = "default", "state_uhs";
828 + iommus = <&ipmmu_ds1 34>;
830 + vmmc-supply = <®_3p3v>;
831 + vqmmc-supply = <®_1p8v>;
838 + fixed-emmc-driver-type = <1>;
843 + pinctrl-0 = <&sdhi3_pins>;
844 + pinctrl-1 = <&sdhi3_pins_uhs>;
845 + pinctrl-names = "default", "state_uhs";
847 + vmmc-supply = <&vcc_sdhi3>;
848 + vqmmc-supply = <&vccq_sdhi3>;
849 + cd-gpios = <&gpio4 15 GPIO_ACTIVE_LOW>;
850 + wp-gpios = <&gpio4 16 GPIO_ACTIVE_HIGH>;
862 + clock-frequency = <50000000>;
866 + pinctrl-0 = <&usb0_pins>;
867 + pinctrl-names = "default";
873 + pinctrl-0 = <&usb1_pins>;
874 + pinctrl-names = "default";
880 + phys = <&usb3_phy0>;
891 + clock-frequency = <100000000>;
927 + pinctrl-0 = <&usb30_pins>;
928 + pinctrl-names = "default";
932 diff --git a/arch/arm64/boot/dts/renesas/r8a7795-agl-refhw.dts b/arch/arm64/boot/dts/renesas/r8a7795-agl-refhw.dts
934 index 000000000000..0a63d2e7a64b
936 +++ b/arch/arm64/boot/dts/renesas/r8a7795-agl-refhw.dts
939 + * Device Tree Source for the AGL reference hardware board with R-Car H3 ES3.0
941 + * Copyright (C) 2019 Panasonic Corp.
942 + * Copyright (C) 2020 Konsulko Group
944 + * This file is licensed under the terms of the GNU General Public License
945 + * version 2. This program is licensed "as is" without any warranty of any
946 + * kind, whether express or implied.
950 + * This file is for the most part derived from:
952 + * - r8a7795-salvator-xs-4x2g.dts
953 + * - r8a7795-salvator-xs.dts
954 + * - salvator-xs.dtsi
956 + * With agl-refhw-common.dtsi replacing (and derived from) salvator-common.dtsi.
960 +#include "r8a7795.dtsi"
961 +#include "agl-refhw-common.dtsi"
964 + model = "AGL Reference Hardware based on r8a7795 ES3.0+ with 8GiB (4 x 2 GiB)";
965 + compatible = "agl,refhw-h3", "renesas,r8a7795";
968 + device_type = "memory";
969 + /* first 128MB is reserved for secure area. */
970 + reg = <0x0 0x48000000 0x0 0x78000000>;
974 + device_type = "memory";
975 + reg = <0x5 0x00000000 0x0 0x80000000>;
979 + device_type = "memory";
980 + reg = <0x6 0x00000000 0x0 0x80000000>;
984 + device_type = "memory";
985 + reg = <0x7 0x00000000 0x0 0x80000000>;
989 + #address-cells = <2>;
993 + /* device specific region for Lossy Decompression */
994 + lossy_decompress: linux,lossy_decompress@54000000 {
996 + reg = <0x00000000 0x54000000 0x0 0x03000000>;
999 + /* For Audio DSP */
1000 + adsp_reserved: linux,adsp@57000000 {
1001 + compatible = "shared-dma-pool";
1003 + reg = <0x00000000 0x57000000 0x0 0x01000000>;
1006 + /* global autoconfigured region for contiguous allocations */
1007 + linux,cma@58000000 {
1008 + compatible = "shared-dma-pool";
1010 + reg = <0x00000000 0x58000000 0x0 0x18000000>;
1011 + linux,cma-default;
1014 + /* device specific region for contiguous allocations */
1015 + mmp_reserved: linux,multimedia@70000000 {
1016 + compatible = "shared-dma-pool";
1018 + reg = <0x00000000 0x70000000 0x0 0x10000000>;
1023 + compatible = "renesas,mmngr";
1024 + memory-region = <&mmp_reserved>, <&lossy_decompress>;
1028 + compatible = "renesas,mmngrbuf";
1032 + compatible = "renesas,vspm_if";
1037 + vga_in: endpoint {
1038 + /delete-property/remote-endpoint;
1046 + adv7123_in: endpoint {
1047 + /delete-property/remote-endpoint;
1052 + adv7123_out: endpoint {
1053 + /delete-property/remote-endpoint;
1063 + memory-region = <&adsp_reserved>;
1067 + clocks = <&cpg CPG_MOD 724>,
1068 + <&cpg CPG_MOD 723>,
1069 + <&cpg CPG_MOD 722>,
1070 + <&cpg CPG_MOD 721>,
1075 + clock-names = "du.0", "du.1", "du.2", "du.3",
1076 + "dclkin.0", "dclkin.1", "dclkin.2", "dclkin.3";
1094 + dais = <&rsnd_port0 /* ak4613 */
1095 + &rsnd_port1 /* HDMI0 */
1096 + &rsnd_port2>; /* HDMI1 */
1105 + rcar_dw_hdmi0_out: endpoint {
1106 + remote-endpoint = <&hdmi0_con>;
1111 + dw_hdmi0_snd_in: endpoint {
1112 + remote-endpoint = <&rsnd_endpoint1>;
1119 + remote-endpoint = <&rcar_dw_hdmi0_out>;
1128 + rcar_dw_hdmi1_out: endpoint {
1129 + remote-endpoint = <&hdmi1_con>;
1134 + dw_hdmi1_snd_in: endpoint {
1135 + remote-endpoint = <&rsnd_endpoint2>;
1142 + remote-endpoint = <&rcar_dw_hdmi1_out>;
1156 + /* rsnd_port0 is on salvator-common */
1157 + rsnd_port1: port@1 {
1159 + rsnd_endpoint1: endpoint {
1160 + remote-endpoint = <&dw_hdmi0_snd_in>;
1162 + dai-format = "i2s";
1163 + bitclock-master = <&rsnd_endpoint1>;
1164 + frame-master = <&rsnd_endpoint1>;
1166 + playback = <&ssi2>;
1169 + rsnd_port2: port@2 {
1171 + rsnd_endpoint2: endpoint {
1172 + remote-endpoint = <&dw_hdmi1_snd_in>;
1174 + dai-format = "i2s";
1175 + bitclock-master = <&rsnd_endpoint2>;
1176 + frame-master = <&rsnd_endpoint2>;
1178 + playback = <&ssi3>;
1186 + groups = "usb2", "usb2_ovc";
1187 + function = "usb2";
1191 + * - On Salvator-X[S], GP6_3[01] are connected to ADV7482 as irq pins
1192 + * (when SW31 is the default setting on Salvator-XS).
1193 + * - If SW31 is the default setting, you cannot use USB2.0 ch3 on
1194 + * r8a7795 with Salvator-XS.
1195 + * Hence the SW31 setting must be changed like 2) below.
1196 + * 1) Default setting of SW31: ON-ON-OFF-OFF-OFF-OFF:
1197 + * - Connect GP6_3[01] to ADV7842.
1198 + * 2) Changed setting of SW31: OFF-OFF-ON-ON-ON-ON:
1199 + * - Connect GP6_3[01] to BD082065 (USB2.0 ch3's host power).
1200 + * - Connect GP6_{04,21} to ADV7842.
1202 + usb2_ch3_pins: usb2_ch3 {
1203 + groups = "usb2_ch3";
1204 + function = "usb2_ch3";
1209 + pinctrl-0 = <&usb2_pins>;
1210 + pinctrl-names = "default";
1216 + pinctrl-0 = <&usb2_ch3_pins>;
1217 + pinctrl-names = "default";
1238 +/* End r8a7795-salvator-xs.dts content */
1241 +/* Start r8a7795-salvator-xs-4x2g.dts content */
1244 + /* Map all possible DDR as inbound ranges */
1245 + dma-ranges = <0x42000000 0 0x40000000 0 0x40000000 0 0x80000000>;
1249 + /* Map all possible DDR as inbound ranges */
1250 + dma-ranges = <0x42000000 0 0x40000000 0 0x40000000 0 0x80000000>;
1253 +/* End r8a7795-salvator-xs-4x2g.dts content */
1256 +/* Start salvator-xs.dts content */
1259 + clock-frequency = <16640000>;
1263 + clock-frequency = <400000>;
1265 + versaclock6: clock-generator@6a {
1266 + compatible = "idt,5p49v6901";
1268 + #clock-cells = <1>;
1269 + clocks = <&x23_clk>;
1270 + clock-names = "xin";
1274 +/* End salvator-xs.dts content */
1277 +/* Start reference hardware specific tweaks */
1283 + /delete-property/remote-endpoint;
1289 + /delete-property/remote-endpoint;
1296 + status = "disabled";
1300 + status = "disabled";
1304 + clock-frequency = <0>;
1308 + /delete-property/ wp-gpios;
1313 + /delete-property/ wp-gpios;
1316 diff --git a/drivers/media/i2c/adv748x/adv748x-core.c b/drivers/media/i2c/adv748x/adv748x-core.c
1317 index da8f0621a10b..c2b37f70f711 100644
1318 --- a/drivers/media/i2c/adv748x/adv748x-core.c
1319 +++ b/drivers/media/i2c/adv748x/adv748x-core.c
1320 @@ -165,6 +165,21 @@ static int adv748x_i2c_addresses[ADV748X_PAGE_MAX] = {
1324 +/* Default addresses for the I2C pages 0x71*/
1325 +static int adv748x_i2c_addresses2[ADV748X_PAGE_MAX] = {
1327 + ADV748X_I2C_DPLL2,
1329 + ADV748X_I2C_HDMI2,
1330 + ADV748X_I2C_EDID2,
1331 + ADV748X_I2C_REPEATER2,
1332 + ADV748X_I2C_INFOFRAME2,
1339 static int adv748x_read_check(struct adv748x_state *state,
1340 int client_page, u8 reg)
1342 @@ -238,9 +253,16 @@ static int adv748x_initialise_clients(struct adv748x_state *state)
1345 for (i = ADV748X_PAGE_DPLL; i < ADV748X_PAGE_MAX; ++i) {
1346 - state->i2c_clients[i] =
1347 - adv748x_dummy_client(state, adv748x_i2c_addresses[i],
1348 - ADV748X_IO_SLAVE_ADDR_BASE + i);
1349 + if((state->client->addr << 1) == 0xe0) {
1350 + state->i2c_clients[i] =
1351 + adv748x_dummy_client(state, adv748x_i2c_addresses[i],
1352 + ADV748X_IO_SLAVE_ADDR_BASE + i);
1354 + state->i2c_clients[i] =
1355 + adv748x_dummy_client(state, adv748x_i2c_addresses2[i],
1356 + ADV748X_IO_SLAVE_ADDR_BASE + i);
1359 if (state->i2c_clients[i] == NULL) {
1360 adv_err(state, "failed to create i2c client %u\n", i);
1362 @@ -508,6 +530,20 @@ static const struct adv748x_reg_value adv748x_set_slave_address[] = {
1363 {ADV748X_PAGE_EOR, 0xff, 0xff} /* End of register table */
1366 +static const struct adv748x_reg_value adv748x_set_slave_address2[] = {
1367 + {ADV748X_PAGE_IO, 0xf3, ADV748X_I2C_DPLL2 << 1},
1368 + {ADV748X_PAGE_IO, 0xf4, ADV748X_I2C_CP2 << 1},
1369 + {ADV748X_PAGE_IO, 0xf5, ADV748X_I2C_HDMI2 << 1},
1370 + {ADV748X_PAGE_IO, 0xf6, ADV748X_I2C_EDID2 << 1},
1371 + {ADV748X_PAGE_IO, 0xf7, ADV748X_I2C_REPEATER2 << 1},
1372 + {ADV748X_PAGE_IO, 0xf8, ADV748X_I2C_INFOFRAME2 << 1},
1373 + {ADV748X_PAGE_IO, 0xfa, ADV748X_I2C_CEC2 << 1},
1374 + {ADV748X_PAGE_IO, 0xfb, ADV748X_I2C_SDP2 << 1},
1375 + {ADV748X_PAGE_IO, 0xfc, ADV748X_I2C_TXB2 << 1},
1376 + {ADV748X_PAGE_IO, 0xfd, ADV748X_I2C_TXA2 << 1},
1377 + {ADV748X_PAGE_EOR, 0xff, 0xff} /* End of register table */
1380 /* Supported Formats For Script Below */
1381 /* - 01-29 HDMI to MIPI TxA CSI 4-Lane - RGB888: */
1382 static const struct adv748x_reg_value adv748x_init_txa_4lane[] = {
1383 @@ -683,7 +719,11 @@ static int adv748x_reset(struct adv748x_state *state)
1387 - ret = adv748x_write_regs(state, adv748x_set_slave_address);
1388 + if((state->client->addr << 1) == 0xe0) {
1389 + ret = adv748x_write_regs(state, adv748x_set_slave_address); //i2c address 0x70
1391 + ret = adv748x_write_regs(state, adv748x_set_slave_address2); //i2c address 0x71
1396 diff --git a/drivers/media/i2c/adv748x/adv748x.h b/drivers/media/i2c/adv748x/adv748x.h
1397 index fb30bfade946..ac50a9e41b08 100644
1398 --- a/drivers/media/i2c/adv748x/adv748x.h
1399 +++ b/drivers/media/i2c/adv748x/adv748x.h
1401 #define ADV748X_I2C_TXB 0x48 /* CSI-TXB Map */
1402 #define ADV748X_I2C_TXA 0x4a /* CSI-TXA Map */
1404 +#define ADV748X_I2C_IO2 0x71 /* IO Map */
1405 +#define ADV748X_I2C_DPLL2 0x27 /* DPLL Map */
1406 +#define ADV748X_I2C_CP2 0x23 /* CP Map */
1407 +#define ADV748X_I2C_HDMI2 0x35 /* HDMI Map */
1408 +#define ADV748X_I2C_EDID2 0x37 /* EDID Map */
1409 +#define ADV748X_I2C_REPEATER2 0x33 /* HDMI RX Repeater Map */
1410 +#define ADV748X_I2C_INFOFRAME2 0x30 /* HDMI RX InfoFrame Map */
1411 +#define ADV748X_I2C_CEC2 0x42 /* CEC Map */
1412 +#define ADV748X_I2C_SDP2 0x78 /* SDP Map */
1413 +#define ADV748X_I2C_TXB2 0x49 /* CSI-TXB Map */
1414 +#define ADV748X_I2C_TXA2 0x4b /* CSI-TXA Map */