Merge "radio-tavarua: Configure channel spacing for enhanced search"
diff --git a/Documentation/devicetree/bindings/fb/mdss-mdp.txt b/Documentation/devicetree/bindings/fb/mdss-mdp.txt
index 0f31a38..17b878c 100644
--- a/Documentation/devicetree/bindings/fb/mdss-mdp.txt
+++ b/Documentation/devicetree/bindings/fb/mdss-mdp.txt
@@ -43,6 +43,11 @@
previous property, the amount of fetch ids
defined should match the number of offsets
defined in property: qcom,mdss-pipe-dma-off
+- qcom,mdss-smp-data: Array of shared memory pool data. There should
+ be only two values in this property. The first
+ value corresponds to the number of smp blocks
+ and the second is the size of each block
+ present in the mdss hardware.
- qcom,mdss-ctl-off: Array of offset addresses for the available ctl
hw blocks within MDP, these offsets are
calculated from register "mdp_phys" defined in
@@ -123,6 +128,7 @@
qcom,mdss-pipe-vig-fetch-id = <1 4 7>;
qcom,mdss-pipe-rgb-fetch-id = <16 17 18>;
qcom,mdss-pipe-dma-fetch-id = <10 13>;
+ qcom,mdss-smp-data = <22 4096>;
qcom,mdss-ctl-off = <0x00000600 0x00000700 0x00000800
0x00000900 0x0000A00>;
diff --git a/Documentation/devicetree/bindings/i2c/i2c-qup.txt b/Documentation/devicetree/bindings/i2c/i2c-qup.txt
index 60de396..a7976e8 100644
--- a/Documentation/devicetree/bindings/i2c/i2c-qup.txt
+++ b/Documentation/devicetree/bindings/i2c/i2c-qup.txt
@@ -24,6 +24,11 @@
desired I2C bus frequency. If this value is not
provided, the source clock is assumed to be running
at 19.2 MHz.
+ - qcom,scl-gpio : I2C clock GPIO number. Required for execution of bus
+ recovery procedure.
+ - qcom,sda-gpio : I2C data GPIO number. Required for execution of bus
+ recovery procedure.
+
Example:
i2c@f9966000 {
cell-index = <0>;
@@ -34,4 +39,6 @@
interrupt-names = "qup_err_intr";
qcom,i2c-bus-freq = <100000>;
qcom,i2c-src-freq = <24000000>;
+ qcom,scl-gpio = <&msmgpio 7 0>;
+ qcom,sda-gpio = <&msmgpio 6 0>;
};
diff --git a/Documentation/devicetree/bindings/sound/qcom-audio-dev.txt b/Documentation/devicetree/bindings/sound/qcom-audio-dev.txt
index fed8cb4..4cd9f99 100644
--- a/Documentation/devicetree/bindings/sound/qcom-audio-dev.txt
+++ b/Documentation/devicetree/bindings/sound/qcom-audio-dev.txt
@@ -434,6 +434,7 @@
- prim-auxpcm-gpio-sync : GPIO on which AUXPCM SYNC signal is coming.
- prim-auxpcm-gpio-din : GPIO on which AUXPCM DIN signal is coming.
- prim-auxpcm-gpio-dout : GPIO on which AUXPCM DOUT signal is coming.
+- qcom,us-euro-gpios : GPIO on which gnd/mic swap signal is coming.
Optional properties:
- qcom,hdmi-audio-rx: specifies if HDMI audio support is enabled or not.
@@ -476,6 +477,7 @@
qcom,cdc-mclk-gpios = <&pm8941_gpios 15 0>;
taiko-mclk-clk = <&pm8941_clkdiv1>;
qcom,taiko-mclk-clk-freq = <9600000>;
+ qcom,us-euro-gpios = <&pm8941_gpios 20 0>;
qcom,hdmi-audio-rx;
diff --git a/arch/arm/boot/dts/msm-pm8226.dtsi b/arch/arm/boot/dts/msm-pm8226.dtsi
index 6a07bad..c776fab 100644
--- a/arch/arm/boot/dts/msm-pm8226.dtsi
+++ b/arch/arm/boot/dts/msm-pm8226.dtsi
@@ -498,6 +498,12 @@
status = "disabled";
};
+ qcom,leds@d800 {
+ compatible = "qcom,leds-qpnp";
+ reg = <0xd800 0x100>;
+ label = "wled";
+ };
+
regulator@8000 {
regulator-name = "8226_lvs1";
reg = <0x8000 0x100>;
diff --git a/arch/arm/boot/dts/msm8226-cdp.dts b/arch/arm/boot/dts/msm8226-cdp.dts
index f01491f..0841c13 100644
--- a/arch/arm/boot/dts/msm8226-cdp.dts
+++ b/arch/arm/boot/dts/msm8226-cdp.dts
@@ -85,3 +85,27 @@
status = "ok";
};
+
+&spmi_bus {
+ qcom,pm8226@1 {
+ qcom,leds@d800 {
+ status = "okay";
+ qcom,wled_0 {
+ label = "wled";
+ linux,name = "wled:backlight";
+ linux,default-trigger = "bkl-trigger";
+ qcom,cs-out-en;
+ qcom,op-fdbck;
+ qcom,default-state = "on";
+ qcom,max-current = <25>;
+ qcom,ctrl-delay-us = <0>;
+ qcom,boost-curr-lim = <3>;
+ qcom,cp-sel = <0>;
+ qcom,switch-freq = <2>;
+ qcom,ovp-val = <2>;
+ qcom,num-strings = <1>;
+ qcom,id = <0>;
+ };
+ };
+ };
+};
diff --git a/arch/arm/boot/dts/msm8226-mdss.dtsi b/arch/arm/boot/dts/msm8226-mdss.dtsi
new file mode 100644
index 0000000..1691743
--- /dev/null
+++ b/arch/arm/boot/dts/msm8226-mdss.dtsi
@@ -0,0 +1,62 @@
+/* Copyright (c) 2013, The Linux Foundation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 and
+ * only version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+/ {
+ qcom,mdss_mdp@fd900000 {
+ compatible = "qcom,mdss_mdp";
+ reg = <0xfd900000 0x22100>,
+ <0xfd924000 0x1000>;
+ reg-names = "mdp_phys", "vbif_phys";
+ interrupts = <0 72 0>;
+ vdd-supply = <&gdsc_mdss>;
+
+ qcom,mdss-pipe-vig-off = <0x00001200>;
+ qcom,mdss-pipe-rgb-off = <0x00001E00>;
+ qcom,mdss-pipe-dma-off = <0x00002A00>;
+ qcom,mdss-pipe-vig-fetch-id = <1>;
+ qcom,mdss-pipe-rgb-fetch-id = <7>;
+ qcom,mdss-pipe-dma-fetch-id = <4>;
+ qcom,mdss-smp-data = <7 4096>;
+
+ qcom,mdss-ctl-off = <0x00000600 0x00000700>;
+ qcom,mdss-mixer-intf-off = <0x00003200>;
+ qcom,mdss-mixer-wb-off = <0x00003E00>;
+ qcom,mdss-dspp-off = <0x00004600>;
+ qcom,mdss-wb-off = <0x00011100 0x00013100>;
+ qcom,mdss-intf-off = <0x00000000 0x00021300>;
+
+ qcom,vbif-settings = <0x004 0x00000001>,
+ <0x0D8 0x00000707>,
+ <0x124 0x00000003>;
+ qcom,mdp-settings = <0x02E0 0x000000A9>,
+ <0x02E4 0x00000055>;
+
+ mdss_fb0: qcom,mdss_fb_primary {
+ cell-index = <0>;
+ compatible = "qcom,mdss-fb";
+ qcom,memory-reservation-type = "EBI1";
+ qcom,memory-reservation-size = <0x800000>;
+ };
+
+ mdss_fb1: qcom,mdss_fb_wfd {
+ cell-index = <1>;
+ compatible = "qcom,mdss-fb";
+ };
+ };
+
+ qcom,mdss_wb_panel {
+ compatible = "qcom,mdss_wb";
+ qcom,mdss_pan_res = <1280 720>;
+ qcom,mdss_pan_bpp = <24>;
+ qcom,mdss-fb-map = <&mdss_fb1>;
+ };
+};
diff --git a/arch/arm/boot/dts/msm8226-mtp.dts b/arch/arm/boot/dts/msm8226-mtp.dts
index 0242540..d55a6bd 100644
--- a/arch/arm/boot/dts/msm8226-mtp.dts
+++ b/arch/arm/boot/dts/msm8226-mtp.dts
@@ -82,3 +82,27 @@
status = "ok";
};
+
+&spmi_bus {
+ qcom,pm8226@1 {
+ qcom,leds@d800 {
+ status = "okay";
+ qcom,wled_0 {
+ label = "wled";
+ linux,name = "wled:backlight";
+ linux,default-trigger = "bkl-trigger";
+ qcom,cs-out-en;
+ qcom,op-fdbck;
+ qcom,default-state = "on";
+ qcom,max-current = <25>;
+ qcom,ctrl-delay-us = <0>;
+ qcom,boost-curr-lim = <3>;
+ qcom,cp-sel = <0>;
+ qcom,switch-freq = <2>;
+ qcom,ovp-val = <2>;
+ qcom,num-strings = <1>;
+ qcom,id = <0>;
+ };
+ };
+ };
+};
diff --git a/arch/arm/boot/dts/msm8226-qrd.dts b/arch/arm/boot/dts/msm8226-qrd.dts
index 65d4b33..a192561 100644
--- a/arch/arm/boot/dts/msm8226-qrd.dts
+++ b/arch/arm/boot/dts/msm8226-qrd.dts
@@ -85,3 +85,27 @@
status = "ok";
};
+
+&spmi_bus {
+ qcom,pm8226@1 {
+ qcom,leds@d800 {
+ status = "okay";
+ qcom,wled_0 {
+ label = "wled";
+ linux,name = "wled:backlight";
+ linux,default-trigger = "bkl-trigger";
+ qcom,cs-out-en;
+ qcom,op-fdbck;
+ qcom,default-state = "on";
+ qcom,max-current = <25>;
+ qcom,ctrl-delay-us = <0>;
+ qcom,boost-curr-lim = <3>;
+ qcom,cp-sel = <0>;
+ qcom,switch-freq = <2>;
+ qcom,ovp-val = <2>;
+ qcom,num-strings = <1>;
+ qcom,id = <0>;
+ };
+ };
+ };
+};
diff --git a/arch/arm/boot/dts/msm8226.dtsi b/arch/arm/boot/dts/msm8226.dtsi
index 741ffbd..df8737b 100644
--- a/arch/arm/boot/dts/msm8226.dtsi
+++ b/arch/arm/boot/dts/msm8226.dtsi
@@ -18,6 +18,7 @@
/include/ "msm8226-smp2p.dtsi"
/include/ "msm8226-gpu.dtsi"
/include/ "msm8226-bus.dtsi"
+/include/ "msm8226-mdss.dtsi"
/ {
model = "Qualcomm MSM 8226";
@@ -92,7 +93,7 @@
qcom,hsusb-otg-phy-type = <2>;
qcom,hsusb-otg-mode = <1>;
- qcom,hsusb-otg-otg-control = <1>;
+ qcom,hsusb-otg-otg-control = <2>;
qcom,hsusb-otg-disable-reset;
qcom,msm-bus,name = "usb2";
@@ -346,7 +347,7 @@
qcom,smem@fa00000 {
compatible = "qcom,smem";
reg = <0xfa00000 0x200000>,
- <0xfa006000 0x1000>,
+ <0xf9011000 0x1000>,
<0xfc428000 0x4000>;
reg-names = "smem", "irq-reg-base", "aux-mem1";
diff --git a/arch/arm/boot/dts/msm8610.dtsi b/arch/arm/boot/dts/msm8610.dtsi
index ce6011b..2dff4c7 100644
--- a/arch/arm/boot/dts/msm8610.dtsi
+++ b/arch/arm/boot/dts/msm8610.dtsi
@@ -166,7 +166,7 @@
qcom,smem@d600000 {
compatible = "qcom,smem";
reg = <0xd600000 0x200000>,
- <0xfa006000 0x1000>,
+ <0xf9011000 0x1000>,
<0xfc428000 0x4000>;
reg-names = "smem", "irq-reg-base", "aux-mem1";
diff --git a/arch/arm/boot/dts/msm8974-mdss.dtsi b/arch/arm/boot/dts/msm8974-mdss.dtsi
index 0b95419..f382c3e 100644
--- a/arch/arm/boot/dts/msm8974-mdss.dtsi
+++ b/arch/arm/boot/dts/msm8974-mdss.dtsi
@@ -27,6 +27,7 @@
qcom,mdss-pipe-vig-fetch-id = <1 4 7>;
qcom,mdss-pipe-rgb-fetch-id = <16 17 18>;
qcom,mdss-pipe-dma-fetch-id = <10 13>;
+ qcom,mdss-smp-data = <22 4096>;
qcom,mdss-ctl-off = <0x00000600 0x00000700 0x00000800
0x00000900 0x0000A00>;
diff --git a/arch/arm/boot/dts/msm8974-pm.dtsi b/arch/arm/boot/dts/msm8974-v1-pm.dtsi
similarity index 100%
rename from arch/arm/boot/dts/msm8974-pm.dtsi
rename to arch/arm/boot/dts/msm8974-v1-pm.dtsi
diff --git a/arch/arm/boot/dts/msm8974-v1.dtsi b/arch/arm/boot/dts/msm8974-v1.dtsi
index 64014b3..bccf0fe 100644
--- a/arch/arm/boot/dts/msm8974-v1.dtsi
+++ b/arch/arm/boot/dts/msm8974-v1.dtsi
@@ -19,6 +19,7 @@
/include/ "msm8974.dtsi"
/include/ "msm8974-v1-iommu.dtsi"
/include/ "msm8974-v1-iommu-domains.dtsi"
+/include/ "msm8974-v1-pm.dtsi"
/ {
android_usb@fc42b0c8 {
diff --git a/arch/arm/boot/dts/msm8974-v2-pm.dtsi b/arch/arm/boot/dts/msm8974-v2-pm.dtsi
new file mode 100644
index 0000000..4d98a1d
--- /dev/null
+++ b/arch/arm/boot/dts/msm8974-v2-pm.dtsi
@@ -0,0 +1,426 @@
+/* Copyright (c) 2013, The Linux Foundation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 and
+ * only version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+/include/ "skeleton.dtsi"
+
+/ {
+ qcom,spm@f9089000 {
+ compatible = "qcom,spm-v2";
+ #address-cells = <1>;
+ #size-cells = <1>;
+ reg = <0xf9089000 0x1000>;
+ qcom,core-id = <0>;
+ qcom,saw2-ver-reg = <0xfd0>;
+ qcom,saw2-cfg = <0x01>;
+ qcom,saw2-avs-ctl = <0>;
+ qcom,saw2-avs-hysteresis = <0>;
+ qcom,saw2-avs-limit = <0>;
+ qcom,saw2-avs-dly= <0>;
+ qcom,saw2-spm-dly= <0x3C102800>;
+ qcom,saw2-spm-ctl = <0x1>;
+ qcom,saw2-spm-cmd-wfi = [03 0b 0f];
+ qcom,saw2-spm-cmd-ret = [42 1b 00 d0 03 d4 5b 0b 00 42 1b 0f];
+ qcom,saw2-spm-cmd-spc = [00 20 50 80 60 70 10 E0 03 6E 70 3B
+ E4 5B 82 3F 50 10 0B 30 06 26 30 0F];
+ qcom,saw2-spm-cmd-pc = [00 20 50 80 60 70 10 E0 07 6E 70 3B
+ E4 5B 82 3F 50 10 0B 30 06 26 30 0F];
+ };
+
+ qcom,spm@f9099000 {
+ compatible = "qcom,spm-v2";
+ #address-cells = <1>;
+ #size-cells = <1>;
+ reg = <0xf9099000 0x1000>;
+ qcom,core-id = <1>;
+ qcom,saw2-ver-reg = <0xfd0>;
+ qcom,saw2-cfg = <0x01>;
+ qcom,saw2-avs-ctl = <0>;
+ qcom,saw2-avs-hysteresis = <0>;
+ qcom,saw2-avs-limit = <0>;
+ qcom,saw2-avs-dly= <0>;
+ qcom,saw2-spm-dly= <0x3C102800>;
+ qcom,saw2-spm-ctl = <0x1>;
+ qcom,saw2-spm-cmd-wfi = [03 0b 0f];
+ qcom,saw2-spm-cmd-ret = [42 1b 00 d0 03 d4 5b 0b 00 42 1b 0f];
+ qcom,saw2-spm-cmd-spc = [00 20 50 80 60 70 10 E0 03 6E 70 3B
+ E4 5B 82 3F 50 10 0B 30 06 26 30 0F];
+ qcom,saw2-spm-cmd-pc = [00 20 50 80 60 70 10 E0 07 6E 70 3B
+ E4 5B 82 3F 50 10 0B 30 06 26 30 0F];
+ };
+
+ qcom,spm@f90a9000 {
+ compatible = "qcom,spm-v2";
+ #address-cells = <1>;
+ #size-cells = <1>;
+ reg = <0xf90a9000 0x1000>;
+ qcom,core-id = <2>;
+ qcom,saw2-ver-reg = <0xfd0>;
+ qcom,saw2-cfg = <0x01>;
+ qcom,saw2-avs-ctl = <0>;
+ qcom,saw2-avs-hysteresis = <0>;
+ qcom,saw2-avs-limit = <0>;
+ qcom,saw2-avs-dly= <0>;
+ qcom,saw2-spm-dly= <0x3C102800>;
+ qcom,saw2-spm-ctl = <0x1>;
+ qcom,saw2-spm-cmd-wfi = [03 0b 0f];
+ qcom,saw2-spm-cmd-ret = [42 1b 00 d0 03 d4 5b 0b 00 42 1b 0f];
+ qcom,saw2-spm-cmd-spc = [00 20 50 80 60 70 10 E0 03 6E 70 3B
+ E4 5B 82 3F 50 10 0B 30 06 26 30 0F];
+ qcom,saw2-spm-cmd-pc = [00 20 50 80 60 70 10 E0 07 6E 70 3B
+ E4 5B 82 3F 50 10 0B 30 06 26 30 0F];
+ };
+
+ qcom,spm@f90b9000 {
+ compatible = "qcom,spm-v2";
+ #address-cells = <1>;
+ #size-cells = <1>;
+ reg = <0xf90b9000 0x1000>;
+ qcom,core-id = <3>;
+ qcom,saw2-ver-reg = <0xfd0>;
+ qcom,saw2-cfg = <0x01>;
+ qcom,saw2-avs-ctl = <0>;
+ qcom,saw2-avs-hysteresis = <0>;
+ qcom,saw2-avs-limit = <0>;
+ qcom,saw2-avs-dly= <0>;
+ qcom,saw2-spm-dly= <0x3C102800>;
+ qcom,saw2-spm-ctl = <0x1>;
+ qcom,saw2-spm-cmd-wfi = [03 0b 0f];
+ qcom,saw2-spm-cmd-ret = [42 1b 00 d0 03 d4 5b 0b 00 42 1b 0f];
+ qcom,saw2-spm-cmd-spc = [00 20 50 80 60 70 10 E0 03 6E 70 3B
+ E4 5B 82 3F 50 10 0B 30 06 26 30 0F];
+ qcom,saw2-spm-cmd-pc = [00 20 50 80 60 70 10 E0 07 6E 70 3B
+ E4 5B 82 3F 50 10 0B 30 06 26 30 0F];
+ };
+
+ qcom,spm@f9012000 {
+ compatible = "qcom,spm-v2";
+ #address-cells = <1>;
+ #size-cells = <1>;
+ reg = <0xf9012000 0x1000>;
+ qcom,core-id = <0xffff>; /* L2/APCS SAW */
+ qcom,saw2-ver-reg = <0xfd0>;
+ qcom,saw2-cfg = <0x14>;
+ qcom,saw2-avs-ctl = <0>;
+ qcom,saw2-avs-hysteresis = <0>;
+ qcom,saw2-avs-limit = <0>;
+ qcom,saw2-avs-dly= <0>;
+ qcom,saw2-spm-dly= <0x3C102800>;
+ qcom,saw2-spm-ctl = <0x1>;
+ qcom,saw2-pmic-data0 = <0x02030080>;
+ qcom,saw2-pmic-data1 = <0x00030000>;
+ qcom,vctl-timeout-us = <50>;
+ qcom,vctl-port = <0x0>;
+ qcom,phase-port = <0x1>;
+ qcom,pfm-port = <0x2>;
+ qcom,saw2-spm-cmd-ret = [1f 00 20 03 22 00 0f];
+ qcom,saw2-spm-cmd-gdhs = [00 20 32 60 70 80 42 07 78 80 44 22 50
+ 3b 60 02 32 50 0f];
+ qcom,saw2-spm-cmd-pc = [00 10 32 60 70 80 b0 11 42 07 01 b0 78
+ 80 12 44 50 3b 60 02 32 50 0f];
+ };
+
+ qcom,lpm-resources {
+ compatible = "qcom,lpm-resources";
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ qcom,lpm-resources@0 {
+ reg = <0x0>;
+ qcom,name = "vdd-dig";
+ qcom,resource-type = <0>;
+ qcom,type = <0x62706d73>; /* "smpb" */
+ qcom,id = <0x02>;
+ qcom,key = <0x6e726f63>; /* "corn" */
+ qcom,init-value = <5>; /* Super Turbo */
+ };
+
+ qcom,lpm-resources@1 {
+ reg = <0x1>;
+ qcom,name = "vdd-mem";
+ qcom,resource-type = <0>;
+ qcom,type = <0x62706d73>; /* "smpb" */
+ qcom,id = <0x01>;
+ qcom,key = <0x7675>; /* "uv" */
+ qcom,init-value = <1050000>; /* Super Turbo */
+ };
+
+ qcom,lpm-resources@2 {
+ reg = <0x2>;
+ qcom,name = "pxo";
+ qcom,resource-type = <0>;
+ qcom,type = <0x306b6c63>; /* "clk0" */
+ qcom,id = <0x00>;
+ qcom,key = <0x62616e45>; /* "Enab" */
+ qcom,init-value = <1>; /* On */
+ };
+
+ qcom,lpm-resources@3 {
+ reg = <0x3>;
+ qcom,name = "l2";
+ qcom,resource-type = <1>;
+ qcom,init-value = <2>; /* Retention */
+ };
+ };
+
+ qcom,lpm-levels {
+ compatible = "qcom,lpm-levels";
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ qcom,lpm-level@0 {
+ reg = <0x0>;
+ qcom,mode = <0>; /* MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT */
+ qcom,xo = <1>; /* ON */
+ qcom,l2 = <2>; /* Retention */
+ qcom,vdd-mem-upper-bound = <1050000>; /* SUPER TURBO */
+ qcom,vdd-mem-lower-bound = <950000>; /* NORMAL */
+ qcom,vdd-dig-upper-bound = <6>; /* SUPER TURBO */
+ qcom,vdd-dig-lower-bound = <4>; /* NORMAL */
+ qcom,irqs-detectable;
+ qcom.gpios-detectable;
+ qcom,latency-us = <1>;
+ qcom,ss-power = <784>;
+ qcom,energy-overhead = <190000>;
+ qcom,time-overhead = <100>;
+ };
+
+ qcom,lpm-level@1 {
+ reg = <0x1>;
+ qcom,mode = <4>; /* MSM_PM_SLEEP_MODE_RETENTION*/
+ qcom,xo = <1>; /* ON */
+ qcom,l2 = <2>; /* Retention */
+ qcom,vdd-mem-upper-bound = <1050000>; /* SUPER TURBO */
+ qcom,vdd-mem-lower-bound = <950000>; /* NORMAL */
+ qcom,vdd-dig-upper-bound = <6>; /* SUPER TURBO */
+ qcom,vdd-dig-lower-bound = <4>; /* NORMAL */
+ qcom,irqs-detectable;
+ qcom.gpios-detectable;
+ qcom,latency-us = <75>;
+ qcom,ss-power = <735>;
+ qcom,energy-overhead = <77341>;
+ qcom,time-overhead = <105>;
+ };
+
+ qcom,lpm-level@2 {
+ reg = <0x2>;
+ qcom,mode = <2>; /* MSM_PM_SLEEP_MODE_STANDALONE_POWER_COLLAPSE */
+ qcom,xo = <1>; /* ON */
+ qcom,l2 = <2>; /* Retention */
+ qcom,vdd-mem-upper-bound = <1050000>; /* SUPER TURBO */
+ qcom,vdd-mem-lower-bound = <950000>; /* NORMAL */
+ qcom,vdd-dig-upper-bound = <6>; /* SUPER TURBO */
+ qcom,vdd-dig-lower-bound = <4>; /* NORMAL */
+ qcom,irqs-detectable;
+ qcom.gpios-detectable;
+ qcom,latency-us = <95>;
+ qcom,ss-power = <725>;
+ qcom,energy-overhead = <99500>;
+ qcom,time-overhead = <130>;
+ };
+
+ qcom,lpm-level@3 {
+ reg = <0x3>;
+ qcom,mode = <3>; /* MSM_PM_SLEEP_MODE_POWER_COLLAPSE */
+ qcom,xo = <1>; /* ON */
+ qcom,l2 = <1>; /* GDHS */
+ qcom,vdd-mem-upper-bound = <1050000>; /* SUPER TURBO */
+ qcom,vdd-mem-lower-bound = <950000>; /* NORMAL */
+ qcom,vdd-dig-upper-bound = <6>; /* SUPER TURBO */
+ qcom,vdd-dig-lower-bound = <4>; /* NORMAL */
+ qcom,irqs-detectable;
+ qcom.gpios-detectable;
+ qcom,latency-us = <2000>;
+ qcom,ss-power = <138>;
+ qcom,energy-overhead = <1208400>;
+ qcom,time-overhead = <3200>;
+ };
+
+ qcom,lpm-level@4 {
+ reg = <0x4>;
+ qcom,mode = <3>; /* MSM_PM_SLEEP_MODE_POWER_COLLAPSE */
+ qcom,xo = <1>; /* ON */
+ qcom,l2 = <1>; /* GDHS */
+ qcom,vdd-mem-upper-bound = <1050000>; /* SUPER TURBO */
+ qcom,vdd-mem-lower-bound = <950000>; /* SVS SOC */
+ qcom,vdd-dig-upper-bound = <6>; /* SUPER TURBO */
+ qcom,vdd-dig-lower-bound = <3>; /* SVS SOC */
+ qcom,irqs-detectable;
+ qcom.gpios-detectable;
+ qcom,latency-us = <3000>;
+ qcom,ss-power = <110>;
+ qcom,energy-overhead = <1250300>;
+ qcom,time-overhead = <3500>;
+ };
+
+ qcom,lpm-level@5 {
+ reg = <0x5>;
+ qcom,mode = <3>; /* MSM_PM_SLEEP_MODE_POWER_COLLAPSE */
+ qcom,xo = <0>; /* OFF */
+ qcom,l2 = <1>; /* GDHS */
+ qcom,vdd-mem-upper-bound = <1050000>; /* SUPER TURBO */
+ qcom,vdd-mem-lower-bound = <950000>; /* NORMAL */
+ qcom,vdd-dig-upper-bound = <6>; /* SUPER TURBO */
+ qcom,vdd-dig-lower-bound = <4>; /* NORMAL */
+ qcom,latency-us = <3000>;
+ qcom,ss-power = <68>;
+ qcom,energy-overhead = <1350200>;
+ qcom,time-overhead = <4000>;
+ };
+
+ qcom,lpm-level@6 {
+ reg = <0x6>;
+ qcom,mode= <3>; /* MSM_PM_SLEEP_MODE_POWER_COLLAPSE */
+ qcom,xo = <0>; /* OFF */
+ qcom,l2 = <1>; /* GDHS */
+ qcom,vdd-mem-upper-bound = <950000>; /* NORMAL */
+ qcom,vdd-mem-lower-bound = <950000>; /* SVS SOC */
+ qcom,vdd-dig-upper-bound = <4>; /* NORMAL */
+ qcom,vdd-dig-lower-bound = <3>; /* SVS SOC */
+ qcom,latency-us = <18000>;
+ qcom,ss-power = <10>;
+ qcom,energy-overhead = <3202600>;
+ qcom,time-overhead = <27000>;
+ };
+
+ qcom,lpm-level@7 {
+ reg = <0x7>;
+ qcom,mode= <3>; /* MSM_PM_SLEEP_MODE_POWER_COLLAPSE */
+ qcom,xo = <0>; /* OFF */
+ qcom,l2 = <0>; /* OFF */
+ qcom,vdd-mem-upper-bound = <950000>; /* SVS SOC */
+ qcom,vdd-mem-lower-bound = <675000>; /* RETENTION */
+ qcom,vdd-dig-upper-bound = <3>; /* SVS SOC */
+ qcom,vdd-dig-lower-bound = <1>; /* RETENTION */
+ qcom,latency-us = <20000>;
+ qcom,ss-power = <2>;
+ qcom,energy-overhead = <4252000>;
+ qcom,time-overhead = <32000>;
+ };
+ };
+
+ qcom,pm-boot {
+ compatible = "qcom,pm-boot";
+ qcom,mode = <0>; /* MSM_PM_BOOT_CONFIG_TZ */
+ };
+
+ qcom,mpm@fc4281d0 {
+ compatible = "qcom,mpm-v2";
+ reg = <0xfc4281d0 0x1000>, /* MSM_RPM_MPM_BASE 4K */
+ <0xf9011008 0x4>; /* MSM_APCS_GCC_BASE 4K */
+ reg-names = "vmpm", "ipc";
+ interrupts = <0 171 1>;
+
+ qcom,ipc-bit-offset = <1>;
+
+ qcom,gic-parent = <&intc>;
+ qcom,gic-map = <47 172>, /* usb2_hsic_async_wakeup_irq */
+ <53 104>, /* mdss_irq */
+ <62 222>, /* ee0_krait_hlos_spmi_periph_irq */
+ <0xff 57>, /* mss_to_apps_irq(0) */
+ <0xff 58>, /* mss_to_apps_irq(1) */
+ <0xff 59>, /* mss_to_apps_irq(2) */
+ <0xff 60>, /* mss_to_apps_irq(3) */
+ <0xff 173>, /* o_wcss_apss_smd_hi */
+ <0xff 174>, /* o_wcss_apss_smd_med */
+ <0xff 175>, /* o_wcss_apss_smd_low */
+ <0xff 176>, /* o_wcss_apss_smsm_irq */
+ <0xff 177>, /* o_wcss_apss_wlan_data_xfer_done */
+ <0xff 178>, /* o_wcss_apss_wlan_rx_data_avail */
+ <0xff 179>, /* o_wcss_apss_asic_intr
+
+ <0xff 188>, /* lpass_irq_out_apcs(0) */
+ <0xff 189>, /* lpass_irq_out_apcs(1) */
+ <0xff 190>, /* lpass_irq_out_apcs(2) */
+ <0xff 191>, /* lpass_irq_out_apcs(3) */
+ <0xff 192>, /* lpass_irq_out_apcs(4) */
+ <0xff 193>, /* lpass_irq_out_apcs(5) */
+ <0xff 194>, /* lpass_irq_out_apcs(6) */
+ <0xff 195>, /* lpass_irq_out_apcs(7) */
+ <0xff 196>, /* lpass_irq_out_apcs(8) */
+ <0xff 197>, /* lpass_irq_out_apcs(9) */
+ <0xff 200>, /* rpm_ipc(4) */
+ <0xff 201>, /* rpm_ipc(5) */
+ <0xff 202>, /* rpm_ipc(6) */
+ <0xff 203>, /* rpm_ipc(7) */
+ <0xff 204>, /* rpm_ipc(24) */
+ <0xff 205>, /* rpm_ipc(25) */
+ <0xff 206>, /* rpm_ipc(26) */
+ <0xff 207>, /* rpm_ipc(27) */
+ <0xff 240>; /* summary_irq_kpss */
+
+ qcom,gpio-parent = <&msmgpio>;
+ qcom,gpio-map = <3 102>,
+ <4 1 >,
+ <5 5 >,
+ <6 9 >,
+ <7 18>,
+ <8 20>,
+ <9 24>,
+ <10 27>,
+ <11 28>,
+ <12 34>,
+ <13 35>,
+ <14 37>,
+ <15 42>,
+ <16 44>,
+ <17 46>,
+ <18 50>,
+ <19 54>,
+ <20 59>,
+ <21 61>,
+ <22 62>,
+ <23 64>,
+ <24 65>,
+ <25 66>,
+ <26 67>,
+ <27 68>,
+ <28 71>,
+ <29 72>,
+ <30 73>,
+ <31 74>,
+ <32 75>,
+ <33 77>,
+ <34 79>,
+ <35 80>,
+ <36 82>,
+ <37 86>,
+ <38 92>,
+ <39 93>,
+ <40 95>;
+ };
+
+ qcom,pm-8x60@fe805664 {
+ compatible = "qcom,pm-8x60";
+ reg = <0xfe805664 0x40>;
+ qcom,pc-mode = <0>; /*MSM_PC_TZ_L2_INT */
+ qcom,use-sync-timer;
+ qcom,saw-turns-off-pll;
+ };
+
+ qcom,rpm-log@fc19dc00 {
+ compatible = "qcom,rpm-log";
+ reg = <0xfc19dc00 0x4000>;
+ qcom,rpm-addr-phys = <0xfc000000>;
+ qcom,offset-version = <4>;
+ qcom,offset-page-buffer-addr = <36>;
+ qcom,offset-log-len = <40>;
+ qcom,offset-log-len-mask = <44>;
+ qcom,offset-page-indices = <56>;
+ };
+
+ qcom,rpm-stats@0xfc19dbd0{
+ compatible = "qcom,rpm-stats";
+ reg = <0xfc19dbd0 0x1000>;
+ reg-names = "phys_addr_base";
+ qcom,sleep-stats-version = <2>;
+ };
+};
diff --git a/arch/arm/boot/dts/msm8974-v2.dtsi b/arch/arm/boot/dts/msm8974-v2.dtsi
index 3dda20f..16cdeb1 100644
--- a/arch/arm/boot/dts/msm8974-v2.dtsi
+++ b/arch/arm/boot/dts/msm8974-v2.dtsi
@@ -19,6 +19,7 @@
/include/ "msm8974.dtsi"
/include/ "msm8974-v2-iommu.dtsi"
/include/ "msm8974-v2-iommu-domains.dtsi"
+/include/ "msm8974-v2-pm.dtsi"
/ {
android_usb@fe8050c8 {
diff --git a/arch/arm/boot/dts/msm8974.dtsi b/arch/arm/boot/dts/msm8974.dtsi
index e7714f2..ab6b7c8 100644
--- a/arch/arm/boot/dts/msm8974.dtsi
+++ b/arch/arm/boot/dts/msm8974.dtsi
@@ -11,7 +11,6 @@
*/
/include/ "skeleton.dtsi"
-/include/ "msm8974-pm.dtsi"
/include/ "msm8974-camera.dtsi"
/include/ "msm8974-coresight.dtsi"
/include/ "msm-gdsc.dtsi"
@@ -344,6 +343,7 @@
reg-names = "hc_mem", "core_mem";
interrupts = <0 123 0>, <0 138 0>;
interrupt-names = "hc_irq", "pwr_irq";
+ qcom,bus-speed-mode = "HS200_1p8v", "DDR_1p8v";
status = "disable";
};
@@ -1231,7 +1231,7 @@
qcom,smem@fa00000 {
compatible = "qcom,smem";
reg = <0xfa00000 0x200000>,
- <0xfa006000 0x1000>,
+ <0xf9011000 0x1000>,
<0xfc428000 0x4000>;
reg-names = "smem", "irq-reg-base", "aux-mem1";
diff --git a/arch/arm/boot/dts/msm9625-pm.dtsi b/arch/arm/boot/dts/msm9625-pm.dtsi
index 1880965..e881977 100644
--- a/arch/arm/boot/dts/msm9625-pm.dtsi
+++ b/arch/arm/boot/dts/msm9625-pm.dtsi
@@ -162,6 +162,22 @@
qcom,mode= <3>; /* MSM_PM_SLEEP_MODE_POWER_COLLAPSE */
qcom,xo = <0>; /* OFF */
qcom,l2 = <0>; /* OFF */
+ qcom,vdd-mem-upper-bound = <1050000>; /* SUPER TURBO */
+ qcom,vdd-mem-lower-bound = <950000>; /* SVS SOC */
+ qcom,vdd-dig-upper-bound = <6>; /* SUPER TURBO */
+ qcom,vdd-dig-lower-bound = <3>; /* SVS SOC */
+ qcom,irqs-detectable;
+ qcom,latency-us = <8000>;
+ qcom,ss-power = <1800>;
+ qcom,energy-overhead = <71950000>;
+ qcom,time-overhead = <15300>;
+ };
+
+ qcom,lpm-level@6 {
+ reg = <0x6>;
+ qcom,mode= <3>; /* MSM_PM_SLEEP_MODE_POWER_COLLAPSE */
+ qcom,xo = <0>; /* OFF */
+ qcom,l2 = <0>; /* OFF */
qcom,vdd-mem-upper-bound = <950000>; /* SVS SOC */
qcom,vdd-mem-lower-bound = <675000>; /* RETENTION */
qcom,vdd-dig-upper-bound = <3>; /* SVS SOC */
diff --git a/arch/arm/boot/dts/msm9625.dtsi b/arch/arm/boot/dts/msm9625.dtsi
index 935ee2c..03eaaf3 100644
--- a/arch/arm/boot/dts/msm9625.dtsi
+++ b/arch/arm/boot/dts/msm9625.dtsi
@@ -104,8 +104,8 @@
hsic@f9a15000 {
compatible = "qcom,hsic-host";
reg = <0xf9a15000 0x400>;
- interrupts = <0 136 0>;
- interrupt-names = "core_irq";
+ interrupts = <0 136 0>, <0 148 0>;
+ interrupt-names = "core_irq", "async_irq";
HSIC_VDDCX-supply = <&pm8019_l12>;
HSIC_GDSC-supply = <&gdsc_usb_hsic>;
@@ -634,7 +634,7 @@
qcom,smem@fa00000 {
compatible = "qcom,smem";
reg = <0xfa00000 0x200000>,
- <0xfa006000 0x1000>,
+ <0xf9011000 0x1000>,
<0xfc428000 0x4000>;
reg-names = "smem", "irq-reg-base", "aux-mem1";
diff --git a/arch/arm/configs/msm7627a-perf_defconfig b/arch/arm/configs/msm7627a-perf_defconfig
index 8e948c2..8eac20f 100644
--- a/arch/arm/configs/msm7627a-perf_defconfig
+++ b/arch/arm/configs/msm7627a-perf_defconfig
@@ -374,7 +374,6 @@
CONFIG_PRINTK_TIME=y
CONFIG_MAGIC_SYSRQ=y
CONFIG_DEBUG_SHIRQ=y
-# CONFIG_SCHED_DEBUG is not set
CONFIG_TIMER_STATS=y
CONFIG_DEBUG_STACK_USAGE=y
CONFIG_DEBUG_INFO=y
diff --git a/arch/arm/configs/msm7630-perf_defconfig b/arch/arm/configs/msm7630-perf_defconfig
index f2d25ac..e46b835 100644
--- a/arch/arm/configs/msm7630-perf_defconfig
+++ b/arch/arm/configs/msm7630-perf_defconfig
@@ -372,7 +372,6 @@
CONFIG_PRINTK_TIME=y
CONFIG_MAGIC_SYSRQ=y
CONFIG_DEBUG_FS=y
-# CONFIG_SCHED_DEBUG is not set
CONFIG_TIMER_STATS=y
# CONFIG_DEBUG_PREEMPT is not set
CONFIG_DEBUG_INFO=y
diff --git a/arch/arm/configs/msm8610_defconfig b/arch/arm/configs/msm8610_defconfig
index df4ae19..7ddb6e0c 100644
--- a/arch/arm/configs/msm8610_defconfig
+++ b/arch/arm/configs/msm8610_defconfig
@@ -114,6 +114,8 @@
CONFIG_NET_SCH_HTB=y
CONFIG_NET_SCH_PRIO=y
CONFIG_NET_CLS_FW=y
+CONFIG_SYNC=y
+CONFIG_SW_SYNC=y
CONFIG_BLK_DEV_LOOP=y
CONFIG_BLK_DEV_RAM=y
CONFIG_MD=y
@@ -160,7 +162,14 @@
CONFIG_ION_MSM=y
CONFIG_MSM_KGSL=y
CONFIG_FB=y
-CONFIG_FB_VIRTUAL=y
+CONFIG_FB_MSM=y
+# CONFIG_FB_MSM_BACKLIGHT is not set
+CONFIG_FB_MSM_MDSS=y
+CONFIG_FB_MSM_MDSS_WRITEBACK=y
+CONFIG_BACKLIGHT_LCD_SUPPORT=y
+# CONFIG_LCD_CLASS_DEVICE is not set
+CONFIG_BACKLIGHT_CLASS_DEVICE=y
+# CONFIG_BACKLIGHT_GENERIC is not set
CONFIG_SOUND=y
CONFIG_SND=y
CONFIG_SND_SOC=y
@@ -185,11 +194,15 @@
CONFIG_ANDROID_RAM_CONSOLE=y
CONFIG_ANDROID_TIMED_GPIO=y
CONFIG_ANDROID_LOW_MEMORY_KILLER=y
+CONFIG_QPNP_PWM=y
CONFIG_MSM_IOMMU=y
CONFIG_MSM_IOMMU_PMON=y
CONFIG_SPS=y
CONFIG_SPS_SUPPORT_NDP_BAM=y
CONFIG_MMC_MSM_SPS_SUPPORT=y
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_CLASS=y
+CONFIG_LEDS_QPNP=y
CONFIG_RTC_CLASS=y
# CONFIG_RTC_DRV_MSM is not set
CONFIG_RTC_DRV_QPNP=y
diff --git a/arch/arm/configs/msm8660-perf_defconfig b/arch/arm/configs/msm8660-perf_defconfig
index 828484a..baefac5 100644
--- a/arch/arm/configs/msm8660-perf_defconfig
+++ b/arch/arm/configs/msm8660-perf_defconfig
@@ -438,7 +438,6 @@
CONFIG_NLS_ISO8859_1=y
CONFIG_PRINTK_TIME=y
CONFIG_MAGIC_SYSRQ=y
-# CONFIG_SCHED_DEBUG is not set
CONFIG_TIMER_STATS=y
# CONFIG_DEBUG_PREEMPT is not set
CONFIG_DEBUG_INFO=y
diff --git a/arch/arm/configs/msm8960-perf_defconfig b/arch/arm/configs/msm8960-perf_defconfig
index 7362ea0..8232a8d 100644
--- a/arch/arm/configs/msm8960-perf_defconfig
+++ b/arch/arm/configs/msm8960-perf_defconfig
@@ -510,7 +510,6 @@
CONFIG_NLS_ISO8859_1=y
CONFIG_PRINTK_TIME=y
CONFIG_MAGIC_SYSRQ=y
-# CONFIG_SCHED_DEBUG is not set
CONFIG_TIMER_STATS=y
# CONFIG_DEBUG_PREEMPT is not set
CONFIG_DEBUG_INFO=y
diff --git a/arch/arm/configs/msm8974-perf_defconfig b/arch/arm/configs/msm8974-perf_defconfig
index 65b68c5..c6be3c5 100644
--- a/arch/arm/configs/msm8974-perf_defconfig
+++ b/arch/arm/configs/msm8974-perf_defconfig
@@ -445,7 +445,6 @@
CONFIG_NLS_ISO8859_1=y
CONFIG_PRINTK_TIME=y
CONFIG_MAGIC_SYSRQ=y
-# CONFIG_SCHED_DEBUG is not set
CONFIG_TIMER_STATS=y
# CONFIG_DEBUG_PREEMPT is not set
CONFIG_DEBUG_INFO=y
diff --git a/arch/arm/mach-msm/board-8226-gpiomux.c b/arch/arm/mach-msm/board-8226-gpiomux.c
index 8be5525..c1971c1 100644
--- a/arch/arm/mach-msm/board-8226-gpiomux.c
+++ b/arch/arm/mach-msm/board-8226-gpiomux.c
@@ -93,6 +93,28 @@
},
};
+static struct gpiomux_setting sd_card_det_active_config = {
+ .func = GPIOMUX_FUNC_GPIO,
+ .drv = GPIOMUX_DRV_2MA,
+ .pull = GPIOMUX_PULL_NONE,
+ .dir = GPIOMUX_IN,
+};
+
+static struct gpiomux_setting sd_card_det_sleep_config = {
+ .func = GPIOMUX_FUNC_GPIO,
+ .drv = GPIOMUX_DRV_2MA,
+ .pull = GPIOMUX_PULL_UP,
+ .dir = GPIOMUX_IN,
+};
+
+static struct msm_gpiomux_config sd_card_det __initdata = {
+ .gpio = 38,
+ .settings = {
+ [GPIOMUX_ACTIVE] = &sd_card_det_active_config,
+ [GPIOMUX_SUSPENDED] = &sd_card_det_sleep_config,
+ },
+};
+
void __init msm8226_init_gpiomux(void)
{
int rc;
@@ -108,4 +130,6 @@
#endif
msm_gpiomux_install(msm_blsp_configs, ARRAY_SIZE(msm_blsp_configs));
+
+ msm_gpiomux_install(&sd_card_det, 1);
}
diff --git a/arch/arm/mach-msm/clock-8226.c b/arch/arm/mach-msm/clock-8226.c
index 119eeb2..1a98b78 100644
--- a/arch/arm/mach-msm/clock-8226.c
+++ b/arch/arm/mach-msm/clock-8226.c
@@ -3197,12 +3197,12 @@
CLK_LOOKUP("pixel_clk", mdss_pclk0_clk.c, "fd922800.qcom,mdss_dsi"),
CLK_LOOKUP("iface_clk", mdss_ahb_clk.c, "mdss_dsi_clk_ctrl"),
- CLK_LOOKUP("core_clk", mdss_mdp_clk.c, "mdp.0"),
- CLK_LOOKUP("lut_clk", mdss_mdp_lut_clk.c, "mdp.0"),
- CLK_LOOKUP("core_clk_src", mdp_clk_src.c, "mdp.0"),
- CLK_LOOKUP("vsync_clk", mdss_vsync_clk.c, "mdp.0"),
- CLK_LOOKUP("iface_clk", mdss_ahb_clk.c, "mdp.0"),
- CLK_LOOKUP("bus_clk", mdss_axi_clk.c, "mdp.0"),
+ CLK_LOOKUP("core_clk", mdss_mdp_clk.c, "fd900000.qcom,mdss_mdp"),
+ CLK_LOOKUP("lut_clk", mdss_mdp_lut_clk.c, "fd900000.qcom,mdss_mdp"),
+ CLK_LOOKUP("core_clk_src", mdp_clk_src.c, "fd900000.qcom,mdss_mdp"),
+ CLK_LOOKUP("vsync_clk", mdss_vsync_clk.c, "fd900000.qcom,mdss_mdp"),
+ CLK_LOOKUP("iface_clk", mdss_ahb_clk.c, "fd900000.qcom,mdss_mdp"),
+ CLK_LOOKUP("bus_clk", mdss_axi_clk.c, "fd900000.qcom,mdss_mdp"),
CLK_LOOKUP("iface_clk", mdss_ahb_clk.c, "fd928000.qcom,iommu"),
CLK_LOOKUP("core_clk", mdss_axi_clk.c, "fd928000.qcom,iommu"),
diff --git a/arch/arm/mach-msm/include/mach/msm_smd.h b/arch/arm/mach-msm/include/mach/msm_smd.h
index 2748636..a8c7bb7 100644
--- a/arch/arm/mach-msm/include/mach/msm_smd.h
+++ b/arch/arm/mach-msm/include/mach/msm_smd.h
@@ -1,7 +1,7 @@
/* linux/include/asm-arm/arch-msm/msm_smd.h
*
* Copyright (C) 2007 Google, Inc.
- * Copyright (c) 2009-2012, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2009-2013, The Linux Foundation. All rights reserved.
* Author: Brian Swetland <swetland@google.com>
*
* This software is licensed under the terms of the GNU General Public
@@ -141,8 +141,8 @@
* @size: size of the region in bytes
*/
struct smd_smem_regions {
- void *phys_addr;
- unsigned size;
+ phys_addr_t phys_addr;
+ resource_size_t size;
};
struct smd_platform {
diff --git a/arch/arm/mach-msm/smd.c b/arch/arm/mach-msm/smd.c
index 10e40b4..cffb211 100644
--- a/arch/arm/mach-msm/smd.c
+++ b/arch/arm/mach-msm/smd.c
@@ -172,13 +172,13 @@
};
struct smem_area {
- void *phys_addr;
- unsigned size;
+ phys_addr_t phys_addr;
+ resource_size_t size;
void __iomem *virt_addr;
};
static uint32_t num_smem_areas;
static struct smem_area *smem_areas;
-static void *smem_range_check(void *base, unsigned offset);
+static void *smem_range_check(phys_addr_t base, unsigned offset);
struct interrupt_stat interrupt_stats[NUM_SMD_SUBSYSTEMS];
@@ -2365,11 +2365,11 @@
* @base: physical base address to check
* @offset: offset from the base to get the final address
*/
-static void *smem_range_check(void *base, unsigned offset)
+static void *smem_range_check(phys_addr_t base, unsigned offset)
{
int i;
- void *phys_addr;
- unsigned size;
+ phys_addr_t phys_addr;
+ resource_size_t size;
for (i = 0; i < num_smem_areas; ++i) {
phys_addr = smem_areas[i].phys_addr;
@@ -2464,7 +2464,7 @@
ret = (void *) (MSM_SHARED_RAM_BASE + toc[id].offset);
else
ret = smem_range_check(
- (void *)(toc[id].reserved & BASE_ADDR_MASK),
+ toc[id].reserved & BASE_ADDR_MASK,
toc[id].offset);
} else {
*size = 0;
@@ -3466,10 +3466,10 @@
(unsigned long)(smem_areas[smem_idx].phys_addr),
smem_areas[smem_idx].size);
if (!smem_areas[smem_idx].virt_addr) {
- pr_err("%s: ioremap_nocache() of addr:%p"
- " size: %x\n", __func__,
- smem_areas[smem_idx].phys_addr,
- smem_areas[smem_idx].size);
+ pr_err("%s: ioremap_nocache() of addr: %pa size: %pa\n",
+ __func__,
+ &smem_areas[smem_idx].phys_addr,
+ &smem_areas[smem_idx].size);
err_ret = -ENOMEM;
++smem_idx;
goto smem_failed;
@@ -3712,8 +3712,8 @@
char *key;
struct resource *r;
void *irq_out_base;
- void *aux_mem_base;
- uint32_t aux_mem_size;
+ phys_addr_t aux_mem_base;
+ resource_size_t aux_mem_size;
int temp_string_size = 11; /* max 3 digit count */
char temp_string[temp_string_size];
int count;
@@ -3721,6 +3721,7 @@
int ret;
const char *compatible;
int subnode_num = 0;
+ resource_size_t irq_out_size;
disable_smsm_reset_handshake = 1;
@@ -3730,7 +3731,13 @@
pr_err("%s: missing '%s'\n", __func__, key);
return -ENODEV;
}
- irq_out_base = (void *)(r->start);
+ irq_out_size = resource_size(r);
+ irq_out_base = ioremap_nocache(r->start, irq_out_size);
+ if (!irq_out_base) {
+ pr_err("%s: ioremap_nocache() of irq_out_base addr:%pr size:%pr\n",
+ __func__, &r->start, &irq_out_size);
+ return -ENOMEM;
+ }
SMD_DBG("%s: %s = %p", __func__, key, irq_out_base);
count = 1;
@@ -3766,20 +3773,20 @@
temp_string);
if (!r)
break;
- aux_mem_base = (void *)(r->start);
- aux_mem_size = (uint32_t)(resource_size(r));
- SMD_DBG("%s: %s = %p %x", __func__, temp_string,
- aux_mem_base, aux_mem_size);
+ aux_mem_base = r->start;
+ aux_mem_size = resource_size(r);
+ SMD_DBG("%s: %s = %pa %pa", __func__, temp_string,
+ &aux_mem_base, &aux_mem_size);
smem_areas[count - 1].phys_addr = aux_mem_base;
smem_areas[count - 1].size = aux_mem_size;
smem_areas[count - 1].virt_addr = ioremap_nocache(
(unsigned long)(smem_areas[count-1].phys_addr),
smem_areas[count - 1].size);
if (!smem_areas[count - 1].virt_addr) {
- pr_err("%s: ioremap_nocache() of addr:%p size: %x\n",
+ pr_err("%s: ioremap_nocache() of addr:%pa size: %pa\n",
__func__,
- smem_areas[count - 1].phys_addr,
- smem_areas[count - 1].size);
+ &smem_areas[count - 1].phys_addr,
+ &smem_areas[count - 1].size);
ret = -ENOMEM;
goto free_smem_areas;
}
diff --git a/drivers/gpu/msm/z180.c b/drivers/gpu/msm/z180.c
index 8f03ccb..e578b0e 100644
--- a/drivers/gpu/msm/z180.c
+++ b/drivers/gpu/msm/z180.c
@@ -817,9 +817,9 @@
{
int status = -EINVAL;
- /* Don't wait forever, set a max (10 sec) value for now */
+ /* Don't wait forever, set a max of Z180_IDLE_TIMEOUT */
if (msecs == -1)
- msecs = 10 * MSEC_PER_SEC;
+ msecs = Z180_IDLE_TIMEOUT;
mutex_unlock(&device->mutex);
status = z180_wait(device, context, timestamp, msecs);
diff --git a/drivers/i2c/busses/i2c-qup.c b/drivers/i2c/busses/i2c-qup.c
index ca0a439..a77dacb 100644
--- a/drivers/i2c/busses/i2c-qup.c
+++ b/drivers/i2c/busses/i2c-qup.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009-2012, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2009-2013, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -29,13 +29,14 @@
#include <linux/mutex.h>
#include <linux/timer.h>
#include <linux/slab.h>
-#include <mach/board.h>
-#include <mach/gpiomux.h>
#include <linux/slab.h>
#include <linux/pm_runtime.h>
#include <linux/gpio.h>
#include <linux/of.h>
#include <linux/of_i2c.h>
+#include <linux/of_gpio.h>
+#include <mach/board.h>
+#include <mach/gpiomux.h>
MODULE_LICENSE("GPL v2");
MODULE_VERSION("0.2");
@@ -131,6 +132,7 @@
#define DEFAULT_CLK_RATE (19200000)
#define I2C_STATUS_CLK_STATE 13
#define QUP_OUT_FIFO_NOT_EMPTY 0x10
+#define I2C_GPIOS_DT_CNT (2) /* sda and scl */
static char const * const i2c_rsrcs[] = {"i2c_clk", "i2c_sda"};
@@ -1088,6 +1090,72 @@
return ret;
}
+enum msm_i2c_dt_entry_status {
+ DT_REQUIRED,
+ DT_SUGGESTED,
+ DT_OPTIONAL,
+};
+
+enum msm_i2c_dt_entry_type {
+ DT_U32,
+ DT_GPIO,
+};
+
+struct msm_i2c_dt_to_pdata_map {
+ const char *dt_name;
+ int *ptr_data;
+ enum msm_i2c_dt_entry_status status;
+ enum msm_i2c_dt_entry_type type;
+ int default_val;
+};
+
+int __devinit msm_i2c_rsrcs_dt_to_pdata_map(struct platform_device *pdev,
+ struct msm_i2c_platform_data *pdata, int *gpios)
+{
+ int ret, err = 0;
+ struct device_node *node = pdev->dev.of_node;
+ struct msm_i2c_dt_to_pdata_map *itr;
+ struct msm_i2c_dt_to_pdata_map map[] = {
+ {"qcom,i2c-bus-freq", &pdata->clk_freq , DT_REQUIRED , DT_U32 , 0},
+ {"cell-index" , &pdev->id , DT_REQUIRED , DT_U32 , -1},
+ {"qcom,i2c-src-freq", &pdata->src_clk_rate, DT_SUGGESTED, DT_U32, 0},
+ {"qcom,scl-gpio" , gpios , DT_OPTIONAL , DT_GPIO, -1},
+ {"qcom,sda-gpio" , gpios + 1 , DT_OPTIONAL , DT_GPIO, -1},
+ {NULL , NULL , 0 , 0 , 0},
+ };
+
+ for (itr = map; itr->dt_name ; ++itr) {
+ if (itr->type == DT_GPIO) {
+ ret = of_get_named_gpio(node, itr->dt_name, 0);
+ if (ret >= 0) {
+ *itr->ptr_data = ret;
+ ret = 0;
+ }
+ } else {
+ ret = of_property_read_u32(node, itr->dt_name,
+ itr->ptr_data);
+ }
+
+ dev_dbg(&pdev->dev, "DT entry ret:%d name:%s val:%d\n",
+ ret, itr->dt_name, *itr->ptr_data);
+
+ if (ret) {
+ *itr->ptr_data = itr->default_val;
+
+ if (itr->status < DT_OPTIONAL) {
+ dev_err(&pdev->dev, "Missing '%s' DT entry\n",
+ itr->dt_name);
+
+ /* cont on err to dump all missing entries */
+ if (itr->status == DT_REQUIRED && !err)
+ err = ret;
+ }
+ }
+ }
+
+ return err;
+}
+
static u32
qup_i2c_func(struct i2c_adapter *adap)
{
@@ -1106,28 +1174,23 @@
struct resource *qup_mem, *gsbi_mem, *qup_io, *gsbi_io, *res;
struct resource *in_irq, *out_irq, *err_irq;
struct clk *clk, *pclk;
- int ret = 0;
- int i;
+ int ret = 0;
+ int i;
+ int dt_gpios[I2C_GPIOS_DT_CNT];
+ bool use_device_tree = pdev->dev.of_node;
struct msm_i2c_platform_data *pdata;
gsbi_mem = NULL;
dev_dbg(&pdev->dev, "qup_i2c_probe\n");
- if (pdev->dev.of_node) {
- struct device_node *node = pdev->dev.of_node;
- pdata = kzalloc(sizeof(*pdata), GFP_KERNEL);
+ if (use_device_tree) {
+ pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
if (!pdata)
return -ENOMEM;
- ret = of_property_read_u32(node, "qcom,i2c-bus-freq",
- &pdata->clk_freq);
+
+ ret = msm_i2c_rsrcs_dt_to_pdata_map(pdev, pdata, dt_gpios);
if (ret)
goto get_res_failed;
- ret = of_property_read_u32(node, "cell-index", &pdev->id);
- if (ret)
- goto get_res_failed;
- /* Optional property */
- of_property_read_u32(node, "qcom,i2c-src-freq",
- &pdata->src_clk_rate);
} else
pdata = pdev->dev.platform_data;
@@ -1247,9 +1310,13 @@
}
for (i = 0; i < ARRAY_SIZE(i2c_rsrcs); ++i) {
- res = platform_get_resource_byname(pdev, IORESOURCE_IO,
- i2c_rsrcs[i]);
- dev->i2c_gpios[i] = res ? res->start : -1;
+ if (use_device_tree && i < I2C_GPIOS_DT_CNT) {
+ dev->i2c_gpios[i] = dt_gpios[i];
+ } else {
+ res = platform_get_resource_byname(pdev, IORESOURCE_IO,
+ i2c_rsrcs[i]);
+ dev->i2c_gpios[i] = res ? res->start : -1;
+ }
}
platform_set_drvdata(pdev, dev);
@@ -1261,8 +1328,7 @@
if (dev->pdata->src_clk_rate <= 0) {
dev_info(&pdev->dev,
- "No src_clk_rate specified in platfrom data or "
- "qcom,i2c-src-freq in DT\n");
+ "No src_clk_rate specified in platfrom data\n");
dev_info(&pdev->dev, "Using default clock rate %dHz\n",
DEFAULT_CLK_RATE);
dev->pdata->src_clk_rate = DEFAULT_CLK_RATE;
diff --git a/drivers/media/platform/msm/vidc/msm_v4l2_vidc.c b/drivers/media/platform/msm/vidc/msm_v4l2_vidc.c
index 96c0139..4f8c257 100644
--- a/drivers/media/platform/msm/vidc/msm_v4l2_vidc.c
+++ b/drivers/media/platform/msm/vidc/msm_v4l2_vidc.c
@@ -785,13 +785,6 @@
res->load_freq_tbl = NULL;
}
-static inline void msm_vidc_free_iommu_maps(
- struct msm_vidc_platform_resources *res)
-{
- kfree(res->iommu_maps);
- res->iommu_maps = NULL;
-}
-
static inline void msm_vidc_free_reg_table(
struct msm_vidc_platform_resources *res)
{
@@ -864,60 +857,6 @@
return rc;
}
-static int msm_vidc_load_iommu_maps(struct msm_vidc_platform_resources *res)
-{
- int rc = 0;
- int num_elements = 0;
- int i;
- struct platform_device *pdev = res->pdev;
- char *names[MAX_MAP] = {
- [CP_MAP] = "qcom,vidc-cp-map",
- [NS_MAP] = "qcom,vidc-ns-map",
- };
- char *contexts[MAX_MAP] = {
- [CP_MAP] = "venus_cp",
- [NS_MAP] = "venus_ns",
- };
-
-
- res->iommu_maps = kzalloc(MAX_MAP * sizeof(*res->iommu_maps),
- GFP_KERNEL);
- if (!res->iommu_maps) {
- dprintk(VIDC_ERR, "%s Failed to alloc iommu_maps\n", __func__);
- return -ENOMEM;
- }
-
- res->iommu_maps_size = MAX_MAP;
- for (i = 0; i < MAX_MAP; i++) {
- num_elements = get_u32_array_num_elements(pdev, names[i]);
- if ((num_elements == 0)) {
- if (i == NS_MAP) {
- dprintk(VIDC_ERR,
- "Domain not found in dtsi file :%s\n",
- names[i]);
- goto error;
- } else
- continue;
- }
- memcpy(&res->iommu_maps[i].name, names[i],
- strlen(names[i]));
- memcpy(&res->iommu_maps[i].ctx, contexts[i],
- strlen(contexts[i]));
-
- if (of_property_read_u32_array(pdev->dev.of_node, names[i],
- res->iommu_maps[i].addr_range, num_elements * 2)) {
- dprintk(VIDC_ERR, "Failed to read iommu map :%s\n",
- names[i]);
- rc = -EINVAL;
- goto error;
- }
- }
- return rc;
-error:
- msm_vidc_free_iommu_maps(res);
- return rc;
-}
-
static int msm_vidc_load_reg_table(struct msm_vidc_platform_resources *res)
{
struct reg_set *reg_set;
@@ -1267,11 +1206,6 @@
dprintk(VIDC_ERR, "Failed to load freq table: %d\n", rc);
goto err_load_freq_table;
}
- rc = msm_vidc_load_iommu_maps(res);
- if (rc) {
- dprintk(VIDC_ERR, "Failed to load iommu maps: %d\n", rc);
- goto err_load_iommu_maps;
- }
rc = msm_vidc_load_reg_table(res);
if (rc) {
dprintk(VIDC_ERR, "Failed to load reg table: %d\n", rc);
@@ -1302,8 +1236,6 @@
err_load_bus_vectors:
msm_vidc_free_reg_table(res);
err_load_reg_table:
- msm_vidc_free_iommu_maps(res);
-err_load_iommu_maps:
msm_vidc_free_freq_table(res);
err_load_freq_table:
return rc;
@@ -1315,7 +1247,6 @@
struct resource *kres = NULL;
struct platform_device *pdev = res->pdev;
struct msm_vidc_v4l2_platform_data *pdata = pdev->dev.platform_data;
- int64_t start, size;
int c = 0, rc = 0;
if (!pdata) {
@@ -1346,33 +1277,6 @@
res->load_freq_tbl[c].load = pdata->load_table[c][0];
res->load_freq_tbl[c].freq = pdata->load_table[c][1];
}
-
- res->iommu_maps = kzalloc(MAX_MAP *
- sizeof(*res->iommu_maps), GFP_KERNEL);
- if (!res->iommu_maps) {
- dprintk(VIDC_ERR, "%s Failed to alloc iommu_maps\n",
- __func__);
- kfree(res->load_freq_tbl);
- return -ENOMEM;
- }
-
- res->iommu_maps_size = MAX_MAP;
-
- start = pdata->iommu_table[MSM_VIDC_V4L2_IOMMU_MAP_CP][0];
- size = pdata->iommu_table[MSM_VIDC_V4L2_IOMMU_MAP_CP][1];
- res->iommu_maps[CP_MAP] = (struct msm_vidc_iommu_info) {
- .addr_range = {(u32) start, (u32) size},
- .name = "qcom,vidc-cp-map",
- .ctx = "venus_cp",
- };
-
- start = pdata->iommu_table[MSM_VIDC_V4L2_IOMMU_MAP_NS][0];
- size = pdata->iommu_table[MSM_VIDC_V4L2_IOMMU_MAP_NS][1];
- res->iommu_maps[NS_MAP] = (struct msm_vidc_iommu_info) {
- .addr_range = {(u32) start, (u32) size},
- .name = "qcom,vidc-ns-map",
- .ctx = "venus_ns",
- };
return rc;
}
@@ -1529,7 +1433,6 @@
v4l2_device_unregister(&core->v4l2_dev);
msm_vidc_free_freq_table(&core->resources);
- msm_vidc_free_iommu_maps(&core->resources);
msm_vidc_free_reg_table(&core->resources);
msm_vidc_free_bus_vectors(&core->resources);
msm_vidc_free_iommu_groups(&core->resources);
diff --git a/drivers/media/platform/msm/vidc/msm_vidc.c b/drivers/media/platform/msm/vidc/msm_vidc.c
index 4de524c..218987e 100644
--- a/drivers/media/platform/msm/vidc/msm_vidc.c
+++ b/drivers/media/platform/msm/vidc/msm_vidc.c
@@ -82,18 +82,16 @@
return rc;
}
-int msm_vidc_get_iommu_maps(void *instance,
- struct msm_vidc_iommu_info maps[MAX_MAP])
+int msm_vidc_get_iommu_domain_partition(void *instance, u32 flags,
+ enum v4l2_buf_type buf_type, int *domain, int *partition)
{
struct msm_vidc_inst *inst = instance;
- struct hfi_device *hdev;
- if (!inst || !maps || !inst->core || !inst->core->device)
+ if (!inst || !inst->core || !inst->core->device)
return -EINVAL;
- hdev = inst->core->device;
-
- return call_hfi_op(hdev, iommu_get_map, hdev->hfi_device_data, maps);
+ return msm_comm_get_domain_partition(inst, flags, buf_type, domain,
+ partition);
}
int msm_vidc_querycap(void *instance, struct v4l2_capability *cap)
diff --git a/drivers/media/platform/msm/vidc/msm_vidc_common.c b/drivers/media/platform/msm/vidc/msm_vidc_common.c
index 731bc95..71c5597 100644
--- a/drivers/media/platform/msm/vidc/msm_vidc_common.c
+++ b/drivers/media/platform/msm/vidc/msm_vidc_common.c
@@ -2298,6 +2298,41 @@
return ret;
};
+int msm_comm_get_domain_partition(struct msm_vidc_inst *inst, u32 flags,
+ enum v4l2_buf_type buf_type, int *domain, int *partition)
+{
+ struct hfi_device *hdev;
+ u32 hal_buffer_type = 0;
+ if (!inst || !inst->core || !inst->core->device)
+ return -EINVAL;
+
+ hdev = inst->core->device;
+
+ /*
+ * TODO: Due to the way in which the underlying smem mechanism
+ * maps buffer types to corresponding IOMMU domains, we need to
+ * pass in HAL_BUFFER_OUTPUT for input buffers (and vice versa)
+ * so that buffers are mapped into the correct domains. In the
+ * future, we should try to remove this workaround.
+ */
+ switch (buf_type) {
+ case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE:
+ hal_buffer_type = (inst->session_type == MSM_VIDC_ENCODER) ?
+ HAL_BUFFER_INPUT : HAL_BUFFER_OUTPUT;
+ break;
+ case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE:
+ hal_buffer_type = (inst->session_type == MSM_VIDC_ENCODER) ?
+ HAL_BUFFER_OUTPUT : HAL_BUFFER_INPUT;
+ break;
+ default:
+ dprintk(VIDC_ERR, "v4l2 buf type not found %d\n", buf_type);
+ return -ENOTSUPP;
+ }
+ return call_hfi_op(hdev, iommu_get_domain_partition,
+ hdev->hfi_device_data, flags, hal_buffer_type, domain,
+ partition);
+};
+
int msm_vidc_trigger_ssr(struct msm_vidc_core *core,
enum hal_ssr_trigger_type type)
{
diff --git a/drivers/media/platform/msm/vidc/msm_vidc_common.h b/drivers/media/platform/msm/vidc/msm_vidc_common.h
index f9d52bb..4f3deb6 100644
--- a/drivers/media/platform/msm/vidc/msm_vidc_common.h
+++ b/drivers/media/platform/msm/vidc/msm_vidc_common.h
@@ -39,6 +39,8 @@
int msm_comm_force_cleanup(struct msm_vidc_inst *inst);
enum hal_extradata_id msm_comm_get_hal_extradata_index(
enum v4l2_mpeg_vidc_extradata index);
+int msm_comm_get_domain_partition(struct msm_vidc_inst *inst, u32 flags,
+ enum v4l2_buf_type buf_type, int *domain, int *partition);
struct hal_buffer_requirements *get_buff_req_buffer(
struct msm_vidc_inst *inst, u32 buffer_type);
#define IS_PRIV_CTRL(idx) (\
diff --git a/drivers/media/platform/msm/vidc/msm_vidc_resources.h b/drivers/media/platform/msm/vidc/msm_vidc_resources.h
index e77e8d3..54c0878 100644
--- a/drivers/media/platform/msm/vidc/msm_vidc_resources.h
+++ b/drivers/media/platform/msm/vidc/msm_vidc_resources.h
@@ -69,8 +69,6 @@
uint32_t irq;
struct load_freq_table *load_freq_tbl;
uint32_t load_freq_tbl_size;
- struct msm_vidc_iommu_info *iommu_maps;
- uint32_t iommu_maps_size;
struct reg_set reg_set;
struct msm_bus_scale_pdata *bus_pdata;
struct iommu_set iommu_group_set;
diff --git a/drivers/media/platform/msm/vidc/q6_hfi.c b/drivers/media/platform/msm/vidc/q6_hfi.c
index 25cc239..88dc4fe 100644
--- a/drivers/media/platform/msm/vidc/q6_hfi.c
+++ b/drivers/media/platform/msm/vidc/q6_hfi.c
@@ -1113,25 +1113,14 @@
return 0;
}
-static int q6_hfi_get_domain(void *dev, enum msm_vidc_io_maps iomap)
+static int q6_hfi_iommu_get_domain_partition(void *dev, u32 flags,
+ u32 buffer_type, int *domain, int *partition)
{
(void)dev;
- (void)iomap;
dprintk(VIDC_ERR, "Not implemented: %s", __func__);
- return 0;
-}
-
-static int q6_hfi_iommu_get_map(void *dev,
- struct msm_vidc_iommu_info maps[MAX_MAP])
-{
- (void)dev;
- (void)maps;
-
- dprintk(VIDC_ERR, "Not implemented: %s", __func__);
-
- return 0;
+ return -ENOTSUPP;
}
static int q6_hfi_iommu_attach(void *dev)
@@ -1230,8 +1219,7 @@
hdev->alloc_ocmem = q6_hfi_alloc_ocmem;
hdev->free_ocmem = q6_hfi_free_ocmem;
hdev->is_ocmem_present = q6_hfi_is_ocmem_present;
- hdev->get_domain = q6_hfi_get_domain;
- hdev->iommu_get_map = q6_hfi_iommu_get_map;
+ hdev->iommu_get_domain_partition = q6_hfi_iommu_get_domain_partition;
hdev->load_fw = q6_hfi_load_fw;
hdev->unload_fw = q6_hfi_unload_fw;
hdev->get_fw_info = q6_hfi_get_fw_info;
diff --git a/drivers/media/platform/msm/vidc/venus_hfi.c b/drivers/media/platform/msm/vidc/venus_hfi.c
index d0d3312..8c30b6c 100644
--- a/drivers/media/platform/msm/vidc/venus_hfi.c
+++ b/drivers/media/platform/msm/vidc/venus_hfi.c
@@ -2044,22 +2044,11 @@
struct iommu_domain *domain;
int rc = 0, i = 0;
struct iommu_set *iommu_group_set;
- struct msm_vidc_iommu_info *io_map;
struct iommu_info *iommu_map;
if (!device || !res)
return -EINVAL;
- io_map = device->resources.io_map;
- strlcpy(io_map[CP_MAP].name, "vidc-cp-map",
- sizeof(io_map[CP_MAP].name));
- strlcpy(io_map[CP_MAP].ctx, "venus_cp",
- sizeof(io_map[CP_MAP].ctx));
- strlcpy(io_map[NS_MAP].name, "vidc-ns-map",
- sizeof(io_map[NS_MAP].name));
- strlcpy(io_map[NS_MAP].ctx, "venus_ns",
- sizeof(io_map[NS_MAP].ctx));
-
iommu_group_set = &device->res->iommu_group_set;
for (i = 0; i < iommu_group_set->count; i++) {
@@ -2084,12 +2073,6 @@
domain);
goto fail_group;
}
- if (i < MAX_MAP) {
- memcpy(io_map[i].addr_range,
- &res->iommu_maps[i].addr_range,
- sizeof(u32) * 2);
- io_map[i].domain = iommu_map->domain;
- }
}
return rc;
@@ -2554,32 +2537,19 @@
}
}
-static int venus_hfi_get_domain(void *dev, enum msm_vidc_io_maps iomap)
+static int venus_hfi_iommu_get_domain_partition(void *dev, u32 flags,
+ u32 buffer_type, int *domain, int *partition)
{
struct venus_hfi_device *device = dev;
- if (!device || iomap < CP_MAP || iomap >= MAX_MAP) {
- dprintk(VIDC_ERR, "%s: Invalid parameter: %p iomap: %d\n",
- __func__, device, iomap);
- return -EINVAL;
- }
- return device->resources.io_map[iomap].domain;
-}
-static int venus_hfi_iommu_get_map(void *dev,
- struct msm_vidc_iommu_info maps[MAX_MAP])
-{
- int i = 0;
- struct venus_hfi_device *device = dev;
-
- if (!device || !maps) {
- dprintk(VIDC_ERR, "%s: Invalid param device: %p maps: %p\n",
- __func__, device, maps);
+ if (!device) {
+ dprintk(VIDC_ERR, "%s: Invalid param device: %p\n",
+ __func__, device);
return -EINVAL;
}
- for (i = 0; i < MAX_MAP; i++)
- maps[i] = device->resources.io_map[i];
-
+ msm_smem_get_domain_partition(device->hal_client, flags, buffer_type,
+ domain, partition);
return 0;
}
@@ -2871,8 +2841,7 @@
hdev->alloc_ocmem = venus_hfi_alloc_ocmem;
hdev->free_ocmem = venus_hfi_free_ocmem;
hdev->is_ocmem_present = venus_hfi_is_ocmem_present;
- hdev->get_domain = venus_hfi_get_domain;
- hdev->iommu_get_map = venus_hfi_iommu_get_map;
+ hdev->iommu_get_domain_partition = venus_hfi_iommu_get_domain_partition;
hdev->load_fw = venus_hfi_load_fw;
hdev->unload_fw = venus_hfi_unload_fw;
hdev->get_fw_info = venus_hfi_get_fw_info;
diff --git a/drivers/media/platform/msm/vidc/venus_hfi.h b/drivers/media/platform/msm/vidc/venus_hfi.h
index 2ffb9d4..7a96ff4 100644
--- a/drivers/media/platform/msm/vidc/venus_hfi.h
+++ b/drivers/media/platform/msm/vidc/venus_hfi.h
@@ -164,7 +164,6 @@
struct venus_resources {
struct msm_vidc_fw fw;
- struct msm_vidc_iommu_info io_map[MAX_MAP];
struct venus_core_clock clock[VCODEC_MAX_CLKS];
struct venus_bus_info bus_info;
struct on_chip_mem ocmem;
diff --git a/drivers/media/platform/msm/vidc/vidc_hfi_api.h b/drivers/media/platform/msm/vidc/vidc_hfi_api.h
index fe68c4b..fad29f1 100644
--- a/drivers/media/platform/msm/vidc/vidc_hfi_api.h
+++ b/drivers/media/platform/msm/vidc/vidc_hfi_api.h
@@ -1047,9 +1047,8 @@
int (*alloc_ocmem)(void *dev, unsigned long size);
int (*free_ocmem)(void *dev);
int (*is_ocmem_present)(void *dev);
- int (*get_domain)(void *dev, enum msm_vidc_io_maps iomap);
- int (*iommu_get_map)(void *dev,
- struct msm_vidc_iommu_info maps[MAX_MAP]);
+ int (*iommu_get_domain_partition)(void *dev, u32 flags, u32 buffer_type,
+ int *domain_num, int *partition_num);
int (*load_fw)(void *dev);
void (*unload_fw)(void *dev);
int (*get_fw_info)(void *dev, enum fw_info info);
diff --git a/drivers/media/platform/msm/wfd/enc-venus-subdev.c b/drivers/media/platform/msm/wfd/enc-venus-subdev.c
index b41ece6..40362f0 100644
--- a/drivers/media/platform/msm/wfd/enc-venus-subdev.c
+++ b/drivers/media/platform/msm/wfd/enc-venus-subdev.c
@@ -46,7 +46,6 @@
bool callback_thread_running;
struct completion dq_complete, cmd_complete;
bool secure;
- int domain;
};
int venc_load_fw(struct v4l2_subdev *sd)
@@ -252,18 +251,6 @@
return msm_vidc_s_ctrl(inst->vidc_context, &ctrl);
}
-static long get_iommu_domain(struct venc_inst *inst)
-{
- struct msm_vidc_iommu_info maps[MAX_MAP];
- int rc = msm_vidc_get_iommu_maps(inst->vidc_context, maps);
- if (rc) {
- WFD_MSG_ERR("Failed to retreive domain mappings\n");
- return rc;
- }
-
- return maps[inst->secure ? CP_MAP : NS_MAP].domain;
-}
-
static long venc_open(struct v4l2_subdev *sd, void *arg)
{
struct venc_inst *inst = NULL;
@@ -316,12 +303,6 @@
goto vidc_subscribe_fail;
}
- inst->domain = get_iommu_domain(inst);
- if (inst->domain < 0) {
- WFD_MSG_ERR("Failed to get domain\n");
- goto vidc_subscribe_fail;
- }
-
inst->callback_thread = kthread_run(venc_vidc_callback_thread, inst,
"venc_vidc_callback_thread");
if (IS_ERR(inst->callback_thread)) {
@@ -641,7 +622,9 @@
struct mem_region *mregion)
{
int rc = 0;
- unsigned long size = 0, align_req = 0;
+ unsigned long size = 0, align_req = 0, flags = 0;
+ int domain = 0, partition = 0;
+
if (!mregion) {
rc = -EINVAL;
goto venc_map_fail;
@@ -663,6 +646,12 @@
goto venc_map_fail;
}
+ rc = ion_handle_get_flags(venc_ion_client, mregion->ion_handle, &flags);
+ if (rc) {
+ WFD_MSG_ERR("Failed to get ion flags %d\n", rc);
+ goto venc_map_fail;
+ }
+
if (!inst->secure) {
mregion->kvaddr = ion_map_kernel(venc_ion_client,
mregion->ion_handle);
@@ -685,10 +674,16 @@
}
}
- rc = ion_map_iommu(venc_ion_client, mregion->ion_handle,
- inst->domain, 0, align_req, 0,
- (unsigned long *)&mregion->paddr, &size, 0, 0);
+ rc = msm_vidc_get_iommu_domain_partition(inst->vidc_context,
+ flags, BUF_TYPE_OUTPUT, &domain, &partition);
+ if (rc) {
+ WFD_MSG_ERR("Failed to get domain for output buffer\n");
+ goto venc_domain_fail;
+ }
+ rc = ion_map_iommu(venc_ion_client, mregion->ion_handle,
+ domain, partition, align_req, 0,
+ (unsigned long *)&mregion->paddr, &size, 0, 0);
if (rc) {
WFD_MSG_ERR("Failed to map into iommu\n");
goto venc_map_iommu_map_fail;
@@ -700,8 +695,8 @@
return 0;
venc_map_iommu_size_fail:
ion_unmap_iommu(venc_ion_client, mregion->ion_handle,
- inst->domain, 0);
-
+ domain, partition);
+venc_domain_fail:
if (inst->secure)
msm_ion_unsecure_buffer(venc_ion_client, mregion->ion_handle);
venc_map_iommu_map_fail:
@@ -714,12 +709,28 @@
static int venc_unmap_user_to_kernel(struct venc_inst *inst,
struct mem_region *mregion)
{
+ unsigned long flags = 0;
+ int domain = 0, partition = 0, rc = 0;
+
if (!mregion || !mregion->ion_handle)
return 0;
+ rc = ion_handle_get_flags(venc_ion_client, mregion->ion_handle, &flags);
+ if (rc) {
+ WFD_MSG_ERR("Failed to get ion flags %d\n", rc);
+ return rc;
+ }
+
+ rc = msm_vidc_get_iommu_domain_partition(inst->vidc_context,
+ flags, BUF_TYPE_OUTPUT, &domain, &partition);
+ if (rc) {
+ WFD_MSG_ERR("Failed to get domain for input buffer\n");
+ return rc;
+ }
+
if (mregion->paddr) {
ion_unmap_iommu(venc_ion_client, mregion->ion_handle,
- inst->domain, 0);
+ domain, partition);
mregion->paddr = NULL;
}
@@ -731,7 +742,7 @@
if (inst->secure)
msm_ion_unsecure_buffer(venc_ion_client, mregion->ion_handle);
- return 0;
+ return rc;
}
static long venc_set_output_buffer(struct v4l2_subdev *sd, void *arg)
@@ -1145,7 +1156,8 @@
{
struct mem_region_map *mmap = arg;
struct mem_region *mregion = NULL;
- unsigned long rc = 0, size = 0, align_req = 0;
+ unsigned long size = 0, align_req = 0, flags = 0;
+ int domain = 0, partition = 0, rc = 0;
void *paddr = NULL;
struct venc_inst *inst = NULL;
@@ -1167,21 +1179,34 @@
goto venc_map_bad_align;
}
+ rc = ion_handle_get_flags(mmap->ion_client, mregion->ion_handle,
+ &flags);
+ if (rc) {
+ WFD_MSG_ERR("Failed to get ion flags %d\n", rc);
+ goto venc_map_bad_align;
+ }
+
if (inst->secure) {
rc = msm_ion_secure_buffer(mmap->ion_client,
- mregion->ion_handle, VIDEO_PIXEL, 0);
+ mregion->ion_handle, VIDEO_PIXEL, 0);
if (rc) {
WFD_MSG_ERR("Failed to secure input buffer\n");
goto venc_map_bad_align;
}
}
- rc = ion_map_iommu(mmap->ion_client, mregion->ion_handle,
- inst->domain, 0, align_req, 0, (unsigned long *)&paddr,
- &size, 0, 0);
-
+ rc = msm_vidc_get_iommu_domain_partition(inst->vidc_context,
+ flags, BUF_TYPE_INPUT, &domain, &partition);
if (rc) {
- WFD_MSG_ERR("Failed to get physical addr %ld\n", rc);
+ WFD_MSG_ERR("Failed to get domain for output buffer\n");
+ goto venc_map_domain_fail;
+ }
+
+ rc = ion_map_iommu(mmap->ion_client, mregion->ion_handle,
+ domain, partition, align_req, 0,
+ (unsigned long *)&paddr, &size, 0, 0);
+ if (rc) {
+ WFD_MSG_ERR("Failed to get physical addr %d\n", rc);
paddr = NULL;
goto venc_map_bad_align;
} else if (size < mregion->size) {
@@ -1191,12 +1216,12 @@
}
mregion->paddr = paddr;
- return 0;
+ return rc;
venc_map_iommu_size_fail:
ion_unmap_iommu(venc_ion_client, mregion->ion_handle,
- inst->domain, 0);
-
+ domain, partition);
+venc_map_domain_fail:
if (inst->secure)
msm_ion_unsecure_buffer(mmap->ion_client, mregion->ion_handle);
venc_map_bad_align:
@@ -1208,6 +1233,8 @@
struct mem_region_map *mmap = arg;
struct mem_region *mregion = NULL;
struct venc_inst *inst = NULL;
+ unsigned long flags = 0;
+ int domain = 0, partition = 0, rc = 0;
if (!sd) {
WFD_MSG_ERR("Subdevice required for %s\n", __func__);
@@ -1220,14 +1247,28 @@
inst = (struct venc_inst *)sd->dev_priv;
mregion = mmap->mregion;
+ rc = ion_handle_get_flags(mmap->ion_client,
+ mregion->ion_handle, &flags);
+ if (rc) {
+ WFD_MSG_ERR("Failed to get ion flags %d\n", rc);
+ return rc;
+ }
+
+ rc = msm_vidc_get_iommu_domain_partition(inst->vidc_context,
+ flags, BUF_TYPE_INPUT, &domain, &partition);
+ if (rc) {
+ WFD_MSG_ERR("Failed to get domain for input buffer\n");
+ return rc;
+ }
+
if (mregion->paddr)
ion_unmap_iommu(mmap->ion_client, mregion->ion_handle,
- inst->domain, 0);
+ domain, partition);
if (inst->secure)
msm_ion_unsecure_buffer(mmap->ion_client, mregion->ion_handle);
- return 0;
+ return rc;
}
static long venc_set_framerate_mode(struct v4l2_subdev *sd,
@@ -1239,24 +1280,6 @@
return 0;
}
-static long secure_toggle(struct venc_inst *inst, bool secure)
-{
- if (inst->secure == secure)
- return 0;
-
- if (!list_empty(&inst->registered_input_bufs.list) ||
- !list_empty(&inst->registered_output_bufs.list)) {
- WFD_MSG_ERR(
- "Attempt to (un)secure encoder not allowed after registering buffers"
- );
- return -EEXIST;
- }
-
- inst->secure = secure;
- inst->domain = get_iommu_domain(inst);
- return 0;
-}
-
static long venc_secure(struct v4l2_subdev *sd)
{
struct venc_inst *inst = NULL;
@@ -1269,9 +1292,18 @@
}
inst = sd->dev_priv;
- rc = secure_toggle(inst, true);
- if (rc) {
- WFD_MSG_ERR("Failed to toggle into secure mode\n");
+
+ if (!list_empty(&inst->registered_input_bufs.list) ||
+ !list_empty(&inst->registered_output_bufs.list)) {
+ WFD_MSG_ERR(
+ "Attempt to (un)secure encoder not allowed after registering buffers"
+ );
+ rc = -EEXIST;
+ }
+
+ if (inst->secure) {
+ /* Nothing to do! */
+ rc = 0;
goto secure_fail;
}
@@ -1282,9 +1314,8 @@
goto secure_fail;
}
- return 0;
+ inst->secure = true;
secure_fail:
- secure_toggle(sd->dev_priv, false);
return rc;
}
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index 5694999..f060718 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -1567,6 +1567,8 @@
return ret;
}
+static void dwc3_gadget_disconnect_interrupt(struct dwc3 *dwc);
+
static int dwc3_gadget_vbus_session(struct usb_gadget *_gadget, int is_active)
{
struct dwc3 *dwc = gadget_to_dwc(_gadget);
@@ -1597,17 +1599,18 @@
} else {
ret = dwc3_gadget_run_stop(dwc, 0);
}
- } else if (dwc->gadget_driver && !dwc->softconnect &&
- !dwc->vbus_active) {
- if (dwc->gadget_driver->disconnect) {
- spin_unlock_irqrestore(&dwc->lock, flags);
- dwc->gadget_driver->disconnect(&dwc->gadget);
- return 0;
- }
+ }
+
+ /*
+ * Clearing run/stop bit might occur before disconnect event is seen.
+ * Make sure to let gadget driver know in that case.
+ */
+ if (!dwc->vbus_active && dwc->start_config_issued) {
+ dev_dbg(dwc->dev, "calling disconnect from %s\n", __func__);
+ dwc3_gadget_disconnect_interrupt(dwc);
}
spin_unlock_irqrestore(&dwc->lock, flags);
-
return ret;
}
diff --git a/drivers/usb/otg/msm_otg.c b/drivers/usb/otg/msm_otg.c
index c03ca69..6ef4f3d 100644
--- a/drivers/usb/otg/msm_otg.c
+++ b/drivers/usb/otg/msm_otg.c
@@ -3038,7 +3038,7 @@
set_bit(A_SRP_DET, &motg->inputs);
set_bit(A_BUS_REQ, &motg->inputs);
work = 1;
- } else if (otgsc & OTGSC_BSVIS) {
+ } else if ((otgsc & OTGSC_BSVIE) && (otgsc & OTGSC_BSVIS)) {
writel_relaxed(otgsc, USB_OTGSC);
/*
* BSV interrupt comes when operating as an A-device
@@ -3157,7 +3157,15 @@
static bool init;
struct msm_otg *motg = the_msm_otg;
- /* Ignore received BSV interrupts, if ID pin is GND */
+ if (online) {
+ pr_debug("PMIC: BSV set\n");
+ set_bit(B_SESS_VLD, &motg->inputs);
+ } else {
+ pr_debug("PMIC: BSV clear\n");
+ clear_bit(B_SESS_VLD, &motg->inputs);
+ }
+
+ /* do not queue state m/c work if id is grounded */
if (!test_bit(ID, &motg->inputs)) {
/*
* state machine work waits for initial VBUS
@@ -3166,17 +3174,8 @@
*/
if (init)
return;
- goto complete;
}
- if (online) {
- pr_debug("PMIC: BSV set\n");
- set_bit(B_SESS_VLD, &motg->inputs);
- } else {
- pr_debug("PMIC: BSV clear\n");
- clear_bit(B_SESS_VLD, &motg->inputs);
- }
-complete:
if (!init) {
init = true;
complete(&pmic_vbus_init);
diff --git a/drivers/video/msm/mdss/mdss_mdp.c b/drivers/video/msm/mdss/mdss_mdp.c
index e4099ad..977fc63 100644
--- a/drivers/video/msm/mdss/mdss_mdp.c
+++ b/drivers/video/msm/mdss/mdss_mdp.c
@@ -124,6 +124,7 @@
char *prop_name, u32 *offsets, int len);
static int mdss_mdp_parse_dt_prop_len(struct platform_device *pdev,
char *prop_name);
+static int mdss_mdp_parse_dt_smp(struct platform_device *pdev);
static inline int mdss_irq_dispatch(u32 hw_ndx, int irq, void *ptr)
{
@@ -808,10 +809,6 @@
mdata->clk_ctrl_wq = create_singlethread_workqueue("mdp_clk_wq");
INIT_WORK(&mdata->clk_ctrl_worker, mdss_mdp_clk_ctrl_workqueue_handler);
- mdata->smp_mb_cnt = MDSS_MDP_SMP_MMB_BLOCKS;
- mdata->smp_mb_size = MDSS_MDP_SMP_MMB_SIZE;
-
-
mdata->iclient = msm_ion_client_create(-1, mdata->pdev->name);
if (IS_ERR_OR_NULL(mdata->iclient)) {
pr_err("msm_ion_client_create() return error (%p)\n",
@@ -1045,6 +1042,12 @@
return rc;
}
+ rc = mdss_mdp_parse_dt_smp(pdev);
+ if (rc) {
+ pr_err("Error in device tree : smp\n");
+ return rc;
+ }
+
return 0;
}
@@ -1305,6 +1308,30 @@
return rc;
}
+static int mdss_mdp_parse_dt_smp(struct platform_device *pdev)
+{
+ struct mdss_data_type *mdata = platform_get_drvdata(pdev);
+ u32 num;
+ u32 data[2];
+ int rc;
+
+ num = mdss_mdp_parse_dt_prop_len(pdev, "qcom,mdss-smp-data");
+
+ if (num != 2)
+ return -EINVAL;
+
+ rc = mdss_mdp_parse_dt_handler(pdev, "qcom,mdss-smp-data", data, num);
+ if (rc)
+ return rc;
+
+ rc = mdss_mdp_smp_setup(mdata, data[0], data[1]);
+
+ if (rc)
+ pr_err("unable to setup smp data\n");
+
+ return rc;
+}
+
static int mdss_mdp_parse_dt_handler(struct platform_device *pdev,
char *prop_name, u32 *offsets, int len)
{
diff --git a/drivers/video/msm/mdss/mdss_mdp.h b/drivers/video/msm/mdss/mdss_mdp.h
index e4f78ad..efd93c0 100644
--- a/drivers/video/msm/mdss/mdss_mdp.h
+++ b/drivers/video/msm/mdss/mdss_mdp.h
@@ -355,6 +355,7 @@
int mdss_mdp_pipe_pp_setup(struct mdss_mdp_pipe *pipe, u32 *op);
int mdss_mdp_pipe_sspp_setup(struct mdss_mdp_pipe *pipe, u32 *op);
void mdss_mdp_pipe_sspp_term(struct mdss_mdp_pipe *pipe);
+int mdss_mdp_smp_setup(struct mdss_data_type *mdata, u32 cnt, u32 size);
int mdss_hw_init(struct mdss_data_type *mdata);
diff --git a/drivers/video/msm/mdss/mdss_mdp_hwio.h b/drivers/video/msm/mdss/mdss_mdp_hwio.h
index d4ffaff..f8cd0ce 100644
--- a/drivers/video/msm/mdss/mdss_mdp_hwio.h
+++ b/drivers/video/msm/mdss/mdss_mdp_hwio.h
@@ -447,8 +447,7 @@
#define MDSS_MDP_REG_SMP_ALLOC_W0 0x00180
#define MDSS_MDP_REG_SMP_ALLOC_R0 0x00230
-#define MDSS_MDP_SMP_MMB_SIZE 4096
-#define MDSS_MDP_SMP_MMB_BLOCKS 22
+#define MDSS_MDP_SMP_MMB_BLOCKS 22
enum mdss_mdp_smp_client_index {
MDSS_MDP_SMP_CLIENT_UNUSED,
diff --git a/drivers/video/msm/mdss/mdss_mdp_pipe.c b/drivers/video/msm/mdss/mdss_mdp_pipe.c
index 8c88646..d51b144 100644
--- a/drivers/video/msm/mdss/mdss_mdp_pipe.c
+++ b/drivers/video/msm/mdss/mdss_mdp_pipe.c
@@ -130,6 +130,17 @@
return 0;
}
+int mdss_mdp_smp_setup(struct mdss_data_type *mdata, u32 cnt, u32 size)
+{
+ if (!mdata)
+ return -EINVAL;
+
+ mdata->smp_mb_cnt = cnt;
+ mdata->smp_mb_size = size;
+
+ return 0;
+}
+
void mdss_mdp_pipe_unmap(struct mdss_mdp_pipe *pipe)
{
int tmp;
diff --git a/include/media/msm_vidc.h b/include/media/msm_vidc.h
index 031f291..c53d604 100644
--- a/include/media/msm_vidc.h
+++ b/include/media/msm_vidc.h
@@ -17,20 +17,6 @@
MSM_VIDC_MAX_DEVICES,
};
-struct msm_vidc_iommu_info {
- u32 addr_range[2];
- char name[64];
- char ctx[64];
- int domain;
- int partition;
-};
-
-enum msm_vidc_io_maps {
- NS_MAP,
- CP_MAP,
- MAX_MAP
-};
-
void *msm_vidc_open(int core_id, int session_type);
int msm_vidc_close(void *instance);
int msm_vidc_querycap(void *instance, struct v4l2_capability *cap);
@@ -50,8 +36,8 @@
int msm_vidc_encoder_cmd(void *instance, struct v4l2_encoder_cmd *enc);
int msm_vidc_poll(void *instance, struct file *filp,
struct poll_table_struct *pt);
-int msm_vidc_get_iommu_maps(void *instance,
- struct msm_vidc_iommu_info maps[MAX_MAP]);
+int msm_vidc_get_iommu_domain_partition(void *instance, u32 flags,
+ enum v4l2_buf_type, int *domain, int *partition);
int msm_vidc_subscribe_event(void *instance,
struct v4l2_event_subscription *sub);
int msm_vidc_unsubscribe_event(void *instance,
diff --git a/sound/soc/msm/msm8974.c b/sound/soc/msm/msm8974.c
index c5cfa11..4462213 100644
--- a/sound/soc/msm/msm8974.c
+++ b/sound/soc/msm/msm8974.c
@@ -133,6 +133,7 @@
struct msm8974_asoc_mach_data {
int mclk_gpio;
u32 mclk_freq;
+ int us_euro_gpio;
struct msm_auxpcm_ctrl *pri_auxpcm_ctrl;
};
@@ -1040,6 +1041,16 @@
slim0_rx_sample_rate_get, slim0_rx_sample_rate_put),
};
+static bool msm8974_swap_gnd_mic(struct snd_soc_codec *codec)
+{
+ struct snd_soc_card *card = codec->card;
+ struct msm8974_asoc_mach_data *pdata = snd_soc_card_get_drvdata(card);
+ int value = gpio_get_value_cansleep(pdata->us_euro_gpio);
+ pr_debug("%s: swap select switch %d to %d\n", __func__, value, !value);
+ gpio_set_value_cansleep(pdata->us_euro_gpio, !value);
+ return true;
+}
+
static int msm_audrx_init(struct snd_soc_pcm_runtime *rtd)
{
int err;
@@ -1984,6 +1995,25 @@
return 0;
}
+static int msm8974_prepare_us_euro(struct snd_soc_card *card)
+{
+ struct msm8974_asoc_mach_data *pdata = snd_soc_card_get_drvdata(card);
+ int ret;
+ if (pdata->us_euro_gpio) {
+ dev_dbg(card->dev, "%s : us_euro gpio request %d", __func__,
+ pdata->us_euro_gpio);
+ ret = gpio_request(pdata->us_euro_gpio, "TAIKO_CODEC_US_EURO");
+ if (ret) {
+ dev_err(card->dev,
+ "%s: Failed to request taiko US/EURO gpio %d error %d\n",
+ __func__, pdata->us_euro_gpio, ret);
+ return ret;
+ }
+ }
+
+ return 0;
+}
+
static __devinit int msm8974_asoc_machine_probe(struct platform_device *pdev)
{
struct snd_soc_card *card = &snd_soc_card_msm8974;
@@ -2073,6 +2103,23 @@
card->num_links = ARRAY_SIZE(msm8974_common_dai_links);
}
+ pdata->us_euro_gpio = of_get_named_gpio(pdev->dev.of_node,
+ "qcom,us-euro-gpios", 0);
+ if (pdata->us_euro_gpio < 0) {
+ dev_err(&pdev->dev, "Looking up %s property in node %s failed",
+ "qcom,us-euro-gpios",
+ pdev->dev.of_node->full_name);
+ } else {
+ dev_dbg(&pdev->dev, "%s detected %d",
+ "qcom,us-euro-gpios", pdata->us_euro_gpio);
+ mbhc_cfg.swap_gnd_mic = msm8974_swap_gnd_mic;
+ }
+
+ ret = msm8974_prepare_us_euro(card);
+ if (ret)
+ dev_err(&pdev->dev, "msm8974_prepare_us_euro failed (%d)\n",
+ ret);
+
mutex_init(&cdc_mclk_mutex);
atomic_set(&auxpcm_rsc_ref, 0);
spdev = pdev;
@@ -2094,6 +2141,18 @@
}
return 0;
err:
+ if (pdata->mclk_gpio > 0) {
+ dev_dbg(&pdev->dev, "%s free gpio %d\n",
+ __func__, pdata->mclk_gpio);
+ gpio_free(pdata->mclk_gpio);
+ pdata->mclk_gpio = 0;
+ }
+ if (pdata->us_euro_gpio > 0) {
+ dev_dbg(&pdev->dev, "%s free us_euro gpio %d\n",
+ __func__, pdata->us_euro_gpio);
+ gpio_free(pdata->us_euro_gpio);
+ pdata->us_euro_gpio = 0;
+ }
devm_kfree(&pdev->dev, pdata);
return ret;
}
@@ -2107,6 +2166,7 @@
regulator_put(ext_spk_amp_regulator);
gpio_free(pdata->mclk_gpio);
+ gpio_free(pdata->us_euro_gpio);
if (ext_spk_amp_gpio >= 0)
gpio_free(ext_spk_amp_gpio);