1 From 330ac25864dd0a71f2d1cd7d58db103ee93f9125 Mon Sep 17 00:00:00 2001
2 From: mokopatches <mokopatches@openmoko.org>
3 Date: Wed, 16 Jul 2008 14:46:52 +0100
4 Subject: [PATCH] gta02-core.patch
7 arch/arm/mach-s3c2440/Kconfig | 15 +
8 arch/arm/mach-s3c2440/Makefile | 3 +
9 arch/arm/mach-s3c2440/mach-gta02.c | 826 ++++++++++++++++++++++++++++++++++
10 drivers/leds/leds-neo1973-vibrator.c | 2 +-
11 include/asm-arm/arch-s3c2410/gta02.h | 99 ++++
12 sound/soc/s3c24xx/neo1973_wm8753.c | 8 +
13 6 files changed, 952 insertions(+), 1 deletions(-)
14 create mode 100644 arch/arm/mach-s3c2440/mach-gta02.c
15 create mode 100644 include/asm-arm/arch-s3c2410/gta02.h
17 diff --git a/arch/arm/mach-s3c2440/Kconfig b/arch/arm/mach-s3c2440/Kconfig
18 index f1915bd..6b317d1 100644
19 --- a/arch/arm/mach-s3c2440/Kconfig
20 +++ b/arch/arm/mach-s3c2440/Kconfig
21 @@ -68,5 +68,20 @@ config SMDK2440_CPU2440
25 +config MACH_NEO1973_GTA02
26 + bool "FIC Neo1973 GSM Phone (GTA02 Hardware)"
28 + select SENSORS_PCF50633
30 + Say Y here if you are using the FIC Neo1973 GSM Phone
32 +config NEO1973_GTA02_2440
33 + bool "Old FIC Neo1973 GTA02 hardware using S3C2440 CPU"
34 + depends on MACH_NEO1973_GTA02
37 + Say Y here if you are using an early hardware revision
38 + of the FIC/OpenMoko Neo1973 GTA02 GSM Phone.
42 diff --git a/arch/arm/mach-s3c2440/Makefile b/arch/arm/mach-s3c2440/Makefile
43 index c81ed62..1a4defd 100644
44 --- a/arch/arm/mach-s3c2440/Makefile
45 +++ b/arch/arm/mach-s3c2440/Makefile
46 @@ -21,3 +21,6 @@ obj-$(CONFIG_MACH_OSIRIS) += mach-osiris.o
47 obj-$(CONFIG_MACH_RX3715) += mach-rx3715.o
48 obj-$(CONFIG_ARCH_S3C2440) += mach-smdk2440.o
49 obj-$(CONFIG_MACH_NEXCODER_2440) += mach-nexcoder.o
50 +obj-$(CONFIG_MACH_AT2440EVB) += mach-at2440evb.o
51 +obj-$(CONFIG_MACH_NEO1973_GTA02) += mach-gta02.o
53 diff --git a/arch/arm/mach-s3c2440/mach-gta02.c b/arch/arm/mach-s3c2440/mach-gta02.c
55 index 0000000..f72a5ae
57 +++ b/arch/arm/mach-s3c2440/mach-gta02.c
60 + * linux/arch/arm/mach-s3c2440/mach-gta02.c
62 + * S3C2440 Machine Support for the FIC GTA02 (Neo1973)
64 + * Copyright (C) 2006-2007 by OpenMoko, Inc.
65 + * Author: Harald Welte <laforge@openmoko.org>
66 + * All rights reserved.
68 + * This program is free software; you can redistribute it and/or
69 + * modify it under the terms of the GNU General Public License as
70 + * published by the Free Software Foundation; either version 2 of
71 + * the License, or (at your option) any later version.
73 + * This program is distributed in the hope that it will be useful,
74 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
75 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
76 + * GNU General Public License for more details.
78 + * You should have received a copy of the GNU General Public License
79 + * along with this program; if not, write to the Free Software
80 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
85 +#include <linux/kernel.h>
86 +#include <linux/types.h>
87 +#include <linux/interrupt.h>
88 +#include <linux/list.h>
89 +#include <linux/delay.h>
90 +#include <linux/timer.h>
91 +#include <linux/init.h>
92 +#include <linux/workqueue.h>
93 +#include <linux/platform_device.h>
94 +#include <linux/serial_core.h>
95 +#include <linux/spi/spi.h>
96 +#include <linux/spi/glamo.h>
97 +#include <linux/spi/spi_bitbang.h>
98 +#include <linux/mmc/host.h>
100 +#include <linux/mtd/mtd.h>
101 +#include <linux/mtd/nand.h>
102 +#include <linux/mtd/nand_ecc.h>
103 +#include <linux/mtd/partitions.h>
104 +#include <linux/mtd/physmap.h>
106 +#include <linux/pcf50633.h>
108 +#include <asm/mach/arch.h>
109 +#include <asm/mach/map.h>
110 +#include <asm/mach/irq.h>
112 +#include <asm/hardware.h>
114 +#include <asm/irq.h>
115 +#include <asm/mach-types.h>
117 +#include <asm/arch/regs-gpio.h>
118 +#include <asm/arch/regs-gpioj.h>
119 +#include <asm/arch/fb.h>
120 +#include <asm/arch/mci.h>
121 +#include <asm/arch/ts.h>
122 +#include <asm/arch/spi.h>
123 +#include <asm/arch/spi-gpio.h>
124 +#include <asm/arch/usb-control.h>
126 +#include <asm/arch/gta01.h>
127 +#include <asm/arch/gta02.h>
129 +#include <asm/plat-s3c/regs-serial.h>
130 +#include <asm/plat-s3c/nand.h>
131 +#include <asm/plat-s3c24xx/devs.h>
132 +#include <asm/plat-s3c24xx/cpu.h>
133 +#include <asm/plat-s3c24xx/pm.h>
134 +#include <asm/plat-s3c24xx/udc.h>
136 +#include <linux/glamofb.h>
138 +static struct map_desc gta02_iodesc[] __initdata = {
140 + .virtual = 0xe0000000,
141 + .pfn = __phys_to_pfn(S3C2410_CS3+0x01000000),
147 +#define UCON S3C2410_UCON_DEFAULT
148 +#define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB
149 +#define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE
151 +static struct s3c2410_uartcfg gta02_uartcfgs[] = {
176 +/* PMU driver info */
178 +static int pmu_callback(struct device *dev, unsigned int feature,
179 + enum pmu_event event)
182 + case PCF50633_FEAT_MBC:
184 + case PMU_EVT_INSERT:
185 + case PMU_EVT_USB_INSERT:
186 + pcf50633_charge_enable(pcf50633_global, 1);
188 + case PMU_EVT_REMOVE:
189 + case PMU_EVT_USB_REMOVE:
190 + pcf50633_charge_enable(pcf50633_global, 0);
203 +static struct pcf50633_platform_data gta02_pcf_pdata = {
204 + .used_features = PCF50633_FEAT_MBC |
205 + PCF50633_FEAT_BBC |
206 + PCF50633_FEAT_RTC |
207 + PCF50633_FEAT_CHGCUR |
208 + PCF50633_FEAT_BATVOLT |
209 + PCF50633_FEAT_BATTEMP |
210 + PCF50633_FEAT_PWM_BL,
211 + .onkey_seconds_sig_init = 4,
212 + .onkey_seconds_shutdown = 8,
213 + .cb = &pmu_callback,
214 + .r_fix_batt = 10000,
215 + .r_fix_batt_par = 10000,
216 + .r_sense_milli = 220,
218 + [PCF50633_REGULATOR_AUTO] = {
220 + .flags = PMU_VRAIL_F_SUSPEND_ON,
226 + [PCF50633_REGULATOR_DOWN1] = {
227 + .name = "core_1v3",
233 + [PCF50633_REGULATOR_DOWN2] = {
234 + .name = "core_1v8",
240 + [PCF50633_REGULATOR_HCLDO] = {
247 + [PCF50633_REGULATOR_LDO1] = {
248 + .name = "stby_1v3",
249 + .flags = PMU_VRAIL_F_SUSPEND_ON,
255 + [PCF50633_REGULATOR_LDO2] = {
256 + .name = "codec_3v3",
262 + [PCF50633_REGULATOR_LDO3] = {
269 + [PCF50633_REGULATOR_LDO4] = {
276 + [PCF50633_REGULATOR_LDO5] = {
283 + [PCF50633_REGULATOR_LDO6] = {
293 +#if 0 /* currently unused */
294 +static void cfg_pmu_vrail(struct pmu_voltage_rail *vrail, char *name,
295 + unsigned int flags, unsigned int init,
298 + vrail->name = name;
299 + vrail->flags = flags;
300 + vrail->voltage.init = init;
301 + vrail->voltage.max = max;
305 +static void mangle_pmu_pdata_by_system_rev(void)
307 + switch (system_rev) {
308 + case GTA02v1_SYSTEM_REV:
309 + /* FIXME: this is only in v1 due to wrong PMU variant */
310 + gta02_pcf_pdata.rails[PCF50633_REGULATOR_DOWN2].flags =
311 + PMU_VRAIL_F_SUSPEND_ON;
313 + case GTA02v2_SYSTEM_REV:
314 + case GTA02v3_SYSTEM_REV:
315 + case GTA02v4_SYSTEM_REV:
316 + case GTA02v5_SYSTEM_REV:
317 + case GTA02v6_SYSTEM_REV:
318 + /* we need to keep the 1.8V going since this is the SDRAM
319 + * self-refresh voltage */
320 + gta02_pcf_pdata.rails[PCF50633_REGULATOR_DOWN2].flags =
321 + PMU_VRAIL_F_SUSPEND_ON;
322 + gta02_pcf_pdata.rails[PCF50633_REGULATOR_DOWN2].name =
324 + gta02_pcf_pdata.rails[PCF50633_REGULATOR_LDO1].name =
326 + gta02_pcf_pdata.rails[PCF50633_REGULATOR_LDO1].voltage.init =
328 + gta02_pcf_pdata.rails[PCF50633_REGULATOR_LDO1].voltage.max =
330 + gta02_pcf_pdata.rails[PCF50633_REGULATOR_LDO1].flags &=
331 + ~PMU_VRAIL_F_SUSPEND_ON;
332 + gta02_pcf_pdata.rails[PCF50633_REGULATOR_LDO3].flags =
333 + PMU_VRAIL_F_UNUSED;
334 + gta02_pcf_pdata.rails[PCF50633_REGULATOR_LDO5] = ((struct pmu_voltage_rail) {
341 + gta02_pcf_pdata.rails[PCF50633_REGULATOR_LDO6] = ((struct pmu_voltage_rail) {
354 +static struct resource gta02_pmu_resources[] = {
356 + .flags = IORESOURCE_IRQ,
357 + .start = GTA02_IRQ_PCF50633,
358 + .end = GTA02_IRQ_PCF50633,
362 +struct platform_device gta02_pmu_dev = {
363 + .name = "pcf50633",
364 + .num_resources = ARRAY_SIZE(gta02_pmu_resources),
365 + .resource = gta02_pmu_resources,
367 + .platform_data = >a02_pcf_pdata,
374 +#define GTA02_FLASH_BASE 0x18000000 /* GCS3 */
375 +#define GTA02_FLASH_SIZE 0x200000 /* 2MBytes */
377 +static struct physmap_flash_data gta02_nor_flash_data = {
381 +static struct resource gta02_nor_flash_resource = {
382 + .start = GTA02_FLASH_BASE,
383 + .end = GTA02_FLASH_BASE + GTA02_FLASH_SIZE - 1,
384 + .flags = IORESOURCE_MEM,
387 +static struct platform_device gta02_nor_flash = {
388 + .name = "physmap-flash",
391 + .platform_data = >a02_nor_flash_data,
393 + .resource = >a02_nor_flash_resource,
394 + .num_resources = 1,
399 +static struct resource gta02_sdio_resources[] = {
401 + .flags = IORESOURCE_IRQ,
406 + .flags = IORESOURCE_MEM,
407 + .start = S3C2410_PA_SDI,
408 + .end = S3C2410_PA_SDI + S3C24XX_SZ_SDI - 1,
411 + .flags = IORESOURCE_DMA,
412 + .start = 0, /* Channel 0 for SDI */
418 +static struct platform_device gta02_sdio_dev = {
419 + .name = "s3c24xx-sdio",
422 + .coherent_dma_mask = 0xffffffff,
424 + .resource = gta02_sdio_resources,
425 + .num_resources = ARRAY_SIZE(gta02_sdio_resources),
428 +static struct platform_device *gta02_devices[] __initdata = {
433 + // &s3c_device_sdi, /* FIXME: temporary disable to avoid s3cmci bind */
434 + &s3c_device_usbgadget,
442 +static struct s3c2410_nand_set gta02_nand_sets[] = {
444 + .name = "neo1973-nand",
446 + .flags = S3C2410_NAND_BBT,
450 +/* choose a set of timings which should suit most 512Mbit
451 + * chips and beyond.
454 +static struct s3c2410_platform_nand gta02_nand_info = {
458 + .nr_sets = ARRAY_SIZE(gta02_nand_sets),
459 + .sets = gta02_nand_sets,
462 +static struct s3c24xx_mci_pdata gta02_mmc_cfg = {
463 + .gpio_detect = GTA02v1_GPIO_nSD_DETECT,
465 + .ocr_avail = MMC_VDD_32_33,
468 +static void gta02_udc_command(enum s3c2410_udc_cmd_e cmd)
470 + printk(KERN_DEBUG "%s(%d)\n", __func__, cmd);
473 + case S3C2410_UDC_P_ENABLE:
474 + s3c2410_gpio_setpin(GTA02_GPIO_USB_PULLUP, 1);
476 + case S3C2410_UDC_P_DISABLE:
477 + s3c2410_gpio_setpin(GTA02_GPIO_USB_PULLUP, 0);
479 + case S3C2410_UDC_P_RESET:
487 +/* use a work queue, since I2C API inherently schedules
488 + * and we get called in hardirq context from UDC driver */
491 + struct work_struct work;
494 +static struct vbus_draw gta02_udc_vbus_drawer;
496 +static void __gta02_udc_vbus_draw(struct work_struct *work)
498 + if (!pcf50633_global) {
499 + printk(KERN_ERR "pcf50633 not initialized yet, can't change "
503 + pcf50633_usb_curlim_set(pcf50633_global, gta02_udc_vbus_drawer.ma);
506 +static void gta02_udc_vbus_draw(unsigned int ma)
508 + gta02_udc_vbus_drawer.ma = ma;
509 + schedule_work(>a02_udc_vbus_drawer.work);
512 +static struct s3c2410_udc_mach_info gta02_udc_cfg = {
513 + .vbus_draw = gta02_udc_vbus_draw,
514 + .udc_command = gta02_udc_command,
518 +static struct s3c2410_ts_mach_info gta02_ts_cfg = {
521 + .oversampling_shift = 5,
526 +static struct spi_board_info gta02_spi_board_info[] = {
528 + .modalias = "jbt6k74",
529 + /* platform_data */
530 + /* controller_data */
532 + .max_speed_hz = 10 * 1000 * 1000,
538 +static struct glamo_spi_info glamo_spi_cfg = {
539 + .board_size = ARRAY_SIZE(gta02_spi_board_info),
540 + .board_info = gta02_spi_board_info,
543 +static struct glamo_spigpio_info glamo_spigpio_cfg = {
544 + .pin_clk = GLAMO_GPIO10_OUTPUT,
545 + .pin_mosi = GLAMO_GPIO11_OUTPUT,
546 + .pin_cs = GLAMO_GPIO12_OUTPUT,
548 + .board_size = ARRAY_SIZE(gta02_spi_board_info),
549 + .board_info = gta02_spi_board_info,
552 +static struct resource gta01_led_resources[] = {
554 + .start = GTA02_GPIO_VIBRATOR_ON,
555 + .end = GTA02_GPIO_VIBRATOR_ON,
559 +static struct platform_device gta01_led_dev = {
560 + .name = "neo1973-vibrator",
561 + .num_resources = ARRAY_SIZE(gta01_led_resources),
562 + .resource = gta01_led_resources,
565 +static struct resource gta02_led_resources[] = {
567 + .name = "gta02-power:orange",
568 + .start = GTA02_GPIO_PWR_LED1,
569 + .end = GTA02_GPIO_PWR_LED1,
571 + .name = "gta02-power:blue",
572 + .start = GTA02_GPIO_PWR_LED2,
573 + .end = GTA02_GPIO_PWR_LED2,
575 + .name = "gta02-aux:red",
576 + .start = GTA02_GPIO_AUX_LED,
577 + .end = GTA02_GPIO_AUX_LED,
581 +struct platform_device gta02_led_dev = {
582 + .name = "gta02-led",
583 + .num_resources = ARRAY_SIZE(gta02_led_resources),
584 + .resource = gta02_led_resources,
587 +static struct resource gta01_button_resources[] = {
589 + .start = GTA02_GPIO_AUX_KEY,
590 + .end = GTA02_GPIO_AUX_KEY,
593 + .start = GTA02_GPIO_HOLD_KEY,
594 + .end = GTA02_GPIO_HOLD_KEY,
597 + .start = GTA02_GPIO_JACK_INSERT,
598 + .end = GTA02_GPIO_JACK_INSERT,
602 +static struct platform_device gta01_button_dev = {
603 + .name = "neo1973-button",
604 + .num_resources = ARRAY_SIZE(gta01_button_resources),
605 + .resource = gta01_button_resources,
608 +static struct platform_device gta01_pm_gsm_dev = {
609 + .name = "neo1973-pm-gsm",
613 +static struct s3c2410_hcd_info gta02_usb_info = {
615 + .flags = S3C_HCDFLG_USED,
622 +static int glamo_irq_is_wired(void)
628 + * GTA02 S-Media IRQs prior to A5 are broken due to a lack of
629 + * a pullup on the INT# line. Check for the bad behaviour.
631 + s3c2410_gpio_setpin(S3C2410_GPG4, 0);
632 + s3c2410_gpio_cfgpin(S3C2410_GPG4, S3C2410_GPG4_OUTP);
633 + s3c2410_gpio_cfgpin(S3C2410_GPG4, S3C2410_GPG4_INP);
635 + * we force it low ourselves for a moment and resume being input.
636 + * If there is a pullup, it won't stay low for long. But if the
637 + * level converter is there as on < A5 revision, the weak keeper
638 + * on the input of the LC will hold the line low indefinitiely
641 + rc = s3c2410_gpio_getpin(S3C2410_GPG4);
642 + while ((!rc) && ((count++) < 10));
643 + if (rc) { /* it got pulled back up, it's good */
644 + printk(KERN_INFO "Detected S-Media IRQ# pullup, "
645 + "enabling interrupt\n");
647 + } else /* Gah we can't work with this level converter */
648 + printk(KERN_WARNING "** Detected bad IRQ# circuit found"
649 + " on pre-A5 GTA02: S-Media interrupt disabled **\n");
655 +gta02_glamo_mmc_set_power(unsigned char power_mode, unsigned short vdd)
659 + printk(KERN_DEBUG "mmc_set_power(power_mode=%u, vdd=%u\n",
662 + switch (system_rev) {
663 + case GTA02v1_SYSTEM_REV:
664 + case GTA02v2_SYSTEM_REV:
666 + case GTA02v3_SYSTEM_REV:
667 + case GTA02v4_SYSTEM_REV:
668 + case GTA02v5_SYSTEM_REV:
669 + case GTA02v6_SYSTEM_REV:
670 + /* depend on pcf50633 driver init */
671 + if (!pcf50633_global)
672 + while (!pcf50633_global)
674 + switch (power_mode) {
677 + /* select and set the voltage */
679 + mv += 300 + 100 * (vdd - 8);
683 + pcf50633_voltage_set(pcf50633_global,
684 + PCF50633_REGULATOR_HCLDO, mv);
686 + pcf50633_onoff_set(pcf50633_global,
687 + PCF50633_REGULATOR_HCLDO, 1);
690 + case MMC_POWER_OFF:
691 + pcf50633_onoff_set(pcf50633_global,
692 + PCF50633_REGULATOR_HCLDO, 0);
700 +/* Smedia Glamo 3362 */
702 +static struct glamofb_platform_data gta02_glamo_pdata = {
705 + /* 24.5MHz --> 40.816ns */
708 + .right_margin = 16,
710 + .lower_margin = 16,
713 + .fb_mem_size = 0x400000, /* glamo has 8 megs of SRAM. we use 4 */
729 + //.spi_info = &glamo_spi_cfg,
730 + .spigpio_info = &glamo_spigpio_cfg,
732 + /* glamo MMC function platform data */
733 + .glamo_set_mci_power = gta02_glamo_mmc_set_power,
734 + .glamo_irq_is_wired = glamo_irq_is_wired,
737 +static struct resource gta02_glamo_resources[] = {
739 + .start = S3C2410_CS1,
740 + .end = S3C2410_CS1 + 0x1000000 - 1,
741 + .flags = IORESOURCE_MEM,
744 + .start = GTA02_IRQ_3D,
745 + .end = GTA02_IRQ_3D,
746 + .flags = IORESOURCE_IRQ,
749 + .start = GTA02v1_GPIO_3D_RESET,
750 + .end = GTA02v1_GPIO_3D_RESET,
754 +static struct platform_device gta02_glamo_dev = {
755 + .name = "glamo3362",
756 + .num_resources = ARRAY_SIZE(gta02_glamo_resources),
757 + .resource = gta02_glamo_resources,
759 + .platform_data = >a02_glamo_pdata,
763 +static void mangle_glamo_res_by_system_rev(void)
765 + switch (system_rev) {
766 + case GTA02v1_SYSTEM_REV:
769 + gta02_glamo_resources[2].start = GTA02_GPIO_3D_RESET;
770 + gta02_glamo_resources[2].end = GTA02_GPIO_3D_RESET;
774 + switch (system_rev) {
775 + case GTA02v1_SYSTEM_REV:
776 + case GTA02v2_SYSTEM_REV:
777 + case GTA02v3_SYSTEM_REV:
778 + /* case GTA02v4_SYSTEM_REV: - FIXME: handle this later */
779 + /* The hardware is missing a pull-up resistor and thus can't
780 + * support the Smedia Glamo IRQ */
781 + gta02_glamo_resources[1].start = 0;
782 + gta02_glamo_resources[1].end = 0;
787 +static void __init gta02_map_io(void)
789 + s3c24xx_init_io(gta02_iodesc, ARRAY_SIZE(gta02_iodesc));
790 + s3c24xx_init_clocks(12000000);
791 + s3c24xx_init_uarts(gta02_uartcfgs, ARRAY_SIZE(gta02_uartcfgs));
794 +static irqreturn_t gta02_modem_irq(int irq, void *param)
796 + printk(KERN_DEBUG "modem wakeup interrupt\n");
797 + return IRQ_HANDLED;
800 +static void __init gta02_machine_init(void)
804 + s3c_device_usb.dev.platform_data = >a02_usb_info;
805 + s3c_device_nand.dev.platform_data = >a02_nand_info;
806 + s3c_device_sdi.dev.platform_data = >a02_mmc_cfg;
808 + /* Only GTA02v1 has a SD_DETECT GPIO. Since the slot is not
809 + * hot-pluggable, this is not required anyway */
810 + switch (system_rev) {
811 + case GTA02v1_SYSTEM_REV:
814 + gta02_mmc_cfg.gpio_detect = 0;
818 + INIT_WORK(>a02_udc_vbus_drawer.work, __gta02_udc_vbus_draw);
819 + s3c24xx_udc_set_platdata(>a02_udc_cfg);
820 + set_s3c2410ts_info(>a02_ts_cfg);
822 + /* FIXME: hardcoded WLAN module power-up */
823 + s3c2410_gpio_cfgpin(GTA02_CHIP_PWD, S3C2410_GPIO_OUTPUT);
825 + /* Power is down */
826 + s3c2410_gpio_setpin(GTA02_CHIP_PWD, 1);
829 + switch (system_rev) {
830 + case GTA02v1_SYSTEM_REV:
831 + s3c2410_gpio_setpin(GTA02_CHIP_PWD, 0);
834 + s3c2410_gpio_cfgpin(GTA02_GPIO_nWLAN_RESET, S3C2410_GPIO_OUTPUT);
835 + /* Chip is in reset state */
836 + s3c2410_gpio_setpin(GTA02_GPIO_nWLAN_RESET, 0);
839 + s3c2410_gpio_setpin(GTA02_CHIP_PWD, 0);
841 + /* Chip is out of reset */
842 + s3c2410_gpio_setpin(GTA02_GPIO_nWLAN_RESET, 1);
846 + platform_device_register(>a01_button_dev);
847 + platform_device_register(>a01_pm_gsm_dev);
849 + mangle_pmu_pdata_by_system_rev();
850 + platform_device_register(>a02_pmu_dev);
851 + platform_device_register(>a01_led_dev);
852 + platform_device_register(>a02_led_dev);
854 + mangle_glamo_res_by_system_rev();
855 + platform_device_register(>a02_glamo_dev);
857 + platform_device_register(>a02_sdio_dev);
859 + platform_add_devices(gta02_devices, ARRAY_SIZE(gta02_devices));
863 + /* Set LCD_RESET / XRES to high */
864 + s3c2410_gpio_cfgpin(GTA01_GPIO_LCD_RESET, S3C2410_GPIO_OUTPUT);
865 + s3c2410_gpio_setpin(GTA01_GPIO_LCD_RESET, 1);
867 + /* Make sure the modem can wake us up */
868 + set_irq_type(GTA02_IRQ_MODEM, IRQT_RISING);
869 + rc = request_irq(GTA02_IRQ_MODEM, gta02_modem_irq, IRQF_DISABLED,
872 + printk(KERN_ERR "GTA02: can't request GSM modem wakeup IRQ\n");
873 + enable_irq_wake(GTA02_IRQ_MODEM);
876 +MACHINE_START(NEO1973_GTA02, "GTA02")
877 + .phys_io = S3C2410_PA_UART,
878 + .io_pg_offst = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
879 + .boot_params = S3C2410_SDRAM_PA + 0x100,
880 + .map_io = gta02_map_io,
881 + .init_irq = s3c24xx_init_irq,
882 + .init_machine = gta02_machine_init,
883 + .timer = &s3c24xx_timer,
885 diff --git a/drivers/leds/leds-neo1973-vibrator.c b/drivers/leds/leds-neo1973-vibrator.c
886 index 0336e36..c943a6a 100644
887 --- a/drivers/leds/leds-neo1973-vibrator.c
888 +++ b/drivers/leds/leds-neo1973-vibrator.c
889 @@ -113,7 +113,7 @@ static int __init neo1973_vib_probe(struct platform_device *pdev)
893 - if (!machine_is_neo1973_gta01())
894 + if (!machine_is_neo1973_gta01() && !machine_is_neo1973_gta02())
897 r = platform_get_resource(pdev, 0, 0);
898 diff --git a/include/asm-arm/arch-s3c2410/gta02.h b/include/asm-arm/arch-s3c2410/gta02.h
900 index 0000000..fa49d93
902 +++ b/include/asm-arm/arch-s3c2410/gta02.h
907 +#include <asm/arch/regs-gpio.h>
908 +#include <asm/arch/irqs.h>
910 +/* Different hardware revisions, passed in ATAG_REVISION by u-boot */
911 +#define GTA02v1_SYSTEM_REV 0x00000310
912 +#define GTA02v2_SYSTEM_REV 0x00000320
913 +#define GTA02v3_SYSTEM_REV 0x00000330
914 +#define GTA02v4_SYSTEM_REV 0x00000340
915 +#define GTA02v5_SYSTEM_REV 0x00000350
916 +#define GTA02v6_SYSTEM_REV 0x00000360
918 +#define GTA02_GPIO_n3DL_GSM S3C2410_GPA13 /* v1 + v2 + v3 only */
920 +#define GTA02_GPIO_PWR_LED1 S3C2410_GPB0
921 +#define GTA02_GPIO_PWR_LED2 S3C2410_GPB1
922 +#define GTA02_GPIO_AUX_LED S3C2410_GPB2
923 +#define GTA02_GPIO_VIBRATOR_ON S3C2410_GPB3
924 +#define GTA02v1_GPIO_GPS_PWRON S3C2410_GPB4 /* v1 only */
925 +#define GTA02_GPIO_MODEM_RST S3C2410_GPB5
926 +#define GTA02_GPIO_BT_EN S3C2410_GPB6
927 +#define GTA02_GPIO_MODEM_ON S3C2410_GPB7
928 +#define GTA02v1_GPIO_EN_AGPS3V S3C2410_GPB8 /* v1 only */
929 +#define GTA02_GPIO_EXTINT8 S3C2410_GPB8
930 +#define GTA02_GPIO_USB_PULLUP S3C2410_GPB9
932 +#define GTA02v1_GPIO_nGPS_RST S3C2410_GPC0 /* v1 only */
933 +#define GTA02v12_GPIO_PIO3 S3C2410_GPC5 /* v1 + v2 only */
934 +#define GTA02_GPIO_PIO5 S3C2410_GPC5 /* v3 + v4 only */
935 +#define GTA02_GPIO_LCD_RESET S3C2410_GPC6 /* v1 + v2 only */
936 +#define GTA02v12_GPIO_PIO2 S3C2410_GPC7 /* v1 + v2 only */
937 +#define GTA02v2_nUSB_FLT S3C2410_GPC9 /* v2 only */
938 +#define GTA02v2_nUSB_OC S3C2410_GPC10 /* v2 only */
939 +#define GTA02v2_nGSM_OC S3C2410_GPC12 /* v2 only */
941 +#define GTA02v3_GPIO_nG1_CS S3C2410_GPD12 /* v3 + v4 only */
942 +#define GTA02v3_GPIO_nG2_CS S3C2410_GPD13 /* v3 + v4 only */
944 +#define GTA02_GPIO_nG1_INT S3C2410_GPF0
945 +#define GTA02_GPIO_IO1 S3C2410_GPF1
946 +#define GTA02v1_GPIO_nG2_INT S3C2410_GPF2 /* v1 only */
947 +#define GTA02_GPIO_PIO_2 S3C2410_GPF2 /* v2 + v3 + v4 only */
948 +#define GTA02_GPIO_JACK_INSERT S3C2410_GPF4
949 +#define GTA02v1_GPIO_nSD_DETECT S3C2410_GPF5 /* v1 only */
950 +#define GTA02_GPIO_WLAN_GPIO1 S3C2410_GPF5 /* v2 + v3 + v4 only */
951 +#define GTA02_GPIO_AUX_KEY S3C2410_GPF6
952 +#define GTA02_GPIO_HOLD_KEY S3C2410_GPF7
954 +#define GTA02_GPIO_3D_IRQ S3C2410_GPG4
955 +#define GTA02v1_GPIO_nG1_CS S3C2410_GPG8 /* v1 only */
956 +#define GTA02v2_GPIO_nG2_INT S3C2410_GPG8 /* v2 + v3 + v4 only */
957 +#define GTA02v3_GPIO_nUSB_OC S3C2410_GPG9 /* v3 + v4 only */
958 +#define GTA02v3_GPIO_nUSB_FLT S3C2410_GPG10 /* v3 + v4 only */
959 +#define GTA02v1_GPIO_nG2_CS S3C2410_GPG11 /* v1 only */
960 +#define GTA02v3_GPIO_nGSM_OC S3C2410_GPG11 /* v3 + v4 only */
962 +#define GTA02v1_GPIO_3D_RESET S3C2440_GPJ0 /* v1 only */
963 +#define GTA02v2_GPIO_BAT_ID S3C2440_GPJ0 /* v2 only */
964 +#define GTA02v1_GPIO_WLAN_GPIO8 S3C2440_GPJ1 /* v1 only */
965 +#define GTA02_GPIO_AMP_SHUT S3C2440_GPJ1 /* v2 + v3 + v4 only */
966 +#define GTA02v1_GPIO_WLAN_GPIO10 S3C2440_GPJ2
967 +#define GTA02_GPIO_HP_IN S3C2440_GPJ2 /* v2 + v3 + v4 only */
968 +#define GTA02v1_GPIO_KEEPACT S3C2440_GPJ3 /* v1 only */
969 +#define GTA02_GPIO_INT0 S3C2440_GPJ3 /* v2 + v3 + v4 only */
970 +#define GTA02_GPIO_nGSM_EN S3C2440_GPJ4
971 +#define GTA02_GPIO_3D_RESET S3C2440_GPJ5
972 +#define GTA02_GPIO_nDL_GSM S3C2440_GPJ6 /* v4 + v5 only */
973 +#define GTA02_GPIO_WLAN_GPIO0 S3C2440_GPJ7
974 +#define GTA02v1_GPIO_BAT_ID S3C2440_GPJ8
975 +#define GTA02_GPIO_KEEPACT S3C2440_GPJ8
976 +#define GTA02v1_GPIO_AMP_SHUT S3C2440_GPJ9 /* v1 only */
977 +#define GTA02v2_nG1_CS S3C2440_GPJ9 /* v2 only */
978 +#define GTA02v1_GPIO_HP_IN S3C2440_GPJ10
979 +#define GTA02v2_nG2_CS S3C2440_GPJ10 /* v2 only */
980 +#define GTA02v1_GPIO_INT0 S3C2440_GPJ11 /* v1 only */
981 +#define GTA02_CHIP_PWD S3C2440_GPJ11 /* v2 + v3 + v4 only */
982 +#define GTA02v1_GPIO_nGSM_EN S3C2440_GPJ12 /* v1 only */
983 +#define GTA02_GPIO_nWLAN_RESET S3C2440_GPJ12 /* v2 + v3 + v4 only */
985 +#define GTA02_IRQ_GSENSOR_1 IRQ_EINT0
986 +#define GTA02_IRQ_MODEM IRQ_EINT1
987 +#define GTA02v1_IRQ_GSENSOR_2 IRQ_EINT2 /* v1 only */
988 +#define GTA02_IRQ_PIO_2 IRQ_EINT2 /* v2 + v3 + v4 only */
989 +#define GTA02_IRQ_nJACK_INSERT IRQ_EINT4
990 +#define GTA02v1_IRQ_nSD_CD IRQ_EINT5 /* v1 only */
991 +#define GTA02_IRQ_WLAN_GPIO1 IRQ_EINT5
992 +#define GTA02_IRQ_AUX IRQ_EINT6
993 +#define GTA02_IRQ_nHOLD IRQ_EINT7
994 +#define GTA02v1_IRQ_nSIM_CD IRQ_EINT8 /* v1 only */
995 +#define GTA02_IRQ_PCF50633 IRQ_EINT9
996 +#define GTA02_IRQ_3D IRQ_EINT12
997 +#define GTA02_IRQ_GSENSOR_2 IRQ_EINT16 /* v2 + v3 + v4 only */
998 +#define GTA02v3_IRQ_nUSB_OC IRQ_EINT17 /* v3 + v4 only */
999 +#define GTA02v3_IRQ_nUSB_FLT IRQ_EINT18 /* v3 + v4 only */
1000 +#define GTA02v3_IRQ_nGSM_OC IRQ_EINT19 /* v3 + v4 only */
1002 +#endif /* _GTA02_H */
1003 diff --git a/sound/soc/s3c24xx/neo1973_wm8753.c b/sound/soc/s3c24xx/neo1973_wm8753.c
1004 index 0e9d1c5..4ab6f63 100644
1005 --- a/sound/soc/s3c24xx/neo1973_wm8753.c
1006 +++ b/sound/soc/s3c24xx/neo1973_wm8753.c
1007 @@ -671,6 +671,14 @@ static int __init neo1973_init(void)
1011 + DBG("Entered %s\n", __func__);
1013 + if (!machine_is_neo1973_gta01()) {
1015 + "Only GTA01 hardware supported by ASoc driver\n");
1019 neo1973_snd_device = platform_device_alloc("soc-audio", -1);
1020 if (!neo1973_snd_device)