Changeset 4301


Ignore:
Timestamp:
04/02/08 23:14:52 (5 years ago)
Author:
werner
Message:

add-lis302dl-gta02-a6-int1-only.patch

A6 uses int1 only and no pullup, adapt according to PCB revision

Signed-off-by: Andy Green <andy@…>

[ Changed to use system_rev, like everyone else. ]

---

arch/arm/mach-s3c2440/mach-gta02.c | 17 +++++++++++++++--
drivers/input/misc/lis302dl.c | 11 ++++++++---
include/linux/lis302dl.h | 1 +
3 files changed, 24 insertions(+), 5 deletions(-)

File:
1 edited

Legend:

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

    r4285 r4301  
    3535 static struct glamo_spigpio_info glamo_spigpio_cfg = { 
    3636        .pin_clk        = GLAMO_GPIO10_OUTPUT, 
    37 @@ -507,16 +510,97 @@ 
     37@@ -507,16 +510,99 @@ 
    3838  
    3939 /* SPI: Accelerometers attached to SPI of s3c244x */ 
     
    118118-static const struct lis302dl_platform_data lis302_pdata[] = { 
    119119+ 
    120 +const struct lis302dl_platform_data lis302_pdata[] = { 
     120+struct lis302dl_platform_data lis302_pdata[] = { 
    121121        { 
    122122-               .name           = "lis302-1 (top)" 
     
    126126+               .pin_mosi       = S3C2410_GPG6, 
    127127+               .pin_miso       = S3C2410_GPG5, 
     128+               .open_drain     = 1, /* altered at runtime by PCB rev */ 
    128129+               .lis302dl_bitbang_read = gat02_lis302dl_bitbang_read, 
    129130        }, { 
     
    134135+               .pin_mosi       = S3C2410_GPG6, 
    135136+               .pin_miso       = S3C2410_GPG5, 
     137+               .open_drain     = 1, /* altered at runtime by PCB rev */ 
    136138+               .lis302dl_bitbang_read = gat02_lis302dl_bitbang_read, 
    137139        }, 
    138140 }; 
    139141  
    140 @@ -525,26 +609,75 @@ 
     142@@ -525,26 +611,75 @@ 
    141143                .modalias       = "lis302dl", 
    142144                .platform_data  = &lis302_pdata[0], 
     
    220222  
    221223 static struct resource gta02_led_resources[] = { 
    222 @@ -786,10 +919,11 @@ 
     224@@ -786,10 +921,21 @@ 
    223225 { 
    224226        int rc; 
    225227  
     228+       switch (system_rev) { 
     229+       case GTA02v6_SYSTEM_REV: 
     230+               /* we need push-pull interrupt from motion sensors */ 
     231+               lis302_pdata[0].open_drain = 0; 
     232+               lis302_pdata[1].open_drain = 0; 
     233+               break; 
     234+       default: 
     235+               break; 
     236+       } 
     237+ 
    226238+       spin_lock_init(&motion_irq_lock); 
    227239+ 
     
    233245        /* Only GTA02v1 has a SD_DETECT GPIO.  Since the slot is not 
    234246         * hot-pluggable, this is not required anyway */ 
    235 @@ -801,6 +935,12 @@ 
     247@@ -801,6 +947,12 @@ 
    236248                break; 
    237249        } 
     
    246258        s3c24xx_udc_set_platdata(&gta02_udc_cfg); 
    247259        set_s3c2410ts_info(&gta02_ts_cfg); 
    248 @@ -829,6 +969,7 @@ 
     260@@ -829,6 +981,7 @@ 
    249261                break; 
    250262        } 
     
    581593  
    582594 static int __devinit lis302dl_probe(struct spi_device *spi) 
    583 @@ -433,84 +281,133 @@ 
     595@@ -433,84 +281,138 @@ 
    584596        int rc; 
    585597        struct lis302dl_info *lis; 
     
    683695+       reg_write(lis, LIS302DL_REG_FF_WU_DURATION_1, 0x00); 
    684696+       reg_write(lis, LIS302DL_REG_FF_WU_CFG_1, 0x95); 
    685   
     697+ 
    686698+       reg_write(lis, LIS302DL_REG_CTRL1, LIS302DL_CTRL1_Xen | 
    687699+                                          LIS302DL_CTRL1_Yen | 
    688700+                                          LIS302DL_CTRL1_Zen); 
    689701+ 
    690 +       /* switch interrupt to open collector, active-low */ 
    691 +       reg_write(lis, LIS302DL_REG_CTRL3, LIS302DL_CTRL3_PP_OD | 
    692 +                                          LIS302DL_CTRL3_IHL); 
     702+       if (pdata->open_drain) 
     703+               /* switch interrupt to open collector, active-low */ 
     704+               reg_write(lis, LIS302DL_REG_CTRL3, LIS302DL_CTRL3_PP_OD | 
     705+                                                  LIS302DL_CTRL3_IHL); 
     706+       else 
     707+               /* push-pull, active-low */ 
     708+               reg_write(lis, LIS302DL_REG_CTRL3, LIS302DL_CTRL3_IHL); 
     709+ 
    693710+       lis302dl_int_mode(spi, 1, LIS302DL_INTMODE_DATA_READY); 
    694711+       lis302dl_int_mode(spi, 2, LIS302DL_INTMODE_DATA_READY); 
     
    698715+       reg_read(lis, LIS302DL_REG_FF_WU_SRC_2); 
    699716+       reg_read(lis, LIS302DL_REG_CLICK_SRC); 
    700 + 
     717  
    701718+       dev_info(&spi->dev, "Found %s\n", pdata->name); 
    702719+ 
     
    742759        kfree(lis); 
    743760  
    744 @@ -521,6 +418,10 @@ 
     761@@ -521,6 +423,10 @@ 
    745762 static int lis302dl_suspend(struct spi_device *spi, pm_message_t state) 
    746763 { 
     
    753770        /* save registers */ 
    754771        lis->regs[LIS302DL_REG_CTRL1] = reg_read(lis, LIS302DL_REG_CTRL1); 
    755 @@ -561,12 +462,17 @@ 
     772@@ -561,12 +467,17 @@ 
    756773                reg_write(lis, LIS302DL_REG_CTRL1, tmp); 
    757774        } 
     
    771788        /* restore registers after resume */ 
    772789        reg_write(lis, LIS302DL_REG_CTRL1, lis->regs[LIS302DL_REG_CTRL1]); 
    773 @@ -597,6 +503,9 @@ 
     790@@ -597,6 +508,9 @@ 
    774791        reg_write(lis, LIS302DL_REG_CLICK_WINDOW, 
    775792                  lis->regs[LIS302DL_REG_CLICK_WINDOW]); 
     
    848865--- linux-2.6.24.orig/include/linux/lis302dl.h 
    849866+++ linux-2.6.24/include/linux/lis302dl.h 
    850 @@ -2,10 +2,111 @@ 
     867@@ -2,10 +2,112 @@ 
    851868 #define _LINUX_LIS302DL_H 
    852869  
     
    864881+       unsigned long pin_mosi; 
    865882+       unsigned long pin_miso; 
     883+       int open_drain; 
    866884+       void (*lis302dl_bitbang_read)(struct lis302dl_info *); 
    867885+}; 
Note: See TracChangeset for help on using the changeset viewer.