aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/mach-s3c2440/mach-gta02.c
diff options
context:
space:
mode:
authorSimon Kagstrom <simon.kagstrom@gmail.com>2008-11-19 17:11:25 +0000
committerAndy Green <agreen@pads.home.warmcat.com>2008-11-19 17:11:25 +0000
commit107b2462fc4872eec18e7fa4a8f498f6f5c5e75d (patch)
treeae861741cb94aa5e69b68ec1d220fc76015a238d /arch/arm/mach-s3c2440/mach-gta02.c
parentc298e74a6c0f6c94f57e40767b5a8be3f2ec314f (diff)
: lis302dl-port-work-from-stable.patch
Merge in the accelerometer functionality from stable From: Simon Kagstrom <simon.kagstrom@gmail.com> This giant patch merges the functionality from stable. It also changes the default threshold to 0 (generate interrupts on data). As the level-triggered interrupts cause too frequent interruptions on low thresholds, also set a lower limit to 36mg to avoid slowing down the phone too much. Also rearrange the probe function to disable interrupts only over device I/O. This fixes the kernel errors when inserting the module. Andy was right: In stable-tracking, no magic workaround is needed to make suspend/resume work. I've tested the accelerometers under heavy load (making the phone basically unusable) without getting lockups. Signed-off-by: Simon Kagstrom <simon.kagstrom@gmail.com>
Diffstat (limited to 'arch/arm/mach-s3c2440/mach-gta02.c')
-rw-r--r--arch/arm/mach-s3c2440/mach-gta02.c35
1 files changed, 3 insertions, 32 deletions
diff --git a/arch/arm/mach-s3c2440/mach-gta02.c b/arch/arm/mach-s3c2440/mach-gta02.c
index a959f67dc12..ac2e5b615ef 100644
--- a/arch/arm/mach-s3c2440/mach-gta02.c
+++ b/arch/arm/mach-s3c2440/mach-gta02.c
@@ -1049,13 +1049,10 @@ static void __gta02_lis302dl_bitbang(struct lis302dl_info *lis, u8 *tx,
int tx_bytes, u8 *rx, int rx_bytes)
{
struct lis302dl_platform_data *pdata = lis->pdata;
- u8 shifter = 0;
int n;
- unsigned long flags;
+ u8 shifter = 0;
unsigned long other_cs;
- local_irq_save(flags);
-
/*
* Huh... "quirk"... CS on this device is not really "CS" like you can
* expect.
@@ -1105,8 +1102,6 @@ static void __gta02_lis302dl_bitbang(struct lis302dl_info *lis, u8 *tx,
}
s3c2410_gpio_setpin(pdata->pin_chip_select, 1);
s3c2410_gpio_setpin(other_cs, 1);
-
- local_irq_restore(flags);
}
@@ -1139,30 +1134,6 @@ static void gta02_lis302dl_bitbang_write_reg(struct lis302dl_info *lis, u8 reg,
}
-static void gta02_lis302dl_bitbang_sample(struct lis302dl_info *lis)
-{
- u8 data = 0xc0 | LIS302DL_REG_OUT_X; /* read, autoincrement */
- u8 read[5];
- unsigned long flags;
-
- local_irq_save(flags);
-
- __gta02_lis302dl_bitbang(lis, &data, 1, &read[0], 5);
-
- local_irq_restore(flags);
-
- input_report_rel(lis->input_dev, REL_X, MG_PER_SAMPLE * (s8)read[0]);
- input_report_rel(lis->input_dev, REL_Y, MG_PER_SAMPLE * (s8)read[2]);
- input_report_rel(lis->input_dev, REL_Z, MG_PER_SAMPLE * (s8)read[4]);
-
- input_sync(lis->input_dev);
-#ifdef DEBUG_SPEW_MS
- printk(KERN_INFO "%s: %d %d %d\n", pdata->name, read[0], read[2],
- read[4]);
-#endif
-}
-
-
void gta02_lis302dl_suspend_io(struct lis302dl_info *lis, int resume)
{
struct lis302dl_platform_data *pdata = lis->pdata;
@@ -1203,7 +1174,7 @@ struct lis302dl_platform_data lis302_pdata_top = {
.pin_miso = S3C2410_GPG5,
.interrupt = GTA02_IRQ_GSENSOR_1,
.open_drain = 1, /* altered at runtime by PCB rev */
- .lis302dl_bitbang_read_sample = gta02_lis302dl_bitbang_sample,
+ .lis302dl_bitbang = __gta02_lis302dl_bitbang,
.lis302dl_bitbang_reg_read = gta02_lis302dl_bitbang_read_reg,
.lis302dl_bitbang_reg_write = gta02_lis302dl_bitbang_write_reg,
.lis302dl_suspend_io = gta02_lis302dl_suspend_io,
@@ -1217,7 +1188,7 @@ struct lis302dl_platform_data lis302_pdata_bottom = {
.pin_miso = S3C2410_GPG5,
.interrupt = GTA02_IRQ_GSENSOR_2,
.open_drain = 1, /* altered at runtime by PCB rev */
- .lis302dl_bitbang_read_sample = gta02_lis302dl_bitbang_sample,
+ .lis302dl_bitbang = __gta02_lis302dl_bitbang,
.lis302dl_bitbang_reg_read = gta02_lis302dl_bitbang_read_reg,
.lis302dl_bitbang_reg_write = gta02_lis302dl_bitbang_write_reg,
.lis302dl_suspend_io = gta02_lis302dl_suspend_io,