aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/devicetree/bindings/dma/fsl-mxs-dma.txt49
-rw-r--r--Documentation/devicetree/bindings/fb/mxsfb.txt36
-rw-r--r--Documentation/devicetree/bindings/i2c/i2c-mxs.txt12
-rw-r--r--Documentation/devicetree/bindings/mmc/mxs-mmc.txt12
-rw-r--r--Documentation/devicetree/bindings/mtd/gpmi-nand.txt17
-rw-r--r--Documentation/devicetree/bindings/pinctrl/fsl,mxs-pinctrl.txt4
-rw-r--r--Documentation/devicetree/bindings/spi/mxs-spi.txt12
-rw-r--r--Documentation/devicetree/bindings/tty/serial/fsl-mxs-auart.txt16
-rw-r--r--arch/arm/boot/dts/imx23-evk.dts36
-rw-r--r--arch/arm/boot/dts/imx23-olinuxino.dts1
-rw-r--r--arch/arm/boot/dts/imx23.dtsi42
-rw-r--r--arch/arm/boot/dts/imx28-apf28dev.dts25
-rw-r--r--arch/arm/boot/dts/imx28-apx4devkit.dts25
-rw-r--r--arch/arm/boot/dts/imx28-cfa10049.dts50
-rw-r--r--arch/arm/boot/dts/imx28-evk.dts36
-rw-r--r--arch/arm/boot/dts/imx28-m28evk.dts27
-rw-r--r--arch/arm/boot/dts/imx28.dtsi62
-rw-r--r--arch/arm/boot/dts/imx6qdl.dtsi8
-rw-r--r--arch/arm/mach-mxs/mach-mxs.c170
-rw-r--r--drivers/dma/mxs-dma.c109
-rw-r--r--drivers/i2c/busses/i2c-mxs.c40
-rw-r--r--drivers/mmc/host/mxs-mmc.c48
-rw-r--r--drivers/mtd/nand/gpmi-nand/gpmi-nand.c51
-rw-r--r--drivers/mtd/nand/gpmi-nand/gpmi-nand.h3
-rw-r--r--drivers/net/ethernet/freescale/fec.c18
-rw-r--r--drivers/net/ethernet/freescale/fec.h1
-rw-r--r--drivers/spi/spi-mxs.c60
-rw-r--r--drivers/tty/serial/mxs-auart.c52
-rw-r--r--drivers/video/Kconfig2
-rw-r--r--drivers/video/mxsfb.c260
-rw-r--r--include/linux/mxsfb.h52
-rw-r--r--include/linux/spi/mxs-spi.h4
32 files changed, 696 insertions, 644 deletions
diff --git a/Documentation/devicetree/bindings/dma/fsl-mxs-dma.txt b/Documentation/devicetree/bindings/dma/fsl-mxs-dma.txt
index ded0398d3bdc..a4873e5e3e36 100644
--- a/Documentation/devicetree/bindings/dma/fsl-mxs-dma.txt
+++ b/Documentation/devicetree/bindings/dma/fsl-mxs-dma.txt
@@ -3,17 +3,58 @@
3Required properties: 3Required properties:
4- compatible : Should be "fsl,<chip>-dma-apbh" or "fsl,<chip>-dma-apbx" 4- compatible : Should be "fsl,<chip>-dma-apbh" or "fsl,<chip>-dma-apbx"
5- reg : Should contain registers location and length 5- reg : Should contain registers location and length
6- interrupts : Should contain the interrupt numbers of DMA channels.
7 If a channel is empty/reserved, 0 should be filled in place.
8- #dma-cells : Must be <1>. The number cell specifies the channel ID.
9- dma-channels : Number of channels supported by the DMA controller
10
11Optional properties:
12- interrupt-names : Name of DMA channel interrupts
6 13
7Supported chips: 14Supported chips:
8imx23, imx28. 15imx23, imx28.
9 16
10Examples: 17Examples:
11dma-apbh@80004000 { 18
19dma_apbh: dma-apbh@80004000 {
12 compatible = "fsl,imx28-dma-apbh"; 20 compatible = "fsl,imx28-dma-apbh";
13 reg = <0x80004000 2000>; 21 reg = <0x80004000 0x2000>;
22 interrupts = <82 83 84 85
23 88 88 88 88
24 88 88 88 88
25 87 86 0 0>;
26 interrupt-names = "ssp0", "ssp1", "ssp2", "ssp3",
27 "gpmi0", "gmpi1", "gpmi2", "gmpi3",
28 "gpmi4", "gmpi5", "gpmi6", "gmpi7",
29 "hsadc", "lcdif", "empty", "empty";
30 #dma-cells = <1>;
31 dma-channels = <16>;
14}; 32};
15 33
16dma-apbx@80024000 { 34dma_apbx: dma-apbx@80024000 {
17 compatible = "fsl,imx28-dma-apbx"; 35 compatible = "fsl,imx28-dma-apbx";
18 reg = <0x80024000 2000>; 36 reg = <0x80024000 0x2000>;
37 interrupts = <78 79 66 0
38 80 81 68 69
39 70 71 72 73
40 74 75 76 77>;
41 interrupt-names = "auart4-rx", "aurat4-tx", "spdif-tx", "empty",
42 "saif0", "saif1", "i2c0", "i2c1",
43 "auart0-rx", "auart0-tx", "auart1-rx", "auart1-tx",
44 "auart2-rx", "auart2-tx", "auart3-rx", "auart3-tx";
45 #dma-cells = <1>;
46 dma-channels = <16>;
47};
48
49DMA clients connected to the MXS DMA controller must use the format
50described in the dma.txt file.
51
52Examples:
53
54auart0: serial@8006a000 {
55 compatible = "fsl,imx28-auart", "fsl,imx23-auart";
56 reg = <0x8006a000 0x2000>;
57 interrupts = <112>;
58 dmas = <&dma_apbx 8>, <&dma_apbx 9>;
59 dma-names = "rx", "tx";
19}; 60};
diff --git a/Documentation/devicetree/bindings/fb/mxsfb.txt b/Documentation/devicetree/bindings/fb/mxsfb.txt
index b41e5e52a676..96ec5179c8a0 100644
--- a/Documentation/devicetree/bindings/fb/mxsfb.txt
+++ b/Documentation/devicetree/bindings/fb/mxsfb.txt
@@ -5,9 +5,16 @@ Required properties:
5 imx23 and imx28. 5 imx23 and imx28.
6- reg: Address and length of the register set for lcdif 6- reg: Address and length of the register set for lcdif
7- interrupts: Should contain lcdif interrupts 7- interrupts: Should contain lcdif interrupts
8- display : phandle to display node (see below for details)
8 9
9Optional properties: 10* display node
10- panel-enable-gpios : Should specify the gpio for panel enable 11
12Required properties:
13- bits-per-pixel : <16> for RGB565, <32> for RGB888/666.
14- bus-width : number of data lines. Could be <8>, <16>, <18> or <24>.
15
16Required sub-node:
17- display-timings : Refer to binding doc display-timing.txt for details.
11 18
12Examples: 19Examples:
13 20
@@ -15,5 +22,28 @@ lcdif@80030000 {
15 compatible = "fsl,imx28-lcdif"; 22 compatible = "fsl,imx28-lcdif";
16 reg = <0x80030000 2000>; 23 reg = <0x80030000 2000>;
17 interrupts = <38 86>; 24 interrupts = <38 86>;
18 panel-enable-gpios = <&gpio3 30 0>; 25
26 display: display {
27 bits-per-pixel = <32>;
28 bus-width = <24>;
29
30 display-timings {
31 native-mode = <&timing0>;
32 timing0: timing0 {
33 clock-frequency = <33500000>;
34 hactive = <800>;
35 vactive = <480>;
36 hfront-porch = <164>;
37 hback-porch = <89>;
38 hsync-len = <10>;
39 vback-porch = <23>;
40 vfront-porch = <10>;
41 vsync-len = <10>;
42 hsync-active = <0>;
43 vsync-active = <0>;
44 de-active = <1>;
45 pixelclk-active = <0>;
46 };
47 };
48 };
19}; 49};
diff --git a/Documentation/devicetree/bindings/i2c/i2c-mxs.txt b/Documentation/devicetree/bindings/i2c/i2c-mxs.txt
index 7a3fe9e5f4cb..4e1c8ac01eba 100644
--- a/Documentation/devicetree/bindings/i2c/i2c-mxs.txt
+++ b/Documentation/devicetree/bindings/i2c/i2c-mxs.txt
@@ -3,10 +3,13 @@
3Required properties: 3Required properties:
4- compatible: Should be "fsl,<chip>-i2c" 4- compatible: Should be "fsl,<chip>-i2c"
5- reg: Should contain registers location and length 5- reg: Should contain registers location and length
6- interrupts: Should contain ERROR and DMA interrupts 6- interrupts: Should contain ERROR interrupt number
7- clock-frequency: Desired I2C bus clock frequency in Hz. 7- clock-frequency: Desired I2C bus clock frequency in Hz.
8 Only 100000Hz and 400000Hz modes are supported. 8 Only 100000Hz and 400000Hz modes are supported.
9- fsl,i2c-dma-channel: APBX DMA channel for the I2C 9- dmas: DMA specifier, consisting of a phandle to DMA controller node
10 and I2C DMA channel ID.
11 Refer to dma.txt and fsl-mxs-dma.txt for details.
12- dma-names: Must be "rx-tx".
10 13
11Examples: 14Examples:
12 15
@@ -15,7 +18,8 @@ i2c0: i2c@80058000 {
15 #size-cells = <0>; 18 #size-cells = <0>;
16 compatible = "fsl,imx28-i2c"; 19 compatible = "fsl,imx28-i2c";
17 reg = <0x80058000 2000>; 20 reg = <0x80058000 2000>;
18 interrupts = <111 68>; 21 interrupts = <111>;
19 clock-frequency = <100000>; 22 clock-frequency = <100000>;
20 fsl,i2c-dma-channel = <6>; 23 dmas = <&dma_apbx 6>;
24 dma-names = "rx-tx";
21}; 25};
diff --git a/Documentation/devicetree/bindings/mmc/mxs-mmc.txt b/Documentation/devicetree/bindings/mmc/mxs-mmc.txt
index 54949f6faede..515addc20070 100644
--- a/Documentation/devicetree/bindings/mmc/mxs-mmc.txt
+++ b/Documentation/devicetree/bindings/mmc/mxs-mmc.txt
@@ -9,15 +9,19 @@ and the properties used by the mxsmmc driver.
9Required properties: 9Required properties:
10- compatible: Should be "fsl,<chip>-mmc". The supported chips include 10- compatible: Should be "fsl,<chip>-mmc". The supported chips include
11 imx23 and imx28. 11 imx23 and imx28.
12- interrupts: Should contain ERROR and DMA interrupts 12- interrupts: Should contain ERROR interrupt number
13- fsl,ssp-dma-channel: APBH DMA channel for the SSP 13- dmas: DMA specifier, consisting of a phandle to DMA controller node
14 and SSP DMA channel ID.
15 Refer to dma.txt and fsl-mxs-dma.txt for details.
16- dma-names: Must be "rx-tx".
14 17
15Examples: 18Examples:
16 19
17ssp0: ssp@80010000 { 20ssp0: ssp@80010000 {
18 compatible = "fsl,imx28-mmc"; 21 compatible = "fsl,imx28-mmc";
19 reg = <0x80010000 2000>; 22 reg = <0x80010000 2000>;
20 interrupts = <96 82>; 23 interrupts = <96>;
21 fsl,ssp-dma-channel = <0>; 24 dmas = <&dma_apbh 0>;
25 dma-names = "rx-tx";
22 bus-width = <8>; 26 bus-width = <8>;
23}; 27};
diff --git a/Documentation/devicetree/bindings/mtd/gpmi-nand.txt b/Documentation/devicetree/bindings/mtd/gpmi-nand.txt
index 3fb3f9015365..551b2a179d01 100644
--- a/Documentation/devicetree/bindings/mtd/gpmi-nand.txt
+++ b/Documentation/devicetree/bindings/mtd/gpmi-nand.txt
@@ -7,10 +7,12 @@ Required properties:
7 - compatible : should be "fsl,<chip>-gpmi-nand" 7 - compatible : should be "fsl,<chip>-gpmi-nand"
8 - reg : should contain registers location and length for gpmi and bch. 8 - reg : should contain registers location and length for gpmi and bch.
9 - reg-names: Should contain the reg names "gpmi-nand" and "bch" 9 - reg-names: Should contain the reg names "gpmi-nand" and "bch"
10 - interrupts : The first is the DMA interrupt number for GPMI. 10 - interrupts : BCH interrupt number.
11 The second is the BCH interrupt number. 11 - interrupt-names : Should be "bch".
12 - interrupt-names : The interrupt names "gpmi-dma", "bch"; 12 - dmas: DMA specifier, consisting of a phandle to DMA controller node
13 - fsl,gpmi-dma-channel : Should contain the dma channel it uses. 13 and GPMI DMA channel ID.
14 Refer to dma.txt and fsl-mxs-dma.txt for details.
15 - dma-names: Must be "rx-tx".
14 16
15Optional properties: 17Optional properties:
16 - nand-on-flash-bbt: boolean to enable on flash bbt option if not 18 - nand-on-flash-bbt: boolean to enable on flash bbt option if not
@@ -27,9 +29,10 @@ gpmi-nand@8000c000 {
27 #size-cells = <1>; 29 #size-cells = <1>;
28 reg = <0x8000c000 2000>, <0x8000a000 2000>; 30 reg = <0x8000c000 2000>, <0x8000a000 2000>;
29 reg-names = "gpmi-nand", "bch"; 31 reg-names = "gpmi-nand", "bch";
30 interrupts = <88>, <41>; 32 interrupts = <41>;
31 interrupt-names = "gpmi-dma", "bch"; 33 interrupt-names = "bch";
32 fsl,gpmi-dma-channel = <4>; 34 dmas = <&dma_apbh 4>;
35 dma-names = "rx-tx";
33 36
34 partition@0 { 37 partition@0 {
35 ... 38 ...
diff --git a/Documentation/devicetree/bindings/pinctrl/fsl,mxs-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/fsl,mxs-pinctrl.txt
index f7e8e8f4d9a3..3077370c89af 100644
--- a/Documentation/devicetree/bindings/pinctrl/fsl,mxs-pinctrl.txt
+++ b/Documentation/devicetree/bindings/pinctrl/fsl,mxs-pinctrl.txt
@@ -70,6 +70,10 @@ Optional subnode-properties:
70 0: Disable the internal pull-up 70 0: Disable the internal pull-up
71 1: Enable the internal pull-up 71 1: Enable the internal pull-up
72 72
73Note that when enabling the pull-up, the internal pad keeper gets disabled.
74Also, some pins doesn't have a pull up, in that case, setting the fsl,pull-up
75will only disable the internal pad keeper.
76
73Examples: 77Examples:
74 78
75pinctrl@80018000 { 79pinctrl@80018000 {
diff --git a/Documentation/devicetree/bindings/spi/mxs-spi.txt b/Documentation/devicetree/bindings/spi/mxs-spi.txt
index e2e13957c2a4..3499b73293c2 100644
--- a/Documentation/devicetree/bindings/spi/mxs-spi.txt
+++ b/Documentation/devicetree/bindings/spi/mxs-spi.txt
@@ -3,8 +3,11 @@
3Required properties: 3Required properties:
4- compatible: Should be "fsl,<soc>-spi", where soc is "imx23" or "imx28" 4- compatible: Should be "fsl,<soc>-spi", where soc is "imx23" or "imx28"
5- reg: Offset and length of the register set for the device 5- reg: Offset and length of the register set for the device
6- interrupts: Should contain SSP interrupts (error irq first, dma irq second) 6- interrupts: Should contain SSP ERROR interrupt
7- fsl,ssp-dma-channel: APBX DMA channel for the SSP 7- dmas: DMA specifier, consisting of a phandle to DMA controller node
8 and SSP DMA channel ID.
9 Refer to dma.txt and fsl-mxs-dma.txt for details.
10- dma-names: Must be "rx-tx".
8 11
9Optional properties: 12Optional properties:
10- clock-frequency : Input clock frequency to the SPI block in Hz. 13- clock-frequency : Input clock frequency to the SPI block in Hz.
@@ -17,6 +20,7 @@ ssp0: ssp@80010000 {
17 #size-cells = <0>; 20 #size-cells = <0>;
18 compatible = "fsl,imx28-spi"; 21 compatible = "fsl,imx28-spi";
19 reg = <0x80010000 0x2000>; 22 reg = <0x80010000 0x2000>;
20 interrupts = <96 82>; 23 interrupts = <96>;
21 fsl,ssp-dma-channel = <0>; 24 dmas = <&dma_apbh 0>;
25 dma-names = "rx-tx";
22}; 26};
diff --git a/Documentation/devicetree/bindings/tty/serial/fsl-mxs-auart.txt b/Documentation/devicetree/bindings/tty/serial/fsl-mxs-auart.txt
index 273a8d5b3300..2c00ec64628e 100644
--- a/Documentation/devicetree/bindings/tty/serial/fsl-mxs-auart.txt
+++ b/Documentation/devicetree/bindings/tty/serial/fsl-mxs-auart.txt
@@ -5,20 +5,18 @@ Required properties:
5 imx23 and imx28. 5 imx23 and imx28.
6- reg : Address and length of the register set for the device 6- reg : Address and length of the register set for the device
7- interrupts : Should contain the auart interrupt numbers 7- interrupts : Should contain the auart interrupt numbers
8 8- dmas: DMA specifier, consisting of a phandle to DMA controller node
9Optional properties: 9 and AUART DMA channel ID.
10- fsl,auart-dma-channel : The DMA channels, the first is for RX, the other 10 Refer to dma.txt and fsl-mxs-dma.txt for details.
11 is for TX. If you add this property, it also means that you 11- dma-names: "rx" for RX channel, "tx" for TX channel.
12 will enable the DMA support for the auart.
13 Note: due to the hardware bug in imx23(see errata : 2836),
14 only the imx28 can enable the DMA support for the auart.
15 12
16Example: 13Example:
17auart0: serial@8006a000 { 14auart0: serial@8006a000 {
18 compatible = "fsl,imx28-auart", "fsl,imx23-auart"; 15 compatible = "fsl,imx28-auart", "fsl,imx23-auart";
19 reg = <0x8006a000 0x2000>; 16 reg = <0x8006a000 0x2000>;
20 interrupts = <112 70 71>; 17 interrupts = <112>;
21 fsl,auart-dma-channel = <8 9>; 18 dmas = <&dma_apbx 8>, <&dma_apbx 9>;
19 dma-names = "rx", "tx";
22}; 20};
23 21
24Note: Each auart port should have an alias correctly numbered in "aliases" 22Note: Each auart port should have an alias correctly numbered in "aliases"
diff --git a/arch/arm/boot/dts/imx23-evk.dts b/arch/arm/boot/dts/imx23-evk.dts
index 035c13f9d3c0..da0588a04131 100644
--- a/arch/arm/boot/dts/imx23-evk.dts
+++ b/arch/arm/boot/dts/imx23-evk.dts
@@ -59,8 +59,33 @@
59 lcdif@80030000 { 59 lcdif@80030000 {
60 pinctrl-names = "default"; 60 pinctrl-names = "default";
61 pinctrl-0 = <&lcdif_24bit_pins_a>; 61 pinctrl-0 = <&lcdif_24bit_pins_a>;
62 panel-enable-gpios = <&gpio1 18 0>; 62 lcd-supply = <&reg_lcd_3v3>;
63 display = <&display>;
63 status = "okay"; 64 status = "okay";
65
66 display: display {
67 bits-per-pixel = <32>;
68 bus-width = <24>;
69
70 display-timings {
71 native-mode = <&timing0>;
72 timing0: timing0 {
73 clock-frequency = <9200000>;
74 hactive = <480>;
75 vactive = <272>;
76 hback-porch = <15>;
77 hfront-porch = <8>;
78 vback-porch = <12>;
79 vfront-porch = <4>;
80 hsync-len = <1>;
81 vsync-len = <1>;
82 hsync-active = <0>;
83 vsync-active = <0>;
84 de-active = <1>;
85 pixelclk-active = <0>;
86 };
87 };
88 };
64 }; 89 };
65 }; 90 };
66 91
@@ -95,6 +120,15 @@
95 regulator-max-microvolt = <3300000>; 120 regulator-max-microvolt = <3300000>;
96 gpio = <&gpio1 29 0>; 121 gpio = <&gpio1 29 0>;
97 }; 122 };
123
124 reg_lcd_3v3: lcd-3v3 {
125 compatible = "regulator-fixed";
126 regulator-name = "lcd-3v3";
127 regulator-min-microvolt = <3300000>;
128 regulator-max-microvolt = <3300000>;
129 gpio = <&gpio1 18 0>;
130 enable-active-high;
131 };
98 }; 132 };
99 133
100 backlight { 134 backlight {
diff --git a/arch/arm/boot/dts/imx23-olinuxino.dts b/arch/arm/boot/dts/imx23-olinuxino.dts
index e7484e4ea659..d107c4af321f 100644
--- a/arch/arm/boot/dts/imx23-olinuxino.dts
+++ b/arch/arm/boot/dts/imx23-olinuxino.dts
@@ -29,6 +29,7 @@
29 pinctrl-names = "default"; 29 pinctrl-names = "default";
30 pinctrl-0 = <&mmc0_4bit_pins_a &mmc0_pins_fixup>; 30 pinctrl-0 = <&mmc0_4bit_pins_a &mmc0_pins_fixup>;
31 bus-width = <4>; 31 bus-width = <4>;
32 broken-cd;
32 status = "okay"; 33 status = "okay";
33 }; 34 };
34 35
diff --git a/arch/arm/boot/dts/imx23.dtsi b/arch/arm/boot/dts/imx23.dtsi
index ad2d79324cd3..73fd7d0887b5 100644
--- a/arch/arm/boot/dts/imx23.dtsi
+++ b/arch/arm/boot/dts/imx23.dtsi
@@ -49,9 +49,15 @@
49 reg = <0x80000000 0x2000>; 49 reg = <0x80000000 0x2000>;
50 }; 50 };
51 51
52 dma-apbh@80004000 { 52 dma_apbh: dma-apbh@80004000 {
53 compatible = "fsl,imx23-dma-apbh"; 53 compatible = "fsl,imx23-dma-apbh";
54 reg = <0x80004000 0x2000>; 54 reg = <0x80004000 0x2000>;
55 interrupts = <0 14 20 0
56 13 13 13 13>;
57 interrupt-names = "empty", "ssp0", "ssp1", "empty",
58 "gpmi0", "gpmi1", "gpmi2", "gpmi3";
59 #dma-cells = <1>;
60 dma-channels = <8>;
55 clocks = <&clks 15>; 61 clocks = <&clks 15>;
56 }; 62 };
57 63
@@ -70,6 +76,8 @@
70 interrupt-names = "gpmi-dma", "bch"; 76 interrupt-names = "gpmi-dma", "bch";
71 clocks = <&clks 34>; 77 clocks = <&clks 34>;
72 clock-names = "gpmi_io"; 78 clock-names = "gpmi_io";
79 dmas = <&dma_apbh 4>;
80 dma-names = "rx-tx";
73 fsl,gpmi-dma-channel = <4>; 81 fsl,gpmi-dma-channel = <4>;
74 status = "disabled"; 82 status = "disabled";
75 }; 83 };
@@ -78,6 +86,8 @@
78 reg = <0x80010000 0x2000>; 86 reg = <0x80010000 0x2000>;
79 interrupts = <15 14>; 87 interrupts = <15 14>;
80 clocks = <&clks 33>; 88 clocks = <&clks 33>;
89 dmas = <&dma_apbh 1>;
90 dma-names = "rx-tx";
81 fsl,ssp-dma-channel = <1>; 91 fsl,ssp-dma-channel = <1>;
82 status = "disabled"; 92 status = "disabled";
83 }; 93 };
@@ -305,9 +315,19 @@
305 status = "disabled"; 315 status = "disabled";
306 }; 316 };
307 317
308 dma-apbx@80024000 { 318 dma_apbx: dma-apbx@80024000 {
309 compatible = "fsl,imx23-dma-apbx"; 319 compatible = "fsl,imx23-dma-apbx";
310 reg = <0x80024000 0x2000>; 320 reg = <0x80024000 0x2000>;
321 interrupts = <7 5 9 26
322 19 0 25 23
323 60 58 9 0
324 0 0 0 0>;
325 interrupt-names = "audio-adc", "audio-dac", "spdif-tx", "i2c",
326 "saif0", "empty", "auart0-rx", "auart0-tx",
327 "auart1-rx", "auart1-tx", "saif1", "empty",
328 "empty", "empty", "empty", "empty";
329 #dma-cells = <1>;
330 dma-channels = <16>;
311 clocks = <&clks 16>; 331 clocks = <&clks 16>;
312 }; 332 };
313 333
@@ -344,6 +364,8 @@
344 reg = <0x80034000 0x2000>; 364 reg = <0x80034000 0x2000>;
345 interrupts = <2 20>; 365 interrupts = <2 20>;
346 clocks = <&clks 33>; 366 clocks = <&clks 33>;
367 dmas = <&dma_apbh 2>;
368 dma-names = "rx-tx";
347 fsl,ssp-dma-channel = <2>; 369 fsl,ssp-dma-channel = <2>;
348 status = "disabled"; 370 status = "disabled";
349 }; 371 };
@@ -369,6 +391,8 @@
369 391
370 saif0: saif@80042000 { 392 saif0: saif@80042000 {
371 reg = <0x80042000 0x2000>; 393 reg = <0x80042000 0x2000>;
394 dmas = <&dma_apbx 4>;
395 dma-names = "rx-tx";
372 status = "disabled"; 396 status = "disabled";
373 }; 397 };
374 398
@@ -379,16 +403,22 @@
379 403
380 saif1: saif@80046000 { 404 saif1: saif@80046000 {
381 reg = <0x80046000 0x2000>; 405 reg = <0x80046000 0x2000>;
406 dmas = <&dma_apbx 10>;
407 dma-names = "rx-tx";
382 status = "disabled"; 408 status = "disabled";
383 }; 409 };
384 410
385 audio-out@80048000 { 411 audio-out@80048000 {
386 reg = <0x80048000 0x2000>; 412 reg = <0x80048000 0x2000>;
413 dmas = <&dma_apbx 1>;
414 dma-names = "tx";
387 status = "disabled"; 415 status = "disabled";
388 }; 416 };
389 417
390 audio-in@8004c000 { 418 audio-in@8004c000 {
391 reg = <0x8004c000 0x2000>; 419 reg = <0x8004c000 0x2000>;
420 dmas = <&dma_apbx 0>;
421 dma-names = "rx";
392 status = "disabled"; 422 status = "disabled";
393 }; 423 };
394 424
@@ -401,11 +431,15 @@
401 431
402 spdif@80054000 { 432 spdif@80054000 {
403 reg = <0x80054000 2000>; 433 reg = <0x80054000 2000>;
434 dmas = <&dma_apbx 2>;
435 dma-names = "tx";
404 status = "disabled"; 436 status = "disabled";
405 }; 437 };
406 438
407 i2c@80058000 { 439 i2c@80058000 {
408 reg = <0x80058000 0x2000>; 440 reg = <0x80058000 0x2000>;
441 dmas = <&dma_apbx 3>;
442 dma-names = "rx-tx";
409 status = "disabled"; 443 status = "disabled";
410 }; 444 };
411 445
@@ -436,6 +470,8 @@
436 reg = <0x8006c000 0x2000>; 470 reg = <0x8006c000 0x2000>;
437 interrupts = <24 25 23>; 471 interrupts = <24 25 23>;
438 clocks = <&clks 32>; 472 clocks = <&clks 32>;
473 dmas = <&dma_apbx 6>, <&dma_apbx 7>;
474 dma-names = "rx", "tx";
439 status = "disabled"; 475 status = "disabled";
440 }; 476 };
441 477
@@ -444,6 +480,8 @@
444 reg = <0x8006e000 0x2000>; 480 reg = <0x8006e000 0x2000>;
445 interrupts = <59 60 58>; 481 interrupts = <59 60 58>;
446 clocks = <&clks 32>; 482 clocks = <&clks 32>;
483 dmas = <&dma_apbx 8>, <&dma_apbx 9>;
484 dma-names = "rx", "tx";
447 status = "disabled"; 485 status = "disabled";
448 }; 486 };
449 487
diff --git a/arch/arm/boot/dts/imx28-apf28dev.dts b/arch/arm/boot/dts/imx28-apf28dev.dts
index 6d8865bfb4b7..3d905d16cbec 100644
--- a/arch/arm/boot/dts/imx28-apf28dev.dts
+++ b/arch/arm/boot/dts/imx28-apf28dev.dts
@@ -72,7 +72,32 @@
72 pinctrl-names = "default"; 72 pinctrl-names = "default";
73 pinctrl-0 = <&lcdif_16bit_pins_a 73 pinctrl-0 = <&lcdif_16bit_pins_a
74 &lcdif_pins_apf28dev>; 74 &lcdif_pins_apf28dev>;
75 display = <&display>;
75 status = "okay"; 76 status = "okay";
77
78 display: display {
79 bits-per-pixel = <16>;
80 bus-width = <16>;
81
82 display-timings {
83 native-mode = <&timing0>;
84 timing0: timing0 {
85 clock-frequency = <33000033>;
86 hactive = <800>;
87 vactive = <480>;
88 hback-porch = <96>;
89 hfront-porch = <96>;
90 vback-porch = <20>;
91 vfront-porch = <21>;
92 hsync-len = <64>;
93 vsync-len = <4>;
94 hsync-active = <1>;
95 vsync-active = <1>;
96 de-active = <1>;
97 pixelclk-active = <0>;
98 };
99 };
100 };
76 }; 101 };
77 }; 102 };
78 103
diff --git a/arch/arm/boot/dts/imx28-apx4devkit.dts b/arch/arm/boot/dts/imx28-apx4devkit.dts
index 5171667a7763..43bf3c796cba 100644
--- a/arch/arm/boot/dts/imx28-apx4devkit.dts
+++ b/arch/arm/boot/dts/imx28-apx4devkit.dts
@@ -94,7 +94,32 @@
94 pinctrl-names = "default"; 94 pinctrl-names = "default";
95 pinctrl-0 = <&lcdif_24bit_pins_a 95 pinctrl-0 = <&lcdif_24bit_pins_a
96 &lcdif_pins_apx4>; 96 &lcdif_pins_apx4>;
97 display = <&display>;
97 status = "okay"; 98 status = "okay";
99
100 display: display {
101 bits-per-pixel = <32>;
102 bus-width = <24>;
103
104 display-timings {
105 native-mode = <&timing0>;
106 timing0: timing0 {
107 clock-frequency = <30000000>;
108 hactive = <800>;
109 vactive = <480>;
110 hback-porch = <88>;
111 hfront-porch = <40>;
112 vback-porch = <32>;
113 vfront-porch = <13>;
114 hsync-len = <48>;
115 vsync-len = <3>;
116 hsync-active = <1>;
117 vsync-active = <1>;
118 de-active = <1>;
119 pixelclk-active = <0>;
120 };
121 };
122 };
98 }; 123 };
99 }; 124 };
100 125
diff --git a/arch/arm/boot/dts/imx28-cfa10049.dts b/arch/arm/boot/dts/imx28-cfa10049.dts
index a0d3e9f1738e..063e62059890 100644
--- a/arch/arm/boot/dts/imx28-cfa10049.dts
+++ b/arch/arm/boot/dts/imx28-cfa10049.dts
@@ -30,7 +30,6 @@
30 reg = <0>; 30 reg = <0>;
31 fsl,pinmux-ids = < 31 fsl,pinmux-ids = <
32 0x0073 /* MX28_PAD_GPMI_D7__GPIO_0_7 */ 32 0x0073 /* MX28_PAD_GPMI_D7__GPIO_0_7 */
33 0x1153 /* MX28_PAD_LCD_D22__GPIO_1_21 */
34 0x1163 /* MX28_PAD_LCD_D22__GPIO_1_22 */ 33 0x1163 /* MX28_PAD_LCD_D22__GPIO_1_22 */
35 0x1173 /* MX28_PAD_LCD_D22__GPIO_1_23 */ 34 0x1173 /* MX28_PAD_LCD_D22__GPIO_1_23 */
36 0x2153 /* MX28_PAD_SSP2_D5__GPIO_2_21 */ 35 0x2153 /* MX28_PAD_SSP2_D5__GPIO_2_21 */
@@ -120,13 +119,48 @@
120 fsl,voltage = <1>; 119 fsl,voltage = <1>;
121 fsl,pull-up = <0>; 120 fsl,pull-up = <0>;
122 }; 121 };
122
123 w1_gpio_pins: w1-gpio@0 {
124 reg = <0>;
125 fsl,pinmux-ids = <
126 0x1153 /* MX28_PAD_LCD_D21__GPIO_1_21 */
127 >;
128 fsl,drive-strength = <1>;
129 fsl,voltage = <1>;
130 fsl,pull-up = <0>; /* 0 will enable the keeper */
131 };
123 }; 132 };
124 133
125 lcdif@80030000 { 134 lcdif@80030000 {
126 pinctrl-names = "default"; 135 pinctrl-names = "default";
127 pinctrl-0 = <&lcdif_18bit_pins_cfa10049 136 pinctrl-0 = <&lcdif_18bit_pins_cfa10049
128 &lcdif_pins_cfa10049>; 137 &lcdif_pins_cfa10049>;
138 display = <&display>;
129 status = "okay"; 139 status = "okay";
140
141 display: display {
142 bits-per-pixel = <32>;
143 bus-width = <18>;
144
145 display-timings {
146 native-mode = <&timing0>;
147 timing0: timing0 {
148 clock-frequency = <9216000>;
149 hactive = <320>;
150 vactive = <480>;
151 hback-porch = <2>;
152 hfront-porch = <2>;
153 vback-porch = <2>;
154 vfront-porch = <2>;
155 hsync-len = <15>;
156 vsync-len = <15>;
157 hsync-active = <0>;
158 vsync-active = <0>;
159 de-active = <1>;
160 pixelclk-active = <1>;
161 };
162 };
163 };
130 }; 164 };
131 }; 165 };
132 166
@@ -183,6 +217,11 @@
183 usbphy1: usbphy@8007e000 { 217 usbphy1: usbphy@8007e000 {
184 status = "okay"; 218 status = "okay";
185 }; 219 };
220
221 lradc@80050000 {
222 status = "okay";
223 fsl,lradc-touchscreen-wires = <4>;
224 };
186 }; 225 };
187 }; 226 };
188 227
@@ -304,5 +343,14 @@
304 pwms = <&pwm 3 5000000>; 343 pwms = <&pwm 3 5000000>;
305 brightness-levels = <0 4 8 16 32 64 128 255>; 344 brightness-levels = <0 4 8 16 32 64 128 255>;
306 default-brightness-level = <6>; 345 default-brightness-level = <6>;
346
347 };
348
349 onewire@0 {
350 compatible = "w1-gpio";
351 pinctrl-names = "default";
352 pinctrl-0 = <&w1_gpio_pins>;
353 status = "okay";
354 gpios = <&gpio1 21 0>;
307 }; 355 };
308}; 356};
diff --git a/arch/arm/boot/dts/imx28-evk.dts b/arch/arm/boot/dts/imx28-evk.dts
index 2da316e04409..3637bf3b1d59 100644
--- a/arch/arm/boot/dts/imx28-evk.dts
+++ b/arch/arm/boot/dts/imx28-evk.dts
@@ -123,8 +123,33 @@
123 pinctrl-names = "default"; 123 pinctrl-names = "default";
124 pinctrl-0 = <&lcdif_24bit_pins_a 124 pinctrl-0 = <&lcdif_24bit_pins_a
125 &lcdif_pins_evk>; 125 &lcdif_pins_evk>;
126 panel-enable-gpios = <&gpio3 30 0>; 126 lcd-supply = <&reg_lcd_3v3>;
127 display = <&display>;
127 status = "okay"; 128 status = "okay";
129
130 display: display {
131 bits-per-pixel = <32>;
132 bus-width = <24>;
133
134 display-timings {
135 native-mode = <&timing0>;
136 timing0: timing0 {
137 clock-frequency = <33500000>;
138 hactive = <800>;
139 vactive = <480>;
140 hback-porch = <89>;
141 hfront-porch = <164>;
142 vback-porch = <23>;
143 vfront-porch = <10>;
144 hsync-len = <10>;
145 vsync-len = <10>;
146 hsync-active = <0>;
147 vsync-active = <0>;
148 de-active = <1>;
149 pixelclk-active = <0>;
150 };
151 };
152 };
128 }; 153 };
129 154
130 can0: can@80032000 { 155 can0: can@80032000 {
@@ -285,6 +310,15 @@
285 gpio = <&gpio3 8 0>; 310 gpio = <&gpio3 8 0>;
286 enable-active-high; 311 enable-active-high;
287 }; 312 };
313
314 reg_lcd_3v3: lcd-3v3 {
315 compatible = "regulator-fixed";
316 regulator-name = "lcd-3v3";
317 regulator-min-microvolt = <3300000>;
318 regulator-max-microvolt = <3300000>;
319 gpio = <&gpio3 30 0>;
320 enable-active-high;
321 };
288 }; 322 };
289 323
290 sound { 324 sound {
diff --git a/arch/arm/boot/dts/imx28-m28evk.dts b/arch/arm/boot/dts/imx28-m28evk.dts
index 6ce3d17c3a29..5f0ba99aa809 100644
--- a/arch/arm/boot/dts/imx28-m28evk.dts
+++ b/arch/arm/boot/dts/imx28-m28evk.dts
@@ -119,7 +119,32 @@
119 pinctrl-names = "default"; 119 pinctrl-names = "default";
120 pinctrl-0 = <&lcdif_24bit_pins_a 120 pinctrl-0 = <&lcdif_24bit_pins_a
121 &lcdif_pins_m28>; 121 &lcdif_pins_m28>;
122 display = <&display>;
122 status = "okay"; 123 status = "okay";
124
125 display: display {
126 bits-per-pixel = <16>;
127 bus-width = <18>;
128
129 display-timings {
130 native-mode = <&timing0>;
131 timing0: timing0 {
132 clock-frequency = <33260000>;
133 hactive = <800>;
134 vactive = <480>;
135 hback-porch = <0>;
136 hfront-porch = <256>;
137 vback-porch = <0>;
138 vfront-porch = <45>;
139 hsync-len = <1>;
140 vsync-len = <1>;
141 hsync-active = <0>;
142 vsync-active = <0>;
143 de-active = <1>;
144 pixelclk-active = <1>;
145 };
146 };
147 };
123 }; 148 };
124 149
125 can0: can@80032000 { 150 can0: can@80032000 {
@@ -221,6 +246,8 @@
221 phy-mode = "rmii"; 246 phy-mode = "rmii";
222 pinctrl-names = "default"; 247 pinctrl-names = "default";
223 pinctrl-0 = <&mac0_pins_a>; 248 pinctrl-0 = <&mac0_pins_a>;
249 clocks = <&clks 57>, <&clks 57>;
250 clock-names = "ipg", "ahb";
224 status = "okay"; 251 status = "okay";
225 }; 252 };
226 253
diff --git a/arch/arm/boot/dts/imx28.dtsi b/arch/arm/boot/dts/imx28.dtsi
index 64af2381c1b0..600f7cb51f3e 100644
--- a/arch/arm/boot/dts/imx28.dtsi
+++ b/arch/arm/boot/dts/imx28.dtsi
@@ -61,12 +61,24 @@
61 hsadc@80002000 { 61 hsadc@80002000 {
62 reg = <0x80002000 0x2000>; 62 reg = <0x80002000 0x2000>;
63 interrupts = <13 87>; 63 interrupts = <13 87>;
64 dmas = <&dma_apbh 12>;
65 dma-names = "rx";
64 status = "disabled"; 66 status = "disabled";
65 }; 67 };
66 68
67 dma-apbh@80004000 { 69 dma_apbh: dma-apbh@80004000 {
68 compatible = "fsl,imx28-dma-apbh"; 70 compatible = "fsl,imx28-dma-apbh";
69 reg = <0x80004000 0x2000>; 71 reg = <0x80004000 0x2000>;
72 interrupts = <82 83 84 85
73 88 88 88 88
74 88 88 88 88
75 87 86 0 0>;
76 interrupt-names = "ssp0", "ssp1", "ssp2", "ssp3",
77 "gpmi0", "gmpi1", "gpmi2", "gmpi3",
78 "gpmi4", "gmpi5", "gpmi6", "gmpi7",
79 "hsadc", "lcdif", "empty", "empty";
80 #dma-cells = <1>;
81 dma-channels = <16>;
70 clocks = <&clks 25>; 82 clocks = <&clks 25>;
71 }; 83 };
72 84
@@ -86,6 +98,8 @@
86 interrupt-names = "gpmi-dma", "bch"; 98 interrupt-names = "gpmi-dma", "bch";
87 clocks = <&clks 50>; 99 clocks = <&clks 50>;
88 clock-names = "gpmi_io"; 100 clock-names = "gpmi_io";
101 dmas = <&dma_apbh 4>;
102 dma-names = "rx-tx";
89 fsl,gpmi-dma-channel = <4>; 103 fsl,gpmi-dma-channel = <4>;
90 status = "disabled"; 104 status = "disabled";
91 }; 105 };
@@ -96,6 +110,8 @@
96 reg = <0x80010000 0x2000>; 110 reg = <0x80010000 0x2000>;
97 interrupts = <96 82>; 111 interrupts = <96 82>;
98 clocks = <&clks 46>; 112 clocks = <&clks 46>;
113 dmas = <&dma_apbh 0>;
114 dma-names = "rx-tx";
99 fsl,ssp-dma-channel = <0>; 115 fsl,ssp-dma-channel = <0>;
100 status = "disabled"; 116 status = "disabled";
101 }; 117 };
@@ -106,6 +122,8 @@
106 reg = <0x80012000 0x2000>; 122 reg = <0x80012000 0x2000>;
107 interrupts = <97 83>; 123 interrupts = <97 83>;
108 clocks = <&clks 47>; 124 clocks = <&clks 47>;
125 dmas = <&dma_apbh 1>;
126 dma-names = "rx-tx";
109 fsl,ssp-dma-channel = <1>; 127 fsl,ssp-dma-channel = <1>;
110 status = "disabled"; 128 status = "disabled";
111 }; 129 };
@@ -116,6 +134,8 @@
116 reg = <0x80014000 0x2000>; 134 reg = <0x80014000 0x2000>;
117 interrupts = <98 84>; 135 interrupts = <98 84>;
118 clocks = <&clks 48>; 136 clocks = <&clks 48>;
137 dmas = <&dma_apbh 2>;
138 dma-names = "rx-tx";
119 fsl,ssp-dma-channel = <2>; 139 fsl,ssp-dma-channel = <2>;
120 status = "disabled"; 140 status = "disabled";
121 }; 141 };
@@ -126,6 +146,8 @@
126 reg = <0x80016000 0x2000>; 146 reg = <0x80016000 0x2000>;
127 interrupts = <99 85>; 147 interrupts = <99 85>;
128 clocks = <&clks 49>; 148 clocks = <&clks 49>;
149 dmas = <&dma_apbh 3>;
150 dma-names = "rx-tx";
129 fsl,ssp-dma-channel = <3>; 151 fsl,ssp-dma-channel = <3>;
130 status = "disabled"; 152 status = "disabled";
131 }; 153 };
@@ -658,9 +680,19 @@
658 status = "disabled"; 680 status = "disabled";
659 }; 681 };
660 682
661 dma-apbx@80024000 { 683 dma_apbx: dma-apbx@80024000 {
662 compatible = "fsl,imx28-dma-apbx"; 684 compatible = "fsl,imx28-dma-apbx";
663 reg = <0x80024000 0x2000>; 685 reg = <0x80024000 0x2000>;
686 interrupts = <78 79 66 0
687 80 81 68 69
688 70 71 72 73
689 74 75 76 77>;
690 interrupt-names = "auart4-rx", "aurat4-tx", "spdif-tx", "empty",
691 "saif0", "saif1", "i2c0", "i2c1",
692 "auart0-rx", "auart0-tx", "auart1-rx", "auart1-tx",
693 "auart2-rx", "auart2-tx", "auart3-rx", "auart3-tx";
694 #dma-cells = <1>;
695 dma-channels = <16>;
664 clocks = <&clks 26>; 696 clocks = <&clks 26>;
665 }; 697 };
666 698
@@ -692,6 +724,8 @@
692 reg = <0x80030000 0x2000>; 724 reg = <0x80030000 0x2000>;
693 interrupts = <38 86>; 725 interrupts = <38 86>;
694 clocks = <&clks 55>; 726 clocks = <&clks 55>;
727 dmas = <&dma_apbh 13>;
728 dma-names = "rx";
695 status = "disabled"; 729 status = "disabled";
696 }; 730 };
697 731
@@ -767,6 +801,8 @@
767 reg = <0x80042000 0x2000>; 801 reg = <0x80042000 0x2000>;
768 interrupts = <59 80>; 802 interrupts = <59 80>;
769 clocks = <&clks 53>; 803 clocks = <&clks 53>;
804 dmas = <&dma_apbx 4>;
805 dma-names = "rx-tx";
770 fsl,saif-dma-channel = <4>; 806 fsl,saif-dma-channel = <4>;
771 status = "disabled"; 807 status = "disabled";
772 }; 808 };
@@ -781,6 +817,8 @@
781 reg = <0x80046000 0x2000>; 817 reg = <0x80046000 0x2000>;
782 interrupts = <58 81>; 818 interrupts = <58 81>;
783 clocks = <&clks 54>; 819 clocks = <&clks 54>;
820 dmas = <&dma_apbx 5>;
821 dma-names = "rx-tx";
784 fsl,saif-dma-channel = <5>; 822 fsl,saif-dma-channel = <5>;
785 status = "disabled"; 823 status = "disabled";
786 }; 824 };
@@ -796,6 +834,8 @@
796 spdif@80054000 { 834 spdif@80054000 {
797 reg = <0x80054000 0x2000>; 835 reg = <0x80054000 0x2000>;
798 interrupts = <45 66>; 836 interrupts = <45 66>;
837 dmas = <&dma_apbx 2>;
838 dma-names = "tx";
799 status = "disabled"; 839 status = "disabled";
800 }; 840 };
801 841
@@ -812,6 +852,8 @@
812 reg = <0x80058000 0x2000>; 852 reg = <0x80058000 0x2000>;
813 interrupts = <111 68>; 853 interrupts = <111 68>;
814 clock-frequency = <100000>; 854 clock-frequency = <100000>;
855 dmas = <&dma_apbx 6>;
856 dma-names = "rx-tx";
815 fsl,i2c-dma-channel = <6>; 857 fsl,i2c-dma-channel = <6>;
816 status = "disabled"; 858 status = "disabled";
817 }; 859 };
@@ -823,6 +865,8 @@
823 reg = <0x8005a000 0x2000>; 865 reg = <0x8005a000 0x2000>;
824 interrupts = <110 69>; 866 interrupts = <110 69>;
825 clock-frequency = <100000>; 867 clock-frequency = <100000>;
868 dmas = <&dma_apbx 7>;
869 dma-names = "rx-tx";
826 fsl,i2c-dma-channel = <7>; 870 fsl,i2c-dma-channel = <7>;
827 status = "disabled"; 871 status = "disabled";
828 }; 872 };
@@ -847,6 +891,8 @@
847 compatible = "fsl,imx28-auart", "fsl,imx23-auart"; 891 compatible = "fsl,imx28-auart", "fsl,imx23-auart";
848 reg = <0x8006a000 0x2000>; 892 reg = <0x8006a000 0x2000>;
849 interrupts = <112 70 71>; 893 interrupts = <112 70 71>;
894 dmas = <&dma_apbx 8>, <&dma_apbx 9>;
895 dma-names = "rx", "tx";
850 fsl,auart-dma-channel = <8 9>; 896 fsl,auart-dma-channel = <8 9>;
851 clocks = <&clks 45>; 897 clocks = <&clks 45>;
852 status = "disabled"; 898 status = "disabled";
@@ -856,6 +902,8 @@
856 compatible = "fsl,imx28-auart", "fsl,imx23-auart"; 902 compatible = "fsl,imx28-auart", "fsl,imx23-auart";
857 reg = <0x8006c000 0x2000>; 903 reg = <0x8006c000 0x2000>;
858 interrupts = <113 72 73>; 904 interrupts = <113 72 73>;
905 dmas = <&dma_apbx 10>, <&dma_apbx 11>;
906 dma-names = "rx", "tx";
859 clocks = <&clks 45>; 907 clocks = <&clks 45>;
860 status = "disabled"; 908 status = "disabled";
861 }; 909 };
@@ -864,6 +912,8 @@
864 compatible = "fsl,imx28-auart", "fsl,imx23-auart"; 912 compatible = "fsl,imx28-auart", "fsl,imx23-auart";
865 reg = <0x8006e000 0x2000>; 913 reg = <0x8006e000 0x2000>;
866 interrupts = <114 74 75>; 914 interrupts = <114 74 75>;
915 dmas = <&dma_apbx 12>, <&dma_apbx 13>;
916 dma-names = "rx", "tx";
867 clocks = <&clks 45>; 917 clocks = <&clks 45>;
868 status = "disabled"; 918 status = "disabled";
869 }; 919 };
@@ -872,6 +922,8 @@
872 compatible = "fsl,imx28-auart", "fsl,imx23-auart"; 922 compatible = "fsl,imx28-auart", "fsl,imx23-auart";
873 reg = <0x80070000 0x2000>; 923 reg = <0x80070000 0x2000>;
874 interrupts = <115 76 77>; 924 interrupts = <115 76 77>;
925 dmas = <&dma_apbx 14>, <&dma_apbx 15>;
926 dma-names = "rx", "tx";
875 clocks = <&clks 45>; 927 clocks = <&clks 45>;
876 status = "disabled"; 928 status = "disabled";
877 }; 929 };
@@ -880,6 +932,8 @@
880 compatible = "fsl,imx28-auart", "fsl,imx23-auart"; 932 compatible = "fsl,imx28-auart", "fsl,imx23-auart";
881 reg = <0x80072000 0x2000>; 933 reg = <0x80072000 0x2000>;
882 interrupts = <116 78 79>; 934 interrupts = <116 78 79>;
935 dmas = <&dma_apbx 0>, <&dma_apbx 1>;
936 dma-names = "rx", "tx";
883 clocks = <&clks 45>; 937 clocks = <&clks 45>;
884 status = "disabled"; 938 status = "disabled";
885 }; 939 };
@@ -943,8 +997,8 @@
943 compatible = "fsl,imx28-fec"; 997 compatible = "fsl,imx28-fec";
944 reg = <0x800f0000 0x4000>; 998 reg = <0x800f0000 0x4000>;
945 interrupts = <101>; 999 interrupts = <101>;
946 clocks = <&clks 57>, <&clks 57>; 1000 clocks = <&clks 57>, <&clks 57>, <&clks 64>;
947 clock-names = "ipg", "ahb"; 1001 clock-names = "ipg", "ahb", "enet_out";
948 status = "disabled"; 1002 status = "disabled";
949 }; 1003 };
950 1004
diff --git a/arch/arm/boot/dts/imx6qdl.dtsi b/arch/arm/boot/dts/imx6qdl.dtsi
index 06ec460b4581..59e970f74e8f 100644
--- a/arch/arm/boot/dts/imx6qdl.dtsi
+++ b/arch/arm/boot/dts/imx6qdl.dtsi
@@ -65,9 +65,13 @@
65 interrupt-parent = <&intc>; 65 interrupt-parent = <&intc>;
66 ranges; 66 ranges;
67 67
68 dma-apbh@00110000 { 68 dma_apbh: dma-apbh@00110000 {
69 compatible = "fsl,imx6q-dma-apbh", "fsl,imx28-dma-apbh"; 69 compatible = "fsl,imx6q-dma-apbh", "fsl,imx28-dma-apbh";
70 reg = <0x00110000 0x2000>; 70 reg = <0x00110000 0x2000>;
71 interrupts = <0 13 0x04>, <0 13 0x04>, <0 13 0x04>, <0 13 0x04>;
72 interrupt-names = "gpmi0", "gpmi1", "gpmi2", "gpmi3";
73 #dma-cells = <1>;
74 dma-channels = <4>;
71 clocks = <&clks 106>; 75 clocks = <&clks 106>;
72 }; 76 };
73 77
@@ -83,6 +87,8 @@
83 <&clks 150>, <&clks 149>; 87 <&clks 150>, <&clks 149>;
84 clock-names = "gpmi_io", "gpmi_apb", "gpmi_bch", 88 clock-names = "gpmi_io", "gpmi_apb", "gpmi_bch",
85 "gpmi_bch_apb", "per1_bch"; 89 "gpmi_bch_apb", "per1_bch";
90 dmas = <&dma_apbh 0>;
91 dma-names = "rx-tx";
86 fsl,gpmi-dma-channel = <0>; 92 fsl,gpmi-dma-channel = <0>;
87 status = "disabled"; 93 status = "disabled";
88 }; 94 };
diff --git a/arch/arm/mach-mxs/mach-mxs.c b/arch/arm/mach-mxs/mach-mxs.c
index 16870bf853b8..f39ab808694d 100644
--- a/arch/arm/mach-mxs/mach-mxs.c
+++ b/arch/arm/mach-mxs/mach-mxs.c
@@ -22,7 +22,6 @@
22#include <linux/irqchip.h> 22#include <linux/irqchip.h>
23#include <linux/irqchip/mxs.h> 23#include <linux/irqchip/mxs.h>
24#include <linux/micrel_phy.h> 24#include <linux/micrel_phy.h>
25#include <linux/mxsfb.h>
26#include <linux/of_address.h> 25#include <linux/of_address.h>
27#include <linux/of_platform.h> 26#include <linux/of_platform.h>
28#include <linux/phy.h> 27#include <linux/phy.h>
@@ -59,106 +58,6 @@ static inline void __mxs_togl(u32 mask, void __iomem *reg)
59 __raw_writel(mask, reg + MXS_TOG_ADDR); 58 __raw_writel(mask, reg + MXS_TOG_ADDR);
60} 59}
61 60
62static struct fb_videomode mx23evk_video_modes[] = {
63 {
64 .name = "Samsung-LMS430HF02",
65 .refresh = 60,
66 .xres = 480,
67 .yres = 272,
68 .pixclock = 108096, /* picosecond (9.2 MHz) */
69 .left_margin = 15,
70 .right_margin = 8,
71 .upper_margin = 12,
72 .lower_margin = 4,
73 .hsync_len = 1,
74 .vsync_len = 1,
75 },
76};
77
78static struct fb_videomode mx28evk_video_modes[] = {
79 {
80 .name = "Seiko-43WVF1G",
81 .refresh = 60,
82 .xres = 800,
83 .yres = 480,
84 .pixclock = 29851, /* picosecond (33.5 MHz) */
85 .left_margin = 89,
86 .right_margin = 164,
87 .upper_margin = 23,
88 .lower_margin = 10,
89 .hsync_len = 10,
90 .vsync_len = 10,
91 },
92};
93
94static struct fb_videomode m28evk_video_modes[] = {
95 {
96 .name = "Ampire AM-800480R2TMQW-T01H",
97 .refresh = 60,
98 .xres = 800,
99 .yres = 480,
100 .pixclock = 30066, /* picosecond (33.26 MHz) */
101 .left_margin = 0,
102 .right_margin = 256,
103 .upper_margin = 0,
104 .lower_margin = 45,
105 .hsync_len = 1,
106 .vsync_len = 1,
107 },
108};
109
110static struct fb_videomode apx4devkit_video_modes[] = {
111 {
112 .name = "HannStar PJ70112A",
113 .refresh = 60,
114 .xres = 800,
115 .yres = 480,
116 .pixclock = 33333, /* picosecond (30.00 MHz) */
117 .left_margin = 88,
118 .right_margin = 40,
119 .upper_margin = 32,
120 .lower_margin = 13,
121 .hsync_len = 48,
122 .vsync_len = 3,
123 .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
124 },
125};
126
127static struct fb_videomode apf28dev_video_modes[] = {
128 {
129 .name = "LW700",
130 .refresh = 60,
131 .xres = 800,
132 .yres = 480,
133 .pixclock = 30303, /* picosecond */
134 .left_margin = 96,
135 .right_margin = 96, /* at least 3 & 1 */
136 .upper_margin = 0x14,
137 .lower_margin = 0x15,
138 .hsync_len = 64,
139 .vsync_len = 4,
140 .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
141 },
142};
143
144static struct fb_videomode cfa10049_video_modes[] = {
145 {
146 .name = "Himax HX8357-B",
147 .refresh = 60,
148 .xres = 320,
149 .yres = 480,
150 .pixclock = 108506, /* picosecond (9.216 MHz) */
151 .left_margin = 2,
152 .right_margin = 2,
153 .upper_margin = 2,
154 .lower_margin = 2,
155 .hsync_len = 15,
156 .vsync_len = 15,
157 },
158};
159
160static struct mxsfb_platform_data mxsfb_pdata __initdata;
161
162/* 61/*
163 * MX28EVK_FLEXCAN_SWITCH is shared between both flexcan controllers 62 * MX28EVK_FLEXCAN_SWITCH is shared between both flexcan controllers
164 */ 63 */
@@ -189,8 +88,6 @@ static void mx28evk_flexcan1_switch(int enable)
189static struct flexcan_platform_data flexcan_pdata[2]; 88static struct flexcan_platform_data flexcan_pdata[2];
190 89
191static struct of_dev_auxdata mxs_auxdata_lookup[] __initdata = { 90static struct of_dev_auxdata mxs_auxdata_lookup[] __initdata = {
192 OF_DEV_AUXDATA("fsl,imx23-lcdif", 0x80030000, NULL, &mxsfb_pdata),
193 OF_DEV_AUXDATA("fsl,imx28-lcdif", 0x80030000, NULL, &mxsfb_pdata),
194 OF_DEV_AUXDATA("fsl,imx28-flexcan", 0x80032000, NULL, &flexcan_pdata[0]), 91 OF_DEV_AUXDATA("fsl,imx28-flexcan", 0x80032000, NULL, &flexcan_pdata[0]),
195 OF_DEV_AUXDATA("fsl,imx28-flexcan", 0x80034000, NULL, &flexcan_pdata[1]), 92 OF_DEV_AUXDATA("fsl,imx28-flexcan", 0x80034000, NULL, &flexcan_pdata[1]),
196 { /* sentinel */ } 93 { /* sentinel */ }
@@ -340,16 +237,6 @@ static void __init update_fec_mac_prop(enum mac_oui oui)
340 } 237 }
341} 238}
342 239
343static void __init imx23_evk_init(void)
344{
345 mxsfb_pdata.mode_list = mx23evk_video_modes;
346 mxsfb_pdata.mode_count = ARRAY_SIZE(mx23evk_video_modes);
347 mxsfb_pdata.default_bpp = 32;
348 mxsfb_pdata.ld_intf_width = STMLCDIF_24BIT;
349 mxsfb_pdata.sync = MXSFB_SYNC_DATA_ENABLE_HIGH_ACT |
350 MXSFB_SYNC_DOTCLK_FAILING_ACT;
351}
352
353static inline void enable_clk_enet_out(void) 240static inline void enable_clk_enet_out(void)
354{ 241{
355 struct clk *clk = clk_get_sys("enet_out", NULL); 242 struct clk *clk = clk_get_sys("enet_out", NULL);
@@ -360,16 +247,8 @@ static inline void enable_clk_enet_out(void)
360 247
361static void __init imx28_evk_init(void) 248static void __init imx28_evk_init(void)
362{ 249{
363 enable_clk_enet_out();
364 update_fec_mac_prop(OUI_FSL); 250 update_fec_mac_prop(OUI_FSL);
365 251
366 mxsfb_pdata.mode_list = mx28evk_video_modes;
367 mxsfb_pdata.mode_count = ARRAY_SIZE(mx28evk_video_modes);
368 mxsfb_pdata.default_bpp = 32;
369 mxsfb_pdata.ld_intf_width = STMLCDIF_24BIT;
370 mxsfb_pdata.sync = MXSFB_SYNC_DATA_ENABLE_HIGH_ACT |
371 MXSFB_SYNC_DOTCLK_FAILING_ACT;
372
373 mxs_saif_clkmux_select(MXS_DIGCTL_SAIF_CLKMUX_EXTMSTR0); 252 mxs_saif_clkmux_select(MXS_DIGCTL_SAIF_CLKMUX_EXTMSTR0);
374} 253}
375 254
@@ -382,20 +261,6 @@ static void __init imx28_evk_post_init(void)
382 } 261 }
383} 262}
384 263
385static void __init m28evk_init(void)
386{
387 mxsfb_pdata.mode_list = m28evk_video_modes;
388 mxsfb_pdata.mode_count = ARRAY_SIZE(m28evk_video_modes);
389 mxsfb_pdata.default_bpp = 16;
390 mxsfb_pdata.ld_intf_width = STMLCDIF_18BIT;
391 mxsfb_pdata.sync = MXSFB_SYNC_DATA_ENABLE_HIGH_ACT;
392}
393
394static void __init sc_sps1_init(void)
395{
396 enable_clk_enet_out();
397}
398
399static int apx4devkit_phy_fixup(struct phy_device *phy) 264static int apx4devkit_phy_fixup(struct phy_device *phy)
400{ 265{
401 phy->dev_flags |= MICREL_PHY_50MHZ_CLK; 266 phy->dev_flags |= MICREL_PHY_50MHZ_CLK;
@@ -409,13 +274,6 @@ static void __init apx4devkit_init(void)
409 if (IS_BUILTIN(CONFIG_PHYLIB)) 274 if (IS_BUILTIN(CONFIG_PHYLIB))
410 phy_register_fixup_for_uid(PHY_ID_KSZ8051, MICREL_PHY_ID_MASK, 275 phy_register_fixup_for_uid(PHY_ID_KSZ8051, MICREL_PHY_ID_MASK,
411 apx4devkit_phy_fixup); 276 apx4devkit_phy_fixup);
412
413 mxsfb_pdata.mode_list = apx4devkit_video_modes;
414 mxsfb_pdata.mode_count = ARRAY_SIZE(apx4devkit_video_modes);
415 mxsfb_pdata.default_bpp = 32;
416 mxsfb_pdata.ld_intf_width = STMLCDIF_24BIT;
417 mxsfb_pdata.sync = MXSFB_SYNC_DATA_ENABLE_HIGH_ACT |
418 MXSFB_SYNC_DOTCLK_FAILING_ACT;
419} 277}
420 278
421#define ENET0_MDC__GPIO_4_0 MXS_GPIO_NR(4, 0) 279#define ENET0_MDC__GPIO_4_0 MXS_GPIO_NR(4, 0)
@@ -494,52 +352,24 @@ static void __init tx28_post_init(void)
494 352
495static void __init cfa10049_init(void) 353static void __init cfa10049_init(void)
496{ 354{
497 enable_clk_enet_out();
498 update_fec_mac_prop(OUI_CRYSTALFONTZ); 355 update_fec_mac_prop(OUI_CRYSTALFONTZ);
499
500 mxsfb_pdata.mode_list = cfa10049_video_modes;
501 mxsfb_pdata.mode_count = ARRAY_SIZE(cfa10049_video_modes);
502 mxsfb_pdata.default_bpp = 32;
503 mxsfb_pdata.ld_intf_width = STMLCDIF_18BIT;
504 mxsfb_pdata.sync = MXSFB_SYNC_DATA_ENABLE_HIGH_ACT;
505} 356}
506 357
507static void __init cfa10037_init(void) 358static void __init cfa10037_init(void)
508{ 359{
509 enable_clk_enet_out();
510 update_fec_mac_prop(OUI_CRYSTALFONTZ); 360 update_fec_mac_prop(OUI_CRYSTALFONTZ);
511} 361}
512 362
513static void __init apf28_init(void)
514{
515 enable_clk_enet_out();
516
517 mxsfb_pdata.mode_list = apf28dev_video_modes;
518 mxsfb_pdata.mode_count = ARRAY_SIZE(apf28dev_video_modes);
519 mxsfb_pdata.default_bpp = 16;
520 mxsfb_pdata.ld_intf_width = STMLCDIF_16BIT;
521 mxsfb_pdata.sync = MXSFB_SYNC_DATA_ENABLE_HIGH_ACT |
522 MXSFB_SYNC_DOTCLK_FAILING_ACT;
523}
524
525static void __init mxs_machine_init(void) 363static void __init mxs_machine_init(void)
526{ 364{
527 if (of_machine_is_compatible("fsl,imx28-evk")) 365 if (of_machine_is_compatible("fsl,imx28-evk"))
528 imx28_evk_init(); 366 imx28_evk_init();
529 else if (of_machine_is_compatible("fsl,imx23-evk"))
530 imx23_evk_init();
531 else if (of_machine_is_compatible("denx,m28evk"))
532 m28evk_init();
533 else if (of_machine_is_compatible("bluegiga,apx4devkit")) 367 else if (of_machine_is_compatible("bluegiga,apx4devkit"))
534 apx4devkit_init(); 368 apx4devkit_init();
535 else if (of_machine_is_compatible("crystalfontz,cfa10037")) 369 else if (of_machine_is_compatible("crystalfontz,cfa10037"))
536 cfa10037_init(); 370 cfa10037_init();
537 else if (of_machine_is_compatible("crystalfontz,cfa10049")) 371 else if (of_machine_is_compatible("crystalfontz,cfa10049"))
538 cfa10049_init(); 372 cfa10049_init();
539 else if (of_machine_is_compatible("armadeus,imx28-apf28"))
540 apf28_init();
541 else if (of_machine_is_compatible("schulercontrol,imx28-sps1"))
542 sc_sps1_init();
543 373
544 of_platform_populate(NULL, of_default_bus_match_table, 374 of_platform_populate(NULL, of_default_bus_match_table,
545 mxs_auxdata_lookup, NULL); 375 mxs_auxdata_lookup, NULL);
diff --git a/drivers/dma/mxs-dma.c b/drivers/dma/mxs-dma.c
index 8f6d30d37c45..b48a79c28845 100644
--- a/drivers/dma/mxs-dma.c
+++ b/drivers/dma/mxs-dma.c
@@ -27,6 +27,7 @@
27#include <linux/stmp_device.h> 27#include <linux/stmp_device.h>
28#include <linux/of.h> 28#include <linux/of.h>
29#include <linux/of_device.h> 29#include <linux/of_device.h>
30#include <linux/of_dma.h>
30 31
31#include <asm/irq.h> 32#include <asm/irq.h>
32 33
@@ -139,6 +140,8 @@ struct mxs_dma_engine {
139 struct dma_device dma_device; 140 struct dma_device dma_device;
140 struct device_dma_parameters dma_parms; 141 struct device_dma_parameters dma_parms;
141 struct mxs_dma_chan mxs_chans[MXS_DMA_CHANNELS]; 142 struct mxs_dma_chan mxs_chans[MXS_DMA_CHANNELS];
143 struct platform_device *pdev;
144 unsigned int nr_channels;
142}; 145};
143 146
144struct mxs_dma_type { 147struct mxs_dma_type {
@@ -350,10 +353,8 @@ static int mxs_dma_alloc_chan_resources(struct dma_chan *chan)
350 struct mxs_dma_engine *mxs_dma = mxs_chan->mxs_dma; 353 struct mxs_dma_engine *mxs_dma = mxs_chan->mxs_dma;
351 int ret; 354 int ret;
352 355
353 if (!data) 356 if (data)
354 return -EINVAL; 357 mxs_chan->chan_irq = data->chan_irq;
355
356 mxs_chan->chan_irq = data->chan_irq;
357 358
358 mxs_chan->ccw = dma_alloc_coherent(mxs_dma->dma_device.dev, 359 mxs_chan->ccw = dma_alloc_coherent(mxs_dma->dma_device.dev,
359 CCW_BLOCK_SIZE, &mxs_chan->ccw_phys, 360 CCW_BLOCK_SIZE, &mxs_chan->ccw_phys,
@@ -665,8 +666,55 @@ err_out:
665 return ret; 666 return ret;
666} 667}
667 668
669struct mxs_dma_filter_param {
670 struct device_node *of_node;
671 unsigned int chan_id;
672};
673
674static bool mxs_dma_filter_fn(struct dma_chan *chan, void *fn_param)
675{
676 struct mxs_dma_filter_param *param = fn_param;
677 struct mxs_dma_chan *mxs_chan = to_mxs_dma_chan(chan);
678 struct mxs_dma_engine *mxs_dma = mxs_chan->mxs_dma;
679 int chan_irq;
680
681 if (mxs_dma->dma_device.dev->of_node != param->of_node)
682 return false;
683
684 if (chan->chan_id != param->chan_id)
685 return false;
686
687 chan_irq = platform_get_irq(mxs_dma->pdev, param->chan_id);
688 if (chan_irq < 0)
689 return false;
690
691 mxs_chan->chan_irq = chan_irq;
692
693 return true;
694}
695
696struct dma_chan *mxs_dma_xlate(struct of_phandle_args *dma_spec,
697 struct of_dma *ofdma)
698{
699 struct mxs_dma_engine *mxs_dma = ofdma->of_dma_data;
700 dma_cap_mask_t mask = mxs_dma->dma_device.cap_mask;
701 struct mxs_dma_filter_param param;
702
703 if (dma_spec->args_count != 1)
704 return NULL;
705
706 param.of_node = ofdma->of_node;
707 param.chan_id = dma_spec->args[0];
708
709 if (param.chan_id >= mxs_dma->nr_channels)
710 return NULL;
711
712 return dma_request_channel(mask, mxs_dma_filter_fn, &param);
713}
714
668static int __init mxs_dma_probe(struct platform_device *pdev) 715static int __init mxs_dma_probe(struct platform_device *pdev)
669{ 716{
717 struct device_node *np = pdev->dev.of_node;
670 const struct platform_device_id *id_entry; 718 const struct platform_device_id *id_entry;
671 const struct of_device_id *of_id; 719 const struct of_device_id *of_id;
672 const struct mxs_dma_type *dma_type; 720 const struct mxs_dma_type *dma_type;
@@ -674,10 +722,16 @@ static int __init mxs_dma_probe(struct platform_device *pdev)
674 struct resource *iores; 722 struct resource *iores;
675 int ret, i; 723 int ret, i;
676 724
677 mxs_dma = kzalloc(sizeof(*mxs_dma), GFP_KERNEL); 725 mxs_dma = devm_kzalloc(&pdev->dev, sizeof(*mxs_dma), GFP_KERNEL);
678 if (!mxs_dma) 726 if (!mxs_dma)
679 return -ENOMEM; 727 return -ENOMEM;
680 728
729 ret = of_property_read_u32(np, "dma-channels", &mxs_dma->nr_channels);
730 if (ret) {
731 dev_err(&pdev->dev, "failed to read dma-channels\n");
732 return ret;
733 }
734
681 of_id = of_match_device(mxs_dma_dt_ids, &pdev->dev); 735 of_id = of_match_device(mxs_dma_dt_ids, &pdev->dev);
682 if (of_id) 736 if (of_id)
683 id_entry = of_id->data; 737 id_entry = of_id->data;
@@ -689,24 +743,13 @@ static int __init mxs_dma_probe(struct platform_device *pdev)
689 mxs_dma->dev_id = dma_type->id; 743 mxs_dma->dev_id = dma_type->id;
690 744
691 iores = platform_get_resource(pdev, IORESOURCE_MEM, 0); 745 iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
746 mxs_dma->base = devm_ioremap_resource(&pdev->dev, iores);
747 if (IS_ERR(mxs_dma->base))
748 return PTR_ERR(mxs_dma->base);
692 749
693 if (!request_mem_region(iores->start, resource_size(iores), 750 mxs_dma->clk = devm_clk_get(&pdev->dev, NULL);
694 pdev->name)) { 751 if (IS_ERR(mxs_dma->clk))
695 ret = -EBUSY; 752 return PTR_ERR(mxs_dma->clk);
696 goto err_request_region;
697 }
698
699 mxs_dma->base = ioremap(iores->start, resource_size(iores));
700 if (!mxs_dma->base) {
701 ret = -ENOMEM;
702 goto err_ioremap;
703 }
704
705 mxs_dma->clk = clk_get(&pdev->dev, NULL);
706 if (IS_ERR(mxs_dma->clk)) {
707 ret = PTR_ERR(mxs_dma->clk);
708 goto err_clk;
709 }
710 753
711 dma_cap_set(DMA_SLAVE, mxs_dma->dma_device.cap_mask); 754 dma_cap_set(DMA_SLAVE, mxs_dma->dma_device.cap_mask);
712 dma_cap_set(DMA_CYCLIC, mxs_dma->dma_device.cap_mask); 755 dma_cap_set(DMA_CYCLIC, mxs_dma->dma_device.cap_mask);
@@ -732,8 +775,9 @@ static int __init mxs_dma_probe(struct platform_device *pdev)
732 775
733 ret = mxs_dma_init(mxs_dma); 776 ret = mxs_dma_init(mxs_dma);
734 if (ret) 777 if (ret)
735 goto err_init; 778 return ret;
736 779
780 mxs_dma->pdev = pdev;
737 mxs_dma->dma_device.dev = &pdev->dev; 781 mxs_dma->dma_device.dev = &pdev->dev;
738 782
739 /* mxs_dma gets 65535 bytes maximum sg size */ 783 /* mxs_dma gets 65535 bytes maximum sg size */
@@ -751,22 +795,19 @@ static int __init mxs_dma_probe(struct platform_device *pdev)
751 ret = dma_async_device_register(&mxs_dma->dma_device); 795 ret = dma_async_device_register(&mxs_dma->dma_device);
752 if (ret) { 796 if (ret) {
753 dev_err(mxs_dma->dma_device.dev, "unable to register\n"); 797 dev_err(mxs_dma->dma_device.dev, "unable to register\n");
754 goto err_init; 798 return ret;
799 }
800
801 ret = of_dma_controller_register(np, mxs_dma_xlate, mxs_dma);
802 if (ret) {
803 dev_err(mxs_dma->dma_device.dev,
804 "failed to register controller\n");
805 dma_async_device_unregister(&mxs_dma->dma_device);
755 } 806 }
756 807
757 dev_info(mxs_dma->dma_device.dev, "initialized\n"); 808 dev_info(mxs_dma->dma_device.dev, "initialized\n");
758 809
759 return 0; 810 return 0;
760
761err_init:
762 clk_put(mxs_dma->clk);
763err_clk:
764 iounmap(mxs_dma->base);
765err_ioremap:
766 release_mem_region(iores->start, resource_size(iores));
767err_request_region:
768 kfree(mxs_dma);
769 return ret;
770} 811}
771 812
772static struct platform_driver mxs_dma_driver = { 813static struct platform_driver mxs_dma_driver = {
diff --git a/drivers/i2c/busses/i2c-mxs.c b/drivers/i2c/busses/i2c-mxs.c
index 120f24646696..d1ba6b403b84 100644
--- a/drivers/i2c/busses/i2c-mxs.c
+++ b/drivers/i2c/busses/i2c-mxs.c
@@ -31,7 +31,6 @@
31#include <linux/of_i2c.h> 31#include <linux/of_i2c.h>
32#include <linux/dma-mapping.h> 32#include <linux/dma-mapping.h>
33#include <linux/dmaengine.h> 33#include <linux/dmaengine.h>
34#include <linux/fsl/mxs-dma.h>
35 34
36#define DRIVER_NAME "mxs-i2c" 35#define DRIVER_NAME "mxs-i2c"
37 36
@@ -113,9 +112,7 @@ struct mxs_i2c_dev {
113 uint32_t timing1; 112 uint32_t timing1;
114 113
115 /* DMA support components */ 114 /* DMA support components */
116 int dma_channel;
117 struct dma_chan *dmach; 115 struct dma_chan *dmach;
118 struct mxs_dma_data dma_data;
119 uint32_t pio_data[2]; 116 uint32_t pio_data[2];
120 uint32_t addr_data; 117 uint32_t addr_data;
121 struct scatterlist sg_io[2]; 118 struct scatterlist sg_io[2];
@@ -518,21 +515,6 @@ static const struct i2c_algorithm mxs_i2c_algo = {
518 .functionality = mxs_i2c_func, 515 .functionality = mxs_i2c_func,
519}; 516};
520 517
521static bool mxs_i2c_dma_filter(struct dma_chan *chan, void *param)
522{
523 struct mxs_i2c_dev *i2c = param;
524
525 if (!mxs_dma_is_apbx(chan))
526 return false;
527
528 if (chan->chan_id != i2c->dma_channel)
529 return false;
530
531 chan->private = &i2c->dma_data;
532
533 return true;
534}
535
536static void mxs_i2c_derive_timing(struct mxs_i2c_dev *i2c, int speed) 518static void mxs_i2c_derive_timing(struct mxs_i2c_dev *i2c, int speed)
537{ 519{
538 /* The I2C block clock run at 24MHz */ 520 /* The I2C block clock run at 24MHz */
@@ -577,17 +559,6 @@ static int mxs_i2c_get_ofdata(struct mxs_i2c_dev *i2c)
577 struct device_node *node = dev->of_node; 559 struct device_node *node = dev->of_node;
578 int ret; 560 int ret;
579 561
580 /*
581 * TODO: This is a temporary solution and should be changed
582 * to use generic DMA binding later when the helpers get in.
583 */
584 ret = of_property_read_u32(node, "fsl,i2c-dma-channel",
585 &i2c->dma_channel);
586 if (ret) {
587 dev_err(dev, "Failed to get DMA channel!\n");
588 return -ENODEV;
589 }
590
591 ret = of_property_read_u32(node, "clock-frequency", &speed); 562 ret = of_property_read_u32(node, "clock-frequency", &speed);
592 if (ret) { 563 if (ret) {
593 dev_warn(dev, "No I2C speed selected, using 100kHz\n"); 564 dev_warn(dev, "No I2C speed selected, using 100kHz\n");
@@ -607,8 +578,7 @@ static int mxs_i2c_probe(struct platform_device *pdev)
607 struct pinctrl *pinctrl; 578 struct pinctrl *pinctrl;
608 struct resource *res; 579 struct resource *res;
609 resource_size_t res_size; 580 resource_size_t res_size;
610 int err, irq, dmairq; 581 int err, irq;
611 dma_cap_mask_t mask;
612 582
613 pinctrl = devm_pinctrl_get_select_default(dev); 583 pinctrl = devm_pinctrl_get_select_default(dev);
614 if (IS_ERR(pinctrl)) 584 if (IS_ERR(pinctrl))
@@ -620,9 +590,8 @@ static int mxs_i2c_probe(struct platform_device *pdev)
620 590
621 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 591 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
622 irq = platform_get_irq(pdev, 0); 592 irq = platform_get_irq(pdev, 0);
623 dmairq = platform_get_irq(pdev, 1);
624 593
625 if (!res || irq < 0 || dmairq < 0) 594 if (!res || irq < 0)
626 return -ENOENT; 595 return -ENOENT;
627 596
628 res_size = resource_size(res); 597 res_size = resource_size(res);
@@ -648,10 +617,7 @@ static int mxs_i2c_probe(struct platform_device *pdev)
648 } 617 }
649 618
650 /* Setup the DMA */ 619 /* Setup the DMA */
651 dma_cap_zero(mask); 620 i2c->dmach = dma_request_slave_channel(dev, "rx-tx");
652 dma_cap_set(DMA_SLAVE, mask);
653 i2c->dma_data.chan_irq = dmairq;
654 i2c->dmach = dma_request_channel(mask, mxs_i2c_dma_filter, i2c);
655 if (!i2c->dmach) { 621 if (!i2c->dmach) {
656 dev_err(dev, "Failed to request dma\n"); 622 dev_err(dev, "Failed to request dma\n");
657 return -ENODEV; 623 return -ENODEV;
diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c
index 4efe3021b217..4fdc71113e6d 100644
--- a/drivers/mmc/host/mxs-mmc.c
+++ b/drivers/mmc/host/mxs-mmc.c
@@ -548,22 +548,6 @@ static const struct mmc_host_ops mxs_mmc_ops = {
548 .enable_sdio_irq = mxs_mmc_enable_sdio_irq, 548 .enable_sdio_irq = mxs_mmc_enable_sdio_irq,
549}; 549};
550 550
551static bool mxs_mmc_dma_filter(struct dma_chan *chan, void *param)
552{
553 struct mxs_mmc_host *host = param;
554 struct mxs_ssp *ssp = &host->ssp;
555
556 if (!mxs_dma_is_apbh(chan))
557 return false;
558
559 if (chan->chan_id != ssp->dma_channel)
560 return false;
561
562 chan->private = &ssp->dma_data;
563
564 return true;
565}
566
567static struct platform_device_id mxs_ssp_ids[] = { 551static struct platform_device_id mxs_ssp_ids[] = {
568 { 552 {
569 .name = "imx23-mmc", 553 .name = "imx23-mmc",
@@ -591,20 +575,17 @@ static int mxs_mmc_probe(struct platform_device *pdev)
591 struct device_node *np = pdev->dev.of_node; 575 struct device_node *np = pdev->dev.of_node;
592 struct mxs_mmc_host *host; 576 struct mxs_mmc_host *host;
593 struct mmc_host *mmc; 577 struct mmc_host *mmc;
594 struct resource *iores, *dmares; 578 struct resource *iores;
595 struct pinctrl *pinctrl; 579 struct pinctrl *pinctrl;
596 int ret = 0, irq_err, irq_dma; 580 int ret = 0, irq_err;
597 dma_cap_mask_t mask;
598 struct regulator *reg_vmmc; 581 struct regulator *reg_vmmc;
599 enum of_gpio_flags flags; 582 enum of_gpio_flags flags;
600 struct mxs_ssp *ssp; 583 struct mxs_ssp *ssp;
601 u32 bus_width = 0; 584 u32 bus_width = 0;
602 585
603 iores = platform_get_resource(pdev, IORESOURCE_MEM, 0); 586 iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
604 dmares = platform_get_resource(pdev, IORESOURCE_DMA, 0);
605 irq_err = platform_get_irq(pdev, 0); 587 irq_err = platform_get_irq(pdev, 0);
606 irq_dma = platform_get_irq(pdev, 1); 588 if (!iores || irq_err < 0)
607 if (!iores || irq_err < 0 || irq_dma < 0)
608 return -EINVAL; 589 return -EINVAL;
609 590
610 mmc = mmc_alloc_host(sizeof(struct mxs_mmc_host), &pdev->dev); 591 mmc = mmc_alloc_host(sizeof(struct mxs_mmc_host), &pdev->dev);
@@ -620,23 +601,7 @@ static int mxs_mmc_probe(struct platform_device *pdev)
620 goto out_mmc_free; 601 goto out_mmc_free;
621 } 602 }
622 603
623 if (np) { 604 ssp->devid = (enum mxs_ssp_id) of_id->data;
624 ssp->devid = (enum mxs_ssp_id) of_id->data;
625 /*
626 * TODO: This is a temporary solution and should be changed
627 * to use generic DMA binding later when the helpers get in.
628 */
629 ret = of_property_read_u32(np, "fsl,ssp-dma-channel",
630 &ssp->dma_channel);
631 if (ret) {
632 dev_err(mmc_dev(host->mmc),
633 "failed to get dma channel\n");
634 goto out_mmc_free;
635 }
636 } else {
637 ssp->devid = pdev->id_entry->driver_data;
638 ssp->dma_channel = dmares->start;
639 }
640 605
641 host->mmc = mmc; 606 host->mmc = mmc;
642 host->sdio_irq_en = 0; 607 host->sdio_irq_en = 0;
@@ -666,10 +631,7 @@ static int mxs_mmc_probe(struct platform_device *pdev)
666 631
667 mxs_mmc_reset(host); 632 mxs_mmc_reset(host);
668 633
669 dma_cap_zero(mask); 634 ssp->dmach = dma_request_slave_channel(&pdev->dev, "rx-tx");
670 dma_cap_set(DMA_SLAVE, mask);
671 ssp->dma_data.chan_irq = irq_dma;
672 ssp->dmach = dma_request_channel(mask, mxs_mmc_dma_filter, host);
673 if (!ssp->dmach) { 635 if (!ssp->dmach) {
674 dev_err(mmc_dev(host->mmc), 636 dev_err(mmc_dev(host->mmc),
675 "%s: failed to request dma\n", __func__); 637 "%s: failed to request dma\n", __func__);
diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
index 717881a3d1b8..25ecfa1822a8 100644
--- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
+++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
@@ -36,7 +36,6 @@
36#define GPMI_NAND_GPMI_REGS_ADDR_RES_NAME "gpmi-nand" 36#define GPMI_NAND_GPMI_REGS_ADDR_RES_NAME "gpmi-nand"
37#define GPMI_NAND_BCH_REGS_ADDR_RES_NAME "bch" 37#define GPMI_NAND_BCH_REGS_ADDR_RES_NAME "bch"
38#define GPMI_NAND_BCH_INTERRUPT_RES_NAME "bch" 38#define GPMI_NAND_BCH_INTERRUPT_RES_NAME "bch"
39#define GPMI_NAND_DMA_INTERRUPT_RES_NAME "gpmi-dma"
40 39
41/* add our owner bbt descriptor */ 40/* add our owner bbt descriptor */
42static uint8_t scan_ff_pattern[] = { 0xff }; 41static uint8_t scan_ff_pattern[] = { 0xff };
@@ -420,28 +419,6 @@ static void release_bch_irq(struct gpmi_nand_data *this)
420 free_irq(i, this); 419 free_irq(i, this);
421} 420}
422 421
423static bool gpmi_dma_filter(struct dma_chan *chan, void *param)
424{
425 struct gpmi_nand_data *this = param;
426 int dma_channel = (int)this->private;
427
428 if (!mxs_dma_is_apbh(chan))
429 return false;
430 /*
431 * only catch the GPMI dma channels :
432 * for mx23 : MX23_DMA_GPMI0 ~ MX23_DMA_GPMI3
433 * (These four channels share the same IRQ!)
434 *
435 * for mx28 : MX28_DMA_GPMI0 ~ MX28_DMA_GPMI7
436 * (These eight channels share the same IRQ!)
437 */
438 if (dma_channel == chan->chan_id) {
439 chan->private = &this->dma_data;
440 return true;
441 }
442 return false;
443}
444
445static void release_dma_channels(struct gpmi_nand_data *this) 422static void release_dma_channels(struct gpmi_nand_data *this)
446{ 423{
447 unsigned int i; 424 unsigned int i;
@@ -455,36 +432,10 @@ static void release_dma_channels(struct gpmi_nand_data *this)
455static int acquire_dma_channels(struct gpmi_nand_data *this) 432static int acquire_dma_channels(struct gpmi_nand_data *this)
456{ 433{
457 struct platform_device *pdev = this->pdev; 434 struct platform_device *pdev = this->pdev;
458 struct resource *r_dma;
459 struct device_node *dn;
460 u32 dma_channel;
461 int ret;
462 struct dma_chan *dma_chan; 435 struct dma_chan *dma_chan;
463 dma_cap_mask_t mask;
464
465 /* dma channel, we only use the first one. */
466 dn = pdev->dev.of_node;
467 ret = of_property_read_u32(dn, "fsl,gpmi-dma-channel", &dma_channel);
468 if (ret) {
469 pr_err("unable to get DMA channel from dt.\n");
470 goto acquire_err;
471 }
472 this->private = (void *)dma_channel;
473
474 /* gpmi dma interrupt */
475 r_dma = platform_get_resource_byname(pdev, IORESOURCE_IRQ,
476 GPMI_NAND_DMA_INTERRUPT_RES_NAME);
477 if (!r_dma) {
478 pr_err("Can't get resource for DMA\n");
479 goto acquire_err;
480 }
481 this->dma_data.chan_irq = r_dma->start;
482 436
483 /* request dma channel */ 437 /* request dma channel */
484 dma_cap_zero(mask); 438 dma_chan = dma_request_slave_channel(&pdev->dev, "rx-tx");
485 dma_cap_set(DMA_SLAVE, mask);
486
487 dma_chan = dma_request_channel(mask, gpmi_dma_filter, this);
488 if (!dma_chan) { 439 if (!dma_chan) {
489 pr_err("Failed to request DMA channel.\n"); 440 pr_err("Failed to request DMA channel.\n");
490 goto acquire_err; 441 goto acquire_err;
diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-nand.h b/drivers/mtd/nand/gpmi-nand/gpmi-nand.h
index 072947731277..a7685e3a8748 100644
--- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.h
+++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.h
@@ -20,7 +20,7 @@
20#include <linux/mtd/nand.h> 20#include <linux/mtd/nand.h>
21#include <linux/platform_device.h> 21#include <linux/platform_device.h>
22#include <linux/dma-mapping.h> 22#include <linux/dma-mapping.h>
23#include <linux/fsl/mxs-dma.h> 23#include <linux/dmaengine.h>
24 24
25#define GPMI_CLK_MAX 5 /* MX6Q needs five clocks */ 25#define GPMI_CLK_MAX 5 /* MX6Q needs five clocks */
26struct resources { 26struct resources {
@@ -180,7 +180,6 @@ struct gpmi_nand_data {
180 /* DMA channels */ 180 /* DMA channels */
181#define DMA_CHANS 8 181#define DMA_CHANS 8
182 struct dma_chan *dma_chans[DMA_CHANS]; 182 struct dma_chan *dma_chans[DMA_CHANS];
183 struct mxs_dma_data dma_data;
184 enum dma_ops_type last_dma_type; 183 enum dma_ops_type last_dma_type;
185 enum dma_ops_type dma_type; 184 enum dma_ops_type dma_type;
186 struct completion dma_done; 185 struct completion dma_done;
diff --git a/drivers/net/ethernet/freescale/fec.c b/drivers/net/ethernet/freescale/fec.c
index 911d0253dbb2..dd098ea44d48 100644
--- a/drivers/net/ethernet/freescale/fec.c
+++ b/drivers/net/ethernet/freescale/fec.c
@@ -1802,18 +1802,23 @@ fec_probe(struct platform_device *pdev)
1802 goto failed_clk; 1802 goto failed_clk;
1803 } 1803 }
1804 1804
1805 /* enet_out is optional, depends on board */
1806 fep->clk_enet_out = devm_clk_get(&pdev->dev, "enet_out");
1807 if (IS_ERR(fep->clk_enet_out))
1808 fep->clk_enet_out = NULL;
1809
1805 fep->clk_ptp = devm_clk_get(&pdev->dev, "ptp"); 1810 fep->clk_ptp = devm_clk_get(&pdev->dev, "ptp");
1806 fep->bufdesc_ex = 1811 fep->bufdesc_ex =
1807 pdev->id_entry->driver_data & FEC_QUIRK_HAS_BUFDESC_EX; 1812 pdev->id_entry->driver_data & FEC_QUIRK_HAS_BUFDESC_EX;
1808 if (IS_ERR(fep->clk_ptp)) { 1813 if (IS_ERR(fep->clk_ptp)) {
1809 ret = PTR_ERR(fep->clk_ptp); 1814 fep->clk_ptp = NULL;
1810 fep->bufdesc_ex = 0; 1815 fep->bufdesc_ex = 0;
1811 } 1816 }
1812 1817
1813 clk_prepare_enable(fep->clk_ahb); 1818 clk_prepare_enable(fep->clk_ahb);
1814 clk_prepare_enable(fep->clk_ipg); 1819 clk_prepare_enable(fep->clk_ipg);
1815 if (!IS_ERR(fep->clk_ptp)) 1820 clk_prepare_enable(fep->clk_enet_out);
1816 clk_prepare_enable(fep->clk_ptp); 1821 clk_prepare_enable(fep->clk_ptp);
1817 1822
1818 reg_phy = devm_regulator_get(&pdev->dev, "phy"); 1823 reg_phy = devm_regulator_get(&pdev->dev, "phy");
1819 if (!IS_ERR(reg_phy)) { 1824 if (!IS_ERR(reg_phy)) {
@@ -1878,8 +1883,8 @@ failed_irq:
1878failed_regulator: 1883failed_regulator:
1879 clk_disable_unprepare(fep->clk_ahb); 1884 clk_disable_unprepare(fep->clk_ahb);
1880 clk_disable_unprepare(fep->clk_ipg); 1885 clk_disable_unprepare(fep->clk_ipg);
1881 if (!IS_ERR(fep->clk_ptp)) 1886 clk_disable_unprepare(fep->clk_enet_out);
1882 clk_disable_unprepare(fep->clk_ptp); 1887 clk_disable_unprepare(fep->clk_ptp);
1883failed_pin: 1888failed_pin:
1884failed_clk: 1889failed_clk:
1885 iounmap(fep->hwp); 1890 iounmap(fep->hwp);
@@ -1905,6 +1910,7 @@ fec_drv_remove(struct platform_device *pdev)
1905 clk_disable_unprepare(fep->clk_ptp); 1910 clk_disable_unprepare(fep->clk_ptp);
1906 if (fep->ptp_clock) 1911 if (fep->ptp_clock)
1907 ptp_clock_unregister(fep->ptp_clock); 1912 ptp_clock_unregister(fep->ptp_clock);
1913 clk_disable_unprepare(fep->clk_enet_out);
1908 clk_disable_unprepare(fep->clk_ahb); 1914 clk_disable_unprepare(fep->clk_ahb);
1909 clk_disable_unprepare(fep->clk_ipg); 1915 clk_disable_unprepare(fep->clk_ipg);
1910 for (i = 0; i < FEC_IRQ_NUM; i++) { 1916 for (i = 0; i < FEC_IRQ_NUM; i++) {
@@ -1935,6 +1941,7 @@ fec_suspend(struct device *dev)
1935 fec_stop(ndev); 1941 fec_stop(ndev);
1936 netif_device_detach(ndev); 1942 netif_device_detach(ndev);
1937 } 1943 }
1944 clk_disable_unprepare(fep->clk_enet_out);
1938 clk_disable_unprepare(fep->clk_ahb); 1945 clk_disable_unprepare(fep->clk_ahb);
1939 clk_disable_unprepare(fep->clk_ipg); 1946 clk_disable_unprepare(fep->clk_ipg);
1940 1947
@@ -1947,6 +1954,7 @@ fec_resume(struct device *dev)
1947 struct net_device *ndev = dev_get_drvdata(dev); 1954 struct net_device *ndev = dev_get_drvdata(dev);
1948 struct fec_enet_private *fep = netdev_priv(ndev); 1955 struct fec_enet_private *fep = netdev_priv(ndev);
1949 1956
1957 clk_prepare_enable(fep->clk_enet_out);
1950 clk_prepare_enable(fep->clk_ahb); 1958 clk_prepare_enable(fep->clk_ahb);
1951 clk_prepare_enable(fep->clk_ipg); 1959 clk_prepare_enable(fep->clk_ipg);
1952 if (netif_running(ndev)) { 1960 if (netif_running(ndev)) {
diff --git a/drivers/net/ethernet/freescale/fec.h b/drivers/net/ethernet/freescale/fec.h
index eb4372962839..feabcb6a78b4 100644
--- a/drivers/net/ethernet/freescale/fec.h
+++ b/drivers/net/ethernet/freescale/fec.h
@@ -207,6 +207,7 @@ struct fec_enet_private {
207 207
208 struct clk *clk_ipg; 208 struct clk *clk_ipg;
209 struct clk *clk_ahb; 209 struct clk *clk_ahb;
210 struct clk *clk_enet_out;
210 struct clk *clk_ptp; 211 struct clk *clk_ptp;
211 212
212 /* The saved address of a sent-in-place packet/buffer, for skfree(). */ 213 /* The saved address of a sent-in-place packet/buffer, for skfree(). */
diff --git a/drivers/spi/spi-mxs.c b/drivers/spi/spi-mxs.c
index 22a0af0147fb..7b1c014b0740 100644
--- a/drivers/spi/spi-mxs.c
+++ b/drivers/spi/spi-mxs.c
@@ -490,21 +490,6 @@ static int mxs_spi_transfer_one(struct spi_master *master,
490 return status; 490 return status;
491} 491}
492 492
493static bool mxs_ssp_dma_filter(struct dma_chan *chan, void *param)
494{
495 struct mxs_ssp *ssp = param;
496
497 if (!mxs_dma_is_apbh(chan))
498 return false;
499
500 if (chan->chan_id != ssp->dma_channel)
501 return false;
502
503 chan->private = &ssp->dma_data;
504
505 return true;
506}
507
508static const struct of_device_id mxs_spi_dt_ids[] = { 493static const struct of_device_id mxs_spi_dt_ids[] = {
509 { .compatible = "fsl,imx23-spi", .data = (void *) IMX23_SSP, }, 494 { .compatible = "fsl,imx23-spi", .data = (void *) IMX23_SSP, },
510 { .compatible = "fsl,imx28-spi", .data = (void *) IMX28_SSP, }, 495 { .compatible = "fsl,imx28-spi", .data = (void *) IMX28_SSP, },
@@ -520,13 +505,12 @@ static int mxs_spi_probe(struct platform_device *pdev)
520 struct spi_master *master; 505 struct spi_master *master;
521 struct mxs_spi *spi; 506 struct mxs_spi *spi;
522 struct mxs_ssp *ssp; 507 struct mxs_ssp *ssp;
523 struct resource *iores, *dmares; 508 struct resource *iores;
524 struct pinctrl *pinctrl; 509 struct pinctrl *pinctrl;
525 struct clk *clk; 510 struct clk *clk;
526 void __iomem *base; 511 void __iomem *base;
527 int devid, dma_channel, clk_freq; 512 int devid, clk_freq;
528 int ret = 0, irq_err, irq_dma; 513 int ret = 0, irq_err;
529 dma_cap_mask_t mask;
530 514
531 /* 515 /*
532 * Default clock speed for the SPI core. 160MHz seems to 516 * Default clock speed for the SPI core. 160MHz seems to
@@ -537,8 +521,7 @@ static int mxs_spi_probe(struct platform_device *pdev)
537 521
538 iores = platform_get_resource(pdev, IORESOURCE_MEM, 0); 522 iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
539 irq_err = platform_get_irq(pdev, 0); 523 irq_err = platform_get_irq(pdev, 0);
540 irq_dma = platform_get_irq(pdev, 1); 524 if (!iores || irq_err < 0)
541 if (!iores || irq_err < 0 || irq_dma < 0)
542 return -EINVAL; 525 return -EINVAL;
543 526
544 base = devm_ioremap_resource(&pdev->dev, iores); 527 base = devm_ioremap_resource(&pdev->dev, iores);
@@ -553,32 +536,11 @@ static int mxs_spi_probe(struct platform_device *pdev)
553 if (IS_ERR(clk)) 536 if (IS_ERR(clk))
554 return PTR_ERR(clk); 537 return PTR_ERR(clk);
555 538
556 if (np) { 539 devid = (enum mxs_ssp_id) of_id->data;
557 devid = (enum mxs_ssp_id) of_id->data; 540 ret = of_property_read_u32(np, "clock-frequency",
558 /* 541 &clk_freq);
559 * TODO: This is a temporary solution and should be changed 542 if (ret)
560 * to use generic DMA binding later when the helpers get in.
561 */
562 ret = of_property_read_u32(np, "fsl,ssp-dma-channel",
563 &dma_channel);
564 if (ret) {
565 dev_err(&pdev->dev,
566 "Failed to get DMA channel\n");
567 return -EINVAL;
568 }
569
570 ret = of_property_read_u32(np, "clock-frequency",
571 &clk_freq);
572 if (ret)
573 clk_freq = clk_freq_default;
574 } else {
575 dmares = platform_get_resource(pdev, IORESOURCE_DMA, 0);
576 if (!dmares)
577 return -EINVAL;
578 devid = pdev->id_entry->driver_data;
579 dma_channel = dmares->start;
580 clk_freq = clk_freq_default; 543 clk_freq = clk_freq_default;
581 }
582 544
583 master = spi_alloc_master(&pdev->dev, sizeof(*spi)); 545 master = spi_alloc_master(&pdev->dev, sizeof(*spi));
584 if (!master) 546 if (!master)
@@ -597,7 +559,6 @@ static int mxs_spi_probe(struct platform_device *pdev)
597 ssp->clk = clk; 559 ssp->clk = clk;
598 ssp->base = base; 560 ssp->base = base;
599 ssp->devid = devid; 561 ssp->devid = devid;
600 ssp->dma_channel = dma_channel;
601 562
602 init_completion(&spi->c); 563 init_completion(&spi->c);
603 564
@@ -606,10 +567,7 @@ static int mxs_spi_probe(struct platform_device *pdev)
606 if (ret) 567 if (ret)
607 goto out_master_free; 568 goto out_master_free;
608 569
609 dma_cap_zero(mask); 570 ssp->dmach = dma_request_slave_channel(&pdev->dev, "rx-tx");
610 dma_cap_set(DMA_SLAVE, mask);
611 ssp->dma_data.chan_irq = irq_dma;
612 ssp->dmach = dma_request_channel(mask, mxs_ssp_dma_filter, ssp);
613 if (!ssp->dmach) { 571 if (!ssp->dmach) {
614 dev_err(ssp->dev, "Failed to request DMA\n"); 572 dev_err(ssp->dev, "Failed to request DMA\n");
615 goto out_master_free; 573 goto out_master_free;
diff --git a/drivers/tty/serial/mxs-auart.c b/drivers/tty/serial/mxs-auart.c
index d549fe1fa42a..269a27caff33 100644
--- a/drivers/tty/serial/mxs-auart.c
+++ b/drivers/tty/serial/mxs-auart.c
@@ -35,7 +35,7 @@
35#include <linux/pinctrl/consumer.h> 35#include <linux/pinctrl/consumer.h>
36#include <linux/of_device.h> 36#include <linux/of_device.h>
37#include <linux/dma-mapping.h> 37#include <linux/dma-mapping.h>
38#include <linux/fsl/mxs-dma.h> 38#include <linux/dmaengine.h>
39 39
40#include <asm/cacheflush.h> 40#include <asm/cacheflush.h>
41 41
@@ -148,11 +148,6 @@ struct mxs_auart_port {
148 struct device *dev; 148 struct device *dev;
149 149
150 /* for DMA */ 150 /* for DMA */
151 struct mxs_dma_data dma_data;
152 int dma_channel_rx, dma_channel_tx;
153 int dma_irq_rx, dma_irq_tx;
154 int dma_channel;
155
156 struct scatterlist tx_sgl; 151 struct scatterlist tx_sgl;
157 struct dma_chan *tx_dma_chan; 152 struct dma_chan *tx_dma_chan;
158 void *tx_dma_buf; 153 void *tx_dma_buf;
@@ -440,20 +435,6 @@ static u32 mxs_auart_get_mctrl(struct uart_port *u)
440 return mctrl; 435 return mctrl;
441} 436}
442 437
443static bool mxs_auart_dma_filter(struct dma_chan *chan, void *param)
444{
445 struct mxs_auart_port *s = param;
446
447 if (!mxs_dma_is_apbx(chan))
448 return false;
449
450 if (s->dma_channel == chan->chan_id) {
451 chan->private = &s->dma_data;
452 return true;
453 }
454 return false;
455}
456
457static int mxs_auart_dma_prep_rx(struct mxs_auart_port *s); 438static int mxs_auart_dma_prep_rx(struct mxs_auart_port *s);
458static void dma_rx_callback(void *arg) 439static void dma_rx_callback(void *arg)
459{ 440{
@@ -545,21 +526,11 @@ static void mxs_auart_dma_exit(struct mxs_auart_port *s)
545 526
546static int mxs_auart_dma_init(struct mxs_auart_port *s) 527static int mxs_auart_dma_init(struct mxs_auart_port *s)
547{ 528{
548 dma_cap_mask_t mask;
549
550 if (auart_dma_enabled(s)) 529 if (auart_dma_enabled(s))
551 return 0; 530 return 0;
552 531
553 /* We do not get the right DMA channels. */
554 if (s->dma_channel_rx == -1 || s->dma_channel_tx == -1)
555 return -EINVAL;
556
557 /* init for RX */ 532 /* init for RX */
558 dma_cap_zero(mask); 533 s->rx_dma_chan = dma_request_slave_channel(s->dev, "rx");
559 dma_cap_set(DMA_SLAVE, mask);
560 s->dma_channel = s->dma_channel_rx;
561 s->dma_data.chan_irq = s->dma_irq_rx;
562 s->rx_dma_chan = dma_request_channel(mask, mxs_auart_dma_filter, s);
563 if (!s->rx_dma_chan) 534 if (!s->rx_dma_chan)
564 goto err_out; 535 goto err_out;
565 s->rx_dma_buf = kzalloc(UART_XMIT_SIZE, GFP_KERNEL | GFP_DMA); 536 s->rx_dma_buf = kzalloc(UART_XMIT_SIZE, GFP_KERNEL | GFP_DMA);
@@ -567,9 +538,7 @@ static int mxs_auart_dma_init(struct mxs_auart_port *s)
567 goto err_out; 538 goto err_out;
568 539
569 /* init for TX */ 540 /* init for TX */
570 s->dma_channel = s->dma_channel_tx; 541 s->tx_dma_chan = dma_request_slave_channel(s->dev, "tx");
571 s->dma_data.chan_irq = s->dma_irq_tx;
572 s->tx_dma_chan = dma_request_channel(mask, mxs_auart_dma_filter, s);
573 if (!s->tx_dma_chan) 542 if (!s->tx_dma_chan)
574 goto err_out; 543 goto err_out;
575 s->tx_dma_buf = kzalloc(UART_XMIT_SIZE, GFP_KERNEL | GFP_DMA); 544 s->tx_dma_buf = kzalloc(UART_XMIT_SIZE, GFP_KERNEL | GFP_DMA);
@@ -1020,7 +989,6 @@ static int serial_mxs_probe_dt(struct mxs_auart_port *s,
1020 struct platform_device *pdev) 989 struct platform_device *pdev)
1021{ 990{
1022 struct device_node *np = pdev->dev.of_node; 991 struct device_node *np = pdev->dev.of_node;
1023 u32 dma_channel[2];
1024 int ret; 992 int ret;
1025 993
1026 if (!np) 994 if (!np)
@@ -1034,20 +1002,8 @@ static int serial_mxs_probe_dt(struct mxs_auart_port *s,
1034 } 1002 }
1035 s->port.line = ret; 1003 s->port.line = ret;
1036 1004
1037 s->dma_irq_rx = platform_get_irq(pdev, 1); 1005 s->flags |= MXS_AUART_DMA_CONFIG;
1038 s->dma_irq_tx = platform_get_irq(pdev, 2);
1039 1006
1040 ret = of_property_read_u32_array(np, "fsl,auart-dma-channel",
1041 dma_channel, 2);
1042 if (ret == 0) {
1043 s->dma_channel_rx = dma_channel[0];
1044 s->dma_channel_tx = dma_channel[1];
1045
1046 s->flags |= MXS_AUART_DMA_CONFIG;
1047 } else {
1048 s->dma_channel_rx = -1;
1049 s->dma_channel_tx = -1;
1050 }
1051 return 0; 1007 return 0;
1052} 1008}
1053 1009
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index 4c1546f71d56..e7718fdad1e1 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -2437,6 +2437,8 @@ config FB_MXS
2437 select FB_CFB_FILLRECT 2437 select FB_CFB_FILLRECT
2438 select FB_CFB_COPYAREA 2438 select FB_CFB_COPYAREA
2439 select FB_CFB_IMAGEBLIT 2439 select FB_CFB_IMAGEBLIT
2440 select FB_MODE_HELPERS
2441 select OF_VIDEOMODE
2440 help 2442 help
2441 Framebuffer support for the MXS SoC. 2443 Framebuffer support for the MXS SoC.
2442 2444
diff --git a/drivers/video/mxsfb.c b/drivers/video/mxsfb.c
index 45169cbaba6e..1b2c26d1658c 100644
--- a/drivers/video/mxsfb.c
+++ b/drivers/video/mxsfb.c
@@ -42,13 +42,15 @@
42#include <linux/module.h> 42#include <linux/module.h>
43#include <linux/kernel.h> 43#include <linux/kernel.h>
44#include <linux/of_device.h> 44#include <linux/of_device.h>
45#include <linux/of_gpio.h> 45#include <video/of_display_timing.h>
46#include <linux/platform_device.h> 46#include <linux/platform_device.h>
47#include <linux/clk.h> 47#include <linux/clk.h>
48#include <linux/dma-mapping.h> 48#include <linux/dma-mapping.h>
49#include <linux/io.h> 49#include <linux/io.h>
50#include <linux/pinctrl/consumer.h> 50#include <linux/pinctrl/consumer.h>
51#include <linux/mxsfb.h> 51#include <linux/fb.h>
52#include <linux/regulator/consumer.h>
53#include <video/videomode.h>
52 54
53#define REG_SET 4 55#define REG_SET 4
54#define REG_CLR 8 56#define REG_CLR 8
@@ -107,7 +109,7 @@
107#define VDCTRL0_ENABLE_PRESENT (1 << 28) 109#define VDCTRL0_ENABLE_PRESENT (1 << 28)
108#define VDCTRL0_VSYNC_ACT_HIGH (1 << 27) 110#define VDCTRL0_VSYNC_ACT_HIGH (1 << 27)
109#define VDCTRL0_HSYNC_ACT_HIGH (1 << 26) 111#define VDCTRL0_HSYNC_ACT_HIGH (1 << 26)
110#define VDCTRL0_DOTCLK_ACT_FAILING (1 << 25) 112#define VDCTRL0_DOTCLK_ACT_FALLING (1 << 25)
111#define VDCTRL0_ENABLE_ACT_HIGH (1 << 24) 113#define VDCTRL0_ENABLE_ACT_HIGH (1 << 24)
112#define VDCTRL0_VSYNC_PERIOD_UNIT (1 << 21) 114#define VDCTRL0_VSYNC_PERIOD_UNIT (1 << 21)
113#define VDCTRL0_VSYNC_PULSE_WIDTH_UNIT (1 << 20) 115#define VDCTRL0_VSYNC_PULSE_WIDTH_UNIT (1 << 20)
@@ -142,6 +144,14 @@
142#define BLUE 2 144#define BLUE 2
143#define TRANSP 3 145#define TRANSP 3
144 146
147#define STMLCDIF_8BIT 1 /** pixel data bus to the display is of 8 bit width */
148#define STMLCDIF_16BIT 0 /** pixel data bus to the display is of 16 bit width */
149#define STMLCDIF_18BIT 2 /** pixel data bus to the display is of 18 bit width */
150#define STMLCDIF_24BIT 3 /** pixel data bus to the display is of 24 bit width */
151
152#define MXSFB_SYNC_DATA_ENABLE_HIGH_ACT (1 << 6)
153#define MXSFB_SYNC_DOTCLK_FALLING_ACT (1 << 7) /* negtive edge sampling */
154
145enum mxsfb_devtype { 155enum mxsfb_devtype {
146 MXSFB_V3, 156 MXSFB_V3,
147 MXSFB_V4, 157 MXSFB_V4,
@@ -168,8 +178,8 @@ struct mxsfb_info {
168 unsigned ld_intf_width; 178 unsigned ld_intf_width;
169 unsigned dotclk_delay; 179 unsigned dotclk_delay;
170 const struct mxsfb_devdata *devdata; 180 const struct mxsfb_devdata *devdata;
171 int mapped;
172 u32 sync; 181 u32 sync;
182 struct regulator *reg_lcd;
173}; 183};
174 184
175#define mxsfb_is_v3(host) (host->devdata->ipversion == 3) 185#define mxsfb_is_v3(host) (host->devdata->ipversion == 3)
@@ -329,9 +339,19 @@ static void mxsfb_enable_controller(struct fb_info *fb_info)
329{ 339{
330 struct mxsfb_info *host = to_imxfb_host(fb_info); 340 struct mxsfb_info *host = to_imxfb_host(fb_info);
331 u32 reg; 341 u32 reg;
342 int ret;
332 343
333 dev_dbg(&host->pdev->dev, "%s\n", __func__); 344 dev_dbg(&host->pdev->dev, "%s\n", __func__);
334 345
346 if (host->reg_lcd) {
347 ret = regulator_enable(host->reg_lcd);
348 if (ret) {
349 dev_err(&host->pdev->dev,
350 "lcd regulator enable failed: %d\n", ret);
351 return;
352 }
353 }
354
335 clk_prepare_enable(host->clk); 355 clk_prepare_enable(host->clk);
336 clk_set_rate(host->clk, PICOS2KHZ(fb_info->var.pixclock) * 1000U); 356 clk_set_rate(host->clk, PICOS2KHZ(fb_info->var.pixclock) * 1000U);
337 357
@@ -353,6 +373,7 @@ static void mxsfb_disable_controller(struct fb_info *fb_info)
353 struct mxsfb_info *host = to_imxfb_host(fb_info); 373 struct mxsfb_info *host = to_imxfb_host(fb_info);
354 unsigned loop; 374 unsigned loop;
355 u32 reg; 375 u32 reg;
376 int ret;
356 377
357 dev_dbg(&host->pdev->dev, "%s\n", __func__); 378 dev_dbg(&host->pdev->dev, "%s\n", __func__);
358 379
@@ -376,6 +397,13 @@ static void mxsfb_disable_controller(struct fb_info *fb_info)
376 clk_disable_unprepare(host->clk); 397 clk_disable_unprepare(host->clk);
377 398
378 host->enabled = 0; 399 host->enabled = 0;
400
401 if (host->reg_lcd) {
402 ret = regulator_disable(host->reg_lcd);
403 if (ret)
404 dev_err(&host->pdev->dev,
405 "lcd regulator disable failed: %d\n", ret);
406 }
379} 407}
380 408
381static int mxsfb_set_par(struct fb_info *fb_info) 409static int mxsfb_set_par(struct fb_info *fb_info)
@@ -459,8 +487,8 @@ static int mxsfb_set_par(struct fb_info *fb_info)
459 vdctrl0 |= VDCTRL0_VSYNC_ACT_HIGH; 487 vdctrl0 |= VDCTRL0_VSYNC_ACT_HIGH;
460 if (host->sync & MXSFB_SYNC_DATA_ENABLE_HIGH_ACT) 488 if (host->sync & MXSFB_SYNC_DATA_ENABLE_HIGH_ACT)
461 vdctrl0 |= VDCTRL0_ENABLE_ACT_HIGH; 489 vdctrl0 |= VDCTRL0_ENABLE_ACT_HIGH;
462 if (host->sync & MXSFB_SYNC_DOTCLK_FAILING_ACT) 490 if (host->sync & MXSFB_SYNC_DOTCLK_FALLING_ACT)
463 vdctrl0 |= VDCTRL0_DOTCLK_ACT_FAILING; 491 vdctrl0 |= VDCTRL0_DOTCLK_ACT_FALLING;
464 492
465 writel(vdctrl0, host->base + LCDC_VDCTRL0); 493 writel(vdctrl0, host->base + LCDC_VDCTRL0);
466 494
@@ -679,14 +707,105 @@ static int mxsfb_restore_mode(struct mxsfb_info *host)
679 return 0; 707 return 0;
680} 708}
681 709
710static int mxsfb_init_fbinfo_dt(struct mxsfb_info *host)
711{
712 struct fb_info *fb_info = &host->fb_info;
713 struct fb_var_screeninfo *var = &fb_info->var;
714 struct device *dev = &host->pdev->dev;
715 struct device_node *np = host->pdev->dev.of_node;
716 struct device_node *display_np;
717 struct device_node *timings_np;
718 struct display_timings *timings;
719 u32 width;
720 int i;
721 int ret = 0;
722
723 display_np = of_parse_phandle(np, "display", 0);
724 if (!display_np) {
725 dev_err(dev, "failed to find display phandle\n");
726 return -ENOENT;
727 }
728
729 ret = of_property_read_u32(display_np, "bus-width", &width);
730 if (ret < 0) {
731 dev_err(dev, "failed to get property bus-width\n");
732 goto put_display_node;
733 }
734
735 switch (width) {
736 case 8:
737 host->ld_intf_width = STMLCDIF_8BIT;
738 break;
739 case 16:
740 host->ld_intf_width = STMLCDIF_16BIT;
741 break;
742 case 18:
743 host->ld_intf_width = STMLCDIF_18BIT;
744 break;
745 case 24:
746 host->ld_intf_width = STMLCDIF_24BIT;
747 break;
748 default:
749 dev_err(dev, "invalid bus-width value\n");
750 ret = -EINVAL;
751 goto put_display_node;
752 }
753
754 ret = of_property_read_u32(display_np, "bits-per-pixel",
755 &var->bits_per_pixel);
756 if (ret < 0) {
757 dev_err(dev, "failed to get property bits-per-pixel\n");
758 goto put_display_node;
759 }
760
761 timings = of_get_display_timings(display_np);
762 if (!timings) {
763 dev_err(dev, "failed to get display timings\n");
764 ret = -ENOENT;
765 goto put_display_node;
766 }
767
768 timings_np = of_find_node_by_name(display_np,
769 "display-timings");
770 if (!timings_np) {
771 dev_err(dev, "failed to find display-timings node\n");
772 ret = -ENOENT;
773 goto put_display_node;
774 }
775
776 for (i = 0; i < of_get_child_count(timings_np); i++) {
777 struct videomode vm;
778 struct fb_videomode fb_vm;
779
780 ret = videomode_from_timing(timings, &vm, i);
781 if (ret < 0)
782 goto put_timings_node;
783 ret = fb_videomode_from_videomode(&vm, &fb_vm);
784 if (ret < 0)
785 goto put_timings_node;
786
787 if (vm.data_flags & DISPLAY_FLAGS_DE_HIGH)
788 host->sync |= MXSFB_SYNC_DATA_ENABLE_HIGH_ACT;
789 if (vm.data_flags & DISPLAY_FLAGS_PIXDATA_NEGEDGE)
790 host->sync |= MXSFB_SYNC_DOTCLK_FALLING_ACT;
791 fb_add_videomode(&fb_vm, &fb_info->modelist);
792 }
793
794put_timings_node:
795 of_node_put(timings_np);
796put_display_node:
797 of_node_put(display_np);
798 return ret;
799}
800
682static int mxsfb_init_fbinfo(struct mxsfb_info *host) 801static int mxsfb_init_fbinfo(struct mxsfb_info *host)
683{ 802{
684 struct fb_info *fb_info = &host->fb_info; 803 struct fb_info *fb_info = &host->fb_info;
685 struct fb_var_screeninfo *var = &fb_info->var; 804 struct fb_var_screeninfo *var = &fb_info->var;
686 struct mxsfb_platform_data *pdata = host->pdev->dev.platform_data;
687 dma_addr_t fb_phys; 805 dma_addr_t fb_phys;
688 void *fb_virt; 806 void *fb_virt;
689 unsigned fb_size = pdata->fb_size; 807 unsigned fb_size;
808 int ret;
690 809
691 fb_info->fbops = &mxsfb_ops; 810 fb_info->fbops = &mxsfb_ops;
692 fb_info->flags = FBINFO_FLAG_DEFAULT | FBINFO_READS_FAST; 811 fb_info->flags = FBINFO_FLAG_DEFAULT | FBINFO_READS_FAST;
@@ -696,40 +815,22 @@ static int mxsfb_init_fbinfo(struct mxsfb_info *host)
696 fb_info->fix.visual = FB_VISUAL_TRUECOLOR, 815 fb_info->fix.visual = FB_VISUAL_TRUECOLOR,
697 fb_info->fix.accel = FB_ACCEL_NONE; 816 fb_info->fix.accel = FB_ACCEL_NONE;
698 817
699 var->bits_per_pixel = pdata->default_bpp ? pdata->default_bpp : 16; 818 ret = mxsfb_init_fbinfo_dt(host);
819 if (ret)
820 return ret;
821
700 var->nonstd = 0; 822 var->nonstd = 0;
701 var->activate = FB_ACTIVATE_NOW; 823 var->activate = FB_ACTIVATE_NOW;
702 var->accel_flags = 0; 824 var->accel_flags = 0;
703 var->vmode = FB_VMODE_NONINTERLACED; 825 var->vmode = FB_VMODE_NONINTERLACED;
704 826
705 host->dotclk_delay = pdata->dotclk_delay;
706 host->ld_intf_width = pdata->ld_intf_width;
707
708 /* Memory allocation for framebuffer */ 827 /* Memory allocation for framebuffer */
709 if (pdata->fb_phys) { 828 fb_size = SZ_2M;
710 if (!fb_size) 829 fb_virt = alloc_pages_exact(fb_size, GFP_DMA);
711 return -EINVAL; 830 if (!fb_virt)
712 831 return -ENOMEM;
713 fb_phys = pdata->fb_phys;
714
715 if (!request_mem_region(fb_phys, fb_size, host->pdev->name))
716 return -ENOMEM;
717 832
718 fb_virt = ioremap(fb_phys, fb_size); 833 fb_phys = virt_to_phys(fb_virt);
719 if (!fb_virt) {
720 release_mem_region(fb_phys, fb_size);
721 return -ENOMEM;
722 }
723 host->mapped = 1;
724 } else {
725 if (!fb_size)
726 fb_size = SZ_2M; /* default */
727 fb_virt = alloc_pages_exact(fb_size, GFP_DMA);
728 if (!fb_virt)
729 return -ENOMEM;
730
731 fb_phys = virt_to_phys(fb_virt);
732 }
733 834
734 fb_info->fix.smem_start = fb_phys; 835 fb_info->fix.smem_start = fb_phys;
735 fb_info->screen_base = fb_virt; 836 fb_info->screen_base = fb_virt;
@@ -745,13 +846,7 @@ static void mxsfb_free_videomem(struct mxsfb_info *host)
745{ 846{
746 struct fb_info *fb_info = &host->fb_info; 847 struct fb_info *fb_info = &host->fb_info;
747 848
748 if (host->mapped) { 849 free_pages_exact(fb_info->screen_base, fb_info->fix.smem_len);
749 iounmap(fb_info->screen_base);
750 release_mem_region(fb_info->fix.smem_start,
751 fb_info->screen_size);
752 } else {
753 free_pages_exact(fb_info->screen_base, fb_info->fix.smem_len);
754 }
755} 850}
756 851
757static struct platform_device_id mxsfb_devtype[] = { 852static struct platform_device_id mxsfb_devtype[] = {
@@ -778,47 +873,35 @@ static int mxsfb_probe(struct platform_device *pdev)
778{ 873{
779 const struct of_device_id *of_id = 874 const struct of_device_id *of_id =
780 of_match_device(mxsfb_dt_ids, &pdev->dev); 875 of_match_device(mxsfb_dt_ids, &pdev->dev);
781 struct mxsfb_platform_data *pdata = pdev->dev.platform_data;
782 struct resource *res; 876 struct resource *res;
783 struct mxsfb_info *host; 877 struct mxsfb_info *host;
784 struct fb_info *fb_info; 878 struct fb_info *fb_info;
785 struct fb_modelist *modelist; 879 struct fb_modelist *modelist;
786 struct pinctrl *pinctrl; 880 struct pinctrl *pinctrl;
787 int panel_enable; 881 int ret;
788 enum of_gpio_flags flags;
789 int i, ret;
790 882
791 if (of_id) 883 if (of_id)
792 pdev->id_entry = of_id->data; 884 pdev->id_entry = of_id->data;
793 885
794 if (!pdata) {
795 dev_err(&pdev->dev, "No platformdata. Giving up\n");
796 return -ENODEV;
797 }
798
799 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 886 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
800 if (!res) { 887 if (!res) {
801 dev_err(&pdev->dev, "Cannot get memory IO resource\n"); 888 dev_err(&pdev->dev, "Cannot get memory IO resource\n");
802 return -ENODEV; 889 return -ENODEV;
803 } 890 }
804 891
805 if (!request_mem_region(res->start, resource_size(res), pdev->name))
806 return -EBUSY;
807
808 fb_info = framebuffer_alloc(sizeof(struct mxsfb_info), &pdev->dev); 892 fb_info = framebuffer_alloc(sizeof(struct mxsfb_info), &pdev->dev);
809 if (!fb_info) { 893 if (!fb_info) {
810 dev_err(&pdev->dev, "Failed to allocate fbdev\n"); 894 dev_err(&pdev->dev, "Failed to allocate fbdev\n");
811 ret = -ENOMEM; 895 return -ENOMEM;
812 goto error_alloc_info;
813 } 896 }
814 897
815 host = to_imxfb_host(fb_info); 898 host = to_imxfb_host(fb_info);
816 899
817 host->base = ioremap(res->start, resource_size(res)); 900 host->base = devm_ioremap_resource(&pdev->dev, res);
818 if (!host->base) { 901 if (IS_ERR(host->base)) {
819 dev_err(&pdev->dev, "ioremap failed\n"); 902 dev_err(&pdev->dev, "ioremap failed\n");
820 ret = -ENOMEM; 903 ret = PTR_ERR(host->base);
821 goto error_ioremap; 904 goto fb_release;
822 } 905 }
823 906
824 host->pdev = pdev; 907 host->pdev = pdev;
@@ -829,47 +912,31 @@ static int mxsfb_probe(struct platform_device *pdev)
829 pinctrl = devm_pinctrl_get_select_default(&pdev->dev); 912 pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
830 if (IS_ERR(pinctrl)) { 913 if (IS_ERR(pinctrl)) {
831 ret = PTR_ERR(pinctrl); 914 ret = PTR_ERR(pinctrl);
832 goto error_getpin; 915 goto fb_release;
833 } 916 }
834 917
835 host->clk = clk_get(&host->pdev->dev, NULL); 918 host->clk = devm_clk_get(&host->pdev->dev, NULL);
836 if (IS_ERR(host->clk)) { 919 if (IS_ERR(host->clk)) {
837 ret = PTR_ERR(host->clk); 920 ret = PTR_ERR(host->clk);
838 goto error_getclock; 921 goto fb_release;
839 } 922 }
840 923
841 panel_enable = of_get_named_gpio_flags(pdev->dev.of_node, 924 host->reg_lcd = devm_regulator_get(&pdev->dev, "lcd");
842 "panel-enable-gpios", 0, &flags); 925 if (IS_ERR(host->reg_lcd))
843 if (gpio_is_valid(panel_enable)) { 926 host->reg_lcd = NULL;
844 unsigned long f = GPIOF_OUT_INIT_HIGH;
845 if (flags == OF_GPIO_ACTIVE_LOW)
846 f = GPIOF_OUT_INIT_LOW;
847 ret = devm_gpio_request_one(&pdev->dev, panel_enable,
848 f, "panel-enable");
849 if (ret) {
850 dev_err(&pdev->dev,
851 "failed to request gpio %d: %d\n",
852 panel_enable, ret);
853 goto error_panel_enable;
854 }
855 }
856 927
857 fb_info->pseudo_palette = kmalloc(sizeof(u32) * 16, GFP_KERNEL); 928 fb_info->pseudo_palette = devm_kzalloc(&pdev->dev, sizeof(u32) * 16,
929 GFP_KERNEL);
858 if (!fb_info->pseudo_palette) { 930 if (!fb_info->pseudo_palette) {
859 ret = -ENOMEM; 931 ret = -ENOMEM;
860 goto error_pseudo_pallette; 932 goto fb_release;
861 } 933 }
862 934
863 INIT_LIST_HEAD(&fb_info->modelist); 935 INIT_LIST_HEAD(&fb_info->modelist);
864 936
865 host->sync = pdata->sync;
866
867 ret = mxsfb_init_fbinfo(host); 937 ret = mxsfb_init_fbinfo(host);
868 if (ret != 0) 938 if (ret != 0)
869 goto error_init_fb; 939 goto fb_release;
870
871 for (i = 0; i < pdata->mode_count; i++)
872 fb_add_videomode(&pdata->mode_list[i], &fb_info->modelist);
873 940
874 modelist = list_first_entry(&fb_info->modelist, 941 modelist = list_first_entry(&fb_info->modelist,
875 struct fb_modelist, list); 942 struct fb_modelist, list);
@@ -883,7 +950,7 @@ static int mxsfb_probe(struct platform_device *pdev)
883 ret = register_framebuffer(fb_info); 950 ret = register_framebuffer(fb_info);
884 if (ret != 0) { 951 if (ret != 0) {
885 dev_err(&pdev->dev,"Failed to register framebuffer\n"); 952 dev_err(&pdev->dev,"Failed to register framebuffer\n");
886 goto error_register; 953 goto fb_destroy;
887 } 954 }
888 955
889 if (!host->enabled) { 956 if (!host->enabled) {
@@ -896,22 +963,12 @@ static int mxsfb_probe(struct platform_device *pdev)
896 963
897 return 0; 964 return 0;
898 965
899error_register: 966fb_destroy:
900 if (host->enabled) 967 if (host->enabled)
901 clk_disable_unprepare(host->clk); 968 clk_disable_unprepare(host->clk);
902 fb_destroy_modelist(&fb_info->modelist); 969 fb_destroy_modelist(&fb_info->modelist);
903error_init_fb: 970fb_release:
904 kfree(fb_info->pseudo_palette);
905error_pseudo_pallette:
906error_panel_enable:
907 clk_put(host->clk);
908error_getclock:
909error_getpin:
910 iounmap(host->base);
911error_ioremap:
912 framebuffer_release(fb_info); 971 framebuffer_release(fb_info);
913error_alloc_info:
914 release_mem_region(res->start, resource_size(res));
915 972
916 return ret; 973 return ret;
917} 974}
@@ -920,19 +977,14 @@ static int mxsfb_remove(struct platform_device *pdev)
920{ 977{
921 struct fb_info *fb_info = platform_get_drvdata(pdev); 978 struct fb_info *fb_info = platform_get_drvdata(pdev);
922 struct mxsfb_info *host = to_imxfb_host(fb_info); 979 struct mxsfb_info *host = to_imxfb_host(fb_info);
923 struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
924 980
925 if (host->enabled) 981 if (host->enabled)
926 mxsfb_disable_controller(fb_info); 982 mxsfb_disable_controller(fb_info);
927 983
928 unregister_framebuffer(fb_info); 984 unregister_framebuffer(fb_info);
929 kfree(fb_info->pseudo_palette);
930 mxsfb_free_videomem(host); 985 mxsfb_free_videomem(host);
931 iounmap(host->base);
932 clk_put(host->clk);
933 986
934 framebuffer_release(fb_info); 987 framebuffer_release(fb_info);
935 release_mem_region(res->start, resource_size(res));
936 988
937 platform_set_drvdata(pdev, NULL); 989 platform_set_drvdata(pdev, NULL);
938 990
diff --git a/include/linux/mxsfb.h b/include/linux/mxsfb.h
deleted file mode 100644
index f80af8674342..000000000000
--- a/include/linux/mxsfb.h
+++ /dev/null
@@ -1,52 +0,0 @@
1/*
2 * This program is free software; you can redistribute it and/or
3 * modify it under the terms of the GNU General Public License
4 * as published by the Free Software Foundation; either version 2
5 * of the License, or (at your option) any later version.
6 * This program is distributed in the hope that it will be useful,
7 * but WITHOUT ANY WARRANTY; without even the implied warranty of
8 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 * GNU General Public License for more details.
10 *
11 * You should have received a copy of the GNU General Public License
12 * along with this program; if not, write to the Free Software
13 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
14 * MA 02110-1301, USA.
15 */
16
17#ifndef __LINUX_MXSFB_H
18#define __LINUX_MXSFB_H
19
20#include <linux/fb.h>
21
22#define STMLCDIF_8BIT 1 /** pixel data bus to the display is of 8 bit width */
23#define STMLCDIF_16BIT 0 /** pixel data bus to the display is of 16 bit width */
24#define STMLCDIF_18BIT 2 /** pixel data bus to the display is of 18 bit width */
25#define STMLCDIF_24BIT 3 /** pixel data bus to the display is of 24 bit width */
26
27#define MXSFB_SYNC_DATA_ENABLE_HIGH_ACT (1 << 6)
28#define MXSFB_SYNC_DOTCLK_FAILING_ACT (1 << 7) /* failing/negtive edge sampling */
29
30struct mxsfb_platform_data {
31 struct fb_videomode *mode_list;
32 unsigned mode_count;
33
34 unsigned default_bpp;
35
36 unsigned dotclk_delay; /* refer manual HW_LCDIF_VDCTRL4 register */
37 unsigned ld_intf_width; /* refer STMLCDIF_* macros */
38
39 unsigned fb_size; /* Size of the video memory. If zero a
40 * default will be used
41 */
42 unsigned long fb_phys; /* physical address for the video memory. If
43 * zero the framebuffer memory will be dynamically
44 * allocated. If specified,fb_size must also be specified.
45 * fb_phys must be unused by Linux.
46 */
47 u32 sync; /* sync mask, contains MXSFB specifics not
48 * carried in fb_info->var.sync
49 */
50};
51
52#endif /* __LINUX_MXSFB_H */
diff --git a/include/linux/spi/mxs-spi.h b/include/linux/spi/mxs-spi.h
index 61ae1306db23..4835486f58e5 100644
--- a/include/linux/spi/mxs-spi.h
+++ b/include/linux/spi/mxs-spi.h
@@ -24,7 +24,7 @@
24#ifndef __LINUX_SPI_MXS_SPI_H__ 24#ifndef __LINUX_SPI_MXS_SPI_H__
25#define __LINUX_SPI_MXS_SPI_H__ 25#define __LINUX_SPI_MXS_SPI_H__
26 26
27#include <linux/fsl/mxs-dma.h> 27#include <linux/dmaengine.h>
28 28
29#define ssp_is_old(host) ((host)->devid == IMX23_SSP) 29#define ssp_is_old(host) ((host)->devid == IMX23_SSP)
30 30
@@ -137,9 +137,7 @@ struct mxs_ssp {
137 unsigned int clk_rate; 137 unsigned int clk_rate;
138 enum mxs_ssp_id devid; 138 enum mxs_ssp_id devid;
139 139
140 int dma_channel;
141 struct dma_chan *dmach; 140 struct dma_chan *dmach;
142 struct mxs_dma_data dma_data;
143 unsigned int dma_dir; 141 unsigned int dma_dir;
144 enum dma_transfer_direction slave_dirn; 142 enum dma_transfer_direction slave_dirn;
145 u32 ssp_pio_words[SSP_PIO_NUM]; 143 u32 ssp_pio_words[SSP_PIO_NUM];