diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/char/hw_random/Kconfig | 12 | ||||
-rw-r--r-- | drivers/char/hw_random/Makefile | 1 | ||||
-rw-r--r-- | drivers/char/hw_random/mxc-rnga.c | 247 | ||||
-rw-r--r-- | drivers/media/video/Kconfig | 4 | ||||
-rw-r--r-- | drivers/mmc/host/Kconfig | 2 | ||||
-rw-r--r-- | drivers/rtc/rtc-ep93xx.c | 149 | ||||
-rw-r--r-- | drivers/serial/imx.c | 13 | ||||
-rw-r--r-- | drivers/spi/Kconfig | 2 | ||||
-rw-r--r-- | drivers/video/Kconfig | 2 | ||||
-rw-r--r-- | drivers/video/mx3fb.c | 4 |
10 files changed, 384 insertions, 52 deletions
diff --git a/drivers/char/hw_random/Kconfig b/drivers/char/hw_random/Kconfig index 5fab6470f4b2..26c93c75e62d 100644 --- a/drivers/char/hw_random/Kconfig +++ b/drivers/char/hw_random/Kconfig | |||
@@ -148,3 +148,15 @@ config HW_RANDOM_VIRTIO | |||
148 | 148 | ||
149 | To compile this driver as a module, choose M here: the | 149 | To compile this driver as a module, choose M here: the |
150 | module will be called virtio-rng. If unsure, say N. | 150 | module will be called virtio-rng. If unsure, say N. |
151 | |||
152 | config HW_RANDOM_MXC_RNGA | ||
153 | tristate "Freescale i.MX RNGA Random Number Generator" | ||
154 | depends on HW_RANDOM && ARCH_HAS_RNGA | ||
155 | ---help--- | ||
156 | This driver provides kernel-side support for the Random Number | ||
157 | Generator hardware found on Freescale i.MX processors. | ||
158 | |||
159 | To compile this driver as a module, choose M here: the | ||
160 | module will be called mxc-rnga. | ||
161 | |||
162 | If unsure, say Y. | ||
diff --git a/drivers/char/hw_random/Makefile b/drivers/char/hw_random/Makefile index e81d21a5f28f..fd1ecd2f6731 100644 --- a/drivers/char/hw_random/Makefile +++ b/drivers/char/hw_random/Makefile | |||
@@ -15,3 +15,4 @@ obj-$(CONFIG_HW_RANDOM_IXP4XX) += ixp4xx-rng.o | |||
15 | obj-$(CONFIG_HW_RANDOM_OMAP) += omap-rng.o | 15 | obj-$(CONFIG_HW_RANDOM_OMAP) += omap-rng.o |
16 | obj-$(CONFIG_HW_RANDOM_PASEMI) += pasemi-rng.o | 16 | obj-$(CONFIG_HW_RANDOM_PASEMI) += pasemi-rng.o |
17 | obj-$(CONFIG_HW_RANDOM_VIRTIO) += virtio-rng.o | 17 | obj-$(CONFIG_HW_RANDOM_VIRTIO) += virtio-rng.o |
18 | obj-$(CONFIG_HW_RANDOM_MXC_RNGA) += mxc-rnga.o | ||
diff --git a/drivers/char/hw_random/mxc-rnga.c b/drivers/char/hw_random/mxc-rnga.c new file mode 100644 index 000000000000..187c6be80f43 --- /dev/null +++ b/drivers/char/hw_random/mxc-rnga.c | |||
@@ -0,0 +1,247 @@ | |||
1 | /* | ||
2 | * RNG driver for Freescale RNGA | ||
3 | * | ||
4 | * Copyright 2008-2009 Freescale Semiconductor, Inc. All Rights Reserved. | ||
5 | * Author: Alan Carvalho de Assis <acassis@gmail.com> | ||
6 | */ | ||
7 | |||
8 | /* | ||
9 | * The code contained herein is licensed under the GNU General Public | ||
10 | * License. You may obtain a copy of the GNU General Public License | ||
11 | * Version 2 or later at the following locations: | ||
12 | * | ||
13 | * http://www.opensource.org/licenses/gpl-license.html | ||
14 | * http://www.gnu.org/copyleft/gpl.html | ||
15 | * | ||
16 | * This driver is based on other RNG drivers. | ||
17 | */ | ||
18 | |||
19 | #include <linux/module.h> | ||
20 | #include <linux/init.h> | ||
21 | #include <linux/kernel.h> | ||
22 | #include <linux/clk.h> | ||
23 | #include <linux/err.h> | ||
24 | #include <linux/ioport.h> | ||
25 | #include <linux/platform_device.h> | ||
26 | #include <linux/hw_random.h> | ||
27 | #include <linux/io.h> | ||
28 | |||
29 | /* RNGA Registers */ | ||
30 | #define RNGA_CONTROL 0x00 | ||
31 | #define RNGA_STATUS 0x04 | ||
32 | #define RNGA_ENTROPY 0x08 | ||
33 | #define RNGA_OUTPUT_FIFO 0x0c | ||
34 | #define RNGA_MODE 0x10 | ||
35 | #define RNGA_VERIFICATION_CONTROL 0x14 | ||
36 | #define RNGA_OSC_CONTROL_COUNTER 0x18 | ||
37 | #define RNGA_OSC1_COUNTER 0x1c | ||
38 | #define RNGA_OSC2_COUNTER 0x20 | ||
39 | #define RNGA_OSC_COUNTER_STATUS 0x24 | ||
40 | |||
41 | /* RNGA Registers Range */ | ||
42 | #define RNG_ADDR_RANGE 0x28 | ||
43 | |||
44 | /* RNGA Control Register */ | ||
45 | #define RNGA_CONTROL_SLEEP 0x00000010 | ||
46 | #define RNGA_CONTROL_CLEAR_INT 0x00000008 | ||
47 | #define RNGA_CONTROL_MASK_INTS 0x00000004 | ||
48 | #define RNGA_CONTROL_HIGH_ASSURANCE 0x00000002 | ||
49 | #define RNGA_CONTROL_GO 0x00000001 | ||
50 | |||
51 | #define RNGA_STATUS_LEVEL_MASK 0x0000ff00 | ||
52 | |||
53 | /* RNGA Status Register */ | ||
54 | #define RNGA_STATUS_OSC_DEAD 0x80000000 | ||
55 | #define RNGA_STATUS_SLEEP 0x00000010 | ||
56 | #define RNGA_STATUS_ERROR_INT 0x00000008 | ||
57 | #define RNGA_STATUS_FIFO_UNDERFLOW 0x00000004 | ||
58 | #define RNGA_STATUS_LAST_READ_STATUS 0x00000002 | ||
59 | #define RNGA_STATUS_SECURITY_VIOLATION 0x00000001 | ||
60 | |||
61 | static struct platform_device *rng_dev; | ||
62 | |||
63 | static int mxc_rnga_data_present(struct hwrng *rng) | ||
64 | { | ||
65 | int level; | ||
66 | void __iomem *rng_base = (void __iomem *)rng->priv; | ||
67 | |||
68 | /* how many random numbers is in FIFO? [0-16] */ | ||
69 | level = ((__raw_readl(rng_base + RNGA_STATUS) & | ||
70 | RNGA_STATUS_LEVEL_MASK) >> 8); | ||
71 | |||
72 | return level > 0 ? 1 : 0; | ||
73 | } | ||
74 | |||
75 | static int mxc_rnga_data_read(struct hwrng *rng, u32 * data) | ||
76 | { | ||
77 | int err; | ||
78 | u32 ctrl; | ||
79 | void __iomem *rng_base = (void __iomem *)rng->priv; | ||
80 | |||
81 | /* retrieve a random number from FIFO */ | ||
82 | *data = __raw_readl(rng_base + RNGA_OUTPUT_FIFO); | ||
83 | |||
84 | /* some error while reading this random number? */ | ||
85 | err = __raw_readl(rng_base + RNGA_STATUS) & RNGA_STATUS_ERROR_INT; | ||
86 | |||
87 | /* if error: clear error interrupt, but doesn't return random number */ | ||
88 | if (err) { | ||
89 | dev_dbg(&rng_dev->dev, "Error while reading random number!\n"); | ||
90 | ctrl = __raw_readl(rng_base + RNGA_CONTROL); | ||
91 | __raw_writel(ctrl | RNGA_CONTROL_CLEAR_INT, | ||
92 | rng_base + RNGA_CONTROL); | ||
93 | return 0; | ||
94 | } else | ||
95 | return 4; | ||
96 | } | ||
97 | |||
98 | static int mxc_rnga_init(struct hwrng *rng) | ||
99 | { | ||
100 | u32 ctrl, osc; | ||
101 | void __iomem *rng_base = (void __iomem *)rng->priv; | ||
102 | |||
103 | /* wake up */ | ||
104 | ctrl = __raw_readl(rng_base + RNGA_CONTROL); | ||
105 | __raw_writel(ctrl & ~RNGA_CONTROL_SLEEP, rng_base + RNGA_CONTROL); | ||
106 | |||
107 | /* verify if oscillator is working */ | ||
108 | osc = __raw_readl(rng_base + RNGA_STATUS); | ||
109 | if (osc & RNGA_STATUS_OSC_DEAD) { | ||
110 | dev_err(&rng_dev->dev, "RNGA Oscillator is dead!\n"); | ||
111 | return -ENODEV; | ||
112 | } | ||
113 | |||
114 | /* go running */ | ||
115 | ctrl = __raw_readl(rng_base + RNGA_CONTROL); | ||
116 | __raw_writel(ctrl | RNGA_CONTROL_GO, rng_base + RNGA_CONTROL); | ||
117 | |||
118 | return 0; | ||
119 | } | ||
120 | |||
121 | static void mxc_rnga_cleanup(struct hwrng *rng) | ||
122 | { | ||
123 | u32 ctrl; | ||
124 | void __iomem *rng_base = (void __iomem *)rng->priv; | ||
125 | |||
126 | ctrl = __raw_readl(rng_base + RNGA_CONTROL); | ||
127 | |||
128 | /* stop rnga */ | ||
129 | __raw_writel(ctrl & ~RNGA_CONTROL_GO, rng_base + RNGA_CONTROL); | ||
130 | } | ||
131 | |||
132 | static struct hwrng mxc_rnga = { | ||
133 | .name = "mxc-rnga", | ||
134 | .init = mxc_rnga_init, | ||
135 | .cleanup = mxc_rnga_cleanup, | ||
136 | .data_present = mxc_rnga_data_present, | ||
137 | .data_read = mxc_rnga_data_read | ||
138 | }; | ||
139 | |||
140 | static int __init mxc_rnga_probe(struct platform_device *pdev) | ||
141 | { | ||
142 | int err = -ENODEV; | ||
143 | struct clk *clk; | ||
144 | struct resource *res, *mem; | ||
145 | void __iomem *rng_base = NULL; | ||
146 | |||
147 | if (rng_dev) | ||
148 | return -EBUSY; | ||
149 | |||
150 | clk = clk_get(&pdev->dev, "rng"); | ||
151 | if (IS_ERR(clk)) { | ||
152 | dev_err(&pdev->dev, "Could not get rng_clk!\n"); | ||
153 | err = PTR_ERR(clk); | ||
154 | goto out; | ||
155 | } | ||
156 | |||
157 | clk_enable(clk); | ||
158 | |||
159 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||
160 | if (!res) { | ||
161 | err = -ENOENT; | ||
162 | goto err_region; | ||
163 | } | ||
164 | |||
165 | mem = request_mem_region(res->start, resource_size(res), pdev->name); | ||
166 | if (mem == NULL) { | ||
167 | err = -EBUSY; | ||
168 | goto err_region; | ||
169 | } | ||
170 | |||
171 | rng_base = ioremap(res->start, resource_size(res)); | ||
172 | if (!rng_base) { | ||
173 | err = -ENOMEM; | ||
174 | goto err_ioremap; | ||
175 | } | ||
176 | |||
177 | mxc_rnga.priv = (unsigned long)rng_base; | ||
178 | |||
179 | err = hwrng_register(&mxc_rnga); | ||
180 | if (err) { | ||
181 | dev_err(&pdev->dev, "MXC RNGA registering failed (%d)\n", err); | ||
182 | goto err_register; | ||
183 | } | ||
184 | |||
185 | rng_dev = pdev; | ||
186 | |||
187 | dev_info(&pdev->dev, "MXC RNGA Registered.\n"); | ||
188 | |||
189 | return 0; | ||
190 | |||
191 | err_register: | ||
192 | iounmap(rng_base); | ||
193 | rng_base = NULL; | ||
194 | |||
195 | err_ioremap: | ||
196 | release_mem_region(res->start, resource_size(res)); | ||
197 | |||
198 | err_region: | ||
199 | clk_disable(clk); | ||
200 | clk_put(clk); | ||
201 | |||
202 | out: | ||
203 | return err; | ||
204 | } | ||
205 | |||
206 | static int __exit mxc_rnga_remove(struct platform_device *pdev) | ||
207 | { | ||
208 | struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||
209 | void __iomem *rng_base = (void __iomem *)mxc_rnga.priv; | ||
210 | struct clk *clk = clk_get(&pdev->dev, "rng"); | ||
211 | |||
212 | hwrng_unregister(&mxc_rnga); | ||
213 | |||
214 | iounmap(rng_base); | ||
215 | |||
216 | release_mem_region(res->start, resource_size(res)); | ||
217 | |||
218 | clk_disable(clk); | ||
219 | clk_put(clk); | ||
220 | |||
221 | return 0; | ||
222 | } | ||
223 | |||
224 | static struct platform_driver mxc_rnga_driver = { | ||
225 | .driver = { | ||
226 | .name = "mxc_rnga", | ||
227 | .owner = THIS_MODULE, | ||
228 | }, | ||
229 | .remove = __exit_p(mxc_rnga_remove), | ||
230 | }; | ||
231 | |||
232 | static int __init mod_init(void) | ||
233 | { | ||
234 | return platform_driver_probe(&mxc_rnga_driver, mxc_rnga_probe); | ||
235 | } | ||
236 | |||
237 | static void __exit mod_exit(void) | ||
238 | { | ||
239 | platform_driver_unregister(&mxc_rnga_driver); | ||
240 | } | ||
241 | |||
242 | module_init(mod_init); | ||
243 | module_exit(mod_exit); | ||
244 | |||
245 | MODULE_AUTHOR("Freescale Semiconductor, Inc."); | ||
246 | MODULE_DESCRIPTION("H/W RNGA driver for i.MX"); | ||
247 | MODULE_LICENSE("GPL"); | ||
diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig index 9d48da2fb013..57835f5715fc 100644 --- a/drivers/media/video/Kconfig +++ b/drivers/media/video/Kconfig | |||
@@ -758,10 +758,14 @@ config VIDEO_MX1 | |||
758 | ---help--- | 758 | ---help--- |
759 | This is a v4l2 driver for the i.MX1/i.MXL CMOS Sensor Interface | 759 | This is a v4l2 driver for the i.MX1/i.MXL CMOS Sensor Interface |
760 | 760 | ||
761 | config MX3_VIDEO | ||
762 | bool | ||
763 | |||
761 | config VIDEO_MX3 | 764 | config VIDEO_MX3 |
762 | tristate "i.MX3x Camera Sensor Interface driver" | 765 | tristate "i.MX3x Camera Sensor Interface driver" |
763 | depends on VIDEO_DEV && MX3_IPU && SOC_CAMERA | 766 | depends on VIDEO_DEV && MX3_IPU && SOC_CAMERA |
764 | select VIDEOBUF_DMA_CONTIG | 767 | select VIDEOBUF_DMA_CONTIG |
768 | select MX3_VIDEO | ||
765 | ---help--- | 769 | ---help--- |
766 | This is a v4l2 driver for the i.MX3x Camera Sensor Interface | 770 | This is a v4l2 driver for the i.MX3x Camera Sensor Interface |
767 | 771 | ||
diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig index b4cf691f3f64..3eb87bda14f3 100644 --- a/drivers/mmc/host/Kconfig +++ b/drivers/mmc/host/Kconfig | |||
@@ -155,7 +155,7 @@ config MMC_ATMELMCI_DMA | |||
155 | 155 | ||
156 | config MMC_IMX | 156 | config MMC_IMX |
157 | tristate "Motorola i.MX Multimedia Card Interface support" | 157 | tristate "Motorola i.MX Multimedia Card Interface support" |
158 | depends on ARCH_IMX | 158 | depends on ARCH_MX1 |
159 | help | 159 | help |
160 | This selects the Motorola i.MX Multimedia card Interface. | 160 | This selects the Motorola i.MX Multimedia card Interface. |
161 | If you have a i.MX platform with a Multimedia Card slot, | 161 | If you have a i.MX platform with a Multimedia Card slot, |
diff --git a/drivers/rtc/rtc-ep93xx.c b/drivers/rtc/rtc-ep93xx.c index f7a3283dd029..551332e4ed02 100644 --- a/drivers/rtc/rtc-ep93xx.c +++ b/drivers/rtc/rtc-ep93xx.c | |||
@@ -12,32 +12,56 @@ | |||
12 | #include <linux/module.h> | 12 | #include <linux/module.h> |
13 | #include <linux/rtc.h> | 13 | #include <linux/rtc.h> |
14 | #include <linux/platform_device.h> | 14 | #include <linux/platform_device.h> |
15 | #include <mach/hardware.h> | 15 | #include <linux/io.h> |
16 | |||
17 | #define EP93XX_RTC_DATA 0x000 | ||
18 | #define EP93XX_RTC_MATCH 0x004 | ||
19 | #define EP93XX_RTC_STATUS 0x008 | ||
20 | #define EP93XX_RTC_STATUS_INTR (1<<0) | ||
21 | #define EP93XX_RTC_LOAD 0x00C | ||
22 | #define EP93XX_RTC_CONTROL 0x010 | ||
23 | #define EP93XX_RTC_CONTROL_MIE (1<<0) | ||
24 | #define EP93XX_RTC_SWCOMP 0x108 | ||
25 | #define EP93XX_RTC_SWCOMP_DEL_MASK 0x001f0000 | ||
26 | #define EP93XX_RTC_SWCOMP_DEL_SHIFT 16 | ||
27 | #define EP93XX_RTC_SWCOMP_INT_MASK 0x0000ffff | ||
28 | #define EP93XX_RTC_SWCOMP_INT_SHIFT 0 | ||
29 | |||
30 | #define DRV_VERSION "0.3" | ||
16 | 31 | ||
17 | #define EP93XX_RTC_REG(x) (EP93XX_RTC_BASE + (x)) | 32 | /* |
18 | #define EP93XX_RTC_DATA EP93XX_RTC_REG(0x0000) | 33 | * struct device dev.platform_data is used to store our private data |
19 | #define EP93XX_RTC_LOAD EP93XX_RTC_REG(0x000C) | 34 | * because struct rtc_device does not have a variable to hold it. |
20 | #define EP93XX_RTC_SWCOMP EP93XX_RTC_REG(0x0108) | 35 | */ |
21 | 36 | struct ep93xx_rtc { | |
22 | #define DRV_VERSION "0.2" | 37 | void __iomem *mmio_base; |
38 | }; | ||
23 | 39 | ||
24 | static int ep93xx_get_swcomp(struct device *dev, unsigned short *preload, | 40 | static int ep93xx_rtc_get_swcomp(struct device *dev, unsigned short *preload, |
25 | unsigned short *delete) | 41 | unsigned short *delete) |
26 | { | 42 | { |
27 | unsigned short comp = __raw_readl(EP93XX_RTC_SWCOMP); | 43 | struct ep93xx_rtc *ep93xx_rtc = dev->platform_data; |
44 | unsigned long comp; | ||
45 | |||
46 | comp = __raw_readl(ep93xx_rtc->mmio_base + EP93XX_RTC_SWCOMP); | ||
28 | 47 | ||
29 | if (preload) | 48 | if (preload) |
30 | *preload = comp & 0xffff; | 49 | *preload = (comp & EP93XX_RTC_SWCOMP_INT_MASK) |
50 | >> EP93XX_RTC_SWCOMP_INT_SHIFT; | ||
31 | 51 | ||
32 | if (delete) | 52 | if (delete) |
33 | *delete = (comp >> 16) & 0x1f; | 53 | *delete = (comp & EP93XX_RTC_SWCOMP_DEL_MASK) |
54 | >> EP93XX_RTC_SWCOMP_DEL_SHIFT; | ||
34 | 55 | ||
35 | return 0; | 56 | return 0; |
36 | } | 57 | } |
37 | 58 | ||
38 | static int ep93xx_rtc_read_time(struct device *dev, struct rtc_time *tm) | 59 | static int ep93xx_rtc_read_time(struct device *dev, struct rtc_time *tm) |
39 | { | 60 | { |
40 | unsigned long time = __raw_readl(EP93XX_RTC_DATA); | 61 | struct ep93xx_rtc *ep93xx_rtc = dev->platform_data; |
62 | unsigned long time; | ||
63 | |||
64 | time = __raw_readl(ep93xx_rtc->mmio_base + EP93XX_RTC_DATA); | ||
41 | 65 | ||
42 | rtc_time_to_tm(time, tm); | 66 | rtc_time_to_tm(time, tm); |
43 | return 0; | 67 | return 0; |
@@ -45,7 +69,9 @@ static int ep93xx_rtc_read_time(struct device *dev, struct rtc_time *tm) | |||
45 | 69 | ||
46 | static int ep93xx_rtc_set_mmss(struct device *dev, unsigned long secs) | 70 | static int ep93xx_rtc_set_mmss(struct device *dev, unsigned long secs) |
47 | { | 71 | { |
48 | __raw_writel(secs + 1, EP93XX_RTC_LOAD); | 72 | struct ep93xx_rtc *ep93xx_rtc = dev->platform_data; |
73 | |||
74 | __raw_writel(secs + 1, ep93xx_rtc->mmio_base + EP93XX_RTC_LOAD); | ||
49 | return 0; | 75 | return 0; |
50 | } | 76 | } |
51 | 77 | ||
@@ -53,7 +79,7 @@ static int ep93xx_rtc_proc(struct device *dev, struct seq_file *seq) | |||
53 | { | 79 | { |
54 | unsigned short preload, delete; | 80 | unsigned short preload, delete; |
55 | 81 | ||
56 | ep93xx_get_swcomp(dev, &preload, &delete); | 82 | ep93xx_rtc_get_swcomp(dev, &preload, &delete); |
57 | 83 | ||
58 | seq_printf(seq, "preload\t\t: %d\n", preload); | 84 | seq_printf(seq, "preload\t\t: %d\n", preload); |
59 | seq_printf(seq, "delete\t\t: %d\n", delete); | 85 | seq_printf(seq, "delete\t\t: %d\n", delete); |
@@ -67,54 +93,104 @@ static const struct rtc_class_ops ep93xx_rtc_ops = { | |||
67 | .proc = ep93xx_rtc_proc, | 93 | .proc = ep93xx_rtc_proc, |
68 | }; | 94 | }; |
69 | 95 | ||
70 | static ssize_t ep93xx_sysfs_show_comp_preload(struct device *dev, | 96 | static ssize_t ep93xx_rtc_show_comp_preload(struct device *dev, |
71 | struct device_attribute *attr, char *buf) | 97 | struct device_attribute *attr, char *buf) |
72 | { | 98 | { |
73 | unsigned short preload; | 99 | unsigned short preload; |
74 | 100 | ||
75 | ep93xx_get_swcomp(dev, &preload, NULL); | 101 | ep93xx_rtc_get_swcomp(dev, &preload, NULL); |
76 | 102 | ||
77 | return sprintf(buf, "%d\n", preload); | 103 | return sprintf(buf, "%d\n", preload); |
78 | } | 104 | } |
79 | static DEVICE_ATTR(comp_preload, S_IRUGO, ep93xx_sysfs_show_comp_preload, NULL); | 105 | static DEVICE_ATTR(comp_preload, S_IRUGO, ep93xx_rtc_show_comp_preload, NULL); |
80 | 106 | ||
81 | static ssize_t ep93xx_sysfs_show_comp_delete(struct device *dev, | 107 | static ssize_t ep93xx_rtc_show_comp_delete(struct device *dev, |
82 | struct device_attribute *attr, char *buf) | 108 | struct device_attribute *attr, char *buf) |
83 | { | 109 | { |
84 | unsigned short delete; | 110 | unsigned short delete; |
85 | 111 | ||
86 | ep93xx_get_swcomp(dev, NULL, &delete); | 112 | ep93xx_rtc_get_swcomp(dev, NULL, &delete); |
87 | 113 | ||
88 | return sprintf(buf, "%d\n", delete); | 114 | return sprintf(buf, "%d\n", delete); |
89 | } | 115 | } |
90 | static DEVICE_ATTR(comp_delete, S_IRUGO, ep93xx_sysfs_show_comp_delete, NULL); | 116 | static DEVICE_ATTR(comp_delete, S_IRUGO, ep93xx_rtc_show_comp_delete, NULL); |
91 | 117 | ||
92 | 118 | ||
93 | static int __devinit ep93xx_rtc_probe(struct platform_device *dev) | 119 | static int __init ep93xx_rtc_probe(struct platform_device *pdev) |
94 | { | 120 | { |
95 | struct rtc_device *rtc = rtc_device_register("ep93xx", | 121 | struct ep93xx_rtc *ep93xx_rtc; |
96 | &dev->dev, &ep93xx_rtc_ops, THIS_MODULE); | 122 | struct resource *res; |
123 | struct rtc_device *rtc; | ||
124 | int err; | ||
125 | |||
126 | ep93xx_rtc = kzalloc(sizeof(struct ep93xx_rtc), GFP_KERNEL); | ||
127 | if (ep93xx_rtc == NULL) | ||
128 | return -ENOMEM; | ||
129 | |||
130 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||
131 | if (res == NULL) | ||
132 | return -ENXIO; | ||
133 | |||
134 | res = request_mem_region(res->start, resource_size(res), pdev->name); | ||
135 | if (res == NULL) | ||
136 | return -EBUSY; | ||
137 | |||
138 | ep93xx_rtc->mmio_base = ioremap(res->start, resource_size(res)); | ||
139 | if (ep93xx_rtc->mmio_base == NULL) { | ||
140 | err = -ENXIO; | ||
141 | goto fail; | ||
142 | } | ||
97 | 143 | ||
144 | pdev->dev.platform_data = ep93xx_rtc; | ||
145 | |||
146 | rtc = rtc_device_register(pdev->name, | ||
147 | &pdev->dev, &ep93xx_rtc_ops, THIS_MODULE); | ||
98 | if (IS_ERR(rtc)) { | 148 | if (IS_ERR(rtc)) { |
99 | return PTR_ERR(rtc); | 149 | err = PTR_ERR(rtc); |
150 | goto fail; | ||
100 | } | 151 | } |
101 | 152 | ||
102 | platform_set_drvdata(dev, rtc); | 153 | platform_set_drvdata(pdev, rtc); |
103 | 154 | ||
104 | device_create_file(&dev->dev, &dev_attr_comp_preload); | 155 | err = device_create_file(&pdev->dev, &dev_attr_comp_preload); |
105 | device_create_file(&dev->dev, &dev_attr_comp_delete); | 156 | if (err) |
157 | goto fail; | ||
158 | err = device_create_file(&pdev->dev, &dev_attr_comp_delete); | ||
159 | if (err) { | ||
160 | device_remove_file(&pdev->dev, &dev_attr_comp_preload); | ||
161 | goto fail; | ||
162 | } | ||
106 | 163 | ||
107 | return 0; | 164 | return 0; |
165 | |||
166 | fail: | ||
167 | if (ep93xx_rtc->mmio_base) { | ||
168 | iounmap(ep93xx_rtc->mmio_base); | ||
169 | pdev->dev.platform_data = NULL; | ||
170 | } | ||
171 | release_mem_region(res->start, resource_size(res)); | ||
172 | return err; | ||
108 | } | 173 | } |
109 | 174 | ||
110 | static int __devexit ep93xx_rtc_remove(struct platform_device *dev) | 175 | static int __exit ep93xx_rtc_remove(struct platform_device *pdev) |
111 | { | 176 | { |
112 | struct rtc_device *rtc = platform_get_drvdata(dev); | 177 | struct rtc_device *rtc = platform_get_drvdata(pdev); |
178 | struct ep93xx_rtc *ep93xx_rtc = pdev->dev.platform_data; | ||
179 | struct resource *res; | ||
180 | |||
181 | /* cleanup sysfs */ | ||
182 | device_remove_file(&pdev->dev, &dev_attr_comp_delete); | ||
183 | device_remove_file(&pdev->dev, &dev_attr_comp_preload); | ||
184 | |||
185 | rtc_device_unregister(rtc); | ||
186 | |||
187 | iounmap(ep93xx_rtc->mmio_base); | ||
188 | pdev->dev.platform_data = NULL; | ||
113 | 189 | ||
114 | if (rtc) | 190 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
115 | rtc_device_unregister(rtc); | 191 | release_mem_region(res->start, resource_size(res)); |
116 | 192 | ||
117 | platform_set_drvdata(dev, NULL); | 193 | platform_set_drvdata(pdev, NULL); |
118 | 194 | ||
119 | return 0; | 195 | return 0; |
120 | } | 196 | } |
@@ -122,23 +198,22 @@ static int __devexit ep93xx_rtc_remove(struct platform_device *dev) | |||
122 | /* work with hotplug and coldplug */ | 198 | /* work with hotplug and coldplug */ |
123 | MODULE_ALIAS("platform:ep93xx-rtc"); | 199 | MODULE_ALIAS("platform:ep93xx-rtc"); |
124 | 200 | ||
125 | static struct platform_driver ep93xx_rtc_platform_driver = { | 201 | static struct platform_driver ep93xx_rtc_driver = { |
126 | .driver = { | 202 | .driver = { |
127 | .name = "ep93xx-rtc", | 203 | .name = "ep93xx-rtc", |
128 | .owner = THIS_MODULE, | 204 | .owner = THIS_MODULE, |
129 | }, | 205 | }, |
130 | .probe = ep93xx_rtc_probe, | 206 | .remove = __exit_p(ep93xx_rtc_remove), |
131 | .remove = __devexit_p(ep93xx_rtc_remove), | ||
132 | }; | 207 | }; |
133 | 208 | ||
134 | static int __init ep93xx_rtc_init(void) | 209 | static int __init ep93xx_rtc_init(void) |
135 | { | 210 | { |
136 | return platform_driver_register(&ep93xx_rtc_platform_driver); | 211 | return platform_driver_probe(&ep93xx_rtc_driver, ep93xx_rtc_probe); |
137 | } | 212 | } |
138 | 213 | ||
139 | static void __exit ep93xx_rtc_exit(void) | 214 | static void __exit ep93xx_rtc_exit(void) |
140 | { | 215 | { |
141 | platform_driver_unregister(&ep93xx_rtc_platform_driver); | 216 | platform_driver_unregister(&ep93xx_rtc_driver); |
142 | } | 217 | } |
143 | 218 | ||
144 | MODULE_AUTHOR("Alessandro Zummo <a.zummo@towertech.it>"); | 219 | MODULE_AUTHOR("Alessandro Zummo <a.zummo@towertech.it>"); |
diff --git a/drivers/serial/imx.c b/drivers/serial/imx.c index 9f460b175c50..3f5d5a200481 100644 --- a/drivers/serial/imx.c +++ b/drivers/serial/imx.c | |||
@@ -66,7 +66,7 @@ | |||
66 | #define ONEMS 0xb0 /* One Millisecond register */ | 66 | #define ONEMS 0xb0 /* One Millisecond register */ |
67 | #define UTS 0xb4 /* UART Test Register */ | 67 | #define UTS 0xb4 /* UART Test Register */ |
68 | #endif | 68 | #endif |
69 | #if defined(CONFIG_ARCH_IMX) || defined(CONFIG_ARCH_MX1) | 69 | #ifdef CONFIG_ARCH_MX1 |
70 | #define BIPR1 0xb0 /* Incremental Preset Register 1 */ | 70 | #define BIPR1 0xb0 /* Incremental Preset Register 1 */ |
71 | #define BIPR2 0xb4 /* Incremental Preset Register 2 */ | 71 | #define BIPR2 0xb4 /* Incremental Preset Register 2 */ |
72 | #define BIPR3 0xb8 /* Incremental Preset Register 3 */ | 72 | #define BIPR3 0xb8 /* Incremental Preset Register 3 */ |
@@ -96,7 +96,7 @@ | |||
96 | #define UCR1_RTSDEN (1<<5) /* RTS delta interrupt enable */ | 96 | #define UCR1_RTSDEN (1<<5) /* RTS delta interrupt enable */ |
97 | #define UCR1_SNDBRK (1<<4) /* Send break */ | 97 | #define UCR1_SNDBRK (1<<4) /* Send break */ |
98 | #define UCR1_TDMAEN (1<<3) /* Transmitter ready DMA enable */ | 98 | #define UCR1_TDMAEN (1<<3) /* Transmitter ready DMA enable */ |
99 | #if defined(CONFIG_ARCH_IMX) || defined(CONFIG_ARCH_MX1) | 99 | #ifdef CONFIG_ARCH_MX1 |
100 | #define UCR1_UARTCLKEN (1<<2) /* UART clock enabled */ | 100 | #define UCR1_UARTCLKEN (1<<2) /* UART clock enabled */ |
101 | #endif | 101 | #endif |
102 | #if defined CONFIG_ARCH_MX3 || defined CONFIG_ARCH_MX2 | 102 | #if defined CONFIG_ARCH_MX3 || defined CONFIG_ARCH_MX2 |
@@ -127,7 +127,7 @@ | |||
127 | #define UCR3_RXDSEN (1<<6) /* Receive status interrupt enable */ | 127 | #define UCR3_RXDSEN (1<<6) /* Receive status interrupt enable */ |
128 | #define UCR3_AIRINTEN (1<<5) /* Async IR wake interrupt enable */ | 128 | #define UCR3_AIRINTEN (1<<5) /* Async IR wake interrupt enable */ |
129 | #define UCR3_AWAKEN (1<<4) /* Async wake interrupt enable */ | 129 | #define UCR3_AWAKEN (1<<4) /* Async wake interrupt enable */ |
130 | #ifdef CONFIG_ARCH_IMX | 130 | #ifdef CONFIG_ARCH_MX1 |
131 | #define UCR3_REF25 (1<<3) /* Ref freq 25 MHz, only on mx1 */ | 131 | #define UCR3_REF25 (1<<3) /* Ref freq 25 MHz, only on mx1 */ |
132 | #define UCR3_REF30 (1<<2) /* Ref Freq 30 MHz, only on mx1 */ | 132 | #define UCR3_REF30 (1<<2) /* Ref Freq 30 MHz, only on mx1 */ |
133 | #endif | 133 | #endif |
@@ -180,13 +180,6 @@ | |||
180 | #define UTS_SOFTRST (1<<0) /* Software reset */ | 180 | #define UTS_SOFTRST (1<<0) /* Software reset */ |
181 | 181 | ||
182 | /* We've been assigned a range on the "Low-density serial ports" major */ | 182 | /* We've been assigned a range on the "Low-density serial ports" major */ |
183 | #ifdef CONFIG_ARCH_IMX | ||
184 | #define SERIAL_IMX_MAJOR 204 | ||
185 | #define MINOR_START 41 | ||
186 | #define DEV_NAME "ttySMX" | ||
187 | #define MAX_INTERNAL_IRQ IMX_IRQS | ||
188 | #endif | ||
189 | |||
190 | #ifdef CONFIG_ARCH_MXC | 183 | #ifdef CONFIG_ARCH_MXC |
191 | #define SERIAL_IMX_MAJOR 207 | 184 | #define SERIAL_IMX_MAJOR 207 |
192 | #define MINOR_START 16 | 185 | #define MINOR_START 16 |
diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig index 83a185d52961..7c61251bea61 100644 --- a/drivers/spi/Kconfig +++ b/drivers/spi/Kconfig | |||
@@ -118,7 +118,7 @@ config SPI_GPIO | |||
118 | 118 | ||
119 | config SPI_IMX | 119 | config SPI_IMX |
120 | tristate "Freescale iMX SPI controller" | 120 | tristate "Freescale iMX SPI controller" |
121 | depends on ARCH_IMX && EXPERIMENTAL | 121 | depends on ARCH_MX1 && EXPERIMENTAL |
122 | help | 122 | help |
123 | This enables using the Freescale iMX SPI controller in master | 123 | This enables using the Freescale iMX SPI controller in master |
124 | mode. | 124 | mode. |
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig index 0048f1185a60..8083d862ebc5 100644 --- a/drivers/video/Kconfig +++ b/drivers/video/Kconfig | |||
@@ -397,7 +397,7 @@ config FB_SA1100 | |||
397 | 397 | ||
398 | config FB_IMX | 398 | config FB_IMX |
399 | tristate "Motorola i.MX LCD support" | 399 | tristate "Motorola i.MX LCD support" |
400 | depends on FB && (ARCH_IMX || ARCH_MX2) | 400 | depends on FB && (ARCH_MX1 || ARCH_MX2) |
401 | select FB_CFB_FILLRECT | 401 | select FB_CFB_FILLRECT |
402 | select FB_CFB_COPYAREA | 402 | select FB_CFB_COPYAREA |
403 | select FB_CFB_IMAGEBLIT | 403 | select FB_CFB_IMAGEBLIT |
diff --git a/drivers/video/mx3fb.c b/drivers/video/mx3fb.c index 9894de1c9b9f..b7af5256e887 100644 --- a/drivers/video/mx3fb.c +++ b/drivers/video/mx3fb.c | |||
@@ -706,7 +706,7 @@ static void mx3fb_dma_done(void *arg) | |||
706 | dev_dbg(mx3fb->dev, "irq %d callback\n", ichannel->eof_irq); | 706 | dev_dbg(mx3fb->dev, "irq %d callback\n", ichannel->eof_irq); |
707 | 707 | ||
708 | /* We only need one interrupt, it will be re-enabled as needed */ | 708 | /* We only need one interrupt, it will be re-enabled as needed */ |
709 | disable_irq(ichannel->eof_irq); | 709 | disable_irq_nosync(ichannel->eof_irq); |
710 | 710 | ||
711 | complete(&mx3_fbi->flip_cmpl); | 711 | complete(&mx3_fbi->flip_cmpl); |
712 | } | 712 | } |
@@ -1366,7 +1366,7 @@ static int init_fb_chan(struct mx3fb_data *mx3fb, struct idmac_channel *ichan) | |||
1366 | 1366 | ||
1367 | mx3fb_blank(FB_BLANK_UNBLANK, fbi); | 1367 | mx3fb_blank(FB_BLANK_UNBLANK, fbi); |
1368 | 1368 | ||
1369 | dev_info(dev, "mx3fb: fb registered, using mode %s\n", fb_mode); | 1369 | dev_info(dev, "registered, using mode %s\n", fb_mode); |
1370 | 1370 | ||
1371 | ret = register_framebuffer(fbi); | 1371 | ret = register_framebuffer(fbi); |
1372 | if (ret < 0) | 1372 | if (ret < 0) |