aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/Kconfig1
-rw-r--r--arch/arm/boot/dts/kirkwood-dreamplug.dts25
-rw-r--r--arch/arm/boot/dts/kirkwood.dtsi6
-rw-r--r--arch/arm/boot/dts/tegra-paz00.dts26
-rw-r--r--arch/arm/configs/tegra_defconfig33
-rw-r--r--arch/arm/mach-exynos/Kconfig10
-rw-r--r--arch/arm/mach-exynos/mach-nuri.c80
-rw-r--r--arch/arm/mach-exynos/mach-origen.c37
-rw-r--r--arch/arm/mach-exynos/mach-smdkv310.c3
-rw-r--r--arch/arm/mach-exynos/mach-universal_c210.c80
-rw-r--r--arch/arm/mach-imx/Kconfig5
-rw-r--r--arch/arm/mach-imx/mach-imx27_visstrim_m10.c139
-rw-r--r--arch/arm/mach-imx/mach-mx31moboard.c4
-rw-r--r--arch/arm/mach-imx/mach-mx35_3ds.c216
-rw-r--r--arch/arm/mach-kirkwood/Kconfig14
-rw-r--r--arch/arm/mach-kirkwood/Makefile1
-rw-r--r--arch/arm/mach-kirkwood/Makefile.boot2
-rw-r--r--arch/arm/mach-kirkwood/board-dt.c180
-rw-r--r--arch/arm/mach-mmp/mmp2.c1
-rw-r--r--arch/arm/mach-mmp/pxa168.c1
-rw-r--r--arch/arm/mach-mmp/pxa910.c1
-rw-r--r--arch/arm/mach-mxs/Kconfig16
-rw-r--r--arch/arm/mach-mxs/Makefile1
-rw-r--r--arch/arm/mach-mxs/include/mach/digctl.h1
-rw-r--r--arch/arm/mach-mxs/include/mach/mxs.h29
-rw-r--r--arch/arm/mach-mxs/include/mach/uncompress.h13
-rw-r--r--arch/arm/mach-mxs/mach-apx4devkit.c260
-rw-r--r--arch/arm/mach-mxs/mach-m28evk.c7
-rw-r--r--arch/arm/mach-mxs/mach-mx28evk.c80
-rw-r--r--arch/arm/mach-omap1/Kconfig4
-rw-r--r--arch/arm/mach-omap1/board-ams-delta.c314
-rw-r--r--arch/arm/mach-omap2/Kconfig3
-rw-r--r--arch/arm/mach-omap2/Makefile3
-rw-r--r--arch/arm/mach-omap2/am35xx-emac.c117
-rw-r--r--arch/arm/mach-omap2/am35xx-emac.h15
-rw-r--r--arch/arm/mach-omap2/board-4430sdp.c5
-rw-r--r--arch/arm/mach-omap2/board-am3517evm.c117
-rw-r--r--arch/arm/mach-omap2/board-cm-t3517.c2
-rw-r--r--arch/arm/mach-omap2/board-omap3logic.c2
-rw-r--r--arch/arm/mach-omap2/board-omap3pandora.c11
-rw-r--r--arch/arm/mach-omap2/board-omap4panda.c6
-rw-r--r--arch/arm/mach-omap2/board-rm680.c14
-rw-r--r--arch/arm/mach-omap2/board-rx51-peripherals.c25
-rw-r--r--arch/arm/mach-pxa/hx4700.c44
-rw-r--r--arch/arm/mach-pxa/include/mach/mfp-pxa27x.h2
-rw-r--r--arch/arm/mach-s3c64xx/Kconfig1
-rw-r--r--arch/arm/mach-s3c64xx/mach-crag6410-module.c31
-rw-r--r--arch/arm/mach-s3c64xx/mach-crag6410.c67
-rw-r--r--arch/arm/mach-s5pv210/Kconfig9
-rw-r--r--arch/arm/mach-s5pv210/clock.c5
-rw-r--r--arch/arm/mach-s5pv210/include/mach/map.h4
-rw-r--r--arch/arm/mach-s5pv210/mach-aquila.c1
-rw-r--r--arch/arm/mach-s5pv210/mach-smdkc110.c14
-rw-r--r--arch/arm/mach-s5pv210/mach-smdkv210.c15
-rw-r--r--arch/arm/mach-tegra/board-dt-tegra20.c6
-rw-r--r--arch/arm/mach-tegra/board-dt-tegra30.c2
-rw-r--r--arch/arm/mach-tegra/board-harmony-power.c3
-rw-r--r--arch/arm/plat-omap/include/plat/board-ams-delta.h49
-rw-r--r--arch/arm/plat-omap/include/plat/uncompress.h1
-rw-r--r--drivers/input/serio/ams_delta_serio.c54
-rw-r--r--drivers/leds/Kconfig7
-rw-r--r--drivers/leds/Makefile1
-rw-r--r--drivers/leds/leds-ams-delta.c126
-rw-r--r--drivers/mtd/nand/ams-delta.c74
-rw-r--r--drivers/video/omap/lcd_ams_delta.c27
-rw-r--r--sound/soc/omap/ams-delta.c34
66 files changed, 1929 insertions, 558 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index dae718ab1d66..c941fd06b2af 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1583,6 +1583,7 @@ config ARCH_NR_GPIO
1583 int 1583 int
1584 default 1024 if ARCH_SHMOBILE || ARCH_TEGRA 1584 default 1024 if ARCH_SHMOBILE || ARCH_TEGRA
1585 default 355 if ARCH_U8500 1585 default 355 if ARCH_U8500
1586 default 264 if MACH_H4700
1586 default 0 1587 default 0
1587 help 1588 help
1588 Maximum number of GPIOs in the system. 1589 Maximum number of GPIOs in the system.
diff --git a/arch/arm/boot/dts/kirkwood-dreamplug.dts b/arch/arm/boot/dts/kirkwood-dreamplug.dts
new file mode 100644
index 000000000000..8a5dff807b45
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood-dreamplug.dts
@@ -0,0 +1,25 @@
1/dts-v1/;
2
3/include/ "kirkwood.dtsi"
4
5/ {
6 model = "Globalscale Technologies Dreamplug";
7 compatible = "globalscale,dreamplug-003-ds2001", "globalscale,dreamplug", "marvell,kirkwood-88f6281", "marvell,kirkwood";
8
9 memory {
10 device_type = "memory";
11 reg = <0x00000000 0x20000000>;
12 };
13
14 chosen {
15 bootargs = "console=ttyS0,115200n8 earlyprintk";
16 };
17
18 serial@f1012000 {
19 compatible = "ns16550a";
20 reg = <0xf1012000 0xff>;
21 reg-shift = <2>;
22 interrupts = <33>;
23 clock-frequency = <200000000>;
24 };
25};
diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
new file mode 100644
index 000000000000..771c6bbeb29a
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood.dtsi
@@ -0,0 +1,6 @@
1/include/ "skeleton.dtsi"
2
3/ {
4 compatible = "marvell,kirkwood";
5};
6
diff --git a/arch/arm/boot/dts/tegra-paz00.dts b/arch/arm/boot/dts/tegra-paz00.dts
index 825d2957da0b..61f385809970 100644
--- a/arch/arm/boot/dts/tegra-paz00.dts
+++ b/arch/arm/boot/dts/tegra-paz00.dts
@@ -35,6 +35,11 @@
35 35
36 i2c@7000d000 { 36 i2c@7000d000 {
37 clock-frequency = <400000>; 37 clock-frequency = <400000>;
38
39 adt7461@4c {
40 compatible = "adi,adt7461";
41 reg = <0x4c>;
42 };
38 }; 43 };
39 44
40 serial@70006000 { 45 serial@70006000 {
@@ -74,4 +79,25 @@
74 sdhci@c8000600 { 79 sdhci@c8000600 {
75 support-8bit; 80 support-8bit;
76 }; 81 };
82
83 gpio-keys {
84 compatible = "gpio-keys";
85
86 power {
87 label = "Power";
88 gpios = <&gpio 79 1>; /* gpio PJ7, active low */
89 linux,code = <116>; /* KEY_POWER */
90 gpio-key,wakeup;
91 };
92 };
93
94 gpio-leds {
95 compatible = "gpio-leds";
96
97 wifi {
98 label = "wifi-led";
99 gpios = <&gpio 24 0>;
100 linux,default-trigger = "rfkill0";
101 };
102 };
77}; 103};
diff --git a/arch/arm/configs/tegra_defconfig b/arch/arm/configs/tegra_defconfig
index fd5d3041d717..351d6708c3ae 100644
--- a/arch/arm/configs/tegra_defconfig
+++ b/arch/arm/configs/tegra_defconfig
@@ -11,11 +11,14 @@ CONFIG_RT_GROUP_SCHED=y
11CONFIG_BLK_DEV_INITRD=y 11CONFIG_BLK_DEV_INITRD=y
12# CONFIG_ELF_CORE is not set 12# CONFIG_ELF_CORE is not set
13CONFIG_EMBEDDED=y 13CONFIG_EMBEDDED=y
14CONFIG_PERF_EVENTS=y
14CONFIG_SLAB=y 15CONFIG_SLAB=y
15CONFIG_MODULES=y 16CONFIG_MODULES=y
16CONFIG_MODULE_UNLOAD=y 17CONFIG_MODULE_UNLOAD=y
17CONFIG_MODULE_FORCE_UNLOAD=y 18CONFIG_MODULE_FORCE_UNLOAD=y
18# CONFIG_BLK_DEV_BSG is not set 19# CONFIG_BLK_DEV_BSG is not set
20CONFIG_PARTITION_ADVANCED=y
21CONFIG_EFI_PARTITION=y
19# CONFIG_IOSCHED_DEADLINE is not set 22# CONFIG_IOSCHED_DEADLINE is not set
20# CONFIG_IOSCHED_CFQ is not set 23# CONFIG_IOSCHED_CFQ is not set
21CONFIG_ARCH_TEGRA=y 24CONFIG_ARCH_TEGRA=y
@@ -27,18 +30,20 @@ CONFIG_MACH_PAZ00=y
27CONFIG_MACH_TRIMSLICE=y 30CONFIG_MACH_TRIMSLICE=y
28CONFIG_MACH_WARIO=y 31CONFIG_MACH_WARIO=y
29CONFIG_MACH_VENTANA=y 32CONFIG_MACH_VENTANA=y
30CONFIG_TEGRA_DEBUG_UARTD=y 33CONFIG_TEGRA_EMC_SCALING_ENABLE=y
31CONFIG_ARM_ERRATA_742230=y
32CONFIG_NO_HZ=y 34CONFIG_NO_HZ=y
33CONFIG_HIGH_RES_TIMERS=y 35CONFIG_HIGH_RES_TIMERS=y
34CONFIG_SMP=y 36CONFIG_SMP=y
35CONFIG_NR_CPUS=2
36CONFIG_PREEMPT=y 37CONFIG_PREEMPT=y
37CONFIG_AEABI=y 38CONFIG_AEABI=y
38# CONFIG_OABI_COMPAT is not set 39# CONFIG_OABI_COMPAT is not set
39CONFIG_HIGHMEM=y 40CONFIG_HIGHMEM=y
40CONFIG_ZBOOT_ROM_TEXT=0x0 41CONFIG_ZBOOT_ROM_TEXT=0x0
41CONFIG_ZBOOT_ROM_BSS=0x0 42CONFIG_ZBOOT_ROM_BSS=0x0
43CONFIG_AUTO_ZRELADDR=y
44CONFIG_CPU_FREQ=y
45CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
46CONFIG_CPU_IDLE=y
42CONFIG_VFP=y 47CONFIG_VFP=y
43CONFIG_NET=y 48CONFIG_NET=y
44CONFIG_PACKET=y 49CONFIG_PACKET=y
@@ -68,7 +73,6 @@ CONFIG_IPV6_MULTIPLE_TABLES=y
68# CONFIG_FIRMWARE_IN_KERNEL is not set 73# CONFIG_FIRMWARE_IN_KERNEL is not set
69CONFIG_PROC_DEVICETREE=y 74CONFIG_PROC_DEVICETREE=y
70CONFIG_BLK_DEV_LOOP=y 75CONFIG_BLK_DEV_LOOP=y
71CONFIG_MISC_DEVICES=y
72CONFIG_AD525X_DPOT=y 76CONFIG_AD525X_DPOT=y
73CONFIG_AD525X_DPOT_I2C=y 77CONFIG_AD525X_DPOT_I2C=y
74CONFIG_ICS932S401=y 78CONFIG_ICS932S401=y
@@ -76,6 +80,7 @@ CONFIG_APDS9802ALS=y
76CONFIG_ISL29003=y 80CONFIG_ISL29003=y
77CONFIG_SCSI=y 81CONFIG_SCSI=y
78CONFIG_BLK_DEV_SD=y 82CONFIG_BLK_DEV_SD=y
83CONFIG_BLK_DEV_SR=y
79# CONFIG_SCSI_LOWLEVEL is not set 84# CONFIG_SCSI_LOWLEVEL is not set
80CONFIG_NETDEVICES=y 85CONFIG_NETDEVICES=y
81CONFIG_DUMMY=y 86CONFIG_DUMMY=y
@@ -85,8 +90,7 @@ CONFIG_USB_USBNET=y
85CONFIG_USB_NET_SMSC75XX=y 90CONFIG_USB_NET_SMSC75XX=y
86CONFIG_USB_NET_SMSC95XX=y 91CONFIG_USB_NET_SMSC95XX=y
87# CONFIG_WLAN is not set 92# CONFIG_WLAN is not set
88# CONFIG_INPUT is not set 93CONFIG_INPUT_EVDEV=y
89# CONFIG_SERIO is not set
90# CONFIG_VT is not set 94# CONFIG_VT is not set
91# CONFIG_LEGACY_PTYS is not set 95# CONFIG_LEGACY_PTYS is not set
92# CONFIG_DEVKMEM is not set 96# CONFIG_DEVKMEM is not set
@@ -96,13 +100,15 @@ CONFIG_SERIAL_OF_PLATFORM=y
96# CONFIG_HW_RANDOM is not set 100# CONFIG_HW_RANDOM is not set
97CONFIG_I2C=y 101CONFIG_I2C=y
98# CONFIG_I2C_COMPAT is not set 102# CONFIG_I2C_COMPAT is not set
99# CONFIG_I2C_HELPER_AUTO is not set
100CONFIG_I2C_TEGRA=y 103CONFIG_I2C_TEGRA=y
101CONFIG_SPI=y 104CONFIG_SPI=y
102CONFIG_SPI_TEGRA=y 105CONFIG_SPI_TEGRA=y
103CONFIG_SENSORS_LM90=y 106CONFIG_SENSORS_LM90=y
104CONFIG_MFD_TPS6586X=y 107CONFIG_MFD_TPS6586X=y
105CONFIG_REGULATOR=y 108CONFIG_REGULATOR=y
109CONFIG_REGULATOR_FIXED_VOLTAGE=y
110CONFIG_REGULATOR_VIRTUAL_CONSUMER=y
111CONFIG_REGULATOR_GPIO=y
106CONFIG_REGULATOR_TPS6586X=y 112CONFIG_REGULATOR_TPS6586X=y
107CONFIG_SOUND=y 113CONFIG_SOUND=y
108CONFIG_SND=y 114CONFIG_SND=y
@@ -116,11 +122,13 @@ CONFIG_SND_SOC=y
116CONFIG_SND_SOC_TEGRA=y 122CONFIG_SND_SOC_TEGRA=y
117CONFIG_SND_SOC_TEGRA_WM8903=y 123CONFIG_SND_SOC_TEGRA_WM8903=y
118CONFIG_SND_SOC_TEGRA_TRIMSLICE=y 124CONFIG_SND_SOC_TEGRA_TRIMSLICE=y
125CONFIG_SND_SOC_TEGRA_ALC5632=y
119CONFIG_USB=y 126CONFIG_USB=y
120CONFIG_USB_EHCI_HCD=y 127CONFIG_USB_EHCI_HCD=y
121CONFIG_USB_EHCI_TEGRA=y 128CONFIG_USB_EHCI_TEGRA=y
122CONFIG_USB_STORAGE=y 129CONFIG_USB_STORAGE=y
123CONFIG_MMC=y 130CONFIG_MMC=y
131CONFIG_MMC_BLOCK_MINORS=16
124CONFIG_MMC_SDHCI=y 132CONFIG_MMC_SDHCI=y
125CONFIG_MMC_SDHCI_PLTFM=y 133CONFIG_MMC_SDHCI_PLTFM=y
126CONFIG_MMC_SDHCI_TEGRA=y 134CONFIG_MMC_SDHCI_TEGRA=y
@@ -130,6 +138,11 @@ CONFIG_STAGING=y
130CONFIG_IIO=y 138CONFIG_IIO=y
131CONFIG_SENSORS_ISL29018=y 139CONFIG_SENSORS_ISL29018=y
132CONFIG_SENSORS_AK8975=y 140CONFIG_SENSORS_AK8975=y
141CONFIG_MFD_NVEC=y
142CONFIG_KEYBOARD_NVEC=y
143CONFIG_SERIO_NVEC_PS2=y
144CONFIG_TEGRA_IOMMU_GART=y
145CONFIG_TEGRA_IOMMU_SMMU=y
133CONFIG_EXT2_FS=y 146CONFIG_EXT2_FS=y
134CONFIG_EXT2_FS_XATTR=y 147CONFIG_EXT2_FS_XATTR=y
135CONFIG_EXT2_FS_POSIX_ACL=y 148CONFIG_EXT2_FS_POSIX_ACL=y
@@ -138,13 +151,12 @@ CONFIG_EXT3_FS=y
138# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set 151# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
139CONFIG_EXT3_FS_POSIX_ACL=y 152CONFIG_EXT3_FS_POSIX_ACL=y
140CONFIG_EXT3_FS_SECURITY=y 153CONFIG_EXT3_FS_SECURITY=y
154CONFIG_EXT4_FS=y
141# CONFIG_DNOTIFY is not set 155# CONFIG_DNOTIFY is not set
142CONFIG_VFAT_FS=y 156CONFIG_VFAT_FS=y
143CONFIG_TMPFS=y 157CONFIG_TMPFS=y
144CONFIG_NFS_FS=y 158CONFIG_NFS_FS=y
145CONFIG_ROOT_NFS=y 159CONFIG_ROOT_NFS=y
146CONFIG_PARTITION_ADVANCED=y
147CONFIG_EFI_PARTITION=y
148CONFIG_NLS_CODEPAGE_437=y 160CONFIG_NLS_CODEPAGE_437=y
149CONFIG_NLS_ISO8859_1=y 161CONFIG_NLS_ISO8859_1=y
150CONFIG_PRINTK_TIME=y 162CONFIG_PRINTK_TIME=y
@@ -162,9 +174,8 @@ CONFIG_DEBUG_SG=y
162CONFIG_DEBUG_LL=y 174CONFIG_DEBUG_LL=y
163CONFIG_EARLY_PRINTK=y 175CONFIG_EARLY_PRINTK=y
164CONFIG_CRYPTO_ECB=y 176CONFIG_CRYPTO_ECB=y
165CONFIG_CRYPTO_AES=y
166CONFIG_CRYPTO_ARC4=y 177CONFIG_CRYPTO_ARC4=y
167CONFIG_CRYPTO_TWOFISH=y 178CONFIG_CRYPTO_TWOFISH=y
168# CONFIG_CRYPTO_ANSI_CPRNG is not set 179# CONFIG_CRYPTO_ANSI_CPRNG is not set
180CONFIG_CRYPTO_DEV_TEGRA_AES=y
169CONFIG_CRC_CCITT=y 181CONFIG_CRC_CCITT=y
170CONFIG_CRC16=y
diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig
index dfad6538b273..98997c2da262 100644
--- a/arch/arm/mach-exynos/Kconfig
+++ b/arch/arm/mach-exynos/Kconfig
@@ -179,7 +179,9 @@ config MACH_SMDKV310
179 select S5P_DEV_FIMC1 179 select S5P_DEV_FIMC1
180 select S5P_DEV_FIMC2 180 select S5P_DEV_FIMC2
181 select S5P_DEV_FIMC3 181 select S5P_DEV_FIMC3
182 select S5P_DEV_G2D
182 select S5P_DEV_I2C_HDMIPHY 183 select S5P_DEV_I2C_HDMIPHY
184 select S5P_DEV_JPEG
183 select S5P_DEV_MFC 185 select S5P_DEV_MFC
184 select S5P_DEV_TV 186 select S5P_DEV_TV
185 select S5P_DEV_USB_EHCI 187 select S5P_DEV_USB_EHCI
@@ -225,7 +227,9 @@ config MACH_UNIVERSAL_C210
225 select S5P_DEV_FIMC1 227 select S5P_DEV_FIMC1
226 select S5P_DEV_FIMC2 228 select S5P_DEV_FIMC2
227 select S5P_DEV_FIMC3 229 select S5P_DEV_FIMC3
230 select S5P_DEV_G2D
228 select S5P_DEV_CSIS0 231 select S5P_DEV_CSIS0
232 select S5P_DEV_JPEG
229 select S5P_DEV_FIMD0 233 select S5P_DEV_FIMD0
230 select S3C_DEV_HSMMC 234 select S3C_DEV_HSMMC
231 select S3C_DEV_HSMMC2 235 select S3C_DEV_HSMMC2
@@ -262,11 +266,14 @@ config MACH_NURI
262 select S3C_DEV_I2C1 266 select S3C_DEV_I2C1
263 select S3C_DEV_I2C3 267 select S3C_DEV_I2C3
264 select S3C_DEV_I2C5 268 select S3C_DEV_I2C5
269 select S3C_DEV_I2C6
265 select S5P_DEV_CSIS0 270 select S5P_DEV_CSIS0
271 select S5P_DEV_JPEG
266 select S5P_DEV_FIMC0 272 select S5P_DEV_FIMC0
267 select S5P_DEV_FIMC1 273 select S5P_DEV_FIMC1
268 select S5P_DEV_FIMC2 274 select S5P_DEV_FIMC2
269 select S5P_DEV_FIMC3 275 select S5P_DEV_FIMC3
276 select S5P_DEV_G2D
270 select S5P_DEV_MFC 277 select S5P_DEV_MFC
271 select S5P_DEV_USB_EHCI 278 select S5P_DEV_USB_EHCI
272 select S5P_SETUP_MIPIPHY 279 select S5P_SETUP_MIPIPHY
@@ -276,6 +283,7 @@ config MACH_NURI
276 select EXYNOS4_SETUP_I2C1 283 select EXYNOS4_SETUP_I2C1
277 select EXYNOS4_SETUP_I2C3 284 select EXYNOS4_SETUP_I2C3
278 select EXYNOS4_SETUP_I2C5 285 select EXYNOS4_SETUP_I2C5
286 select EXYNOS4_SETUP_I2C6
279 select EXYNOS4_SETUP_SDHCI 287 select EXYNOS4_SETUP_SDHCI
280 select EXYNOS4_SETUP_USB_PHY 288 select EXYNOS4_SETUP_USB_PHY
281 select S5P_SETUP_MIPIPHY 289 select S5P_SETUP_MIPIPHY
@@ -296,7 +304,9 @@ config MACH_ORIGEN
296 select S5P_DEV_FIMC2 304 select S5P_DEV_FIMC2
297 select S5P_DEV_FIMC3 305 select S5P_DEV_FIMC3
298 select S5P_DEV_FIMD0 306 select S5P_DEV_FIMD0
307 select S5P_DEV_G2D
299 select S5P_DEV_I2C_HDMIPHY 308 select S5P_DEV_I2C_HDMIPHY
309 select S5P_DEV_JPEG
300 select S5P_DEV_MFC 310 select S5P_DEV_MFC
301 select S5P_DEV_TV 311 select S5P_DEV_TV
302 select S5P_DEV_USB_EHCI 312 select S5P_DEV_USB_EHCI
diff --git a/arch/arm/mach-exynos/mach-nuri.c b/arch/arm/mach-exynos/mach-nuri.c
index aa37179d776c..191f5c675fe1 100644
--- a/arch/arm/mach-exynos/mach-nuri.c
+++ b/arch/arm/mach-exynos/mach-nuri.c
@@ -28,6 +28,7 @@
28 28
29#include <video/platform_lcd.h> 29#include <video/platform_lcd.h>
30#include <media/m5mols.h> 30#include <media/m5mols.h>
31#include <media/s5k6aa.h>
31#include <media/s5p_fimc.h> 32#include <media/s5p_fimc.h>
32#include <media/v4l2-mediabus.h> 33#include <media/v4l2-mediabus.h>
33 34
@@ -75,6 +76,7 @@ enum fixed_regulator_id {
75 FIXED_REG_ID_MAX8903, 76 FIXED_REG_ID_MAX8903,
76 FIXED_REG_ID_CAM_A28V, 77 FIXED_REG_ID_CAM_A28V,
77 FIXED_REG_ID_CAM_12V, 78 FIXED_REG_ID_CAM_12V,
79 FIXED_REG_ID_CAM_VT_15V,
78}; 80};
79 81
80static struct s3c2410_uartcfg nuri_uartcfgs[] __initdata = { 82static struct s3c2410_uartcfg nuri_uartcfgs[] __initdata = {
@@ -399,6 +401,9 @@ static struct regulator_consumer_supply __initdata max8997_ldo4_[] = {
399static struct regulator_consumer_supply __initdata max8997_ldo5_[] = { 401static struct regulator_consumer_supply __initdata max8997_ldo5_[] = {
400 REGULATOR_SUPPLY("vhsic", "modemctl"), /* MODEM */ 402 REGULATOR_SUPPLY("vhsic", "modemctl"), /* MODEM */
401}; 403};
404static struct regulator_consumer_supply nuri_max8997_ldo6_consumer[] = {
405 REGULATOR_SUPPLY("vdd_reg", "6-003c"), /* S5K6AA camera */
406};
402static struct regulator_consumer_supply __initdata max8997_ldo7_[] = { 407static struct regulator_consumer_supply __initdata max8997_ldo7_[] = {
403 REGULATOR_SUPPLY("dig_18", "0-001f"), /* HCD803 */ 408 REGULATOR_SUPPLY("dig_18", "0-001f"), /* HCD803 */
404}; 409};
@@ -431,7 +436,7 @@ static struct regulator_consumer_supply __initdata max8997_buck1_[] = {
431 REGULATOR_SUPPLY("vdd_arm", NULL), /* CPUFREQ */ 436 REGULATOR_SUPPLY("vdd_arm", NULL), /* CPUFREQ */
432}; 437};
433static struct regulator_consumer_supply __initdata max8997_buck2_[] = { 438static struct regulator_consumer_supply __initdata max8997_buck2_[] = {
434 REGULATOR_SUPPLY("vdd_int", NULL), /* CPUFREQ */ 439 REGULATOR_SUPPLY("vdd_int", "exynos4210-busfreq.0"), /* CPUFREQ */
435}; 440};
436static struct regulator_consumer_supply __initdata max8997_buck3_[] = { 441static struct regulator_consumer_supply __initdata max8997_buck3_[] = {
437 REGULATOR_SUPPLY("vdd", "mali_dev.0"), /* G3D of Exynos 4 */ 442 REGULATOR_SUPPLY("vdd", "mali_dev.0"), /* G3D of Exynos 4 */
@@ -546,6 +551,8 @@ static struct regulator_init_data __initdata max8997_ldo6_data = {
546 .enabled = 1, 551 .enabled = 1,
547 }, 552 },
548 }, 553 },
554 .num_consumer_supplies = ARRAY_SIZE(nuri_max8997_ldo6_consumer),
555 .consumer_supplies = nuri_max8997_ldo6_consumer,
549}; 556};
550 557
551static struct regulator_init_data __initdata max8997_ldo7_data = { 558static struct regulator_init_data __initdata max8997_ldo7_data = {
@@ -742,7 +749,7 @@ static struct regulator_init_data __initdata max8997_buck2_data = {
742 .constraints = { 749 .constraints = {
743 .name = "VINT_1.1V_C210", 750 .name = "VINT_1.1V_C210",
744 .min_uV = 900000, 751 .min_uV = 900000,
745 .max_uV = 1100000, 752 .max_uV = 1200000,
746 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE, 753 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
747 .always_on = 1, 754 .always_on = 1,
748 .state_mem = { 755 .state_mem = {
@@ -957,7 +964,6 @@ static struct max8997_platform_data __initdata nuri_max8997_pdata = {
957 .regulators = nuri_max8997_regulators, 964 .regulators = nuri_max8997_regulators,
958 965
959 .buck125_gpios = { EXYNOS4_GPX0(5), EXYNOS4_GPX0(6), EXYNOS4_GPL0(0) }, 966 .buck125_gpios = { EXYNOS4_GPX0(5), EXYNOS4_GPX0(6), EXYNOS4_GPL0(0) },
960 .buck2_gpiodvs = true,
961 967
962 .buck1_voltage[0] = 1350000, /* 1.35V */ 968 .buck1_voltage[0] = 1350000, /* 1.35V */
963 .buck1_voltage[1] = 1300000, /* 1.3V */ 969 .buck1_voltage[1] = 1300000, /* 1.3V */
@@ -1116,7 +1122,30 @@ static void __init nuri_ehci_init(void)
1116} 1122}
1117 1123
1118/* CAMERA */ 1124/* CAMERA */
1125static struct regulator_consumer_supply cam_vt_cam15_supply =
1126 REGULATOR_SUPPLY("vdd_core", "6-003c");
1127
1128static struct regulator_init_data cam_vt_cam15_reg_init_data = {
1129 .constraints = { .valid_ops_mask = REGULATOR_CHANGE_STATUS },
1130 .num_consumer_supplies = 1,
1131 .consumer_supplies = &cam_vt_cam15_supply,
1132};
1133
1134static struct fixed_voltage_config cam_vt_cam15_fixed_voltage_cfg = {
1135 .supply_name = "VT_CAM_1.5V",
1136 .microvolts = 1500000,
1137 .gpio = EXYNOS4_GPE2(2), /* VT_CAM_1.5V_EN */
1138 .enable_high = 1,
1139 .init_data = &cam_vt_cam15_reg_init_data,
1140};
1141
1142static struct platform_device cam_vt_cam15_fixed_rdev = {
1143 .name = "reg-fixed-voltage", .id = FIXED_REG_ID_CAM_VT_15V,
1144 .dev = { .platform_data = &cam_vt_cam15_fixed_voltage_cfg },
1145};
1146
1119static struct regulator_consumer_supply cam_vdda_supply[] = { 1147static struct regulator_consumer_supply cam_vdda_supply[] = {
1148 REGULATOR_SUPPLY("vdda", "6-003c"),
1120 REGULATOR_SUPPLY("a_sensor", "0-001f"), 1149 REGULATOR_SUPPLY("a_sensor", "0-001f"),
1121}; 1150};
1122 1151
@@ -1173,6 +1202,21 @@ static struct s5p_platform_mipi_csis mipi_csis_platdata = {
1173 1202
1174#define GPIO_CAM_MEGA_RST EXYNOS4_GPY3(7) /* ISP_RESET */ 1203#define GPIO_CAM_MEGA_RST EXYNOS4_GPY3(7) /* ISP_RESET */
1175#define GPIO_CAM_8M_ISP_INT EXYNOS4_GPL2(5) 1204#define GPIO_CAM_8M_ISP_INT EXYNOS4_GPL2(5)
1205#define GPIO_CAM_VT_NSTBY EXYNOS4_GPL2(0)
1206#define GPIO_CAM_VT_NRST EXYNOS4_GPL2(1)
1207
1208static struct s5k6aa_platform_data s5k6aa_pldata = {
1209 .mclk_frequency = 24000000UL,
1210 .gpio_reset = { GPIO_CAM_VT_NRST, 0 },
1211 .gpio_stby = { GPIO_CAM_VT_NSTBY, 0 },
1212 .bus_type = V4L2_MBUS_PARALLEL,
1213 .horiz_flip = 1,
1214};
1215
1216static struct i2c_board_info s5k6aa_board_info = {
1217 I2C_BOARD_INFO("S5K6AA", 0x3c),
1218 .platform_data = &s5k6aa_pldata,
1219};
1176 1220
1177static struct m5mols_platform_data m5mols_platdata = { 1221static struct m5mols_platform_data m5mols_platdata = {
1178 .gpio_reset = GPIO_CAM_MEGA_RST, 1222 .gpio_reset = GPIO_CAM_MEGA_RST,
@@ -1185,6 +1229,13 @@ static struct i2c_board_info m5mols_board_info = {
1185 1229
1186static struct s5p_fimc_isp_info nuri_camera_sensors[] = { 1230static struct s5p_fimc_isp_info nuri_camera_sensors[] = {
1187 { 1231 {
1232 .flags = V4L2_MBUS_PCLK_SAMPLE_RISING |
1233 V4L2_MBUS_VSYNC_ACTIVE_LOW,
1234 .bus_type = FIMC_ITU_601,
1235 .board_info = &s5k6aa_board_info,
1236 .clk_frequency = 24000000UL,
1237 .i2c_bus_num = 6,
1238 }, {
1188 .flags = V4L2_MBUS_PCLK_SAMPLE_FALLING | 1239 .flags = V4L2_MBUS_PCLK_SAMPLE_FALLING |
1189 V4L2_MBUS_VSYNC_ACTIVE_LOW, 1240 V4L2_MBUS_VSYNC_ACTIVE_LOW,
1190 .bus_type = FIMC_MIPI_CSI2, 1241 .bus_type = FIMC_MIPI_CSI2,
@@ -1200,11 +1251,13 @@ static struct s5p_platform_fimc fimc_md_platdata = {
1200}; 1251};
1201 1252
1202static struct gpio nuri_camera_gpios[] = { 1253static struct gpio nuri_camera_gpios[] = {
1254 { GPIO_CAM_VT_NSTBY, GPIOF_OUT_INIT_LOW, "CAM_VGA_NSTBY" },
1255 { GPIO_CAM_VT_NRST, GPIOF_OUT_INIT_LOW, "CAM_VGA_NRST" },
1203 { GPIO_CAM_8M_ISP_INT, GPIOF_IN, "8M_ISP_INT" }, 1256 { GPIO_CAM_8M_ISP_INT, GPIOF_IN, "8M_ISP_INT" },
1204 { GPIO_CAM_MEGA_RST, GPIOF_OUT_INIT_LOW, "CAM_8M_NRST" }, 1257 { GPIO_CAM_MEGA_RST, GPIOF_OUT_INIT_LOW, "CAM_8M_NRST" },
1205}; 1258};
1206 1259
1207static void nuri_camera_init(void) 1260static void __init nuri_camera_init(void)
1208{ 1261{
1209 s3c_set_platdata(&mipi_csis_platdata, sizeof(mipi_csis_platdata), 1262 s3c_set_platdata(&mipi_csis_platdata, sizeof(mipi_csis_platdata),
1210 &s5p_device_mipi_csis0); 1263 &s5p_device_mipi_csis0);
@@ -1224,6 +1277,8 @@ static void nuri_camera_init(void)
1224 pr_err("%s: Failed to configure 8M_ISP_INT GPIO\n", __func__); 1277 pr_err("%s: Failed to configure 8M_ISP_INT GPIO\n", __func__);
1225 1278
1226 /* Free GPIOs controlled directly by the sensor drivers. */ 1279 /* Free GPIOs controlled directly by the sensor drivers. */
1280 gpio_free(GPIO_CAM_VT_NRST);
1281 gpio_free(GPIO_CAM_VT_NSTBY);
1227 gpio_free(GPIO_CAM_MEGA_RST); 1282 gpio_free(GPIO_CAM_MEGA_RST);
1228 1283
1229 if (exynos4_fimc_setup_gpio(S5P_CAMPORT_A)) { 1284 if (exynos4_fimc_setup_gpio(S5P_CAMPORT_A)) {
@@ -1234,15 +1289,27 @@ static void nuri_camera_init(void)
1234 s5p_gpio_set_drvstr(EXYNOS4_GPJ1(3), S5P_GPIO_DRVSTR_LV4); 1289 s5p_gpio_set_drvstr(EXYNOS4_GPJ1(3), S5P_GPIO_DRVSTR_LV4);
1235} 1290}
1236 1291
1292static struct s3c2410_platform_i2c nuri_i2c6_platdata __initdata = {
1293 .frequency = 400000U,
1294 .sda_delay = 200,
1295 .bus_num = 6,
1296};
1297
1237static struct s3c2410_platform_i2c nuri_i2c0_platdata __initdata = { 1298static struct s3c2410_platform_i2c nuri_i2c0_platdata __initdata = {
1238 .frequency = 400000U, 1299 .frequency = 400000U,
1239 .sda_delay = 200, 1300 .sda_delay = 200,
1240}; 1301};
1241 1302
1303/* DEVFREQ controlling memory/bus */
1304static struct platform_device exynos4_bus_devfreq = {
1305 .name = "exynos4210-busfreq",
1306};
1307
1242static struct platform_device *nuri_devices[] __initdata = { 1308static struct platform_device *nuri_devices[] __initdata = {
1243 /* Samsung Platform Devices */ 1309 /* Samsung Platform Devices */
1244 &s3c_device_i2c5, /* PMIC should initialize first */ 1310 &s3c_device_i2c5, /* PMIC should initialize first */
1245 &s3c_device_i2c0, 1311 &s3c_device_i2c0,
1312 &s3c_device_i2c6,
1246 &emmc_fixed_voltage, 1313 &emmc_fixed_voltage,
1247 &s5p_device_mipi_csis0, 1314 &s5p_device_mipi_csis0,
1248 &s5p_device_fimc0, 1315 &s5p_device_fimc0,
@@ -1259,6 +1326,8 @@ static struct platform_device *nuri_devices[] __initdata = {
1259 &s3c_device_i2c3, 1326 &s3c_device_i2c3,
1260 &i2c9_gpio, 1327 &i2c9_gpio,
1261 &s3c_device_adc, 1328 &s3c_device_adc,
1329 &s5p_device_g2d,
1330 &s5p_device_jpeg,
1262 &s3c_device_rtc, 1331 &s3c_device_rtc,
1263 &s5p_device_mfc, 1332 &s5p_device_mfc,
1264 &s5p_device_mfc_l, 1333 &s5p_device_mfc_l,
@@ -1271,8 +1340,10 @@ static struct platform_device *nuri_devices[] __initdata = {
1271 &nuri_backlight_device, 1340 &nuri_backlight_device,
1272 &max8903_fixed_reg_dev, 1341 &max8903_fixed_reg_dev,
1273 &nuri_max8903_device, 1342 &nuri_max8903_device,
1343 &cam_vt_cam15_fixed_rdev,
1274 &cam_vdda_fixed_rdev, 1344 &cam_vdda_fixed_rdev,
1275 &cam_8m_12v_fixed_rdev, 1345 &cam_8m_12v_fixed_rdev,
1346 &exynos4_bus_devfreq,
1276}; 1347};
1277 1348
1278static void __init nuri_map_io(void) 1349static void __init nuri_map_io(void)
@@ -1302,6 +1373,7 @@ static void __init nuri_machine_init(void)
1302 i2c_register_board_info(5, i2c5_devs, ARRAY_SIZE(i2c5_devs)); 1373 i2c_register_board_info(5, i2c5_devs, ARRAY_SIZE(i2c5_devs));
1303 i2c9_devs[I2C9_MAX17042].irq = gpio_to_irq(EXYNOS4_GPX2(3)); 1374 i2c9_devs[I2C9_MAX17042].irq = gpio_to_irq(EXYNOS4_GPX2(3));
1304 i2c_register_board_info(9, i2c9_devs, ARRAY_SIZE(i2c9_devs)); 1375 i2c_register_board_info(9, i2c9_devs, ARRAY_SIZE(i2c9_devs));
1376 s3c_i2c6_set_platdata(&nuri_i2c6_platdata);
1305 1377
1306 s5p_fimd0_set_platdata(&nuri_fb_pdata); 1378 s5p_fimd0_set_platdata(&nuri_fb_pdata);
1307 1379
diff --git a/arch/arm/mach-exynos/mach-origen.c b/arch/arm/mach-exynos/mach-origen.c
index b4d032d5c878..878d4c99142d 100644
--- a/arch/arm/mach-exynos/mach-origen.c
+++ b/arch/arm/mach-exynos/mach-origen.c
@@ -20,6 +20,7 @@
20#include <linux/regulator/machine.h> 20#include <linux/regulator/machine.h>
21#include <linux/mfd/max8997.h> 21#include <linux/mfd/max8997.h>
22#include <linux/lcd.h> 22#include <linux/lcd.h>
23#include <linux/rfkill-gpio.h>
23 24
24#include <asm/mach/arch.h> 25#include <asm/mach/arch.h>
25#include <asm/hardware/gic.h> 26#include <asm/hardware/gic.h>
@@ -235,6 +236,7 @@ static struct regulator_init_data __initdata max8997_ldo9_data = {
235 .min_uV = 2800000, 236 .min_uV = 2800000,
236 .max_uV = 2800000, 237 .max_uV = 2800000,
237 .apply_uV = 1, 238 .apply_uV = 1,
239 .always_on = 1,
238 .valid_ops_mask = REGULATOR_CHANGE_STATUS, 240 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
239 .state_mem = { 241 .state_mem = {
240 .disabled = 1, 242 .disabled = 1,
@@ -278,6 +280,7 @@ static struct regulator_init_data __initdata max8997_ldo14_data = {
278 .min_uV = 1800000, 280 .min_uV = 1800000,
279 .max_uV = 1800000, 281 .max_uV = 1800000,
280 .apply_uV = 1, 282 .apply_uV = 1,
283 .always_on = 1,
281 .valid_ops_mask = REGULATOR_CHANGE_STATUS, 284 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
282 .state_mem = { 285 .state_mem = {
283 .disabled = 1, 286 .disabled = 1,
@@ -293,6 +296,7 @@ static struct regulator_init_data __initdata max8997_ldo17_data = {
293 .min_uV = 3300000, 296 .min_uV = 3300000,
294 .max_uV = 3300000, 297 .max_uV = 3300000,
295 .apply_uV = 1, 298 .apply_uV = 1,
299 .always_on = 1,
296 .valid_ops_mask = REGULATOR_CHANGE_STATUS, 300 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
297 .state_mem = { 301 .state_mem = {
298 .disabled = 1, 302 .disabled = 1,
@@ -602,6 +606,23 @@ static struct s3c_fb_platdata origen_lcd_pdata __initdata = {
602 .setup_gpio = exynos4_fimd0_gpio_setup_24bpp, 606 .setup_gpio = exynos4_fimd0_gpio_setup_24bpp,
603}; 607};
604 608
609/* Bluetooth rfkill gpio platform data */
610struct rfkill_gpio_platform_data origen_bt_pdata = {
611 .reset_gpio = EXYNOS4_GPX2(2),
612 .shutdown_gpio = -1,
613 .type = RFKILL_TYPE_BLUETOOTH,
614 .name = "origen-bt",
615};
616
617/* Bluetooth Platform device */
618static struct platform_device origen_device_bluetooth = {
619 .name = "rfkill_gpio",
620 .id = -1,
621 .dev = {
622 .platform_data = &origen_bt_pdata,
623 },
624};
625
605static struct platform_device *origen_devices[] __initdata = { 626static struct platform_device *origen_devices[] __initdata = {
606 &s3c_device_hsmmc2, 627 &s3c_device_hsmmc2,
607 &s3c_device_hsmmc0, 628 &s3c_device_hsmmc0,
@@ -613,9 +634,12 @@ static struct platform_device *origen_devices[] __initdata = {
613 &s5p_device_fimc1, 634 &s5p_device_fimc1,
614 &s5p_device_fimc2, 635 &s5p_device_fimc2,
615 &s5p_device_fimc3, 636 &s5p_device_fimc3,
637 &s5p_device_fimc_md,
616 &s5p_device_fimd0, 638 &s5p_device_fimd0,
639 &s5p_device_g2d,
617 &s5p_device_hdmi, 640 &s5p_device_hdmi,
618 &s5p_device_i2c_hdmiphy, 641 &s5p_device_i2c_hdmiphy,
642 &s5p_device_jpeg,
619 &s5p_device_mfc, 643 &s5p_device_mfc,
620 &s5p_device_mfc_l, 644 &s5p_device_mfc_l,
621 &s5p_device_mfc_r, 645 &s5p_device_mfc_r,
@@ -623,6 +647,7 @@ static struct platform_device *origen_devices[] __initdata = {
623 &exynos4_device_ohci, 647 &exynos4_device_ohci,
624 &origen_device_gpiokeys, 648 &origen_device_gpiokeys,
625 &origen_lcd_hv070wsa, 649 &origen_lcd_hv070wsa,
650 &origen_device_bluetooth,
626}; 651};
627 652
628/* LCD Backlight data */ 653/* LCD Backlight data */
@@ -636,6 +661,16 @@ static struct platform_pwm_backlight_data origen_bl_data = {
636 .pwm_period_ns = 1000, 661 .pwm_period_ns = 1000,
637}; 662};
638 663
664static void __init origen_bt_setup(void)
665{
666 gpio_request(EXYNOS4_GPA0(0), "GPIO BT_UART");
667 /* 4 UART Pins configuration */
668 s3c_gpio_cfgrange_nopull(EXYNOS4_GPA0(0), 4, S3C_GPIO_SFN(2));
669 /* Setup BT Reset, this gpio will be requesed by rfkill-gpio */
670 s3c_gpio_cfgpin(EXYNOS4_GPX2(2), S3C_GPIO_OUTPUT);
671 s3c_gpio_setpull(EXYNOS4_GPX2(2), S3C_GPIO_PULL_NONE);
672}
673
639static void s5p_tv_setup(void) 674static void s5p_tv_setup(void)
640{ 675{
641 /* Direct HPD to HDMI chip */ 676 /* Direct HPD to HDMI chip */
@@ -689,6 +724,8 @@ static void __init origen_machine_init(void)
689 platform_add_devices(origen_devices, ARRAY_SIZE(origen_devices)); 724 platform_add_devices(origen_devices, ARRAY_SIZE(origen_devices));
690 725
691 samsung_bl_set(&origen_bl_gpio_info, &origen_bl_data); 726 samsung_bl_set(&origen_bl_gpio_info, &origen_bl_data);
727
728 origen_bt_setup();
692} 729}
693 730
694MACHINE_START(ORIGEN, "ORIGEN") 731MACHINE_START(ORIGEN, "ORIGEN")
diff --git a/arch/arm/mach-exynos/mach-smdkv310.c b/arch/arm/mach-exynos/mach-smdkv310.c
index 5258b8563676..83b91fa777c1 100644
--- a/arch/arm/mach-exynos/mach-smdkv310.c
+++ b/arch/arm/mach-exynos/mach-smdkv310.c
@@ -270,6 +270,9 @@ static struct platform_device *smdkv310_devices[] __initdata = {
270 &s5p_device_fimc1, 270 &s5p_device_fimc1,
271 &s5p_device_fimc2, 271 &s5p_device_fimc2,
272 &s5p_device_fimc3, 272 &s5p_device_fimc3,
273 &s5p_device_fimc_md,
274 &s5p_device_g2d,
275 &s5p_device_jpeg,
273 &exynos4_device_ac97, 276 &exynos4_device_ac97,
274 &exynos4_device_i2s0, 277 &exynos4_device_i2s0,
275 &exynos4_device_ohci, 278 &exynos4_device_ohci,
diff --git a/arch/arm/mach-exynos/mach-universal_c210.c b/arch/arm/mach-exynos/mach-universal_c210.c
index 4850700798d0..0b944eb66ebd 100644
--- a/arch/arm/mach-exynos/mach-universal_c210.c
+++ b/arch/arm/mach-exynos/mach-universal_c210.c
@@ -47,6 +47,7 @@
47#include <media/v4l2-mediabus.h> 47#include <media/v4l2-mediabus.h>
48#include <media/s5p_fimc.h> 48#include <media/s5p_fimc.h>
49#include <media/m5mols.h> 49#include <media/m5mols.h>
50#include <media/s5k6aa.h>
50 51
51#include "common.h" 52#include "common.h"
52 53
@@ -123,8 +124,10 @@ static struct regulator_consumer_supply lp3974_buck1_consumer =
123static struct regulator_consumer_supply lp3974_buck2_consumer = 124static struct regulator_consumer_supply lp3974_buck2_consumer =
124 REGULATOR_SUPPLY("vddg3d", NULL); 125 REGULATOR_SUPPLY("vddg3d", NULL);
125 126
126static struct regulator_consumer_supply lp3974_buck3_consumer = 127static struct regulator_consumer_supply lp3974_buck3_consumer[] = {
127 REGULATOR_SUPPLY("vdet", "s5p-sdo"); 128 REGULATOR_SUPPLY("vdet", "s5p-sdo"),
129 REGULATOR_SUPPLY("vdd_reg", "0-003c"),
130};
128 131
129static struct regulator_init_data lp3974_buck1_data = { 132static struct regulator_init_data lp3974_buck1_data = {
130 .constraints = { 133 .constraints = {
@@ -169,8 +172,8 @@ static struct regulator_init_data lp3974_buck3_data = {
169 .enabled = 1, 172 .enabled = 1,
170 }, 173 },
171 }, 174 },
172 .num_consumer_supplies = 1, 175 .num_consumer_supplies = ARRAY_SIZE(lp3974_buck3_consumer),
173 .consumer_supplies = &lp3974_buck3_consumer, 176 .consumer_supplies = lp3974_buck3_consumer,
174}; 177};
175 178
176static struct regulator_init_data lp3974_buck4_data = { 179static struct regulator_init_data lp3974_buck4_data = {
@@ -303,6 +306,9 @@ static struct regulator_init_data lp3974_ldo8_data = {
303 .consumer_supplies = lp3974_ldo8_consumer, 306 .consumer_supplies = lp3974_ldo8_consumer,
304}; 307};
305 308
309static struct regulator_consumer_supply lp3974_ldo9_consumer =
310 REGULATOR_SUPPLY("vddio", "0-003c");
311
306static struct regulator_init_data lp3974_ldo9_data = { 312static struct regulator_init_data lp3974_ldo9_data = {
307 .constraints = { 313 .constraints = {
308 .name = "VCC_2.8V", 314 .name = "VCC_2.8V",
@@ -314,6 +320,8 @@ static struct regulator_init_data lp3974_ldo9_data = {
314 .enabled = 1, 320 .enabled = 1,
315 }, 321 },
316 }, 322 },
323 .num_consumer_supplies = 1,
324 .consumer_supplies = &lp3974_ldo9_consumer,
317}; 325};
318 326
319static struct regulator_init_data lp3974_ldo10_data = { 327static struct regulator_init_data lp3974_ldo10_data = {
@@ -412,6 +420,7 @@ static struct regulator_init_data lp3974_ldo15_data = {
412}; 420};
413 421
414static struct regulator_consumer_supply lp3974_ldo16_consumer[] = { 422static struct regulator_consumer_supply lp3974_ldo16_consumer[] = {
423 REGULATOR_SUPPLY("vdda", "0-003c"),
415 REGULATOR_SUPPLY("a_sensor", "0-001f"), 424 REGULATOR_SUPPLY("a_sensor", "0-001f"),
416}; 425};
417 426
@@ -819,6 +828,8 @@ static struct s3c_fb_pd_win universal_fb_win0 = {
819 }, 828 },
820 .max_bpp = 32, 829 .max_bpp = 32,
821 .default_bpp = 16, 830 .default_bpp = 16,
831 .virtual_x = 480,
832 .virtual_y = 2 * 800,
822}; 833};
823 834
824static struct s3c_fb_platdata universal_lcd_pdata __initdata = { 835static struct s3c_fb_platdata universal_lcd_pdata __initdata = {
@@ -830,6 +841,28 @@ static struct s3c_fb_platdata universal_lcd_pdata __initdata = {
830 .setup_gpio = exynos4_fimd0_gpio_setup_24bpp, 841 .setup_gpio = exynos4_fimd0_gpio_setup_24bpp,
831}; 842};
832 843
844static struct regulator_consumer_supply cam_vt_dio_supply =
845 REGULATOR_SUPPLY("vdd_core", "0-003c");
846
847static struct regulator_init_data cam_vt_dio_reg_init_data = {
848 .constraints = { .valid_ops_mask = REGULATOR_CHANGE_STATUS },
849 .num_consumer_supplies = 1,
850 .consumer_supplies = &cam_vt_dio_supply,
851};
852
853static struct fixed_voltage_config cam_vt_dio_fixed_voltage_cfg = {
854 .supply_name = "CAM_VT_D_IO",
855 .microvolts = 2800000,
856 .gpio = EXYNOS4_GPE2(1), /* CAM_PWR_EN2 */
857 .enable_high = 1,
858 .init_data = &cam_vt_dio_reg_init_data,
859};
860
861static struct platform_device cam_vt_dio_fixed_reg_dev = {
862 .name = "reg-fixed-voltage", .id = FIXED_REG_ID_CAM_VT_DIO,
863 .dev = { .platform_data = &cam_vt_dio_fixed_voltage_cfg },
864};
865
833static struct regulator_consumer_supply cam_i_core_supply = 866static struct regulator_consumer_supply cam_i_core_supply =
834 REGULATOR_SUPPLY("core", "0-001f"); 867 REGULATOR_SUPPLY("core", "0-001f");
835 868
@@ -885,6 +918,28 @@ static struct s5p_platform_mipi_csis mipi_csis_platdata = {
885#define GPIO_CAM_LEVEL_EN(n) EXYNOS4_GPE4(n + 3) 918#define GPIO_CAM_LEVEL_EN(n) EXYNOS4_GPE4(n + 3)
886#define GPIO_CAM_8M_ISP_INT EXYNOS4_GPX1(5) /* XEINT_13 */ 919#define GPIO_CAM_8M_ISP_INT EXYNOS4_GPX1(5) /* XEINT_13 */
887#define GPIO_CAM_MEGA_nRST EXYNOS4_GPE2(5) 920#define GPIO_CAM_MEGA_nRST EXYNOS4_GPE2(5)
921#define GPIO_CAM_VGA_NRST EXYNOS4_GPE4(7)
922#define GPIO_CAM_VGA_NSTBY EXYNOS4_GPE4(6)
923
924static int s5k6aa_set_power(int on)
925{
926 gpio_set_value(GPIO_CAM_LEVEL_EN(2), !!on);
927 return 0;
928}
929
930static struct s5k6aa_platform_data s5k6aa_platdata = {
931 .mclk_frequency = 21600000UL,
932 .gpio_reset = { GPIO_CAM_VGA_NRST, 0 },
933 .gpio_stby = { GPIO_CAM_VGA_NSTBY, 0 },
934 .bus_type = V4L2_MBUS_PARALLEL,
935 .horiz_flip = 1,
936 .set_power = s5k6aa_set_power,
937};
938
939static struct i2c_board_info s5k6aa_board_info = {
940 I2C_BOARD_INFO("S5K6AA", 0x3C),
941 .platform_data = &s5k6aa_platdata,
942};
888 943
889static int m5mols_set_power(struct device *dev, int on) 944static int m5mols_set_power(struct device *dev, int on)
890{ 945{
@@ -909,6 +964,14 @@ static struct s5p_fimc_isp_info universal_camera_sensors[] = {
909 .mux_id = 0, 964 .mux_id = 0,
910 .flags = V4L2_MBUS_PCLK_SAMPLE_FALLING | 965 .flags = V4L2_MBUS_PCLK_SAMPLE_FALLING |
911 V4L2_MBUS_VSYNC_ACTIVE_LOW, 966 V4L2_MBUS_VSYNC_ACTIVE_LOW,
967 .bus_type = FIMC_ITU_601,
968 .board_info = &s5k6aa_board_info,
969 .i2c_bus_num = 0,
970 .clk_frequency = 24000000UL,
971 }, {
972 .mux_id = 0,
973 .flags = V4L2_MBUS_PCLK_SAMPLE_FALLING |
974 V4L2_MBUS_VSYNC_ACTIVE_LOW,
912 .bus_type = FIMC_MIPI_CSI2, 975 .bus_type = FIMC_MIPI_CSI2,
913 .board_info = &m5mols_board_info, 976 .board_info = &m5mols_board_info,
914 .i2c_bus_num = 0, 977 .i2c_bus_num = 0,
@@ -927,9 +990,11 @@ static struct gpio universal_camera_gpios[] = {
927 { GPIO_CAM_LEVEL_EN(2), GPIOF_OUT_INIT_LOW, "CAM_LVL_EN2" }, 990 { GPIO_CAM_LEVEL_EN(2), GPIOF_OUT_INIT_LOW, "CAM_LVL_EN2" },
928 { GPIO_CAM_8M_ISP_INT, GPIOF_IN, "8M_ISP_INT" }, 991 { GPIO_CAM_8M_ISP_INT, GPIOF_IN, "8M_ISP_INT" },
929 { GPIO_CAM_MEGA_nRST, GPIOF_OUT_INIT_LOW, "CAM_8M_NRST" }, 992 { GPIO_CAM_MEGA_nRST, GPIOF_OUT_INIT_LOW, "CAM_8M_NRST" },
993 { GPIO_CAM_VGA_NRST, GPIOF_OUT_INIT_LOW, "CAM_VGA_NRST" },
994 { GPIO_CAM_VGA_NSTBY, GPIOF_OUT_INIT_LOW, "CAM_VGA_NSTBY" },
930}; 995};
931 996
932static void universal_camera_init(void) 997static void __init universal_camera_init(void)
933{ 998{
934 s3c_set_platdata(&mipi_csis_platdata, sizeof(mipi_csis_platdata), 999 s3c_set_platdata(&mipi_csis_platdata, sizeof(mipi_csis_platdata),
935 &s5p_device_mipi_csis0); 1000 &s5p_device_mipi_csis0);
@@ -950,6 +1015,8 @@ static void universal_camera_init(void)
950 /* Free GPIOs controlled directly by the sensor drivers. */ 1015 /* Free GPIOs controlled directly by the sensor drivers. */
951 gpio_free(GPIO_CAM_MEGA_nRST); 1016 gpio_free(GPIO_CAM_MEGA_nRST);
952 gpio_free(GPIO_CAM_8M_ISP_INT); 1017 gpio_free(GPIO_CAM_8M_ISP_INT);
1018 gpio_free(GPIO_CAM_VGA_NRST);
1019 gpio_free(GPIO_CAM_VGA_NSTBY);
953 1020
954 if (exynos4_fimc_setup_gpio(S5P_CAMPORT_A)) 1021 if (exynos4_fimc_setup_gpio(S5P_CAMPORT_A))
955 pr_err("Camera port A setup failed\n"); 1022 pr_err("Camera port A setup failed\n");
@@ -962,6 +1029,7 @@ static struct platform_device *universal_devices[] __initdata = {
962 &s5p_device_fimc1, 1029 &s5p_device_fimc1,
963 &s5p_device_fimc2, 1030 &s5p_device_fimc2,
964 &s5p_device_fimc3, 1031 &s5p_device_fimc3,
1032 &s5p_device_g2d,
965 &mmc0_fixed_voltage, 1033 &mmc0_fixed_voltage,
966 &s3c_device_hsmmc0, 1034 &s3c_device_hsmmc0,
967 &s3c_device_hsmmc2, 1035 &s3c_device_hsmmc2,
@@ -980,9 +1048,11 @@ static struct platform_device *universal_devices[] __initdata = {
980 &universal_gpio_keys, 1048 &universal_gpio_keys,
981 &s5p_device_onenand, 1049 &s5p_device_onenand,
982 &s5p_device_fimd0, 1050 &s5p_device_fimd0,
1051 &s5p_device_jpeg,
983 &s5p_device_mfc, 1052 &s5p_device_mfc,
984 &s5p_device_mfc_l, 1053 &s5p_device_mfc_l,
985 &s5p_device_mfc_r, 1054 &s5p_device_mfc_r,
1055 &cam_vt_dio_fixed_reg_dev,
986 &cam_i_core_fixed_reg_dev, 1056 &cam_i_core_fixed_reg_dev,
987 &cam_s_if_fixed_reg_dev, 1057 &cam_s_if_fixed_reg_dev,
988 &s5p_device_fimc_md, 1058 &s5p_device_fimc_md,
diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
index 3919fba52ac8..37a5d715a6c2 100644
--- a/arch/arm/mach-imx/Kconfig
+++ b/arch/arm/mach-imx/Kconfig
@@ -314,8 +314,10 @@ config MACH_IMX27_VISSTRIM_M10
314 select IMX_HAVE_PLATFORM_IMX_I2C 314 select IMX_HAVE_PLATFORM_IMX_I2C
315 select IMX_HAVE_PLATFORM_IMX_SSI 315 select IMX_HAVE_PLATFORM_IMX_SSI
316 select IMX_HAVE_PLATFORM_IMX_UART 316 select IMX_HAVE_PLATFORM_IMX_UART
317 select IMX_HAVE_PLATFORM_MXC_MMC 317 select IMX_HAVE_PLATFORM_MX2_CAMERA
318 select IMX_HAVE_PLATFORM_MXC_EHCI 318 select IMX_HAVE_PLATFORM_MXC_EHCI
319 select IMX_HAVE_PLATFORM_MXC_MMC
320 select LEDS_GPIO_REGISTER
319 help 321 help
320 Include support for Visstrim_m10 platform and its different variants. 322 Include support for Visstrim_m10 platform and its different variants.
321 This includes specific configurations for the board and its 323 This includes specific configurations for the board and its
@@ -486,6 +488,7 @@ config MACH_MX31MOBOARD
486 bool "Support mx31moboard platforms (EPFL Mobots group)" 488 bool "Support mx31moboard platforms (EPFL Mobots group)"
487 select SOC_IMX31 489 select SOC_IMX31
488 select IMX_HAVE_PLATFORM_FSL_USB2_UDC 490 select IMX_HAVE_PLATFORM_FSL_USB2_UDC
491 select IMX_HAVE_PLATFORM_IMX2_WDT
489 select IMX_HAVE_PLATFORM_IMX_I2C 492 select IMX_HAVE_PLATFORM_IMX_I2C
490 select IMX_HAVE_PLATFORM_IMX_UART 493 select IMX_HAVE_PLATFORM_IMX_UART
491 select IMX_HAVE_PLATFORM_IPU_CORE 494 select IMX_HAVE_PLATFORM_IPU_CORE
diff --git a/arch/arm/mach-imx/mach-imx27_visstrim_m10.c b/arch/arm/mach-imx/mach-imx27_visstrim_m10.c
index 428459fbca4b..f7b074f496f0 100644
--- a/arch/arm/mach-imx/mach-imx27_visstrim_m10.c
+++ b/arch/arm/mach-imx/mach-imx27_visstrim_m10.c
@@ -30,6 +30,10 @@
30#include <linux/input.h> 30#include <linux/input.h>
31#include <linux/gpio.h> 31#include <linux/gpio.h>
32#include <linux/delay.h> 32#include <linux/delay.h>
33#include <linux/dma-mapping.h>
34#include <linux/leds.h>
35#include <linux/memblock.h>
36#include <media/soc_camera.h>
33#include <sound/tlv320aic32x4.h> 37#include <sound/tlv320aic32x4.h>
34#include <asm/mach-types.h> 38#include <asm/mach-types.h>
35#include <asm/mach/arch.h> 39#include <asm/mach/arch.h>
@@ -39,6 +43,8 @@
39 43
40#include "devices-imx27.h" 44#include "devices-imx27.h"
41 45
46#define TVP5150_RSTN (GPIO_PORTC + 18)
47#define TVP5150_PWDN (GPIO_PORTC + 19)
42#define OTG_PHY_CS_GPIO (GPIO_PORTF + 17) 48#define OTG_PHY_CS_GPIO (GPIO_PORTF + 17)
43#define SDHC1_IRQ IRQ_GPIOB(25) 49#define SDHC1_IRQ IRQ_GPIOB(25)
44 50
@@ -100,8 +106,99 @@ static const int visstrim_m10_pins[] __initconst = {
100 PE1_PF_USBOTG_STP, 106 PE1_PF_USBOTG_STP,
101 PB23_PF_USB_PWR, 107 PB23_PF_USB_PWR,
102 PB24_PF_USB_OC, 108 PB24_PF_USB_OC,
109 /* CSI */
110 PB10_PF_CSI_D0,
111 PB11_PF_CSI_D1,
112 PB12_PF_CSI_D2,
113 PB13_PF_CSI_D3,
114 PB14_PF_CSI_D4,
115 PB15_PF_CSI_MCLK,
116 PB16_PF_CSI_PIXCLK,
117 PB17_PF_CSI_D5,
118 PB18_PF_CSI_D6,
119 PB19_PF_CSI_D7,
120 PB20_PF_CSI_VSYNC,
121 PB21_PF_CSI_HSYNC,
103}; 122};
104 123
124/* Camera */
125static int visstrim_camera_power(struct device *dev, int on)
126{
127 gpio_set_value(TVP5150_PWDN, on);
128
129 return 0;
130};
131
132static int visstrim_camera_reset(struct device *dev)
133{
134 gpio_set_value(TVP5150_RSTN, 0);
135 ndelay(500);
136 gpio_set_value(TVP5150_RSTN, 1);
137
138 return 0;
139};
140
141static struct i2c_board_info visstrim_i2c_camera = {
142 I2C_BOARD_INFO("tvp5150", 0x5d),
143};
144
145static struct soc_camera_link iclink_tvp5150 = {
146 .bus_id = 0,
147 .board_info = &visstrim_i2c_camera,
148 .i2c_adapter_id = 0,
149 .power = visstrim_camera_power,
150 .reset = visstrim_camera_reset,
151};
152
153static struct mx2_camera_platform_data visstrim_camera = {
154 .flags = MX2_CAMERA_CCIR | MX2_CAMERA_CCIR_INTERLACE |
155 MX2_CAMERA_SWAP16 | MX2_CAMERA_PCLK_SAMPLE_RISING,
156 .clk = 100000,
157};
158
159static phys_addr_t mx2_camera_base __initdata;
160#define MX2_CAMERA_BUF_SIZE SZ_8M
161
162static void __init visstrim_camera_init(void)
163{
164 struct platform_device *pdev;
165 int dma;
166
167 /* Initialize tvp5150 gpios */
168 mxc_gpio_mode(TVP5150_RSTN | GPIO_GPIO | GPIO_OUT);
169 mxc_gpio_mode(TVP5150_PWDN | GPIO_GPIO | GPIO_OUT);
170 gpio_set_value(TVP5150_RSTN, 1);
171 gpio_set_value(TVP5150_PWDN, 0);
172 ndelay(1);
173
174 gpio_set_value(TVP5150_PWDN, 1);
175 ndelay(1);
176 gpio_set_value(TVP5150_RSTN, 0);
177 ndelay(500);
178 gpio_set_value(TVP5150_RSTN, 1);
179 ndelay(200000);
180
181 pdev = imx27_add_mx2_camera(&visstrim_camera);
182 if (IS_ERR(pdev))
183 return;
184
185 dma = dma_declare_coherent_memory(&pdev->dev,
186 mx2_camera_base, mx2_camera_base,
187 MX2_CAMERA_BUF_SIZE,
188 DMA_MEMORY_MAP | DMA_MEMORY_EXCLUSIVE);
189 if (!(dma & DMA_MEMORY_MAP))
190 return;
191}
192
193static void __init visstrim_reserve(void)
194{
195 /* reserve 4 MiB for mx2-camera */
196 mx2_camera_base = memblock_alloc(MX2_CAMERA_BUF_SIZE,
197 MX2_CAMERA_BUF_SIZE);
198 memblock_free(mx2_camera_base, MX2_CAMERA_BUF_SIZE);
199 memblock_remove(mx2_camera_base, MX2_CAMERA_BUF_SIZE);
200}
201
105/* GPIOs used as events for applications */ 202/* GPIOs used as events for applications */
106static struct gpio_keys_button visstrim_gpio_keys[] = { 203static struct gpio_keys_button visstrim_gpio_keys[] = {
107 { 204 {
@@ -136,6 +233,35 @@ static const struct gpio_keys_platform_data
136 .nbuttons = ARRAY_SIZE(visstrim_gpio_keys), 233 .nbuttons = ARRAY_SIZE(visstrim_gpio_keys),
137}; 234};
138 235
236/* led */
237static const struct gpio_led visstrim_m10_leds[] __initconst = {
238 {
239 .name = "visstrim:ld0",
240 .default_trigger = "nand-disk",
241 .gpio = (GPIO_PORTC + 29),
242 },
243 {
244 .name = "visstrim:ld1",
245 .default_trigger = "nand-disk",
246 .gpio = (GPIO_PORTC + 24),
247 },
248 {
249 .name = "visstrim:ld2",
250 .default_trigger = "nand-disk",
251 .gpio = (GPIO_PORTC + 28),
252 },
253 {
254 .name = "visstrim:ld3",
255 .default_trigger = "nand-disk",
256 .gpio = (GPIO_PORTC + 25),
257 },
258};
259
260static const struct gpio_led_platform_data visstrim_m10_led_data __initconst = {
261 .leds = visstrim_m10_leds,
262 .num_leds = ARRAY_SIZE(visstrim_m10_leds),
263};
264
139/* Visstrim_SM10 has a microSD slot connected to sdhc1 */ 265/* Visstrim_SM10 has a microSD slot connected to sdhc1 */
140static int visstrim_m10_sdhc1_init(struct device *dev, 266static int visstrim_m10_sdhc1_init(struct device *dev,
141 irq_handler_t detect_irq, void *data) 267 irq_handler_t detect_irq, void *data)
@@ -216,6 +342,9 @@ static struct i2c_board_info visstrim_m10_i2c_devices[] = {
216 { 342 {
217 I2C_BOARD_INFO("tlv320aic32x4", 0x18), 343 I2C_BOARD_INFO("tlv320aic32x4", 0x18),
218 .platform_data = &visstrim_m10_aic32x4_pdata, 344 .platform_data = &visstrim_m10_aic32x4_pdata,
345 },
346 {
347 I2C_BOARD_INFO("m41t00", 0x68),
219 } 348 }
220}; 349};
221 350
@@ -254,16 +383,21 @@ static void __init visstrim_m10_board_init(void)
254 imx27_add_imx_ssi(0, &visstrim_m10_ssi_pdata); 383 imx27_add_imx_ssi(0, &visstrim_m10_ssi_pdata);
255 imx27_add_imx_uart0(&uart_pdata); 384 imx27_add_imx_uart0(&uart_pdata);
256 385
257 i2c_register_board_info(0, visstrim_m10_i2c_devices,
258 ARRAY_SIZE(visstrim_m10_i2c_devices));
259 imx27_add_imx_i2c(0, &visstrim_m10_i2c_data); 386 imx27_add_imx_i2c(0, &visstrim_m10_i2c_data);
260 imx27_add_imx_i2c(1, &visstrim_m10_i2c_data); 387 imx27_add_imx_i2c(1, &visstrim_m10_i2c_data);
388 i2c_register_board_info(0, visstrim_m10_i2c_devices,
389 ARRAY_SIZE(visstrim_m10_i2c_devices));
390
261 imx27_add_mxc_mmc(0, &visstrim_m10_sdhc_pdata); 391 imx27_add_mxc_mmc(0, &visstrim_m10_sdhc_pdata);
262 imx27_add_mxc_ehci_otg(&visstrim_m10_usbotg_pdata); 392 imx27_add_mxc_ehci_otg(&visstrim_m10_usbotg_pdata);
263 imx27_add_fec(NULL); 393 imx27_add_fec(NULL);
264 imx_add_gpio_keys(&visstrim_gpio_keys_platform_data); 394 imx_add_gpio_keys(&visstrim_gpio_keys_platform_data);
265 platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); 395 platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
266 imx_add_platform_device("mx27vis", 0, NULL, 0, NULL, 0); 396 imx_add_platform_device("mx27vis", 0, NULL, 0, NULL, 0);
397 platform_device_register_resndata(NULL, "soc-camera-pdrv", 0, NULL, 0,
398 &iclink_tvp5150, sizeof(iclink_tvp5150));
399 gpio_led_register_device(0, &visstrim_m10_led_data);
400 visstrim_camera_init();
267} 401}
268 402
269static void __init visstrim_m10_timer_init(void) 403static void __init visstrim_m10_timer_init(void)
@@ -277,6 +411,7 @@ static struct sys_timer visstrim_m10_timer = {
277 411
278MACHINE_START(IMX27_VISSTRIM_M10, "Vista Silicon Visstrim_M10") 412MACHINE_START(IMX27_VISSTRIM_M10, "Vista Silicon Visstrim_M10")
279 .atag_offset = 0x100, 413 .atag_offset = 0x100,
414 .reserve = visstrim_reserve,
280 .map_io = mx27_map_io, 415 .map_io = mx27_map_io,
281 .init_early = imx27_init_early, 416 .init_early = imx27_init_early,
282 .init_irq = mx27_init_irq, 417 .init_irq = mx27_init_irq,
diff --git a/arch/arm/mach-imx/mach-mx31moboard.c b/arch/arm/mach-imx/mach-mx31moboard.c
index f225262b5c38..c0511fb1a5f9 100644
--- a/arch/arm/mach-imx/mach-mx31moboard.c
+++ b/arch/arm/mach-imx/mach-mx31moboard.c
@@ -530,6 +530,8 @@ static void __init mx31moboard_init(void)
530 platform_add_devices(devices, ARRAY_SIZE(devices)); 530 platform_add_devices(devices, ARRAY_SIZE(devices));
531 gpio_led_register_device(-1, &mx31moboard_led_pdata); 531 gpio_led_register_device(-1, &mx31moboard_led_pdata);
532 532
533 imx31_add_imx2_wdt(NULL);
534
533 imx31_add_imx_uart0(&uart0_pdata); 535 imx31_add_imx_uart0(&uart0_pdata);
534 imx31_add_imx_uart4(&uart4_pdata); 536 imx31_add_imx_uart4(&uart4_pdata);
535 537
@@ -590,7 +592,7 @@ static void __init mx31moboard_reserve(void)
590} 592}
591 593
592MACHINE_START(MX31MOBOARD, "EPFL Mobots mx31moboard") 594MACHINE_START(MX31MOBOARD, "EPFL Mobots mx31moboard")
593 /* Maintainer: Valentin Longchamp, EPFL Mobots group */ 595 /* Maintainer: Philippe Retornaz, EPFL Mobots group */
594 .atag_offset = 0x100, 596 .atag_offset = 0x100,
595 .reserve = mx31moboard_reserve, 597 .reserve = mx31moboard_reserve,
596 .map_io = mx31_map_io, 598 .map_io = mx31_map_io,
diff --git a/arch/arm/mach-imx/mach-mx35_3ds.c b/arch/arm/mach-imx/mach-mx35_3ds.c
index 0af6c9c5b3fd..e14291d89e4f 100644
--- a/arch/arm/mach-imx/mach-mx35_3ds.c
+++ b/arch/arm/mach-imx/mach-mx35_3ds.c
@@ -4,6 +4,11 @@
4 * 4 *
5 * Author: Fabio Estevam <fabio.estevam@freescale.com> 5 * Author: Fabio Estevam <fabio.estevam@freescale.com>
6 * 6 *
7 * Copyright (C) 2011 Meprolight, Ltd.
8 * Alex Gershgorin <alexg@meprolight.com>
9 *
10 * Modified from i.MX31 3-Stack Development System
11 *
7 * This program is free software; you can redistribute it and/or modify 12 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 13 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or 14 * the Free Software Foundation; either version 2 of the License, or
@@ -34,15 +39,102 @@
34#include <asm/mach/arch.h> 39#include <asm/mach/arch.h>
35#include <asm/mach/time.h> 40#include <asm/mach/time.h>
36#include <asm/mach/map.h> 41#include <asm/mach/map.h>
42#include <asm/memblock.h>
37 43
38#include <mach/hardware.h> 44#include <mach/hardware.h>
39#include <mach/common.h> 45#include <mach/common.h>
40#include <mach/iomux-mx35.h> 46#include <mach/iomux-mx35.h>
41#include <mach/irqs.h> 47#include <mach/irqs.h>
42#include <mach/3ds_debugboard.h> 48#include <mach/3ds_debugboard.h>
49#include <video/platform_lcd.h>
50
51#include <media/soc_camera.h>
43 52
44#include "devices-imx35.h" 53#include "devices-imx35.h"
45 54
55#define GPIO_MC9S08DZ60_GPS_ENABLE 0
56#define GPIO_MC9S08DZ60_HDD_ENABLE 4
57#define GPIO_MC9S08DZ60_WIFI_ENABLE 5
58#define GPIO_MC9S08DZ60_LCD_ENABLE 6
59#define GPIO_MC9S08DZ60_SPEAKER_ENABLE 8
60
61static const struct fb_videomode fb_modedb[] = {
62 {
63 /* 800x480 @ 55 Hz */
64 .name = "Ceramate-CLAA070VC01",
65 .refresh = 55,
66 .xres = 800,
67 .yres = 480,
68 .pixclock = 40000,
69 .left_margin = 40,
70 .right_margin = 40,
71 .upper_margin = 5,
72 .lower_margin = 5,
73 .hsync_len = 20,
74 .vsync_len = 10,
75 .sync = FB_SYNC_OE_ACT_HIGH,
76 .vmode = FB_VMODE_NONINTERLACED,
77 .flag = 0,
78 },
79};
80
81static const struct ipu_platform_data mx3_ipu_data __initconst = {
82 .irq_base = MXC_IPU_IRQ_START,
83};
84
85static struct mx3fb_platform_data mx3fb_pdata __initdata = {
86 .name = "Ceramate-CLAA070VC01",
87 .mode = fb_modedb,
88 .num_modes = ARRAY_SIZE(fb_modedb),
89};
90
91static struct i2c_board_info __initdata i2c_devices_3ds[] = {
92 {
93 I2C_BOARD_INFO("mc9s08dz60", 0x69),
94 },
95};
96
97static int lcd_power_gpio = -ENXIO;
98
99static int mc9s08dz60_gpiochip_match(struct gpio_chip *chip,
100 void *data)
101{
102 return !strcmp(chip->label, data);
103}
104
105static void mx35_3ds_lcd_set_power(
106 struct plat_lcd_data *pd, unsigned int power)
107{
108 struct gpio_chip *chip;
109
110 if (!gpio_is_valid(lcd_power_gpio)) {
111 chip = gpiochip_find(
112 "mc9s08dz60", mc9s08dz60_gpiochip_match);
113 if (chip) {
114 lcd_power_gpio =
115 chip->base + GPIO_MC9S08DZ60_LCD_ENABLE;
116 if (gpio_request(lcd_power_gpio, "lcd_power") < 0) {
117 pr_err("error: gpio already requested!\n");
118 lcd_power_gpio = -ENXIO;
119 }
120 } else {
121 pr_err("error: didn't find mc9s08dz60 gpio chip\n");
122 }
123 }
124
125 if (gpio_is_valid(lcd_power_gpio))
126 gpio_set_value_cansleep(lcd_power_gpio, power);
127}
128
129static struct plat_lcd_data mx35_3ds_lcd_data = {
130 .set_power = mx35_3ds_lcd_set_power,
131};
132
133static struct platform_device mx35_3ds_lcd = {
134 .name = "platform-lcd",
135 .dev.platform_data = &mx35_3ds_lcd_data,
136};
137
46#define EXPIO_PARENT_INT gpio_to_irq(IMX_GPIO_NR(1, 1)) 138#define EXPIO_PARENT_INT gpio_to_irq(IMX_GPIO_NR(1, 1))
47 139
48static const struct imxuart_platform_data uart_pdata __initconst = { 140static const struct imxuart_platform_data uart_pdata __initconst = {
@@ -120,6 +212,109 @@ static iomux_v3_cfg_t mx35pdk_pads[] = {
120 /* I2C1 */ 212 /* I2C1 */
121 MX35_PAD_I2C1_CLK__I2C1_SCL, 213 MX35_PAD_I2C1_CLK__I2C1_SCL,
122 MX35_PAD_I2C1_DAT__I2C1_SDA, 214 MX35_PAD_I2C1_DAT__I2C1_SDA,
215 /* Display */
216 MX35_PAD_LD0__IPU_DISPB_DAT_0,
217 MX35_PAD_LD1__IPU_DISPB_DAT_1,
218 MX35_PAD_LD2__IPU_DISPB_DAT_2,
219 MX35_PAD_LD3__IPU_DISPB_DAT_3,
220 MX35_PAD_LD4__IPU_DISPB_DAT_4,
221 MX35_PAD_LD5__IPU_DISPB_DAT_5,
222 MX35_PAD_LD6__IPU_DISPB_DAT_6,
223 MX35_PAD_LD7__IPU_DISPB_DAT_7,
224 MX35_PAD_LD8__IPU_DISPB_DAT_8,
225 MX35_PAD_LD9__IPU_DISPB_DAT_9,
226 MX35_PAD_LD10__IPU_DISPB_DAT_10,
227 MX35_PAD_LD11__IPU_DISPB_DAT_11,
228 MX35_PAD_LD12__IPU_DISPB_DAT_12,
229 MX35_PAD_LD13__IPU_DISPB_DAT_13,
230 MX35_PAD_LD14__IPU_DISPB_DAT_14,
231 MX35_PAD_LD15__IPU_DISPB_DAT_15,
232 MX35_PAD_LD16__IPU_DISPB_DAT_16,
233 MX35_PAD_LD17__IPU_DISPB_DAT_17,
234 MX35_PAD_D3_HSYNC__IPU_DISPB_D3_HSYNC,
235 MX35_PAD_D3_FPSHIFT__IPU_DISPB_D3_CLK,
236 MX35_PAD_D3_DRDY__IPU_DISPB_D3_DRDY,
237 MX35_PAD_CONTRAST__IPU_DISPB_CONTR,
238 MX35_PAD_D3_VSYNC__IPU_DISPB_D3_VSYNC,
239 MX35_PAD_D3_REV__IPU_DISPB_D3_REV,
240 MX35_PAD_D3_CLS__IPU_DISPB_D3_CLS,
241 /* CSI */
242 MX35_PAD_TX1__IPU_CSI_D_6,
243 MX35_PAD_TX0__IPU_CSI_D_7,
244 MX35_PAD_CSI_D8__IPU_CSI_D_8,
245 MX35_PAD_CSI_D9__IPU_CSI_D_9,
246 MX35_PAD_CSI_D10__IPU_CSI_D_10,
247 MX35_PAD_CSI_D11__IPU_CSI_D_11,
248 MX35_PAD_CSI_D12__IPU_CSI_D_12,
249 MX35_PAD_CSI_D13__IPU_CSI_D_13,
250 MX35_PAD_CSI_D14__IPU_CSI_D_14,
251 MX35_PAD_CSI_D15__IPU_CSI_D_15,
252 MX35_PAD_CSI_HSYNC__IPU_CSI_HSYNC,
253 MX35_PAD_CSI_MCLK__IPU_CSI_MCLK,
254 MX35_PAD_CSI_PIXCLK__IPU_CSI_PIXCLK,
255 MX35_PAD_CSI_VSYNC__IPU_CSI_VSYNC,
256};
257
258/*
259 * Camera support
260*/
261static phys_addr_t mx3_camera_base __initdata;
262#define MX35_3DS_CAMERA_BUF_SIZE SZ_8M
263
264static const struct mx3_camera_pdata mx35_3ds_camera_pdata __initconst = {
265 .flags = MX3_CAMERA_DATAWIDTH_8,
266 .mclk_10khz = 2000,
267};
268
269static int __init imx35_3ds_init_camera(void)
270{
271 int dma, ret = -ENOMEM;
272 struct platform_device *pdev =
273 imx35_alloc_mx3_camera(&mx35_3ds_camera_pdata);
274
275 if (IS_ERR(pdev))
276 return PTR_ERR(pdev);
277
278 if (!mx3_camera_base)
279 goto err;
280
281 dma = dma_declare_coherent_memory(&pdev->dev,
282 mx3_camera_base, mx3_camera_base,
283 MX35_3DS_CAMERA_BUF_SIZE,
284 DMA_MEMORY_MAP | DMA_MEMORY_EXCLUSIVE);
285
286 if (!(dma & DMA_MEMORY_MAP))
287 goto err;
288
289 ret = platform_device_add(pdev);
290 if (ret)
291err:
292 platform_device_put(pdev);
293
294 return ret;
295}
296
297static const struct ipu_platform_data mx35_3ds_ipu_data __initconst = {
298 .irq_base = MXC_IPU_IRQ_START,
299};
300
301static struct i2c_board_info mx35_3ds_i2c_camera = {
302 I2C_BOARD_INFO("ov2640", 0x30),
303};
304
305static struct soc_camera_link iclink_ov2640 = {
306 .bus_id = 0,
307 .board_info = &mx35_3ds_i2c_camera,
308 .i2c_adapter_id = 0,
309 .power = NULL,
310};
311
312static struct platform_device mx35_3ds_ov2640 = {
313 .name = "soc-camera-pdrv",
314 .id = 0,
315 .dev = {
316 .platform_data = &iclink_ov2640,
317 },
123}; 318};
124 319
125static int mx35_3ds_otg_init(struct platform_device *pdev) 320static int mx35_3ds_otg_init(struct platform_device *pdev)
@@ -179,6 +374,8 @@ static const struct imxi2c_platform_data mx35_3ds_i2c0_data __initconst = {
179 */ 374 */
180static void __init mx35_3ds_init(void) 375static void __init mx35_3ds_init(void)
181{ 376{
377 struct platform_device *imx35_fb_pdev;
378
182 imx35_soc_init(); 379 imx35_soc_init();
183 380
184 mxc_iomux_v3_setup_multiple_pads(mx35pdk_pads, ARRAY_SIZE(mx35pdk_pads)); 381 mxc_iomux_v3_setup_multiple_pads(mx35pdk_pads, ARRAY_SIZE(mx35pdk_pads));
@@ -204,6 +401,17 @@ static void __init mx35_3ds_init(void)
204 pr_warn("Init of the debugboard failed, all " 401 pr_warn("Init of the debugboard failed, all "
205 "devices on the debugboard are unusable.\n"); 402 "devices on the debugboard are unusable.\n");
206 imx35_add_imx_i2c0(&mx35_3ds_i2c0_data); 403 imx35_add_imx_i2c0(&mx35_3ds_i2c0_data);
404
405 i2c_register_board_info(
406 0, i2c_devices_3ds, ARRAY_SIZE(i2c_devices_3ds));
407
408 imx35_add_ipu_core(&mx35_3ds_ipu_data);
409 platform_device_register(&mx35_3ds_ov2640);
410 imx35_3ds_init_camera();
411
412 imx35_fb_pdev = imx35_add_mx3_sdc_fb(&mx3fb_pdata);
413 mx35_3ds_lcd.dev.parent = &imx35_fb_pdev->dev;
414 platform_device_register(&mx35_3ds_lcd);
207} 415}
208 416
209static void __init mx35pdk_timer_init(void) 417static void __init mx35pdk_timer_init(void)
@@ -215,6 +423,13 @@ struct sys_timer mx35pdk_timer = {
215 .init = mx35pdk_timer_init, 423 .init = mx35pdk_timer_init,
216}; 424};
217 425
426static void __init mx35_3ds_reserve(void)
427{
428 /* reserve MX35_3DS_CAMERA_BUF_SIZE bytes for mx3-camera */
429 mx3_camera_base = arm_memblock_steal(MX35_3DS_CAMERA_BUF_SIZE,
430 MX35_3DS_CAMERA_BUF_SIZE);
431}
432
218MACHINE_START(MX35_3DS, "Freescale MX35PDK") 433MACHINE_START(MX35_3DS, "Freescale MX35PDK")
219 /* Maintainer: Freescale Semiconductor, Inc */ 434 /* Maintainer: Freescale Semiconductor, Inc */
220 .atag_offset = 0x100, 435 .atag_offset = 0x100,
@@ -224,5 +439,6 @@ MACHINE_START(MX35_3DS, "Freescale MX35PDK")
224 .handle_irq = imx35_handle_irq, 439 .handle_irq = imx35_handle_irq,
225 .timer = &mx35pdk_timer, 440 .timer = &mx35pdk_timer,
226 .init_machine = mx35_3ds_init, 441 .init_machine = mx35_3ds_init,
442 .reserve = mx35_3ds_reserve,
227 .restart = mxc_restart, 443 .restart = mxc_restart,
228MACHINE_END 444MACHINE_END
diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
index 7fc603b46891..90ceab761929 100644
--- a/arch/arm/mach-kirkwood/Kconfig
+++ b/arch/arm/mach-kirkwood/Kconfig
@@ -44,6 +44,20 @@ config MACH_GURUPLUG
44 Say 'Y' here if you want your kernel to support the 44 Say 'Y' here if you want your kernel to support the
45 Marvell GuruPlug Reference Board. 45 Marvell GuruPlug Reference Board.
46 46
47config ARCH_KIRKWOOD_DT
48 bool "Marvell Kirkwood Flattened Device Tree"
49 select USE_OF
50 help
51 Say 'Y' here if you want your kernel to support the
52 Marvell Kirkwood using flattened device tree.
53
54config MACH_DREAMPLUG_DT
55 bool "Marvell DreamPlug (Flattened Device Tree)"
56 select ARCH_KIRKWOOD_DT
57 help
58 Say 'Y' here if you want your kernel to support the
59 Marvell DreamPlug (Flattened Device Tree).
60
47config MACH_TS219 61config MACH_TS219
48 bool "QNAP TS-110, TS-119, TS-119P+, TS-210, TS-219, TS-219P and TS-219P+ Turbo NAS" 62 bool "QNAP TS-110, TS-119, TS-119P+, TS-210, TS-219, TS-219P and TS-219P+ Turbo NAS"
49 help 63 help
diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile
index 5dcaa81a2ec3..acbc5e1db06f 100644
--- a/arch/arm/mach-kirkwood/Makefile
+++ b/arch/arm/mach-kirkwood/Makefile
@@ -20,3 +20,4 @@ obj-$(CONFIG_MACH_NET5BIG_V2) += netxbig_v2-setup.o lacie_v2-common.o
20obj-$(CONFIG_MACH_T5325) += t5325-setup.o 20obj-$(CONFIG_MACH_T5325) += t5325-setup.o
21 21
22obj-$(CONFIG_CPU_IDLE) += cpuidle.o 22obj-$(CONFIG_CPU_IDLE) += cpuidle.o
23obj-$(CONFIG_ARCH_KIRKWOOD_DT) += board-dt.o
diff --git a/arch/arm/mach-kirkwood/Makefile.boot b/arch/arm/mach-kirkwood/Makefile.boot
index 760a0efe7580..16f938522304 100644
--- a/arch/arm/mach-kirkwood/Makefile.boot
+++ b/arch/arm/mach-kirkwood/Makefile.boot
@@ -1,3 +1,5 @@
1 zreladdr-y += 0x00008000 1 zreladdr-y += 0x00008000
2params_phys-y := 0x00000100 2params_phys-y := 0x00000100
3initrd_phys-y := 0x00800000 3initrd_phys-y := 0x00800000
4
5dtb-$(CONFIG_MACH_DREAMPLUG_DT) += kirkwood-dreamplug.dtb
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
new file mode 100644
index 000000000000..fbe6405602ed
--- /dev/null
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -0,0 +1,180 @@
1/*
2 * Copyright 2012 (C), Jason Cooper <jason@lakedaemon.net>
3 *
4 * arch/arm/mach-kirkwood/board-dt.c
5 *
6 * Marvell DreamPlug Reference Board Setup
7 *
8 * This file is licensed under the terms of the GNU General Public
9 * License version 2. This program is licensed "as is" without any
10 * warranty of any kind, whether express or implied.
11 */
12
13#include <linux/kernel.h>
14#include <linux/init.h>
15#include <linux/platform_device.h>
16#include <linux/mtd/partitions.h>
17#include <linux/ata_platform.h>
18#include <linux/mv643xx_eth.h>
19#include <linux/of.h>
20#include <linux/of_address.h>
21#include <linux/of_fdt.h>
22#include <linux/of_irq.h>
23#include <linux/of_platform.h>
24#include <linux/gpio.h>
25#include <linux/leds.h>
26#include <linux/mtd/physmap.h>
27#include <linux/spi/flash.h>
28#include <linux/spi/spi.h>
29#include <linux/spi/orion_spi.h>
30#include <asm/mach-types.h>
31#include <asm/mach/arch.h>
32#include <mach/kirkwood.h>
33#include <plat/mvsdio.h>
34#include "common.h"
35#include "mpp.h"
36
37static struct of_device_id kirkwood_dt_match_table[] __initdata = {
38 { .compatible = "simple-bus", },
39 { }
40};
41
42struct mtd_partition dreamplug_partitions[] = {
43 {
44 .name = "u-boot",
45 .size = SZ_512K,
46 .offset = 0,
47 },
48 {
49 .name = "u-boot env",
50 .size = SZ_64K,
51 .offset = SZ_512K + SZ_512K,
52 },
53 {
54 .name = "dtb",
55 .size = SZ_64K,
56 .offset = SZ_512K + SZ_512K + SZ_512K,
57 },
58};
59
60static const struct flash_platform_data dreamplug_spi_slave_data = {
61 .type = "mx25l1606e",
62 .name = "spi_flash",
63 .parts = dreamplug_partitions,
64 .nr_parts = ARRAY_SIZE(dreamplug_partitions),
65};
66
67static struct spi_board_info __initdata dreamplug_spi_slave_info[] = {
68 {
69 .modalias = "m25p80",
70 .platform_data = &dreamplug_spi_slave_data,
71 .irq = -1,
72 .max_speed_hz = 50000000,
73 .bus_num = 0,
74 .chip_select = 0,
75 },
76};
77
78static struct mv643xx_eth_platform_data dreamplug_ge00_data = {
79 .phy_addr = MV643XX_ETH_PHY_ADDR(0),
80};
81
82static struct mv643xx_eth_platform_data dreamplug_ge01_data = {
83 .phy_addr = MV643XX_ETH_PHY_ADDR(1),
84};
85
86static struct mv_sata_platform_data dreamplug_sata_data = {
87 .n_ports = 1,
88};
89
90static struct mvsdio_platform_data dreamplug_mvsdio_data = {
91 /* unfortunately the CD signal has not been connected */
92};
93
94static struct gpio_led dreamplug_led_pins[] = {
95 {
96 .name = "dreamplug:blue:bluetooth",
97 .gpio = 47,
98 .active_low = 1,
99 },
100 {
101 .name = "dreamplug:green:wifi",
102 .gpio = 48,
103 .active_low = 1,
104 },
105 {
106 .name = "dreamplug:green:wifi_ap",
107 .gpio = 49,
108 .active_low = 1,
109 },
110};
111
112static struct gpio_led_platform_data dreamplug_led_data = {
113 .leds = dreamplug_led_pins,
114 .num_leds = ARRAY_SIZE(dreamplug_led_pins),
115};
116
117static struct platform_device dreamplug_leds = {
118 .name = "leds-gpio",
119 .id = -1,
120 .dev = {
121 .platform_data = &dreamplug_led_data,
122 }
123};
124
125static unsigned int dreamplug_mpp_config[] __initdata = {
126 MPP0_SPI_SCn,
127 MPP1_SPI_MOSI,
128 MPP2_SPI_SCK,
129 MPP3_SPI_MISO,
130 MPP47_GPIO, /* Bluetooth LED */
131 MPP48_GPIO, /* Wifi LED */
132 MPP49_GPIO, /* Wifi AP LED */
133 0
134};
135
136static void __init dreamplug_init(void)
137{
138 /*
139 * Basic setup. Needs to be called early.
140 */
141 kirkwood_mpp_conf(dreamplug_mpp_config);
142
143 spi_register_board_info(dreamplug_spi_slave_info,
144 ARRAY_SIZE(dreamplug_spi_slave_info));
145 kirkwood_spi_init();
146
147 kirkwood_ehci_init();
148 kirkwood_ge00_init(&dreamplug_ge00_data);
149 kirkwood_ge01_init(&dreamplug_ge01_data);
150 kirkwood_sata_init(&dreamplug_sata_data);
151 kirkwood_sdio_init(&dreamplug_mvsdio_data);
152
153 platform_device_register(&dreamplug_leds);
154}
155
156static void __init kirkwood_dt_init(void)
157{
158 kirkwood_init();
159
160 if (of_machine_is_compatible("globalscale,dreamplug"))
161 dreamplug_init();
162
163 of_platform_populate(NULL, kirkwood_dt_match_table, NULL, NULL);
164}
165
166static const char *kirkwood_dt_board_compat[] = {
167 "globalscale,dreamplug",
168 NULL
169};
170
171DT_MACHINE_START(KIRKWOOD_DT, "Marvell Kirkwood (Flattened Device Tree)")
172 /* Maintainer: Jason Cooper <jason@lakedaemon.net> */
173 .map_io = kirkwood_map_io,
174 .init_early = kirkwood_init_early,
175 .init_irq = kirkwood_init_irq,
176 .timer = &kirkwood_timer,
177 .init_machine = kirkwood_dt_init,
178 .restart = kirkwood_restart,
179 .dt_compat = kirkwood_dt_board_compat,
180MACHINE_END
diff --git a/arch/arm/mach-mmp/mmp2.c b/arch/arm/mach-mmp/mmp2.c
index 617c60a170a4..c709a24a9d25 100644
--- a/arch/arm/mach-mmp/mmp2.c
+++ b/arch/arm/mach-mmp/mmp2.c
@@ -223,6 +223,7 @@ struct resource mmp2_resource_gpio[] = {
223 }, { 223 }, {
224 .start = IRQ_MMP2_GPIO, 224 .start = IRQ_MMP2_GPIO,
225 .end = IRQ_MMP2_GPIO, 225 .end = IRQ_MMP2_GPIO,
226 .name = "gpio_mux",
226 .flags = IORESOURCE_IRQ, 227 .flags = IORESOURCE_IRQ,
227 }, 228 },
228}; 229};
diff --git a/arch/arm/mach-mmp/pxa168.c b/arch/arm/mach-mmp/pxa168.c
index ada1213982b4..f10f87d8b667 100644
--- a/arch/arm/mach-mmp/pxa168.c
+++ b/arch/arm/mach-mmp/pxa168.c
@@ -166,6 +166,7 @@ struct resource pxa168_resource_gpio[] = {
166 }, { 166 }, {
167 .start = IRQ_PXA168_GPIOX, 167 .start = IRQ_PXA168_GPIOX,
168 .end = IRQ_PXA168_GPIOX, 168 .end = IRQ_PXA168_GPIOX,
169 .name = "gpio_mux",
169 .flags = IORESOURCE_IRQ, 170 .flags = IORESOURCE_IRQ,
170 }, 171 },
171}; 172};
diff --git a/arch/arm/mach-mmp/pxa910.c b/arch/arm/mach-mmp/pxa910.c
index 3241a25784d0..0c87e69adf9f 100644
--- a/arch/arm/mach-mmp/pxa910.c
+++ b/arch/arm/mach-mmp/pxa910.c
@@ -173,6 +173,7 @@ struct resource pxa910_resource_gpio[] = {
173 }, { 173 }, {
174 .start = IRQ_PXA910_AP_GPIO, 174 .start = IRQ_PXA910_AP_GPIO,
175 .end = IRQ_PXA910_AP_GPIO, 175 .end = IRQ_PXA910_AP_GPIO,
176 .name = "gpio_mux",
176 .flags = IORESOURCE_IRQ, 177 .flags = IORESOURCE_IRQ,
177 }, 178 },
178}; 179};
diff --git a/arch/arm/mach-mxs/Kconfig b/arch/arm/mach-mxs/Kconfig
index cf00b3e3be85..c57f9964a713 100644
--- a/arch/arm/mach-mxs/Kconfig
+++ b/arch/arm/mach-mxs/Kconfig
@@ -83,6 +83,18 @@ config MODULE_M28
83 select MXS_HAVE_PLATFORM_MXSFB 83 select MXS_HAVE_PLATFORM_MXSFB
84 select MXS_OCOTP 84 select MXS_OCOTP
85 85
86config MODULE_APX4
87 bool
88 select SOC_IMX28
89 select LEDS_GPIO_REGISTER
90 select MXS_HAVE_AMBA_DUART
91 select MXS_HAVE_PLATFORM_AUART
92 select MXS_HAVE_PLATFORM_FEC
93 select MXS_HAVE_PLATFORM_MXS_I2C
94 select MXS_HAVE_PLATFORM_MXS_MMC
95 select MXS_HAVE_PLATFORM_MXS_SAIF
96 select MXS_OCOTP
97
86config MACH_TX28 98config MACH_TX28
87 bool "Ka-Ro TX28 module" 99 bool "Ka-Ro TX28 module"
88 select MODULE_TX28 100 select MODULE_TX28
@@ -91,4 +103,8 @@ config MACH_M28EVK
91 bool "Support DENX M28EVK Platform" 103 bool "Support DENX M28EVK Platform"
92 select MODULE_M28 104 select MODULE_M28
93 105
106config MACH_APX4DEVKIT
107 bool "Support Bluegiga APX4 Development Kit"
108 select MODULE_APX4
109
94endif 110endif
diff --git a/arch/arm/mach-mxs/Makefile b/arch/arm/mach-mxs/Makefile
index 8c93b24896bf..908bf9a567f1 100644
--- a/arch/arm/mach-mxs/Makefile
+++ b/arch/arm/mach-mxs/Makefile
@@ -11,6 +11,7 @@ obj-$(CONFIG_MACH_STMP378X_DEVB) += mach-stmp378x_devb.o
11obj-$(CONFIG_MACH_MX23EVK) += mach-mx23evk.o 11obj-$(CONFIG_MACH_MX23EVK) += mach-mx23evk.o
12obj-$(CONFIG_MACH_MX28EVK) += mach-mx28evk.o 12obj-$(CONFIG_MACH_MX28EVK) += mach-mx28evk.o
13obj-$(CONFIG_MACH_M28EVK) += mach-m28evk.o 13obj-$(CONFIG_MACH_M28EVK) += mach-m28evk.o
14obj-$(CONFIG_MACH_APX4DEVKIT) += mach-apx4devkit.o
14obj-$(CONFIG_MODULE_TX28) += module-tx28.o 15obj-$(CONFIG_MODULE_TX28) += module-tx28.o
15obj-$(CONFIG_MACH_TX28) += mach-tx28.o 16obj-$(CONFIG_MACH_TX28) += mach-tx28.o
16 17
diff --git a/arch/arm/mach-mxs/include/mach/digctl.h b/arch/arm/mach-mxs/include/mach/digctl.h
index 49a888c65d6d..17964066303f 100644
--- a/arch/arm/mach-mxs/include/mach/digctl.h
+++ b/arch/arm/mach-mxs/include/mach/digctl.h
@@ -18,4 +18,5 @@
18#define HW_DIGCTL_CTRL 0x0 18#define HW_DIGCTL_CTRL 0x0
19#define BP_DIGCTL_CTRL_SAIF_CLKMUX 10 19#define BP_DIGCTL_CTRL_SAIF_CLKMUX 10
20#define BM_DIGCTL_CTRL_SAIF_CLKMUX (0x3 << 10) 20#define BM_DIGCTL_CTRL_SAIF_CLKMUX (0x3 << 10)
21#define HW_DIGCTL_CHIPID 0x310
21#endif 22#endif
diff --git a/arch/arm/mach-mxs/include/mach/mxs.h b/arch/arm/mach-mxs/include/mach/mxs.h
index bde5f6634747..7d4fb6d0afda 100644
--- a/arch/arm/mach-mxs/include/mach/mxs.h
+++ b/arch/arm/mach-mxs/include/mach/mxs.h
@@ -23,22 +23,10 @@
23#include <linux/io.h> 23#include <linux/io.h>
24#endif 24#endif
25#include <asm/mach-types.h> 25#include <asm/mach-types.h>
26#include <mach/digctl.h>
26#include <mach/hardware.h> 27#include <mach/hardware.h>
27 28
28/* 29/*
29 * MXS CPU types
30 */
31#define cpu_is_mx23() ( \
32 machine_is_mx23evk() || \
33 machine_is_stmp378x() || \
34 0)
35#define cpu_is_mx28() ( \
36 machine_is_mx28evk() || \
37 machine_is_m28evk() || \
38 machine_is_tx28() || \
39 0)
40
41/*
42 * IO addresses common to MXS-based 30 * IO addresses common to MXS-based
43 */ 31 */
44#define MXS_IO_BASE_ADDR 0x80000000 32#define MXS_IO_BASE_ADDR 0x80000000
@@ -109,6 +97,21 @@ static inline void __mxs_togl(u32 mask, void __iomem *reg)
109{ 97{
110 __raw_writel(mask, reg + MXS_TOG_ADDR); 98 __raw_writel(mask, reg + MXS_TOG_ADDR);
111} 99}
100
101/*
102 * MXS CPU types
103 */
104#define MXS_CHIPID (MXS_IO_ADDRESS(MXS_DIGCTL_BASE_ADDR) + HW_DIGCTL_CHIPID)
105
106static inline int cpu_is_mx23(void)
107{
108 return ((__raw_readl(MXS_CHIPID) >> 16) == 0x3780);
109}
110
111static inline int cpu_is_mx28(void)
112{
113 return ((__raw_readl(MXS_CHIPID) >> 16) == 0x2800);
114}
112#endif 115#endif
113 116
114#endif /* __MACH_MXS_H__ */ 117#endif /* __MACH_MXS_H__ */
diff --git a/arch/arm/mach-mxs/include/mach/uncompress.h b/arch/arm/mach-mxs/include/mach/uncompress.h
index 67776746f143..ef2811495446 100644
--- a/arch/arm/mach-mxs/include/mach/uncompress.h
+++ b/arch/arm/mach-mxs/include/mach/uncompress.h
@@ -18,8 +18,6 @@
18#ifndef __MACH_MXS_UNCOMPRESS_H__ 18#ifndef __MACH_MXS_UNCOMPRESS_H__
19#define __MACH_MXS_UNCOMPRESS_H__ 19#define __MACH_MXS_UNCOMPRESS_H__
20 20
21#include <asm/mach-types.h>
22
23unsigned long mxs_duart_base; 21unsigned long mxs_duart_base;
24 22
25#define MXS_DUART(x) (*(volatile unsigned long *)(mxs_duart_base + (x))) 23#define MXS_DUART(x) (*(volatile unsigned long *)(mxs_duart_base + (x)))
@@ -55,16 +53,17 @@ static inline void flush(void)
55 53
56#define MX23_DUART_BASE_ADDR 0x80070000 54#define MX23_DUART_BASE_ADDR 0x80070000
57#define MX28_DUART_BASE_ADDR 0x80074000 55#define MX28_DUART_BASE_ADDR 0x80074000
56#define MXS_DIGCTL_CHIPID 0x8001c310
58 57
59static inline void __arch_decomp_setup(unsigned long arch_id) 58static inline void __arch_decomp_setup(unsigned long arch_id)
60{ 59{
61 switch (arch_id) { 60 u16 chipid = (*(volatile unsigned long *) MXS_DIGCTL_CHIPID) >> 16;
62 case MACH_TYPE_MX23EVK: 61
62 switch (chipid) {
63 case 0x3780:
63 mxs_duart_base = MX23_DUART_BASE_ADDR; 64 mxs_duart_base = MX23_DUART_BASE_ADDR;
64 break; 65 break;
65 case MACH_TYPE_MX28EVK: 66 case 0x2800:
66 case MACH_TYPE_M28EVK:
67 case MACH_TYPE_TX28:
68 mxs_duart_base = MX28_DUART_BASE_ADDR; 67 mxs_duart_base = MX28_DUART_BASE_ADDR;
69 break; 68 break;
70 default: 69 default:
diff --git a/arch/arm/mach-mxs/mach-apx4devkit.c b/arch/arm/mach-mxs/mach-apx4devkit.c
new file mode 100644
index 000000000000..48a7fab571a6
--- /dev/null
+++ b/arch/arm/mach-mxs/mach-apx4devkit.c
@@ -0,0 +1,260 @@
1/*
2 * Copyright (C) 2011-2012
3 * Lauri Hintsala, Bluegiga, <lauri.hintsala@bluegiga.com>
4 * Veli-Pekka Peltola, Bluegiga, <veli-pekka.peltola@bluegiga.com>
5 *
6 * based on: mach-mx28evk.c
7 * Copyright 2010 Freescale Semiconductor, Inc. All Rights Reserved.
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 */
19
20#include <linux/delay.h>
21#include <linux/platform_device.h>
22#include <linux/gpio.h>
23#include <linux/leds.h>
24#include <linux/clk.h>
25#include <linux/i2c.h>
26#include <linux/regulator/machine.h>
27#include <linux/regulator/fixed.h>
28#include <linux/micrel_phy.h>
29
30#include <asm/mach-types.h>
31#include <asm/mach/arch.h>
32#include <asm/mach/time.h>
33
34#include <mach/common.h>
35#include <mach/digctl.h>
36#include <mach/iomux-mx28.h>
37
38#include "devices-mx28.h"
39
40#define APX4DEVKIT_GPIO_USERLED MXS_GPIO_NR(3, 28)
41
42static const iomux_cfg_t apx4devkit_pads[] __initconst = {
43 /* duart */
44 MX28_PAD_PWM0__DUART_RX | MXS_PAD_CTRL,
45 MX28_PAD_PWM1__DUART_TX | MXS_PAD_CTRL,
46
47 /* auart0 */
48 MX28_PAD_AUART0_RX__AUART0_RX | MXS_PAD_CTRL,
49 MX28_PAD_AUART0_TX__AUART0_TX | MXS_PAD_CTRL,
50 MX28_PAD_AUART0_CTS__AUART0_CTS | MXS_PAD_CTRL,
51 MX28_PAD_AUART0_RTS__AUART0_RTS | MXS_PAD_CTRL,
52
53 /* auart1 */
54 MX28_PAD_AUART1_RX__AUART1_RX | MXS_PAD_CTRL,
55 MX28_PAD_AUART1_TX__AUART1_TX | MXS_PAD_CTRL,
56
57 /* auart2 */
58 MX28_PAD_SSP2_SCK__AUART2_RX | MXS_PAD_CTRL,
59 MX28_PAD_SSP2_MOSI__AUART2_TX | MXS_PAD_CTRL,
60
61 /* auart3 */
62 MX28_PAD_SSP2_MISO__AUART3_RX | MXS_PAD_CTRL,
63 MX28_PAD_SSP2_SS0__AUART3_TX | MXS_PAD_CTRL,
64
65#define MXS_PAD_FEC (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP)
66 /* fec0 */
67 MX28_PAD_ENET0_MDC__ENET0_MDC | MXS_PAD_FEC,
68 MX28_PAD_ENET0_MDIO__ENET0_MDIO | MXS_PAD_FEC,
69 MX28_PAD_ENET0_RX_EN__ENET0_RX_EN | MXS_PAD_FEC,
70 MX28_PAD_ENET0_RXD0__ENET0_RXD0 | MXS_PAD_FEC,
71 MX28_PAD_ENET0_RXD1__ENET0_RXD1 | MXS_PAD_FEC,
72 MX28_PAD_ENET0_TX_EN__ENET0_TX_EN | MXS_PAD_FEC,
73 MX28_PAD_ENET0_TXD0__ENET0_TXD0 | MXS_PAD_FEC,
74 MX28_PAD_ENET0_TXD1__ENET0_TXD1 | MXS_PAD_FEC,
75 MX28_PAD_ENET_CLK__CLKCTRL_ENET | MXS_PAD_FEC,
76
77 /* i2c */
78 MX28_PAD_I2C0_SCL__I2C0_SCL,
79 MX28_PAD_I2C0_SDA__I2C0_SDA,
80
81 /* mmc0 */
82 MX28_PAD_SSP0_DATA0__SSP0_D0 |
83 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
84 MX28_PAD_SSP0_DATA1__SSP0_D1 |
85 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
86 MX28_PAD_SSP0_DATA2__SSP0_D2 |
87 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
88 MX28_PAD_SSP0_DATA3__SSP0_D3 |
89 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
90 MX28_PAD_SSP0_DATA4__SSP0_D4 |
91 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
92 MX28_PAD_SSP0_DATA5__SSP0_D5 |
93 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
94 MX28_PAD_SSP0_DATA6__SSP0_D6 |
95 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
96 MX28_PAD_SSP0_DATA7__SSP0_D7 |
97 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
98 MX28_PAD_SSP0_CMD__SSP0_CMD |
99 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
100 MX28_PAD_SSP0_DETECT__SSP0_CARD_DETECT |
101 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_NOPULL),
102 MX28_PAD_SSP0_SCK__SSP0_SCK |
103 (MXS_PAD_12MA | MXS_PAD_3V3 | MXS_PAD_NOPULL),
104
105 /* led */
106 MX28_PAD_PWM3__GPIO_3_28 | MXS_PAD_CTRL,
107
108 /* saif0 & saif1 */
109 MX28_PAD_SAIF0_MCLK__SAIF0_MCLK |
110 (MXS_PAD_12MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
111 MX28_PAD_SAIF0_LRCLK__SAIF0_LRCLK |
112 (MXS_PAD_12MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
113 MX28_PAD_SAIF0_BITCLK__SAIF0_BITCLK |
114 (MXS_PAD_12MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
115 MX28_PAD_SAIF0_SDATA0__SAIF0_SDATA0 |
116 (MXS_PAD_12MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
117 MX28_PAD_SAIF1_SDATA0__SAIF1_SDATA0 |
118 (MXS_PAD_12MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
119};
120
121/* led */
122static const struct gpio_led apx4devkit_leds[] __initconst = {
123 {
124 .name = "user-led",
125 .default_trigger = "heartbeat",
126 .gpio = APX4DEVKIT_GPIO_USERLED,
127 },
128};
129
130static const struct gpio_led_platform_data apx4devkit_led_data __initconst = {
131 .leds = apx4devkit_leds,
132 .num_leds = ARRAY_SIZE(apx4devkit_leds),
133};
134
135static const struct fec_platform_data mx28_fec_pdata __initconst = {
136 .phy = PHY_INTERFACE_MODE_RMII,
137};
138
139static const struct mxs_mmc_platform_data apx4devkit_mmc_pdata __initconst = {
140 .wp_gpio = -EINVAL,
141 .flags = SLOTF_4_BIT_CAPABLE,
142};
143
144static const struct i2c_board_info apx4devkit_i2c_boardinfo[] __initconst = {
145 { I2C_BOARD_INFO("sgtl5000", 0x0a) }, /* ASoC */
146 { I2C_BOARD_INFO("pcf8563", 0x51) }, /* RTC */
147};
148
149#if defined(CONFIG_REGULATOR_FIXED_VOLTAGE) || \
150 defined(CONFIG_REGULATOR_FIXED_VOLTAGE_MODULE)
151static struct regulator_consumer_supply apx4devkit_audio_consumer_supplies[] = {
152 REGULATOR_SUPPLY("VDDA", "0-000a"),
153 REGULATOR_SUPPLY("VDDIO", "0-000a"),
154};
155
156static struct regulator_init_data apx4devkit_vdd_reg_init_data = {
157 .constraints = {
158 .name = "3V3",
159 .always_on = 1,
160 },
161 .consumer_supplies = apx4devkit_audio_consumer_supplies,
162 .num_consumer_supplies = ARRAY_SIZE(apx4devkit_audio_consumer_supplies),
163};
164
165static struct fixed_voltage_config apx4devkit_vdd_pdata = {
166 .supply_name = "board-3V3",
167 .microvolts = 3300000,
168 .gpio = -EINVAL,
169 .enabled_at_boot = 1,
170 .init_data = &apx4devkit_vdd_reg_init_data,
171};
172
173static struct platform_device apx4devkit_voltage_regulator = {
174 .name = "reg-fixed-voltage",
175 .id = -1,
176 .num_resources = 0,
177 .dev = {
178 .platform_data = &apx4devkit_vdd_pdata,
179 },
180};
181
182static void __init apx4devkit_add_regulators(void)
183{
184 platform_device_register(&apx4devkit_voltage_regulator);
185}
186#else
187static void __init apx4devkit_add_regulators(void) {}
188#endif
189
190static const struct mxs_saif_platform_data
191 apx4devkit_mxs_saif_pdata[] __initconst = {
192 /* working on EXTMSTR0 mode (saif0 master, saif1 slave) */
193 {
194 .master_mode = 1,
195 .master_id = 0,
196 }, {
197 .master_mode = 0,
198 .master_id = 0,
199 },
200};
201
202static int apx4devkit_phy_fixup(struct phy_device *phy)
203{
204 phy->dev_flags |= MICREL_PHY_50MHZ_CLK;
205 return 0;
206}
207
208static void __init apx4devkit_init(void)
209{
210 mxs_iomux_setup_multiple_pads(apx4devkit_pads,
211 ARRAY_SIZE(apx4devkit_pads));
212
213 mx28_add_duart();
214 mx28_add_auart0();
215 mx28_add_auart1();
216 mx28_add_auart2();
217 mx28_add_auart3();
218
219 /*
220 * Register fixup for the Micrel KS8031 PHY clock
221 * (shares same ID with KS8051)
222 */
223 phy_register_fixup_for_uid(PHY_ID_KS8051, MICREL_PHY_ID_MASK,
224 apx4devkit_phy_fixup);
225
226 mx28_add_fec(0, &mx28_fec_pdata);
227
228 mx28_add_mxs_mmc(0, &apx4devkit_mmc_pdata);
229
230 gpio_led_register_device(0, &apx4devkit_led_data);
231
232 mxs_saif_clkmux_select(MXS_DIGCTL_SAIF_CLKMUX_EXTMSTR0);
233 mx28_add_saif(0, &apx4devkit_mxs_saif_pdata[0]);
234 mx28_add_saif(1, &apx4devkit_mxs_saif_pdata[1]);
235
236 apx4devkit_add_regulators();
237
238 mx28_add_mxs_i2c(0);
239 i2c_register_board_info(0, apx4devkit_i2c_boardinfo,
240 ARRAY_SIZE(apx4devkit_i2c_boardinfo));
241
242 mxs_add_platform_device("mxs-sgtl5000", 0, NULL, 0, NULL, 0);
243}
244
245static void __init apx4devkit_timer_init(void)
246{
247 mx28_clocks_init();
248}
249
250static struct sys_timer apx4devkit_timer = {
251 .init = apx4devkit_timer_init,
252};
253
254MACHINE_START(APX4DEVKIT, "Bluegiga APX4 Development Kit")
255 .map_io = mx28_map_io,
256 .init_irq = mx28_init_irq,
257 .timer = &apx4devkit_timer,
258 .init_machine = apx4devkit_init,
259 .restart = mxs_restart,
260MACHINE_END
diff --git a/arch/arm/mach-mxs/mach-m28evk.c b/arch/arm/mach-mxs/mach-m28evk.c
index 2f2758230edf..06d79963611c 100644
--- a/arch/arm/mach-mxs/mach-m28evk.c
+++ b/arch/arm/mach-mxs/mach-m28evk.c
@@ -247,18 +247,15 @@ static int __init m28evk_fec_get_mac(void)
247 u32 val; 247 u32 val;
248 const u32 *ocotp = mxs_get_ocotp(); 248 const u32 *ocotp = mxs_get_ocotp();
249 249
250 if (!ocotp) { 250 if (!ocotp)
251 pr_err("%s: timeout when reading fec mac from OCOTP\n",
252 __func__);
253 return -ETIMEDOUT; 251 return -ETIMEDOUT;
254 }
255 252
256 /* 253 /*
257 * OCOTP only stores the last 4 octets for each mac address, 254 * OCOTP only stores the last 4 octets for each mac address,
258 * so hard-code DENX OUI (C0:E5:4E) here. 255 * so hard-code DENX OUI (C0:E5:4E) here.
259 */ 256 */
260 for (i = 0; i < 2; i++) { 257 for (i = 0; i < 2; i++) {
261 val = ocotp[i * 4]; 258 val = ocotp[i];
262 mx28_fec_pdata[i].mac[0] = 0xC0; 259 mx28_fec_pdata[i].mac[0] = 0xC0;
263 mx28_fec_pdata[i].mac[1] = 0xE5; 260 mx28_fec_pdata[i].mac[1] = 0xE5;
264 mx28_fec_pdata[i].mac[2] = 0x4E; 261 mx28_fec_pdata[i].mac[2] = 0x4E;
diff --git a/arch/arm/mach-mxs/mach-mx28evk.c b/arch/arm/mach-mxs/mach-mx28evk.c
index fdb0a5664dd6..e386c142f93c 100644
--- a/arch/arm/mach-mxs/mach-mx28evk.c
+++ b/arch/arm/mach-mxs/mach-mx28evk.c
@@ -223,7 +223,6 @@ static const struct gpio_led_platform_data mx28evk_led_data __initconst = {
223/* fec */ 223/* fec */
224static void __init mx28evk_fec_reset(void) 224static void __init mx28evk_fec_reset(void)
225{ 225{
226 int ret;
227 struct clk *clk; 226 struct clk *clk;
228 227
229 /* Enable fec phy clock */ 228 /* Enable fec phy clock */
@@ -231,32 +230,7 @@ static void __init mx28evk_fec_reset(void)
231 if (!IS_ERR(clk)) 230 if (!IS_ERR(clk))
232 clk_prepare_enable(clk); 231 clk_prepare_enable(clk);
233 232
234 /* Power up fec phy */ 233 gpio_set_value(MX28EVK_FEC_PHY_RESET, 0);
235 ret = gpio_request(MX28EVK_FEC_PHY_POWER, "fec-phy-power");
236 if (ret) {
237 pr_err("Failed to request gpio fec-phy-%s: %d\n", "power", ret);
238 return;
239 }
240
241 ret = gpio_direction_output(MX28EVK_FEC_PHY_POWER, 0);
242 if (ret) {
243 pr_err("Failed to drive gpio fec-phy-%s: %d\n", "power", ret);
244 return;
245 }
246
247 /* Reset fec phy */
248 ret = gpio_request(MX28EVK_FEC_PHY_RESET, "fec-phy-reset");
249 if (ret) {
250 pr_err("Failed to request gpio fec-phy-%s: %d\n", "reset", ret);
251 return;
252 }
253
254 gpio_direction_output(MX28EVK_FEC_PHY_RESET, 0);
255 if (ret) {
256 pr_err("Failed to drive gpio fec-phy-%s: %d\n", "reset", ret);
257 return;
258 }
259
260 mdelay(1); 234 mdelay(1);
261 gpio_set_value(MX28EVK_FEC_PHY_RESET, 1); 235 gpio_set_value(MX28EVK_FEC_PHY_RESET, 1);
262} 236}
@@ -278,14 +252,14 @@ static int __init mx28evk_fec_get_mac(void)
278 const u32 *ocotp = mxs_get_ocotp(); 252 const u32 *ocotp = mxs_get_ocotp();
279 253
280 if (!ocotp) 254 if (!ocotp)
281 goto error; 255 return -ETIMEDOUT;
282 256
283 /* 257 /*
284 * OCOTP only stores the last 4 octets for each mac address, 258 * OCOTP only stores the last 4 octets for each mac address,
285 * so hard-code Freescale OUI (00:04:9f) here. 259 * so hard-code Freescale OUI (00:04:9f) here.
286 */ 260 */
287 for (i = 0; i < 2; i++) { 261 for (i = 0; i < 2; i++) {
288 val = ocotp[i * 4]; 262 val = ocotp[i];
289 mx28_fec_pdata[i].mac[0] = 0x00; 263 mx28_fec_pdata[i].mac[0] = 0x00;
290 mx28_fec_pdata[i].mac[1] = 0x04; 264 mx28_fec_pdata[i].mac[1] = 0x04;
291 mx28_fec_pdata[i].mac[2] = 0x9f; 265 mx28_fec_pdata[i].mac[2] = 0x9f;
@@ -295,10 +269,6 @@ static int __init mx28evk_fec_get_mac(void)
295 } 269 }
296 270
297 return 0; 271 return 0;
298
299error:
300 pr_err("%s: timeout when reading fec mac from OCOTP\n", __func__);
301 return -ETIMEDOUT;
302} 272}
303 273
304/* 274/*
@@ -417,9 +387,14 @@ static void __init mx28evk_add_regulators(void)
417static void __init mx28evk_add_regulators(void) {} 387static void __init mx28evk_add_regulators(void) {}
418#endif 388#endif
419 389
420static struct gpio mx28evk_lcd_gpios[] = { 390static const struct gpio mx28evk_gpios[] __initconst = {
421 { MX28EVK_LCD_ENABLE, GPIOF_OUT_INIT_HIGH, "lcd-enable" }, 391 { MX28EVK_LCD_ENABLE, GPIOF_OUT_INIT_HIGH, "lcd-enable" },
422 { MX28EVK_BL_ENABLE, GPIOF_OUT_INIT_HIGH, "bl-enable" }, 392 { MX28EVK_BL_ENABLE, GPIOF_OUT_INIT_HIGH, "bl-enable" },
393 { MX28EVK_FLEXCAN_SWITCH, GPIOF_DIR_OUT, "flexcan-switch" },
394 { MX28EVK_MMC0_SLOT_POWER, GPIOF_OUT_INIT_LOW, "mmc0-slot-power" },
395 { MX28EVK_MMC1_SLOT_POWER, GPIOF_OUT_INIT_LOW, "mmc1-slot-power" },
396 { MX28EVK_FEC_PHY_POWER, GPIOF_OUT_INIT_LOW, "fec-phy-power" },
397 { MX28EVK_FEC_PHY_RESET, GPIOF_DIR_OUT, "fec-phy-reset" },
423}; 398};
424 399
425static const struct mxs_saif_platform_data 400static const struct mxs_saif_platform_data
@@ -447,25 +422,18 @@ static void __init mx28evk_init(void)
447 if (mx28evk_fec_get_mac()) 422 if (mx28evk_fec_get_mac())
448 pr_warn("%s: failed on fec mac setup\n", __func__); 423 pr_warn("%s: failed on fec mac setup\n", __func__);
449 424
425 ret = gpio_request_array(mx28evk_gpios, ARRAY_SIZE(mx28evk_gpios));
426 if (ret)
427 pr_err("One or more GPIOs failed to be requested: %d\n", ret);
428
450 mx28evk_fec_reset(); 429 mx28evk_fec_reset();
451 mx28_add_fec(0, &mx28_fec_pdata[0]); 430 mx28_add_fec(0, &mx28_fec_pdata[0]);
452 mx28_add_fec(1, &mx28_fec_pdata[1]); 431 mx28_add_fec(1, &mx28_fec_pdata[1]);
453 432
454 ret = gpio_request_one(MX28EVK_FLEXCAN_SWITCH, GPIOF_DIR_OUT, 433 mx28_add_flexcan(0, &mx28evk_flexcan_pdata[0]);
455 "flexcan-switch"); 434 mx28_add_flexcan(1, &mx28evk_flexcan_pdata[1]);
456 if (ret) {
457 pr_err("failed to request gpio flexcan-switch: %d\n", ret);
458 } else {
459 mx28_add_flexcan(0, &mx28evk_flexcan_pdata[0]);
460 mx28_add_flexcan(1, &mx28evk_flexcan_pdata[1]);
461 }
462 435
463 ret = gpio_request_array(mx28evk_lcd_gpios, 436 mx28_add_mxsfb(&mx28evk_mxsfb_pdata);
464 ARRAY_SIZE(mx28evk_lcd_gpios));
465 if (ret)
466 pr_warn("failed to request gpio pins for lcd: %d\n", ret);
467 else
468 mx28_add_mxsfb(&mx28evk_mxsfb_pdata);
469 437
470 mxs_saif_clkmux_select(MXS_DIGCTL_SAIF_CLKMUX_EXTMSTR0); 438 mxs_saif_clkmux_select(MXS_DIGCTL_SAIF_CLKMUX_EXTMSTR0);
471 mx28_add_saif(0, &mx28evk_mxs_saif_pdata[0]); 439 mx28_add_saif(0, &mx28evk_mxs_saif_pdata[0]);
@@ -480,20 +448,8 @@ static void __init mx28evk_init(void)
480 mxs_add_platform_device("mxs-sgtl5000", 0, NULL, 0, 448 mxs_add_platform_device("mxs-sgtl5000", 0, NULL, 0,
481 NULL, 0); 449 NULL, 0);
482 450
483 /* power on mmc slot by writing 0 to the gpio */ 451 mx28_add_mxs_mmc(0, &mx28evk_mmc_pdata[0]);
484 ret = gpio_request_one(MX28EVK_MMC0_SLOT_POWER, GPIOF_OUT_INIT_LOW, 452 mx28_add_mxs_mmc(1, &mx28evk_mmc_pdata[1]);
485 "mmc0-slot-power");
486 if (ret)
487 pr_warn("failed to request gpio mmc0-slot-power: %d\n", ret);
488 else
489 mx28_add_mxs_mmc(0, &mx28evk_mmc_pdata[0]);
490
491 ret = gpio_request_one(MX28EVK_MMC1_SLOT_POWER, GPIOF_OUT_INIT_LOW,
492 "mmc1-slot-power");
493 if (ret)
494 pr_warn("failed to request gpio mmc1-slot-power: %d\n", ret);
495 else
496 mx28_add_mxs_mmc(1, &mx28evk_mmc_pdata[1]);
497 453
498 mx28_add_rtc_stmp3xxx(); 454 mx28_add_rtc_stmp3xxx();
499 455
diff --git a/arch/arm/mach-omap1/Kconfig b/arch/arm/mach-omap1/Kconfig
index 922ab0dc2bcd..dfab466ebd1d 100644
--- a/arch/arm/mach-omap1/Kconfig
+++ b/arch/arm/mach-omap1/Kconfig
@@ -152,6 +152,10 @@ config MACH_AMS_DELTA
152 bool "Amstrad E3 (Delta)" 152 bool "Amstrad E3 (Delta)"
153 depends on ARCH_OMAP1 && ARCH_OMAP15XX 153 depends on ARCH_OMAP1 && ARCH_OMAP15XX
154 select FIQ 154 select FIQ
155 select GPIO_GENERIC_PLATFORM
156 select LEDS_GPIO_REGISTER
157 select REGULATOR
158 select REGULATOR_FIXED_VOLTAGE
155 help 159 help
156 Support for the Amstrad E3 (codename Delta) videophone. Say Y here 160 Support for the Amstrad E3 (codename Delta) videophone. Say Y here
157 if you have such a device. 161 if you have such a device.
diff --git a/arch/arm/mach-omap1/board-ams-delta.c b/arch/arm/mach-omap1/board-ams-delta.c
index 83eac744ddb9..c1b681ef4cba 100644
--- a/arch/arm/mach-omap1/board-ams-delta.c
+++ b/arch/arm/mach-omap1/board-ams-delta.c
@@ -11,6 +11,7 @@
11 * it under the terms of the GNU General Public License version 2 as 11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation. 12 * published by the Free Software Foundation.
13 */ 13 */
14#include <linux/basic_mmio_gpio.h>
14#include <linux/gpio.h> 15#include <linux/gpio.h>
15#include <linux/kernel.h> 16#include <linux/kernel.h>
16#include <linux/init.h> 17#include <linux/init.h>
@@ -18,6 +19,9 @@
18#include <linux/interrupt.h> 19#include <linux/interrupt.h>
19#include <linux/leds.h> 20#include <linux/leds.h>
20#include <linux/platform_device.h> 21#include <linux/platform_device.h>
22#include <linux/regulator/consumer.h>
23#include <linux/regulator/fixed.h>
24#include <linux/regulator/machine.h>
21#include <linux/serial_8250.h> 25#include <linux/serial_8250.h>
22#include <linux/export.h> 26#include <linux/export.h>
23#include <linux/omapfb.h> 27#include <linux/omapfb.h>
@@ -43,9 +47,6 @@
43#include "iomap.h" 47#include "iomap.h"
44#include "common.h" 48#include "common.h"
45 49
46static u8 ams_delta_latch1_reg;
47static u16 ams_delta_latch2_reg;
48
49static const unsigned int ams_delta_keymap[] = { 50static const unsigned int ams_delta_keymap[] = {
50 KEY(0, 0, KEY_F1), /* Advert */ 51 KEY(0, 0, KEY_F1), /* Advert */
51 52
@@ -124,54 +125,188 @@ static const unsigned int ams_delta_keymap[] = {
124 KEY(7, 3, KEY_LEFTCTRL), /* Vol down */ 125 KEY(7, 3, KEY_LEFTCTRL), /* Vol down */
125}; 126};
126 127
127void ams_delta_latch1_write(u8 mask, u8 value) 128#define LATCH1_PHYS 0x01000000
128{ 129#define LATCH1_VIRT 0xEA000000
129 ams_delta_latch1_reg &= ~mask; 130#define MODEM_PHYS 0x04000000
130 ams_delta_latch1_reg |= value; 131#define MODEM_VIRT 0xEB000000
131 *(volatile __u8 *) AMS_DELTA_LATCH1_VIRT = ams_delta_latch1_reg; 132#define LATCH2_PHYS 0x08000000
132} 133#define LATCH2_VIRT 0xEC000000
133
134void ams_delta_latch2_write(u16 mask, u16 value)
135{
136 ams_delta_latch2_reg &= ~mask;
137 ams_delta_latch2_reg |= value;
138 *(volatile __u16 *) AMS_DELTA_LATCH2_VIRT = ams_delta_latch2_reg;
139}
140 134
141static struct map_desc ams_delta_io_desc[] __initdata = { 135static struct map_desc ams_delta_io_desc[] __initdata = {
142 /* AMS_DELTA_LATCH1 */ 136 /* AMS_DELTA_LATCH1 */
143 { 137 {
144 .virtual = AMS_DELTA_LATCH1_VIRT, 138 .virtual = LATCH1_VIRT,
145 .pfn = __phys_to_pfn(AMS_DELTA_LATCH1_PHYS), 139 .pfn = __phys_to_pfn(LATCH1_PHYS),
146 .length = 0x01000000, 140 .length = 0x01000000,
147 .type = MT_DEVICE 141 .type = MT_DEVICE
148 }, 142 },
149 /* AMS_DELTA_LATCH2 */ 143 /* AMS_DELTA_LATCH2 */
150 { 144 {
151 .virtual = AMS_DELTA_LATCH2_VIRT, 145 .virtual = LATCH2_VIRT,
152 .pfn = __phys_to_pfn(AMS_DELTA_LATCH2_PHYS), 146 .pfn = __phys_to_pfn(LATCH2_PHYS),
153 .length = 0x01000000, 147 .length = 0x01000000,
154 .type = MT_DEVICE 148 .type = MT_DEVICE
155 }, 149 },
156 /* AMS_DELTA_MODEM */ 150 /* AMS_DELTA_MODEM */
157 { 151 {
158 .virtual = AMS_DELTA_MODEM_VIRT, 152 .virtual = MODEM_VIRT,
159 .pfn = __phys_to_pfn(AMS_DELTA_MODEM_PHYS), 153 .pfn = __phys_to_pfn(MODEM_PHYS),
160 .length = 0x01000000, 154 .length = 0x01000000,
161 .type = MT_DEVICE 155 .type = MT_DEVICE
162 } 156 }
163}; 157};
164 158
165static struct omap_lcd_config ams_delta_lcd_config = { 159static struct omap_lcd_config ams_delta_lcd_config __initdata = {
166 .ctrl_name = "internal", 160 .ctrl_name = "internal",
167}; 161};
168 162
169static struct omap_usb_config ams_delta_usb_config __initdata = { 163static struct omap_usb_config ams_delta_usb_config = {
170 .register_host = 1, 164 .register_host = 1,
171 .hmc_mode = 16, 165 .hmc_mode = 16,
172 .pins[0] = 2, 166 .pins[0] = 2,
173}; 167};
174 168
169#define LATCH1_GPIO_BASE 232
170#define LATCH1_NGPIO 8
171
172static struct resource latch1_resources[] = {
173 [0] = {
174 .name = "dat",
175 .start = LATCH1_PHYS,
176 .end = LATCH1_PHYS + (LATCH1_NGPIO - 1) / 8,
177 .flags = IORESOURCE_MEM,
178 },
179};
180
181static struct bgpio_pdata latch1_pdata = {
182 .base = LATCH1_GPIO_BASE,
183 .ngpio = LATCH1_NGPIO,
184};
185
186static struct platform_device latch1_gpio_device = {
187 .name = "basic-mmio-gpio",
188 .id = 0,
189 .resource = latch1_resources,
190 .num_resources = ARRAY_SIZE(latch1_resources),
191 .dev = {
192 .platform_data = &latch1_pdata,
193 },
194};
195
196static struct resource latch2_resources[] = {
197 [0] = {
198 .name = "dat",
199 .start = LATCH2_PHYS,
200 .end = LATCH2_PHYS + (AMS_DELTA_LATCH2_NGPIO - 1) / 8,
201 .flags = IORESOURCE_MEM,
202 },
203};
204
205static struct bgpio_pdata latch2_pdata = {
206 .base = AMS_DELTA_LATCH2_GPIO_BASE,
207 .ngpio = AMS_DELTA_LATCH2_NGPIO,
208};
209
210static struct platform_device latch2_gpio_device = {
211 .name = "basic-mmio-gpio",
212 .id = 1,
213 .resource = latch2_resources,
214 .num_resources = ARRAY_SIZE(latch2_resources),
215 .dev = {
216 .platform_data = &latch2_pdata,
217 },
218};
219
220static const struct gpio latch_gpios[] __initconst = {
221 {
222 .gpio = LATCH1_GPIO_BASE + 6,
223 .flags = GPIOF_OUT_INIT_LOW,
224 .label = "dockit1",
225 },
226 {
227 .gpio = LATCH1_GPIO_BASE + 7,
228 .flags = GPIOF_OUT_INIT_LOW,
229 .label = "dockit2",
230 },
231 {
232 .gpio = AMS_DELTA_GPIO_PIN_SCARD_RSTIN,
233 .flags = GPIOF_OUT_INIT_LOW,
234 .label = "scard_rstin",
235 },
236 {
237 .gpio = AMS_DELTA_GPIO_PIN_SCARD_CMDVCC,
238 .flags = GPIOF_OUT_INIT_LOW,
239 .label = "scard_cmdvcc",
240 },
241 {
242 .gpio = AMS_DELTA_GPIO_PIN_MODEM_CODEC,
243 .flags = GPIOF_OUT_INIT_LOW,
244 .label = "modem_codec",
245 },
246 {
247 .gpio = AMS_DELTA_LATCH2_GPIO_BASE + 14,
248 .flags = GPIOF_OUT_INIT_LOW,
249 .label = "hookflash1",
250 },
251 {
252 .gpio = AMS_DELTA_LATCH2_GPIO_BASE + 15,
253 .flags = GPIOF_OUT_INIT_LOW,
254 .label = "hookflash2",
255 },
256};
257
258static struct regulator_consumer_supply modem_nreset_consumers[] = {
259 REGULATOR_SUPPLY("RESET#", "serial8250.1"),
260 REGULATOR_SUPPLY("POR", "cx20442-codec"),
261};
262
263static struct regulator_init_data modem_nreset_data = {
264 .constraints = {
265 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
266 .boot_on = 1,
267 },
268 .num_consumer_supplies = ARRAY_SIZE(modem_nreset_consumers),
269 .consumer_supplies = modem_nreset_consumers,
270};
271
272static struct fixed_voltage_config modem_nreset_config = {
273 .supply_name = "modem_nreset",
274 .microvolts = 3300000,
275 .gpio = AMS_DELTA_GPIO_PIN_MODEM_NRESET,
276 .startup_delay = 25000,
277 .enable_high = 1,
278 .enabled_at_boot = 1,
279 .init_data = &modem_nreset_data,
280};
281
282static struct platform_device modem_nreset_device = {
283 .name = "reg-fixed-voltage",
284 .id = -1,
285 .dev = {
286 .platform_data = &modem_nreset_config,
287 },
288};
289
290struct modem_private_data {
291 struct regulator *regulator;
292};
293
294static struct modem_private_data modem_priv;
295
296void ams_delta_latch_write(int base, int ngpio, u16 mask, u16 value)
297{
298 int bit = 0;
299 u16 bitpos = 1 << bit;
300
301 for (; bit < ngpio; bit++, bitpos = bitpos << 1) {
302 if (!(mask & bitpos))
303 continue;
304 else
305 gpio_set_value(base + bit, (value & bitpos) != 0);
306 }
307}
308EXPORT_SYMBOL(ams_delta_latch_write);
309
175static struct resource ams_delta_nand_resources[] = { 310static struct resource ams_delta_nand_resources[] = {
176 [0] = { 311 [0] = {
177 .start = OMAP1_MPUIO_BASE, 312 .start = OMAP1_MPUIO_BASE,
@@ -201,7 +336,7 @@ static const struct matrix_keymap_data ams_delta_keymap_data = {
201 .keymap_size = ARRAY_SIZE(ams_delta_keymap), 336 .keymap_size = ARRAY_SIZE(ams_delta_keymap),
202}; 337};
203 338
204static struct omap_kp_platform_data ams_delta_kp_data __initdata = { 339static struct omap_kp_platform_data ams_delta_kp_data = {
205 .rows = 8, 340 .rows = 8,
206 .cols = 8, 341 .cols = 8,
207 .keymap_data = &ams_delta_keymap_data, 342 .keymap_data = &ams_delta_keymap_data,
@@ -223,9 +358,45 @@ static struct platform_device ams_delta_lcd_device = {
223 .id = -1, 358 .id = -1,
224}; 359};
225 360
226static struct platform_device ams_delta_led_device = { 361static const struct gpio_led gpio_leds[] __initconst = {
227 .name = "ams-delta-led", 362 {
228 .id = -1 363 .name = "camera",
364 .gpio = LATCH1_GPIO_BASE + 0,
365 .default_state = LEDS_GPIO_DEFSTATE_OFF,
366#ifdef CONFIG_LEDS_TRIGGERS
367 .default_trigger = "ams_delta_camera",
368#endif
369 },
370 {
371 .name = "advert",
372 .gpio = LATCH1_GPIO_BASE + 1,
373 .default_state = LEDS_GPIO_DEFSTATE_OFF,
374 },
375 {
376 .name = "email",
377 .gpio = LATCH1_GPIO_BASE + 2,
378 .default_state = LEDS_GPIO_DEFSTATE_OFF,
379 },
380 {
381 .name = "handsfree",
382 .gpio = LATCH1_GPIO_BASE + 3,
383 .default_state = LEDS_GPIO_DEFSTATE_OFF,
384 },
385 {
386 .name = "voicemail",
387 .gpio = LATCH1_GPIO_BASE + 4,
388 .default_state = LEDS_GPIO_DEFSTATE_OFF,
389 },
390 {
391 .name = "voice",
392 .gpio = LATCH1_GPIO_BASE + 5,
393 .default_state = LEDS_GPIO_DEFSTATE_OFF,
394 },
395};
396
397static const struct gpio_led_platform_data leds_pdata __initconst = {
398 .leds = gpio_leds,
399 .num_leds = ARRAY_SIZE(gpio_leds),
229}; 400};
230 401
231static struct i2c_board_info ams_delta_camera_board_info[] = { 402static struct i2c_board_info ams_delta_camera_board_info[] = {
@@ -274,13 +445,17 @@ static struct omap1_cam_platform_data ams_delta_camera_platform_data = {
274}; 445};
275 446
276static struct platform_device *ams_delta_devices[] __initdata = { 447static struct platform_device *ams_delta_devices[] __initdata = {
277 &ams_delta_nand_device, 448 &latch1_gpio_device,
449 &latch2_gpio_device,
278 &ams_delta_kp_device, 450 &ams_delta_kp_device,
279 &ams_delta_lcd_device,
280 &ams_delta_led_device,
281 &ams_delta_camera_device, 451 &ams_delta_camera_device,
282}; 452};
283 453
454static struct platform_device *late_devices[] __initdata = {
455 &ams_delta_nand_device,
456 &ams_delta_lcd_device,
457};
458
284static void __init ams_delta_init(void) 459static void __init ams_delta_init(void)
285{ 460{
286 /* mux pins for uarts */ 461 /* mux pins for uarts */
@@ -304,15 +479,13 @@ static void __init ams_delta_init(void)
304 omap_serial_init(); 479 omap_serial_init();
305 omap_register_i2c_bus(1, 100, NULL, 0); 480 omap_register_i2c_bus(1, 100, NULL, 0);
306 481
307 /* Clear latch2 (NAND, LCD, modem enable) */
308 ams_delta_latch2_write(~0, 0);
309
310 omap1_usb_init(&ams_delta_usb_config); 482 omap1_usb_init(&ams_delta_usb_config);
311 omap1_set_camera_info(&ams_delta_camera_platform_data); 483 omap1_set_camera_info(&ams_delta_camera_platform_data);
312#ifdef CONFIG_LEDS_TRIGGERS 484#ifdef CONFIG_LEDS_TRIGGERS
313 led_trigger_register_simple("ams_delta_camera", 485 led_trigger_register_simple("ams_delta_camera",
314 &ams_delta_camera_led_trigger); 486 &ams_delta_camera_led_trigger);
315#endif 487#endif
488 gpio_led_register_device(-1, &leds_pdata);
316 platform_add_devices(ams_delta_devices, ARRAY_SIZE(ams_delta_devices)); 489 platform_add_devices(ams_delta_devices, ARRAY_SIZE(ams_delta_devices));
317 490
318 ams_delta_init_fiq(); 491 ams_delta_init_fiq();
@@ -322,16 +495,34 @@ static void __init ams_delta_init(void)
322 omapfb_set_lcd_config(&ams_delta_lcd_config); 495 omapfb_set_lcd_config(&ams_delta_lcd_config);
323} 496}
324 497
498static void modem_pm(struct uart_port *port, unsigned int state, unsigned old)
499{
500 struct modem_private_data *priv = port->private_data;
501
502 if (IS_ERR(priv->regulator))
503 return;
504
505 if (state == old)
506 return;
507
508 if (state == 0)
509 regulator_enable(priv->regulator);
510 else if (old == 0)
511 regulator_disable(priv->regulator);
512}
513
325static struct plat_serial8250_port ams_delta_modem_ports[] = { 514static struct plat_serial8250_port ams_delta_modem_ports[] = {
326 { 515 {
327 .membase = IOMEM(AMS_DELTA_MODEM_VIRT), 516 .membase = IOMEM(MODEM_VIRT),
328 .mapbase = AMS_DELTA_MODEM_PHYS, 517 .mapbase = MODEM_PHYS,
329 .irq = -EINVAL, /* changed later */ 518 .irq = -EINVAL, /* changed later */
330 .flags = UPF_BOOT_AUTOCONF, 519 .flags = UPF_BOOT_AUTOCONF,
331 .irqflags = IRQF_TRIGGER_RISING, 520 .irqflags = IRQF_TRIGGER_RISING,
332 .iotype = UPIO_MEM, 521 .iotype = UPIO_MEM,
333 .regshift = 1, 522 .regshift = 1,
334 .uartclk = BASE_BAUD * 16, 523 .uartclk = BASE_BAUD * 16,
524 .pm = modem_pm,
525 .private_data = &modem_priv,
335 }, 526 },
336 { }, 527 { },
337}; 528};
@@ -344,13 +535,27 @@ static struct platform_device ams_delta_modem_device = {
344 }, 535 },
345}; 536};
346 537
347static int __init ams_delta_modem_init(void) 538static int __init late_init(void)
348{ 539{
349 int err; 540 int err;
350 541
351 if (!machine_is_ams_delta()) 542 if (!machine_is_ams_delta())
352 return -ENODEV; 543 return -ENODEV;
353 544
545 err = gpio_request_array(latch_gpios, ARRAY_SIZE(latch_gpios));
546 if (err) {
547 pr_err("Couldn't take over latch1/latch2 GPIO pins\n");
548 return err;
549 }
550
551 platform_add_devices(late_devices, ARRAY_SIZE(late_devices));
552
553 err = platform_device_register(&modem_nreset_device);
554 if (err) {
555 pr_err("Couldn't register the modem regulator device\n");
556 return err;
557 }
558
354 omap_cfg_reg(M14_1510_GPIO2); 559 omap_cfg_reg(M14_1510_GPIO2);
355 ams_delta_modem_ports[0].irq = 560 ams_delta_modem_ports[0].irq =
356 gpio_to_irq(AMS_DELTA_GPIO_PIN_MODEM_IRQ); 561 gpio_to_irq(AMS_DELTA_GPIO_PIN_MODEM_IRQ);
@@ -362,13 +567,35 @@ static int __init ams_delta_modem_init(void)
362 } 567 }
363 gpio_direction_input(AMS_DELTA_GPIO_PIN_MODEM_IRQ); 568 gpio_direction_input(AMS_DELTA_GPIO_PIN_MODEM_IRQ);
364 569
365 ams_delta_latch2_write( 570 /* Initialize the modem_nreset regulator consumer before use */
366 AMS_DELTA_LATCH2_MODEM_NRESET | AMS_DELTA_LATCH2_MODEM_CODEC, 571 modem_priv.regulator = ERR_PTR(-ENODEV);
367 AMS_DELTA_LATCH2_MODEM_NRESET | AMS_DELTA_LATCH2_MODEM_CODEC); 572
573 ams_delta_latch2_write(AMS_DELTA_LATCH2_MODEM_CODEC,
574 AMS_DELTA_LATCH2_MODEM_CODEC);
575
576 err = platform_device_register(&ams_delta_modem_device);
577 if (err)
578 goto gpio_free;
368 579
369 return platform_device_register(&ams_delta_modem_device); 580 /*
581 * Once the modem device is registered, the modem_nreset
582 * regulator can be requested on behalf of that device.
583 */
584 modem_priv.regulator = regulator_get(&ams_delta_modem_device.dev,
585 "RESET#");
586 if (IS_ERR(modem_priv.regulator)) {
587 err = PTR_ERR(modem_priv.regulator);
588 goto unregister;
589 }
590 return 0;
591
592unregister:
593 platform_device_unregister(&ams_delta_modem_device);
594gpio_free:
595 gpio_free(AMS_DELTA_GPIO_PIN_MODEM_IRQ);
596 return err;
370} 597}
371arch_initcall(ams_delta_modem_init); 598late_initcall(late_init);
372 599
373static void __init ams_delta_map_io(void) 600static void __init ams_delta_map_io(void)
374{ 601{
@@ -387,6 +614,3 @@ MACHINE_START(AMS_DELTA, "Amstrad E3 (Delta)")
387 .timer = &omap1_timer, 614 .timer = &omap1_timer,
388 .restart = omap1_restart, 615 .restart = omap1_restart,
389MACHINE_END 616MACHINE_END
390
391EXPORT_SYMBOL(ams_delta_latch1_write);
392EXPORT_SYMBOL(ams_delta_latch2_write);
diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index 21a4095a1000..36b371face3d 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -245,10 +245,11 @@ config MACH_NOKIA_N8X0
245 select MACH_NOKIA_N810_WIMAX 245 select MACH_NOKIA_N810_WIMAX
246 246
247config MACH_NOKIA_RM680 247config MACH_NOKIA_RM680
248 bool "Nokia RM-680 board" 248 bool "Nokia RM-680/696 board"
249 depends on ARCH_OMAP3 249 depends on ARCH_OMAP3
250 default y 250 default y
251 select OMAP_PACKAGE_CBB 251 select OMAP_PACKAGE_CBB
252 select MACH_NOKIA_RM696
252 253
253config MACH_NOKIA_RX51 254config MACH_NOKIA_RX51
254 bool "Nokia RX-51 board" 255 bool "Nokia RX-51 board"
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 3f850fca8c92..49f92bc1c311 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -270,4 +270,7 @@ ifneq ($(CONFIG_HWSPINLOCK_OMAP),)
270obj-y += hwspinlock.o 270obj-y += hwspinlock.o
271endif 271endif
272 272
273emac-$(CONFIG_TI_DAVINCI_EMAC) := am35xx-emac.o
274obj-y += $(emac-m) $(emac-y)
275
273obj-y += common-board-devices.o twl-common.o 276obj-y += common-board-devices.o twl-common.o
diff --git a/arch/arm/mach-omap2/am35xx-emac.c b/arch/arm/mach-omap2/am35xx-emac.c
new file mode 100644
index 000000000000..1f97e7475206
--- /dev/null
+++ b/arch/arm/mach-omap2/am35xx-emac.c
@@ -0,0 +1,117 @@
1/*
2 * Copyright (C) 2011 Ilya Yanok, Emcraft Systems
3 *
4 * Based on mach-omap2/board-am3517evm.c
5 * Copyright (C) 2009 Texas Instruments Incorporated
6 * Author: Ranjith Lohithakshan <ranjithl@ti.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2
10 * published by the Free Software Foundation.
11 *
12 * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
13 * whether express or implied; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 */
17
18#include <linux/clk.h>
19#include <linux/davinci_emac.h>
20#include <linux/platform_device.h>
21#include <plat/irqs.h>
22#include <mach/am35xx.h>
23
24#include "control.h"
25
26static struct mdio_platform_data am35xx_emac_mdio_pdata;
27
28static struct resource am35xx_emac_mdio_resources[] = {
29 DEFINE_RES_MEM(AM35XX_IPSS_EMAC_BASE + AM35XX_EMAC_MDIO_OFFSET, SZ_4K),
30};
31
32static struct platform_device am35xx_emac_mdio_device = {
33 .name = "davinci_mdio",
34 .id = 0,
35 .num_resources = ARRAY_SIZE(am35xx_emac_mdio_resources),
36 .resource = am35xx_emac_mdio_resources,
37 .dev.platform_data = &am35xx_emac_mdio_pdata,
38};
39
40static void am35xx_enable_emac_int(void)
41{
42 u32 regval;
43
44 regval = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR);
45 regval = (regval | AM35XX_CPGMAC_C0_RX_PULSE_CLR |
46 AM35XX_CPGMAC_C0_TX_PULSE_CLR |
47 AM35XX_CPGMAC_C0_MISC_PULSE_CLR |
48 AM35XX_CPGMAC_C0_RX_THRESH_CLR);
49 omap_ctrl_writel(regval, AM35XX_CONTROL_LVL_INTR_CLEAR);
50 regval = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR);
51}
52
53static void am35xx_disable_emac_int(void)
54{
55 u32 regval;
56
57 regval = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR);
58 regval = (regval | AM35XX_CPGMAC_C0_RX_PULSE_CLR |
59 AM35XX_CPGMAC_C0_TX_PULSE_CLR);
60 omap_ctrl_writel(regval, AM35XX_CONTROL_LVL_INTR_CLEAR);
61 regval = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR);
62}
63
64static struct emac_platform_data am35xx_emac_pdata = {
65 .ctrl_reg_offset = AM35XX_EMAC_CNTRL_OFFSET,
66 .ctrl_mod_reg_offset = AM35XX_EMAC_CNTRL_MOD_OFFSET,
67 .ctrl_ram_offset = AM35XX_EMAC_CNTRL_RAM_OFFSET,
68 .ctrl_ram_size = AM35XX_EMAC_CNTRL_RAM_SIZE,
69 .hw_ram_addr = AM35XX_EMAC_HW_RAM_ADDR,
70 .version = EMAC_VERSION_2,
71 .interrupt_enable = am35xx_enable_emac_int,
72 .interrupt_disable = am35xx_disable_emac_int,
73};
74
75static struct resource am35xx_emac_resources[] = {
76 DEFINE_RES_MEM(AM35XX_IPSS_EMAC_BASE, 0x30000),
77 DEFINE_RES_IRQ(INT_35XX_EMAC_C0_RXTHRESH_IRQ),
78 DEFINE_RES_IRQ(INT_35XX_EMAC_C0_RX_PULSE_IRQ),
79 DEFINE_RES_IRQ(INT_35XX_EMAC_C0_TX_PULSE_IRQ),
80 DEFINE_RES_IRQ(INT_35XX_EMAC_C0_MISC_PULSE_IRQ),
81};
82
83static struct platform_device am35xx_emac_device = {
84 .name = "davinci_emac",
85 .id = -1,
86 .num_resources = ARRAY_SIZE(am35xx_emac_resources),
87 .resource = am35xx_emac_resources,
88 .dev = {
89 .platform_data = &am35xx_emac_pdata,
90 },
91};
92
93void __init am35xx_emac_init(unsigned long mdio_bus_freq, u8 rmii_en)
94{
95 unsigned int regval;
96 int err;
97
98 am35xx_emac_pdata.rmii_en = rmii_en;
99 am35xx_emac_mdio_pdata.bus_freq = mdio_bus_freq;
100 err = platform_device_register(&am35xx_emac_device);
101 if (err) {
102 pr_err("AM35x: failed registering EMAC device: %d\n", err);
103 return;
104 }
105
106 err = platform_device_register(&am35xx_emac_mdio_device);
107 if (err) {
108 pr_err("AM35x: failed registering EMAC MDIO device: %d\n", err);
109 platform_device_unregister(&am35xx_emac_device);
110 return;
111 }
112
113 regval = omap_ctrl_readl(AM35XX_CONTROL_IP_SW_RESET);
114 regval = regval & (~(AM35XX_CPGMACSS_SW_RST));
115 omap_ctrl_writel(regval, AM35XX_CONTROL_IP_SW_RESET);
116 regval = omap_ctrl_readl(AM35XX_CONTROL_IP_SW_RESET);
117}
diff --git a/arch/arm/mach-omap2/am35xx-emac.h b/arch/arm/mach-omap2/am35xx-emac.h
new file mode 100644
index 000000000000..15c6f9ce59a2
--- /dev/null
+++ b/arch/arm/mach-omap2/am35xx-emac.h
@@ -0,0 +1,15 @@
1/*
2 * Copyright (C) 2011 Ilya Yanok, Emcraft Systems
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8
9#define AM35XX_DEFAULT_MDIO_FREQUENCY 1000000
10
11#if defined(CONFIG_TI_DAVINCI_EMAC) || defined(CONFIG_TI_DAVINCI_EMAC_MODULE)
12void am35xx_emac_init(unsigned long mdio_bus_freq, u8 rmii_en);
13#else
14static inline void am35xx_emac_init(unsigned long mdio_bus_freq, u8 rmii_en) {}
15#endif
diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c
index 890c446e7b35..30768c2f53fd 100644
--- a/arch/arm/mach-omap2/board-4430sdp.c
+++ b/arch/arm/mach-omap2/board-4430sdp.c
@@ -324,7 +324,10 @@ static struct spi_board_info sdp4430_spi_board_info[] __initdata = {
324 .bus_num = 1, 324 .bus_num = 1,
325 .chip_select = 0, 325 .chip_select = 0,
326 .max_speed_hz = 24000000, 326 .max_speed_hz = 24000000,
327 .irq = ETH_KS8851_IRQ, 327 /*
328 * .irq is set to gpio_to_irq(ETH_KS8851_IRQ)
329 * in omap_4430sdp_init
330 */
328 }, 331 },
329}; 332};
330 333
diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-omap2/board-am3517evm.c
index 71138a1271d8..3645285a3e2b 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -39,124 +39,11 @@
39#include <video/omap-panel-generic-dpi.h> 39#include <video/omap-panel-generic-dpi.h>
40#include <video/omap-panel-dvi.h> 40#include <video/omap-panel-dvi.h>
41 41
42#include "am35xx-emac.h"
42#include "mux.h" 43#include "mux.h"
43#include "control.h" 44#include "control.h"
44#include "hsmmc.h" 45#include "hsmmc.h"
45 46
46#define AM35XX_EVM_MDIO_FREQUENCY (1000000)
47
48static struct mdio_platform_data am3517_evm_mdio_pdata = {
49 .bus_freq = AM35XX_EVM_MDIO_FREQUENCY,
50};
51
52static struct resource am3517_mdio_resources[] = {
53 {
54 .start = AM35XX_IPSS_EMAC_BASE + AM35XX_EMAC_MDIO_OFFSET,
55 .end = AM35XX_IPSS_EMAC_BASE + AM35XX_EMAC_MDIO_OFFSET +
56 SZ_4K - 1,
57 .flags = IORESOURCE_MEM,
58 },
59};
60
61static struct platform_device am3517_mdio_device = {
62 .name = "davinci_mdio",
63 .id = 0,
64 .num_resources = ARRAY_SIZE(am3517_mdio_resources),
65 .resource = am3517_mdio_resources,
66 .dev.platform_data = &am3517_evm_mdio_pdata,
67};
68
69static struct emac_platform_data am3517_evm_emac_pdata = {
70 .rmii_en = 1,
71};
72
73static struct resource am3517_emac_resources[] = {
74 {
75 .start = AM35XX_IPSS_EMAC_BASE,
76 .end = AM35XX_IPSS_EMAC_BASE + 0x2FFFF,
77 .flags = IORESOURCE_MEM,
78 },
79 {
80 .start = INT_35XX_EMAC_C0_RXTHRESH_IRQ,
81 .end = INT_35XX_EMAC_C0_RXTHRESH_IRQ,
82 .flags = IORESOURCE_IRQ,
83 },
84 {
85 .start = INT_35XX_EMAC_C0_RX_PULSE_IRQ,
86 .end = INT_35XX_EMAC_C0_RX_PULSE_IRQ,
87 .flags = IORESOURCE_IRQ,
88 },
89 {
90 .start = INT_35XX_EMAC_C0_TX_PULSE_IRQ,
91 .end = INT_35XX_EMAC_C0_TX_PULSE_IRQ,
92 .flags = IORESOURCE_IRQ,
93 },
94 {
95 .start = INT_35XX_EMAC_C0_MISC_PULSE_IRQ,
96 .end = INT_35XX_EMAC_C0_MISC_PULSE_IRQ,
97 .flags = IORESOURCE_IRQ,
98 },
99};
100
101static struct platform_device am3517_emac_device = {
102 .name = "davinci_emac",
103 .id = -1,
104 .num_resources = ARRAY_SIZE(am3517_emac_resources),
105 .resource = am3517_emac_resources,
106};
107
108static void am3517_enable_ethernet_int(void)
109{
110 u32 regval;
111
112 regval = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR);
113 regval = (regval | AM35XX_CPGMAC_C0_RX_PULSE_CLR |
114 AM35XX_CPGMAC_C0_TX_PULSE_CLR |
115 AM35XX_CPGMAC_C0_MISC_PULSE_CLR |
116 AM35XX_CPGMAC_C0_RX_THRESH_CLR);
117 omap_ctrl_writel(regval, AM35XX_CONTROL_LVL_INTR_CLEAR);
118 regval = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR);
119}
120
121static void am3517_disable_ethernet_int(void)
122{
123 u32 regval;
124
125 regval = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR);
126 regval = (regval | AM35XX_CPGMAC_C0_RX_PULSE_CLR |
127 AM35XX_CPGMAC_C0_TX_PULSE_CLR);
128 omap_ctrl_writel(regval, AM35XX_CONTROL_LVL_INTR_CLEAR);
129 regval = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR);
130}
131
132static void am3517_evm_ethernet_init(struct emac_platform_data *pdata)
133{
134 unsigned int regval;
135
136 pdata->ctrl_reg_offset = AM35XX_EMAC_CNTRL_OFFSET;
137 pdata->ctrl_mod_reg_offset = AM35XX_EMAC_CNTRL_MOD_OFFSET;
138 pdata->ctrl_ram_offset = AM35XX_EMAC_CNTRL_RAM_OFFSET;
139 pdata->ctrl_ram_size = AM35XX_EMAC_CNTRL_RAM_SIZE;
140 pdata->version = EMAC_VERSION_2;
141 pdata->hw_ram_addr = AM35XX_EMAC_HW_RAM_ADDR;
142 pdata->interrupt_enable = am3517_enable_ethernet_int;
143 pdata->interrupt_disable = am3517_disable_ethernet_int;
144 am3517_emac_device.dev.platform_data = pdata;
145 platform_device_register(&am3517_emac_device);
146 platform_device_register(&am3517_mdio_device);
147 clk_add_alias(NULL, dev_name(&am3517_mdio_device.dev),
148 NULL, &am3517_emac_device.dev);
149
150 regval = omap_ctrl_readl(AM35XX_CONTROL_IP_SW_RESET);
151 regval = regval & (~(AM35XX_CPGMACSS_SW_RST));
152 omap_ctrl_writel(regval, AM35XX_CONTROL_IP_SW_RESET);
153 regval = omap_ctrl_readl(AM35XX_CONTROL_IP_SW_RESET);
154
155 return ;
156}
157
158
159
160#define LCD_PANEL_PWR 176 47#define LCD_PANEL_PWR 176
161#define LCD_PANEL_BKLIGHT_PWR 182 48#define LCD_PANEL_BKLIGHT_PWR 182
162#define LCD_PANEL_PWM 181 49#define LCD_PANEL_PWM 181
@@ -498,7 +385,7 @@ static void __init am3517_evm_init(void)
498 i2c_register_board_info(1, am3517evm_i2c1_boardinfo, 385 i2c_register_board_info(1, am3517evm_i2c1_boardinfo,
499 ARRAY_SIZE(am3517evm_i2c1_boardinfo)); 386 ARRAY_SIZE(am3517evm_i2c1_boardinfo));
500 /*Ethernet*/ 387 /*Ethernet*/
501 am3517_evm_ethernet_init(&am3517_evm_emac_pdata); 388 am35xx_emac_init(AM35XX_DEFAULT_MDIO_FREQUENCY, 1);
502 389
503 /* MUSB */ 390 /* MUSB */
504 am3517_evm_musb_init(); 391 am3517_evm_musb_init();
diff --git a/arch/arm/mach-omap2/board-cm-t3517.c b/arch/arm/mach-omap2/board-cm-t3517.c
index f36d694d2159..9e66e167e4f3 100644
--- a/arch/arm/mach-omap2/board-cm-t3517.c
+++ b/arch/arm/mach-omap2/board-cm-t3517.c
@@ -49,6 +49,7 @@
49#include "mux.h" 49#include "mux.h"
50#include "control.h" 50#include "control.h"
51#include "common-board-devices.h" 51#include "common-board-devices.h"
52#include "am35xx-emac.h"
52 53
53#if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE) 54#if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE)
54static struct gpio_led cm_t3517_leds[] = { 55static struct gpio_led cm_t3517_leds[] = {
@@ -291,6 +292,7 @@ static void __init cm_t3517_init(void)
291 cm_t3517_init_rtc(); 292 cm_t3517_init_rtc();
292 cm_t3517_init_usbh(); 293 cm_t3517_init_usbh();
293 cm_t3517_init_hecc(); 294 cm_t3517_init_hecc();
295 am35xx_emac_init(AM35XX_DEFAULT_MDIO_FREQUENCY, 1);
294} 296}
295 297
296MACHINE_START(CM_T3517, "Compulab CM-T3517") 298MACHINE_START(CM_T3517, "Compulab CM-T3517")
diff --git a/arch/arm/mach-omap2/board-omap3logic.c b/arch/arm/mach-omap2/board-omap3logic.c
index 2304ba340e99..4a7d8c8a75da 100644
--- a/arch/arm/mach-omap2/board-omap3logic.c
+++ b/arch/arm/mach-omap2/board-omap3logic.c
@@ -205,6 +205,7 @@ static void __init omap3logic_init(void)
205 205
206MACHINE_START(OMAP3_TORPEDO, "Logic OMAP3 Torpedo board") 206MACHINE_START(OMAP3_TORPEDO, "Logic OMAP3 Torpedo board")
207 .atag_offset = 0x100, 207 .atag_offset = 0x100,
208 .reserve = omap_reserve,
208 .map_io = omap3_map_io, 209 .map_io = omap3_map_io,
209 .init_early = omap35xx_init_early, 210 .init_early = omap35xx_init_early,
210 .init_irq = omap3_init_irq, 211 .init_irq = omap3_init_irq,
@@ -216,6 +217,7 @@ MACHINE_END
216 217
217MACHINE_START(OMAP3530_LV_SOM, "OMAP Logic 3530 LV SOM board") 218MACHINE_START(OMAP3530_LV_SOM, "OMAP Logic 3530 LV SOM board")
218 .atag_offset = 0x100, 219 .atag_offset = 0x100,
220 .reserve = omap_reserve,
219 .map_io = omap3_map_io, 221 .map_io = omap3_map_io,
220 .init_early = omap35xx_init_early, 222 .init_early = omap35xx_init_early,
221 .init_irq = omap3_init_irq, 223 .init_irq = omap3_init_irq,
diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c
index 7184b8b9e38f..33d995d0f075 100644
--- a/arch/arm/mach-omap2/board-omap3pandora.c
+++ b/arch/arm/mach-omap2/board-omap3pandora.c
@@ -121,6 +121,11 @@ static struct platform_device pandora_leds_gpio = {
121 }, 121 },
122}; 122};
123 123
124static struct platform_device pandora_backlight = {
125 .name = "pandora-backlight",
126 .id = -1,
127};
128
124#define GPIO_BUTTON(gpio_num, ev_type, ev_code, act_low, descr) \ 129#define GPIO_BUTTON(gpio_num, ev_type, ev_code, act_low, descr) \
125{ \ 130{ \
126 .gpio = gpio_num, \ 131 .gpio = gpio_num, \
@@ -478,6 +483,10 @@ static struct platform_device pandora_vwlan_device = {
478 483
479static struct twl4030_bci_platform_data pandora_bci_data; 484static struct twl4030_bci_platform_data pandora_bci_data;
480 485
486static struct twl4030_power_data pandora_power_data = {
487 .use_poweroff = true,
488};
489
481static struct twl4030_platform_data omap3pandora_twldata = { 490static struct twl4030_platform_data omap3pandora_twldata = {
482 .gpio = &omap3pandora_gpio_data, 491 .gpio = &omap3pandora_gpio_data,
483 .vmmc1 = &pandora_vmmc1, 492 .vmmc1 = &pandora_vmmc1,
@@ -488,6 +497,7 @@ static struct twl4030_platform_data omap3pandora_twldata = {
488 .vsim = &pandora_vsim, 497 .vsim = &pandora_vsim,
489 .keypad = &pandora_kp_data, 498 .keypad = &pandora_kp_data,
490 .bci = &pandora_bci_data, 499 .bci = &pandora_bci_data,
500 .power = &pandora_power_data,
491}; 501};
492 502
493static struct i2c_board_info __initdata omap3pandora_i2c3_boardinfo[] = { 503static struct i2c_board_info __initdata omap3pandora_i2c3_boardinfo[] = {
@@ -559,6 +569,7 @@ static struct platform_device *omap3pandora_devices[] __initdata = {
559 &pandora_leds_gpio, 569 &pandora_leds_gpio,
560 &pandora_keys_gpio, 570 &pandora_keys_gpio,
561 &pandora_vwlan_device, 571 &pandora_vwlan_device,
572 &pandora_backlight,
562}; 573};
563 574
564static const struct usbhs_omap_board_data usbhs_bdata __initconst = { 575static const struct usbhs_omap_board_data usbhs_bdata __initconst = {
diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c
index 866411d4fe65..e9071a57c37b 100644
--- a/arch/arm/mach-omap2/board-omap4panda.c
+++ b/arch/arm/mach-omap2/board-omap4panda.c
@@ -116,10 +116,16 @@ static struct platform_device panda_abe_audio = {
116 }, 116 },
117}; 117};
118 118
119static struct platform_device btwilink_device = {
120 .name = "btwilink",
121 .id = -1,
122};
123
119static struct platform_device *panda_devices[] __initdata = { 124static struct platform_device *panda_devices[] __initdata = {
120 &leds_gpio, 125 &leds_gpio,
121 &wl1271_device, 126 &wl1271_device,
122 &panda_abe_audio, 127 &panda_abe_audio,
128 &btwilink_device,
123}; 129};
124 130
125static const struct usbhs_omap_board_data usbhs_bdata __initconst = { 131static const struct usbhs_omap_board_data usbhs_bdata __initconst = {
diff --git a/arch/arm/mach-omap2/board-rm680.c b/arch/arm/mach-omap2/board-rm680.c
index 2d24c98f3d45..ae53d71f0ce0 100644
--- a/arch/arm/mach-omap2/board-rm680.c
+++ b/arch/arm/mach-omap2/board-rm680.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Board support file for Nokia RM-680. 2 * Board support file for Nokia RM-680/696.
3 * 3 *
4 * Copyright (C) 2010 Nokia 4 * Copyright (C) 2010 Nokia
5 * 5 *
@@ -154,3 +154,15 @@ MACHINE_START(NOKIA_RM680, "Nokia RM-680 board")
154 .timer = &omap3_timer, 154 .timer = &omap3_timer,
155 .restart = omap_prcm_restart, 155 .restart = omap_prcm_restart,
156MACHINE_END 156MACHINE_END
157
158MACHINE_START(NOKIA_RM696, "Nokia RM-696 board")
159 .atag_offset = 0x100,
160 .reserve = omap_reserve,
161 .map_io = omap3_map_io,
162 .init_early = omap3630_init_early,
163 .init_irq = omap3_init_irq,
164 .handle_irq = omap3_intc_handle_irq,
165 .init_machine = rm680_init,
166 .timer = &omap3_timer,
167 .restart = omap_prcm_restart,
168MACHINE_END
diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c b/arch/arm/mach-omap2/board-rx51-peripherals.c
index 0f65c3b202ac..16aebfb8a7ec 100644
--- a/arch/arm/mach-omap2/board-rx51-peripherals.c
+++ b/arch/arm/mach-omap2/board-rx51-peripherals.c
@@ -1102,6 +1102,11 @@ static struct tsc2005_platform_data tsc2005_pdata = {
1102 .esd_timeout_ms = 8000, 1102 .esd_timeout_ms = 8000,
1103}; 1103};
1104 1104
1105static struct gpio rx51_tsc2005_gpios[] __initdata = {
1106 { RX51_TSC2005_IRQ_GPIO, GPIOF_IN, "tsc2005 IRQ" },
1107 { RX51_TSC2005_RESET_GPIO, GPIOF_OUT_INIT_HIGH, "tsc2005 reset" },
1108};
1109
1105static void rx51_tsc2005_set_reset(bool enable) 1110static void rx51_tsc2005_set_reset(bool enable)
1106{ 1111{
1107 gpio_set_value(RX51_TSC2005_RESET_GPIO, enable); 1112 gpio_set_value(RX51_TSC2005_RESET_GPIO, enable);
@@ -1111,20 +1116,18 @@ static void __init rx51_init_tsc2005(void)
1111{ 1116{
1112 int r; 1117 int r;
1113 1118
1114 r = gpio_request_one(RX51_TSC2005_IRQ_GPIO, GPIOF_IN, "tsc2005 IRQ"); 1119 omap_mux_init_gpio(RX51_TSC2005_RESET_GPIO, OMAP_PIN_OUTPUT);
1115 if (r < 0) { 1120 omap_mux_init_gpio(RX51_TSC2005_IRQ_GPIO, OMAP_PIN_INPUT_PULLUP);
1116 printk(KERN_ERR "unable to get %s GPIO\n", "tsc2005 IRQ");
1117 rx51_peripherals_spi_board_info[RX51_SPI_TSC2005].irq = 0;
1118 }
1119 1121
1120 r = gpio_request_one(RX51_TSC2005_RESET_GPIO, GPIOF_OUT_INIT_HIGH, 1122 r = gpio_request_array(rx51_tsc2005_gpios,
1121 "tsc2005 reset"); 1123 ARRAY_SIZE(rx51_tsc2005_gpios));
1122 if (r >= 0) { 1124 if (r < 0) {
1123 tsc2005_pdata.set_reset = rx51_tsc2005_set_reset; 1125 printk(KERN_ERR "tsc2005 board initialization failed\n");
1124 } else {
1125 printk(KERN_ERR "unable to get %s GPIO\n", "tsc2005 reset");
1126 tsc2005_pdata.esd_timeout_ms = 0; 1126 tsc2005_pdata.esd_timeout_ms = 0;
1127 return;
1127 } 1128 }
1129
1130 tsc2005_pdata.set_reset = rx51_tsc2005_set_reset;
1128} 1131}
1129 1132
1130void __init rx51_peripherals_init(void) 1133void __init rx51_peripherals_init(void)
diff --git a/arch/arm/mach-pxa/hx4700.c b/arch/arm/mach-pxa/hx4700.c
index 208eef1c0485..f309bf975202 100644
--- a/arch/arm/mach-pxa/hx4700.c
+++ b/arch/arm/mach-pxa/hx4700.c
@@ -97,9 +97,9 @@ static unsigned long hx4700_pin_config[] __initdata = {
97 97
98 /* BTUART */ 98 /* BTUART */
99 GPIO42_BTUART_RXD, 99 GPIO42_BTUART_RXD,
100 GPIO43_BTUART_TXD, 100 GPIO43_BTUART_TXD_LPM_LOW,
101 GPIO44_BTUART_CTS, 101 GPIO44_BTUART_CTS,
102 GPIO45_BTUART_RTS, 102 GPIO45_BTUART_RTS_LPM_LOW,
103 103
104 /* PWM 1 (Backlight) */ 104 /* PWM 1 (Backlight) */
105 GPIO17_PWM1_OUT, 105 GPIO17_PWM1_OUT,
@@ -245,6 +245,21 @@ static u16 asic3_gpio_config[] = {
245 ASIC3_GPIOD15_nPIOW, 245 ASIC3_GPIOD15_nPIOW,
246}; 246};
247 247
248static struct asic3_led asic3_leds[ASIC3_NUM_LEDS] = {
249 [0] = {
250 .name = "hx4700:amber",
251 .default_trigger = "ds2760-battery.0-charging-blink-full-solid",
252 },
253 [1] = {
254 .name = "hx4700:green",
255 .default_trigger = "unused",
256 },
257 [2] = {
258 .name = "hx4700:blue",
259 .default_trigger = "hx4700-radio",
260 },
261};
262
248static struct resource asic3_resources[] = { 263static struct resource asic3_resources[] = {
249 /* GPIO part */ 264 /* GPIO part */
250 [0] = { 265 [0] = {
@@ -275,6 +290,7 @@ static struct asic3_platform_data asic3_platform_data = {
275 .gpio_config_num = ARRAY_SIZE(asic3_gpio_config), 290 .gpio_config_num = ARRAY_SIZE(asic3_gpio_config),
276 .irq_base = IRQ_BOARD_START, 291 .irq_base = IRQ_BOARD_START,
277 .gpio_base = HX4700_ASIC3_GPIO_BASE, 292 .gpio_base = HX4700_ASIC3_GPIO_BASE,
293 .leds = asic3_leds,
278}; 294};
279 295
280static struct platform_device asic3 = { 296static struct platform_device asic3 = {
@@ -705,10 +721,9 @@ static void hx4700_set_vpp(struct platform_device *pdev, int vpp)
705 gpio_set_value(GPIO91_HX4700_FLASH_VPEN, vpp); 721 gpio_set_value(GPIO91_HX4700_FLASH_VPEN, vpp);
706} 722}
707 723
708static struct resource strataflash_resource = { 724static struct resource strataflash_resource[] = {
709 .start = PXA_CS0_PHYS, 725 [0] = DEFINE_RES_MEM(PXA_CS0_PHYS, SZ_64M),
710 .end = PXA_CS0_PHYS + SZ_128M - 1, 726 [1] = DEFINE_RES_MEM(PXA_CS0_PHYS + SZ_64M, SZ_64M),
711 .flags = IORESOURCE_MEM,
712}; 727};
713 728
714static struct physmap_flash_data strataflash_data = { 729static struct physmap_flash_data strataflash_data = {
@@ -719,8 +734,8 @@ static struct physmap_flash_data strataflash_data = {
719static struct platform_device strataflash = { 734static struct platform_device strataflash = {
720 .name = "physmap-flash", 735 .name = "physmap-flash",
721 .id = -1, 736 .id = -1,
722 .resource = &strataflash_resource, 737 .resource = strataflash_resource,
723 .num_resources = 1, 738 .num_resources = ARRAY_SIZE(strataflash_resource),
724 .dev = { 739 .dev = {
725 .platform_data = &strataflash_data, 740 .platform_data = &strataflash_data,
726 }, 741 },
@@ -788,17 +803,6 @@ static struct platform_device audio = {
788 803
789 804
790/* 805/*
791 * PCMCIA
792 */
793
794static struct platform_device pcmcia = {
795 .name = "hx4700-pcmcia",
796 .dev = {
797 .parent = &asic3.dev,
798 },
799};
800
801/*
802 * Platform devices 806 * Platform devices
803 */ 807 */
804 808
@@ -814,7 +818,6 @@ static struct platform_device *devices[] __initdata = {
814 &power_supply, 818 &power_supply,
815 &strataflash, 819 &strataflash,
816 &audio, 820 &audio,
817 &pcmcia,
818}; 821};
819 822
820static struct gpio global_gpios[] = { 823static struct gpio global_gpios[] = {
@@ -830,7 +833,6 @@ static struct gpio global_gpios[] = {
830 { GPIO32_HX4700_RS232_ON, GPIOF_OUT_INIT_HIGH, "RS232_ON" }, 833 { GPIO32_HX4700_RS232_ON, GPIOF_OUT_INIT_HIGH, "RS232_ON" },
831 { GPIO71_HX4700_ASIC3_nRESET, GPIOF_OUT_INIT_HIGH, "ASIC3_nRESET" }, 834 { GPIO71_HX4700_ASIC3_nRESET, GPIOF_OUT_INIT_HIGH, "ASIC3_nRESET" },
832 { GPIO82_HX4700_EUART_RESET, GPIOF_OUT_INIT_HIGH, "EUART_RESET" }, 835 { GPIO82_HX4700_EUART_RESET, GPIOF_OUT_INIT_HIGH, "EUART_RESET" },
833 { GPIO105_HX4700_nIR_ON, GPIOF_OUT_INIT_HIGH, "nIR_EN" },
834}; 836};
835 837
836static void __init hx4700_init(void) 838static void __init hx4700_init(void)
diff --git a/arch/arm/mach-pxa/include/mach/mfp-pxa27x.h b/arch/arm/mach-pxa/include/mach/mfp-pxa27x.h
index ec0f0b0b6744..a65867209aa0 100644
--- a/arch/arm/mach-pxa/include/mach/mfp-pxa27x.h
+++ b/arch/arm/mach-pxa/include/mach/mfp-pxa27x.h
@@ -158,7 +158,9 @@
158#define GPIO44_BTUART_CTS MFP_CFG_IN(GPIO44, AF1) 158#define GPIO44_BTUART_CTS MFP_CFG_IN(GPIO44, AF1)
159#define GPIO42_BTUART_RXD MFP_CFG_IN(GPIO42, AF1) 159#define GPIO42_BTUART_RXD MFP_CFG_IN(GPIO42, AF1)
160#define GPIO45_BTUART_RTS MFP_CFG_OUT(GPIO45, AF2, DRIVE_HIGH) 160#define GPIO45_BTUART_RTS MFP_CFG_OUT(GPIO45, AF2, DRIVE_HIGH)
161#define GPIO45_BTUART_RTS_LPM_LOW MFP_CFG_OUT(GPIO45, AF2, DRIVE_LOW)
161#define GPIO43_BTUART_TXD MFP_CFG_OUT(GPIO43, AF2, DRIVE_HIGH) 162#define GPIO43_BTUART_TXD MFP_CFG_OUT(GPIO43, AF2, DRIVE_HIGH)
163#define GPIO43_BTUART_TXD_LPM_LOW MFP_CFG_OUT(GPIO43, AF2, DRIVE_LOW)
162 164
163/* STUART */ 165/* STUART */
164#define GPIO46_STUART_RXD MFP_CFG_IN(GPIO46, AF2) 166#define GPIO46_STUART_RXD MFP_CFG_IN(GPIO46, AF2)
diff --git a/arch/arm/mach-s3c64xx/Kconfig b/arch/arm/mach-s3c64xx/Kconfig
index 326ea3a98725..82c0915729ee 100644
--- a/arch/arm/mach-s3c64xx/Kconfig
+++ b/arch/arm/mach-s3c64xx/Kconfig
@@ -304,5 +304,6 @@ config MACH_WLF_CRAGG_6410
304 select S3C64XX_DEV_SPI0 304 select S3C64XX_DEV_SPI0
305 select SAMSUNG_GPIO_EXTRA128 305 select SAMSUNG_GPIO_EXTRA128
306 select I2C 306 select I2C
307 select LEDS_GPIO_REGISTER
307 help 308 help
308 Machine support for the Wolfson Cragganmore S3C6410 variant. 309 Machine support for the Wolfson Cragganmore S3C6410 variant.
diff --git a/arch/arm/mach-s3c64xx/mach-crag6410-module.c b/arch/arm/mach-s3c64xx/mach-crag6410-module.c
index 32a30f38ba0c..b6a67728cc88 100644
--- a/arch/arm/mach-s3c64xx/mach-crag6410-module.c
+++ b/arch/arm/mach-s3c64xx/mach-crag6410-module.c
@@ -11,6 +11,7 @@
11#include <linux/export.h> 11#include <linux/export.h>
12#include <linux/interrupt.h> 12#include <linux/interrupt.h>
13#include <linux/i2c.h> 13#include <linux/i2c.h>
14#include <linux/spi/spi.h>
14 15
15#include <linux/mfd/wm831x/irq.h> 16#include <linux/mfd/wm831x/irq.h>
16#include <linux/mfd/wm831x/gpio.h> 17#include <linux/mfd/wm831x/gpio.h>
@@ -21,8 +22,25 @@
21#include <sound/wm8962.h> 22#include <sound/wm8962.h>
22#include <sound/wm9081.h> 23#include <sound/wm9081.h>
23 24
25#include <plat/s3c64xx-spi.h>
26
24#include <mach/crag6410.h> 27#include <mach/crag6410.h>
25 28
29static struct s3c64xx_spi_csinfo wm0010_spi_csinfo = {
30 .set_level = gpio_set_value,
31 .line = S3C64XX_GPC(3),
32};
33
34static struct spi_board_info wm1253_devs[] = {
35 [0] = {
36 .modalias = "wm0010",
37 .bus_num = 0,
38 .chip_select = 0,
39 .mode = SPI_MODE_0,
40 .controller_data = &wm0010_spi_csinfo,
41 },
42};
43
26static struct wm5100_pdata wm5100_pdata = { 44static struct wm5100_pdata wm5100_pdata = {
27 .ldo_ena = S3C64XX_GPN(7), 45 .ldo_ena = S3C64XX_GPN(7),
28 .irq_flags = IRQF_TRIGGER_HIGH, 46 .irq_flags = IRQF_TRIGGER_HIGH,
@@ -159,14 +177,21 @@ static __devinitdata const struct {
159 const char *name; 177 const char *name;
160 const struct i2c_board_info *i2c_devs; 178 const struct i2c_board_info *i2c_devs;
161 int num_i2c_devs; 179 int num_i2c_devs;
180 const struct spi_board_info *spi_devs;
181 int num_spi_devs;
162} gf_mods[] = { 182} gf_mods[] = {
163 { .id = 0x01, .name = "1250-EV1 Springbank" }, 183 { .id = 0x01, .name = "1250-EV1 Springbank" },
164 { .id = 0x02, .name = "1251-EV1 Jura" }, 184 { .id = 0x02, .name = "1251-EV1 Jura" },
165 { .id = 0x03, .name = "1252-EV1 Glenlivet" }, 185 { .id = 0x03, .name = "1252-EV1 Glenlivet" },
166 { .id = 0x11, .name = "6249-EV2 Glenfarclas", }, 186 { .id = 0x11, .name = "6249-EV2 Glenfarclas", },
187 { .id = 0x14, .name = "6271-EV1 Lochnagar" },
188 { .id = 0x15, .name = "XXXX-EV1 Bells" },
167 { .id = 0x21, .name = "1275-EV1 Mortlach" }, 189 { .id = 0x21, .name = "1275-EV1 Mortlach" },
168 { .id = 0x25, .name = "1274-EV1 Glencadam" }, 190 { .id = 0x25, .name = "1274-EV1 Glencadam" },
169 { .id = 0x31, .name = "1253-EV1 Tomatin", }, 191 { .id = 0x31, .name = "1253-EV1 Tomatin",
192 .spi_devs = wm1253_devs, .num_spi_devs = ARRAY_SIZE(wm1253_devs) },
193 { .id = 0x32, .name = "XXXX-EV1 Caol Illa" },
194 { .id = 0x33, .name = "XXXX-EV1 Oban" },
170 { .id = 0x39, .name = "1254-EV1 Dallas Dhu", 195 { .id = 0x39, .name = "1254-EV1 Dallas Dhu",
171 .i2c_devs = wm1254_devs, .num_i2c_devs = ARRAY_SIZE(wm1254_devs) }, 196 .i2c_devs = wm1254_devs, .num_i2c_devs = ARRAY_SIZE(wm1254_devs) },
172 { .id = 0x3a, .name = "1259-EV1 Tobermory", 197 { .id = 0x3a, .name = "1259-EV1 Tobermory",
@@ -198,12 +223,16 @@ static __devinit int wlf_gf_module_probe(struct i2c_client *i2c,
198 if (i < ARRAY_SIZE(gf_mods)) { 223 if (i < ARRAY_SIZE(gf_mods)) {
199 dev_info(&i2c->dev, "%s revision %d\n", 224 dev_info(&i2c->dev, "%s revision %d\n",
200 gf_mods[i].name, rev + 1); 225 gf_mods[i].name, rev + 1);
226
201 for (j = 0; j < gf_mods[i].num_i2c_devs; j++) { 227 for (j = 0; j < gf_mods[i].num_i2c_devs; j++) {
202 if (!i2c_new_device(i2c->adapter, 228 if (!i2c_new_device(i2c->adapter,
203 &(gf_mods[i].i2c_devs[j]))) 229 &(gf_mods[i].i2c_devs[j])))
204 dev_err(&i2c->dev, 230 dev_err(&i2c->dev,
205 "Failed to register dev: %d\n", ret); 231 "Failed to register dev: %d\n", ret);
206 } 232 }
233
234 spi_register_board_info(gf_mods[i].spi_devs,
235 gf_mods[i].num_spi_devs);
207 } else { 236 } else {
208 dev_warn(&i2c->dev, "Unknown module ID 0x%x revision %d\n", 237 dev_warn(&i2c->dev, "Unknown module ID 0x%x revision %d\n",
209 id, rev + 1); 238 id, rev + 1);
diff --git a/arch/arm/mach-s3c64xx/mach-crag6410.c b/arch/arm/mach-s3c64xx/mach-crag6410.c
index 3b56bd9cb880..e20bf5835365 100644
--- a/arch/arm/mach-s3c64xx/mach-crag6410.c
+++ b/arch/arm/mach-s3c64xx/mach-crag6410.c
@@ -19,7 +19,9 @@
19#include <linux/io.h> 19#include <linux/io.h>
20#include <linux/init.h> 20#include <linux/init.h>
21#include <linux/gpio.h> 21#include <linux/gpio.h>
22#include <linux/leds.h>
22#include <linux/delay.h> 23#include <linux/delay.h>
24#include <linux/mmc/host.h>
23#include <linux/regulator/machine.h> 25#include <linux/regulator/machine.h>
24#include <linux/regulator/fixed.h> 26#include <linux/regulator/fixed.h>
25#include <linux/pwm_backlight.h> 27#include <linux/pwm_backlight.h>
@@ -299,6 +301,7 @@ static struct platform_device littlemill_device = {
299}; 301};
300 302
301static struct regulator_consumer_supply wallvdd_consumers[] = { 303static struct regulator_consumer_supply wallvdd_consumers[] = {
304 REGULATOR_SUPPLY("SPKVDD", "1-001a"),
302 REGULATOR_SUPPLY("SPKVDD1", "1-001a"), 305 REGULATOR_SUPPLY("SPKVDD1", "1-001a"),
303 REGULATOR_SUPPLY("SPKVDD2", "1-001a"), 306 REGULATOR_SUPPLY("SPKVDD2", "1-001a"),
304 REGULATOR_SUPPLY("SPKVDDL", "1-001a"), 307 REGULATOR_SUPPLY("SPKVDDL", "1-001a"),
@@ -575,11 +578,19 @@ static struct s3c2410_platform_i2c i2c0_pdata = {
575 .frequency = 400000, 578 .frequency = 400000,
576}; 579};
577 580
581static struct regulator_consumer_supply pvdd_1v2_consumers[] __initdata = {
582 REGULATOR_SUPPLY("DCVDD", "spi0.0"),
583 REGULATOR_SUPPLY("AVDD", "spi0.0"),
584};
585
578static struct regulator_init_data pvdd_1v2 __initdata = { 586static struct regulator_init_data pvdd_1v2 __initdata = {
579 .constraints = { 587 .constraints = {
580 .name = "PVDD_1V2", 588 .name = "PVDD_1V2",
581 .always_on = 1, 589 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
582 }, 590 },
591
592 .consumer_supplies = pvdd_1v2_consumers,
593 .num_consumer_supplies = ARRAY_SIZE(pvdd_1v2_consumers),
583}; 594};
584 595
585static struct regulator_consumer_supply pvdd_1v8_consumers[] __initdata = { 596static struct regulator_consumer_supply pvdd_1v8_consumers[] __initdata = {
@@ -593,6 +604,7 @@ static struct regulator_consumer_supply pvdd_1v8_consumers[] __initdata = {
593 REGULATOR_SUPPLY("AVDD2", "1-001a"), 604 REGULATOR_SUPPLY("AVDD2", "1-001a"),
594 REGULATOR_SUPPLY("DCVDD", "1-001a"), 605 REGULATOR_SUPPLY("DCVDD", "1-001a"),
595 REGULATOR_SUPPLY("AVDD", "1-001a"), 606 REGULATOR_SUPPLY("AVDD", "1-001a"),
607 REGULATOR_SUPPLY("DBVDD", "spi0.0"),
596}; 608};
597 609
598static struct regulator_init_data pvdd_1v8 __initdata = { 610static struct regulator_init_data pvdd_1v8 __initdata = {
@@ -682,6 +694,7 @@ static void __init crag6410_map_io(void)
682static struct s3c_sdhci_platdata crag6410_hsmmc2_pdata = { 694static struct s3c_sdhci_platdata crag6410_hsmmc2_pdata = {
683 .max_width = 4, 695 .max_width = 4,
684 .cd_type = S3C_SDHCI_CD_PERMANENT, 696 .cd_type = S3C_SDHCI_CD_PERMANENT,
697 .host_caps = MMC_CAP_POWER_OFF_CARD,
685}; 698};
686 699
687static void crag6410_cfg_sdhci0(struct platform_device *dev, int width) 700static void crag6410_cfg_sdhci0(struct platform_device *dev, int width)
@@ -697,6 +710,55 @@ static struct s3c_sdhci_platdata crag6410_hsmmc0_pdata = {
697 .max_width = 4, 710 .max_width = 4,
698 .cd_type = S3C_SDHCI_CD_INTERNAL, 711 .cd_type = S3C_SDHCI_CD_INTERNAL,
699 .cfg_gpio = crag6410_cfg_sdhci0, 712 .cfg_gpio = crag6410_cfg_sdhci0,
713 .host_caps = MMC_CAP_POWER_OFF_CARD,
714};
715
716static const struct gpio_led gpio_leds[] = {
717 {
718 .name = "d13:green:",
719 .gpio = MMGPIO_GPIO_BASE + 0,
720 .default_state = LEDS_GPIO_DEFSTATE_ON,
721 },
722 {
723 .name = "d14:green:",
724 .gpio = MMGPIO_GPIO_BASE + 1,
725 .default_state = LEDS_GPIO_DEFSTATE_ON,
726 },
727 {
728 .name = "d15:green:",
729 .gpio = MMGPIO_GPIO_BASE + 2,
730 .default_state = LEDS_GPIO_DEFSTATE_ON,
731 },
732 {
733 .name = "d16:green:",
734 .gpio = MMGPIO_GPIO_BASE + 3,
735 .default_state = LEDS_GPIO_DEFSTATE_ON,
736 },
737 {
738 .name = "d17:green:",
739 .gpio = MMGPIO_GPIO_BASE + 4,
740 .default_state = LEDS_GPIO_DEFSTATE_ON,
741 },
742 {
743 .name = "d18:green:",
744 .gpio = MMGPIO_GPIO_BASE + 5,
745 .default_state = LEDS_GPIO_DEFSTATE_ON,
746 },
747 {
748 .name = "d19:green:",
749 .gpio = MMGPIO_GPIO_BASE + 6,
750 .default_state = LEDS_GPIO_DEFSTATE_ON,
751 },
752 {
753 .name = "d20:green:",
754 .gpio = MMGPIO_GPIO_BASE + 7,
755 .default_state = LEDS_GPIO_DEFSTATE_ON,
756 },
757};
758
759static const struct gpio_led_platform_data gpio_leds_pdata = {
760 .leds = gpio_leds,
761 .num_leds = ARRAY_SIZE(gpio_leds),
700}; 762};
701 763
702static struct s3c_hsotg_plat crag6410_hsotg_pdata; 764static struct s3c_hsotg_plat crag6410_hsotg_pdata;
@@ -731,9 +793,12 @@ static void __init crag6410_machine_init(void)
731 i2c_register_board_info(1, i2c_devs1, ARRAY_SIZE(i2c_devs1)); 793 i2c_register_board_info(1, i2c_devs1, ARRAY_SIZE(i2c_devs1));
732 794
733 samsung_keypad_set_platdata(&crag6410_keypad_data); 795 samsung_keypad_set_platdata(&crag6410_keypad_data);
796 s3c64xx_spi0_set_platdata(&s3c64xx_spi0_pdata, 0, 1);
734 797
735 platform_add_devices(crag6410_devices, ARRAY_SIZE(crag6410_devices)); 798 platform_add_devices(crag6410_devices, ARRAY_SIZE(crag6410_devices));
736 799
800 gpio_led_register_device(-1, &gpio_leds_pdata);
801
737 regulator_has_full_constraints(); 802 regulator_has_full_constraints();
738 803
739 s3c64xx_pm_init(); 804 s3c64xx_pm_init();
diff --git a/arch/arm/mach-s5pv210/Kconfig b/arch/arm/mach-s5pv210/Kconfig
index 82525e3831e9..29594fc4fdf4 100644
--- a/arch/arm/mach-s5pv210/Kconfig
+++ b/arch/arm/mach-s5pv210/Kconfig
@@ -124,6 +124,10 @@ config MACH_SMDKC110
124 select S3C_DEV_I2C2 124 select S3C_DEV_I2C2
125 select S3C_DEV_RTC 125 select S3C_DEV_RTC
126 select S3C_DEV_WDT 126 select S3C_DEV_WDT
127 select S5P_DEV_FIMC0
128 select S5P_DEV_FIMC1
129 select S5P_DEV_FIMC2
130 select S5P_DEV_MFC
127 select SAMSUNG_DEV_IDE 131 select SAMSUNG_DEV_IDE
128 select S5PV210_SETUP_I2C1 132 select S5PV210_SETUP_I2C1
129 select S5PV210_SETUP_I2C2 133 select S5PV210_SETUP_I2C2
@@ -148,6 +152,11 @@ config MACH_SMDKV210
148 select S3C_DEV_I2C2 152 select S3C_DEV_I2C2
149 select S3C_DEV_RTC 153 select S3C_DEV_RTC
150 select S3C_DEV_WDT 154 select S3C_DEV_WDT
155 select S5P_DEV_FIMC0
156 select S5P_DEV_FIMC1
157 select S5P_DEV_FIMC2
158 select S5P_DEV_JPEG
159 select S5P_DEV_MFC
151 select SAMSUNG_DEV_ADC 160 select SAMSUNG_DEV_ADC
152 select SAMSUNG_DEV_BACKLIGHT 161 select SAMSUNG_DEV_BACKLIGHT
153 select SAMSUNG_DEV_IDE 162 select SAMSUNG_DEV_IDE
diff --git a/arch/arm/mach-s5pv210/clock.c b/arch/arm/mach-s5pv210/clock.c
index b9ec0c35379f..09609d50961d 100644
--- a/arch/arm/mach-s5pv210/clock.c
+++ b/arch/arm/mach-s5pv210/clock.c
@@ -340,6 +340,11 @@ static struct clk init_clocks_off[] = {
340 .enable = s5pv210_clk_ip0_ctrl, 340 .enable = s5pv210_clk_ip0_ctrl,
341 .ctrlbit = (1 << 26), 341 .ctrlbit = (1 << 26),
342 }, { 342 }, {
343 .name = "jpeg",
344 .parent = &clk_hclk_dsys.clk,
345 .enable = s5pv210_clk_ip0_ctrl,
346 .ctrlbit = (1 << 28),
347 }, {
343 .name = "mfc", 348 .name = "mfc",
344 .devname = "s5p-mfc", 349 .devname = "s5p-mfc",
345 .parent = &clk_pclk_psys.clk, 350 .parent = &clk_pclk_psys.clk,
diff --git a/arch/arm/mach-s5pv210/include/mach/map.h b/arch/arm/mach-s5pv210/include/mach/map.h
index 89c34b8f73bf..b7c8a1917ffc 100644
--- a/arch/arm/mach-s5pv210/include/mach/map.h
+++ b/arch/arm/mach-s5pv210/include/mach/map.h
@@ -90,6 +90,8 @@
90#define S5PV210_PA_FIMC1 0xFB300000 90#define S5PV210_PA_FIMC1 0xFB300000
91#define S5PV210_PA_FIMC2 0xFB400000 91#define S5PV210_PA_FIMC2 0xFB400000
92 92
93#define S5PV210_PA_JPEG 0xFB600000
94
93#define S5PV210_PA_SDO 0xF9000000 95#define S5PV210_PA_SDO 0xF9000000
94#define S5PV210_PA_VP 0xF9100000 96#define S5PV210_PA_VP 0xF9100000
95#define S5PV210_PA_MIXER 0xF9200000 97#define S5PV210_PA_MIXER 0xF9200000
@@ -132,6 +134,8 @@
132#define S5P_PA_SYSCON S5PV210_PA_SYSCON 134#define S5P_PA_SYSCON S5PV210_PA_SYSCON
133#define S5P_PA_TIMER S5PV210_PA_TIMER 135#define S5P_PA_TIMER S5PV210_PA_TIMER
134 136
137#define S5P_PA_JPEG S5PV210_PA_JPEG
138
135#define SAMSUNG_PA_ADC S5PV210_PA_ADC 139#define SAMSUNG_PA_ADC S5PV210_PA_ADC
136#define SAMSUNG_PA_CFCON S5PV210_PA_CFCON 140#define SAMSUNG_PA_CFCON S5PV210_PA_CFCON
137#define SAMSUNG_PA_KEYPAD S5PV210_PA_KEYPAD 141#define SAMSUNG_PA_KEYPAD S5PV210_PA_KEYPAD
diff --git a/arch/arm/mach-s5pv210/mach-aquila.c b/arch/arm/mach-s5pv210/mach-aquila.c
index 5e734d025a6a..a9ea64e0da0d 100644
--- a/arch/arm/mach-s5pv210/mach-aquila.c
+++ b/arch/arm/mach-s5pv210/mach-aquila.c
@@ -616,6 +616,7 @@ static struct platform_device *aquila_devices[] __initdata = {
616 &s5p_device_fimc0, 616 &s5p_device_fimc0,
617 &s5p_device_fimc1, 617 &s5p_device_fimc1,
618 &s5p_device_fimc2, 618 &s5p_device_fimc2,
619 &s5p_device_fimc_md,
619 &s5pv210_device_iis0, 620 &s5pv210_device_iis0,
620 &wm8994_fixed_voltage0, 621 &wm8994_fixed_voltage0,
621 &wm8994_fixed_voltage1, 622 &wm8994_fixed_voltage1,
diff --git a/arch/arm/mach-s5pv210/mach-smdkc110.c b/arch/arm/mach-s5pv210/mach-smdkc110.c
index b323983b2c54..dfc29236321c 100644
--- a/arch/arm/mach-s5pv210/mach-smdkc110.c
+++ b/arch/arm/mach-s5pv210/mach-smdkc110.c
@@ -31,6 +31,7 @@
31#include <plat/iic.h> 31#include <plat/iic.h>
32#include <plat/pm.h> 32#include <plat/pm.h>
33#include <plat/s5p-time.h> 33#include <plat/s5p-time.h>
34#include <plat/mfc.h>
34 35
35#include "common.h" 36#include "common.h"
36 37
@@ -94,6 +95,13 @@ static struct platform_device *smdkc110_devices[] __initdata = {
94 &s3c_device_i2c2, 95 &s3c_device_i2c2,
95 &s3c_device_rtc, 96 &s3c_device_rtc,
96 &s3c_device_wdt, 97 &s3c_device_wdt,
98 &s5p_device_fimc0,
99 &s5p_device_fimc1,
100 &s5p_device_fimc2,
101 &s5p_device_fimc_md,
102 &s5p_device_mfc,
103 &s5p_device_mfc_l,
104 &s5p_device_mfc_r,
97}; 105};
98 106
99static struct i2c_board_info smdkc110_i2c_devs0[] __initdata = { 107static struct i2c_board_info smdkc110_i2c_devs0[] __initdata = {
@@ -117,6 +125,11 @@ static void __init smdkc110_map_io(void)
117 s5p_set_timer_source(S5P_PWM3, S5P_PWM4); 125 s5p_set_timer_source(S5P_PWM3, S5P_PWM4);
118} 126}
119 127
128static void __init smdkc110_reserve(void)
129{
130 s5p_mfc_reserve_mem(0x43000000, 8 << 20, 0x51000000, 8 << 20);
131}
132
120static void __init smdkc110_machine_init(void) 133static void __init smdkc110_machine_init(void)
121{ 134{
122 s3c_pm_init(); 135 s3c_pm_init();
@@ -145,4 +158,5 @@ MACHINE_START(SMDKC110, "SMDKC110")
145 .init_machine = smdkc110_machine_init, 158 .init_machine = smdkc110_machine_init,
146 .timer = &s5p_timer, 159 .timer = &s5p_timer,
147 .restart = s5pv210_restart, 160 .restart = s5pv210_restart,
161 .reserve = &smdkc110_reserve,
148MACHINE_END 162MACHINE_END
diff --git a/arch/arm/mach-s5pv210/mach-smdkv210.c b/arch/arm/mach-s5pv210/mach-smdkv210.c
index 0933c8e1eb7b..91d4ad8bcc73 100644
--- a/arch/arm/mach-s5pv210/mach-smdkv210.c
+++ b/arch/arm/mach-s5pv210/mach-smdkv210.c
@@ -46,6 +46,7 @@
46#include <plat/s5p-time.h> 46#include <plat/s5p-time.h>
47#include <plat/backlight.h> 47#include <plat/backlight.h>
48#include <plat/regs-fb-v4.h> 48#include <plat/regs-fb-v4.h>
49#include <plat/mfc.h>
49 50
50#include "common.h" 51#include "common.h"
51 52
@@ -223,6 +224,14 @@ static struct platform_device *smdkv210_devices[] __initdata = {
223 &s3c_device_rtc, 224 &s3c_device_rtc,
224 &s3c_device_ts, 225 &s3c_device_ts,
225 &s3c_device_wdt, 226 &s3c_device_wdt,
227 &s5p_device_fimc0,
228 &s5p_device_fimc1,
229 &s5p_device_fimc2,
230 &s5p_device_fimc_md,
231 &s5p_device_jpeg,
232 &s5p_device_mfc,
233 &s5p_device_mfc_l,
234 &s5p_device_mfc_r,
226 &s5pv210_device_ac97, 235 &s5pv210_device_ac97,
227 &s5pv210_device_iis0, 236 &s5pv210_device_iis0,
228 &s5pv210_device_spdif, 237 &s5pv210_device_spdif,
@@ -282,6 +291,11 @@ static void __init smdkv210_map_io(void)
282 s5p_set_timer_source(S5P_PWM2, S5P_PWM4); 291 s5p_set_timer_source(S5P_PWM2, S5P_PWM4);
283} 292}
284 293
294static void __init smdkv210_reserve(void)
295{
296 s5p_mfc_reserve_mem(0x43000000, 8 << 20, 0x51000000, 8 << 20);
297}
298
285static void __init smdkv210_machine_init(void) 299static void __init smdkv210_machine_init(void)
286{ 300{
287 s3c_pm_init(); 301 s3c_pm_init();
@@ -319,4 +333,5 @@ MACHINE_START(SMDKV210, "SMDKV210")
319 .init_machine = smdkv210_machine_init, 333 .init_machine = smdkv210_machine_init,
320 .timer = &s5p_timer, 334 .timer = &s5p_timer,
321 .restart = s5pv210_restart, 335 .restart = s5pv210_restart,
336 .reserve = &smdkv210_reserve,
322MACHINE_END 337MACHINE_END
diff --git a/arch/arm/mach-tegra/board-dt-tegra20.c b/arch/arm/mach-tegra/board-dt-tegra20.c
index 7a95e0bc4aba..e20b419d5983 100644
--- a/arch/arm/mach-tegra/board-dt-tegra20.c
+++ b/arch/arm/mach-tegra/board-dt-tegra20.c
@@ -131,11 +131,7 @@ static void __init tegra_dt_init(void)
131} 131}
132 132
133static const char *tegra20_dt_board_compat[] = { 133static const char *tegra20_dt_board_compat[] = {
134 "compulab,trimslice", 134 "nvidia,tegra20",
135 "nvidia,harmony",
136 "compal,paz00",
137 "nvidia,seaboard",
138 "nvidia,ventana",
139 NULL 135 NULL
140}; 136};
141 137
diff --git a/arch/arm/mach-tegra/board-dt-tegra30.c b/arch/arm/mach-tegra/board-dt-tegra30.c
index b4124b12a779..96f6c0d030bd 100644
--- a/arch/arm/mach-tegra/board-dt-tegra30.c
+++ b/arch/arm/mach-tegra/board-dt-tegra30.c
@@ -69,7 +69,7 @@ static void __init tegra30_dt_init(void)
69} 69}
70 70
71static const char *tegra30_dt_board_compat[] = { 71static const char *tegra30_dt_board_compat[] = {
72 "nvidia,cardhu", 72 "nvidia,tegra30",
73 NULL 73 NULL
74}; 74};
75 75
diff --git a/arch/arm/mach-tegra/board-harmony-power.c b/arch/arm/mach-tegra/board-harmony-power.c
index 21d1285731b3..c0298b3f7d63 100644
--- a/arch/arm/mach-tegra/board-harmony-power.c
+++ b/arch/arm/mach-tegra/board-harmony-power.c
@@ -36,13 +36,14 @@ static struct regulator_consumer_supply tps658621_ldo0_supply[] = {
36 36
37static struct regulator_init_data ldo0_data = { 37static struct regulator_init_data ldo0_data = {
38 .constraints = { 38 .constraints = {
39 .min_uV = 1250 * 1000, 39 .min_uV = 3300 * 1000,
40 .max_uV = 3300 * 1000, 40 .max_uV = 3300 * 1000,
41 .valid_modes_mask = (REGULATOR_MODE_NORMAL | 41 .valid_modes_mask = (REGULATOR_MODE_NORMAL |
42 REGULATOR_MODE_STANDBY), 42 REGULATOR_MODE_STANDBY),
43 .valid_ops_mask = (REGULATOR_CHANGE_MODE | 43 .valid_ops_mask = (REGULATOR_CHANGE_MODE |
44 REGULATOR_CHANGE_STATUS | 44 REGULATOR_CHANGE_STATUS |
45 REGULATOR_CHANGE_VOLTAGE), 45 REGULATOR_CHANGE_VOLTAGE),
46 .apply_uV = 1,
46 }, 47 },
47 .num_consumer_supplies = ARRAY_SIZE(tps658621_ldo0_supply), 48 .num_consumer_supplies = ARRAY_SIZE(tps658621_ldo0_supply),
48 .consumer_supplies = tps658621_ldo0_supply, 49 .consumer_supplies = tps658621_ldo0_supply,
diff --git a/arch/arm/plat-omap/include/plat/board-ams-delta.h b/arch/arm/plat-omap/include/plat/board-ams-delta.h
index 51b102dc906b..ad6f865d1f16 100644
--- a/arch/arm/plat-omap/include/plat/board-ams-delta.h
+++ b/arch/arm/plat-omap/include/plat/board-ams-delta.h
@@ -28,33 +28,8 @@
28 28
29#if defined (CONFIG_MACH_AMS_DELTA) 29#if defined (CONFIG_MACH_AMS_DELTA)
30 30
31#define AMS_DELTA_LATCH1_PHYS 0x01000000
32#define AMS_DELTA_LATCH1_VIRT 0xEA000000
33#define AMS_DELTA_MODEM_PHYS 0x04000000
34#define AMS_DELTA_MODEM_VIRT 0xEB000000
35#define AMS_DELTA_LATCH2_PHYS 0x08000000
36#define AMS_DELTA_LATCH2_VIRT 0xEC000000
37
38#define AMS_DELTA_LATCH1_LED_CAMERA 0x01
39#define AMS_DELTA_LATCH1_LED_ADVERT 0x02
40#define AMS_DELTA_LATCH1_LED_EMAIL 0x04
41#define AMS_DELTA_LATCH1_LED_HANDSFREE 0x08
42#define AMS_DELTA_LATCH1_LED_VOICEMAIL 0x10
43#define AMS_DELTA_LATCH1_LED_VOICE 0x20
44
45#define AMS_DELTA_LATCH2_LCD_VBLEN 0x0001
46#define AMS_DELTA_LATCH2_LCD_NDISP 0x0002
47#define AMS_DELTA_LATCH2_NAND_NCE 0x0004
48#define AMS_DELTA_LATCH2_NAND_NRE 0x0008
49#define AMS_DELTA_LATCH2_NAND_NWP 0x0010
50#define AMS_DELTA_LATCH2_NAND_NWE 0x0020
51#define AMS_DELTA_LATCH2_NAND_ALE 0x0040
52#define AMS_DELTA_LATCH2_NAND_CLE 0x0080
53#define AMD_DELTA_LATCH2_KEYBRD_PWR 0x0100
54#define AMD_DELTA_LATCH2_KEYBRD_DATA 0x0200
55#define AMD_DELTA_LATCH2_SCARD_RSTIN 0x0400 31#define AMD_DELTA_LATCH2_SCARD_RSTIN 0x0400
56#define AMD_DELTA_LATCH2_SCARD_CMDVCC 0x0800 32#define AMD_DELTA_LATCH2_SCARD_CMDVCC 0x0800
57#define AMS_DELTA_LATCH2_MODEM_NRESET 0x1000
58#define AMS_DELTA_LATCH2_MODEM_CODEC 0x2000 33#define AMS_DELTA_LATCH2_MODEM_CODEC 0x2000
59 34
60#define AMS_DELTA_GPIO_PIN_KEYBRD_DATA 0 35#define AMS_DELTA_GPIO_PIN_KEYBRD_DATA 0
@@ -66,9 +41,29 @@
66#define AMS_DELTA_GPIO_PIN_CONFIG 11 41#define AMS_DELTA_GPIO_PIN_CONFIG 11
67#define AMS_DELTA_GPIO_PIN_NAND_RB 12 42#define AMS_DELTA_GPIO_PIN_NAND_RB 12
68 43
44#define AMS_DELTA_GPIO_PIN_LCD_VBLEN 240
45#define AMS_DELTA_GPIO_PIN_LCD_NDISP 241
46#define AMS_DELTA_GPIO_PIN_NAND_NCE 242
47#define AMS_DELTA_GPIO_PIN_NAND_NRE 243
48#define AMS_DELTA_GPIO_PIN_NAND_NWP 244
49#define AMS_DELTA_GPIO_PIN_NAND_NWE 245
50#define AMS_DELTA_GPIO_PIN_NAND_ALE 246
51#define AMS_DELTA_GPIO_PIN_NAND_CLE 247
52#define AMS_DELTA_GPIO_PIN_KEYBRD_PWR 248
53#define AMS_DELTA_GPIO_PIN_KEYBRD_DATAOUT 249
54#define AMS_DELTA_GPIO_PIN_SCARD_RSTIN 250
55#define AMS_DELTA_GPIO_PIN_SCARD_CMDVCC 251
56#define AMS_DELTA_GPIO_PIN_MODEM_NRESET 252
57#define AMS_DELTA_GPIO_PIN_MODEM_CODEC 253
58
59#define AMS_DELTA_LATCH2_GPIO_BASE AMS_DELTA_GPIO_PIN_LCD_VBLEN
60#define AMS_DELTA_LATCH2_NGPIO 16
61
69#ifndef __ASSEMBLY__ 62#ifndef __ASSEMBLY__
70void ams_delta_latch1_write(u8 mask, u8 value); 63void ams_delta_latch_write(int base, int ngpio, u16 mask, u16 value);
71void ams_delta_latch2_write(u16 mask, u16 value); 64#define ams_delta_latch2_write(mask, value) \
65 ams_delta_latch_write(AMS_DELTA_LATCH2_GPIO_BASE, \
66 AMS_DELTA_LATCH2_NGPIO, (mask), (value))
72#endif 67#endif
73 68
74#endif /* CONFIG_MACH_AMS_DELTA */ 69#endif /* CONFIG_MACH_AMS_DELTA */
diff --git a/arch/arm/plat-omap/include/plat/uncompress.h b/arch/arm/plat-omap/include/plat/uncompress.h
index 6ee90495ca4c..cc3f11ba7a99 100644
--- a/arch/arm/plat-omap/include/plat/uncompress.h
+++ b/arch/arm/plat-omap/include/plat/uncompress.h
@@ -160,6 +160,7 @@ static inline void __arch_decomp_setup(unsigned long arch_id)
160 DEBUG_LL_OMAP3(3, igep0020); 160 DEBUG_LL_OMAP3(3, igep0020);
161 DEBUG_LL_OMAP3(3, igep0030); 161 DEBUG_LL_OMAP3(3, igep0030);
162 DEBUG_LL_OMAP3(3, nokia_rm680); 162 DEBUG_LL_OMAP3(3, nokia_rm680);
163 DEBUG_LL_OMAP3(3, nokia_rm696);
163 DEBUG_LL_OMAP3(3, nokia_rx51); 164 DEBUG_LL_OMAP3(3, nokia_rx51);
164 DEBUG_LL_OMAP3(3, omap3517evm); 165 DEBUG_LL_OMAP3(3, omap3517evm);
165 DEBUG_LL_OMAP3(3, omap3_beagle); 166 DEBUG_LL_OMAP3(3, omap3_beagle);
diff --git a/drivers/input/serio/ams_delta_serio.c b/drivers/input/serio/ams_delta_serio.c
index d4d08bd9205b..bd5b10eeeb40 100644
--- a/drivers/input/serio/ams_delta_serio.c
+++ b/drivers/input/serio/ams_delta_serio.c
@@ -92,8 +92,7 @@ static irqreturn_t ams_delta_serio_interrupt(int irq, void *dev_id)
92static int ams_delta_serio_open(struct serio *serio) 92static int ams_delta_serio_open(struct serio *serio)
93{ 93{
94 /* enable keyboard */ 94 /* enable keyboard */
95 ams_delta_latch2_write(AMD_DELTA_LATCH2_KEYBRD_PWR, 95 gpio_set_value(AMS_DELTA_GPIO_PIN_KEYBRD_PWR, 1);
96 AMD_DELTA_LATCH2_KEYBRD_PWR);
97 96
98 return 0; 97 return 0;
99} 98}
@@ -101,9 +100,32 @@ static int ams_delta_serio_open(struct serio *serio)
101static void ams_delta_serio_close(struct serio *serio) 100static void ams_delta_serio_close(struct serio *serio)
102{ 101{
103 /* disable keyboard */ 102 /* disable keyboard */
104 ams_delta_latch2_write(AMD_DELTA_LATCH2_KEYBRD_PWR, 0); 103 gpio_set_value(AMS_DELTA_GPIO_PIN_KEYBRD_PWR, 0);
105} 104}
106 105
106static const struct gpio ams_delta_gpios[] __initconst_or_module = {
107 {
108 .gpio = AMS_DELTA_GPIO_PIN_KEYBRD_DATA,
109 .flags = GPIOF_DIR_IN,
110 .label = "serio-data",
111 },
112 {
113 .gpio = AMS_DELTA_GPIO_PIN_KEYBRD_CLK,
114 .flags = GPIOF_DIR_IN,
115 .label = "serio-clock",
116 },
117 {
118 .gpio = AMS_DELTA_GPIO_PIN_KEYBRD_PWR,
119 .flags = GPIOF_OUT_INIT_LOW,
120 .label = "serio-power",
121 },
122 {
123 .gpio = AMS_DELTA_GPIO_PIN_KEYBRD_DATAOUT,
124 .flags = GPIOF_OUT_INIT_LOW,
125 .label = "serio-dataout",
126 },
127};
128
107static int __init ams_delta_serio_init(void) 129static int __init ams_delta_serio_init(void)
108{ 130{
109 int err; 131 int err;
@@ -123,19 +145,12 @@ static int __init ams_delta_serio_init(void)
123 strlcpy(ams_delta_serio->phys, "GPIO/serio0", 145 strlcpy(ams_delta_serio->phys, "GPIO/serio0",
124 sizeof(ams_delta_serio->phys)); 146 sizeof(ams_delta_serio->phys));
125 147
126 err = gpio_request(AMS_DELTA_GPIO_PIN_KEYBRD_DATA, "serio-data"); 148 err = gpio_request_array(ams_delta_gpios,
149 ARRAY_SIZE(ams_delta_gpios));
127 if (err) { 150 if (err) {
128 pr_err("ams_delta_serio: Couldn't request gpio pin for data\n"); 151 pr_err("ams_delta_serio: Couldn't request gpio pins\n");
129 goto serio; 152 goto serio;
130 } 153 }
131 gpio_direction_input(AMS_DELTA_GPIO_PIN_KEYBRD_DATA);
132
133 err = gpio_request(AMS_DELTA_GPIO_PIN_KEYBRD_CLK, "serio-clock");
134 if (err) {
135 pr_err("ams_delta_serio: couldn't request gpio pin for clock\n");
136 goto gpio_data;
137 }
138 gpio_direction_input(AMS_DELTA_GPIO_PIN_KEYBRD_CLK);
139 154
140 err = request_irq(gpio_to_irq(AMS_DELTA_GPIO_PIN_KEYBRD_CLK), 155 err = request_irq(gpio_to_irq(AMS_DELTA_GPIO_PIN_KEYBRD_CLK),
141 ams_delta_serio_interrupt, IRQ_TYPE_EDGE_RISING, 156 ams_delta_serio_interrupt, IRQ_TYPE_EDGE_RISING,
@@ -143,7 +158,7 @@ static int __init ams_delta_serio_init(void)
143 if (err < 0) { 158 if (err < 0) {
144 pr_err("ams_delta_serio: couldn't request gpio interrupt %d\n", 159 pr_err("ams_delta_serio: couldn't request gpio interrupt %d\n",
145 gpio_to_irq(AMS_DELTA_GPIO_PIN_KEYBRD_CLK)); 160 gpio_to_irq(AMS_DELTA_GPIO_PIN_KEYBRD_CLK));
146 goto gpio_clk; 161 goto gpio;
147 } 162 }
148 /* 163 /*
149 * Since GPIO register handling for keyboard clock pin is performed 164 * Since GPIO register handling for keyboard clock pin is performed
@@ -157,10 +172,9 @@ static int __init ams_delta_serio_init(void)
157 dev_info(&ams_delta_serio->dev, "%s\n", ams_delta_serio->name); 172 dev_info(&ams_delta_serio->dev, "%s\n", ams_delta_serio->name);
158 173
159 return 0; 174 return 0;
160gpio_clk: 175gpio:
161 gpio_free(AMS_DELTA_GPIO_PIN_KEYBRD_CLK); 176 gpio_free_array(ams_delta_gpios,
162gpio_data: 177 ARRAY_SIZE(ams_delta_gpios));
163 gpio_free(AMS_DELTA_GPIO_PIN_KEYBRD_DATA);
164serio: 178serio:
165 kfree(ams_delta_serio); 179 kfree(ams_delta_serio);
166 return err; 180 return err;
@@ -171,7 +185,7 @@ static void __exit ams_delta_serio_exit(void)
171{ 185{
172 serio_unregister_port(ams_delta_serio); 186 serio_unregister_port(ams_delta_serio);
173 free_irq(OMAP_GPIO_IRQ(AMS_DELTA_GPIO_PIN_KEYBRD_CLK), 0); 187 free_irq(OMAP_GPIO_IRQ(AMS_DELTA_GPIO_PIN_KEYBRD_CLK), 0);
174 gpio_free(AMS_DELTA_GPIO_PIN_KEYBRD_CLK); 188 gpio_free_array(ams_delta_gpios,
175 gpio_free(AMS_DELTA_GPIO_PIN_KEYBRD_DATA); 189 ARRAY_SIZE(ams_delta_gpios));
176} 190}
177module_exit(ams_delta_serio_exit); 191module_exit(ams_delta_serio_exit);
diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig
index 2cdcf8c2ed49..ff4b8cfda585 100644
--- a/drivers/leds/Kconfig
+++ b/drivers/leds/Kconfig
@@ -74,13 +74,6 @@ config LEDS_S3C24XX
74 This option enables support for LEDs connected to GPIO lines 74 This option enables support for LEDs connected to GPIO lines
75 on Samsung S3C24XX series CPUs, such as the S3C2410 and S3C2440. 75 on Samsung S3C24XX series CPUs, such as the S3C2410 and S3C2440.
76 76
77config LEDS_AMS_DELTA
78 tristate "LED Support for the Amstrad Delta (E3)"
79 depends on LEDS_CLASS
80 depends on MACH_AMS_DELTA
81 help
82 This option enables support for the LEDs on Amstrad Delta (E3).
83
84config LEDS_NET48XX 77config LEDS_NET48XX
85 tristate "LED Support for Soekris net48xx series Error LED" 78 tristate "LED Support for Soekris net48xx series Error LED"
86 depends on LEDS_CLASS 79 depends on LEDS_CLASS
diff --git a/drivers/leds/Makefile b/drivers/leds/Makefile
index fa0f428b32fe..890481cb09f6 100644
--- a/drivers/leds/Makefile
+++ b/drivers/leds/Makefile
@@ -12,7 +12,6 @@ obj-$(CONFIG_LEDS_LOCOMO) += leds-locomo.o
12obj-$(CONFIG_LEDS_LM3530) += leds-lm3530.o 12obj-$(CONFIG_LEDS_LM3530) += leds-lm3530.o
13obj-$(CONFIG_LEDS_MIKROTIK_RB532) += leds-rb532.o 13obj-$(CONFIG_LEDS_MIKROTIK_RB532) += leds-rb532.o
14obj-$(CONFIG_LEDS_S3C24XX) += leds-s3c24xx.o 14obj-$(CONFIG_LEDS_S3C24XX) += leds-s3c24xx.o
15obj-$(CONFIG_LEDS_AMS_DELTA) += leds-ams-delta.o
16obj-$(CONFIG_LEDS_NET48XX) += leds-net48xx.o 15obj-$(CONFIG_LEDS_NET48XX) += leds-net48xx.o
17obj-$(CONFIG_LEDS_WRAP) += leds-wrap.o 16obj-$(CONFIG_LEDS_WRAP) += leds-wrap.o
18obj-$(CONFIG_LEDS_COBALT_QUBE) += leds-cobalt-qube.o 17obj-$(CONFIG_LEDS_COBALT_QUBE) += leds-cobalt-qube.o
diff --git a/drivers/leds/leds-ams-delta.c b/drivers/leds/leds-ams-delta.c
deleted file mode 100644
index 07428357c83f..000000000000
--- a/drivers/leds/leds-ams-delta.c
+++ /dev/null
@@ -1,126 +0,0 @@
1/*
2 * LEDs driver for Amstrad Delta (E3)
3 *
4 * Copyright (C) 2006 Jonathan McDowell <noodles@earth.li>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#include <linux/module.h>
12#include <linux/kernel.h>
13#include <linux/init.h>
14#include <linux/platform_device.h>
15#include <linux/leds.h>
16#include <plat/board-ams-delta.h>
17
18/*
19 * Our context
20 */
21struct ams_delta_led {
22 struct led_classdev cdev;
23 u8 bitmask;
24};
25
26static void ams_delta_led_set(struct led_classdev *led_cdev,
27 enum led_brightness value)
28{
29 struct ams_delta_led *led_dev =
30 container_of(led_cdev, struct ams_delta_led, cdev);
31
32 if (value)
33 ams_delta_latch1_write(led_dev->bitmask, led_dev->bitmask);
34 else
35 ams_delta_latch1_write(led_dev->bitmask, 0);
36}
37
38static struct ams_delta_led ams_delta_leds[] = {
39 {
40 .cdev = {
41 .name = "ams-delta::camera",
42 .brightness_set = ams_delta_led_set,
43 },
44 .bitmask = AMS_DELTA_LATCH1_LED_CAMERA,
45 },
46 {
47 .cdev = {
48 .name = "ams-delta::advert",
49 .brightness_set = ams_delta_led_set,
50 },
51 .bitmask = AMS_DELTA_LATCH1_LED_ADVERT,
52 },
53 {
54 .cdev = {
55 .name = "ams-delta::email",
56 .brightness_set = ams_delta_led_set,
57 },
58 .bitmask = AMS_DELTA_LATCH1_LED_EMAIL,
59 },
60 {
61 .cdev = {
62 .name = "ams-delta::handsfree",
63 .brightness_set = ams_delta_led_set,
64 },
65 .bitmask = AMS_DELTA_LATCH1_LED_HANDSFREE,
66 },
67 {
68 .cdev = {
69 .name = "ams-delta::voicemail",
70 .brightness_set = ams_delta_led_set,
71 },
72 .bitmask = AMS_DELTA_LATCH1_LED_VOICEMAIL,
73 },
74 {
75 .cdev = {
76 .name = "ams-delta::voice",
77 .brightness_set = ams_delta_led_set,
78 },
79 .bitmask = AMS_DELTA_LATCH1_LED_VOICE,
80 },
81};
82
83static int ams_delta_led_probe(struct platform_device *pdev)
84{
85 int i, ret;
86
87 for (i = 0; i < ARRAY_SIZE(ams_delta_leds); i++) {
88 ams_delta_leds[i].cdev.flags |= LED_CORE_SUSPENDRESUME;
89 ret = led_classdev_register(&pdev->dev,
90 &ams_delta_leds[i].cdev);
91 if (ret < 0)
92 goto fail;
93 }
94
95 return 0;
96fail:
97 while (--i >= 0)
98 led_classdev_unregister(&ams_delta_leds[i].cdev);
99 return ret;
100}
101
102static int ams_delta_led_remove(struct platform_device *pdev)
103{
104 int i;
105
106 for (i = 0; i < ARRAY_SIZE(ams_delta_leds); i++)
107 led_classdev_unregister(&ams_delta_leds[i].cdev);
108
109 return 0;
110}
111
112static struct platform_driver ams_delta_led_driver = {
113 .probe = ams_delta_led_probe,
114 .remove = ams_delta_led_remove,
115 .driver = {
116 .name = "ams-delta-led",
117 .owner = THIS_MODULE,
118 },
119};
120
121module_platform_driver(ams_delta_led_driver);
122
123MODULE_AUTHOR("Jonathan McDowell <noodles@earth.li>");
124MODULE_DESCRIPTION("Amstrad Delta LED driver");
125MODULE_LICENSE("GPL");
126MODULE_ALIAS("platform:ams-delta-led");
diff --git a/drivers/mtd/nand/ams-delta.c b/drivers/mtd/nand/ams-delta.c
index 3197e9764fcd..73416951f4c1 100644
--- a/drivers/mtd/nand/ams-delta.c
+++ b/drivers/mtd/nand/ams-delta.c
@@ -26,7 +26,7 @@
26#include <asm/io.h> 26#include <asm/io.h>
27#include <mach/hardware.h> 27#include <mach/hardware.h>
28#include <asm/sizes.h> 28#include <asm/sizes.h>
29#include <asm/gpio.h> 29#include <linux/gpio.h>
30#include <plat/board-ams-delta.h> 30#include <plat/board-ams-delta.h>
31 31
32/* 32/*
@@ -34,8 +34,6 @@
34 */ 34 */
35static struct mtd_info *ams_delta_mtd = NULL; 35static struct mtd_info *ams_delta_mtd = NULL;
36 36
37#define NAND_MASK (AMS_DELTA_LATCH2_NAND_NRE | AMS_DELTA_LATCH2_NAND_NWE | AMS_DELTA_LATCH2_NAND_CLE | AMS_DELTA_LATCH2_NAND_ALE | AMS_DELTA_LATCH2_NAND_NCE | AMS_DELTA_LATCH2_NAND_NWP)
38
39/* 37/*
40 * Define partitions for flash devices 38 * Define partitions for flash devices
41 */ 39 */
@@ -68,10 +66,9 @@ static void ams_delta_write_byte(struct mtd_info *mtd, u_char byte)
68 66
69 writew(0, io_base + OMAP_MPUIO_IO_CNTL); 67 writew(0, io_base + OMAP_MPUIO_IO_CNTL);
70 writew(byte, this->IO_ADDR_W); 68 writew(byte, this->IO_ADDR_W);
71 ams_delta_latch2_write(AMS_DELTA_LATCH2_NAND_NWE, 0); 69 gpio_set_value(AMS_DELTA_GPIO_PIN_NAND_NWE, 0);
72 ndelay(40); 70 ndelay(40);
73 ams_delta_latch2_write(AMS_DELTA_LATCH2_NAND_NWE, 71 gpio_set_value(AMS_DELTA_GPIO_PIN_NAND_NWE, 1);
74 AMS_DELTA_LATCH2_NAND_NWE);
75} 72}
76 73
77static u_char ams_delta_read_byte(struct mtd_info *mtd) 74static u_char ams_delta_read_byte(struct mtd_info *mtd)
@@ -80,12 +77,11 @@ static u_char ams_delta_read_byte(struct mtd_info *mtd)
80 struct nand_chip *this = mtd->priv; 77 struct nand_chip *this = mtd->priv;
81 void __iomem *io_base = this->priv; 78 void __iomem *io_base = this->priv;
82 79
83 ams_delta_latch2_write(AMS_DELTA_LATCH2_NAND_NRE, 0); 80 gpio_set_value(AMS_DELTA_GPIO_PIN_NAND_NRE, 0);
84 ndelay(40); 81 ndelay(40);
85 writew(~0, io_base + OMAP_MPUIO_IO_CNTL); 82 writew(~0, io_base + OMAP_MPUIO_IO_CNTL);
86 res = readw(this->IO_ADDR_R); 83 res = readw(this->IO_ADDR_R);
87 ams_delta_latch2_write(AMS_DELTA_LATCH2_NAND_NRE, 84 gpio_set_value(AMS_DELTA_GPIO_PIN_NAND_NRE, 1);
88 AMS_DELTA_LATCH2_NAND_NRE);
89 85
90 return res; 86 return res;
91} 87}
@@ -132,15 +128,12 @@ static void ams_delta_hwcontrol(struct mtd_info *mtd, int cmd,
132{ 128{
133 129
134 if (ctrl & NAND_CTRL_CHANGE) { 130 if (ctrl & NAND_CTRL_CHANGE) {
135 unsigned long bits; 131 gpio_set_value(AMS_DELTA_GPIO_PIN_NAND_NCE,
136 132 (ctrl & NAND_NCE) == 0);
137 bits = (~ctrl & NAND_NCE) ? AMS_DELTA_LATCH2_NAND_NCE : 0; 133 gpio_set_value(AMS_DELTA_GPIO_PIN_NAND_CLE,
138 bits |= (ctrl & NAND_CLE) ? AMS_DELTA_LATCH2_NAND_CLE : 0; 134 (ctrl & NAND_CLE) != 0);
139 bits |= (ctrl & NAND_ALE) ? AMS_DELTA_LATCH2_NAND_ALE : 0; 135 gpio_set_value(AMS_DELTA_GPIO_PIN_NAND_ALE,
140 136 (ctrl & NAND_ALE) != 0);
141 ams_delta_latch2_write(AMS_DELTA_LATCH2_NAND_CLE |
142 AMS_DELTA_LATCH2_NAND_ALE |
143 AMS_DELTA_LATCH2_NAND_NCE, bits);
144 } 137 }
145 138
146 if (cmd != NAND_CMD_NONE) 139 if (cmd != NAND_CMD_NONE)
@@ -152,6 +145,39 @@ static int ams_delta_nand_ready(struct mtd_info *mtd)
152 return gpio_get_value(AMS_DELTA_GPIO_PIN_NAND_RB); 145 return gpio_get_value(AMS_DELTA_GPIO_PIN_NAND_RB);
153} 146}
154 147
148static const struct gpio _mandatory_gpio[] = {
149 {
150 .gpio = AMS_DELTA_GPIO_PIN_NAND_NCE,
151 .flags = GPIOF_OUT_INIT_HIGH,
152 .label = "nand_nce",
153 },
154 {
155 .gpio = AMS_DELTA_GPIO_PIN_NAND_NRE,
156 .flags = GPIOF_OUT_INIT_HIGH,
157 .label = "nand_nre",
158 },
159 {
160 .gpio = AMS_DELTA_GPIO_PIN_NAND_NWP,
161 .flags = GPIOF_OUT_INIT_HIGH,
162 .label = "nand_nwp",
163 },
164 {
165 .gpio = AMS_DELTA_GPIO_PIN_NAND_NWE,
166 .flags = GPIOF_OUT_INIT_HIGH,
167 .label = "nand_nwe",
168 },
169 {
170 .gpio = AMS_DELTA_GPIO_PIN_NAND_ALE,
171 .flags = GPIOF_OUT_INIT_LOW,
172 .label = "nand_ale",
173 },
174 {
175 .gpio = AMS_DELTA_GPIO_PIN_NAND_CLE,
176 .flags = GPIOF_OUT_INIT_LOW,
177 .label = "nand_cle",
178 },
179};
180
155/* 181/*
156 * Main initialization routine 182 * Main initialization routine
157 */ 183 */
@@ -223,10 +249,9 @@ static int __devinit ams_delta_init(struct platform_device *pdev)
223 platform_set_drvdata(pdev, io_base); 249 platform_set_drvdata(pdev, io_base);
224 250
225 /* Set chip enabled, but */ 251 /* Set chip enabled, but */
226 ams_delta_latch2_write(NAND_MASK, AMS_DELTA_LATCH2_NAND_NRE | 252 err = gpio_request_array(_mandatory_gpio, ARRAY_SIZE(_mandatory_gpio));
227 AMS_DELTA_LATCH2_NAND_NWE | 253 if (err)
228 AMS_DELTA_LATCH2_NAND_NCE | 254 goto out_gpio;
229 AMS_DELTA_LATCH2_NAND_NWP);
230 255
231 /* Scan to find existence of the device */ 256 /* Scan to find existence of the device */
232 if (nand_scan(ams_delta_mtd, 1)) { 257 if (nand_scan(ams_delta_mtd, 1)) {
@@ -241,7 +266,10 @@ static int __devinit ams_delta_init(struct platform_device *pdev)
241 goto out; 266 goto out;
242 267
243 out_mtd: 268 out_mtd:
269 gpio_free_array(_mandatory_gpio, ARRAY_SIZE(_mandatory_gpio));
270out_gpio:
244 platform_set_drvdata(pdev, NULL); 271 platform_set_drvdata(pdev, NULL);
272 gpio_free(AMS_DELTA_GPIO_PIN_NAND_RB);
245 iounmap(io_base); 273 iounmap(io_base);
246out_release_io: 274out_release_io:
247 release_mem_region(res->start, resource_size(res)); 275 release_mem_region(res->start, resource_size(res));
@@ -262,6 +290,8 @@ static int __devexit ams_delta_cleanup(struct platform_device *pdev)
262 /* Release resources, unregister device */ 290 /* Release resources, unregister device */
263 nand_release(ams_delta_mtd); 291 nand_release(ams_delta_mtd);
264 292
293 gpio_free_array(_mandatory_gpio, ARRAY_SIZE(_mandatory_gpio));
294 gpio_free(AMS_DELTA_GPIO_PIN_NAND_RB);
265 iounmap(io_base); 295 iounmap(io_base);
266 release_mem_region(res->start, resource_size(res)); 296 release_mem_region(res->start, resource_size(res));
267 297
diff --git a/drivers/video/omap/lcd_ams_delta.c b/drivers/video/omap/lcd_ams_delta.c
index 0fdd6f6873bf..d3a311327227 100644
--- a/drivers/video/omap/lcd_ams_delta.c
+++ b/drivers/video/omap/lcd_ams_delta.c
@@ -25,6 +25,7 @@
25#include <linux/io.h> 25#include <linux/io.h>
26#include <linux/delay.h> 26#include <linux/delay.h>
27#include <linux/lcd.h> 27#include <linux/lcd.h>
28#include <linux/gpio.h>
28 29
29#include <plat/board-ams-delta.h> 30#include <plat/board-ams-delta.h>
30#include <mach/hardware.h> 31#include <mach/hardware.h>
@@ -98,29 +99,41 @@ static struct lcd_ops ams_delta_lcd_ops = {
98 99
99/* omapfb panel section */ 100/* omapfb panel section */
100 101
102static const struct gpio _gpios[] = {
103 {
104 .gpio = AMS_DELTA_GPIO_PIN_LCD_VBLEN,
105 .flags = GPIOF_OUT_INIT_LOW,
106 .label = "lcd_vblen",
107 },
108 {
109 .gpio = AMS_DELTA_GPIO_PIN_LCD_NDISP,
110 .flags = GPIOF_OUT_INIT_LOW,
111 .label = "lcd_ndisp",
112 },
113};
114
101static int ams_delta_panel_init(struct lcd_panel *panel, 115static int ams_delta_panel_init(struct lcd_panel *panel,
102 struct omapfb_device *fbdev) 116 struct omapfb_device *fbdev)
103{ 117{
104 return 0; 118 return gpio_request_array(_gpios, ARRAY_SIZE(_gpios));
105} 119}
106 120
107static void ams_delta_panel_cleanup(struct lcd_panel *panel) 121static void ams_delta_panel_cleanup(struct lcd_panel *panel)
108{ 122{
123 gpio_free_array(_gpios, ARRAY_SIZE(_gpios));
109} 124}
110 125
111static int ams_delta_panel_enable(struct lcd_panel *panel) 126static int ams_delta_panel_enable(struct lcd_panel *panel)
112{ 127{
113 ams_delta_latch2_write(AMS_DELTA_LATCH2_LCD_NDISP, 128 gpio_set_value(AMS_DELTA_GPIO_PIN_LCD_NDISP, 1);
114 AMS_DELTA_LATCH2_LCD_NDISP); 129 gpio_set_value(AMS_DELTA_GPIO_PIN_LCD_VBLEN, 1);
115 ams_delta_latch2_write(AMS_DELTA_LATCH2_LCD_VBLEN,
116 AMS_DELTA_LATCH2_LCD_VBLEN);
117 return 0; 130 return 0;
118} 131}
119 132
120static void ams_delta_panel_disable(struct lcd_panel *panel) 133static void ams_delta_panel_disable(struct lcd_panel *panel)
121{ 134{
122 ams_delta_latch2_write(AMS_DELTA_LATCH2_LCD_VBLEN, 0); 135 gpio_set_value(AMS_DELTA_GPIO_PIN_LCD_VBLEN, 0);
123 ams_delta_latch2_write(AMS_DELTA_LATCH2_LCD_NDISP, 0); 136 gpio_set_value(AMS_DELTA_GPIO_PIN_LCD_NDISP, 0);
124} 137}
125 138
126static unsigned long ams_delta_panel_get_caps(struct lcd_panel *panel) 139static unsigned long ams_delta_panel_get_caps(struct lcd_panel *panel)
diff --git a/sound/soc/omap/ams-delta.c b/sound/soc/omap/ams-delta.c
index 49fe63ce51f7..7d4fa8ed6699 100644
--- a/sound/soc/omap/ams-delta.c
+++ b/sound/soc/omap/ams-delta.c
@@ -426,29 +426,6 @@ static struct snd_soc_ops ams_delta_ops = {
426}; 426};
427 427
428 428
429/* Board specific codec bias level control */
430static int ams_delta_set_bias_level(struct snd_soc_card *card,
431 struct snd_soc_dapm_context *dapm,
432 enum snd_soc_bias_level level)
433{
434 switch (level) {
435 case SND_SOC_BIAS_ON:
436 case SND_SOC_BIAS_PREPARE:
437 case SND_SOC_BIAS_STANDBY:
438 if (card->dapm.bias_level == SND_SOC_BIAS_OFF)
439 ams_delta_latch2_write(AMS_DELTA_LATCH2_MODEM_NRESET,
440 AMS_DELTA_LATCH2_MODEM_NRESET);
441 break;
442 case SND_SOC_BIAS_OFF:
443 if (card->dapm.bias_level != SND_SOC_BIAS_OFF)
444 ams_delta_latch2_write(AMS_DELTA_LATCH2_MODEM_NRESET,
445 0);
446 }
447 card->dapm.bias_level = level;
448
449 return 0;
450}
451
452/* Digital mute implemented using modem/CPU multiplexer. 429/* Digital mute implemented using modem/CPU multiplexer.
453 * Shares hardware with codec config pulse generation */ 430 * Shares hardware with codec config pulse generation */
454static bool ams_delta_muted = 1; 431static bool ams_delta_muted = 1;
@@ -512,9 +489,6 @@ static int ams_delta_cx20442_init(struct snd_soc_pcm_runtime *rtd)
512 ams_delta_ops.shutdown = ams_delta_shutdown; 489 ams_delta_ops.shutdown = ams_delta_shutdown;
513 } 490 }
514 491
515 /* Set codec bias level */
516 ams_delta_set_bias_level(card, dapm, SND_SOC_BIAS_STANDBY);
517
518 /* Add hook switch - can be used to control the codec from userspace 492 /* Add hook switch - can be used to control the codec from userspace
519 * even if line discipline fails */ 493 * even if line discipline fails */
520 ret = snd_soc_jack_new(rtd->codec, "hook_switch", 494 ret = snd_soc_jack_new(rtd->codec, "hook_switch",
@@ -598,7 +572,6 @@ static struct snd_soc_card ams_delta_audio_card = {
598 .owner = THIS_MODULE, 572 .owner = THIS_MODULE,
599 .dai_link = &ams_delta_dai_link, 573 .dai_link = &ams_delta_dai_link,
600 .num_links = 1, 574 .num_links = 1,
601 .set_bias_level = ams_delta_set_bias_level,
602}; 575};
603 576
604/* Module init/exit */ 577/* Module init/exit */
@@ -635,7 +608,7 @@ err:
635 platform_device_put(ams_delta_audio_platform_device); 608 platform_device_put(ams_delta_audio_platform_device);
636 return ret; 609 return ret;
637} 610}
638module_init(ams_delta_module_init); 611late_initcall(ams_delta_module_init);
639 612
640static void __exit ams_delta_module_exit(void) 613static void __exit ams_delta_module_exit(void)
641{ 614{
@@ -647,11 +620,6 @@ static void __exit ams_delta_module_exit(void)
647 ARRAY_SIZE(ams_delta_hook_switch_gpios), 620 ARRAY_SIZE(ams_delta_hook_switch_gpios),
648 ams_delta_hook_switch_gpios); 621 ams_delta_hook_switch_gpios);
649 622
650 /* Keep modem power on */
651 ams_delta_set_bias_level(&ams_delta_audio_card,
652 &ams_delta_audio_card.rtd[0].codec->dapm,
653 SND_SOC_BIAS_STANDBY);
654
655 platform_device_unregister(cx20442_platform_device); 623 platform_device_unregister(cx20442_platform_device);
656 platform_device_unregister(ams_delta_audio_platform_device); 624 platform_device_unregister(ams_delta_audio_platform_device);
657} 625}