r3945 - branches/src/target/kernel/2.6.24.x/patches
werner at sita.openmoko.org
werner at sita.openmoko.org
Thu Jan 24 19:21:05 CET 2008
Author: werner
Date: 2008-01-24 19:21:01 +0100 (Thu, 24 Jan 2008)
New Revision: 3945
Modified:
branches/src/target/kernel/2.6.24.x/patches/gta02-acc.patch
Log:
Now applied funbar-2.6.24-platform-spi-gpio-acc-repair.patch for real.
Previous attempt had only the manual change, since "quilt fold" rejected
the whole patch.
Modified: branches/src/target/kernel/2.6.24.x/patches/gta02-acc.patch
===================================================================
--- branches/src/target/kernel/2.6.24.x/patches/gta02-acc.patch 2008-01-24 16:58:28 UTC (rev 3944)
+++ branches/src/target/kernel/2.6.24.x/patches/gta02-acc.patch 2008-01-24 18:21:01 UTC (rev 3945)
@@ -11,8 +11,21 @@
>a02_nor_flash,
};
-@@ -504,11 +502,6 @@
+@@ -475,10 +473,12 @@
+ },
+ };
++#if 0 /* currently this is not used and we use gpio spi */
+ static struct glamo_spi_info glamo_spi_cfg = {
+ .board_size = ARRAY_SIZE(gta02_spi_board_info),
+ .board_info = gta02_spi_board_info,
+ };
++#endif /* 0 */
+
+ static struct glamo_spigpio_info glamo_spigpio_cfg = {
+ .pin_clk = GLAMO_GPIO10_OUTPUT,
+@@ -504,16 +504,13 @@
+
/* SPI: Accelerometers attached to SPI of s3c244x */
-static void gta02_spi_acc_set_cs(struct s3c2410_spi_info *spi, int cs, int pol)
@@ -22,22 +35,48 @@
-
static const struct lis302dl_platform_data lis302_pdata[] = {
{
- .name = "lis302-1 (top)"
-@@ -538,10 +531,55 @@
+- .name = "lis302-1 (top)"
++ .name = "lis302-1 (top)",
++ .pin_chip_select= S3C2410_GPD12,
+ }, {
+- .name = "lis302-2 (bottom)"
++ .name = "lis302-2 (bottom)",
++ .pin_chip_select= S3C2410_GPD13,
},
};
+@@ -524,7 +521,7 @@
+ .irq = GTA02_IRQ_GSENSOR_1,
+ .max_speed_hz = 400 * 1000,
+ .bus_num = 1,
+- .chip_select = S3C2410_GPD12,
++ .chip_select = 0,
+ .mode = SPI_MODE_3,
+ },
+ {
+@@ -533,15 +530,63 @@
+ .irq = GTA02_IRQ_GSENSOR_2,
+ .max_speed_hz = 400 * 1000,
+ .bus_num = 1,
+- .chip_select = S3C2410_GPD13,
++ .chip_select = 1,
+ .mode = SPI_MODE_3,
+ },
+ };
+
-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)
++static void spi_acc_cs(struct s3c2410_spigpio_info *spigpio_info, int cs)
+{
++ struct lis302dl_platform_data * plat_data =
++ (struct lis302dl_platform_data *)spigpio_info->
++ board_info->platform_data;
+ switch (cs) {
+ case BITBANG_CS_ACTIVE:
-+ s3c2410_gpio_setpin(S3C2410_GPD12, 0);
++ s3c2410_gpio_setpin(plat_data->pin_chip_select, 0);
+ break;
+ case BITBANG_CS_INACTIVE:
-+ s3c2410_gpio_setpin(S3C2410_GPD12, 1);
++ s3c2410_gpio_setpin(plat_data->pin_chip_select, 1);
+ break;
+ }
+}
@@ -49,6 +88,7 @@
.board_size = ARRAY_SIZE(gta02_spi_acc_bdinfo),
.board_info = gta02_spi_acc_bdinfo,
+ .chip_select = &spi_acc_cs,
++ .num_chipselect = 2,
+};
+
+static struct resource s3c_spi_acc_resource[] = {
@@ -71,7 +111,7 @@
+};
+
+static struct platform_device s3c_device_spi_acc = {
-+ .name = "s3c24xx-spi-gpio",
++ .name = "spi_s3c24xx_gpio",
+ .id = 1,
+ .num_resources = ARRAY_SIZE(s3c_spi_acc_resource),
+ .resource = s3c_spi_acc_resource,
@@ -81,7 +121,7 @@
};
static struct resource gta02_led_resources[] = {
-@@ -784,7 +822,6 @@
+@@ -784,7 +829,6 @@
s3c_device_usb.dev.platform_data = >a02_usb_info;
s3c_device_nand.dev.platform_data = >a02_nand_info;
s3c_device_sdi.dev.platform_data = >a02_mmc_cfg;
@@ -89,10 +129,23 @@
/* Only GTA02v1 has a SD_DETECT GPIO. Since the slot is not
* hot-pluggable, this is not required anyway */
-@@ -824,6 +861,7 @@
+@@ -796,6 +840,12 @@
break;
}
++ /* acc sensor chip selects */
++ s3c2410_gpio_setpin(S3C2410_GPD12, 1);
++ s3c2410_gpio_cfgpin(S3C2410_GPD12, S3C2410_GPIO_OUTPUT);
++ s3c2410_gpio_setpin(S3C2410_GPD13, 1);
++ s3c2410_gpio_cfgpin(S3C2410_GPD13, S3C2410_GPIO_OUTPUT);
++
+ INIT_WORK(>a02_udc_vbus_drawer.work, __gta02_udc_vbus_draw);
+ s3c24xx_udc_set_platdata(>a02_udc_cfg);
+ set_s3c2410ts_info(>a02_ts_cfg);
+@@ -824,6 +874,7 @@
+ break;
+ }
+
+ platform_device_register(&s3c_device_spi_acc);
platform_device_register(>a01_button_dev);
platform_device_register(>a01_pm_gsm_dev);
@@ -189,3 +242,40 @@
if (rc < 0) {
dev_err(&spi->dev, "error requesting IRQ %d\n",
lis->spi_dev->irq);
+Index: linux-2.6.24-rc8/drivers/spi/spi_s3c24xx_gpio.c
+===================================================================
+--- linux-2.6.24-rc8.orig/drivers/spi/spi_s3c24xx_gpio.c
++++ linux-2.6.24-rc8/drivers/spi/spi_s3c24xx_gpio.c
+@@ -116,6 +116,8 @@
+ /* copy in the plkatform data */
+ info = sp->info = dev->dev.platform_data;
+
++ master->num_chipselect = info->num_chipselect;
++
+ /* setup spi bitbang adaptor */
+ sp->bitbang.master = spi_master_get(master);
+ sp->bitbang.master->bus_num = info->bus_num;
+Index: linux-2.6.24-rc8/include/asm-arm/arch-s3c2410/spi-gpio.h
+===================================================================
+--- linux-2.6.24-rc8.orig/include/asm-arm/arch-s3c2410/spi-gpio.h
++++ linux-2.6.24-rc8/include/asm-arm/arch-s3c2410/spi-gpio.h
+@@ -22,6 +22,7 @@
+ unsigned long pin_miso;
+
+ int bus_num;
++ int num_chipselect;
+
+ unsigned long board_size;
+ struct spi_board_info *board_info;
+Index: linux-2.6.24-rc8/include/linux/lis302dl.h
+===================================================================
+--- linux-2.6.24-rc8.orig/include/linux/lis302dl.h
++++ linux-2.6.24-rc8/include/linux/lis302dl.h
+@@ -5,6 +5,7 @@
+
+ struct lis302dl_platform_data {
+ char *name;
++ unsigned long pin_chip_select;
+ };
+
+ #endif /* _LINUX_LIS302DL_H */
More information about the commitlog
mailing list