aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/mach-s3c2442
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2009-10-09 10:52:55 +0200
committerLars-Peter Clausen <lars@metafoo.de>2009-10-09 10:52:55 +0200
commit6c6692d4eeb74aaee885c62b9fd0f2f9f0b4f94c (patch)
tree7dca97f3b3210a7124d20753f6557359091e49a9 /arch/arm/mach-s3c2442
parent533dc180290379c5eced9e5acdcdcf72a78a30ac (diff)
parent9a0ca511720ee9bc8f2bc448d53012b477028140 (diff)
Merge branch 'gta02-machine-devices-2.6.31' into om-gta02-2.6.31
Diffstat (limited to 'arch/arm/mach-s3c2442')
-rw-r--r--arch/arm/mach-s3c2442/Kconfig3
-rw-r--r--arch/arm/mach-s3c2442/Makefile3
-rw-r--r--arch/arm/mach-s3c2442/gta02-fiq.c144
-rw-r--r--arch/arm/mach-s3c2442/include/mach/gta02-fiq.h9
-rw-r--r--arch/arm/mach-s3c2442/include/mach/gta02.h3
-rw-r--r--arch/arm/mach-s3c2442/mach-gta02.c350
6 files changed, 498 insertions, 14 deletions
diff --git a/arch/arm/mach-s3c2442/Kconfig b/arch/arm/mach-s3c2442/Kconfig
index 26c14b1b835..8e37b9f42ab 100644
--- a/arch/arm/mach-s3c2442/Kconfig
+++ b/arch/arm/mach-s3c2442/Kconfig
@@ -34,6 +34,9 @@ config MACH_NEO1973_GTA02
select MACH_NEO1973
select S3C2410_PWM
select S3C_DEV_USB_HOST
+ select FIQ
+ select S3C_PWM
+ select S3C24XX_GPIO_EXTRA64
help
Say Y here if you are using the Openmoko GTA02 / Freerunner GSM Phone
diff --git a/arch/arm/mach-s3c2442/Makefile b/arch/arm/mach-s3c2442/Makefile
index ebe0579c537..cf39481cb5c 100644
--- a/arch/arm/mach-s3c2442/Makefile
+++ b/arch/arm/mach-s3c2442/Makefile
@@ -16,6 +16,7 @@ obj-$(CONFIG_MACH_NEO1973_GTA02) += mach-gta02.o \
gta02-pm-bt.o \
gta02-pm-gps.o \
gta02-pm-gsm.o \
- gta02-pm-wlan.o
+ gta02-pm-wlan.o \
+ gta02-fiq.o
# Machine support
diff --git a/arch/arm/mach-s3c2442/gta02-fiq.c b/arch/arm/mach-s3c2442/gta02-fiq.c
new file mode 100644
index 00000000000..2b46597c41e
--- /dev/null
+++ b/arch/arm/mach-s3c2442/gta02-fiq.c
@@ -0,0 +1,144 @@
+#include <linux/kernel.h>
+
+#include <asm/fiq.h>
+#include <plat/pwm.h>
+#include <mach/regs-irq.h>
+#include <mach/irqs.h>
+#include <linux/io.h>
+#include <linux/hdq.h>
+
+/* -------------------------------------------------------------------------------
+ * GTA02 FIQ related
+ *
+ * Calls into vibrator and hdq and based on the return values
+ * determines if we the FIQ source be kept alive
+ */
+
+#define DIVISOR_FROM_US(x) ((x) << 3)
+
+#ifdef CONFIG_HDQ_GPIO_BITBANG
+#define FIQ_DIVISOR_HDQ DIVISOR_FROM_US(HDQ_SAMPLE_PERIOD_US)
+extern int hdq_fiq_handler(void);
+#endif
+
+#ifdef CONFIG_LEDS_GTA02_VIBRATOR
+#define FIQ_DIVISOR_VIBRATOR DIVISOR_FROM_US(100)
+extern int gta02_vibrator_fiq_handler(void);
+#endif
+
+/* Global data related to our fiq source */
+static uint32_t gta02_fiq_ack_mask;
+static struct s3c2410_pwm gta02_fiq_pwm_timer;
+static uint16_t gta02_fiq_timer_index;
+static int gta02_fiq_irq;
+
+void gta02_fiq_handler(void)
+{
+ uint16_t divisor = 0xffff;
+
+ /* disable further timer interrupts if nobody has any work
+ * or adjust rate according to who still has work
+ *
+ * CAUTION: it means forground code must disable FIQ around
+ * its own non-atomic S3C2410_INTMSK changes... not common
+ * thankfully and taken care of by the fiq-basis patch
+ */
+
+#ifdef CONFIG_HDQ_GPIO_BITBANG
+ if (hdq_fiq_handler())
+ divisor = FIQ_DIVISOR_HDQ;
+#endif
+
+#ifdef CONFIG_LEDS_GTA02_VIBRATOR
+ if (gta02_vibrator_fiq_handler())
+ divisor = FIQ_DIVISOR_VIBRATOR;
+#endif
+
+ if (divisor == 0xffff) /* mask the fiq irq source */
+ __raw_writel(__raw_readl(S3C2410_INTMSK) | gta02_fiq_ack_mask,
+ S3C2410_INTMSK);
+ else /* still working, maybe at a different rate */
+ __raw_writel(divisor, S3C2410_TCNTB(gta02_fiq_timer_index));
+
+ __raw_writel(gta02_fiq_ack_mask, S3C2410_SRCPND);
+}
+
+void gta02_fiq_kick(void)
+{
+ unsigned long flags;
+ uint32_t tcon;
+
+ /* we have to take care about FIQ because this modification is
+ * non-atomic, FIQ could come in after the read and before the
+ * writeback and its changes to the register would be lost
+ * (platform INTMSK mod code is taken care of already)
+ */
+ local_save_flags(flags);
+ local_fiq_disable();
+ /* allow FIQs to resume */
+ __raw_writel(__raw_readl(S3C2410_INTMSK) &
+ ~(1 << (gta02_fiq_irq - S3C2410_CPUIRQ_OFFSET)),
+ S3C2410_INTMSK);
+ tcon = __raw_readl(S3C2410_TCON) & ~S3C2410_TCON_T3START;
+ /* fake the timer to a count of 1 */
+ __raw_writel(1, S3C2410_TCNTB(gta02_fiq_timer_index));
+ __raw_writel(tcon | S3C2410_TCON_T3MANUALUPD, S3C2410_TCON);
+ __raw_writel(tcon | S3C2410_TCON_T3MANUALUPD | S3C2410_TCON_T3START,
+ S3C2410_TCON);
+ __raw_writel(tcon | S3C2410_TCON_T3START, S3C2410_TCON);
+ local_irq_restore(flags);
+}
+
+int gta02_fiq_enable(void)
+{
+ int irq_index_fiq = IRQ_TIMER3;
+ int rc = 0;
+
+ local_fiq_disable();
+
+ gta02_fiq_irq = irq_index_fiq;
+ gta02_fiq_ack_mask = 1 << (irq_index_fiq - S3C2410_CPUIRQ_OFFSET);
+ gta02_fiq_timer_index = (irq_index_fiq - IRQ_TIMER0);
+
+ /* set up the timer to operate as a pwm device */
+
+ rc = s3c2410_pwm_init(&gta02_fiq_pwm_timer);
+ if (rc)
+ goto bail;
+
+ gta02_fiq_pwm_timer.timerid = PWM0 + gta02_fiq_timer_index;
+ gta02_fiq_pwm_timer.prescaler = (6 - 1) / 2;
+ gta02_fiq_pwm_timer.divider = S3C2410_TCFG1_MUX3_DIV2;
+ /* default rate == ~32us */
+ gta02_fiq_pwm_timer.counter = gta02_fiq_pwm_timer.comparer = 3000;
+
+ rc = s3c2410_pwm_enable(&gta02_fiq_pwm_timer);
+ if (rc)
+ goto bail;
+
+ s3c2410_pwm_start(&gta02_fiq_pwm_timer);
+
+ /* let our selected interrupt be a magic FIQ interrupt */
+ __raw_writel(gta02_fiq_ack_mask, S3C2410_INTMOD);
+
+ /* it's ready to go as soon as we unmask the source in S3C2410_INTMSK */
+ local_fiq_enable();
+
+ set_fiq_c_handler(gta02_fiq_handler);
+
+ return 0;
+
+bail:
+ printk(KERN_ERR "Could not initialize FIQ for GTA02: %d\n", rc);
+
+ return rc;
+}
+
+void gta02_fiq_disable(void)
+{
+ __raw_writel(0, S3C2410_INTMOD);
+ local_fiq_disable();
+ gta02_fiq_irq = 0; /* no active source interrupt now either */
+
+}
+/* -------------------- /GTA02 FIQ Handler ------------------------------------- */
diff --git a/arch/arm/mach-s3c2442/include/mach/gta02-fiq.h b/arch/arm/mach-s3c2442/include/mach/gta02-fiq.h
new file mode 100644
index 00000000000..90de3530595
--- /dev/null
+++ b/arch/arm/mach-s3c2442/include/mach/gta02-fiq.h
@@ -0,0 +1,9 @@
+#ifndef __GTA02_FIQ_H
+#define __GTA02_FIQ_H
+
+extern void gta02_fiq_handler(void);
+extern void gta02_fiq_kick(void);
+extern int gta02_fiq_enable(void);
+extern void gta02_fiq_disable(void);
+
+#endif
diff --git a/arch/arm/mach-s3c2442/include/mach/gta02.h b/arch/arm/mach-s3c2442/include/mach/gta02.h
index 11624c0b926..b67e5ec2919 100644
--- a/arch/arm/mach-s3c2442/include/mach/gta02.h
+++ b/arch/arm/mach-s3c2442/include/mach/gta02.h
@@ -80,6 +80,9 @@
#define GTA02_PCB_ID2_0 S3C2410_GPD(3)
#define GTA02_PCB_ID2_1 S3C2410_GPD(4)
+#define GTA02_GPIO_GLAMO_BASE S3C_GPIO_END
+#define GTA02_GPIO_GLAMO(x) (GTA02_GPIO_GLAMO_BASE + (x))
+
int gta02_get_pcb_revision(void);
extern struct pcf50633 *gta02_pcf;
diff --git a/arch/arm/mach-s3c2442/mach-gta02.c b/arch/arm/mach-s3c2442/mach-gta02.c
index 4488b4b428c..7122114c517 100644
--- a/arch/arm/mach-s3c2442/mach-gta02.c
+++ b/arch/arm/mach-s3c2442/mach-gta02.c
@@ -38,6 +38,7 @@
#include <linux/platform_device.h>
#include <linux/serial_core.h>
#include <linux/spi/spi.h>
+#include <linux/spi/spi_gpio.h>
#include <linux/mmc/host.h>
@@ -96,6 +97,17 @@
#include <mach/gta02-pm-gps.h>
#include <mach/gta02-pm-wlan.h>
+#include <linux/jbt6k74.h>
+#include <linux/glamofb.h>
+#include <linux/mfd/glamo.h>
+
+#include <mach/gta02-fiq.h>
+
+#include <linux/hdq.h>
+#include <linux/bq27000_battery.h>
+
+#include <linux/gta02-vibrator.h>
+
struct pcf50633 *gta02_pcf;
/*
@@ -158,6 +170,140 @@ static struct s3c2410_uartcfg gta02_uartcfgs[] = {
},
};
+/*
+ * we crank down SD Card clock dynamically when GPS is powered
+ */
+
+static int gta02_glamo_mci_use_slow(void)
+{
+ return gta02_pm_gps_is_on();
+}
+
+static void gta02_glamo_external_reset(int level)
+{
+ s3c2410_gpio_setpin(GTA02_GPIO_3D_RESET, level);
+ s3c2410_gpio_cfgpin(GTA02_GPIO_3D_RESET, S3C2410_GPIO_OUTPUT);
+}
+
+struct spi_gpio_platform_data spigpio_platform_data = {
+ .sck = GTA02_GPIO_GLAMO(10),
+ .mosi = GTA02_GPIO_GLAMO(11),
+ .miso = GTA02_GPIO_GLAMO(5),
+ .num_chipselect = 1,
+};
+
+static struct platform_device spigpio_device = {
+ .name = "spi_gpio",
+ .id = 2,
+ .dev = {
+ .platform_data = &spigpio_platform_data,
+ },
+};
+
+static void gta02_glamo_registered(struct device *dev)
+{
+ spigpio_device.dev.parent = dev;
+ platform_device_register(&spigpio_device);
+}
+
+static struct fb_videomode gta02_glamo_modes[] = {
+ {
+ .name = "480x640",
+ .xres = 480,
+ .yres = 640,
+ .pixclock = 40816,
+ .left_margin = 8,
+ .right_margin = 16,
+ .upper_margin = 2,
+ .lower_margin = 16,
+ .hsync_len = 8,
+ .vsync_len = 2,
+ .vmode = FB_VMODE_NONINTERLACED,
+ }, {
+ .name = "240x320",
+ .xres = 240,
+ .yres = 320,
+ .pixclock = 40816,
+ .left_margin = 8,
+ .right_margin = 16,
+ .upper_margin = 2,
+ .lower_margin = 16,
+ .hsync_len = 8,
+ .vsync_len = 2,
+ .vmode = FB_VMODE_NONINTERLACED,
+ }
+};
+
+
+static struct glamo_fb_platform_data gta02_glamo_fb_pdata = {
+ .width = 43,
+ .height = 58,
+
+ .num_modes = ARRAY_SIZE(gta02_glamo_modes),
+ .modes = gta02_glamo_modes,
+};
+
+static struct glamo_mmc_platform_data gta02_glamo_mmc_pdata = {
+ .glamo_mmc_use_slow = gta02_glamo_mci_use_slow,
+};
+
+static struct glamo_gpio_platform_data gta02_glamo_gpio_pdata = {
+ .base = GTA02_GPIO_GLAMO_BASE,
+ .registered = gta02_glamo_registered,
+};
+
+static struct glamo_platform_data gta02_glamo_pdata = {
+ .fb_data = &gta02_glamo_fb_pdata,
+ .mmc_data = &gta02_glamo_mmc_pdata,
+ .gpio_data = &gta02_glamo_gpio_pdata,
+
+ .osci_clock_rate = 32768,
+
+ .glamo_external_reset = gta02_glamo_external_reset,
+};
+
+static struct resource gta02_glamo_resources[] = {
+ [0] = {
+ .start = S3C2410_CS1,
+ .end = S3C2410_CS1 + 0x1000000 - 1,
+ .flags = IORESOURCE_MEM,
+ },
+ [1] = {
+ .start = GTA02_IRQ_3D,
+ .end = GTA02_IRQ_3D,
+ .flags = IORESOURCE_IRQ,
+ },
+ [2] = {
+ .start = GTA02_GPIO_3D_RESET,
+ .end = GTA02_GPIO_3D_RESET,
+ },
+};
+
+static struct platform_device gta02_glamo_dev = {
+ .name = "glamo3362",
+ .num_resources = ARRAY_SIZE(gta02_glamo_resources),
+ .resource = gta02_glamo_resources,
+ .dev = {
+ .platform_data = &gta02_glamo_pdata,
+ },
+};
+
+static struct platform_device gta02_pm_gps_dev = {
+ .name = "gta02-pm-gps",
+};
+
+static struct platform_device gta02_pm_bt_dev = {
+ .name = "gta02-pm-bt",
+};
+
+static struct platform_device gta02_pm_gsm_dev = {
+ .name = "gta02-pm-gsm",
+};
+
+static struct platform_device gta02_pm_wlan_dev = {
+ .name = "gta02-pm-wlan",
+};
+
#ifdef CONFIG_CHARGER_PCF50633
/*
* On GTA02 the 1A charger features a 48K resistor to 0V on the ID pin.
@@ -170,6 +316,20 @@ static struct s3c2410_uartcfg gta02_uartcfgs[] = {
#define ADC_NOM_CHG_DETECT_1A 6
#define ADC_NOM_CHG_DETECT_USB 43
+static int gta02_get_charger_online_status(void)
+{
+ struct pcf50633 *pcf = gta02_pcf;
+
+ return pcf50633_mbc_get_status(pcf) & PCF50633_MBC_USB_ONLINE;
+}
+
+static int gta02_get_charger_active_status(void)
+{
+ struct pcf50633 *pcf = gta02_pcf;
+
+ return pcf50633_mbc_get_status(pcf) & PCF50633_MBC_USB_ACTIVE;
+}
+
static void
gta02_configure_pmu_for_charger(struct pcf50633 *pcf, void *unused, int res)
{
@@ -246,6 +406,8 @@ static void gta02_udc_vbus_draw(unsigned int ma)
#else /* !CONFIG_CHARGER_PCF50633 */
#define gta02_pmu_event_callback NULL
#define gta02_udc_vbus_draw NULL
+#define gta02_get_charger_online_status NULL
+#define gta02_get_charger_active_status NULL
#endif
/*
@@ -263,6 +425,40 @@ static char *gta02_batteries[] = {
"battery",
};
+static struct regulator_consumer_supply ldo4_consumers[] = {
+ {
+ .dev = &gta02_pm_bt_dev.dev,
+ .supply = "BT_3V2",
+ },
+};
+
+static struct regulator_consumer_supply ldo5_consumers[] = {
+ {
+ .dev = &gta02_pm_gps_dev.dev,
+ .supply = "RF_3V",
+ },
+};
+
+static struct regulator_consumer_supply hcldo_consumers[] = {
+ {
+ .dev = &gta02_glamo_dev.dev,
+ .supply = "SD_3V3",
+ },
+};
+
+#if 0
+/* This will come with 2.6.32. Don't forget to uncomment it then. */
+static struct regulator_consumer_supply ldo6_consumers[] = {
+ REGULATOR_SUPPLY("VDC", "jbt6k74"),
+ REGULATOR_SUPPLY("VDDIO", "jbt6k74"),
+};
+#else
+static struct regulator_consumer_supply ldo6_consumers[] = {
+ { .supply = "VDC", },
+ { .supply = "VDDIO", },
+};
+#endif
+
struct pcf50633_platform_data gta02_pcf_pdata = {
.resumers = {
[0] = PCF50633_INT1_USBINS |
@@ -277,6 +473,9 @@ struct pcf50633_platform_data gta02_pcf_pdata = {
.batteries = gta02_batteries,
.num_batteries = ARRAY_SIZE(gta02_batteries),
+
+ .chg_ref_current_ma = 1000,
+
.reg_init_data = {
[PCF50633_REGULATOR_AUTO] = {
.constraints = {
@@ -319,6 +518,8 @@ struct pcf50633_platform_data gta02_pcf_pdata = {
.valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
.always_on = 1,
},
+ .num_consumer_supplies = ARRAY_SIZE(hcldo_consumers),
+ .consumer_supplies = hcldo_consumers,
},
[PCF50633_REGULATOR_LDO1] = {
.constraints = {
@@ -354,6 +555,8 @@ struct pcf50633_platform_data gta02_pcf_pdata = {
.valid_modes_mask = REGULATOR_MODE_NORMAL,
.apply_uV = 1,
},
+ .num_consumer_supplies = ARRAY_SIZE(ldo4_consumers),
+ .consumer_supplies = ldo4_consumers,
},
[PCF50633_REGULATOR_LDO5] = {
.constraints = {
@@ -365,6 +568,8 @@ struct pcf50633_platform_data gta02_pcf_pdata = {
.enabled = 1,
},
},
+ .num_consumer_supplies = ARRAY_SIZE(ldo5_consumers),
+ .consumer_supplies = ldo5_consumers,
},
[PCF50633_REGULATOR_LDO6] = {
.constraints = {
@@ -372,6 +577,8 @@ struct pcf50633_platform_data gta02_pcf_pdata = {
.max_uV = 3000000,
.valid_modes_mask = REGULATOR_MODE_NORMAL,
},
+ .num_consumer_supplies = ARRAY_SIZE(ldo6_consumers),
+ .consumer_supplies = ldo6_consumers,
},
[PCF50633_REGULATOR_MEMLDO] = {
.constraints = {
@@ -484,8 +691,6 @@ static struct s3c2410_udc_mach_info gta02_udc_cfg = {
};
-
-
static void gta02_bl_set_intensity(int intensity)
{
struct pcf50633 *pcf = gta02_pcf;
@@ -547,8 +752,6 @@ static struct platform_device gta02_bl_dev = {
},
};
-
-
/* USB */
static struct s3c2410_hcd_info gta02_usb_info = {
.port[0] = {
@@ -619,20 +822,137 @@ static struct platform_device gta02_leds_device = {
},
};
-static struct platform_device gta02_pm_gps_dev = {
- .name = "gta02-pm-gps",
+/* JBT6k74 display controller */
+static void gta02_jbt6k74_probe_completed(struct device *dev)
+{
+ struct pcf50633 *pcf = gta02_pcf;
+ /* Switch on backlight. Qi does not do it for us */
+ pcf50633_reg_write(pcf, PCF50633_REG_LEDOUT, 0x01);
+ pcf50633_reg_write(pcf, PCF50633_REG_LEDENA, 0x00);
+ pcf50633_reg_write(pcf, PCF50633_REG_LEDDIM, 0x01);
+ pcf50633_reg_write(pcf, PCF50633_REG_LEDENA, 0x01);
+
+ gta02_bl_dev.dev.parent = dev;
+ platform_device_register(&gta02_bl_dev);
+}
+
+const struct jbt6k74_platform_data jbt6k74_pdata = {
+ .probe_completed = gta02_jbt6k74_probe_completed,
+ .gpio_reset = GTA02_GPIO_GLAMO(4),
};
-static struct platform_device gta02_pm_bt_dev = {
- .name = "gta02-pm-bt",
+static struct spi_board_info gta02_spi_board_info[] = {
+ {
+ .modalias = "jbt6k74",
+ .platform_data = &jbt6k74_pdata,
+ .controller_data = (void*)GTA02_GPIO_GLAMO(12),
+ /* irq */
+ .max_speed_hz = 100 * 1000,
+ .bus_num = 2,
+ .chip_select = 0
+ },
};
-static struct platform_device gta02_pm_gsm_dev = {
- .name = "gta02-pm-gsm",
+/* BQ27000 Battery */
+
+struct bq27000_platform_data bq27000_pdata = {
+ .name = "battery",
+ .rsense_mohms = 20,
+ .hdq_read = hdq_read,
+ .hdq_write = hdq_write,
+ .hdq_initialized = hdq_initialized,
+ .get_charger_online_status = gta02_get_charger_online_status,
+ .get_charger_active_status = gta02_get_charger_active_status
};
-static struct platform_device gta02_pm_wlan_dev = {
- .name = "gta02-pm-wlan",
+struct platform_device bq27000_battery_device = {
+ .name = "bq27000-battery",
+ .dev = {
+ .platform_data = &bq27000_pdata,
+ },
+};
+
+/* HDQ */
+
+static void gta02_hdq_attach_child_devices(struct device *parent_device)
+{
+ bq27000_battery_device.dev.parent = parent_device;
+ platform_device_register(&bq27000_battery_device);
+}
+
+static void gta02_hdq_gpio_direction_out(void)
+{
+ s3c2410_gpio_cfgpin(GTA02v5_GPIO_HDQ, S3C2410_GPIO_OUTPUT);
+}
+
+static void gta02_hdq_gpio_direction_in(void)
+{
+ s3c2410_gpio_cfgpin(GTA02v5_GPIO_HDQ, S3C2410_GPIO_INPUT);
+}
+
+static void gta02_hdq_gpio_set_value(int val)
+{
+
+ s3c2410_gpio_setpin(GTA02v5_GPIO_HDQ, val);
+}
+
+static int gta02_hdq_gpio_get_value(void)
+{
+ return s3c2410_gpio_getpin(GTA02v5_GPIO_HDQ);
+}
+
+static struct resource gta02_hdq_resources[] = {
+ [0] = {
+ .start = GTA02v5_GPIO_HDQ,
+ .end = GTA02v5_GPIO_HDQ,
+ },
+};
+
+struct hdq_platform_data gta02_hdq_platform_data = {
+ .attach_child_devices = gta02_hdq_attach_child_devices,
+ .gpio_dir_out = gta02_hdq_gpio_direction_out,
+ .gpio_dir_in = gta02_hdq_gpio_direction_in,
+ .gpio_set = gta02_hdq_gpio_set_value,
+ .gpio_get = gta02_hdq_gpio_get_value,
+
+ .enable_fiq = gta02_fiq_enable,
+ .disable_fiq = gta02_fiq_disable,
+ .kick_fiq = gta02_fiq_kick,
+
+};
+
+struct platform_device gta02_hdq_device = {
+ .name = "hdq",
+ .num_resources = 1,
+ .resource = gta02_hdq_resources,
+ .dev = {
+ .platform_data = &gta02_hdq_platform_data,
+ .parent = &s3c24xx_pwm_device.dev,
+ },
+};
+
+/* vibrator (child of FIQ) */
+
+static struct resource gta02_vibrator_resources[] = {
+ [0] = {
+ .start = GTA02_GPIO_VIBRATOR_ON,
+ .end = GTA02_GPIO_VIBRATOR_ON,
+ },
+};
+
+struct gta02_vib_platform_data gta02_vib_pdata = {
+ .enable_fiq = gta02_fiq_enable,
+ .disable_fiq = gta02_fiq_disable,
+ .kick_fiq = gta02_fiq_kick,
+};
+
+static struct platform_device gta02_vibrator_device = {
+ .name = "gta02-vibrator",
+ .num_resources = ARRAY_SIZE(gta02_vibrator_resources),
+ .resource = gta02_vibrator_resources,
+ .dev = {
+ .platform_data = &gta02_vib_pdata,
+ },
};
static void __init gta02_map_io(void)
@@ -666,7 +986,9 @@ static struct platform_device *gta02_devices[] __initdata = {
/* These guys DO need to be children of PMU. */
static struct platform_device *gta02_devices_pmu_children[] = {
- &gta02_bl_dev,
+ &gta02_glamo_dev,
+ &gta02_hdq_device,
+ &gta02_vibrator_device,
};
@@ -791,6 +1113,8 @@ static void __init gta02_machine_init(void)
s3c_i2c0_set_platdata(NULL);
i2c_register_board_info(0, gta02_i2c_devs, ARRAY_SIZE(gta02_i2c_devs));
+ spi_register_board_info(gta02_spi_board_info,
+ ARRAY_SIZE(gta02_spi_board_info));
platform_add_devices(gta02_devices, ARRAY_SIZE(gta02_devices));
pm_power_off = gta02_poweroff;