aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSundar Raman2013-07-25 08:54:52 -0500
committerSundar Raman2013-07-25 08:54:52 -0500
commita6a2b96ba4934c1beb9d37cb0ec1db308d904e10 (patch)
treecb69ca1f033b737b5029adfb105bb62d3e491b30
parent4d92f1b39268fdd930e36cfcf8e1b99fe7501ba0 (diff)
parent25c03f68530632720fd19ffb319502199e1d8752 (diff)
downloadkernel-video-a6a2b96ba4934c1beb9d37cb0ec1db308d904e10.tar.gz
kernel-video-a6a2b96ba4934c1beb9d37cb0ec1db308d904e10.tar.xz
kernel-video-a6a2b96ba4934c1beb9d37cb0ec1db308d904e10.zip
Merge remote-tracking branch 'omapzoom/p-ti-android-3.8.y' into p-ti-android-3.8.y-video
-rw-r--r--Documentation/devicetree/bindings/sound/davinci-mcasp-audio.txt7
-rw-r--r--Documentation/devicetree/bindings/sound/dra7-atl.txt42
-rw-r--r--Documentation/devicetree/bindings/sound/dra7-evm.txt60
-rw-r--r--Documentation/devicetree/bindings/usb/omap-usb.txt3
-rwxr-xr-xarch/arm/boot/dts/dra7-evm.dts91
-rw-r--r--arch/arm/boot/dts/dra7.dtsi134
-rw-r--r--arch/arm/configs/android_omap5_defconfig359
-rw-r--r--arch/arm/configs/android_omap_defconfig (renamed from arch/arm/configs/android_dra7_defconfig)32
-rw-r--r--arch/arm/configs/omap2plus_defconfig23
-rw-r--r--arch/arm/mach-omap2/board-generic.c2
-rw-r--r--arch/arm/mach-omap2/cclock54xx_data.c10
-rw-r--r--arch/arm/mach-omap2/cclock7xx_data.c39
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_7xx_data.c26
-rw-r--r--drivers/usb/dwc3/dwc3-omap.c43
-rw-r--r--drivers/usb/dwc3/gadget.c38
-rw-r--r--drivers/usb/gadget/android.c40
-rw-r--r--drivers/usb/gadget/composite.c24
-rw-r--r--drivers/usb/gadget/udc-core.c29
-rw-r--r--drivers/usb/musb/omap2430.c18
-rw-r--r--drivers/usb/otg/palmas-usb.c12
-rw-r--r--drivers/usb/phy/omap-control-usb.c101
-rw-r--r--drivers/usb/phy/omap-usb2.c58
-rw-r--r--drivers/usb/phy/omap-usb3.c59
-rw-r--r--drivers/video/omap2/dss/ti_hdmi_5xxx_ip.c11
-rw-r--r--drivers/video/omap2/dsscomp/Kconfig2
-rw-r--r--drivers/video/omap2/omapfb/Kconfig2
-rw-r--r--include/linux/platform_data/davinci_asp.h3
-rw-r--r--include/linux/regulator/consumer.h7
-rw-r--r--include/linux/usb/composite.h1
-rw-r--r--include/linux/usb/dwc3-omap.h4
-rw-r--r--include/linux/usb/gadget.h2
-rw-r--r--include/linux/usb/omap_control_usb.h9
-rw-r--r--include/linux/usb/omap_usb.h1
-rw-r--r--sound/soc/davinci/davinci-mcasp.c507
-rw-r--r--sound/soc/davinci/davinci-mcasp.h9
-rw-r--r--sound/soc/davinci/davinci-pcm.h15
-rw-r--r--sound/soc/omap/Kconfig12
-rw-r--r--sound/soc/omap/Makefile4
-rw-r--r--sound/soc/omap/dra7-atl.c317
-rw-r--r--sound/soc/omap/dra7-evm.c331
-rw-r--r--sound/soc/omap/omap-hdmi-card.c2
-rw-r--r--sound/soc/omap/omap-hdmi.c6
-rw-r--r--sound/soc/omap/omap-pcm.c2
43 files changed, 1883 insertions, 614 deletions
diff --git a/Documentation/devicetree/bindings/sound/davinci-mcasp-audio.txt b/Documentation/devicetree/bindings/sound/davinci-mcasp-audio.txt
index 374e145c2ef..9bac63e73eb 100644
--- a/Documentation/devicetree/bindings/sound/davinci-mcasp-audio.txt
+++ b/Documentation/devicetree/bindings/sound/davinci-mcasp-audio.txt
@@ -5,6 +5,7 @@ Required properties:
5 "ti,dm646x-mcasp-audio" : for DM646x platforms 5 "ti,dm646x-mcasp-audio" : for DM646x platforms
6 "ti,da830-mcasp-audio" : for both DA830 & DA850 platforms 6 "ti,da830-mcasp-audio" : for both DA830 & DA850 platforms
7 "ti,omap2-mcasp-audio" : for OMAP2 platforms (TI81xx, AM33xx) 7 "ti,omap2-mcasp-audio" : for OMAP2 platforms (TI81xx, AM33xx)
8 "ti,dra7-mcasp-audio" : for DRA7xx platforms
8 9
9- reg : Should contain McASP registers offset and length 10- reg : Should contain McASP registers offset and length
10- interrupts : Interrupt number for McASP 11- interrupts : Interrupt number for McASP
@@ -23,6 +24,10 @@ Optional properties:
23- rx-num-evt : FIFO levels. 24- rx-num-evt : FIFO levels.
24- sram-size-playback : size of sram to be allocated during playback 25- sram-size-playback : size of sram to be allocated during playback
25- sram-size-capture : size of sram to be allocated during capture 26- sram-size-capture : size of sram to be allocated during capture
27- ti,tx-inactive-mode : Transmit pin mode while in an inactive slot (0 - Hi-Z,
28 2 - Low, 3 - High)
29- ti,rx-inactive-mode : Receive pin mode while in an inactive slot (0 - Hi-Z,
30 2 - Low, 3 - High)
26 31
27Example: 32Example:
28 33
@@ -42,4 +47,6 @@ mcasp0: mcasp0@1d00000 {
42 2 0 0 0 >; 47 2 0 0 0 >;
43 tx-num-evt = <1>; 48 tx-num-evt = <1>;
44 rx-num-evt = <1>; 49 rx-num-evt = <1>;
50 ti,tx-inactive-mode = <0>; /* 0: Hi-Z, 2: Low, 3: High */
51 ti,rx-inactive-mode = <0>; /* 0: Hi-Z, 2: Low, 3: High */
45}; 52};
diff --git a/Documentation/devicetree/bindings/sound/dra7-atl.txt b/Documentation/devicetree/bindings/sound/dra7-atl.txt
new file mode 100644
index 00000000000..cd85aa3477c
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/dra7-atl.txt
@@ -0,0 +1,42 @@
1* Texas Instruments DRA7 Audio Tracking Logic (ATL)
2
3Required properties:
4- compatible: "ti,dra7-atl"
5- ti,hwmods: Name of the hwmod associated with the ATL module
6
7
8Optional properties:
9- ti,atclk<n>-freq: Output clock frequency for ATL instance n.
10 ATL instance is disabled if this property is not set
11- ti,atl<n>-bws-input: ATL baseband word select input for ATL instance n.
12 Possible inputs are:
13 0 - McASP1 FSR
14 1 - McASP1 FSX
15 2 - McASP2 FSR
16 3 - McASP2 FSX
17 4 - McASP3 FSX
18 5 - McASP4 FSX
19 6 - McASP5 FSX
20 7 - McASP6 FSX
21 8 - McASP7 FSX
22 9 - McASP8 FSX
23 10 - McASP8 AHCLKX
24 11 - XREF_CLK3 input pad
25 12 - XREF_CLK0 input pad
26 13 - XREF_CLK1 input pad
27 14 - XREF_CLK2 input pad
28 15 - OSC1_X1 input pad
29- ti,atl<n>-aws-input: Audio word select input for ATL instance n.
30 Same inputs than BWS.
31
32
33Example:
34
35atl: atl@0x4843c000 {
36 compatible = "ti,dra7-atl";
37 reg = <0x4843c000 0x3ff>;
38 ti,hwmods = "atl";
39 ti,atclk1-freq = <11289600>; /* 11.2896 MHz */
40 ti,atl1-bws-input = <2>; /* McASP2 FSR */
41 ti,atl1-aws-input = <4>; /* McASP3 FSX */
42};
diff --git a/Documentation/devicetree/bindings/sound/dra7-evm.txt b/Documentation/devicetree/bindings/sound/dra7-evm.txt
new file mode 100644
index 00000000000..1eeed6e6d67
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/dra7-evm.txt
@@ -0,0 +1,60 @@
1* Texas Instruments DRA7 EVM sound
2
3Required properties:
4- compatible: "ti,dra7-evm-sound"
5- ti,mode: Name of the sound card
6- ti,media-cpu: phandle for the McASP node in media link
7- ti,media-codec: phandle for the analog codec in media link
8- ti,media-mclk-freq: MCLK frequency for the analog codec in media link
9- ti,media-slots: Number of slots
10- ti,audio-routing: List of connections between audio components.
11 Each entry is a pair of strings, the first being the connection's sink,
12 the second being the connection's source.
13
14Available audio endpoints for the audio-routing table:
15
16Board connectors:
17 * Main Mic
18 * Line In
19 * Headphone
20 * Line Out
21
22tlv320aic3x pins:
23 * LLOUT
24 * RLOUT
25 * MONO_LOUT
26 * HPLOUT
27 * HPROUT
28 * HPLCOM
29 * HPCOM
30 * MIC3L
31 * MIC3R
32 * LINE1L
33 * LINE1R
34 * LINE2L
35 * LINE2R
36
37Example:
38
39sound {
40 compatible = "ti,dra7-evm-sound";
41 ti,model = "DRA7-EVM";
42
43 /* Media DAI link */
44 ti,media-cpu = <&mcasp3>;
45 ti,media-codec = <&tlv320aic3106>;
46 ti,media-mclk-freq = <1411200>;
47 ti,media-slots = <2>;
48
49 /* Audio routing */
50 ti,audio-routing =
51 "LINE1L", "Line In",
52 "LINE1R", "Line In",
53 "MIC3L", "Main Mic",
54 "MIC3R", "Main Mic",
55 "Main Mic", "Mic Bias 2V",
56 "Headphone", "HPLOUT",
57 "Headphone", "HPROUT",
58 "Line Out", "LLOUT",
59 "Line Out", "RLOUT";
60};
diff --git a/Documentation/devicetree/bindings/usb/omap-usb.txt b/Documentation/devicetree/bindings/usb/omap-usb.txt
index d4769f343d6..b5770b49c8e 100644
--- a/Documentation/devicetree/bindings/usb/omap-usb.txt
+++ b/Documentation/devicetree/bindings/usb/omap-usb.txt
@@ -83,7 +83,8 @@ Required properties:
83 usb mailbox or usb3 phy power. omap4 has usb mailbox in control module to 83 usb mailbox or usb3 phy power. omap4 has usb mailbox in control module to
84 notify events to the musb core and omap5 has usb3 phy power register to 84 notify events to the musb core and omap5 has usb3 phy power register to
85 power on usb3 phy. Should be "1" if it has mailbox and "2" if it has usb3 85 power on usb3 phy. Should be "1" if it has mailbox and "2" if it has usb3
86 phy power. 86 phy power (usb3 phy power indicates the presense of a usb2 and usb3 phy),
87 should be "3" is it has only usb2 phy power.
87 88
88omap_control_usb: omap-control-usb@4a002300 { 89omap_control_usb: omap-control-usb@4a002300 {
89 compatible = "ti,omap-control-usb"; 90 compatible = "ti,omap-control-usb";
diff --git a/arch/arm/boot/dts/dra7-evm.dts b/arch/arm/boot/dts/dra7-evm.dts
index e6ab292d9c7..2c902e95194 100755
--- a/arch/arm/boot/dts/dra7-evm.dts
+++ b/arch/arm/boot/dts/dra7-evm.dts
@@ -49,14 +49,96 @@
49 gpu-supply = <&avs_gpu>; 49 gpu-supply = <&avs_gpu>;
50 }; 50 };
51 }; 51 };
52
53 vaudio_1v8: fixedregulator-vaudio-dig {
54 compatible = "regulator-fixed";
55 regulator-name = "vdac_fixed";
56 regulator-min-microvolt = <1800000>;
57 regulator-max-microvolt = <1800000>;
58 regulator-boot-on;
59 };
60
61 vaudio_3v3: fixedregulator-vaudio-anlg {
62 compatible = "regulator-fixed";
63 regulator-name = "vdac_fixed";
64 regulator-min-microvolt = <3300000>;
65 regulator-max-microvolt = <3300000>;
66 regulator-boot-on;
67 };
68
69 sound {
70 compatible = "ti,dra7-evm-sound";
71 ti,model = "dra7evm";
72
73 /* Audio routing */
74 ti,audio-routing =
75 "LINE1L", "Line In",
76 "LINE1R", "Line In",
77 "MIC3L", "Mic Bias 2V",
78 "MIC3R", "Mic Bias 2V",
79 "Mic Bias 2V", "Main Mic",
80 "Headphone", "HPLOUT",
81 "Headphone", "HPROUT",
82 "Line Out", "LLOUT",
83 "Line Out", "RLOUT";
84
85 /* Media DAI link */
86 ti,media-cpu = <&mcasp3>;
87 ti,media-codec = <&tlv320aic3106>;
88 ti,media-mclk-freq = <5644800>;
89 ti,media-slots = <2>;
90 };
91
92 sound_hdmi {
93 compatible = "ti,omap-hdmi-tpd12s015-audio";
94 ti,model = "OMAP5HDMI";
95 ti,hdmi_audio = <&hdmi>;
96 ti,level_shifter = <&tpd12s015>;
97 };
52}; 98};
53 99
54&dra7_pmx_core { 100&dra7_pmx_core {
55 pinctrl-names = "default"; 101 pinctrl-names = "default";
56 pinctrl-0 = < 102 pinctrl-0 = <
103 &atl_pins
104 &mcasp3_pins
105 &mcasp6_pins
57 &vout1_pins 106 &vout1_pins
107 &usb_pins
58 >; 108 >;
59 109
110 atl_pins: pinmux_atl_pins {
111 pinctrl-single,pins = <
112 0x298 0x00000005 /* xref_clk1.atl_clk1 OUTPUT | MODE5 */
113 0x29c 0x00000005 /* xref_clk2.atl_clk2 OUTPUT | MODE5 */
114 >;
115 };
116
117 mcasp3_pins: pinmux_mcasp3_pins {
118 pinctrl-single,pins = <
119 0x324 0x00000000 /* mcasp3_aclkx.mcasp3_aclkx OUTPUT | MODE0 */
120 0x328 0x00000000 /* mcasp3_fsx.mcasp3_fsx OUTPUT | MODE0 */
121 0x32c 0x00000000 /* mcasp3_axr0.mcasp3_axr0 OUTPUT | MODE0 */
122 0x330 0x00040000 /* mcasp3_axr1.mcasp3_axr1 INPUT | MODE0 */
123 >;
124 };
125
126 mcasp6_pins: pinmux_mcasp6_pins {
127 pinctrl-single,pins = <
128 0x2d4 0x00000001 /* mcasp1_axr8.mcasp6_axr0 OUTPUT | MODE1 */
129 0x2d8 0x00040001 /* mcasp1_axr9.mcasp6_axr1 INPUT | MODE 1 */
130 0x2dc 0x00000001 /* mcasp1_axr10.mcasp6_clkx OUTPUT | MODE1 */
131 0x2e0 0x00000001 /* mcasp1_axr11.mcasp6_fsx OUTPUT | MODE1 */
132 >;
133 };
134
135 usb_pins: pinmux_usb_pins {
136 pinctrl-single,pins = <
137 0x280 0xc0000 /* DRV1_VBUS SLEW | PULLDEN | MODE0 */
138 0x284 0xc0000 /* DRV2_VBUS SLEW | PULLDEN | MODE0 */
139 >;
140 };
141
60 i2c2_pins: pinmux_i2c2_pins { 142 i2c2_pins: pinmux_i2c2_pins {
61 pinctrl-single,pins = < 143 pinctrl-single,pins = <
62 0x408 0x60000 /* i2c2_sda INPUT | MODE0 */ 144 0x408 0x60000 /* i2c2_sda INPUT | MODE0 */
@@ -124,6 +206,15 @@
124 reg = <0x40>; 206 reg = <0x40>;
125 gpios = <&pcf_lcd 15 0>; /* P15, CON_LCD_PWR_DN */ 207 gpios = <&pcf_lcd 15 0>; /* P15, CON_LCD_PWR_DN */
126 }; 208 };
209
210 tlv320aic3106: tlv320aic3106@18 {
211 compatible = "ti,tlv320aic3x";
212 reg = <0x18>;
213 IOVDD-supply = <&vaudio_3v3>;
214 DVDD-supply = <&vaudio_1v8>;
215 AVDD-supply = <&vaudio_3v3>;
216 DRVDD-supply = <&vaudio_3v3>;
217 };
127}; 218};
128 219
129/include/ "tps659038.dtsi" 220/include/ "tps659038.dtsi"
diff --git a/arch/arm/boot/dts/dra7.dtsi b/arch/arm/boot/dts/dra7.dtsi
index def635612de..2e9e4b546d4 100644
--- a/arch/arm/boot/dts/dra7.dtsi
+++ b/arch/arm/boot/dts/dra7.dtsi
@@ -378,6 +378,98 @@
378 ti,hwmods = "wd_timer2"; 378 ti,hwmods = "wd_timer2";
379 }; 379 };
380 380
381 omap_control_usb1: omap-control-usb@4a002300 {
382 compatible = "ti,omap-control-usb";
383 reg = <0x4a002300 0x4>,
384 <0x4a002370 0x4>;
385 reg-names = "control_dev_conf", "phy_power_usb";
386 ti,type = <2>;
387 };
388
389 omap_dwc31: omap_dwc3@48880000 {
390 compatible = "ti,dwc3";
391 ti,hwmods = "usb_otg_ss1";
392 reg = <0x48880000 0x1ff>;
393 interrupts = <0 77 4>;
394 #address-cells = <1>;
395 #size-cells = <1>;
396 utmi-mode = <2>;
397 ranges;
398 dwc3@48890000 {
399 compatible = "synopsys,dwc3";
400 reg = <0x48890000 0xcfff>;
401 interrupts = <0 76 4>;
402 usb-phy = <&usb2_phy1>, <&usb3_phy>;
403 tx-fifo-resize;
404 dr_mode = "peripheral";
405 maximum-speed = "superspeed";
406 };
407 };
408
409 omap_control_usb2: omap-control-usb@4a002e74 {
410 compatible = "ti,omap-control-usb";
411 reg = <0x4a002e74 0x4>,
412 <0x4a0086c0 0x4>;
413 reg-names = "ctrl_core_srcomp_north_side", "dummy_reg";
414 ti,type = <3>;
415 };
416
417 omap_dwc32: omap_dwc3@488c0000 {
418 compatible = "ti,dwc3";
419 ti,hwmods = "usb_otg_ss2";
420 reg = <0x488c0000 0x1ff>;
421 interrupts = <0 92 4>;
422 #address-cells = <1>;
423 #size-cells = <1>;
424 utmi-mode = <1>;
425 ranges;
426 dwc3@488d0000 {
427 compatible = "synopsys,dwc3";
428 reg = <0x488d0000 0xcfff>;
429 interrupts = <0 78 4>;
430 usb-phy = <&usb2_phy2>;
431 tx-fifo-resize;
432 dr_mode = "host";
433 maximum-speed = "highspeed";
434 };
435 };
436
437 ocp2scp {
438 compatible = "ti,omap-ocp2scp";
439 #address-cells = <1>;
440 #size-cells = <1>;
441 ranges;
442 ti,hwmods = "ocp2scp1";
443 usb2_phy1: usb2_phy1@4a084000 {
444 compatible = "ti,omap-usb2";
445 reg = <0x4a084000 0x7c>;
446 ctrl-module = <&omap_control_usb1>;
447 wkupclk = "usb_phy1_always_on_clk32k";
448 optclk = "usb_otg_ss1_refclk960m";
449 };
450
451 usb3_phy: usb3_phy@4a084400 {
452 compatible = "ti,omap-usb3";
453 reg = <0x4a084400 0x80>,
454 <0x4a084800 0x64>,
455 <0x4a084c00 0x40>;
456 reg-names = "phy_rx", "phy_tx", "pll_ctrl";
457 ctrl-module = <&omap_control_usb1>;
458 wkupclk = "usb_phy1_always_on_clk32k";
459 optclk = "usb_otg_ss1_refclk960m";
460 };
461
462 usb2_phy2: usb2_phy2@4a085000 {
463 compatible = "ti,omap-usb2";
464 reg = <0x4a085000 0x7c>;
465 ctrl-module = <&omap_control_usb2>;
466 wkupclk = "usb_phy2_always_on_clk32k";
467 optclk = "usb_otg_ss2_refclk960m";
468 };
469
470 };
471
472
381 dmm: dmm@4e000000 { 473 dmm: dmm@4e000000 {
382 compatible = "ti,omap5-dmm"; 474 compatible = "ti,omap5-dmm";
383 reg = <0x4e000000 0x800>; 475 reg = <0x4e000000 0x800>;
@@ -505,6 +597,7 @@
505 efuse-settings = <1090000 8 597 efuse-settings = <1090000 8
506 1210000 12 598 1210000 12
507 1280000 16>; 599 1280000 16>;
600 voltage-tolerance = <1>;
508 }; 601 };
509 602
510 avs_core: regulator-avs@0x4A0025EC { 603 avs_core: regulator-avs@0x4A0025EC {
@@ -519,6 +612,7 @@
519 efuse-settings = <1090000 8 612 efuse-settings = <1090000 8
520 1210000 12 613 1210000 12
521 1280000 16>; 614 1280000 16>;
615 voltage-tolerance = <1>;
522 }; 616 };
523 617
524 avs_dspeve: regulator-avs@0x4A0025D8 { 618 avs_dspeve: regulator-avs@0x4A0025D8 {
@@ -574,5 +668,45 @@
574 video-source = <1>; 668 video-source = <1>;
575 }; 669 };
576 }; 670 };
671
672 atl: atl@0x4843c000 {
673 compatible = "ti,dra7-atl";
674 reg = <0x4843c000 0x3ff>;
675 ti,hwmods = "atl";
676 ti,atclk1-freq = <11289600>;
677 ti,atl1-bws-input = <3>; /* McASP2 FSX */
678 ti,atl1-aws-input = <15>; /* McASP6 FSX */
679 ti,atclk2-freq = <5644800>;
680 ti,atl2-bws-input = <3>; /* McASP2 FSX */
681 ti,atl2-aws-input = <4>; /* McASP3 FSX */
682 };
683
684 mcasp3: mcasp@48468000 {
685 compatible = "ti,dra7-mcasp-audio";
686 reg = <0x48468000 0x2000>;
687 interrupts = <0 108 0x4>, /* AREVT */
688 <0 109 0x4>; /* TXEVT */
689 ti,hwmods = "mcasp3";
690 op-mode = <0>; /* MCASP_IIS_MODE */
691 tdm-slots = <2>;
692 num-serializer = <4>;
693 serial-dir = <1 2 0 0>; /* 0:INACTIVE, 1:TX, 2:RX */
694 ti,tx-inactive-mode = <2>; /* 0: Hi-Z, 2: Low, 3: High */
695 ti,rx-inactive-mode = <2>; /* 0: Hi-Z, 2: Low, 3: High */
696 };
697
698 mcasp6: mcasp@48474000 {
699 compatible = "ti,dra7-mcasp-audio";
700 reg = <0x48474000 0x2000>;
701 interrupts = <0 108 0x4>, /* AREVT */
702 <0 109 0x4>; /* TXEVT */
703 ti,hwmods = "mcasp6";
704 op-mode = <0>; /* MCASP_IIS_MODE */
705 tdm-slots = <8>;
706 num-serializer = <4>;
707 serial-dir = <1 2 0 0>; /* 0:INACTIVE, 1:TX, 2:RX */
708 ti,tx-inactive-mode = <2>; /* 0: Hi-Z, 2: Low, 3: High */
709 ti,rx-inactive-mode = <2>; /* 0: Hi-Z, 2: Low, 3: High */
710 };
577 }; 711 };
578}; 712};
diff --git a/arch/arm/configs/android_omap5_defconfig b/arch/arm/configs/android_omap5_defconfig
deleted file mode 100644
index 66522af5ff7..00000000000
--- a/arch/arm/configs/android_omap5_defconfig
+++ /dev/null
@@ -1,359 +0,0 @@
1CONFIG_EXPERIMENTAL=y
2CONFIG_SYSVIPC=y
3CONFIG_POSIX_MQUEUE=y
4CONFIG_NO_HZ=y
5CONFIG_HIGH_RES_TIMERS=y
6CONFIG_BSD_PROCESS_ACCT=y
7CONFIG_IKCONFIG=y
8CONFIG_IKCONFIG_PROC=y
9CONFIG_LOG_BUF_SHIFT=16
10CONFIG_BLK_DEV_INITRD=y
11CONFIG_EXPERT=y
12CONFIG_SLAB=y
13CONFIG_PROFILING=y
14CONFIG_OPROFILE=y
15CONFIG_KPROBES=y
16CONFIG_MODULES=y
17CONFIG_MODULE_FORCE_LOAD=y
18CONFIG_MODULE_UNLOAD=y
19CONFIG_MODULE_FORCE_UNLOAD=y
20CONFIG_MODVERSIONS=y
21CONFIG_MODULE_SRCVERSION_ALL=y
22# CONFIG_BLK_DEV_BSG is not set
23CONFIG_PARTITION_ADVANCED=y
24CONFIG_ARCH_OMAP=y
25CONFIG_ARCH_OMAP2PLUS=y
26CONFIG_OMAP_RESET_CLOCKS=y
27CONFIG_OMAP_MUX_DEBUG=y
28CONFIG_SOC_OMAP5=y
29CONFIG_SOC_DRA7XX=y
30CONFIG_ARM_THUMBEE=y
31CONFIG_ARM_ERRATA_411920=y
32CONFIG_SMP=y
33CONFIG_NR_CPUS=2
34CONFIG_PREEMPT=y
35CONFIG_ZBOOT_ROM_TEXT=0x0
36CONFIG_ZBOOT_ROM_BSS=0x0
37CONFIG_CMDLINE="root=/dev/mmcblk0p2 rootwait console=ttyO2,115200 init=/init androidboot.console=ttyO2 vmalloc=496M omapfb.fb_opt=-1,-1,-1,1,1280,720"
38CONFIG_CMDLINE_FORCE=y
39CONFIG_KEXEC=y
40CONFIG_CPU_FREQ=y
41CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
42CONFIG_CPU_FREQ_GOV_USERSPACE=y
43CONFIG_GENERIC_CPUFREQ_CPU0=y
44# CONFIG_ARM_OMAP2PLUS_CPUFREQ is not set
45CONFIG_FPE_NWFPE=y
46CONFIG_BINFMT_MISC=y
47CONFIG_PM_DEBUG=y
48CONFIG_NET=y
49CONFIG_PACKET=y
50CONFIG_UNIX=y
51CONFIG_XFRM_USER=y
52CONFIG_NET_KEY=y
53CONFIG_NET_KEY_MIGRATE=y
54CONFIG_INET=y
55CONFIG_IP_MULTICAST=y
56CONFIG_IP_PNP=y
57CONFIG_IP_PNP_DHCP=y
58CONFIG_IP_PNP_BOOTP=y
59CONFIG_IP_PNP_RARP=y
60# CONFIG_INET_LRO is not set
61# CONFIG_IPV6 is not set
62CONFIG_NETFILTER=y
63CONFIG_CAN=m
64CONFIG_CAN_RAW=m
65CONFIG_CAN_BCM=m
66CONFIG_CAN_C_CAN=m
67CONFIG_CAN_C_CAN_PLATFORM=m
68CONFIG_BT=m
69CONFIG_BT_HCIUART=m
70CONFIG_BT_HCIUART_H4=y
71CONFIG_BT_HCIUART_BCSP=y
72CONFIG_BT_HCIUART_LL=y
73CONFIG_BT_HCIBCM203X=m
74CONFIG_BT_HCIBPA10X=m
75CONFIG_CFG80211=m
76CONFIG_MAC80211=m
77CONFIG_MAC80211_RC_PID=y
78CONFIG_MAC80211_RC_DEFAULT_PID=y
79CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
80CONFIG_DEVTMPFS=y
81CONFIG_DEVTMPFS_MOUNT=y
82CONFIG_OMAP_OCP2SCP=y
83CONFIG_CONNECTOR=y
84CONFIG_MTD=y
85CONFIG_MTD_CMDLINE_PARTS=y
86CONFIG_MTD_CHAR=y
87CONFIG_MTD_BLOCK=y
88CONFIG_MTD_OOPS=y
89CONFIG_MTD_CFI=y
90CONFIG_MTD_CFI_INTELEXT=y
91CONFIG_MTD_M25P80=y
92CONFIG_MTD_NAND=y
93CONFIG_MTD_NAND_OMAP2=y
94CONFIG_MTD_ONENAND=y
95CONFIG_MTD_ONENAND_VERIFY_WRITE=y
96CONFIG_MTD_ONENAND_OMAP2=y
97CONFIG_MTD_UBI=y
98CONFIG_BLK_DEV_LOOP=y
99CONFIG_BLK_DEV_RAM=y
100CONFIG_BLK_DEV_RAM_SIZE=16384
101CONFIG_SENSORS_TSL2550=m
102CONFIG_SENSORS_LIS3_I2C=m
103CONFIG_SCSI=y
104CONFIG_BLK_DEV_SD=y
105CONFIG_ATA=y
106# CONFIG_SATA_PMP is not set
107CONFIG_SATA_AHCI_PLATFORM=m
108# CONFIG_ATA_SFF is not set
109CONFIG_SCSI_MULTI_LUN=y
110CONFIG_SCSI_SCAN_ASYNC=y
111CONFIG_MD=y
112CONFIG_NETDEVICES=y
113CONFIG_KS8851=y
114CONFIG_KS8851_MLL=y
115CONFIG_SMC91X=y
116CONFIG_SMSC911X=y
117CONFIG_TI_CPSW=y
118CONFIG_SMSC_PHY=y
119CONFIG_USB_USBNET=y
120CONFIG_USB_NET_SMSC95XX=y
121CONFIG_USB_ALI_M5632=y
122CONFIG_USB_AN2720=y
123CONFIG_USB_EPSON2888=y
124CONFIG_USB_KC2190=y
125CONFIG_LIBERTAS=m
126CONFIG_LIBERTAS_USB=m
127CONFIG_LIBERTAS_SDIO=m
128CONFIG_LIBERTAS_DEBUG=y
129CONFIG_INPUT_JOYDEV=y
130CONFIG_INPUT_EVDEV=y
131CONFIG_KEYBOARD_GPIO=y
132CONFIG_KEYBOARD_MATRIX=m
133CONFIG_KEYBOARD_TWL4030=y
134CONFIG_INPUT_TOUCHSCREEN=y
135CONFIG_TOUCHSCREEN_ADS7846=y
136CONFIG_INPUT_MISC=y
137CONFIG_INPUT_TWL4030_PWRBUTTON=y
138CONFIG_VT_HW_CONSOLE_BINDING=y
139# CONFIG_LEGACY_PTYS is not set
140CONFIG_SERIAL_8250_NR_UARTS=32
141CONFIG_SERIAL_8250_EXTENDED=y
142CONFIG_SERIAL_8250_MANY_PORTS=y
143CONFIG_SERIAL_8250_SHARE_IRQ=y
144CONFIG_SERIAL_8250_DETECT_IRQ=y
145CONFIG_SERIAL_8250_RSA=y
146CONFIG_HW_RANDOM=y
147CONFIG_I2C_CHARDEV=y
148CONFIG_SPI=y
149CONFIG_SPI_OMAP24XX=y
150CONFIG_DEBUG_PINCTRL=y
151CONFIG_PINCTRL_SINGLE=y
152CONFIG_DEBUG_GPIO=y
153CONFIG_GPIO_SYSFS=y
154CONFIG_GPIO_PCF857X=y
155CONFIG_GPIO_TWL4030=y
156CONFIG_W1=y
157CONFIG_POWER_SUPPLY=y
158CONFIG_SENSORS_LM75=m
159CONFIG_THERMAL=y
160CONFIG_THERMAL_GOV_FAIR_SHARE=y
161CONFIG_THERMAL_GOV_USER_SPACE=y
162CONFIG_CPU_THERMAL=y
163CONFIG_WATCHDOG=y
164CONFIG_OMAP_WATCHDOG=y
165CONFIG_TWL4030_WATCHDOG=y
166CONFIG_PALMAS_WATCHDOG=y
167CONFIG_MFD_TPS65217=y
168CONFIG_TWL6040_CORE=y
169CONFIG_REGULATOR_TWL4030=y
170CONFIG_MFD_PALMAS=y
171CONFIG_MFD_PALMAS_GPADC=y
172CONFIG_MFD_PALMAS_PWM=y
173CONFIG_MFD_PALMAS_RESOURCE=y
174CONFIG_REGULATOR_PALMAS=y
175CONFIG_MFD_TPS65910=y
176CONFIG_REGULATOR_TPS65023=y
177CONFIG_REGULATOR_TPS6507X=y
178CONFIG_REGULATOR_TPS65217=y
179CONFIG_REGULATOR_TPS65910=y
180CONFIG_REGULATOR_TIAVSCLASS0=y
181CONFIG_MEDIA_SUPPORT=m
182CONFIG_MEDIA_CAMERA_SUPPORT=y
183CONFIG_VIDEO_DEV=m
184CONFIG_VIDEO_V4L2=m
185CONFIG_VIDEOBUF2_CORE=m
186CONFIG_VIDEOBUF2_MEMOPS=m
187CONFIG_VIDEOBUF2_VMALLOC=m
188CONFIG_MEDIA_USB_SUPPORT=y
189CONFIG_USB_VIDEO_CLASS=m
190CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV=y
191CONFIG_USB_GSPCA=m
192CONFIG_DRM_OMAP_NUM_CRTCS=3
193CONFIG_FIRMWARE_EDID=y
194CONFIG_FB_MODE_HELPERS=y
195CONFIG_FB_TILEBLITTING=y
196CONFIG_DSSCOMP=y
197CONFIG_DSSCOMP_DEBUG_LOG=y
198CONFIG_OMAP2_DSS=y
199CONFIG_OMAP2_DSS_DRA7XX_DPI=y
200CONFIG_OMAP2_DSS_RFBI=y
201CONFIG_OMAP2_DSS_SDI=y
202CONFIG_OMAP2_DSS_DSI=y
203CONFIG_FB_OMAP2=y
204CONFIG_OMAPLFB=y
205CONFIG_PANEL_GENERIC_DPI=y
206CONFIG_PANEL_TFP410=y
207CONFIG_PANEL_LGPHILIPS_LB035Q02=y
208CONFIG_PANEL_SHARP_LS037V7DW01=y
209CONFIG_PANEL_NEC_NL8048HL11_01B=y
210CONFIG_PANEL_PICODLP=y
211CONFIG_PANEL_TFCS9700=y
212CONFIG_PANEL_TAAL=y
213CONFIG_PANEL_LG4591=y
214CONFIG_PANEL_TPO_TD043MTEA1=y
215CONFIG_PANEL_ACX565AKM=y
216CONFIG_PANEL_N8X0=y
217CONFIG_BACKLIGHT_LCD_SUPPORT=y
218CONFIG_LCD_CLASS_DEVICE=y
219CONFIG_LCD_PLATFORM=y
220CONFIG_BACKLIGHT_CLASS_DEVICE=y
221CONFIG_FONTS=y
222CONFIG_FONT_8x8=y
223CONFIG_FONT_8x16=y
224CONFIG_LOGO=y
225CONFIG_SOUND=m
226CONFIG_SND=m
227CONFIG_SND_MIXER_OSS=m
228CONFIG_SND_PCM_OSS=m
229CONFIG_SND_VERBOSE_PRINTK=y
230CONFIG_SND_DEBUG=y
231CONFIG_SND_USB_AUDIO=m
232CONFIG_SND_SOC=m
233CONFIG_SND_OMAP_SOC=m
234CONFIG_SND_OMAP_SOC_OMAP_TWL4030=m
235CONFIG_SND_OMAP_SOC_OMAP_ABE_TWL6040=m
236CONFIG_SND_OMAP_SOC_OMAP3_PANDORA=m
237CONFIG_USB=y
238CONFIG_USB_DEBUG=y
239CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
240CONFIG_USB_SUSPEND=y
241CONFIG_USB_EHCI_HCD=y
242CONFIG_USB_DWC3=m
243CONFIG_USB_DWC3_DEBUG=y
244CONFIG_USB_DWC3_VERBOSE=y
245CONFIG_USB_MUSB_HDRC=m
246CONFIG_USB_MUSB_OMAP2PLUS=m
247CONFIG_USB_MUSB_AM35X=m
248CONFIG_USB_MUSB_DSPS=m
249CONFIG_MUSB_PIO_ONLY=y
250CONFIG_USB_MON=y
251CONFIG_USB_WDM=y
252CONFIG_USB_STORAGE=y
253CONFIG_USB_TEST=y
254CONFIG_USB_GADGET=y
255CONFIG_USB_GADGET_DEBUG=y
256CONFIG_USB_GADGET_DEBUG_FILES=y
257CONFIG_USB_GADGET_DEBUG_FS=y
258CONFIG_USB_ZERO=m
259CONFIG_USB_MASS_STORAGE=m
260CONFIG_USB_G_MULTI=m
261CONFIG_USB_G_MULTI_CDC=y
262CONFIG_USB_ETH=m
263CONFIG_USB_ETH_EEM=y
264CONFIG_OMAP_USB2=m
265CONFIG_OMAP_USB3=m
266CONFIG_OMAP_CONTROL_USB=y
267CONFIG_TWL4030_USB=m
268CONFIG_TWL6030_USB=m
269CONFIG_NOP_USB_XCEIV=y
270CONFIG_PALMAS_USB=m
271CONFIG_MMC=y
272CONFIG_MMC_UNSAFE_RESUME=y
273CONFIG_SDIO_UART=y
274CONFIG_MMC_OMAP=y
275CONFIG_MMC_OMAP_HS=y
276CONFIG_NEW_LEDS=y
277CONFIG_LEDS_GPIO=y
278CONFIG_LEDS_TRIGGERS=y
279CONFIG_LEDS_TRIGGER_TIMER=y
280CONFIG_LEDS_TRIGGER_ONESHOT=y
281CONFIG_LEDS_TRIGGER_HEARTBEAT=y
282CONFIG_LEDS_TRIGGER_BACKLIGHT=y
283CONFIG_LEDS_TRIGGER_CPU=y
284CONFIG_LEDS_TRIGGER_GPIO=y
285CONFIG_LEDS_TRIGGER_DEFAULT_ON=y
286CONFIG_SWITCH=y
287CONFIG_SWITCH_GPIO=y
288CONFIG_RTC_CLASS=y
289CONFIG_RTC_DRV_PALMAS=y
290CONFIG_RTC_DRV_TWL92330=y
291CONFIG_RTC_DRV_TWL4030=y
292CONFIG_RTC_DRV_OMAP=y
293CONFIG_DMADEVICES=y
294CONFIG_TI_EDMA=y
295CONFIG_DMA_OMAP=y
296CONFIG_STAGING=y
297CONFIG_FB=y
298CONFIG_DRM=y
299CONFIG_DRM_OMAP=y
300CONFIG_DRM_OMAP_DISPLAY=n
301CONFIG_DRM_OMAP_DMM_TILER=y
302CONFIG_ANDROID=y
303CONFIG_ANDROID_BINDER_IPC=y
304CONFIG_ASHMEM=y
305CONFIG_ANDROID_LOGGER=y
306CONFIG_ANDROID_TIMED_OUTPUT=y
307CONFIG_ANDROID_TIMED_GPIO=y
308CONFIG_ANDROID_LOW_MEMORY_KILLER=y
309CONFIG_ANDROID_LOW_MEMORY_KILLER_AUTODETECT_OOM_ADJ_VALUES=y
310CONFIG_ANDROID_INTF_ALARM_DEV=y
311CONFIG_TI_SOC_THERMAL=y
312CONFIG_TI_THERMAL=y
313CONFIG_OMAP4_THERMAL=y
314CONFIG_OMAP5_THERMAL=y
315CONFIG_DRA752_THERMAL=y
316CONFIG_EXT2_FS=y
317CONFIG_EXT3_FS=y
318# CONFIG_EXT3_FS_XATTR is not set
319CONFIG_EXT4_FS=y
320CONFIG_QUOTA=y
321CONFIG_QFMT_V2=y
322CONFIG_FUSE_FS=y
323CONFIG_MSDOS_FS=y
324CONFIG_VFAT_FS=y
325CONFIG_TMPFS=y
326CONFIG_JFFS2_FS=y
327CONFIG_JFFS2_SUMMARY=y
328CONFIG_JFFS2_FS_XATTR=y
329CONFIG_JFFS2_COMPRESSION_OPTIONS=y
330CONFIG_JFFS2_LZO=y
331CONFIG_JFFS2_RUBIN=y
332CONFIG_UBIFS_FS=y
333CONFIG_CRAMFS=y
334CONFIG_NFS_FS=y
335CONFIG_NFS_V3_ACL=y
336CONFIG_NFS_V4=y
337CONFIG_ROOT_NFS=y
338CONFIG_NLS_CODEPAGE_437=y
339CONFIG_NLS_ISO8859_1=y
340CONFIG_PRINTK_TIME=y
341CONFIG_MAGIC_SYSRQ=y
342CONFIG_SCHEDSTATS=y
343CONFIG_TIMER_STATS=y
344CONFIG_PROVE_LOCKING=y
345# CONFIG_DEBUG_BUGVERBOSE is not set
346CONFIG_DEBUG_INFO=y
347CONFIG_SECURITY=y
348CONFIG_CRYPTO_MICHAEL_MIC=y
349# CONFIG_CRYPTO_ANSI_CPRNG is not set
350CONFIG_CRC_CCITT=y
351CONFIG_CRC_T10DIF=y
352CONFIG_CRC_ITU_T=y
353CONFIG_CRC7=y
354CONFIG_LIBCRC32C=y
355CONFIG_ION=y
356CONFIG_ION_OMAP=y
357CONFIG_CMA=y
358CONFIG_TI_DAVINCI_MDIO=y
359CONFIG_TI_DAVINCI_CPDMA=y
diff --git a/arch/arm/configs/android_dra7_defconfig b/arch/arm/configs/android_omap_defconfig
index 3a80c3257c3..dfda9624155 100644
--- a/arch/arm/configs/android_dra7_defconfig
+++ b/arch/arm/configs/android_omap_defconfig
@@ -222,27 +222,35 @@ CONFIG_FONTS=y
222CONFIG_FONT_8x8=y 222CONFIG_FONT_8x8=y
223CONFIG_FONT_8x16=y 223CONFIG_FONT_8x16=y
224CONFIG_LOGO=y 224CONFIG_LOGO=y
225CONFIG_SOUND=m 225CONFIG_SOUND=y
226CONFIG_SND=m 226CONFIG_SND=y
227CONFIG_SND_TIMER=y
228CONFIG_SND_PCM=y
227CONFIG_SND_MIXER_OSS=m 229CONFIG_SND_MIXER_OSS=m
228CONFIG_SND_PCM_OSS=m 230CONFIG_SND_PCM_OSS=m
229CONFIG_SND_VERBOSE_PRINTK=y 231CONFIG_SND_VERBOSE_PRINTK=y
232CONFIG_SND_COMPRESS_OFFLOAD=y
230CONFIG_SND_DEBUG=y 233CONFIG_SND_DEBUG=y
231CONFIG_SND_USB_AUDIO=m 234CONFIG_SND_USB_AUDIO=m
232CONFIG_SND_SOC=m 235CONFIG_SND_SOC=y
233CONFIG_SND_OMAP_SOC=m 236CONFIG_SND_DAVINCI_SOC_MCASP=y
237CONFIG_SND_OMAP_SOC=y
238CONFIG_SND_OMAP_SOC_HDMI=y
234CONFIG_SND_OMAP_SOC_OMAP_TWL4030=m 239CONFIG_SND_OMAP_SOC_OMAP_TWL4030=m
235CONFIG_SND_OMAP_SOC_OMAP_ABE_TWL6040=m 240CONFIG_SND_OMAP_SOC_OMAP_ABE_TWL6040=m
241CONFIG_SND_OMAP_SOC_OMAP_HDMI=y
236CONFIG_SND_OMAP_SOC_OMAP3_PANDORA=m 242CONFIG_SND_OMAP_SOC_OMAP3_PANDORA=m
243CONFIG_SND_DRA7_SOC_ATL=y
244CONFIG_SND_SOC_DRA7_EVM=y
245CONFIG_SND_SOC_I2C_AND_SPI=y
246CONFIG_SND_SOC_OMAP_HDMI_CODEC=y
247CONFIG_SND_SOC_TLV320AIC3X=y
237CONFIG_USB=y 248CONFIG_USB=y
238CONFIG_USB_DEBUG=y
239CONFIG_USB_ANNOUNCE_NEW_DEVICES=y 249CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
240CONFIG_USB_SUSPEND=y 250CONFIG_USB_SUSPEND=y
241CONFIG_USB_EHCI_HCD=y 251CONFIG_USB_EHCI_HCD=y
242CONFIG_USB_XHCI_HCD=y 252CONFIG_USB_XHCI_HCD=y
243CONFIG_USB_DWC3=y 253CONFIG_USB_DWC3=y
244CONFIG_USB_DWC3_DEBUG=y
245CONFIG_USB_DWC3_VERBOSE=y
246CONFIG_USB_MUSB_HDRC=m 254CONFIG_USB_MUSB_HDRC=m
247CONFIG_USB_MUSB_OMAP2PLUS=m 255CONFIG_USB_MUSB_OMAP2PLUS=m
248CONFIG_USB_MUSB_AM35X=m 256CONFIG_USB_MUSB_AM35X=m
@@ -253,15 +261,8 @@ CONFIG_USB_WDM=y
253CONFIG_USB_STORAGE=y 261CONFIG_USB_STORAGE=y
254CONFIG_USB_TEST=y 262CONFIG_USB_TEST=y
255CONFIG_USB_GADGET=y 263CONFIG_USB_GADGET=y
256CONFIG_USB_GADGET_DEBUG=y
257CONFIG_USB_GADGET_DEBUG_FILES=y 264CONFIG_USB_GADGET_DEBUG_FILES=y
258CONFIG_USB_GADGET_DEBUG_FS=y 265CONFIG_USB_GADGET_DEBUG_FS=y
259CONFIG_USB_ZERO=m
260CONFIG_USB_MASS_STORAGE=m
261CONFIG_USB_G_MULTI=m
262CONFIG_USB_G_MULTI_CDC=y
263CONFIG_USB_ETH=m
264CONFIG_USB_ETH_EEM=y
265CONFIG_OMAP_USB2=y 266CONFIG_OMAP_USB2=y
266CONFIG_OMAP_USB3=y 267CONFIG_OMAP_USB3=y
267CONFIG_OMAP_CONTROL_USB=y 268CONFIG_OMAP_CONTROL_USB=y
@@ -309,6 +310,8 @@ CONFIG_ANDROID_TIMED_GPIO=y
309CONFIG_ANDROID_LOW_MEMORY_KILLER=y 310CONFIG_ANDROID_LOW_MEMORY_KILLER=y
310CONFIG_ANDROID_LOW_MEMORY_KILLER_AUTODETECT_OOM_ADJ_VALUES=y 311CONFIG_ANDROID_LOW_MEMORY_KILLER_AUTODETECT_OOM_ADJ_VALUES=y
311CONFIG_ANDROID_INTF_ALARM_DEV=y 312CONFIG_ANDROID_INTF_ALARM_DEV=y
313CONFIG_USB_G_ANDROID=y
314CONFIG_USB_LIBCOMPOSITE=y
312CONFIG_TI_SOC_THERMAL=y 315CONFIG_TI_SOC_THERMAL=y
313CONFIG_TI_THERMAL=y 316CONFIG_TI_THERMAL=y
314CONFIG_OMAP4_THERMAL=y 317CONFIG_OMAP4_THERMAL=y
@@ -358,3 +361,4 @@ CONFIG_ION_OMAP=y
358CONFIG_CMA=y 361CONFIG_CMA=y
359CONFIG_TI_DAVINCI_MDIO=y 362CONFIG_TI_DAVINCI_MDIO=y
360CONFIG_TI_DAVINCI_CPDMA=y 363CONFIG_TI_DAVINCI_CPDMA=y
364CONFIG_PM_WAKELOCKS=y
diff --git a/arch/arm/configs/omap2plus_defconfig b/arch/arm/configs/omap2plus_defconfig
index e3514f7e7c0..3ef11817cf1 100644
--- a/arch/arm/configs/omap2plus_defconfig
+++ b/arch/arm/configs/omap2plus_defconfig
@@ -220,26 +220,34 @@ CONFIG_FONTS=y
220CONFIG_FONT_8x8=y 220CONFIG_FONT_8x8=y
221CONFIG_FONT_8x16=y 221CONFIG_FONT_8x16=y
222CONFIG_LOGO=y 222CONFIG_LOGO=y
223CONFIG_SOUND=m 223CONFIG_SOUND=y
224CONFIG_SND=m 224CONFIG_SND=y
225CONFIG_SND_TIMER=y
226CONFIG_SND_PCM=y
225CONFIG_SND_MIXER_OSS=m 227CONFIG_SND_MIXER_OSS=m
226CONFIG_SND_PCM_OSS=m 228CONFIG_SND_PCM_OSS=m
227CONFIG_SND_VERBOSE_PRINTK=y 229CONFIG_SND_VERBOSE_PRINTK=y
230CONFIG_SND_COMPRESS_OFFLOAD=y
228CONFIG_SND_DEBUG=y 231CONFIG_SND_DEBUG=y
229CONFIG_SND_USB_AUDIO=m 232CONFIG_SND_USB_AUDIO=m
230CONFIG_SND_SOC=m 233CONFIG_SND_SOC=y
231CONFIG_SND_OMAP_SOC=m 234CONFIG_SND_DAVINCI_SOC_MCASP=y
235CONFIG_SND_OMAP_SOC=y
236CONFIG_SND_OMAP_SOC_HDMI=y
232CONFIG_SND_OMAP_SOC_OMAP_TWL4030=m 237CONFIG_SND_OMAP_SOC_OMAP_TWL4030=m
233CONFIG_SND_OMAP_SOC_OMAP_ABE_TWL6040=m 238CONFIG_SND_OMAP_SOC_OMAP_ABE_TWL6040=m
239CONFIG_SND_OMAP_SOC_OMAP_HDMI=y
234CONFIG_SND_OMAP_SOC_OMAP3_PANDORA=m 240CONFIG_SND_OMAP_SOC_OMAP3_PANDORA=m
241CONFIG_SND_DRA7_SOC_ATL=y
242CONFIG_SND_SOC_DRA7_EVM=y
243CONFIG_SND_SOC_I2C_AND_SPI=y
244CONFIG_SND_SOC_OMAP_HDMI_CODEC=y
245CONFIG_SND_SOC_TLV320AIC3X=y
235CONFIG_USB=y 246CONFIG_USB=y
236CONFIG_USB_DEBUG=y
237CONFIG_USB_ANNOUNCE_NEW_DEVICES=y 247CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
238CONFIG_USB_SUSPEND=y 248CONFIG_USB_SUSPEND=y
239CONFIG_USB_EHCI_HCD=y 249CONFIG_USB_EHCI_HCD=y
240CONFIG_USB_DWC3=m 250CONFIG_USB_DWC3=m
241CONFIG_USB_DWC3_DEBUG=y
242CONFIG_USB_DWC3_VERBOSE=y
243CONFIG_USB_MUSB_HDRC=m 251CONFIG_USB_MUSB_HDRC=m
244CONFIG_USB_MUSB_OMAP2PLUS=m 252CONFIG_USB_MUSB_OMAP2PLUS=m
245CONFIG_USB_MUSB_AM35X=m 253CONFIG_USB_MUSB_AM35X=m
@@ -250,7 +258,6 @@ CONFIG_USB_WDM=y
250CONFIG_USB_STORAGE=y 258CONFIG_USB_STORAGE=y
251CONFIG_USB_TEST=y 259CONFIG_USB_TEST=y
252CONFIG_USB_GADGET=y 260CONFIG_USB_GADGET=y
253CONFIG_USB_GADGET_DEBUG=y
254CONFIG_USB_GADGET_DEBUG_FILES=y 261CONFIG_USB_GADGET_DEBUG_FILES=y
255CONFIG_USB_GADGET_DEBUG_FS=y 262CONFIG_USB_GADGET_DEBUG_FS=y
256CONFIG_USB_ZERO=m 263CONFIG_USB_ZERO=m
diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c
index eca7a77df80..8af6b54ab66 100644
--- a/arch/arm/mach-omap2/board-generic.c
+++ b/arch/arm/mach-omap2/board-generic.c
@@ -240,7 +240,7 @@ static const char *omap5_boards_compat[] __initdata = {
240 NULL, 240 NULL,
241}; 241};
242 242
243DT_MACHINE_START(OMAP5_DT, "Generic OMAP5 (Flattened Device Tree)") 243DT_MACHINE_START(OMAP5_DT, "OMAP5 Panda board")
244 .reserve = omap_reserve, 244 .reserve = omap_reserve,
245 .smp = smp_ops(omap4_smp_ops), 245 .smp = smp_ops(omap4_smp_ops),
246 .map_io = omap5_map_io, 246 .map_io = omap5_map_io,
diff --git a/arch/arm/mach-omap2/cclock54xx_data.c b/arch/arm/mach-omap2/cclock54xx_data.c
index 4a17f12caa9..4228e2ba37a 100644
--- a/arch/arm/mach-omap2/cclock54xx_data.c
+++ b/arch/arm/mach-omap2/cclock54xx_data.c
@@ -1018,12 +1018,14 @@ static const char *gpu_core_gclk_mux_parents[] = {
1018 "dpll_core_h14x2_ck", "dpll_per_h14x2_ck", 1018 "dpll_core_h14x2_ck", "dpll_per_h14x2_ck",
1019}; 1019};
1020 1020
1021DEFINE_CLK_MUX(gpu_core_gclk_mux, gpu_core_gclk_mux_parents, NULL, 0x0, 1021DEFINE_CLK_MUX(gpu_core_gclk_mux, gpu_core_gclk_mux_parents, NULL,
1022 OMAP54XX_CM_GPU_GPU_CLKCTRL, OMAP54XX_CLKSEL_GPU_CORE_GCLK_SHIFT, 1022 CLK_SET_RATE_PARENT, OMAP54XX_CM_GPU_GPU_CLKCTRL,
1023 OMAP54XX_CLKSEL_GPU_CORE_GCLK_SHIFT,
1023 OMAP54XX_CLKSEL_GPU_CORE_GCLK_WIDTH, 0x0, NULL); 1024 OMAP54XX_CLKSEL_GPU_CORE_GCLK_WIDTH, 0x0, NULL);
1024 1025
1025DEFINE_CLK_MUX(gpu_hyd_gclk_mux, gpu_core_gclk_mux_parents, NULL, 0x0, 1026DEFINE_CLK_MUX(gpu_hyd_gclk_mux, gpu_core_gclk_mux_parents, NULL,
1026 OMAP54XX_CM_GPU_GPU_CLKCTRL, OMAP54XX_CLKSEL_GPU_HYD_GCLK_SHIFT, 1027 CLK_SET_RATE_PARENT, OMAP54XX_CM_GPU_GPU_CLKCTRL,
1028 OMAP54XX_CLKSEL_GPU_HYD_GCLK_SHIFT,
1027 OMAP54XX_CLKSEL_GPU_HYD_GCLK_WIDTH, 0x0, NULL); 1029 OMAP54XX_CLKSEL_GPU_HYD_GCLK_WIDTH, 0x0, NULL);
1028 1030
1029DEFINE_CLK_DIVIDER(hsi_fclk, "dpll_per_m2x2_ck", &dpll_per_m2x2_ck, 0x0, 1031DEFINE_CLK_DIVIDER(hsi_fclk, "dpll_per_m2x2_ck", &dpll_per_m2x2_ck, 0x0,
diff --git a/arch/arm/mach-omap2/cclock7xx_data.c b/arch/arm/mach-omap2/cclock7xx_data.c
index e77d58771c7..70bbe2c7760 100644
--- a/arch/arm/mach-omap2/cclock7xx_data.c
+++ b/arch/arm/mach-omap2/cclock7xx_data.c
@@ -40,8 +40,9 @@
40#include "prm-regbits-7xx.h" 40#include "prm-regbits-7xx.h"
41#include "control.h" 41#include "control.h"
42 42
43#define DRA7_DPLL_ABE_DEFFREQ 361267200 43#define DRA7_DPLL_ABE_DEFFREQ 180633600
44#define DRA7_DPLL_GMAC_DEFFREQ 1000000000 44#define DRA7_DPLL_GMAC_DEFFREQ 1000000000
45#define DRA7_DPLL_USB_DEFFREQ 960000000
45 46
46/* Root clocks */ 47/* Root clocks */
47 48
@@ -51,7 +52,7 @@ DEFINE_CLK_FIXED_RATE(atl_clkin1_ck, CLK_IS_ROOT, 0, 0x0);
51 52
52DEFINE_CLK_FIXED_RATE(atl_clkin2_ck, CLK_IS_ROOT, 0, 0x0); 53DEFINE_CLK_FIXED_RATE(atl_clkin2_ck, CLK_IS_ROOT, 0, 0x0);
53 54
54DEFINE_CLK_FIXED_RATE(atlclkin3_ck, CLK_IS_ROOT, 0, 0x0); 55DEFINE_CLK_FIXED_RATE(atl_clkin3_ck, CLK_IS_ROOT, 0, 0x0);
55 56
56DEFINE_CLK_FIXED_RATE(hdmi_clkin_ck, CLK_IS_ROOT, 0, 0x0); 57DEFINE_CLK_FIXED_RATE(hdmi_clkin_ck, CLK_IS_ROOT, 0, 0x0);
57 58
@@ -1245,7 +1246,7 @@ static struct clk_hw_omap hdmi_div_clk_hw = {
1245DEFINE_STRUCT_CLK(hdmi_div_clk, hdmi_dclk_div_parents, apll_pcie_clkvcoldo_ops); 1246DEFINE_STRUCT_CLK(hdmi_div_clk, hdmi_dclk_div_parents, apll_pcie_clkvcoldo_ops);
1246 1247
1247DEFINE_CLK_MUX(hdmi_dpll_clk_mux, abe_dpll_sys_clk_mux_parents, NULL, 0x0, 1248DEFINE_CLK_MUX(hdmi_dpll_clk_mux, abe_dpll_sys_clk_mux_parents, NULL, 0x0,
1248 DRA7XX_CM_CLKSEL_HDMI_CLK_CLKOUTMUX, DRA7XX_CLKSEL_SHIFT, 1249 DRA7XX_CM_CLKSEL_HDMI_PLL_SYS, DRA7XX_CLKSEL_SHIFT,
1249 DRA7XX_CLKSEL_WIDTH, 0x0, NULL); 1250 DRA7XX_CLKSEL_WIDTH, 0x0, NULL);
1250 1251
1251static struct clk l3_iclk_div; 1252static struct clk l3_iclk_div;
@@ -1525,13 +1526,15 @@ static const char *gpu_core_gclk_mux_parents[] = {
1525 "dpll_core_h14x2_ck", "dpll_per_h14x2_ck", "dpll_gpu_m2_ck", 1526 "dpll_core_h14x2_ck", "dpll_per_h14x2_ck", "dpll_gpu_m2_ck",
1526}; 1527};
1527 1528
1528DEFINE_CLK_MUX(gpu_core_gclk_mux, gpu_core_gclk_mux_parents, NULL, 0x0, 1529DEFINE_CLK_MUX(gpu_core_gclk_mux, gpu_core_gclk_mux_parents, NULL,
1529 DRA7XX_CM_GPU_GPU_CLKCTRL, DRA7XX_CLKSEL_CORE_CLK_SHIFT, 1530 CLK_SET_RATE_PARENT, DRA7XX_CM_GPU_GPU_CLKCTRL,
1530 DRA7XX_CLKSEL_CORE_CLK_WIDTH, 0x0, NULL); 1531 DRA7XX_CLKSEL_CORE_CLK_SHIFT, DRA7XX_CLKSEL_CORE_CLK_WIDTH,
1532 0x0, NULL);
1531 1533
1532DEFINE_CLK_MUX(gpu_hyd_gclk_mux, gpu_core_gclk_mux_parents, NULL, 0x0, 1534DEFINE_CLK_MUX(gpu_hyd_gclk_mux, gpu_core_gclk_mux_parents, NULL,
1533 DRA7XX_CM_GPU_GPU_CLKCTRL, DRA7XX_CLKSEL_HYD_CLK_SHIFT, 1535 CLK_SET_RATE_PARENT, DRA7XX_CM_GPU_GPU_CLKCTRL,
1534 DRA7XX_CLKSEL_HYD_CLK_WIDTH, 0x0, NULL); 1536 DRA7XX_CLKSEL_HYD_CLK_SHIFT, DRA7XX_CLKSEL_HYD_CLK_WIDTH,
1537 0x0, NULL);
1535 1538
1536static const char *ipu1_gfclk_mux_parents[] = { 1539static const char *ipu1_gfclk_mux_parents[] = {
1537 "dpll_abe_m2x2_ck", "dpll_core_h22x2_ck", 1540 "dpll_abe_m2x2_ck", "dpll_core_h22x2_ck",
@@ -1555,9 +1558,9 @@ DEFINE_CLK_DIVIDER_TABLE(l3instr_ts_gclk_div, "wkupaon_iclk_mux",
1555 1558
1556static const char *mcasp1_ahclkr_mux_parents[] = { 1559static const char *mcasp1_ahclkr_mux_parents[] = {
1557 "abe_24m_fclk", "abe_sys_clk_div", "func_24m_clk", 1560 "abe_24m_fclk", "abe_sys_clk_div", "func_24m_clk",
1558 "atlclkin3", "atl_clkin2", "atl_clkin1", 1561 "atl_clkin3_ck", "atl_clkin2_ck", "atl_clkin1_ck",
1559 "atl_clkin0", "sys_clkin2", "ref_clkin0", 1562 "atl_clkin0_ck", "sys_clkin2", "ref_clkin0_ck",
1560 "ref_clkin1", "ref_clkin2", "ref_clkin3", 1563 "ref_clkin1_ck", "ref_clkin2_ck", "ref_clkin3_ck",
1561 "mlb_clk", "mlbp_clk", 1564 "mlb_clk", "mlbp_clk",
1562}; 1565};
1563 1566
@@ -1692,8 +1695,8 @@ DEFINE_CLK_DIVIDER(qspi_gfclk_div, "qspi_gfclk_mux", &qspi_gfclk_mux, 0x0,
1692 1695
1693static const char *timer10_gfclk_mux_parents[] = { 1696static const char *timer10_gfclk_mux_parents[] = {
1694 "timer_sys_clk_div", "sys_32k_ck", "sys_clkin2", 1697 "timer_sys_clk_div", "sys_32k_ck", "sys_clkin2",
1695 "ref_clkin0", "ref_clkin1", "ref_clkin2", 1698 "ref_clkin0_ck", "ref_clkin1_ck", "ref_clkin2_ck",
1696 "ref_clkin3", "abe_giclk_div", "video1_div_clk", 1699 "ref_clkin3_ck", "abe_giclk_div", "video1_div_clk",
1697 "video2_div_clk", "hdmi_div_clk", 1700 "video2_div_clk", "hdmi_div_clk",
1698}; 1701};
1699 1702
@@ -1739,8 +1742,8 @@ DEFINE_CLK_MUX(timer4_gfclk_mux, timer10_gfclk_mux_parents, NULL, 0x0,
1739 1742
1740static const char *timer5_gfclk_mux_parents[] = { 1743static const char *timer5_gfclk_mux_parents[] = {
1741 "timer_sys_clk_div", "sys_32k_ck", "sys_clkin2", 1744 "timer_sys_clk_div", "sys_32k_ck", "sys_clkin2",
1742 "ref_clkin0", "ref_clkin1", "ref_clkin2", 1745 "ref_clkin0_ck", "ref_clkin1_ck", "ref_clkin2_ck",
1743 "ref_clkin3", "abe_giclk_div", "video1_div_clk", 1746 "ref_clkin3_ck", "abe_giclk_div", "video1_div_clk",
1744 "video2_div_clk", "hdmi_div_clk", "clkoutmux0_clk_mux", 1747 "video2_div_clk", "hdmi_div_clk", "clkoutmux0_clk_mux",
1745}; 1748};
1746 1749
@@ -1828,7 +1831,7 @@ static struct omap_clk dra7xx_clks[] = {
1828 CLK(NULL, "atl_clkin0_ck", &atl_clkin0_ck, CK_7XX), 1831 CLK(NULL, "atl_clkin0_ck", &atl_clkin0_ck, CK_7XX),
1829 CLK(NULL, "atl_clkin1_ck", &atl_clkin1_ck, CK_7XX), 1832 CLK(NULL, "atl_clkin1_ck", &atl_clkin1_ck, CK_7XX),
1830 CLK(NULL, "atl_clkin2_ck", &atl_clkin2_ck, CK_7XX), 1833 CLK(NULL, "atl_clkin2_ck", &atl_clkin2_ck, CK_7XX),
1831 CLK(NULL, "atlclkin3_ck", &atlclkin3_ck, CK_7XX), 1834 CLK(NULL, "atl_clkin3_ck", &atl_clkin3_ck, CK_7XX),
1832 CLK(NULL, "hdmi_clkin_ck", &hdmi_clkin_ck, CK_7XX), 1835 CLK(NULL, "hdmi_clkin_ck", &hdmi_clkin_ck, CK_7XX),
1833 CLK(NULL, "mlb_clkin_ck", &mlb_clkin_ck, CK_7XX), 1836 CLK(NULL, "mlb_clkin_ck", &mlb_clkin_ck, CK_7XX),
1834 CLK(NULL, "mlbp_clkin_ck", &mlbp_clkin_ck, CK_7XX), 1837 CLK(NULL, "mlbp_clkin_ck", &mlbp_clkin_ck, CK_7XX),
@@ -2123,7 +2126,9 @@ static struct reparent_init_clks reparent_clks[] = {
2123 2126
2124static struct rate_init_clks rate_clks[] = { 2127static struct rate_init_clks rate_clks[] = {
2125 { .name = "dpll_abe_ck", .rate = DRA7_DPLL_ABE_DEFFREQ }, 2128 { .name = "dpll_abe_ck", .rate = DRA7_DPLL_ABE_DEFFREQ },
2129 { .name = "dpll_abe_m2x2_ck", .rate = DRA7_DPLL_ABE_DEFFREQ * 2 },
2126 { .name = "dpll_gmac_ck", .rate = DRA7_DPLL_GMAC_DEFFREQ }, 2130 { .name = "dpll_gmac_ck", .rate = DRA7_DPLL_GMAC_DEFFREQ },
2131 { .name = "dpll_usb_ck", .rate = DRA7_DPLL_USB_DEFFREQ },
2127}; 2132};
2128 2133
2129int __init dra7xx_clk_init(void) 2134int __init dra7xx_clk_init(void)
diff --git a/arch/arm/mach-omap2/omap_hwmod_7xx_data.c b/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
index e8d09dfbaf6..c9db73b816a 100644
--- a/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
@@ -600,7 +600,7 @@ static struct omap_hwmod_class dra7xx_hdmi_hwmod_class = {
600 600
601/* dss_hdmi */ 601/* dss_hdmi */
602static struct omap_hwmod_irq_info dra7xx_dss_hdmi_irqs[] = { 602static struct omap_hwmod_irq_info dra7xx_dss_hdmi_irqs[] = {
603 { .irq = 101 + DRA7XX_IRQ_GIC_START }, 603 { .irq = 96 + DRA7XX_IRQ_GIC_START },
604 { .irq = -1 } 604 { .irq = -1 }
605}; 605};
606 606
@@ -1518,6 +1518,7 @@ static struct omap_hwmod dra7xx_mcasp1_hwmod = {
1518 .class = &dra7xx_mcasp_hwmod_class, 1518 .class = &dra7xx_mcasp_hwmod_class,
1519 .clkdm_name = "ipu_clkdm", 1519 .clkdm_name = "ipu_clkdm",
1520 .main_clk = "mcasp1_ahclkx_mux", 1520 .main_clk = "mcasp1_ahclkx_mux",
1521 .flags = HWMOD_SWSUP_SIDLE,
1521 .prcm = { 1522 .prcm = {
1522 .omap4 = { 1523 .omap4 = {
1523 .clkctrl_offs = DRA7XX_CM_IPU_MCASP1_CLKCTRL_OFFSET, 1524 .clkctrl_offs = DRA7XX_CM_IPU_MCASP1_CLKCTRL_OFFSET,
@@ -1533,6 +1534,7 @@ static struct omap_hwmod dra7xx_mcasp2_hwmod = {
1533 .class = &dra7xx_mcasp_hwmod_class, 1534 .class = &dra7xx_mcasp_hwmod_class,
1534 .clkdm_name = "l4per2_clkdm", 1535 .clkdm_name = "l4per2_clkdm",
1535 .main_clk = "mcasp2_ahclkr_mux", 1536 .main_clk = "mcasp2_ahclkr_mux",
1537 .flags = HWMOD_SWSUP_SIDLE,
1536 .prcm = { 1538 .prcm = {
1537 .omap4 = { 1539 .omap4 = {
1538 .clkctrl_offs = DRA7XX_CM_L4PER2_MCASP2_CLKCTRL_OFFSET, 1540 .clkctrl_offs = DRA7XX_CM_L4PER2_MCASP2_CLKCTRL_OFFSET,
@@ -1542,12 +1544,21 @@ static struct omap_hwmod dra7xx_mcasp2_hwmod = {
1542 }, 1544 },
1543}; 1545};
1544 1546
1547/* HACK: Taken from UART6 since they're not used in dra7-evm */
1548static struct omap_hwmod_dma_info dra7xx_mcasp3_sdma_reqs[] = {
1549 { .name = "tx", .dma_req = 78 + DRA7XX_DMA_REQ_START },
1550 { .name = "rx", .dma_req = 79 + DRA7XX_DMA_REQ_START },
1551 { .dma_req = -1 }
1552};
1553
1545/* mcasp3 */ 1554/* mcasp3 */
1546static struct omap_hwmod dra7xx_mcasp3_hwmod = { 1555static struct omap_hwmod dra7xx_mcasp3_hwmod = {
1547 .name = "mcasp3", 1556 .name = "mcasp3",
1548 .class = &dra7xx_mcasp_hwmod_class, 1557 .class = &dra7xx_mcasp_hwmod_class,
1549 .clkdm_name = "l4per2_clkdm", 1558 .clkdm_name = "l4per2_clkdm",
1550 .main_clk = "mcasp3_ahclkx_mux", 1559 .main_clk = "mcasp3_ahclkx_mux",
1560 .sdma_reqs = dra7xx_mcasp3_sdma_reqs,
1561 .flags = HWMOD_SWSUP_SIDLE,
1551 .prcm = { 1562 .prcm = {
1552 .omap4 = { 1563 .omap4 = {
1553 .clkctrl_offs = DRA7XX_CM_L4PER2_MCASP3_CLKCTRL_OFFSET, 1564 .clkctrl_offs = DRA7XX_CM_L4PER2_MCASP3_CLKCTRL_OFFSET,
@@ -1563,6 +1574,7 @@ static struct omap_hwmod dra7xx_mcasp4_hwmod = {
1563 .class = &dra7xx_mcasp_hwmod_class, 1574 .class = &dra7xx_mcasp_hwmod_class,
1564 .clkdm_name = "l4per2_clkdm", 1575 .clkdm_name = "l4per2_clkdm",
1565 .main_clk = "mcasp4_ahclkx_mux", 1576 .main_clk = "mcasp4_ahclkx_mux",
1577 .flags = HWMOD_SWSUP_SIDLE,
1566 .prcm = { 1578 .prcm = {
1567 .omap4 = { 1579 .omap4 = {
1568 .clkctrl_offs = DRA7XX_CM_L4PER2_MCASP4_CLKCTRL_OFFSET, 1580 .clkctrl_offs = DRA7XX_CM_L4PER2_MCASP4_CLKCTRL_OFFSET,
@@ -1578,6 +1590,7 @@ static struct omap_hwmod dra7xx_mcasp5_hwmod = {
1578 .class = &dra7xx_mcasp_hwmod_class, 1590 .class = &dra7xx_mcasp_hwmod_class,
1579 .clkdm_name = "l4per2_clkdm", 1591 .clkdm_name = "l4per2_clkdm",
1580 .main_clk = "mcasp5_ahclkx_mux", 1592 .main_clk = "mcasp5_ahclkx_mux",
1593 .flags = HWMOD_SWSUP_SIDLE,
1581 .prcm = { 1594 .prcm = {
1582 .omap4 = { 1595 .omap4 = {
1583 .clkctrl_offs = DRA7XX_CM_L4PER2_MCASP5_CLKCTRL_OFFSET, 1596 .clkctrl_offs = DRA7XX_CM_L4PER2_MCASP5_CLKCTRL_OFFSET,
@@ -1587,12 +1600,21 @@ static struct omap_hwmod dra7xx_mcasp5_hwmod = {
1587 }, 1600 },
1588}; 1601};
1589 1602
1603/* HACK: Taken from UART5 since they're not used in dra7-evm */
1604static struct omap_hwmod_dma_info dra7xx_mcasp6_sdma_reqs[] = {
1605 { .name = "tx", .dma_req = 62 + DRA7XX_DMA_REQ_START },
1606 { .name = "rx", .dma_req = 63 + DRA7XX_DMA_REQ_START },
1607 { .dma_req = -1 }
1608};
1609
1590/* mcasp6 */ 1610/* mcasp6 */
1591static struct omap_hwmod dra7xx_mcasp6_hwmod = { 1611static struct omap_hwmod dra7xx_mcasp6_hwmod = {
1592 .name = "mcasp6", 1612 .name = "mcasp6",
1593 .class = &dra7xx_mcasp_hwmod_class, 1613 .class = &dra7xx_mcasp_hwmod_class,
1594 .clkdm_name = "l4per2_clkdm", 1614 .clkdm_name = "l4per2_clkdm",
1595 .main_clk = "mcasp6_ahclkx_mux", 1615 .main_clk = "mcasp6_ahclkx_mux",
1616 .sdma_reqs = dra7xx_mcasp6_sdma_reqs,
1617 .flags = HWMOD_SWSUP_SIDLE,
1596 .prcm = { 1618 .prcm = {
1597 .omap4 = { 1619 .omap4 = {
1598 .clkctrl_offs = DRA7XX_CM_L4PER2_MCASP6_CLKCTRL_OFFSET, 1620 .clkctrl_offs = DRA7XX_CM_L4PER2_MCASP6_CLKCTRL_OFFSET,
@@ -1608,6 +1630,7 @@ static struct omap_hwmod dra7xx_mcasp7_hwmod = {
1608 .class = &dra7xx_mcasp_hwmod_class, 1630 .class = &dra7xx_mcasp_hwmod_class,
1609 .clkdm_name = "l4per2_clkdm", 1631 .clkdm_name = "l4per2_clkdm",
1610 .main_clk = "mcasp7_ahclkx_mux", 1632 .main_clk = "mcasp7_ahclkx_mux",
1633 .flags = HWMOD_SWSUP_SIDLE,
1611 .prcm = { 1634 .prcm = {
1612 .omap4 = { 1635 .omap4 = {
1613 .clkctrl_offs = DRA7XX_CM_L4PER2_MCASP7_CLKCTRL_OFFSET, 1636 .clkctrl_offs = DRA7XX_CM_L4PER2_MCASP7_CLKCTRL_OFFSET,
@@ -1623,6 +1646,7 @@ static struct omap_hwmod dra7xx_mcasp8_hwmod = {
1623 .class = &dra7xx_mcasp_hwmod_class, 1646 .class = &dra7xx_mcasp_hwmod_class,
1624 .clkdm_name = "l4per2_clkdm", 1647 .clkdm_name = "l4per2_clkdm",
1625 .main_clk = "mcasp8_ahclk_mux", 1648 .main_clk = "mcasp8_ahclk_mux",
1649 .flags = HWMOD_SWSUP_SIDLE,
1626 .prcm = { 1650 .prcm = {
1627 .omap4 = { 1651 .omap4 = {
1628 .clkctrl_offs = DRA7XX_CM_L4PER2_MCASP8_CLKCTRL_OFFSET, 1652 .clkctrl_offs = DRA7XX_CM_L4PER2_MCASP8_CLKCTRL_OFFSET,
diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c
index 352f397d4aa..e4a9dbe8cbc 100644
--- a/drivers/usb/dwc3/dwc3-omap.c
+++ b/drivers/usb/dwc3/dwc3-omap.c
@@ -139,14 +139,22 @@ static inline void dwc3_omap_writel(void __iomem *base, u32 offset, u32 value)
139 writel(value, base + offset); 139 writel(value, base + offset);
140} 140}
141 141
142int dwc3_omap_mailbox(enum omap_dwc3_vbus_id_status status) 142int dwc3_omap_mailbox(struct device *dev, enum omap_dwc3_vbus_id_status status)
143{ 143{
144 u32 val; 144 u32 val;
145 struct dwc3_omap *omap = _omap; 145 struct platform_device *pdev;
146 struct dwc3_omap *omap;
146 147
147 if (!omap) 148 if (dev) { /* i.e. this is being called from a non palmas driver */
148 return -EPROBE_DEFER; 149 pdev = to_platform_device(dev);
150 omap = platform_get_drvdata(pdev);
151 } else /* This is being invoked by palmas and the global is needed */
152 omap = _omap;
149 153
154 if (!omap) {
155 dev_dbg(omap->dev, "not ready , deferring\n");
156 return -EPROBE_DEFER;
157 }
150 switch (status) { 158 switch (status) {
151 case OMAP_DWC3_ID_GROUND: 159 case OMAP_DWC3_ID_GROUND:
152 dev_dbg(omap->dev, "ID GND\n"); 160 dev_dbg(omap->dev, "ID GND\n");
@@ -189,7 +197,7 @@ int dwc3_omap_mailbox(enum omap_dwc3_vbus_id_status status)
189 dev_dbg(omap->dev, "ID float\n"); 197 dev_dbg(omap->dev, "ID float\n");
190 } 198 }
191 199
192 return IRQ_HANDLED; 200 return 0;
193} 201}
194EXPORT_SYMBOL_GPL(dwc3_omap_mailbox); 202EXPORT_SYMBOL_GPL(dwc3_omap_mailbox);
195 203
@@ -261,6 +269,22 @@ static int dwc3_omap_set_dmamask(struct device *dev, void *c)
261 return 0; 269 return 0;
262} 270}
263 271
272static u64 dwc3_omap_dma_mask1 = DMA_BIT_MASK(32);
273
274static int dwc3_omap_set_dmamask1(struct device *dev, void *c)
275{
276 dev->dma_mask = &dwc3_omap_dma_mask1;
277 return 0;
278}
279
280static u64 dwc3_omap_dma_mask2 = DMA_BIT_MASK(32);
281
282static int dwc3_omap_set_dmamask2(struct device *dev, void *c)
283{
284 dev->dma_mask = &dwc3_omap_dma_mask2;
285 return 0;
286}
287
264static int dwc3_omap_probe(struct platform_device *pdev) 288static int dwc3_omap_probe(struct platform_device *pdev)
265{ 289{
266 struct device_node *node = pdev->dev.of_node; 290 struct device_node *node = pdev->dev.of_node;
@@ -388,7 +412,14 @@ static int dwc3_omap_probe(struct platform_device *pdev)
388 return ret; 412 return ret;
389 } 413 }
390 414
391 device_for_each_child(&pdev->dev, NULL, dwc3_omap_set_dmamask); 415 if (strstr(dev_name(dev), "omap_dwc31") != NULL)
416 device_for_each_child(&pdev->dev, NULL, dwc3_omap_set_dmamask1);
417 else
418 if (strstr(dev_name(dev), "omap_dwc32") != NULL)
419 device_for_each_child(&pdev->dev, NULL, dwc3_omap_set_dmamask2);
420 else
421 if (strstr(dev_name(dev), "omap_dwc3") != NULL)
422 device_for_each_child(&pdev->dev, NULL, dwc3_omap_set_dmamask);
392 423
393 return 0; 424 return 0;
394} 425}
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index 0ee9a04a517..f90fa6e11f7 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -53,6 +53,8 @@
53#include "core.h" 53#include "core.h"
54#include "gadget.h" 54#include "gadget.h"
55#include "io.h" 55#include "io.h"
56#include <linux/usb/dwc3-omap.h>
57#include <linux/platform_data/dwc3-omap.h>
56 58
57/** 59/**
58 * dwc3_gadget_set_test_mode - Enables USB2 Test Modes 60 * dwc3_gadget_set_test_mode - Enables USB2 Test Modes
@@ -1048,6 +1050,13 @@ static int __dwc3_gadget_ep_queue(struct dwc3_ep *dep, struct dwc3_request *req)
1048 req->direction = dep->direction; 1050 req->direction = dep->direction;
1049 req->epnum = dep->number; 1051 req->epnum = dep->number;
1050 1052
1053 /* For a "read" direction aka OUT endpoints */
1054 if (req->direction == 0) {
1055 if (req->request.length % dep->endpoint.desc->wMaxPacketSize) {
1056 req->request.length += ( dep->endpoint.desc->wMaxPacketSize - req->request.length);
1057 }
1058 }
1059
1051 /* 1060 /*
1052 * We only add to our list of requests now and 1061 * We only add to our list of requests now and
1053 * start consuming the list once we get XferNotReady 1062 * start consuming the list once we get XferNotReady
@@ -1452,6 +1461,12 @@ static int dwc3_gadget_pullup(struct usb_gadget *g, int is_on)
1452 1461
1453 is_on = !!is_on; 1462 is_on = !!is_on;
1454 1463
1464#if defined(CONFIG_SOC_DRA7XX)
1465 if (is_on) {
1466 if (dwc3_omap_mailbox(dwc->dev->parent, OMAP_DWC3_VBUS_VALID))
1467 dev_err(dwc->dev, "Error wrapper may not be initilized\n");
1468 }
1469#endif
1455 spin_lock_irqsave(&dwc->lock, flags); 1470 spin_lock_irqsave(&dwc->lock, flags);
1456 ret = dwc3_gadget_run_stop(dwc, is_on); 1471 ret = dwc3_gadget_run_stop(dwc, is_on);
1457 spin_unlock_irqrestore(&dwc->lock, flags); 1472 spin_unlock_irqrestore(&dwc->lock, flags);
@@ -1584,6 +1599,25 @@ static const struct usb_gadget_ops dwc3_gadget_ops = {
1584 1599
1585/* -------------------------------------------------------------------------- */ 1600/* -------------------------------------------------------------------------- */
1586 1601
1602static int dwc3_gadget_get_maxpacket_ep0(struct dwc3 *dwc)
1603{
1604 switch (dwc->maximum_speed) {
1605 case USB_SPEED_HIGH:
1606 case USB_SPEED_FULL:
1607 return 64;
1608 case USB_SPEED_LOW:
1609 return 8;
1610 case USB_SPEED_SUPER:
1611 default:
1612 return 512;
1613 }
1614}
1615
1616static int dwc3_gadget_get_maxpacket(struct dwc3 *dwc)
1617{
1618 return 1024;
1619}
1620
1587static int dwc3_gadget_init_endpoints(struct dwc3 *dwc) 1621static int dwc3_gadget_init_endpoints(struct dwc3 *dwc)
1588{ 1622{
1589 struct dwc3_ep *dep; 1623 struct dwc3_ep *dep;
@@ -1609,7 +1643,7 @@ static int dwc3_gadget_init_endpoints(struct dwc3 *dwc)
1609 dep->direction = (epnum & 1); 1643 dep->direction = (epnum & 1);
1610 1644
1611 if (epnum == 0 || epnum == 1) { 1645 if (epnum == 0 || epnum == 1) {
1612 dep->endpoint.maxpacket = 512; 1646 dep->endpoint.maxpacket = dwc3_gadget_get_maxpacket_ep0(dwc);
1613 dep->endpoint.maxburst = 1; 1647 dep->endpoint.maxburst = 1;
1614 dep->endpoint.ops = &dwc3_gadget_ep0_ops; 1648 dep->endpoint.ops = &dwc3_gadget_ep0_ops;
1615 if (!epnum) 1649 if (!epnum)
@@ -1617,7 +1651,7 @@ static int dwc3_gadget_init_endpoints(struct dwc3 *dwc)
1617 } else { 1651 } else {
1618 int ret; 1652 int ret;
1619 1653
1620 dep->endpoint.maxpacket = 1024; 1654 dep->endpoint.maxpacket = dwc3_gadget_get_maxpacket(dwc);
1621 dep->endpoint.max_streams = 15; 1655 dep->endpoint.max_streams = 15;
1622 dep->endpoint.ops = &dwc3_gadget_ep_ops; 1656 dep->endpoint.ops = &dwc3_gadget_ep_ops;
1623 list_add_tail(&dep->endpoint.ep_list, 1657 list_add_tail(&dep->endpoint.ep_list,
diff --git a/drivers/usb/gadget/android.c b/drivers/usb/gadget/android.c
index 11d247cc0e9..3bd8de5af6e 100644
--- a/drivers/usb/gadget/android.c
+++ b/drivers/usb/gadget/android.c
@@ -31,7 +31,7 @@
31#include "gadget_chips.h" 31#include "gadget_chips.h"
32 32
33#include "f_fs.c" 33#include "f_fs.c"
34#include "f_audio_source.c" 34//#include "f_audio_source.c"
35#include "f_mass_storage.c" 35#include "f_mass_storage.c"
36#include "u_serial.c" 36#include "u_serial.c"
37#include "f_acm.c" 37#include "f_acm.c"
@@ -814,7 +814,7 @@ static struct android_usb_function accessory_function = {
814 .bind_config = accessory_function_bind_config, 814 .bind_config = accessory_function_bind_config,
815 .ctrlrequest = accessory_function_ctrlrequest, 815 .ctrlrequest = accessory_function_ctrlrequest,
816}; 816};
817 817#if 0 //HACK
818static int audio_source_function_init(struct android_usb_function *f, 818static int audio_source_function_init(struct android_usb_function *f,
819 struct usb_composite_dev *cdev) 819 struct usb_composite_dev *cdev)
820{ 820{
@@ -876,7 +876,7 @@ static struct android_usb_function audio_source_function = {
876 .unbind_config = audio_source_function_unbind_config, 876 .unbind_config = audio_source_function_unbind_config,
877 .attributes = audio_source_function_attributes, 877 .attributes = audio_source_function_attributes,
878}; 878};
879 879#endif
880static struct android_usb_function *supported_functions[] = { 880static struct android_usb_function *supported_functions[] = {
881 &ffs_function, 881 &ffs_function,
882 &acm_function, 882 &acm_function,
@@ -885,7 +885,7 @@ static struct android_usb_function *supported_functions[] = {
885 &rndis_function, 885 &rndis_function,
886 &mass_storage_function, 886 &mass_storage_function,
887 &accessory_function, 887 &accessory_function,
888 &audio_source_function, 888// &audio_source_function,
889 NULL 889 NULL
890}; 890};
891 891
@@ -1404,12 +1404,16 @@ static int android_create_device(struct android_dev *dev)
1404 return 0; 1404 return 0;
1405} 1405}
1406 1406
1407 1407static int omap_android_probe(struct platform_device *pdev)
1408static int __init init(void)
1409{ 1408{
1410 struct android_dev *dev; 1409 struct android_dev *dev;
1411 int err; 1410 int err;
1412 1411
1412 if (usb_composite_probe_ready(&android_usb_driver) != 0) {
1413 err = -EPROBE_DEFER;
1414 goto err_ret;
1415 }
1416
1413 android_class = class_create(THIS_MODULE, "android_usb"); 1417 android_class = class_create(THIS_MODULE, "android_usb");
1414 if (IS_ERR(android_class)) 1418 if (IS_ERR(android_class))
1415 return PTR_ERR(android_class); 1419 return PTR_ERR(android_class);
@@ -1450,15 +1454,33 @@ err_create:
1450 kfree(dev); 1454 kfree(dev);
1451err_dev: 1455err_dev:
1452 class_destroy(android_class); 1456 class_destroy(android_class);
1457err_ret:
1453 return err; 1458 return err;
1454} 1459}
1455module_init(init);
1456 1460
1457static void __exit cleanup(void) 1461static int omap_android_remove(struct platform_device *pdev)
1458{ 1462{
1459 usb_composite_unregister(&android_usb_driver); 1463 usb_composite_unregister(&android_usb_driver);
1460 class_destroy(android_class); 1464 class_destroy(android_class);
1461 kfree(_android_dev); 1465 kfree(_android_dev);
1462 _android_dev = NULL; 1466 _android_dev = NULL;
1467 return 0;
1468}
1469
1470static struct platform_driver omap_g_androiddrv = {
1471 .driver = {
1472 .name = "omap_g_android",
1473 .owner = THIS_MODULE,
1474 },
1475 .probe = omap_android_probe,
1476 .remove = omap_android_remove,
1477};
1478module_platform_driver(omap_g_androiddrv);
1479
1480static int __init omap_init_g_android(void)
1481{
1482 struct platform_device_info devinfo = { .name = "omap_g_android", };
1483 platform_device_register_full(&devinfo);
1484 return 0;
1463} 1485}
1464module_exit(cleanup); 1486module_init(omap_init_g_android);
diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
index 733047b31cf..a8ee0637dfe 100644
--- a/drivers/usb/gadget/composite.c
+++ b/drivers/usb/gadget/composite.c
@@ -958,7 +958,7 @@ EXPORT_SYMBOL_GPL(usb_string_id);
958 958
959/** 959/**
960 * usb_string_ids() - allocate unused string IDs in batch 960 * usb_string_ids() - allocate unused string IDs in batch
961 * @cdev: the device whose string descriptor IDs are being allocated 961 @cdev: the device whose string descriptor IDs are being allocated
962 * @str: an array of usb_string objects to assign numbers to 962 * @str: an array of usb_string objects to assign numbers to
963 * Context: single threaded during gadget setup 963 * Context: single threaded during gadget setup
964 * 964 *
@@ -1546,6 +1546,28 @@ static const struct usb_gadget_driver composite_driver_template = {
1546 }, 1546 },
1547}; 1547};
1548 1548
1549int usb_composite_probe_ready(struct usb_composite_driver *driver){
1550 struct usb_gadget_driver *gadget_driver;
1551 int ready=0;
1552
1553 if (!driver || !driver->dev || !driver->bind)
1554 return -EINVAL;
1555
1556 if (!driver->name)
1557 driver->name = "composite";
1558
1559 driver->gadget_driver = composite_driver_template;
1560 gadget_driver = &driver->gadget_driver;
1561
1562 gadget_driver->function = (char *) driver->name;
1563 gadget_driver->driver.name = driver->name;
1564 gadget_driver->max_speed = driver->max_speed;
1565
1566 ready = usb_gadget_probe_driver_ready(gadget_driver);
1567 driver->name = NULL;
1568 return ready;
1569}
1570
1549/** 1571/**
1550 * usb_composite_probe() - register a composite driver 1572 * usb_composite_probe() - register a composite driver
1551 * @driver: the driver to register 1573 * @driver: the driver to register
diff --git a/drivers/usb/gadget/udc-core.c b/drivers/usb/gadget/udc-core.c
index 0b10575a2fa..a10ea8edc37 100644
--- a/drivers/usb/gadget/udc-core.c
+++ b/drivers/usb/gadget/udc-core.c
@@ -309,6 +309,27 @@ found:
309} 309}
310EXPORT_SYMBOL_GPL(usb_del_gadget_udc); 310EXPORT_SYMBOL_GPL(usb_del_gadget_udc);
311 311
312int usb_gadget_probe_driver_ready(struct usb_gadget_driver *driver)
313{
314 struct usb_udc *udc = NULL;
315
316 if (!driver || !driver->bind || !driver->setup)
317 return -EINVAL;
318
319 mutex_lock(&udc_lock);
320 list_for_each_entry(udc, &udc_list, list) {
321 /* For now we take the first one */
322 if (!udc->driver) {
323 mutex_unlock(&udc_lock);
324 return 0;
325 }
326 }
327
328 mutex_unlock(&udc_lock);
329 return -EPROBE_DEFER;
330}
331EXPORT_SYMBOL_GPL(usb_gadget_probe_driver_ready);
332
312/* ------------------------------------------------------------------------- */ 333/* ------------------------------------------------------------------------- */
313 334
314int usb_gadget_probe_driver(struct usb_gadget_driver *driver) 335int usb_gadget_probe_driver(struct usb_gadget_driver *driver)
@@ -351,10 +372,12 @@ found:
351 * on bind and expects the gadget to stay disconnected until 372 * on bind and expects the gadget to stay disconnected until
352 * it calls usb_gadget_connect when userspace is ready. Remove 373 * it calls usb_gadget_connect when userspace is ready. Remove
353 * the call to usb_gadget_connect bellow to avoid enabling the 374 * the call to usb_gadget_connect bellow to avoid enabling the
354 * pullup before userspace is ready. 375 * pullup before userspace is ready. Do the gadget connect in
355 * 376 * case of a non android system.
356 * usb_gadget_connect(udc->gadget);
357 */ 377 */
378#ifndef CONFIG_USB_G_ANDROID
379 usb_gadget_connect(udc->gadget);
380#endif
358 } else { 381 } else {
359 382
360 ret = usb_gadget_start(udc->gadget, driver, driver->bind); 383 ret = usb_gadget_start(udc->gadget, driver, driver->bind);
diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c
index 9215ae3da9d..6d9234242b7 100644
--- a/drivers/usb/musb/omap2430.c
+++ b/drivers/usb/musb/omap2430.c
@@ -38,6 +38,7 @@
38#include <linux/delay.h> 38#include <linux/delay.h>
39#include <linux/usb/musb-omap.h> 39#include <linux/usb/musb-omap.h>
40#include <linux/usb/omap_control_usb.h> 40#include <linux/usb/omap_control_usb.h>
41#include <linux/of_platform.h>
41 42
42#include "musb_core.h" 43#include "musb_core.h"
43#include "omap2430.h" 44#include "omap2430.h"
@@ -476,6 +477,9 @@ static int omap2430_probe(struct platform_device *pdev)
476 struct platform_device *musb; 477 struct platform_device *musb;
477 struct omap2430_glue *glue; 478 struct omap2430_glue *glue;
478 struct device_node *np = pdev->dev.of_node; 479 struct device_node *np = pdev->dev.of_node;
480 struct device_node *omap_control_usb_node;
481 struct platform_device *pdev_control_usb;
482
479 struct musb_hdrc_config *config; 483 struct musb_hdrc_config *config;
480 int ret = -ENOMEM; 484 int ret = -ENOMEM;
481 485
@@ -538,7 +542,19 @@ static int omap2430_probe(struct platform_device *pdev)
538 } 542 }
539 543
540 if (pdata->has_mailbox) { 544 if (pdata->has_mailbox) {
541 glue->control_otghs = omap_get_control_dev(); 545 omap_control_usb_node = of_parse_phandle(np, "ctrl-module", 0);
546 if (IS_ERR(omap_control_usb_node)) {
547 dev_err(&pdev->dev, "Failed to find ctrl-module\n");
548 return -EPROBE_DEFER;
549 }
550 pdev_control_usb = of_find_device_by_node(omap_control_usb_node);
551
552 if (IS_ERR(pdev_control_usb)) {
553 dev_err(&pdev->dev, "Failed to find device node for ctrl-module\n");
554 return -EPROBE_DEFER;
555 }
556
557 glue->control_otghs = &pdev_control_usb->dev;
542 if (IS_ERR(glue->control_otghs)) { 558 if (IS_ERR(glue->control_otghs)) {
543 dev_vdbg(&pdev->dev, "Failed to get control device\n"); 559 dev_vdbg(&pdev->dev, "Failed to get control device\n");
544 return -ENODEV; 560 return -ENODEV;
diff --git a/drivers/usb/otg/palmas-usb.c b/drivers/usb/otg/palmas-usb.c
index 0ecbd94b162..3881cd19821 100644
--- a/drivers/usb/otg/palmas-usb.c
+++ b/drivers/usb/otg/palmas-usb.c
@@ -106,6 +106,7 @@ static irqreturn_t palmas_vbus_wakeup_irq(int irq, void *_palmas_usb)
106 enum omap_dwc3_vbus_id_status status = OMAP_DWC3_UNKNOWN; 106 enum omap_dwc3_vbus_id_status status = OMAP_DWC3_UNKNOWN;
107 int slave; 107 int slave;
108 unsigned int vbus_line_state, addr; 108 unsigned int vbus_line_state, addr;
109 int ret = IRQ_NONE;
109 110
110 slave = PALMAS_BASE_TO_SLAVE(PALMAS_INTERRUPT_BASE); 111 slave = PALMAS_BASE_TO_SLAVE(PALMAS_INTERRUPT_BASE);
111 addr = PALMAS_BASE_TO_REG(PALMAS_INTERRUPT_BASE, 112 addr = PALMAS_BASE_TO_REG(PALMAS_INTERRUPT_BASE,
@@ -135,10 +136,12 @@ static irqreturn_t palmas_vbus_wakeup_irq(int irq, void *_palmas_usb)
135 136
136 palmas_usb->linkstat = status; 137 palmas_usb->linkstat = status;
137 if (status != OMAP_DWC3_UNKNOWN) { 138 if (status != OMAP_DWC3_UNKNOWN) {
138 return dwc3_omap_mailbox(status); 139 ret = dwc3_omap_mailbox(NULL, status);
140 if (!ret)
141 ret = IRQ_HANDLED;
139 } 142 }
140 143
141 return IRQ_NONE; 144 return ret;
142} 145}
143 146
144static irqreturn_t palmas_id_wakeup_irq(int irq, void *_palmas_usb) 147static irqreturn_t palmas_id_wakeup_irq(int irq, void *_palmas_usb)
@@ -146,6 +149,7 @@ static irqreturn_t palmas_id_wakeup_irq(int irq, void *_palmas_usb)
146 enum omap_dwc3_vbus_id_status status = OMAP_DWC3_UNKNOWN; 149 enum omap_dwc3_vbus_id_status status = OMAP_DWC3_UNKNOWN;
147 unsigned int set; 150 unsigned int set;
148 struct palmas_usb *palmas_usb = _palmas_usb; 151 struct palmas_usb *palmas_usb = _palmas_usb;
152 int ret = IRQ_NONE;
149 153
150 palmas_usb_read(palmas_usb->palmas, PALMAS_USB_ID_INT_LATCH_SET, &set); 154 palmas_usb_read(palmas_usb->palmas, PALMAS_USB_ID_INT_LATCH_SET, &set);
151 155
@@ -175,7 +179,9 @@ static irqreturn_t palmas_id_wakeup_irq(int irq, void *_palmas_usb)
175 179
176 palmas_usb->linkstat = status; 180 palmas_usb->linkstat = status;
177 if (status != OMAP_DWC3_UNKNOWN) { 181 if (status != OMAP_DWC3_UNKNOWN) {
178 return dwc3_omap_mailbox(status); 182 ret = dwc3_omap_mailbox(NULL, status);
183 if (!ret)
184 ret = IRQ_HANDLED;
179 } 185 }
180 186
181 return IRQ_NONE; 187 return IRQ_NONE;
diff --git a/drivers/usb/phy/omap-control-usb.c b/drivers/usb/phy/omap-control-usb.c
index 5323b71c352..3a605b01dd7 100644
--- a/drivers/usb/phy/omap-control-usb.c
+++ b/drivers/usb/phy/omap-control-usb.c
@@ -25,26 +25,6 @@
25#include <linux/clk.h> 25#include <linux/clk.h>
26#include <linux/usb/omap_control_usb.h> 26#include <linux/usb/omap_control_usb.h>
27 27
28static struct omap_control_usb *control_usb;
29
30/**
31 * omap_get_control_dev - returns the device pointer for this control device
32 *
33 * This API should be called to get the device pointer for this control
34 * module device. This device pointer should be used for called other
35 * exported API's in this driver.
36 *
37 * To be used by PHY driver and glue driver.
38 */
39struct device *omap_get_control_dev(void)
40{
41 if (!control_usb)
42 return ERR_PTR(-ENODEV);
43
44 return control_usb->dev;
45}
46EXPORT_SYMBOL_GPL(omap_get_control_dev);
47
48/** 28/**
49 * omap_control_usb3_phy_power - power on/off the serializer using control 29 * omap_control_usb3_phy_power - power on/off the serializer using control
50 * module 30 * module
@@ -93,14 +73,36 @@ void omap_control_usb_phy_power(struct device *dev, int on)
93 u32 val; 73 u32 val;
94 struct omap_control_usb *control_usb = dev_get_drvdata(dev); 74 struct omap_control_usb *control_usb = dev_get_drvdata(dev);
95 75
96 val = readl(control_usb->dev_conf); 76 if (control_usb->type == OMAP_CTRL_DEV_TYPE2) {
97 77
98 if (on) 78 val = readl(control_usb->dev_conf);
99 val &= ~OMAP_CTRL_DEV_PHY_PD; 79 if (on)
100 else 80 val &= ~OMAP_CTRL_DEV_PHY_PD;
101 val |= OMAP_CTRL_DEV_PHY_PD; 81 else
82 val |= OMAP_CTRL_DEV_PHY_PD;
102 83
103 writel(val, control_usb->dev_conf); 84 writel(val, control_usb->dev_conf);
85 } else {
86
87 if (on) {
88 val = readl(control_usb->dummy_reg);
89 val |= 0x100;
90 writel(val , control_usb->dummy_reg);
91
92 val = readl(control_usb->ctrl_core_srcomp_north_side);
93 val &= ~OMAP_CTRL_USB_SRCOMP_NORTH_SIDE_PD;
94 writel(val, control_usb->ctrl_core_srcomp_north_side);
95 } else {
96 val = readl(control_usb->ctrl_core_srcomp_north_side);
97 val |= OMAP_CTRL_USB_SRCOMP_NORTH_SIDE_PD;
98 writel(val, control_usb->ctrl_core_srcomp_north_side);
99
100 val = readl(control_usb->dummy_reg);
101 val &= ~0x100;
102 writel(val , control_usb->dummy_reg);
103 }
104
105 }
104} 106}
105EXPORT_SYMBOL_GPL(omap_control_usb_phy_power); 107EXPORT_SYMBOL_GPL(omap_control_usb_phy_power);
106 108
@@ -172,10 +174,12 @@ void omap_control_usb_set_mode(struct device *dev,
172{ 174{
173 struct omap_control_usb *ctrl_usb; 175 struct omap_control_usb *ctrl_usb;
174 176
175 if (IS_ERR(dev) || control_usb->type != OMAP_CTRL_DEV_TYPE1) 177 if (IS_ERR(dev))
176 return; 178 return;
177 179
178 ctrl_usb = dev_get_drvdata(dev); 180 ctrl_usb = dev_get_drvdata(dev);
181 if (ctrl_usb->type != OMAP_CTRL_DEV_TYPE1)
182 return;
179 183
180 switch (mode) { 184 switch (mode) {
181 case USB_MODE_HOST: 185 case USB_MODE_HOST:
@@ -198,6 +202,7 @@ static int omap_control_usb_probe(struct platform_device *pdev)
198 struct resource *res; 202 struct resource *res;
199 struct device_node *np = pdev->dev.of_node; 203 struct device_node *np = pdev->dev.of_node;
200 struct omap_control_usb_platform_data *pdata = pdev->dev.platform_data; 204 struct omap_control_usb_platform_data *pdata = pdev->dev.platform_data;
205 struct omap_control_usb *control_usb;
201 206
202 control_usb = devm_kzalloc(&pdev->dev, sizeof(*control_usb), 207 control_usb = devm_kzalloc(&pdev->dev, sizeof(*control_usb),
203 GFP_KERNEL); 208 GFP_KERNEL);
@@ -217,14 +222,6 @@ static int omap_control_usb_probe(struct platform_device *pdev)
217 222
218 control_usb->dev = &pdev->dev; 223 control_usb->dev = &pdev->dev;
219 224
220 res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
221 "control_dev_conf");
222 control_usb->dev_conf = devm_request_and_ioremap(&pdev->dev, res);
223 if (!control_usb->dev_conf) {
224 dev_err(&pdev->dev, "Failed to obtain io memory\n");
225 return -EADDRNOTAVAIL;
226 }
227
228 if (control_usb->type == OMAP_CTRL_DEV_TYPE1) { 225 if (control_usb->type == OMAP_CTRL_DEV_TYPE1) {
229 res = platform_get_resource_byname(pdev, IORESOURCE_MEM, 226 res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
230 "otghs_control"); 227 "otghs_control");
@@ -238,6 +235,14 @@ static int omap_control_usb_probe(struct platform_device *pdev)
238 235
239 if (control_usb->type == OMAP_CTRL_DEV_TYPE2) { 236 if (control_usb->type == OMAP_CTRL_DEV_TYPE2) {
240 res = platform_get_resource_byname(pdev, IORESOURCE_MEM, 237 res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
238 "control_dev_conf");
239 control_usb->dev_conf = devm_request_and_ioremap(&pdev->dev, res);
240 if (!control_usb->dev_conf) {
241 dev_err(&pdev->dev, "Failed to obtain io memory\n");
242 return -EADDRNOTAVAIL;
243 }
244
245 res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
241 "phy_power_usb"); 246 "phy_power_usb");
242 control_usb->phy_power = devm_request_and_ioremap( 247 control_usb->phy_power = devm_request_and_ioremap(
243 &pdev->dev, res); 248 &pdev->dev, res);
@@ -246,6 +251,32 @@ static int omap_control_usb_probe(struct platform_device *pdev)
246 return -EADDRNOTAVAIL; 251 return -EADDRNOTAVAIL;
247 } 252 }
248 253
254 }
255
256 if (control_usb->type == OMAP_CTRL_DEV_TYPE3) {
257 res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
258 "ctrl_core_srcomp_north_side");
259 control_usb->ctrl_core_srcomp_north_side =
260 devm_request_and_ioremap(&pdev->dev, res);
261 if (!control_usb->ctrl_core_srcomp_north_side) {
262 dev_err(&pdev->dev, "Failed to obtain io memory\n");
263 return -EADDRNOTAVAIL;
264 }
265
266 res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
267 "dummy_reg");
268 control_usb->dummy_reg = devm_request_and_ioremap(&pdev->dev, res);
269 if (!control_usb->dummy_reg) {
270 dev_err(&pdev->dev, "Failed to obtain io memory\n");
271 dev_err(&pdev->dev, "#RK: DUMMY not found \n");
272 return -EADDRNOTAVAIL;
273 }
274
275 }
276
277 if ((control_usb->type == OMAP_CTRL_DEV_TYPE2) ||
278 (control_usb->type == OMAP_CTRL_DEV_TYPE3)) {
279
249 control_usb->sys_clk = devm_clk_get(control_usb->dev, 280 control_usb->sys_clk = devm_clk_get(control_usb->dev,
250 "sys_clkin"); 281 "sys_clkin");
251 if (IS_ERR(control_usb->sys_clk)) { 282 if (IS_ERR(control_usb->sys_clk)) {
diff --git a/drivers/usb/phy/omap-usb2.c b/drivers/usb/phy/omap-usb2.c
index 844ab68f08d..f3f5afd2058 100644
--- a/drivers/usb/phy/omap-usb2.c
+++ b/drivers/usb/phy/omap-usb2.c
@@ -28,6 +28,7 @@
28#include <linux/pm_runtime.h> 28#include <linux/pm_runtime.h>
29#include <linux/delay.h> 29#include <linux/delay.h>
30#include <linux/usb/omap_control_usb.h> 30#include <linux/usb/omap_control_usb.h>
31#include <linux/of_platform.h>
31 32
32/** 33/**
33 * omap_usb2_set_comparator - links the comparator present in the sytem with 34 * omap_usb2_set_comparator - links the comparator present in the sytem with
@@ -123,6 +124,10 @@ static int omap_usb2_probe(struct platform_device *pdev)
123{ 124{
124 struct omap_usb *phy; 125 struct omap_usb *phy;
125 struct usb_otg *otg; 126 struct usb_otg *otg;
127 struct device_node *node = pdev->dev.of_node;
128 struct device_node *omap_control_usb_node;
129 struct platform_device *pdev_control_usb;
130 const char *clk_name;
126 131
127 phy = devm_kzalloc(&pdev->dev, sizeof(*phy), GFP_KERNEL); 132 phy = devm_kzalloc(&pdev->dev, sizeof(*phy), GFP_KERNEL);
128 if (!phy) { 133 if (!phy) {
@@ -143,13 +148,28 @@ static int omap_usb2_probe(struct platform_device *pdev)
143 phy->phy.set_suspend = omap_usb2_suspend; 148 phy->phy.set_suspend = omap_usb2_suspend;
144 phy->phy.otg = otg; 149 phy->phy.otg = otg;
145 phy->phy.type = USB_PHY_TYPE_USB2; 150 phy->phy.type = USB_PHY_TYPE_USB2;
151 omap_control_usb_node = of_parse_phandle(node, "ctrl-module", 0);
152
153 if (IS_ERR(omap_control_usb_node)) {
154 dev_err(&pdev->dev, "Failed to find ctrl-module\n");
155 return -EPROBE_DEFER;
156 }
157
158 pdev_control_usb = of_find_device_by_node(omap_control_usb_node);
159
160 if (IS_ERR(pdev_control_usb)) {
161 dev_dbg(&pdev->dev, "Attempt to get the platform control usb failed\n");
162 return -EPROBE_DEFER;
163 }
164 phy->control_dev = &pdev_control_usb->dev;
146 165
147 phy->control_dev = omap_get_control_dev();
148 if (IS_ERR(phy->control_dev)) { 166 if (IS_ERR(phy->control_dev)) {
149 dev_dbg(&pdev->dev, "Failed to get control device\n"); 167 dev_dbg(&pdev->dev, "Failed to get control device\n");
150 return -ENODEV; 168 return -ENODEV;
151 } 169 }
152 170 dev_dbg(&pdev->dev, "got control usb name %s\n",
171 dev_name(phy->control_dev));
172 phy->control_node = omap_control_usb_node;
153 phy->is_suspended = 1; 173 phy->is_suspended = 1;
154 omap_control_usb_phy_power(phy->control_dev, 0); 174 omap_control_usb_phy_power(phy->control_dev, 0);
155 175
@@ -159,18 +179,33 @@ static int omap_usb2_probe(struct platform_device *pdev)
159 otg->start_srp = omap_usb_start_srp; 179 otg->start_srp = omap_usb_start_srp;
160 otg->phy = &phy->phy; 180 otg->phy = &phy->phy;
161 181
162 phy->wkupclk = devm_clk_get(phy->dev, "usb_phy_cm_clk32k"); 182
163 if (IS_ERR(phy->wkupclk)) { 183 of_property_read_string(node, "wkupclk", &clk_name);
164 dev_err(&pdev->dev, "unable to get usb_phy_cm_clk32k\n"); 184 if (!clk_name) {
165 return PTR_ERR(phy->wkupclk); 185 dev_err(&pdev->dev, "unable to read wkupclk property from dt \n");
186 return -ENODEV;
187 } else {
188 phy->wkupclk = devm_clk_get(phy->dev, clk_name);
189 if (IS_ERR(phy->wkupclk)) {
190 dev_err(&pdev->dev, "unable to get usb_phy wk clk\n");
191 return PTR_ERR(phy->wkupclk);
192 }
166 } 193 }
194
167 clk_prepare(phy->wkupclk); 195 clk_prepare(phy->wkupclk);
168 196
169 phy->optclk = devm_clk_get(phy->dev, "usb_otg_ss_refclk960m"); 197 of_property_read_string(node, "optclk", &clk_name);
170 if (IS_ERR(phy->optclk)) 198 if (!clk_name)
171 dev_vdbg(&pdev->dev, "unable to get refclk960m\n"); 199 dev_err(&pdev->dev, "unable to read optclk property from dt\n");
172 else 200 else {
173 clk_prepare(phy->optclk); 201 phy->optclk = devm_clk_get(phy->dev, clk_name);
202 if (IS_ERR(phy->optclk)) {
203 dev_err(&pdev->dev, "unable to get usb_phy opt clk\n");
204 return PTR_ERR(phy->optclk);
205 }
206 else
207 clk_prepare(phy->optclk);
208 }
174 209
175 usb_add_phy_dev(&phy->phy); 210 usb_add_phy_dev(&phy->phy);
176 211
@@ -186,6 +221,7 @@ static int omap_usb2_remove(struct platform_device *pdev)
186 struct omap_usb *phy = platform_get_drvdata(pdev); 221 struct omap_usb *phy = platform_get_drvdata(pdev);
187 222
188 clk_unprepare(phy->wkupclk); 223 clk_unprepare(phy->wkupclk);
224 of_node_put(phy->control_node);
189 if (!IS_ERR(phy->optclk)) 225 if (!IS_ERR(phy->optclk))
190 clk_unprepare(phy->optclk); 226 clk_unprepare(phy->optclk);
191 usb_remove_phy(&phy->phy); 227 usb_remove_phy(&phy->phy);
diff --git a/drivers/usb/phy/omap-usb3.c b/drivers/usb/phy/omap-usb3.c
index 695c7c69646..3b533a5dfa5 100644
--- a/drivers/usb/phy/omap-usb3.c
+++ b/drivers/usb/phy/omap-usb3.c
@@ -26,6 +26,7 @@
26#include <linux/pm_runtime.h> 26#include <linux/pm_runtime.h>
27#include <linux/delay.h> 27#include <linux/delay.h>
28#include <linux/usb/omap_control_usb.h> 28#include <linux/usb/omap_control_usb.h>
29#include <linux/of_platform.h>
29 30
30#define NUM_SYS_CLKS 6 31#define NUM_SYS_CLKS 6
31#define PLL_STATUS 0x00000004 32#define PLL_STATUS 0x00000004
@@ -208,6 +209,10 @@ static int omap_usb3_probe(struct platform_device *pdev)
208{ 209{
209 struct omap_usb *phy; 210 struct omap_usb *phy;
210 struct resource *res; 211 struct resource *res;
212 struct device_node *node = pdev->dev.of_node;
213 struct device_node *omap_control_usb_node;
214 struct platform_device *pdev_control_usb;
215 const char *clk_name;
211 216
212 phy = devm_kzalloc(&pdev->dev, sizeof(*phy), GFP_KERNEL); 217 phy = devm_kzalloc(&pdev->dev, sizeof(*phy), GFP_KERNEL);
213 if (!phy) { 218 if (!phy) {
@@ -223,27 +228,40 @@ static int omap_usb3_probe(struct platform_device *pdev)
223 } 228 }
224 229
225 phy->dev = &pdev->dev; 230 phy->dev = &pdev->dev;
226
227 phy->phy.dev = phy->dev; 231 phy->phy.dev = phy->dev;
228 phy->phy.label = "omap-usb3"; 232 phy->phy.label = "omap-usb3";
229 phy->phy.init = omap_usb3_init; 233 phy->phy.init = omap_usb3_init;
230 phy->phy.set_suspend = omap_usb3_suspend; 234 phy->phy.set_suspend = omap_usb3_suspend;
231 phy->phy.type = USB_PHY_TYPE_USB3; 235 phy->phy.type = USB_PHY_TYPE_USB3;
232
233 phy->is_suspended = 1; 236 phy->is_suspended = 1;
234 phy->wkupclk = devm_clk_get(phy->dev, "usb_phy_cm_clk32k"); 237
235 if (IS_ERR(phy->wkupclk)) { 238 of_property_read_string(node, "wkupclk", &clk_name);
236 dev_err(&pdev->dev, "unable to get usb_phy_cm_clk32k\n"); 239 if (!clk_name) {
237 return PTR_ERR(phy->wkupclk); 240 dev_err(&pdev->dev, "unable to read wkupclk property from dt \n");
241 return -EINVAL;
242 } else {
243 phy->wkupclk = devm_clk_get(phy->dev, clk_name);
244 if (IS_ERR(phy->wkupclk)) {
245 dev_err(&pdev->dev, "unable to get usb_phy wk clk\n");
246 return PTR_ERR(phy->wkupclk);
247 }
238 } 248 }
249
239 clk_prepare(phy->wkupclk); 250 clk_prepare(phy->wkupclk);
240 251
241 phy->optclk = devm_clk_get(phy->dev, "usb_otg_ss_refclk960m"); 252 of_property_read_string(node, "optclk", &clk_name);
242 if (IS_ERR(phy->optclk)) { 253 if (!clk_name)
243 dev_err(&pdev->dev, "unable to get usb_otg_ss_refclk960m\n"); 254 dev_err(&pdev->dev, "unable to read optclk property from dt\n");
244 return PTR_ERR(phy->optclk); 255 else {
256 phy->optclk = devm_clk_get(phy->dev, clk_name);
257 if (IS_ERR(phy->optclk)) {
258 dev_err(&pdev->dev, "unable to get usb_phy opt clk\n");
259 return PTR_ERR(phy->optclk);
260 }
261 else
262 clk_prepare(phy->optclk);
245 } 263 }
246 clk_prepare(phy->optclk); 264
247 265
248 phy->sys_clk = devm_clk_get(phy->dev, "sys_clkin"); 266 phy->sys_clk = devm_clk_get(phy->dev, "sys_clkin");
249 if (IS_ERR(phy->sys_clk)) { 267 if (IS_ERR(phy->sys_clk)) {
@@ -251,12 +269,28 @@ static int omap_usb3_probe(struct platform_device *pdev)
251 return -EINVAL; 269 return -EINVAL;
252 } 270 }
253 271
254 phy->control_dev = omap_get_control_dev(); 272 omap_control_usb_node = of_parse_phandle(node, "ctrl-module", 0);
273 if (IS_ERR(omap_control_usb_node)) {
274 dev_err(&pdev->dev, "Failed to find ctrl-module\n");
275 return -EPROBE_DEFER;
276 }
277
278 pdev_control_usb = of_find_device_by_node(omap_control_usb_node);
279 if (IS_ERR(pdev_control_usb)) {
280 dev_dbg(&pdev->dev, "Attempt to get the platform control usb failed\n");
281 return -EPROBE_DEFER;
282 }
283
284 phy->control_dev = &pdev_control_usb->dev;
255 if (IS_ERR(phy->control_dev)) { 285 if (IS_ERR(phy->control_dev)) {
256 dev_dbg(&pdev->dev, "Failed to get control device\n"); 286 dev_dbg(&pdev->dev, "Failed to get control device\n");
257 return -ENODEV; 287 return -ENODEV;
258 } 288 }
259 289
290 dev_dbg(&pdev->dev, "got control usb name %s\n",
291 dev_name(phy->control_dev));
292 phy->control_node = omap_control_usb_node;
293
260 omap_control_usb3_phy_power(phy->control_dev, 0); 294 omap_control_usb3_phy_power(phy->control_dev, 0);
261 usb_add_phy_dev(&phy->phy); 295 usb_add_phy_dev(&phy->phy);
262 296
@@ -274,6 +308,7 @@ static int omap_usb3_remove(struct platform_device *pdev)
274 308
275 clk_unprepare(phy->wkupclk); 309 clk_unprepare(phy->wkupclk);
276 clk_unprepare(phy->optclk); 310 clk_unprepare(phy->optclk);
311 of_node_put(phy->control_node);
277 usb_remove_phy(&phy->phy); 312 usb_remove_phy(&phy->phy);
278 if (!pm_runtime_suspended(&pdev->dev)) 313 if (!pm_runtime_suspended(&pdev->dev))
279 pm_runtime_put(&pdev->dev); 314 pm_runtime_put(&pdev->dev);
diff --git a/drivers/video/omap2/dss/ti_hdmi_5xxx_ip.c b/drivers/video/omap2/dss/ti_hdmi_5xxx_ip.c
index 232d708df0e..c77d865b1f9 100644
--- a/drivers/video/omap2/dss/ti_hdmi_5xxx_ip.c
+++ b/drivers/video/omap2/dss/ti_hdmi_5xxx_ip.c
@@ -898,10 +898,15 @@ static void ti_hdmi_5xxx_core_audio_config(struct hdmi_ip_data *ip_data,
898 REG_FLD_MOD(core_sys_base, HDMI_CORE_AUD_CONF0, 0, 5, 5); 898 REG_FLD_MOD(core_sys_base, HDMI_CORE_AUD_CONF0, 0, 5, 5);
899 /* enable two channels in GPA */ 899 /* enable two channels in GPA */
900 REG_FLD_MOD(core_sys_base, HDMI_CORE_AUD_GP_CONF1, 3, 7, 0); 900 REG_FLD_MOD(core_sys_base, HDMI_CORE_AUD_GP_CONF1, 3, 7, 0);
901 } else if (cfg->layout == HDMI_AUDIO_LAYOUT_6CH) {
902 /* select HBR/SPDIF interfaces */
903 REG_FLD_MOD(core_sys_base, HDMI_CORE_AUD_CONF0, 0, 5, 5);
904 /* enable six channels in GPA */
905 REG_FLD_MOD(core_sys_base, HDMI_CORE_AUD_GP_CONF1, 0x3F, 7, 0);
901 } else { 906 } else {
902 /* select HBR/SPDIF interfaces */ 907 /* select HBR/SPDIF interfaces */
903 REG_FLD_MOD(core_sys_base, HDMI_CORE_AUD_CONF0, 0, 5, 5); 908 REG_FLD_MOD(core_sys_base, HDMI_CORE_AUD_CONF0, 0, 5, 5);
904 /* enable two channels in GPA */ 909 /* enable eight channels in GPA */
905 REG_FLD_MOD(core_sys_base, HDMI_CORE_AUD_GP_CONF1, 0xFF, 7, 0); 910 REG_FLD_MOD(core_sys_base, HDMI_CORE_AUD_GP_CONF1, 0xFF, 7, 0);
906 } 911 }
907 912
@@ -924,8 +929,10 @@ static void ti_hdmi_5xxx_core_audio_infoframe_cfg
924{ 929{
925 void __iomem *core_sys_base = hdmi_core_sys_base(ip_data); 930 void __iomem *core_sys_base = hdmi_core_sys_base(ip_data);
926 931
932 /* Channel count and coding type fields in AUDICONF0 are swapped */
927 hdmi_write_reg(core_sys_base, HDMI_CORE_FC_AUDICONF0, 933 hdmi_write_reg(core_sys_base, HDMI_CORE_FC_AUDICONF0,
928 info_aud->db1_ct_cc); 934 (info_aud->db1_ct_cc & CEA861_AUDIO_INFOFRAME_DB1CC)<<4 |
935 (info_aud->db1_ct_cc & CEA861_AUDIO_INFOFRAME_DB1CT)>>4);
929 936
930 hdmi_write_reg(core_sys_base, HDMI_CORE_FC_AUDICONF1, 937 hdmi_write_reg(core_sys_base, HDMI_CORE_FC_AUDICONF1,
931 info_aud->db2_sf_ss); 938 info_aud->db2_sf_ss);
diff --git a/drivers/video/omap2/dsscomp/Kconfig b/drivers/video/omap2/dsscomp/Kconfig
index 38660fb6cc5..8236f9d2d0c 100644
--- a/drivers/video/omap2/dsscomp/Kconfig
+++ b/drivers/video/omap2/dsscomp/Kconfig
@@ -1,6 +1,6 @@
1menuconfig DSSCOMP 1menuconfig DSSCOMP
2 tristate "OMAP DSS Composition support (EXPERIMENTAL)" 2 tristate "OMAP DSS Composition support (EXPERIMENTAL)"
3 depends on EXPERIMENTAL && OMAP2_DSS && DRM_OMAP_DMM_TILER 3 depends on EXPERIMENTAL && OMAP2_DSS && DRM_OMAP_DMM_TILER && ION_OMAP
4 default y 4 default y
5 5
6 help 6 help
diff --git a/drivers/video/omap2/omapfb/Kconfig b/drivers/video/omap2/omapfb/Kconfig
index 17cbb3f03e4..e612028980a 100644
--- a/drivers/video/omap2/omapfb/Kconfig
+++ b/drivers/video/omap2/omapfb/Kconfig
@@ -1,6 +1,6 @@
1menuconfig FB_OMAP2 1menuconfig FB_OMAP2
2 tristate "OMAP2+ frame buffer support" 2 tristate "OMAP2+ frame buffer support"
3 depends on FB && OMAP2_DSS && !DRM_OMAP_DISPLAY 3 depends on FB && OMAP2_DSS
4 4
5 select OMAP2_VRFB if ARCH_OMAP2 || ARCH_OMAP3 5 select OMAP2_VRFB if ARCH_OMAP2 || ARCH_OMAP3
6 select FB_CFB_FILLRECT 6 select FB_CFB_FILLRECT
diff --git a/include/linux/platform_data/davinci_asp.h b/include/linux/platform_data/davinci_asp.h
index 8db5ae03b6e..416c1d2abe6 100644
--- a/include/linux/platform_data/davinci_asp.h
+++ b/include/linux/platform_data/davinci_asp.h
@@ -84,12 +84,15 @@ struct snd_platform_data {
84 u8 version; 84 u8 version;
85 u8 txnumevt; 85 u8 txnumevt;
86 u8 rxnumevt; 86 u8 rxnumevt;
87 u32 tx_dismod;
88 u32 rx_dismod;
87}; 89};
88 90
89enum { 91enum {
90 MCASP_VERSION_1 = 0, /* DM646x */ 92 MCASP_VERSION_1 = 0, /* DM646x */
91 MCASP_VERSION_2, /* DA8xx/OMAPL1x */ 93 MCASP_VERSION_2, /* DA8xx/OMAPL1x */
92 MCASP_VERSION_3, /* TI81xx/AM33xx */ 94 MCASP_VERSION_3, /* TI81xx/AM33xx */
95 MCASP_VERSION_4, /* DRA7xxx */
93}; 96};
94 97
95enum mcbsp_clk_input_pin { 98enum mcbsp_clk_input_pin {
diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h
index 7bc732ce6e5..8f3063f458d 100644
--- a/include/linux/regulator/consumer.h
+++ b/include/linux/regulator/consumer.h
@@ -368,8 +368,11 @@ static inline int regulator_count_voltages(struct regulator *regulator)
368static inline int regulator_set_voltage_tol(struct regulator *regulator, 368static inline int regulator_set_voltage_tol(struct regulator *regulator,
369 int new_uV, int tol_uV) 369 int new_uV, int tol_uV)
370{ 370{
371 return regulator_set_voltage(regulator, 371 if (regulator_set_voltage(regulator, new_uV, new_uV + tol_uV) == 0)
372 new_uV - tol_uV, new_uV + tol_uV); 372 return 0;
373 else
374 return regulator_set_voltage(regulator,
375 new_uV - tol_uV, new_uV + tol_uV);
373} 376}
374 377
375static inline int regulator_is_supported_voltage_tol(struct regulator *regulator, 378static inline int regulator_is_supported_voltage_tol(struct regulator *regulator,
diff --git a/include/linux/usb/composite.h b/include/linux/usb/composite.h
index b09c37e04a9..8e863b3e802 100644
--- a/include/linux/usb/composite.h
+++ b/include/linux/usb/composite.h
@@ -313,6 +313,7 @@ struct usb_composite_driver {
313 struct usb_gadget_driver gadget_driver; 313 struct usb_gadget_driver gadget_driver;
314}; 314};
315 315
316extern int usb_composite_probe_ready(struct usb_composite_driver *driver);
316extern int usb_composite_probe(struct usb_composite_driver *driver); 317extern int usb_composite_probe(struct usb_composite_driver *driver);
317extern void usb_composite_unregister(struct usb_composite_driver *driver); 318extern void usb_composite_unregister(struct usb_composite_driver *driver);
318extern void usb_composite_setup_continue(struct usb_composite_dev *cdev); 319extern void usb_composite_setup_continue(struct usb_composite_dev *cdev);
diff --git a/include/linux/usb/dwc3-omap.h b/include/linux/usb/dwc3-omap.h
index 5615f4d8272..64c78a56d4b 100644
--- a/include/linux/usb/dwc3-omap.h
+++ b/include/linux/usb/dwc3-omap.h
@@ -19,9 +19,9 @@ enum omap_dwc3_vbus_id_status {
19}; 19};
20 20
21#if (defined(CONFIG_USB_DWC3) || defined(CONFIG_USB_DWC3_MODULE)) 21#if (defined(CONFIG_USB_DWC3) || defined(CONFIG_USB_DWC3_MODULE))
22extern int dwc3_omap_mailbox(enum omap_dwc3_vbus_id_status status); 22extern int dwc3_omap_mailbox(struct device *dev, enum omap_dwc3_vbus_id_status status);
23#else 23#else
24static inline int dwc3_omap_mailbox(enum omap_dwc3_vbus_id_status status) 24static inline int dwc3_omap_mailbox(struct device *dev, enum omap_dwc3_vbus_id_status status)
25{ 25{
26 return -ENODEV; 26 return -ENODEV;
27} 27}
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
index 0af6569b8cc..29ae631d8a9 100644
--- a/include/linux/usb/gadget.h
+++ b/include/linux/usb/gadget.h
@@ -880,6 +880,8 @@ int usb_gadget_unregister_driver(struct usb_gadget_driver *driver);
880 880
881extern int usb_add_gadget_udc(struct device *parent, struct usb_gadget *gadget); 881extern int usb_add_gadget_udc(struct device *parent, struct usb_gadget *gadget);
882extern void usb_del_gadget_udc(struct usb_gadget *gadget); 882extern void usb_del_gadget_udc(struct usb_gadget *gadget);
883extern int usb_gadget_probe_driver_ready(struct usb_gadget_driver *driver);
884
883 885
884/*-------------------------------------------------------------------------*/ 886/*-------------------------------------------------------------------------*/
885 887
diff --git a/include/linux/usb/omap_control_usb.h b/include/linux/usb/omap_control_usb.h
index 27b5b8c931b..8574dd8a279 100644
--- a/include/linux/usb/omap_control_usb.h
+++ b/include/linux/usb/omap_control_usb.h
@@ -25,6 +25,8 @@ struct omap_control_usb {
25 u32 __iomem *dev_conf; 25 u32 __iomem *dev_conf;
26 u32 __iomem *otghs_control; 26 u32 __iomem *otghs_control;
27 u32 __iomem *phy_power; 27 u32 __iomem *phy_power;
28 u32 __iomem *ctrl_core_srcomp_north_side;
29 u32 __iomem *dummy_reg;
28 30
29 struct clk *sys_clk; 31 struct clk *sys_clk;
30 32
@@ -43,8 +45,9 @@ enum omap_control_usb_mode {
43}; 45};
44 46
45/* To differentiate ctrl module IP having either mailbox or USB3 PHY power */ 47/* To differentiate ctrl module IP having either mailbox or USB3 PHY power */
46#define OMAP_CTRL_DEV_TYPE1 0x1 48#define OMAP_CTRL_DEV_TYPE1 0x1 /* mailbox */
47#define OMAP_CTRL_DEV_TYPE2 0x2 49#define OMAP_CTRL_DEV_TYPE2 0x2 /* has a usb2 and usb3 phy */
50#define OMAP_CTRL_DEV_TYPE3 0x3 /* has only a usb2 phy */
48 51
49#define OMAP_CTRL_DEV_PHY_PD BIT(0) 52#define OMAP_CTRL_DEV_PHY_PD BIT(0)
50 53
@@ -63,6 +66,8 @@ enum omap_control_usb_mode {
63#define OMAP_CTRL_USB3_PHY_TX_RX_POWERON 0x3 66#define OMAP_CTRL_USB3_PHY_TX_RX_POWERON 0x3
64#define OMAP_CTRL_USB3_PHY_TX_RX_POWEROFF 0x0 67#define OMAP_CTRL_USB3_PHY_TX_RX_POWEROFF 0x0
65 68
69#define OMAP_CTRL_USB_SRCOMP_NORTH_SIDE_PD BIT(28)
70
66#if IS_ENABLED(CONFIG_OMAP_CONTROL_USB) 71#if IS_ENABLED(CONFIG_OMAP_CONTROL_USB)
67extern struct device *omap_get_control_dev(void); 72extern struct device *omap_get_control_dev(void);
68extern void omap_control_usb_phy_power(struct device *dev, int on); 73extern void omap_control_usb_phy_power(struct device *dev, int on);
diff --git a/include/linux/usb/omap_usb.h b/include/linux/usb/omap_usb.h
index 6ae29360e1d..f53932389f8 100644
--- a/include/linux/usb/omap_usb.h
+++ b/include/linux/usb/omap_usb.h
@@ -40,6 +40,7 @@ struct omap_usb {
40 struct clk *sys_clk; 40 struct clk *sys_clk;
41 struct clk *optclk; 41 struct clk *optclk;
42 u8 is_suspended:1; 42 u8 is_suspended:1;
43 struct device_node *control_node;
43}; 44};
44 45
45#define phy_to_omapusb(x) container_of((x), struct omap_usb, phy) 46#define phy_to_omapusb(x) container_of((x), struct omap_usb, phy)
diff --git a/sound/soc/davinci/davinci-mcasp.c b/sound/soc/davinci/davinci-mcasp.c
index 7ba62e99087..ef30dbdd7ae 100644
--- a/sound/soc/davinci/davinci-mcasp.c
+++ b/sound/soc/davinci/davinci-mcasp.c
@@ -25,6 +25,7 @@
25#include <linux/of.h> 25#include <linux/of.h>
26#include <linux/of_platform.h> 26#include <linux/of_platform.h>
27#include <linux/of_device.h> 27#include <linux/of_device.h>
28#include <linux/lcm.h>
28 29
29#include <sound/core.h> 30#include <sound/core.h>
30#include <sound/pcm.h> 31#include <sound/pcm.h>
@@ -34,6 +35,7 @@
34 35
35#include "davinci-pcm.h" 36#include "davinci-pcm.h"
36#include "davinci-mcasp.h" 37#include "davinci-mcasp.h"
38#include "../omap/omap-pcm.h"
37 39
38/* 40/*
39 * McASP register definitions 41 * McASP register definitions
@@ -104,7 +106,7 @@
104/* Transmit Buffer for Serializer n */ 106/* Transmit Buffer for Serializer n */
105#define DAVINCI_MCASP_TXBUF_REG 0x200 107#define DAVINCI_MCASP_TXBUF_REG 0x200
106/* Receive Buffer for Serializer n */ 108/* Receive Buffer for Serializer n */
107#define DAVINCI_MCASP_RXBUF_REG 0x280 109#define DAVINCI_MCASP_RXBUF_REG 0x284
108 110
109/* McASP FIFO Registers */ 111/* McASP FIFO Registers */
110#define DAVINCI_MCASP_WFIFOCTL (0x1010) 112#define DAVINCI_MCASP_WFIFOCTL (0x1010)
@@ -232,7 +234,7 @@
232 * DAVINCI_MCASP_XRSRCTL_BASE_REG - Serializer Control Register Bits 234 * DAVINCI_MCASP_XRSRCTL_BASE_REG - Serializer Control Register Bits
233 */ 235 */
234#define MODE(val) (val) 236#define MODE(val) (val)
235#define DISMOD (val)(val<<2) 237#define DISMOD(val) (val << 2)
236#define TXSTATE BIT(4) 238#define TXSTATE BIT(4)
237#define RXSTATE BIT(5) 239#define RXSTATE BIT(5)
238#define SRMOD_MASK 3 240#define SRMOD_MASK 3
@@ -304,6 +306,12 @@
304 306
305#define DAVINCI_MCASP_NUM_SERIALIZER 16 307#define DAVINCI_MCASP_NUM_SERIALIZER 16
306 308
309/*
310 * Timeout value of 1 ms was chosen experimentally to account for the initial
311 * latency to have the first audio sample transferred to AFIFO by DMA
312 */
313#define MCASP_FIFO_FILL_TIMEOUT 1000
314
307static inline void mcasp_set_bits(void __iomem *reg, u32 val) 315static inline void mcasp_set_bits(void __iomem *reg, u32 val)
308{ 316{
309 __raw_writel(__raw_readl(reg) | val, reg); 317 __raw_writel(__raw_readl(reg) | val, reg);
@@ -348,8 +356,24 @@ static inline void mcasp_set_ctl_reg(void __iomem *regs, u32 val)
348 356
349static void mcasp_start_rx(struct davinci_audio_dev *dev) 357static void mcasp_start_rx(struct davinci_audio_dev *dev)
350{ 358{
359 u32 rxfmctl = mcasp_get_reg(dev->base + DAVINCI_MCASP_RXFMCTL_REG);
360
351 mcasp_set_ctl_reg(dev->base + DAVINCI_MCASP_GBLCTLR_REG, RXHCLKRST); 361 mcasp_set_ctl_reg(dev->base + DAVINCI_MCASP_GBLCTLR_REG, RXHCLKRST);
352 mcasp_set_ctl_reg(dev->base + DAVINCI_MCASP_GBLCTLR_REG, RXCLKRST); 362 mcasp_set_ctl_reg(dev->base + DAVINCI_MCASP_GBLCTLR_REG, RXCLKRST);
363
364 /*
365 * Enable TX FSG when McASP is in sync mode and is master since the
366 * TX section provides FSYNC for RX too. TX clk dividers are also
367 * enabled for cases where ACLKR pin is not connected (typically
368 * done when AFSR is not used either)
369 */
370 if (rxfmctl & AFSRE) {
371 mcasp_set_ctl_reg(dev->base + DAVINCI_MCASP_GBLCTLX_REG,
372 TXHCLKRST);
373 mcasp_set_ctl_reg(dev->base + DAVINCI_MCASP_GBLCTLX_REG,
374 TXCLKRST);
375 }
376
353 mcasp_set_ctl_reg(dev->base + DAVINCI_MCASP_GBLCTLR_REG, RXSERCLR); 377 mcasp_set_ctl_reg(dev->base + DAVINCI_MCASP_GBLCTLR_REG, RXSERCLR);
354 mcasp_set_reg(dev->base + DAVINCI_MCASP_RXBUF_REG, 0); 378 mcasp_set_reg(dev->base + DAVINCI_MCASP_RXBUF_REG, 0);
355 379
@@ -359,6 +383,10 @@ static void mcasp_start_rx(struct davinci_audio_dev *dev)
359 383
360 mcasp_set_ctl_reg(dev->base + DAVINCI_MCASP_GBLCTLR_REG, RXSMRST); 384 mcasp_set_ctl_reg(dev->base + DAVINCI_MCASP_GBLCTLR_REG, RXSMRST);
361 mcasp_set_ctl_reg(dev->base + DAVINCI_MCASP_GBLCTLR_REG, RXFSRST); 385 mcasp_set_ctl_reg(dev->base + DAVINCI_MCASP_GBLCTLR_REG, RXFSRST);
386
387 if (rxfmctl & AFSRE)
388 mcasp_set_ctl_reg(dev->base + DAVINCI_MCASP_GBLCTLX_REG,
389 TXFSRST);
362} 390}
363 391
364static void mcasp_start_tx(struct davinci_audio_dev *dev) 392static void mcasp_start_tx(struct davinci_audio_dev *dev)
@@ -390,12 +418,16 @@ static void mcasp_start_tx(struct davinci_audio_dev *dev)
390 mcasp_set_reg(dev->base + DAVINCI_MCASP_TXBUF_REG, 0); 418 mcasp_set_reg(dev->base + DAVINCI_MCASP_TXBUF_REG, 0);
391} 419}
392 420
393static void davinci_mcasp_start(struct davinci_audio_dev *dev, int stream) 421static int davinci_mcasp_start(struct davinci_audio_dev *dev, int stream)
394{ 422{
423 int i = 0;
424 u32 val;
425
395 if (stream == SNDRV_PCM_STREAM_PLAYBACK) { 426 if (stream == SNDRV_PCM_STREAM_PLAYBACK) {
396 if (dev->txnumevt) { /* enable FIFO */ 427 if (dev->txnumevt) { /* enable FIFO */
397 switch (dev->version) { 428 switch (dev->version) {
398 case MCASP_VERSION_3: 429 case MCASP_VERSION_3:
430 case MCASP_VERSION_4:
399 mcasp_clr_bits(dev->base + MCASP_VER3_WFIFOCTL, 431 mcasp_clr_bits(dev->base + MCASP_VER3_WFIFOCTL,
400 FIFO_ENABLE); 432 FIFO_ENABLE);
401 mcasp_set_bits(dev->base + MCASP_VER3_WFIFOCTL, 433 mcasp_set_bits(dev->base + MCASP_VER3_WFIFOCTL,
@@ -407,12 +439,31 @@ static void davinci_mcasp_start(struct davinci_audio_dev *dev, int stream)
407 mcasp_set_bits(dev->base + 439 mcasp_set_bits(dev->base +
408 DAVINCI_MCASP_WFIFOCTL, FIFO_ENABLE); 440 DAVINCI_MCASP_WFIFOCTL, FIFO_ENABLE);
409 } 441 }
442
443 /*
444 * Wait until DMA has loaded at least one sample into
445 * AFIFO to ensure XRUN is not immediately hit
446 * Implementation has to use udelay since it's executed
447 * in atomic context (trigger() callback)
448 */
449 while (++i) {
450 val = mcasp_get_reg(dev->base +
451 MCASP_VER3_WFIFOSTS);
452 if (val > 0)
453 break;
454
455 if (i > MCASP_FIFO_FILL_TIMEOUT)
456 return -ETIMEDOUT;
457
458 udelay(1);
459 }
410 } 460 }
411 mcasp_start_tx(dev); 461 mcasp_start_tx(dev);
412 } else { 462 } else {
413 if (dev->rxnumevt) { /* enable FIFO */ 463 if (dev->rxnumevt) { /* enable FIFO */
414 switch (dev->version) { 464 switch (dev->version) {
415 case MCASP_VERSION_3: 465 case MCASP_VERSION_3:
466 case MCASP_VERSION_4:
416 mcasp_clr_bits(dev->base + MCASP_VER3_RFIFOCTL, 467 mcasp_clr_bits(dev->base + MCASP_VER3_RFIFOCTL,
417 FIFO_ENABLE); 468 FIFO_ENABLE);
418 mcasp_set_bits(dev->base + MCASP_VER3_RFIFOCTL, 469 mcasp_set_bits(dev->base + MCASP_VER3_RFIFOCTL,
@@ -427,17 +478,34 @@ static void davinci_mcasp_start(struct davinci_audio_dev *dev, int stream)
427 } 478 }
428 mcasp_start_rx(dev); 479 mcasp_start_rx(dev);
429 } 480 }
481
482 return 0;
430} 483}
431 484
432static void mcasp_stop_rx(struct davinci_audio_dev *dev) 485static void mcasp_stop_rx(struct davinci_audio_dev *dev)
433{ 486{
487 u32 gblctl = mcasp_get_reg(dev->base + DAVINCI_MCASP_GBLCTLX_REG);
488 u32 rxfmctl = mcasp_get_reg(dev->base + DAVINCI_MCASP_RXFMCTL_REG);
489
490 /* Disable TX FSG if RX was the only active user */
491 if ((rxfmctl & AFSRE) && !(gblctl & TXSMRST))
492 mcasp_set_reg(dev->base + DAVINCI_MCASP_GBLCTLX_REG, 0);
493
434 mcasp_set_reg(dev->base + DAVINCI_MCASP_GBLCTLR_REG, 0); 494 mcasp_set_reg(dev->base + DAVINCI_MCASP_GBLCTLR_REG, 0);
435 mcasp_set_reg(dev->base + DAVINCI_MCASP_RXSTAT_REG, 0xFFFFFFFF); 495 mcasp_set_reg(dev->base + DAVINCI_MCASP_RXSTAT_REG, 0xFFFFFFFF);
436} 496}
437 497
438static void mcasp_stop_tx(struct davinci_audio_dev *dev) 498static void mcasp_stop_tx(struct davinci_audio_dev *dev)
439{ 499{
440 mcasp_set_reg(dev->base + DAVINCI_MCASP_GBLCTLX_REG, 0); 500 u32 gblctl = mcasp_get_reg(dev->base + DAVINCI_MCASP_GBLCTLR_REG);
501 u32 rxfmctl = mcasp_get_reg(dev->base + DAVINCI_MCASP_RXFMCTL_REG);
502 u32 val = 0;
503
504 /* Keep FSG active until RX section is stopped too */
505 if ((rxfmctl & AFSRE) && (gblctl & RXSMRST))
506 val = TXHCLKRST | TXCLKRST | TXFSRST;
507
508 mcasp_set_reg(dev->base + DAVINCI_MCASP_GBLCTLX_REG, val);
441 mcasp_set_reg(dev->base + DAVINCI_MCASP_TXSTAT_REG, 0xFFFFFFFF); 509 mcasp_set_reg(dev->base + DAVINCI_MCASP_TXSTAT_REG, 0xFFFFFFFF);
442} 510}
443 511
@@ -447,6 +515,7 @@ static void davinci_mcasp_stop(struct davinci_audio_dev *dev, int stream)
447 if (dev->txnumevt) { /* disable FIFO */ 515 if (dev->txnumevt) { /* disable FIFO */
448 switch (dev->version) { 516 switch (dev->version) {
449 case MCASP_VERSION_3: 517 case MCASP_VERSION_3:
518 case MCASP_VERSION_4:
450 mcasp_clr_bits(dev->base + MCASP_VER3_WFIFOCTL, 519 mcasp_clr_bits(dev->base + MCASP_VER3_WFIFOCTL,
451 FIFO_ENABLE); 520 FIFO_ENABLE);
452 break; 521 break;
@@ -460,6 +529,7 @@ static void davinci_mcasp_stop(struct davinci_audio_dev *dev, int stream)
460 if (dev->rxnumevt) { /* disable FIFO */ 529 if (dev->rxnumevt) { /* disable FIFO */
461 switch (dev->version) { 530 switch (dev->version) {
462 case MCASP_VERSION_3: 531 case MCASP_VERSION_3:
532 case MCASP_VERSION_4:
463 mcasp_clr_bits(dev->base + MCASP_VER3_RFIFOCTL, 533 mcasp_clr_bits(dev->base + MCASP_VER3_RFIFOCTL,
464 FIFO_ENABLE); 534 FIFO_ENABLE);
465 break; 535 break;
@@ -632,8 +702,9 @@ static int davinci_config_channel_size(struct davinci_audio_dev *dev,
632{ 702{
633 u32 fmt; 703 u32 fmt;
634 u32 tx_rotate = (word_length / 4) & 0x7; 704 u32 tx_rotate = (word_length / 4) & 0x7;
635 u32 rx_rotate = (32 - word_length) / 4; 705 u32 rx_rotate;
636 u32 mask = (1ULL << word_length) - 1; 706 u32 mask = (1ULL << word_length) - 1;
707 u32 slot_length;
637 708
638 /* 709 /*
639 * if s BCLK-to-LRCLK ratio has been configured via the set_clkdiv() 710 * if s BCLK-to-LRCLK ratio has been configured via the set_clkdiv()
@@ -645,10 +716,14 @@ static int davinci_config_channel_size(struct davinci_audio_dev *dev,
645 * tdm-slots (for I2S - divided by 2). 716 * tdm-slots (for I2S - divided by 2).
646 */ 717 */
647 if (dev->bclk_lrclk_ratio) 718 if (dev->bclk_lrclk_ratio)
648 word_length = dev->bclk_lrclk_ratio / dev->tdm_slots; 719 slot_length = dev->bclk_lrclk_ratio / dev->tdm_slots;
720 else
721 slot_length = word_length;
649 722
650 /* mapping of the XSSZ bit-field as described in the datasheet */ 723 /* mapping of the XSSZ bit-field as described in the datasheet */
651 fmt = (word_length >> 1) - 1; 724 fmt = (slot_length >> 1) - 1;
725
726 rx_rotate = (slot_length - word_length) / 4;
652 727
653 if (dev->op_mode != DAVINCI_MCASP_DIT_MODE) { 728 if (dev->op_mode != DAVINCI_MCASP_DIT_MODE) {
654 mcasp_mod_bits(dev->base + DAVINCI_MCASP_RXFMT_REG, 729 mcasp_mod_bits(dev->base + DAVINCI_MCASP_RXFMT_REG,
@@ -678,7 +753,9 @@ static int davinci_hw_common_param(struct davinci_audio_dev *dev, int stream,
678 u8 slots = dev->tdm_slots; 753 u8 slots = dev->tdm_slots;
679 u8 max_active_serializers = (channels + slots - 1) / slots; 754 u8 max_active_serializers = (channels + slots - 1) / slots;
680 /* Default configuration */ 755 /* Default configuration */
681 mcasp_set_bits(dev->base + DAVINCI_MCASP_PWREMUMGT_REG, MCASP_SOFT); 756 if (dev->version != MCASP_VERSION_4)
757 mcasp_set_bits(dev->base + DAVINCI_MCASP_PWREMUMGT_REG,
758 MCASP_SOFT);
682 759
683 /* All PINS as McASP */ 760 /* All PINS as McASP */
684 mcasp_set_reg(dev->base + DAVINCI_MCASP_PFUNC_REG, 0x00000000); 761 mcasp_set_reg(dev->base + DAVINCI_MCASP_PFUNC_REG, 0x00000000);
@@ -698,11 +775,17 @@ static int davinci_hw_common_param(struct davinci_audio_dev *dev, int stream,
698 dev->serial_dir[i]); 775 dev->serial_dir[i]);
699 if (dev->serial_dir[i] == TX_MODE && 776 if (dev->serial_dir[i] == TX_MODE &&
700 tx_ser < max_active_serializers) { 777 tx_ser < max_active_serializers) {
778 mcasp_mod_bits(dev->base + DAVINCI_MCASP_XRSRCTL_REG(i),
779 DISMOD(dev->tx_dismod), DISMOD(3));
780
701 mcasp_set_bits(dev->base + DAVINCI_MCASP_PDIR_REG, 781 mcasp_set_bits(dev->base + DAVINCI_MCASP_PDIR_REG,
702 AXR(i)); 782 AXR(i));
703 tx_ser++; 783 tx_ser++;
704 } else if (dev->serial_dir[i] == RX_MODE && 784 } else if (dev->serial_dir[i] == RX_MODE &&
705 rx_ser < max_active_serializers) { 785 rx_ser < max_active_serializers) {
786 mcasp_mod_bits(dev->base + DAVINCI_MCASP_XRSRCTL_REG(i),
787 DISMOD(dev->rx_dismod), DISMOD(3));
788
706 mcasp_clr_bits(dev->base + DAVINCI_MCASP_PDIR_REG, 789 mcasp_clr_bits(dev->base + DAVINCI_MCASP_PDIR_REG,
707 AXR(i)); 790 AXR(i));
708 rx_ser++; 791 rx_ser++;
@@ -729,6 +812,7 @@ static int davinci_hw_common_param(struct davinci_audio_dev *dev, int stream,
729 812
730 switch (dev->version) { 813 switch (dev->version) {
731 case MCASP_VERSION_3: 814 case MCASP_VERSION_3:
815 case MCASP_VERSION_4:
732 mcasp_mod_bits(dev->base + MCASP_VER3_WFIFOCTL, tx_ser, 816 mcasp_mod_bits(dev->base + MCASP_VER3_WFIFOCTL, tx_ser,
733 NUMDMA_MASK); 817 NUMDMA_MASK);
734 mcasp_mod_bits(dev->base + MCASP_VER3_WFIFOCTL, 818 mcasp_mod_bits(dev->base + MCASP_VER3_WFIFOCTL,
@@ -747,6 +831,7 @@ static int davinci_hw_common_param(struct davinci_audio_dev *dev, int stream,
747 dev->rxnumevt = 1; 831 dev->rxnumevt = 1;
748 switch (dev->version) { 832 switch (dev->version) {
749 case MCASP_VERSION_3: 833 case MCASP_VERSION_3:
834 case MCASP_VERSION_4:
750 mcasp_mod_bits(dev->base + MCASP_VER3_RFIFOCTL, rx_ser, 835 mcasp_mod_bits(dev->base + MCASP_VER3_RFIFOCTL, rx_ser,
751 NUMDMA_MASK); 836 NUMDMA_MASK);
752 mcasp_mod_bits(dev->base + MCASP_VER3_RFIFOCTL, 837 mcasp_mod_bits(dev->base + MCASP_VER3_RFIFOCTL,
@@ -763,46 +848,60 @@ static int davinci_hw_common_param(struct davinci_audio_dev *dev, int stream,
763 return 0; 848 return 0;
764} 849}
765 850
766static void davinci_hw_param(struct davinci_audio_dev *dev, int stream) 851static int davinci_hw_param(struct davinci_audio_dev *dev, int stream,
852 int channels)
767{ 853{
768 int i, active_slots; 854 int i, active_slots;
855 int total_slots = dev->tdm_slots;
856 int active_serializers;
769 u32 mask = 0; 857 u32 mask = 0;
858 u32 busel = 0;
859
860 if ((total_slots < 2) || (total_slots > 32)) {
861 dev_err(dev->dev, "tdm slot count %d not supported\n",
862 total_slots);
863 return -EINVAL;
864 }
865
866 /*
867 * If more than one serializer is needed, then use them with
868 * their specified tdm_slots count. Otherwise, one serializer
869 * can cope with the transaction using as many slots as channels
870 * in the stream, requires channels symmetry
871 */
872 active_serializers = (channels + total_slots - 1) / total_slots;
873 if (active_serializers == 1) {
874 active_slots = channels;
875 dev->channels = channels;
876 } else {
877 active_slots = total_slots;
878 }
770 879
771 active_slots = (dev->tdm_slots > 31) ? 32 : dev->tdm_slots;
772 for (i = 0; i < active_slots; i++) 880 for (i = 0; i < active_slots; i++)
773 mask |= (1 << i); 881 mask |= (1 << i);
774 882
775 mcasp_clr_bits(dev->base + DAVINCI_MCASP_ACLKXCTL_REG, TX_ASYNC); 883 mcasp_clr_bits(dev->base + DAVINCI_MCASP_ACLKXCTL_REG, TX_ASYNC);
776 884
777 if (stream == SNDRV_PCM_STREAM_PLAYBACK) { 885 if (dev->version == MCASP_VERSION_4 && !dev->dat_port)
778 /* bit stream is MSB first with no delay */ 886 busel = TXSEL;
779 /* DSP_B mode */ 887
780 mcasp_set_reg(dev->base + DAVINCI_MCASP_TXTDM_REG, mask); 888 /* bit stream is MSB first with no delay */
781 mcasp_set_bits(dev->base + DAVINCI_MCASP_TXFMT_REG, TXORD); 889 /* DSP_B mode */
782 890 mcasp_set_reg(dev->base + DAVINCI_MCASP_TXTDM_REG, mask);
783 if ((dev->tdm_slots >= 2) && (dev->tdm_slots <= 32)) 891 mcasp_set_bits(dev->base + DAVINCI_MCASP_TXFMT_REG, busel | TXORD);
784 mcasp_mod_bits(dev->base + DAVINCI_MCASP_TXFMCTL_REG, 892 mcasp_mod_bits(dev->base + DAVINCI_MCASP_TXFMCTL_REG,
785 FSXMOD(dev->tdm_slots), FSXMOD(0x1FF)); 893 FSXMOD(total_slots), FSXMOD(0x1FF));
786 else 894
787 printk(KERN_ERR "playback tdm slot %d not supported\n", 895 mcasp_set_reg(dev->base + DAVINCI_MCASP_RXTDM_REG, mask);
788 dev->tdm_slots); 896 mcasp_set_bits(dev->base + DAVINCI_MCASP_RXFMT_REG, busel | RXORD);
789 } else { 897 mcasp_mod_bits(dev->base + DAVINCI_MCASP_RXFMCTL_REG,
790 /* bit stream is MSB first with no delay */ 898 FSRMOD(total_slots), FSRMOD(0x1FF));
791 /* DSP_B mode */ 899
792 mcasp_set_bits(dev->base + DAVINCI_MCASP_RXFMT_REG, RXORD); 900 return 0;
793 mcasp_set_reg(dev->base + DAVINCI_MCASP_RXTDM_REG, mask);
794
795 if ((dev->tdm_slots >= 2) && (dev->tdm_slots <= 32))
796 mcasp_mod_bits(dev->base + DAVINCI_MCASP_RXFMCTL_REG,
797 FSRMOD(dev->tdm_slots), FSRMOD(0x1FF));
798 else
799 printk(KERN_ERR "capture tdm slot %d not supported\n",
800 dev->tdm_slots);
801 }
802} 901}
803 902
804/* S/PDIF */ 903/* S/PDIF */
805static void davinci_hw_dit_param(struct davinci_audio_dev *dev) 904static int davinci_hw_dit_param(struct davinci_audio_dev *dev)
806{ 905{
807 /* Set the TX format : 24 bit right rotation, 32 bit slot, Pad 0 906 /* Set the TX format : 24 bit right rotation, 32 bit slot, Pad 0
808 and LSB first */ 907 and LSB first */
@@ -827,6 +926,31 @@ static void davinci_hw_dit_param(struct davinci_audio_dev *dev)
827 926
828 /* Enable the DIT */ 927 /* Enable the DIT */
829 mcasp_set_bits(dev->base + DAVINCI_MCASP_TXDITCTL_REG, DITEN); 928 mcasp_set_bits(dev->base + DAVINCI_MCASP_TXDITCTL_REG, DITEN);
929
930 return 0;
931}
932
933static void davinci_mcasp_set_dma_params(struct snd_pcm_substream *substream,
934 struct davinci_audio_dev *dev,
935 int word_length, u8 fifo_level)
936{
937 if (dev->version == MCASP_VERSION_4) {
938 struct omap_pcm_dma_data *dma_data =
939 dev->dma_params[substream->stream];
940
941 dma_data->packet_size = fifo_level;
942 } else {
943 struct davinci_pcm_dma_params *dma_params =
944 dev->dma_params[substream->stream];
945
946 dma_params->data_type = word_length >> 3;
947 dma_params->fifo_level = fifo_level;
948
949 if (dev->version == MCASP_VERSION_2 && !fifo_level)
950 dma_params->acnt = 4;
951 else
952 dma_params->acnt = dma_params->data_type;
953 }
830} 954}
831 955
832static int davinci_mcasp_hw_params(struct snd_pcm_substream *substream, 956static int davinci_mcasp_hw_params(struct snd_pcm_substream *substream,
@@ -834,16 +958,12 @@ static int davinci_mcasp_hw_params(struct snd_pcm_substream *substream,
834 struct snd_soc_dai *cpu_dai) 958 struct snd_soc_dai *cpu_dai)
835{ 959{
836 struct davinci_audio_dev *dev = snd_soc_dai_get_drvdata(cpu_dai); 960 struct davinci_audio_dev *dev = snd_soc_dai_get_drvdata(cpu_dai);
837 struct davinci_pcm_dma_params *dma_params =
838 &dev->dma_params[substream->stream];
839 int word_length; 961 int word_length;
840 u8 fifo_level; 962 u8 fifo_level;
841 u8 slots = dev->tdm_slots; 963 u8 slots = dev->tdm_slots;
842 u8 active_serializers; 964 u8 active_serializers;
843 int channels; 965 int channels = params_channels(params);
844 struct snd_interval *pcm_channels = hw_param_interval(params, 966 int ret;
845 SNDRV_PCM_HW_PARAM_CHANNELS);
846 channels = pcm_channels->min;
847 967
848 active_serializers = (channels + slots - 1) / slots; 968 active_serializers = (channels + slots - 1) / slots;
849 969
@@ -855,26 +975,26 @@ static int davinci_mcasp_hw_params(struct snd_pcm_substream *substream,
855 fifo_level = dev->rxnumevt * active_serializers; 975 fifo_level = dev->rxnumevt * active_serializers;
856 976
857 if (dev->op_mode == DAVINCI_MCASP_DIT_MODE) 977 if (dev->op_mode == DAVINCI_MCASP_DIT_MODE)
858 davinci_hw_dit_param(dev); 978 ret = davinci_hw_dit_param(dev);
859 else 979 else
860 davinci_hw_param(dev, substream->stream); 980 ret = davinci_hw_param(dev, substream->stream, channels);
981
982 if (ret)
983 return ret;
861 984
862 switch (params_format(params)) { 985 switch (params_format(params)) {
863 case SNDRV_PCM_FORMAT_U8: 986 case SNDRV_PCM_FORMAT_U8:
864 case SNDRV_PCM_FORMAT_S8: 987 case SNDRV_PCM_FORMAT_S8:
865 dma_params->data_type = 1;
866 word_length = 8; 988 word_length = 8;
867 break; 989 break;
868 990
869 case SNDRV_PCM_FORMAT_U16_LE: 991 case SNDRV_PCM_FORMAT_U16_LE:
870 case SNDRV_PCM_FORMAT_S16_LE: 992 case SNDRV_PCM_FORMAT_S16_LE:
871 dma_params->data_type = 2;
872 word_length = 16; 993 word_length = 16;
873 break; 994 break;
874 995
875 case SNDRV_PCM_FORMAT_U24_3LE: 996 case SNDRV_PCM_FORMAT_U24_3LE:
876 case SNDRV_PCM_FORMAT_S24_3LE: 997 case SNDRV_PCM_FORMAT_S24_3LE:
877 dma_params->data_type = 3;
878 word_length = 24; 998 word_length = 24;
879 break; 999 break;
880 1000
@@ -882,7 +1002,6 @@ static int davinci_mcasp_hw_params(struct snd_pcm_substream *substream,
882 case SNDRV_PCM_FORMAT_S24_LE: 1002 case SNDRV_PCM_FORMAT_S24_LE:
883 case SNDRV_PCM_FORMAT_U32_LE: 1003 case SNDRV_PCM_FORMAT_U32_LE:
884 case SNDRV_PCM_FORMAT_S32_LE: 1004 case SNDRV_PCM_FORMAT_S32_LE:
885 dma_params->data_type = 4;
886 word_length = 32; 1005 word_length = 32;
887 break; 1006 break;
888 1007
@@ -891,12 +1010,8 @@ static int davinci_mcasp_hw_params(struct snd_pcm_substream *substream,
891 return -EINVAL; 1010 return -EINVAL;
892 } 1011 }
893 1012
894 if (dev->version == MCASP_VERSION_2 && !fifo_level) 1013 dev->sample_bits = word_length;
895 dma_params->acnt = 4; 1014 davinci_mcasp_set_dma_params(substream, dev, word_length, fifo_level);
896 else
897 dma_params->acnt = dma_params->data_type;
898
899 dma_params->fifo_level = fifo_level;
900 davinci_config_channel_size(dev, word_length); 1015 davinci_config_channel_size(dev, word_length);
901 1016
902 return 0; 1017 return 0;
@@ -912,19 +1027,10 @@ static int davinci_mcasp_trigger(struct snd_pcm_substream *substream,
912 case SNDRV_PCM_TRIGGER_RESUME: 1027 case SNDRV_PCM_TRIGGER_RESUME:
913 case SNDRV_PCM_TRIGGER_START: 1028 case SNDRV_PCM_TRIGGER_START:
914 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: 1029 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
915 ret = pm_runtime_get_sync(dev->dev); 1030 ret = davinci_mcasp_start(dev, substream->stream);
916 if (IS_ERR_VALUE(ret))
917 dev_err(dev->dev, "pm_runtime_get_sync() failed\n");
918 davinci_mcasp_start(dev, substream->stream);
919 break; 1031 break;
920 1032
921 case SNDRV_PCM_TRIGGER_SUSPEND: 1033 case SNDRV_PCM_TRIGGER_SUSPEND:
922 davinci_mcasp_stop(dev, substream->stream);
923 ret = pm_runtime_put_sync(dev->dev);
924 if (IS_ERR_VALUE(ret))
925 dev_err(dev->dev, "pm_runtime_put_sync() failed\n");
926 break;
927
928 case SNDRV_PCM_TRIGGER_STOP: 1034 case SNDRV_PCM_TRIGGER_STOP:
929 case SNDRV_PCM_TRIGGER_PAUSE_PUSH: 1035 case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
930 davinci_mcasp_stop(dev, substream->stream); 1036 davinci_mcasp_stop(dev, substream->stream);
@@ -937,17 +1043,129 @@ static int davinci_mcasp_trigger(struct snd_pcm_substream *substream,
937 return ret; 1043 return ret;
938} 1044}
939 1045
1046static int davinci_mcasp_hwrule_buffersize(struct snd_pcm_hw_params *params,
1047 struct snd_pcm_hw_rule *rule,
1048 int stream)
1049{
1050 struct snd_interval *buffer_size = hw_param_interval(params,
1051 SNDRV_PCM_HW_PARAM_BUFFER_SIZE);
1052 int channels = params_channels(params);
1053 int periods = params_periods(params);
1054 struct davinci_audio_dev *dev = rule->private;
1055 int i;
1056 u8 slots = dev->tdm_slots;
1057 u8 max_active_serializers = (channels + slots - 1) / slots;
1058 u8 num_ser = 0;
1059 u8 num_evt = 0;
1060 unsigned long step = 1;
1061
1062 if (stream == SNDRV_PCM_STREAM_PLAYBACK) {
1063 for (i = 0; i < dev->num_serializer; i++) {
1064 if (dev->serial_dir[i] == TX_MODE &&
1065 num_ser < max_active_serializers)
1066 num_ser++;
1067 }
1068 num_evt = dev->txnumevt * num_ser;
1069 } else {
1070 for (i = 0; i < dev->num_serializer; i++) {
1071 if (dev->serial_dir[i] == RX_MODE &&
1072 num_ser < max_active_serializers)
1073 num_ser++;
1074 }
1075 num_evt = dev->rxnumevt * num_ser;
1076 }
1077
1078 /*
1079 * The buffersize (in samples), must be a multiple of num_evt. The
1080 * buffersize (in frames) is the product of the period_size and the
1081 * number of periods. Therefore, the buffersize should be a multiple
1082 * of the number of periods. The below finds the least common
1083 * multiple of num_evt and channels (since the number of samples
1084 * per frame is equal to the number of channels). It also makes sure
1085 * that the resulting step value (LCM / channels) is a multiple of the
1086 * number of periods.
1087 */
1088 step = lcm((lcm(num_evt, channels) / channels), periods);
1089
1090 return snd_interval_step(buffer_size, 0, step);
1091}
1092
1093static int davinci_mcasp_hwrule_txbuffersize(struct snd_pcm_hw_params *params,
1094 struct snd_pcm_hw_rule *rule)
1095{
1096 return davinci_mcasp_hwrule_buffersize(params, rule,
1097 SNDRV_PCM_STREAM_PLAYBACK);
1098}
1099
1100static int davinci_mcasp_hwrule_rxbuffersize(struct snd_pcm_hw_params *params,
1101 struct snd_pcm_hw_rule *rule)
1102{
1103 return davinci_mcasp_hwrule_buffersize(params, rule,
1104 SNDRV_PCM_STREAM_CAPTURE);
1105}
1106
940static int davinci_mcasp_startup(struct snd_pcm_substream *substream, 1107static int davinci_mcasp_startup(struct snd_pcm_substream *substream,
941 struct snd_soc_dai *dai) 1108 struct snd_soc_dai *dai)
942{ 1109{
943 struct davinci_audio_dev *dev = snd_soc_dai_get_drvdata(dai); 1110 struct davinci_audio_dev *dev = snd_soc_dai_get_drvdata(dai);
944 1111
945 snd_soc_dai_set_dma_data(dai, substream, dev->dma_params); 1112
1113 if (dev->version == MCASP_VERSION_4) {
1114 snd_soc_dai_set_dma_data(dai, substream,
1115 dev->dma_params[substream->stream]);
1116 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
1117 if (dev->txnumevt)
1118 snd_pcm_hw_rule_add(substream->runtime, 0,
1119 SNDRV_PCM_HW_PARAM_BUFFER_SIZE,
1120 davinci_mcasp_hwrule_txbuffersize,
1121 dev,
1122 SNDRV_PCM_HW_PARAM_BUFFER_SIZE, -1);
1123 } else if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) {
1124 if (dev->rxnumevt)
1125 snd_pcm_hw_rule_add(substream->runtime, 0,
1126 SNDRV_PCM_HW_PARAM_BUFFER_SIZE,
1127 davinci_mcasp_hwrule_rxbuffersize,
1128 dev,
1129 SNDRV_PCM_HW_PARAM_BUFFER_SIZE, -1);
1130 }
1131 }
1132 else
1133 snd_soc_dai_set_dma_data(dai, substream, dev->dma_params);
1134
1135 /* Apply channels symmetry, needed when using a single serializer */
1136 if (dev->channels)
1137 snd_pcm_hw_constraint_minmax(substream->runtime,
1138 SNDRV_PCM_HW_PARAM_CHANNELS,
1139 dev->channels, dev->channels);
1140
1141 /*
1142 * Apply sample size symmetry since the slot size (defined by word
1143 * length) has to be the same for playback and capture in McASP
1144 * instances with unified clock/sync domain
1145 */
1146 if (dev->sample_bits)
1147 snd_pcm_hw_constraint_minmax(substream->runtime,
1148 SNDRV_PCM_HW_PARAM_SAMPLE_BITS,
1149 dev->sample_bits,
1150 dev->sample_bits);
1151
946 return 0; 1152 return 0;
947} 1153}
948 1154
1155static void davinci_mcasp_shutdown(struct snd_pcm_substream *substream,
1156 struct snd_soc_dai *dai)
1157{
1158 struct davinci_audio_dev *dev = snd_soc_dai_get_drvdata(dai);
1159
1160 if (!dai->active) {
1161 dev->channels = 0;
1162 dev->sample_bits = 0;
1163 }
1164}
1165
949static const struct snd_soc_dai_ops davinci_mcasp_dai_ops = { 1166static const struct snd_soc_dai_ops davinci_mcasp_dai_ops = {
950 .startup = davinci_mcasp_startup, 1167 .startup = davinci_mcasp_startup,
1168 .shutdown = davinci_mcasp_shutdown,
951 .trigger = davinci_mcasp_trigger, 1169 .trigger = davinci_mcasp_trigger,
952 .hw_params = davinci_mcasp_hw_params, 1170 .hw_params = davinci_mcasp_hw_params,
953 .set_fmt = davinci_mcasp_set_dai_fmt, 1171 .set_fmt = davinci_mcasp_set_dai_fmt,
@@ -970,13 +1188,13 @@ static struct snd_soc_dai_driver davinci_mcasp_dai[] = {
970 { 1188 {
971 .name = "davinci-mcasp.0", 1189 .name = "davinci-mcasp.0",
972 .playback = { 1190 .playback = {
973 .channels_min = 2, 1191 .channels_min = 1,
974 .channels_max = 32 * 16, 1192 .channels_max = 32 * 16,
975 .rates = DAVINCI_MCASP_RATES, 1193 .rates = DAVINCI_MCASP_RATES,
976 .formats = DAVINCI_MCASP_PCM_FMTS, 1194 .formats = DAVINCI_MCASP_PCM_FMTS,
977 }, 1195 },
978 .capture = { 1196 .capture = {
979 .channels_min = 2, 1197 .channels_min = 1,
980 .channels_max = 32 * 16, 1198 .channels_max = 32 * 16,
981 .rates = DAVINCI_MCASP_RATES, 1199 .rates = DAVINCI_MCASP_RATES,
982 .formats = DAVINCI_MCASP_PCM_FMTS, 1200 .formats = DAVINCI_MCASP_PCM_FMTS,
@@ -1010,6 +1228,10 @@ static const struct of_device_id mcasp_dt_ids[] = {
1010 .compatible = "ti,omap2-mcasp-audio", 1228 .compatible = "ti,omap2-mcasp-audio",
1011 .data = (void *)MCASP_VERSION_3, 1229 .data = (void *)MCASP_VERSION_3,
1012 }, 1230 },
1231 {
1232 .compatible = "ti,dra7-mcasp-audio",
1233 .data = (void *)MCASP_VERSION_4,
1234 },
1013 { /* sentinel */ } 1235 { /* sentinel */ }
1014}; 1236};
1015MODULE_DEVICE_TABLE(of, mcasp_dt_ids); 1237MODULE_DEVICE_TABLE(of, mcasp_dt_ids);
@@ -1090,6 +1312,23 @@ static struct snd_platform_data *davinci_mcasp_set_pdata_from_of(
1090 pdata->serial_dir = of_serial_dir; 1312 pdata->serial_dir = of_serial_dir;
1091 } 1313 }
1092 1314
1315 of_property_read_u32(np, "ti,tx-inactive-mode", &pdata->tx_dismod);
1316
1317 of_property_read_u32(np, "ti,rx-inactive-mode", &pdata->rx_dismod);
1318
1319 /* DISMOD = 1 is a reserved value */
1320 if ((pdata->tx_dismod == 1) || (pdata->rx_dismod == 1)) {
1321 dev_err(&pdev->dev, "tx/rx-inactive-mode cannot be 1\n");
1322 ret = -EINVAL;
1323 goto nodata;
1324 }
1325
1326 if ((pdata->tx_dismod > 3) || (pdata->rx_dismod > 3)) {
1327 dev_err(&pdev->dev, "invalid tx/rx-inactive-mode\n");
1328 ret = -EINVAL;
1329 goto nodata;
1330 }
1331
1093 ret = of_property_read_u32(np, "tx-num-evt", &val); 1332 ret = of_property_read_u32(np, "tx-num-evt", &val);
1094 if (ret >= 0) 1333 if (ret >= 0)
1095 pdata->txnumevt = val; 1334 pdata->txnumevt = val;
@@ -1119,8 +1358,8 @@ nodata:
1119 1358
1120static int davinci_mcasp_probe(struct platform_device *pdev) 1359static int davinci_mcasp_probe(struct platform_device *pdev)
1121{ 1360{
1122 struct davinci_pcm_dma_params *dma_data; 1361 struct resource *mem, *ioarea, *mem_dat;
1123 struct resource *mem, *ioarea, *res; 1362 struct resource *tx_res, *rx_res;
1124 struct snd_platform_data *pdata; 1363 struct snd_platform_data *pdata;
1125 struct davinci_audio_dev *dev; 1364 struct davinci_audio_dev *dev;
1126 int ret; 1365 int ret;
@@ -1154,14 +1393,16 @@ static int davinci_mcasp_probe(struct platform_device *pdev)
1154 return -EBUSY; 1393 return -EBUSY;
1155 } 1394 }
1156 1395
1157 pm_runtime_enable(&pdev->dev); 1396 mem_dat = platform_get_resource_byname(pdev, IORESOURCE_MEM, "dat");
1158 1397 if (!mem_dat) {
1159 ret = pm_runtime_get_sync(&pdev->dev); 1398 dev_info(&pdev->dev, "data port resource not defined, cfg port will be used\n");
1160 if (IS_ERR_VALUE(ret)) { 1399 dev->dat_port = false;
1161 dev_err(&pdev->dev, "pm_runtime_get_sync() failed\n"); 1400 } else {
1162 return ret; 1401 dev->dat_port = true;
1163 } 1402 }
1164 1403
1404 pm_runtime_enable(&pdev->dev);
1405
1165 dev->base = devm_ioremap(&pdev->dev, mem->start, resource_size(mem)); 1406 dev->base = devm_ioremap(&pdev->dev, mem->start, resource_size(mem));
1166 if (!dev->base) { 1407 if (!dev->base) {
1167 dev_err(&pdev->dev, "ioremap failed\n"); 1408 dev_err(&pdev->dev, "ioremap failed\n");
@@ -1176,52 +1417,101 @@ static int davinci_mcasp_probe(struct platform_device *pdev)
1176 dev->version = pdata->version; 1417 dev->version = pdata->version;
1177 dev->txnumevt = pdata->txnumevt; 1418 dev->txnumevt = pdata->txnumevt;
1178 dev->rxnumevt = pdata->rxnumevt; 1419 dev->rxnumevt = pdata->rxnumevt;
1420 dev->tx_dismod = pdata->tx_dismod;
1421 dev->rx_dismod = pdata->rx_dismod;
1179 dev->dev = &pdev->dev; 1422 dev->dev = &pdev->dev;
1180 1423
1181 dma_data = &dev->dma_params[SNDRV_PCM_STREAM_PLAYBACK];
1182 dma_data->asp_chan_q = pdata->asp_chan_q;
1183 dma_data->ram_chan_q = pdata->ram_chan_q;
1184 dma_data->sram_pool = pdata->sram_pool;
1185 dma_data->sram_size = pdata->sram_size_playback;
1186 dma_data->dma_addr = (dma_addr_t) (pdata->tx_dma_offset +
1187 mem->start);
1188
1189 /* first TX, then RX */ 1424 /* first TX, then RX */
1190 res = platform_get_resource(pdev, IORESOURCE_DMA, 0); 1425 tx_res = platform_get_resource(pdev, IORESOURCE_DMA, 0);
1191 if (!res) { 1426 if (!tx_res) {
1192 dev_err(&pdev->dev, "no DMA resource\n"); 1427 dev_err(&pdev->dev, "no DMA resource\n");
1193 ret = -ENODEV; 1428 return -ENODEV;
1194 goto err_release_clk;
1195 } 1429 }
1196 1430
1197 dma_data->channel = res->start; 1431 rx_res = platform_get_resource(pdev, IORESOURCE_DMA, 1);
1432 if (!rx_res) {
1433 dev_err(&pdev->dev, "no DMA resource\n");
1434 return -ENODEV;
1435 }
1198 1436
1199 dma_data = &dev->dma_params[SNDRV_PCM_STREAM_CAPTURE]; 1437 if (dev->version == MCASP_VERSION_4) {
1200 dma_data->asp_chan_q = pdata->asp_chan_q; 1438 struct omap_pcm_dma_data *dma_data;
1201 dma_data->ram_chan_q = pdata->ram_chan_q;
1202 dma_data->sram_pool = pdata->sram_pool;
1203 dma_data->sram_size = pdata->sram_size_capture;
1204 dma_data->dma_addr = (dma_addr_t)(pdata->rx_dma_offset +
1205 mem->start);
1206 1439
1207 res = platform_get_resource(pdev, IORESOURCE_DMA, 1); 1440 dma_data = devm_kzalloc(&pdev->dev, sizeof(*dma_data),
1208 if (!res) { 1441 GFP_KERNEL);
1209 dev_err(&pdev->dev, "no DMA resource\n"); 1442 if (!dma_data) {
1210 ret = -ENODEV; 1443 ret = -ENOMEM;
1211 goto err_release_clk; 1444 goto err_release_clk;
1445 }
1446
1447 dev->dma_params[SNDRV_PCM_STREAM_PLAYBACK] = dma_data;
1448 if (mem_dat)
1449 dma_data->port_addr = mem_dat->start;
1450 else
1451 dma_data->port_addr = mem->start + DAVINCI_MCASP_TXBUF_REG;
1452 dma_data->dma_req = tx_res->start;
1453
1454 dma_data = devm_kzalloc(&pdev->dev, sizeof(*dma_data),
1455 GFP_KERNEL);
1456 if (!dma_data) {
1457 ret = -ENOMEM;
1458 goto err_release_clk;
1459 }
1460
1461 dev->dma_params[SNDRV_PCM_STREAM_CAPTURE] = dma_data;
1462 if (mem_dat)
1463 dma_data->port_addr = mem_dat->start;
1464 else
1465 dma_data->port_addr = mem->start + DAVINCI_MCASP_RXBUF_REG;
1466 dma_data->dma_req = rx_res->start;
1467 } else {
1468 struct davinci_pcm_dma_params *dma_data;
1469
1470 dma_data = devm_kzalloc(&pdev->dev, sizeof(*dma_data),
1471 GFP_KERNEL);
1472 if (!dma_data) {
1473 ret = -ENOMEM;
1474 goto err_release_clk;
1475 }
1476
1477 dev->dma_params[SNDRV_PCM_STREAM_PLAYBACK] = dma_data;
1478 dma_data->asp_chan_q = pdata->asp_chan_q;
1479 dma_data->ram_chan_q = pdata->ram_chan_q;
1480 dma_data->sram_pool = pdata->sram_pool;
1481 dma_data->sram_size = pdata->sram_size_playback;
1482 dma_data->channel = tx_res->start;
1483 dma_data->dma_addr = (dma_addr_t)(pdata->tx_dma_offset +
1484 mem->start);
1485
1486 dma_data = devm_kzalloc(&pdev->dev, sizeof(*dma_data),
1487 GFP_KERNEL);
1488 if (!dma_data) {
1489 ret = -ENOMEM;
1490 goto err_release_clk;
1491 }
1492
1493 dev->dma_params[SNDRV_PCM_STREAM_CAPTURE] = dma_data;
1494 dma_data->asp_chan_q = pdata->asp_chan_q;
1495 dma_data->ram_chan_q = pdata->ram_chan_q;
1496 dma_data->sram_pool = pdata->sram_pool;
1497 dma_data->sram_size = pdata->sram_size_capture;
1498 dma_data->channel = rx_res->start;
1499 dma_data->dma_addr = (dma_addr_t)(pdata->rx_dma_offset +
1500 mem->start);
1212 } 1501 }
1213 1502
1214 dma_data->channel = res->start;
1215 dev_set_drvdata(&pdev->dev, dev); 1503 dev_set_drvdata(&pdev->dev, dev);
1216 ret = snd_soc_register_dai(&pdev->dev, &davinci_mcasp_dai[pdata->op_mode]); 1504 ret = snd_soc_register_dai(&pdev->dev, &davinci_mcasp_dai[pdata->op_mode]);
1217 1505
1218 if (ret != 0) 1506 if (ret != 0)
1219 goto err_release_clk; 1507 goto err_release_clk;
1220 1508
1221 ret = davinci_soc_platform_register(&pdev->dev); 1509 if (dev->version != MCASP_VERSION_4) {
1222 if (ret) { 1510 ret = davinci_soc_platform_register(&pdev->dev);
1223 dev_err(&pdev->dev, "register PCM failed: %d\n", ret); 1511 if (ret) {
1224 goto err_unregister_dai; 1512 dev_err(&pdev->dev, "register PCM failed: %d\n", ret);
1513 goto err_unregister_dai;
1514 }
1225 } 1515 }
1226 1516
1227 return 0; 1517 return 0;
@@ -1229,18 +1519,19 @@ static int davinci_mcasp_probe(struct platform_device *pdev)
1229err_unregister_dai: 1519err_unregister_dai:
1230 snd_soc_unregister_dai(&pdev->dev); 1520 snd_soc_unregister_dai(&pdev->dev);
1231err_release_clk: 1521err_release_clk:
1232 pm_runtime_put_sync(&pdev->dev);
1233 pm_runtime_disable(&pdev->dev); 1522 pm_runtime_disable(&pdev->dev);
1234 return ret; 1523 return ret;
1235} 1524}
1236 1525
1237static int davinci_mcasp_remove(struct platform_device *pdev) 1526static int davinci_mcasp_remove(struct platform_device *pdev)
1238{ 1527{
1528 struct davinci_audio_dev *dev = dev_get_drvdata(&pdev->dev);
1239 1529
1240 snd_soc_unregister_dai(&pdev->dev); 1530 snd_soc_unregister_dai(&pdev->dev);
1241 davinci_soc_platform_unregister(&pdev->dev);
1242 1531
1243 pm_runtime_put_sync(&pdev->dev); 1532 if (dev->version != MCASP_VERSION_4)
1533 davinci_soc_platform_unregister(&pdev->dev);
1534
1244 pm_runtime_disable(&pdev->dev); 1535 pm_runtime_disable(&pdev->dev);
1245 1536
1246 return 0; 1537 return 0;
diff --git a/sound/soc/davinci/davinci-mcasp.h b/sound/soc/davinci/davinci-mcasp.h
index a9ac0c11da7..48784954c83 100644
--- a/sound/soc/davinci/davinci-mcasp.h
+++ b/sound/soc/davinci/davinci-mcasp.h
@@ -28,7 +28,7 @@
28#define DAVINCI_MCASP_DIT_DAI 1 28#define DAVINCI_MCASP_DIT_DAI 1
29 29
30struct davinci_audio_dev { 30struct davinci_audio_dev {
31 struct davinci_pcm_dma_params dma_params[2]; 31 void *dma_params[2];
32 void __iomem *base; 32 void __iomem *base;
33 struct device *dev; 33 struct device *dev;
34 34
@@ -37,12 +37,19 @@ struct davinci_audio_dev {
37 u8 op_mode; 37 u8 op_mode;
38 u8 num_serializer; 38 u8 num_serializer;
39 u8 *serial_dir; 39 u8 *serial_dir;
40 u32 tx_dismod;
41 u32 rx_dismod;
40 u8 version; 42 u8 version;
41 u16 bclk_lrclk_ratio; 43 u16 bclk_lrclk_ratio;
44 unsigned int channels;
45 unsigned int sample_bits;
42 46
43 /* McASP FIFO related */ 47 /* McASP FIFO related */
44 u8 txnumevt; 48 u8 txnumevt;
45 u8 rxnumevt; 49 u8 rxnumevt;
50
51 /* McASP port related */
52 bool dat_port;
46}; 53};
47 54
48#endif /* DAVINCI_MCASP_H */ 55#endif /* DAVINCI_MCASP_H */
diff --git a/sound/soc/davinci/davinci-pcm.h b/sound/soc/davinci/davinci-pcm.h
index fbb710c76c0..436722c27dc 100644
--- a/sound/soc/davinci/davinci-pcm.h
+++ b/sound/soc/davinci/davinci-pcm.h
@@ -29,7 +29,22 @@ struct davinci_pcm_dma_params {
29 unsigned int fifo_level; 29 unsigned int fifo_level;
30}; 30};
31 31
32#ifdef CONFIG_SND_DAVINCI_SOC
33
32int davinci_soc_platform_register(struct device *dev); 34int davinci_soc_platform_register(struct device *dev);
33void davinci_soc_platform_unregister(struct device *dev); 35void davinci_soc_platform_unregister(struct device *dev);
34 36
37#else
38
39static inline int davinci_soc_platform_register(struct device *dev)
40{
41 return 0;
42}
43
44static inline void davinci_soc_platform_unregister(struct device *dev)
45{
46}
47
48#endif
49
35#endif 50#endif
diff --git a/sound/soc/omap/Kconfig b/sound/soc/omap/Kconfig
index 9afb392e87e..03018765291 100644
--- a/sound/soc/omap/Kconfig
+++ b/sound/soc/omap/Kconfig
@@ -130,3 +130,15 @@ config SND_OMAP_SOC_OMAP3_PANDORA
130 select SND_SOC_TWL4030 130 select SND_SOC_TWL4030
131 help 131 help
132 Say Y if you want to add support for SoC audio on the OMAP3 Pandora. 132 Say Y if you want to add support for SoC audio on the OMAP3 Pandora.
133
134config SND_DRA7_SOC_ATL
135 tristate
136
137config SND_SOC_DRA7_EVM
138 tristate "SoC Audio support for DRA7 EVM"
139 depends on SND_OMAP_SOC && SOC_DRA7XX
140 select SND_DAVINCI_SOC_MCASP
141 select SND_SOC_TLV320AIC3X
142 select SND_DRA7_SOC_ATL
143 help
144 Say Y if you want to add support for SoC audio on DRA7 EVM
diff --git a/sound/soc/omap/Makefile b/sound/soc/omap/Makefile
index 4e89a7fd3e8..fc9c78177f5 100644
--- a/sound/soc/omap/Makefile
+++ b/sound/soc/omap/Makefile
@@ -8,6 +8,7 @@ snd-soc-omap-hdmi-objs := omap-hdmi.o
8snd-soc-omap-abe-objs := omap-abe-core.o omap-abe-dbg.o omap-abe-mixer.o \ 8snd-soc-omap-abe-objs := omap-abe-core.o omap-abe-dbg.o omap-abe-mixer.o \
9 omap-abe-mmap.o omap-abe-opp.o omap-abe-pcm.o \ 9 omap-abe-mmap.o omap-abe-opp.o omap-abe-pcm.o \
10 omap-abe-pm.o 10 omap-abe-pm.o
11snd-soc-dra7-atl-objs := dra7-atl.o
11 12
12obj-$(CONFIG_SND_OMAP_SOC) += snd-soc-omap.o 13obj-$(CONFIG_SND_OMAP_SOC) += snd-soc-omap.o
13obj-$(CONFIG_SND_OMAP_SOC_DMIC) += snd-soc-omap-dmic.o 14obj-$(CONFIG_SND_OMAP_SOC_DMIC) += snd-soc-omap-dmic.o
@@ -16,6 +17,7 @@ obj-$(CONFIG_SND_OMAP_SOC_MCBSP) += snd-soc-omap-mcbsp.o
16obj-$(CONFIG_SND_OMAP_SOC_MCPDM) += snd-soc-omap-mcpdm.o 17obj-$(CONFIG_SND_OMAP_SOC_MCPDM) += snd-soc-omap-mcpdm.o
17obj-$(CONFIG_SND_OMAP_SOC_HDMI) += snd-soc-omap-hdmi.o 18obj-$(CONFIG_SND_OMAP_SOC_HDMI) += snd-soc-omap-hdmi.o
18obj-$(CONFIG_SND_OMAP_SOC_ABE) += snd-soc-omap-abe.o aess/ 19obj-$(CONFIG_SND_OMAP_SOC_ABE) += snd-soc-omap-abe.o aess/
20obj-$(CONFIG_SND_DRA7_SOC_ATL) += snd-soc-dra7-atl.o
19 21
20# OMAP Machine Support 22# OMAP Machine Support
21snd-soc-n810-objs := n810.o 23snd-soc-n810-objs := n810.o
@@ -27,6 +29,7 @@ snd-soc-omap-abe-twl6040-objs := omap-abe-twl6040.o
27snd-soc-omap-twl4030-objs := omap-twl4030.o 29snd-soc-omap-twl4030-objs := omap-twl4030.o
28snd-soc-omap3pandora-objs := omap3pandora.o 30snd-soc-omap3pandora-objs := omap3pandora.o
29snd-soc-omap-hdmi-card-objs := omap-hdmi-card.o 31snd-soc-omap-hdmi-card-objs := omap-hdmi-card.o
32snd-soc-dra7-evm-objs := dra7-evm.o
30 33
31obj-$(CONFIG_SND_OMAP_SOC_N810) += snd-soc-n810.o 34obj-$(CONFIG_SND_OMAP_SOC_N810) += snd-soc-n810.o
32obj-$(CONFIG_SND_OMAP_SOC_RX51) += snd-soc-rx51.o 35obj-$(CONFIG_SND_OMAP_SOC_RX51) += snd-soc-rx51.o
@@ -37,4 +40,5 @@ obj-$(CONFIG_SND_OMAP_SOC_AM3517EVM) += snd-soc-am3517evm.o
37obj-$(CONFIG_SND_OMAP_SOC_OMAP_ABE_TWL6040) += snd-soc-omap-abe-twl6040.o 40obj-$(CONFIG_SND_OMAP_SOC_OMAP_ABE_TWL6040) += snd-soc-omap-abe-twl6040.o
38obj-$(CONFIG_SND_OMAP_SOC_OMAP_TWL4030) += snd-soc-omap-twl4030.o 41obj-$(CONFIG_SND_OMAP_SOC_OMAP_TWL4030) += snd-soc-omap-twl4030.o
39obj-$(CONFIG_SND_OMAP_SOC_OMAP3_PANDORA) += snd-soc-omap3pandora.o 42obj-$(CONFIG_SND_OMAP_SOC_OMAP3_PANDORA) += snd-soc-omap3pandora.o
43obj-$(CONFIG_SND_SOC_DRA7_EVM) += snd-soc-dra7-evm.o
40obj-$(CONFIG_SND_OMAP_SOC_OMAP_HDMI) += snd-soc-omap-hdmi-card.o 44obj-$(CONFIG_SND_OMAP_SOC_OMAP_HDMI) += snd-soc-omap-hdmi-card.o
diff --git a/sound/soc/omap/dra7-atl.c b/sound/soc/omap/dra7-atl.c
new file mode 100644
index 00000000000..156dc29c960
--- /dev/null
+++ b/sound/soc/omap/dra7-atl.c
@@ -0,0 +1,317 @@
1/*
2 * dra7-atl.c -- DRA7xx Audio Tracking Logic driver
3 *
4 * Copyright (C) 2013 Texas Instruments
5 *
6 * Author: Misael Lopez Cruz <misael.lopez@ti.com>
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * version 2 as published by the Free Software Foundation.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20 * 02110-1301 USA
21 *
22 */
23
24#include <linux/init.h>
25#include <linux/platform_device.h>
26#include <linux/module.h>
27#include <linux/err.h>
28#include <linux/slab.h>
29#include <linux/io.h>
30#include <linux/of.h>
31#include <linux/clk.h>
32#include <linux/pm_runtime.h>
33
34/* ATL instances */
35#define ATL0 0
36#define ATL1 1
37#define ATL2 2
38#define ATL3 3
39#define ATL_INSTANCES 4
40
41/* ATL instance offsets */
42#define ATL_INST(id) (0x200 + (id * 0x80))
43
44/* ATL registers */
45#define ATL_REVID 0x000
46#define ATL_PPMR(inst) (inst + 0x00)
47#define ATL_BBSR(inst) (inst + 0x04)
48#define ATL_ATLCR(inst) (inst + 0x08)
49#define ATL_SWEN(inst) (inst + 0x10)
50#define ATL_BWSMUX(inst) (inst + 0x14)
51#define ATL_AWSMUX(inst) (inst + 0x18)
52#define ATL_PCLKMUX(inst) (inst + 0x1c)
53
54/* ATL_ATCLCR */
55#define INTERNAL_DIVIDER_MAX 0x1F
56
57/* ATL_SWEN register */
58#define ATL_DISABLE 0
59#define ATL_ENABLE 1
60
61/* ATL_BWSMUX / ATL_AWSMUX register */
62#define ATL_WSMUX_MAX 0xF
63
64/* ATL_PCLKMUX register */
65#define PCLKMUX_OCP_CLK 0
66#define PCLKMUX_ATLPCLK 1
67
68struct atl_data {
69 struct device *dev;
70 void __iomem *io_base;
71 unsigned int atlpclk_freq;
72};
73
74static inline void dra7_atl_write(struct atl_data *atl, u32 reg, u32 val)
75{
76 __raw_writel(val, atl->io_base + reg);
77}
78
79static inline int dra7_atl_read(struct atl_data *atl, u32 reg)
80{
81 return __raw_readl(atl->io_base + reg);
82}
83
84static int dra7_atl_init(struct atl_data *atl)
85{
86 struct clk *gfclk, *parent_clk;
87 int ret;
88
89 gfclk = clk_get(atl->dev, "atl_gfclk_mux");
90 if (IS_ERR(gfclk)) {
91 dev_err(atl->dev, "failed to get ATLPCLK\n");
92 return PTR_ERR(gfclk);
93 }
94
95 parent_clk = clk_get(atl->dev, "dpll_abe_m2_ck");
96 if (IS_ERR(parent_clk)) {
97 dev_err(atl->dev, "failed to get new parent clock\n");
98 ret = PTR_ERR(parent_clk);
99 goto err1;
100 }
101
102 ret = clk_set_parent(gfclk, parent_clk);
103 if (ret) {
104 dev_err(atl->dev, "failed to reparent ATLPCLK\n");
105 goto err2;
106 }
107
108 atl->atlpclk_freq = clk_get_rate(gfclk);
109 dev_dbg(atl->dev, "ATLPCLK is at %u Hz\n", atl->atlpclk_freq);
110
111err2:
112 clk_put(parent_clk);
113err1:
114 clk_put(gfclk);