1 From 565a3af138c80c15151d91647b7e92654997ecc8 Mon Sep 17 00:00:00 2001
2 From: mokopatches <mokopatches@openmoko.org>
3 Date: Fri, 4 Apr 2008 11:35:15 +0100
4 Subject: [PATCH] gta02-core.patch
7 arch/arm/mach-s3c2440/Kconfig | 15 +
8 arch/arm/mach-s3c2440/Makefile | 1 +
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, 949 insertions(+), 2 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 6798d9c..1fab1c0 100644
19 --- a/arch/arm/mach-s3c2440/Kconfig
20 +++ b/arch/arm/mach-s3c2440/Kconfig
21 @@ -74,5 +74,20 @@ config MACH_HXD8
23 Say Y here if you are using the FIC Neo1973 GSM Phone
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 6f590d4..5305fdb 100644
44 --- a/arch/arm/mach-s3c2440/Makefile
45 +++ b/arch/arm/mach-s3c2440/Makefile
46 @@ -22,3 +22,4 @@ obj-$(CONFIG_MACH_RX3715) += mach-rx3715.o
47 obj-$(CONFIG_ARCH_S3C2440) += mach-smdk2440.o
48 obj-$(CONFIG_MACH_NEXCODER_2440) += mach-nexcoder.o
49 obj-$(CONFIG_MACH_HXD8) += mach-hxd8.o
50 +obj-$(CONFIG_MACH_NEO1973_GTA02) += mach-gta02.o
51 diff --git a/arch/arm/mach-s3c2440/mach-gta02.c b/arch/arm/mach-s3c2440/mach-gta02.c
53 index 0000000..f72a5ae
55 +++ b/arch/arm/mach-s3c2440/mach-gta02.c
58 + * linux/arch/arm/mach-s3c2440/mach-gta02.c
60 + * S3C2440 Machine Support for the FIC GTA02 (Neo1973)
62 + * Copyright (C) 2006-2007 by OpenMoko, Inc.
63 + * Author: Harald Welte <laforge@openmoko.org>
64 + * All rights reserved.
66 + * This program is free software; you can redistribute it and/or
67 + * modify it under the terms of the GNU General Public License as
68 + * published by the Free Software Foundation; either version 2 of
69 + * the License, or (at your option) any later version.
71 + * This program is distributed in the hope that it will be useful,
72 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
73 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
74 + * GNU General Public License for more details.
76 + * You should have received a copy of the GNU General Public License
77 + * along with this program; if not, write to the Free Software
78 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
83 +#include <linux/kernel.h>
84 +#include <linux/types.h>
85 +#include <linux/interrupt.h>
86 +#include <linux/list.h>
87 +#include <linux/delay.h>
88 +#include <linux/timer.h>
89 +#include <linux/init.h>
90 +#include <linux/workqueue.h>
91 +#include <linux/platform_device.h>
92 +#include <linux/serial_core.h>
93 +#include <linux/spi/spi.h>
94 +#include <linux/spi/glamo.h>
95 +#include <linux/spi/spi_bitbang.h>
96 +#include <linux/mmc/host.h>
98 +#include <linux/mtd/mtd.h>
99 +#include <linux/mtd/nand.h>
100 +#include <linux/mtd/nand_ecc.h>
101 +#include <linux/mtd/partitions.h>
102 +#include <linux/mtd/physmap.h>
104 +#include <linux/pcf50633.h>
106 +#include <asm/mach/arch.h>
107 +#include <asm/mach/map.h>
108 +#include <asm/mach/irq.h>
110 +#include <asm/hardware.h>
112 +#include <asm/irq.h>
113 +#include <asm/mach-types.h>
115 +#include <asm/arch/regs-gpio.h>
116 +#include <asm/arch/regs-gpioj.h>
117 +#include <asm/arch/fb.h>
118 +#include <asm/arch/mci.h>
119 +#include <asm/arch/ts.h>
120 +#include <asm/arch/spi.h>
121 +#include <asm/arch/spi-gpio.h>
122 +#include <asm/arch/usb-control.h>
124 +#include <asm/arch/gta01.h>
125 +#include <asm/arch/gta02.h>
127 +#include <asm/plat-s3c/regs-serial.h>
128 +#include <asm/plat-s3c/nand.h>
129 +#include <asm/plat-s3c24xx/devs.h>
130 +#include <asm/plat-s3c24xx/cpu.h>
131 +#include <asm/plat-s3c24xx/pm.h>
132 +#include <asm/plat-s3c24xx/udc.h>
134 +#include <linux/glamofb.h>
136 +static struct map_desc gta02_iodesc[] __initdata = {
138 + .virtual = 0xe0000000,
139 + .pfn = __phys_to_pfn(S3C2410_CS3+0x01000000),
145 +#define UCON S3C2410_UCON_DEFAULT
146 +#define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB
147 +#define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE
149 +static struct s3c2410_uartcfg gta02_uartcfgs[] = {
174 +/* PMU driver info */
176 +static int pmu_callback(struct device *dev, unsigned int feature,
177 + enum pmu_event event)
180 + case PCF50633_FEAT_MBC:
182 + case PMU_EVT_INSERT:
183 + case PMU_EVT_USB_INSERT:
184 + pcf50633_charge_enable(pcf50633_global, 1);
186 + case PMU_EVT_REMOVE:
187 + case PMU_EVT_USB_REMOVE:
188 + pcf50633_charge_enable(pcf50633_global, 0);
201 +static struct pcf50633_platform_data gta02_pcf_pdata = {
202 + .used_features = PCF50633_FEAT_MBC |
203 + PCF50633_FEAT_BBC |
204 + PCF50633_FEAT_RTC |
205 + PCF50633_FEAT_CHGCUR |
206 + PCF50633_FEAT_BATVOLT |
207 + PCF50633_FEAT_BATTEMP |
208 + PCF50633_FEAT_PWM_BL,
209 + .onkey_seconds_sig_init = 4,
210 + .onkey_seconds_shutdown = 8,
211 + .cb = &pmu_callback,
212 + .r_fix_batt = 10000,
213 + .r_fix_batt_par = 10000,
214 + .r_sense_milli = 220,
216 + [PCF50633_REGULATOR_AUTO] = {
218 + .flags = PMU_VRAIL_F_SUSPEND_ON,
224 + [PCF50633_REGULATOR_DOWN1] = {
225 + .name = "core_1v3",
231 + [PCF50633_REGULATOR_DOWN2] = {
232 + .name = "core_1v8",
238 + [PCF50633_REGULATOR_HCLDO] = {
245 + [PCF50633_REGULATOR_LDO1] = {
246 + .name = "stby_1v3",
247 + .flags = PMU_VRAIL_F_SUSPEND_ON,
253 + [PCF50633_REGULATOR_LDO2] = {
254 + .name = "codec_3v3",
260 + [PCF50633_REGULATOR_LDO3] = {
267 + [PCF50633_REGULATOR_LDO4] = {
274 + [PCF50633_REGULATOR_LDO5] = {
281 + [PCF50633_REGULATOR_LDO6] = {
291 +#if 0 /* currently unused */
292 +static void cfg_pmu_vrail(struct pmu_voltage_rail *vrail, char *name,
293 + unsigned int flags, unsigned int init,
296 + vrail->name = name;
297 + vrail->flags = flags;
298 + vrail->voltage.init = init;
299 + vrail->voltage.max = max;
303 +static void mangle_pmu_pdata_by_system_rev(void)
305 + switch (system_rev) {
306 + case GTA02v1_SYSTEM_REV:
307 + /* FIXME: this is only in v1 due to wrong PMU variant */
308 + gta02_pcf_pdata.rails[PCF50633_REGULATOR_DOWN2].flags =
309 + PMU_VRAIL_F_SUSPEND_ON;
311 + case GTA02v2_SYSTEM_REV:
312 + case GTA02v3_SYSTEM_REV:
313 + case GTA02v4_SYSTEM_REV:
314 + case GTA02v5_SYSTEM_REV:
315 + case GTA02v6_SYSTEM_REV:
316 + /* we need to keep the 1.8V going since this is the SDRAM
317 + * self-refresh voltage */
318 + gta02_pcf_pdata.rails[PCF50633_REGULATOR_DOWN2].flags =
319 + PMU_VRAIL_F_SUSPEND_ON;
320 + gta02_pcf_pdata.rails[PCF50633_REGULATOR_DOWN2].name =
322 + gta02_pcf_pdata.rails[PCF50633_REGULATOR_LDO1].name =
324 + gta02_pcf_pdata.rails[PCF50633_REGULATOR_LDO1].voltage.init =
326 + gta02_pcf_pdata.rails[PCF50633_REGULATOR_LDO1].voltage.max =
328 + gta02_pcf_pdata.rails[PCF50633_REGULATOR_LDO1].flags &=
329 + ~PMU_VRAIL_F_SUSPEND_ON;
330 + gta02_pcf_pdata.rails[PCF50633_REGULATOR_LDO3].flags =
331 + PMU_VRAIL_F_UNUSED;
332 + gta02_pcf_pdata.rails[PCF50633_REGULATOR_LDO5] = ((struct pmu_voltage_rail) {
339 + gta02_pcf_pdata.rails[PCF50633_REGULATOR_LDO6] = ((struct pmu_voltage_rail) {
352 +static struct resource gta02_pmu_resources[] = {
354 + .flags = IORESOURCE_IRQ,
355 + .start = GTA02_IRQ_PCF50633,
356 + .end = GTA02_IRQ_PCF50633,
360 +struct platform_device gta02_pmu_dev = {
361 + .name = "pcf50633",
362 + .num_resources = ARRAY_SIZE(gta02_pmu_resources),
363 + .resource = gta02_pmu_resources,
365 + .platform_data = >a02_pcf_pdata,
372 +#define GTA02_FLASH_BASE 0x18000000 /* GCS3 */
373 +#define GTA02_FLASH_SIZE 0x200000 /* 2MBytes */
375 +static struct physmap_flash_data gta02_nor_flash_data = {
379 +static struct resource gta02_nor_flash_resource = {
380 + .start = GTA02_FLASH_BASE,
381 + .end = GTA02_FLASH_BASE + GTA02_FLASH_SIZE - 1,
382 + .flags = IORESOURCE_MEM,
385 +static struct platform_device gta02_nor_flash = {
386 + .name = "physmap-flash",
389 + .platform_data = >a02_nor_flash_data,
391 + .resource = >a02_nor_flash_resource,
392 + .num_resources = 1,
397 +static struct resource gta02_sdio_resources[] = {
399 + .flags = IORESOURCE_IRQ,
404 + .flags = IORESOURCE_MEM,
405 + .start = S3C2410_PA_SDI,
406 + .end = S3C2410_PA_SDI + S3C24XX_SZ_SDI - 1,
409 + .flags = IORESOURCE_DMA,
410 + .start = 0, /* Channel 0 for SDI */
416 +static struct platform_device gta02_sdio_dev = {
417 + .name = "s3c24xx-sdio",
420 + .coherent_dma_mask = 0xffffffff,
422 + .resource = gta02_sdio_resources,
423 + .num_resources = ARRAY_SIZE(gta02_sdio_resources),
426 +static struct platform_device *gta02_devices[] __initdata = {
431 + // &s3c_device_sdi, /* FIXME: temporary disable to avoid s3cmci bind */
432 + &s3c_device_usbgadget,
440 +static struct s3c2410_nand_set gta02_nand_sets[] = {
442 + .name = "neo1973-nand",
444 + .flags = S3C2410_NAND_BBT,
448 +/* choose a set of timings which should suit most 512Mbit
449 + * chips and beyond.
452 +static struct s3c2410_platform_nand gta02_nand_info = {
456 + .nr_sets = ARRAY_SIZE(gta02_nand_sets),
457 + .sets = gta02_nand_sets,
460 +static struct s3c24xx_mci_pdata gta02_mmc_cfg = {
461 + .gpio_detect = GTA02v1_GPIO_nSD_DETECT,
463 + .ocr_avail = MMC_VDD_32_33,
466 +static void gta02_udc_command(enum s3c2410_udc_cmd_e cmd)
468 + printk(KERN_DEBUG "%s(%d)\n", __func__, cmd);
471 + case S3C2410_UDC_P_ENABLE:
472 + s3c2410_gpio_setpin(GTA02_GPIO_USB_PULLUP, 1);
474 + case S3C2410_UDC_P_DISABLE:
475 + s3c2410_gpio_setpin(GTA02_GPIO_USB_PULLUP, 0);
477 + case S3C2410_UDC_P_RESET:
485 +/* use a work queue, since I2C API inherently schedules
486 + * and we get called in hardirq context from UDC driver */
489 + struct work_struct work;
492 +static struct vbus_draw gta02_udc_vbus_drawer;
494 +static void __gta02_udc_vbus_draw(struct work_struct *work)
496 + if (!pcf50633_global) {
497 + printk(KERN_ERR "pcf50633 not initialized yet, can't change "
501 + pcf50633_usb_curlim_set(pcf50633_global, gta02_udc_vbus_drawer.ma);
504 +static void gta02_udc_vbus_draw(unsigned int ma)
506 + gta02_udc_vbus_drawer.ma = ma;
507 + schedule_work(>a02_udc_vbus_drawer.work);
510 +static struct s3c2410_udc_mach_info gta02_udc_cfg = {
511 + .vbus_draw = gta02_udc_vbus_draw,
512 + .udc_command = gta02_udc_command,
516 +static struct s3c2410_ts_mach_info gta02_ts_cfg = {
519 + .oversampling_shift = 5,
524 +static struct spi_board_info gta02_spi_board_info[] = {
526 + .modalias = "jbt6k74",
527 + /* platform_data */
528 + /* controller_data */
530 + .max_speed_hz = 10 * 1000 * 1000,
536 +static struct glamo_spi_info glamo_spi_cfg = {
537 + .board_size = ARRAY_SIZE(gta02_spi_board_info),
538 + .board_info = gta02_spi_board_info,
541 +static struct glamo_spigpio_info glamo_spigpio_cfg = {
542 + .pin_clk = GLAMO_GPIO10_OUTPUT,
543 + .pin_mosi = GLAMO_GPIO11_OUTPUT,
544 + .pin_cs = GLAMO_GPIO12_OUTPUT,
546 + .board_size = ARRAY_SIZE(gta02_spi_board_info),
547 + .board_info = gta02_spi_board_info,
550 +static struct resource gta01_led_resources[] = {
552 + .start = GTA02_GPIO_VIBRATOR_ON,
553 + .end = GTA02_GPIO_VIBRATOR_ON,
557 +static struct platform_device gta01_led_dev = {
558 + .name = "neo1973-vibrator",
559 + .num_resources = ARRAY_SIZE(gta01_led_resources),
560 + .resource = gta01_led_resources,
563 +static struct resource gta02_led_resources[] = {
565 + .name = "gta02-power:orange",
566 + .start = GTA02_GPIO_PWR_LED1,
567 + .end = GTA02_GPIO_PWR_LED1,
569 + .name = "gta02-power:blue",
570 + .start = GTA02_GPIO_PWR_LED2,
571 + .end = GTA02_GPIO_PWR_LED2,
573 + .name = "gta02-aux:red",
574 + .start = GTA02_GPIO_AUX_LED,
575 + .end = GTA02_GPIO_AUX_LED,
579 +struct platform_device gta02_led_dev = {
580 + .name = "gta02-led",
581 + .num_resources = ARRAY_SIZE(gta02_led_resources),
582 + .resource = gta02_led_resources,
585 +static struct resource gta01_button_resources[] = {
587 + .start = GTA02_GPIO_AUX_KEY,
588 + .end = GTA02_GPIO_AUX_KEY,
591 + .start = GTA02_GPIO_HOLD_KEY,
592 + .end = GTA02_GPIO_HOLD_KEY,
595 + .start = GTA02_GPIO_JACK_INSERT,
596 + .end = GTA02_GPIO_JACK_INSERT,
600 +static struct platform_device gta01_button_dev = {
601 + .name = "neo1973-button",
602 + .num_resources = ARRAY_SIZE(gta01_button_resources),
603 + .resource = gta01_button_resources,
606 +static struct platform_device gta01_pm_gsm_dev = {
607 + .name = "neo1973-pm-gsm",
611 +static struct s3c2410_hcd_info gta02_usb_info = {
613 + .flags = S3C_HCDFLG_USED,
620 +static int glamo_irq_is_wired(void)
626 + * GTA02 S-Media IRQs prior to A5 are broken due to a lack of
627 + * a pullup on the INT# line. Check for the bad behaviour.
629 + s3c2410_gpio_setpin(S3C2410_GPG4, 0);
630 + s3c2410_gpio_cfgpin(S3C2410_GPG4, S3C2410_GPG4_OUTP);
631 + s3c2410_gpio_cfgpin(S3C2410_GPG4, S3C2410_GPG4_INP);
633 + * we force it low ourselves for a moment and resume being input.
634 + * If there is a pullup, it won't stay low for long. But if the
635 + * level converter is there as on < A5 revision, the weak keeper
636 + * on the input of the LC will hold the line low indefinitiely
639 + rc = s3c2410_gpio_getpin(S3C2410_GPG4);
640 + while ((!rc) && ((count++) < 10));
641 + if (rc) { /* it got pulled back up, it's good */
642 + printk(KERN_INFO "Detected S-Media IRQ# pullup, "
643 + "enabling interrupt\n");
645 + } else /* Gah we can't work with this level converter */
646 + printk(KERN_WARNING "** Detected bad IRQ# circuit found"
647 + " on pre-A5 GTA02: S-Media interrupt disabled **\n");
653 +gta02_glamo_mmc_set_power(unsigned char power_mode, unsigned short vdd)
657 + printk(KERN_DEBUG "mmc_set_power(power_mode=%u, vdd=%u\n",
660 + switch (system_rev) {
661 + case GTA02v1_SYSTEM_REV:
662 + case GTA02v2_SYSTEM_REV:
664 + case GTA02v3_SYSTEM_REV:
665 + case GTA02v4_SYSTEM_REV:
666 + case GTA02v5_SYSTEM_REV:
667 + case GTA02v6_SYSTEM_REV:
668 + /* depend on pcf50633 driver init */
669 + if (!pcf50633_global)
670 + while (!pcf50633_global)
672 + switch (power_mode) {
675 + /* select and set the voltage */
677 + mv += 300 + 100 * (vdd - 8);
681 + pcf50633_voltage_set(pcf50633_global,
682 + PCF50633_REGULATOR_HCLDO, mv);
684 + pcf50633_onoff_set(pcf50633_global,
685 + PCF50633_REGULATOR_HCLDO, 1);
688 + case MMC_POWER_OFF:
689 + pcf50633_onoff_set(pcf50633_global,
690 + PCF50633_REGULATOR_HCLDO, 0);
698 +/* Smedia Glamo 3362 */
700 +static struct glamofb_platform_data gta02_glamo_pdata = {
703 + /* 24.5MHz --> 40.816ns */
706 + .right_margin = 16,
708 + .lower_margin = 16,
711 + .fb_mem_size = 0x400000, /* glamo has 8 megs of SRAM. we use 4 */
727 + //.spi_info = &glamo_spi_cfg,
728 + .spigpio_info = &glamo_spigpio_cfg,
730 + /* glamo MMC function platform data */
731 + .glamo_set_mci_power = gta02_glamo_mmc_set_power,
732 + .glamo_irq_is_wired = glamo_irq_is_wired,
735 +static struct resource gta02_glamo_resources[] = {
737 + .start = S3C2410_CS1,
738 + .end = S3C2410_CS1 + 0x1000000 - 1,
739 + .flags = IORESOURCE_MEM,
742 + .start = GTA02_IRQ_3D,
743 + .end = GTA02_IRQ_3D,
744 + .flags = IORESOURCE_IRQ,
747 + .start = GTA02v1_GPIO_3D_RESET,
748 + .end = GTA02v1_GPIO_3D_RESET,
752 +static struct platform_device gta02_glamo_dev = {
753 + .name = "glamo3362",
754 + .num_resources = ARRAY_SIZE(gta02_glamo_resources),
755 + .resource = gta02_glamo_resources,
757 + .platform_data = >a02_glamo_pdata,
761 +static void mangle_glamo_res_by_system_rev(void)
763 + switch (system_rev) {
764 + case GTA02v1_SYSTEM_REV:
767 + gta02_glamo_resources[2].start = GTA02_GPIO_3D_RESET;
768 + gta02_glamo_resources[2].end = GTA02_GPIO_3D_RESET;
772 + switch (system_rev) {
773 + case GTA02v1_SYSTEM_REV:
774 + case GTA02v2_SYSTEM_REV:
775 + case GTA02v3_SYSTEM_REV:
776 + /* case GTA02v4_SYSTEM_REV: - FIXME: handle this later */
777 + /* The hardware is missing a pull-up resistor and thus can't
778 + * support the Smedia Glamo IRQ */
779 + gta02_glamo_resources[1].start = 0;
780 + gta02_glamo_resources[1].end = 0;
785 +static void __init gta02_map_io(void)
787 + s3c24xx_init_io(gta02_iodesc, ARRAY_SIZE(gta02_iodesc));
788 + s3c24xx_init_clocks(12000000);
789 + s3c24xx_init_uarts(gta02_uartcfgs, ARRAY_SIZE(gta02_uartcfgs));
792 +static irqreturn_t gta02_modem_irq(int irq, void *param)
794 + printk(KERN_DEBUG "modem wakeup interrupt\n");
795 + return IRQ_HANDLED;
798 +static void __init gta02_machine_init(void)
802 + s3c_device_usb.dev.platform_data = >a02_usb_info;
803 + s3c_device_nand.dev.platform_data = >a02_nand_info;
804 + s3c_device_sdi.dev.platform_data = >a02_mmc_cfg;
806 + /* Only GTA02v1 has a SD_DETECT GPIO. Since the slot is not
807 + * hot-pluggable, this is not required anyway */
808 + switch (system_rev) {
809 + case GTA02v1_SYSTEM_REV:
812 + gta02_mmc_cfg.gpio_detect = 0;
816 + INIT_WORK(>a02_udc_vbus_drawer.work, __gta02_udc_vbus_draw);
817 + s3c24xx_udc_set_platdata(>a02_udc_cfg);
818 + set_s3c2410ts_info(>a02_ts_cfg);
820 + /* FIXME: hardcoded WLAN module power-up */
821 + s3c2410_gpio_cfgpin(GTA02_CHIP_PWD, S3C2410_GPIO_OUTPUT);
823 + /* Power is down */
824 + s3c2410_gpio_setpin(GTA02_CHIP_PWD, 1);
827 + switch (system_rev) {
828 + case GTA02v1_SYSTEM_REV:
829 + s3c2410_gpio_setpin(GTA02_CHIP_PWD, 0);
832 + s3c2410_gpio_cfgpin(GTA02_GPIO_nWLAN_RESET, S3C2410_GPIO_OUTPUT);
833 + /* Chip is in reset state */
834 + s3c2410_gpio_setpin(GTA02_GPIO_nWLAN_RESET, 0);
837 + s3c2410_gpio_setpin(GTA02_CHIP_PWD, 0);
839 + /* Chip is out of reset */
840 + s3c2410_gpio_setpin(GTA02_GPIO_nWLAN_RESET, 1);
844 + platform_device_register(>a01_button_dev);
845 + platform_device_register(>a01_pm_gsm_dev);
847 + mangle_pmu_pdata_by_system_rev();
848 + platform_device_register(>a02_pmu_dev);
849 + platform_device_register(>a01_led_dev);
850 + platform_device_register(>a02_led_dev);
852 + mangle_glamo_res_by_system_rev();
853 + platform_device_register(>a02_glamo_dev);
855 + platform_device_register(>a02_sdio_dev);
857 + platform_add_devices(gta02_devices, ARRAY_SIZE(gta02_devices));
861 + /* Set LCD_RESET / XRES to high */
862 + s3c2410_gpio_cfgpin(GTA01_GPIO_LCD_RESET, S3C2410_GPIO_OUTPUT);
863 + s3c2410_gpio_setpin(GTA01_GPIO_LCD_RESET, 1);
865 + /* Make sure the modem can wake us up */
866 + set_irq_type(GTA02_IRQ_MODEM, IRQT_RISING);
867 + rc = request_irq(GTA02_IRQ_MODEM, gta02_modem_irq, IRQF_DISABLED,
870 + printk(KERN_ERR "GTA02: can't request GSM modem wakeup IRQ\n");
871 + enable_irq_wake(GTA02_IRQ_MODEM);
874 +MACHINE_START(NEO1973_GTA02, "GTA02")
875 + .phys_io = S3C2410_PA_UART,
876 + .io_pg_offst = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
877 + .boot_params = S3C2410_SDRAM_PA + 0x100,
878 + .map_io = gta02_map_io,
879 + .init_irq = s3c24xx_init_irq,
880 + .init_machine = gta02_machine_init,
881 + .timer = &s3c24xx_timer,
883 diff --git a/drivers/leds/leds-neo1973-vibrator.c b/drivers/leds/leds-neo1973-vibrator.c
884 index 0336e36..c943a6a 100644
885 --- a/drivers/leds/leds-neo1973-vibrator.c
886 +++ b/drivers/leds/leds-neo1973-vibrator.c
887 @@ -113,7 +113,7 @@ static int __init neo1973_vib_probe(struct platform_device *pdev)
891 - if (!machine_is_neo1973_gta01())
892 + if (!machine_is_neo1973_gta01() && !machine_is_neo1973_gta02())
895 r = platform_get_resource(pdev, 0, 0);
896 diff --git a/include/asm-arm/arch-s3c2410/gta02.h b/include/asm-arm/arch-s3c2410/gta02.h
898 index 0000000..fa49d93
900 +++ b/include/asm-arm/arch-s3c2410/gta02.h
905 +#include <asm/arch/regs-gpio.h>
906 +#include <asm/arch/irqs.h>
908 +/* Different hardware revisions, passed in ATAG_REVISION by u-boot */
909 +#define GTA02v1_SYSTEM_REV 0x00000310
910 +#define GTA02v2_SYSTEM_REV 0x00000320
911 +#define GTA02v3_SYSTEM_REV 0x00000330
912 +#define GTA02v4_SYSTEM_REV 0x00000340
913 +#define GTA02v5_SYSTEM_REV 0x00000350
914 +#define GTA02v6_SYSTEM_REV 0x00000360
916 +#define GTA02_GPIO_n3DL_GSM S3C2410_GPA13 /* v1 + v2 + v3 only */
918 +#define GTA02_GPIO_PWR_LED1 S3C2410_GPB0
919 +#define GTA02_GPIO_PWR_LED2 S3C2410_GPB1
920 +#define GTA02_GPIO_AUX_LED S3C2410_GPB2
921 +#define GTA02_GPIO_VIBRATOR_ON S3C2410_GPB3
922 +#define GTA02v1_GPIO_GPS_PWRON S3C2410_GPB4 /* v1 only */
923 +#define GTA02_GPIO_MODEM_RST S3C2410_GPB5
924 +#define GTA02_GPIO_BT_EN S3C2410_GPB6
925 +#define GTA02_GPIO_MODEM_ON S3C2410_GPB7
926 +#define GTA02v1_GPIO_EN_AGPS3V S3C2410_GPB8 /* v1 only */
927 +#define GTA02_GPIO_EXTINT8 S3C2410_GPB8
928 +#define GTA02_GPIO_USB_PULLUP S3C2410_GPB9
930 +#define GTA02v1_GPIO_nGPS_RST S3C2410_GPC0 /* v1 only */
931 +#define GTA02v12_GPIO_PIO3 S3C2410_GPC5 /* v1 + v2 only */
932 +#define GTA02_GPIO_PIO5 S3C2410_GPC5 /* v3 + v4 only */
933 +#define GTA02_GPIO_LCD_RESET S3C2410_GPC6 /* v1 + v2 only */
934 +#define GTA02v12_GPIO_PIO2 S3C2410_GPC7 /* v1 + v2 only */
935 +#define GTA02v2_nUSB_FLT S3C2410_GPC9 /* v2 only */
936 +#define GTA02v2_nUSB_OC S3C2410_GPC10 /* v2 only */
937 +#define GTA02v2_nGSM_OC S3C2410_GPC12 /* v2 only */
939 +#define GTA02v3_GPIO_nG1_CS S3C2410_GPD12 /* v3 + v4 only */
940 +#define GTA02v3_GPIO_nG2_CS S3C2410_GPD13 /* v3 + v4 only */
942 +#define GTA02_GPIO_nG1_INT S3C2410_GPF0
943 +#define GTA02_GPIO_IO1 S3C2410_GPF1
944 +#define GTA02v1_GPIO_nG2_INT S3C2410_GPF2 /* v1 only */
945 +#define GTA02_GPIO_PIO_2 S3C2410_GPF2 /* v2 + v3 + v4 only */
946 +#define GTA02_GPIO_JACK_INSERT S3C2410_GPF4
947 +#define GTA02v1_GPIO_nSD_DETECT S3C2410_GPF5 /* v1 only */
948 +#define GTA02_GPIO_WLAN_GPIO1 S3C2410_GPF5 /* v2 + v3 + v4 only */
949 +#define GTA02_GPIO_AUX_KEY S3C2410_GPF6
950 +#define GTA02_GPIO_HOLD_KEY S3C2410_GPF7
952 +#define GTA02_GPIO_3D_IRQ S3C2410_GPG4
953 +#define GTA02v1_GPIO_nG1_CS S3C2410_GPG8 /* v1 only */
954 +#define GTA02v2_GPIO_nG2_INT S3C2410_GPG8 /* v2 + v3 + v4 only */
955 +#define GTA02v3_GPIO_nUSB_OC S3C2410_GPG9 /* v3 + v4 only */
956 +#define GTA02v3_GPIO_nUSB_FLT S3C2410_GPG10 /* v3 + v4 only */
957 +#define GTA02v1_GPIO_nG2_CS S3C2410_GPG11 /* v1 only */
958 +#define GTA02v3_GPIO_nGSM_OC S3C2410_GPG11 /* v3 + v4 only */
960 +#define GTA02v1_GPIO_3D_RESET S3C2440_GPJ0 /* v1 only */
961 +#define GTA02v2_GPIO_BAT_ID S3C2440_GPJ0 /* v2 only */
962 +#define GTA02v1_GPIO_WLAN_GPIO8 S3C2440_GPJ1 /* v1 only */
963 +#define GTA02_GPIO_AMP_SHUT S3C2440_GPJ1 /* v2 + v3 + v4 only */
964 +#define GTA02v1_GPIO_WLAN_GPIO10 S3C2440_GPJ2
965 +#define GTA02_GPIO_HP_IN S3C2440_GPJ2 /* v2 + v3 + v4 only */
966 +#define GTA02v1_GPIO_KEEPACT S3C2440_GPJ3 /* v1 only */
967 +#define GTA02_GPIO_INT0 S3C2440_GPJ3 /* v2 + v3 + v4 only */
968 +#define GTA02_GPIO_nGSM_EN S3C2440_GPJ4
969 +#define GTA02_GPIO_3D_RESET S3C2440_GPJ5
970 +#define GTA02_GPIO_nDL_GSM S3C2440_GPJ6 /* v4 + v5 only */
971 +#define GTA02_GPIO_WLAN_GPIO0 S3C2440_GPJ7
972 +#define GTA02v1_GPIO_BAT_ID S3C2440_GPJ8
973 +#define GTA02_GPIO_KEEPACT S3C2440_GPJ8
974 +#define GTA02v1_GPIO_AMP_SHUT S3C2440_GPJ9 /* v1 only */
975 +#define GTA02v2_nG1_CS S3C2440_GPJ9 /* v2 only */
976 +#define GTA02v1_GPIO_HP_IN S3C2440_GPJ10
977 +#define GTA02v2_nG2_CS S3C2440_GPJ10 /* v2 only */
978 +#define GTA02v1_GPIO_INT0 S3C2440_GPJ11 /* v1 only */
979 +#define GTA02_CHIP_PWD S3C2440_GPJ11 /* v2 + v3 + v4 only */
980 +#define GTA02v1_GPIO_nGSM_EN S3C2440_GPJ12 /* v1 only */
981 +#define GTA02_GPIO_nWLAN_RESET S3C2440_GPJ12 /* v2 + v3 + v4 only */
983 +#define GTA02_IRQ_GSENSOR_1 IRQ_EINT0
984 +#define GTA02_IRQ_MODEM IRQ_EINT1
985 +#define GTA02v1_IRQ_GSENSOR_2 IRQ_EINT2 /* v1 only */
986 +#define GTA02_IRQ_PIO_2 IRQ_EINT2 /* v2 + v3 + v4 only */
987 +#define GTA02_IRQ_nJACK_INSERT IRQ_EINT4
988 +#define GTA02v1_IRQ_nSD_CD IRQ_EINT5 /* v1 only */
989 +#define GTA02_IRQ_WLAN_GPIO1 IRQ_EINT5
990 +#define GTA02_IRQ_AUX IRQ_EINT6
991 +#define GTA02_IRQ_nHOLD IRQ_EINT7
992 +#define GTA02v1_IRQ_nSIM_CD IRQ_EINT8 /* v1 only */
993 +#define GTA02_IRQ_PCF50633 IRQ_EINT9
994 +#define GTA02_IRQ_3D IRQ_EINT12
995 +#define GTA02_IRQ_GSENSOR_2 IRQ_EINT16 /* v2 + v3 + v4 only */
996 +#define GTA02v3_IRQ_nUSB_OC IRQ_EINT17 /* v3 + v4 only */
997 +#define GTA02v3_IRQ_nUSB_FLT IRQ_EINT18 /* v3 + v4 only */
998 +#define GTA02v3_IRQ_nGSM_OC IRQ_EINT19 /* v3 + v4 only */
1000 +#endif /* _GTA02_H */
1001 diff --git a/sound/soc/s3c24xx/neo1973_wm8753.c b/sound/soc/s3c24xx/neo1973_wm8753.c
1002 index 0289d1d..65a4060 100644
1003 --- a/sound/soc/s3c24xx/neo1973_wm8753.c
1004 +++ b/sound/soc/s3c24xx/neo1973_wm8753.c
1005 @@ -672,6 +672,12 @@ static int __init neo1973_init(void)
1009 + if (!machine_is_neo1973_gta01()) {
1011 + "Only GTA01 hardware supported by ASoc driver\n");
1015 neo1973_snd_device = platform_device_alloc("soc-audio", -1);
1016 if (!neo1973_snd_device)
1018 @@ -700,5 +706,5 @@ module_exit(neo1973_exit);
1020 /* Module information */
1021 MODULE_AUTHOR("Graeme Gregory, graeme.gregory@wolfsonmicro.com, www.wolfsonmicro.com");
1022 -MODULE_DESCRIPTION("ALSA SoC WM8753 Neo1973");
1023 +MODULE_DESCRIPTION("ALSA SoC WM8753 Neo1973 GTA01");
1024 MODULE_LICENSE("GPL");