Ignore:
Timestamp:
01/24/08 19:21:01 (5 years ago)
Author:
werner
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/src/target/kernel/2.6.24.x/patches/gta02-acc.patch

    r3937 r3945  
    1212 }; 
    1313  
    14 @@ -504,11 +502,6 @@ 
     14@@ -475,10 +473,12 @@ 
     15        }, 
     16 }; 
     17  
     18+#if 0 /* currently this is not used and we use gpio spi */ 
     19 static struct glamo_spi_info glamo_spi_cfg = { 
     20        .board_size     = ARRAY_SIZE(gta02_spi_board_info), 
     21        .board_info     = gta02_spi_board_info, 
     22 }; 
     23+#endif /* 0 */ 
     24  
     25 static struct glamo_spigpio_info glamo_spigpio_cfg = { 
     26        .pin_clk        = GLAMO_GPIO10_OUTPUT, 
     27@@ -504,16 +504,13 @@ 
    1528  
    1629 /* SPI: Accelerometers attached to SPI of s3c244x */ 
     
    2336 static const struct lis302dl_platform_data lis302_pdata[] = { 
    2437        { 
    25                 .name           = "lis302-1 (top)" 
    26 @@ -538,10 +531,55 @@ 
     38-               .name           = "lis302-1 (top)" 
     39+               .name           = "lis302-1 (top)", 
     40+               .pin_chip_select= S3C2410_GPD12, 
     41        }, { 
     42-               .name           = "lis302-2 (bottom)" 
     43+               .name           = "lis302-2 (bottom)", 
     44+               .pin_chip_select= S3C2410_GPD13, 
     45        }, 
     46 }; 
     47  
     48@@ -524,7 +521,7 @@ 
     49                .irq            = GTA02_IRQ_GSENSOR_1, 
     50                .max_speed_hz   = 400 * 1000, 
     51                .bus_num        = 1, 
     52-               .chip_select    = S3C2410_GPD12, 
     53+               .chip_select    = 0, 
     54                .mode           = SPI_MODE_3, 
     55        }, 
     56        { 
     57@@ -533,15 +530,63 @@ 
     58                .irq            = GTA02_IRQ_GSENSOR_2, 
     59                .max_speed_hz   = 400 * 1000, 
     60                .bus_num        = 1, 
     61-               .chip_select    = S3C2410_GPD13, 
     62+               .chip_select    = 1, 
     63                .mode           = SPI_MODE_3, 
    2764        }, 
    2865 }; 
     
    3067-static struct s3c2410_spi_info gta02_spi_acc_cfg = { 
    3168-       .set_cs         = gta02_spi_acc_set_cs, 
    32 + 
    33 +static void spi_acc_cs(struct s3c2410_spigpio_info *spi, int cs) 
     69+static void spi_acc_cs(struct s3c2410_spigpio_info *spigpio_info, int cs) 
    3470+{ 
     71+       struct lis302dl_platform_data * plat_data = 
     72+                               (struct lis302dl_platform_data *)spigpio_info-> 
     73+                                                    board_info->platform_data; 
    3574+       switch (cs) { 
    3675+       case BITBANG_CS_ACTIVE: 
    37 +               s3c2410_gpio_setpin(S3C2410_GPD12, 0); 
     76+               s3c2410_gpio_setpin(plat_data->pin_chip_select, 0); 
    3877+               break; 
    3978+       case BITBANG_CS_INACTIVE: 
    40 +               s3c2410_gpio_setpin(S3C2410_GPD12, 1); 
     79+               s3c2410_gpio_setpin(plat_data->pin_chip_select, 1); 
    4180+               break; 
    4281+       } 
     
    5089        .board_info     = gta02_spi_acc_bdinfo, 
    5190+       .chip_select    = &spi_acc_cs, 
     91+       .num_chipselect = 2, 
    5292+}; 
    5393+ 
     
    72112+ 
    73113+static struct platform_device s3c_device_spi_acc = { 
    74 +       .name             = "s3c24xx-spi-gpio", 
     114+       .name             = "spi_s3c24xx_gpio", 
    75115+       .id               = 1, 
    76116+       .num_resources    = ARRAY_SIZE(s3c_spi_acc_resource), 
     
    82122  
    83123 static struct resource gta02_led_resources[] = { 
    84 @@ -784,7 +822,6 @@ 
     124@@ -784,7 +829,6 @@ 
    85125        s3c_device_usb.dev.platform_data = &gta02_usb_info; 
    86126        s3c_device_nand.dev.platform_data = &gta02_nand_info; 
     
    90130        /* Only GTA02v1 has a SD_DETECT GPIO.  Since the slot is not 
    91131         * hot-pluggable, this is not required anyway */ 
    92 @@ -824,6 +861,7 @@ 
     132@@ -796,6 +840,12 @@ 
     133                break; 
     134        } 
     135  
     136+       /* acc sensor chip selects */ 
     137+       s3c2410_gpio_setpin(S3C2410_GPD12, 1); 
     138+       s3c2410_gpio_cfgpin(S3C2410_GPD12, S3C2410_GPIO_OUTPUT); 
     139+       s3c2410_gpio_setpin(S3C2410_GPD13, 1); 
     140+       s3c2410_gpio_cfgpin(S3C2410_GPD13, S3C2410_GPIO_OUTPUT); 
     141+ 
     142        INIT_WORK(&gta02_udc_vbus_drawer.work, __gta02_udc_vbus_draw); 
     143        s3c24xx_udc_set_platdata(&gta02_udc_cfg); 
     144        set_s3c2410ts_info(&gta02_ts_cfg); 
     145@@ -824,6 +874,7 @@ 
    93146                break; 
    94147        } 
     
    190243                dev_err(&spi->dev, "error requesting IRQ %d\n", 
    191244                        lis->spi_dev->irq); 
     245Index: linux-2.6.24-rc8/drivers/spi/spi_s3c24xx_gpio.c 
     246=================================================================== 
     247--- linux-2.6.24-rc8.orig/drivers/spi/spi_s3c24xx_gpio.c 
     248+++ linux-2.6.24-rc8/drivers/spi/spi_s3c24xx_gpio.c 
     249@@ -116,6 +116,8 @@ 
     250        /* copy in the plkatform data */ 
     251        info = sp->info = dev->dev.platform_data; 
     252  
     253+       master->num_chipselect = info->num_chipselect; 
     254+ 
     255        /* setup spi bitbang adaptor */ 
     256        sp->bitbang.master = spi_master_get(master); 
     257        sp->bitbang.master->bus_num = info->bus_num; 
     258Index: linux-2.6.24-rc8/include/asm-arm/arch-s3c2410/spi-gpio.h 
     259=================================================================== 
     260--- linux-2.6.24-rc8.orig/include/asm-arm/arch-s3c2410/spi-gpio.h 
     261+++ linux-2.6.24-rc8/include/asm-arm/arch-s3c2410/spi-gpio.h 
     262@@ -22,6 +22,7 @@ 
     263        unsigned long            pin_miso; 
     264  
     265        int                      bus_num; 
     266+       int                      num_chipselect; 
     267  
     268        unsigned long            board_size; 
     269        struct spi_board_info   *board_info; 
     270Index: linux-2.6.24-rc8/include/linux/lis302dl.h 
     271=================================================================== 
     272--- linux-2.6.24-rc8.orig/include/linux/lis302dl.h 
     273+++ linux-2.6.24-rc8/include/linux/lis302dl.h 
     274@@ -5,6 +5,7 @@ 
     275  
     276 struct lis302dl_platform_data { 
     277        char *name; 
     278+       unsigned long pin_chip_select; 
     279 }; 
     280  
     281 #endif /* _LINUX_LIS302DL_H */ 
Note: See TracChangeset for help on using the changeset viewer.