Index: linux-2.6.22.5/arch/arm/mach-s3c2440/mach-gta02.c
===================================================================
--- linux-2.6.22.5.orig/arch/arm/mach-s3c2440/mach-gta02.c
+++ linux-2.6.22.5/arch/arm/mach-s3c2440/mach-gta02.c
@@ -344,8 +344,6 @@
 	&s3c_device_usbgadget,
 	&s3c_device_nand,
 	&s3c_device_ts,
-	&s3c_device_spi0,
-	&s3c_device_spi1,
 	&gta02_nor_flash,
 };
 
@@ -488,11 +486,6 @@
 
 /* SPI: Accelerometers attached to SPI of s3c244x */
 
-static void gta02_spi_acc_set_cs(struct s3c2410_spi_info *spi, int cs, int pol)
-{
-	s3c2410_gpio_setpin(cs, pol);
-}
-
 static const struct lis302dl_platform_data lis302_pdata[] = {
 	{
 		.name		= "lis302-1 (top)"
@@ -522,10 +515,54 @@
 	},
 };
 
-static struct s3c2410_spi_info gta02_spi_acc_cfg = {
-	.set_cs		= gta02_spi_acc_set_cs,
+static void spi_acc_cs(struct s3c2410_spigpio_info *spi, int cs)
+{
+	switch (cs) {
+	case BITBANG_CS_ACTIVE:
+		s3c2410_gpio_setpin(S3C2410_GPD12, 0);
+		break;
+	case BITBANG_CS_INACTIVE:
+		s3c2410_gpio_setpin(S3C2410_GPD12, 1);
+		break;
+	}
+}
+
+static struct s3c2410_spigpio_info spi_gpio_cfg = {
+	.pin_clk	= S3C2410_GPG7,
+	.pin_mosi	= S3C2410_GPG6,
+	.pin_miso	= S3C2410_GPG5,
 	.board_size	= ARRAY_SIZE(gta02_spi_acc_bdinfo),
-	.board_info	= &gta02_spi_acc_bdinfo,
+	.board_info	= gta02_spi_acc_bdinfo,
+	.chip_select	= &spi_acc_cs,
+};
+
+static struct resource s3c_spi_acc_resource[] = {
+	[0] = {
+		.start = S3C2410_GPG3,
+		.end   = S3C2410_GPG3,
+	},
+	[1] = {
+		.start = S3C2410_GPG5,
+		.end   = S3C2410_GPG5,
+	},
+	[2] = {
+		.start = S3C2410_GPG6,
+		.end   = S3C2410_GPG6,
+	},
+	[3] = {
+		.start = S3C2410_GPG7,
+		.end   = S3C2410_GPG7,
+	},
+};
+
+static struct platform_device s3c_device_spi_acc = {
+	.name		  = "s3c24xx-spi-gpio",
+	.id		  = 1,
+	.num_resources	  = ARRAY_SIZE(s3c_spi_acc_resource),
+	.resource	  = s3c_spi_acc_resource,
+	.dev = {
+		.platform_data = &spi_gpio_cfg,
+	},
 };
 
 static struct resource gta02_led_resources[] = {
@@ -673,7 +710,6 @@
 	s3c_device_usb.dev.platform_data = &gta02_usb_info;
 	s3c_device_nand.dev.platform_data = &gta02_nand_info;
 	s3c_device_sdi.dev.platform_data = &gta02_mmc_cfg;
-	s3c_device_spi1.dev.platform_data = &gta02_spi_acc_cfg;
 
 	/* Only GTA02v1 has a SD_DETECT GPIO.  Since the slot is not
 	 * hot-pluggable, this is not required anyway */
@@ -702,6 +738,7 @@
 		break;
 	}
 
+	platform_device_register(&s3c_device_spi_acc);
 	platform_device_register(&gta01_button_dev);
 	platform_device_register(&gta01_pm_gsm_dev);
 
@@ -721,6 +758,13 @@
 	s3c2410_gpio_cfgpin(GTA01_GPIO_LCD_RESET, S3C2410_GPIO_OUTPUT);
 	s3c2410_gpio_setpin(GTA01_GPIO_LCD_RESET, 1);
 
+	s3c2410_gpio_cfgpin(S3C2410_GPD12, S3C2410_GPIO_OUTPUT);
+	s3c2410_gpio_setpin(S3C2410_GPD12, 1);
+
+
+	s3c2410_gpio_cfgpin(S3C2410_GPD13, S3C2410_GPIO_OUTPUT);
+	s3c2410_gpio_setpin(S3C2410_GPD13, 1);
+
 	/* Make sure the modem can wake us up */
 	set_irq_type(GTA02_IRQ_MODEM, IRQT_RISING);
 	request_irq(GTA02_IRQ_MODEM, gta02_modem_irq,
Index: linux-2.6.22.5/drivers/spi/lis302dl.c
===================================================================
--- linux-2.6.22.5.orig/drivers/spi/lis302dl.c
+++ linux-2.6.22.5/drivers/spi/lis302dl.c
@@ -84,6 +84,7 @@
 
 enum lis302dl_reg_ctrl3 {
 	LIS302DL_CTRL3_PP_OD		= 0x40,
+	LIS302DL_CTRL3_IHL		= 0x80,
 };
 
 enum lis302dl_reg_status {
@@ -134,16 +135,17 @@
 
 /* lowlevel register access functions */
 
-#define READ_BIT	0x01
-#define MS_BIT		0x02
-#define ADDR_SHIFT	2
+#define READ_BIT	0x80
+#define	ADDR_MASK	0x3f
 
 static inline u_int8_t __reg_read(struct lis302dl_info *lis, u_int8_t reg)
 {
 	int rc;
 	u_int8_t cmd;
 
-	cmd = (reg << ADDR_SHIFT) | READ_BIT;
+	BUG_ON(reg & ~ADDR_MASK);
+
+	cmd = reg | READ_BIT;
 
 	rc = spi_w8r8(lis->spi_dev, cmd);
 
@@ -165,7 +167,9 @@
 {
 	u_int8_t buf[2];
 
-	buf[0] = (reg << ADDR_SHIFT);
+	BUG_ON(reg & ~ADDR_MASK);
+
+	buf[0] = reg;
 	buf[1] = val;
 
 	return spi_write(lis->spi_dev, buf, sizeof(buf));
@@ -218,10 +222,16 @@
 {
 	struct lis302dl_info *lis = dev_get_drvdata(&spi->dev);
 
-	if (int_pin == 1)
+	switch (int_pin) {
+	case 1:
 		reg_set_bit_mask(lis, LIS302DL_REG_CTRL3, 0x07, mode);
-	else if (int_pin == 2)
+		break;
+	case 2:
 		reg_set_bit_mask(lis, LIS302DL_REG_CTRL3, 0x38, mode << 3);
+		break;
+	default:
+		BUG();
+	}
 }
 
 static void _report_btn_single(struct input_dev *inp, int btn)
@@ -388,6 +398,7 @@
 static struct attribute *lis302dl_sysfs_entries[] = {
 	&dev_attr_sample_rate.attr,
 	&dev_attr_full_scale.attr,
+	NULL
 };
 
 static struct attribute_group lis302dl_attr_group = {
@@ -459,12 +470,15 @@
 		kfree(lis);
 		return -ENODEV;
 	}
+	/* switch interrupt to open collector, active-low */
+	reg_write(lis, LIS302DL_REG_CTRL3,
+	    LIS302DL_CTRL3_PP_OD | LIS302DL_CTRL3_IHL);
+	lis302dl_int_mode(spi, 1, LIX302DL_INTMODE_DATA_READY);
+	lis302dl_int_mode(spi, 2, LIX302DL_INTMODE_CLICK);
 
-	/* switch interrupt to open collector */
-	reg_write(lis, LIS302DL_CTRL3_PP_OD, 0x7c);
-
+	/* Fix me: always interrupt */
 	rc = request_irq(lis->spi_dev->irq, lis302dl_interrupt, IRQF_DISABLED,
-			 "lis302dl", NULL);
+			 "lis302dl", lis);
 	if (rc < 0) {
 		dev_err(&spi->dev, "error requesting IRQ %d\n",
 			lis->spi_dev->irq);
