Changeset 4301
- Timestamp:
- 04/02/08 23:14:52 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/src/target/kernel/2.6.24.x/patches/gta02-acc.patch
r4285 r4301 35 35 static struct glamo_spigpio_info glamo_spigpio_cfg = { 36 36 .pin_clk = GLAMO_GPIO10_OUTPUT, 37 @@ -507,16 +510,9 7@@37 @@ -507,16 +510,99 @@ 38 38 39 39 /* SPI: Accelerometers attached to SPI of s3c244x */ … … 118 118 -static const struct lis302dl_platform_data lis302_pdata[] = { 119 119 + 120 + conststruct lis302dl_platform_data lis302_pdata[] = {120 +struct lis302dl_platform_data lis302_pdata[] = { 121 121 { 122 122 - .name = "lis302-1 (top)" … … 126 126 + .pin_mosi = S3C2410_GPG6, 127 127 + .pin_miso = S3C2410_GPG5, 128 + .open_drain = 1, /* altered at runtime by PCB rev */ 128 129 + .lis302dl_bitbang_read = gat02_lis302dl_bitbang_read, 129 130 }, { … … 134 135 + .pin_mosi = S3C2410_GPG6, 135 136 + .pin_miso = S3C2410_GPG5, 137 + .open_drain = 1, /* altered at runtime by PCB rev */ 136 138 + .lis302dl_bitbang_read = gat02_lis302dl_bitbang_read, 137 139 }, 138 140 }; 139 141 140 @@ -525,26 +6 09,75 @@142 @@ -525,26 +611,75 @@ 141 143 .modalias = "lis302dl", 142 144 .platform_data = &lis302_pdata[0], … … 220 222 221 223 static struct resource gta02_led_resources[] = { 222 @@ -786,10 +9 19,11 @@224 @@ -786,10 +921,21 @@ 223 225 { 224 226 int rc; 225 227 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 + 226 238 + spin_lock_init(&motion_irq_lock); 227 239 + … … 233 245 /* Only GTA02v1 has a SD_DETECT GPIO. Since the slot is not 234 246 * hot-pluggable, this is not required anyway */ 235 @@ -801,6 +9 35,12 @@247 @@ -801,6 +947,12 @@ 236 248 break; 237 249 } … … 246 258 s3c24xx_udc_set_platdata(>a02_udc_cfg); 247 259 set_s3c2410ts_info(>a02_ts_cfg); 248 @@ -829,6 +9 69,7 @@260 @@ -829,6 +981,7 @@ 249 261 break; 250 262 } … … 581 593 582 594 static int __devinit lis302dl_probe(struct spi_device *spi) 583 @@ -433,84 +281,13 3@@595 @@ -433,84 +281,138 @@ 584 596 int rc; 585 597 struct lis302dl_info *lis; … … 683 695 + reg_write(lis, LIS302DL_REG_FF_WU_DURATION_1, 0x00); 684 696 + reg_write(lis, LIS302DL_REG_FF_WU_CFG_1, 0x95); 685 697 + 686 698 + reg_write(lis, LIS302DL_REG_CTRL1, LIS302DL_CTRL1_Xen | 687 699 + LIS302DL_CTRL1_Yen | 688 700 + LIS302DL_CTRL1_Zen); 689 701 + 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 + 693 710 + lis302dl_int_mode(spi, 1, LIS302DL_INTMODE_DATA_READY); 694 711 + lis302dl_int_mode(spi, 2, LIS302DL_INTMODE_DATA_READY); … … 698 715 + reg_read(lis, LIS302DL_REG_FF_WU_SRC_2); 699 716 + reg_read(lis, LIS302DL_REG_CLICK_SRC); 700 + 717 701 718 + dev_info(&spi->dev, "Found %s\n", pdata->name); 702 719 + … … 742 759 kfree(lis); 743 760 744 @@ -521,6 +4 18,10 @@761 @@ -521,6 +423,10 @@ 745 762 static int lis302dl_suspend(struct spi_device *spi, pm_message_t state) 746 763 { … … 753 770 /* save registers */ 754 771 lis->regs[LIS302DL_REG_CTRL1] = reg_read(lis, LIS302DL_REG_CTRL1); 755 @@ -561,12 +46 2,17 @@772 @@ -561,12 +467,17 @@ 756 773 reg_write(lis, LIS302DL_REG_CTRL1, tmp); 757 774 } … … 771 788 /* restore registers after resume */ 772 789 reg_write(lis, LIS302DL_REG_CTRL1, lis->regs[LIS302DL_REG_CTRL1]); 773 @@ -597,6 +50 3,9 @@790 @@ -597,6 +508,9 @@ 774 791 reg_write(lis, LIS302DL_REG_CLICK_WINDOW, 775 792 lis->regs[LIS302DL_REG_CLICK_WINDOW]); … … 848 865 --- linux-2.6.24.orig/include/linux/lis302dl.h 849 866 +++ linux-2.6.24/include/linux/lis302dl.h 850 @@ -2,10 +2,11 1@@867 @@ -2,10 +2,112 @@ 851 868 #define _LINUX_LIS302DL_H 852 869 … … 864 881 + unsigned long pin_mosi; 865 882 + unsigned long pin_miso; 883 + int open_drain; 866 884 + void (*lis302dl_bitbang_read)(struct lis302dl_info *); 867 885 +};
Note: See TracChangeset
for help on using the changeset viewer.
