aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean McNeil <sean@mcneil.com>2008-11-19 17:11:00 +0000
committerAndy Green <agreen@pads.home.warmcat.com>2008-11-19 17:11:00 +0000
commitdd819f74c1d26b270b38b8757c1d8ea3c61792dc (patch)
treef84cc920bcf7e64dcde7e03eb052ec03150abec7
parent6ace15281cc7c8ab74d34ec392d02ed413685c47 (diff)
fix-lis302dl-issues.patch
Move to level from edge, fix local_save... to local_irq... simplify bitbang sequence Signed-off-by: Sean McNeil <sean@mcneil.com>
-rw-r--r--arch/arm/mach-s3c2440/mach-gta02.c16
-rw-r--r--drivers/input/misc/lis302dl.c6
2 files changed, 5 insertions, 17 deletions
diff --git a/arch/arm/mach-s3c2440/mach-gta02.c b/arch/arm/mach-s3c2440/mach-gta02.c
index 87acd6c3cf2..47d863bc7eb 100644
--- a/arch/arm/mach-s3c2440/mach-gta02.c
+++ b/arch/arm/mach-s3c2440/mach-gta02.c
@@ -1067,7 +1067,6 @@ void gta02_lis302dl_bitbang_read(struct lis302dl_info *lis)
struct lis302dl_platform_data *pdata = lis->pdata;
u8 shifter = 0xc0 | LIS302DL_REG_OUT_X; /* read, autoincrement */
int n, n1;
- unsigned long other_cs;
unsigned long flags;
#ifdef DEBUG_SPEW_MS
s8 x, y, z;
@@ -1085,33 +1084,21 @@ void gta02_lis302dl_bitbang_read(struct lis302dl_info *lis)
* ensure this is never issued.
*/
- if (&lis302_pdata[0] == pdata)
- other_cs = lis302_pdata[1].pin_chip_select;
- else
- other_cs = lis302_pdata[0].pin_chip_select;
-
- s3c2410_gpio_setpin(other_cs, 1);
- s3c2410_gpio_setpin(pdata->pin_chip_select, 1);
s3c2410_gpio_setpin(pdata->pin_clk, 1);
s3c2410_gpio_setpin(pdata->pin_chip_select, 0);
for (n = 0; n < 8; n++) { /* write the r/w, inc and address */
s3c2410_gpio_setpin(pdata->pin_clk, 0);
- s3c2410_gpio_setpin(pdata->pin_mosi, (shifter >> 7) & 1);
- s3c2410_gpio_setpin(pdata->pin_clk, 0);
+ s3c2410_gpio_setpin(pdata->pin_mosi, (shifter >> (7 - n)) & 1);
s3c2410_gpio_setpin(pdata->pin_clk, 1);
- s3c2410_gpio_setpin(pdata->pin_clk, 1);
- shifter <<= 1;
}
for (n = 0; n < 5; n++) { /* 5 consequetive registers */
for (n1 = 0; n1 < 8; n1++) { /* 8 bits each */
s3c2410_gpio_setpin(pdata->pin_clk, 0);
- s3c2410_gpio_setpin(pdata->pin_clk, 0);
shifter <<= 1;
if (s3c2410_gpio_getpin(pdata->pin_miso))
shifter |= 1;
s3c2410_gpio_setpin(pdata->pin_clk, 1);
- s3c2410_gpio_setpin(pdata->pin_clk, 1);
}
switch (n) {
case 0:
@@ -1135,7 +1122,6 @@ void gta02_lis302dl_bitbang_read(struct lis302dl_info *lis)
}
}
s3c2410_gpio_setpin(pdata->pin_chip_select, 1);
- s3c2410_gpio_setpin(other_cs, 1);
local_irq_restore(flags);
input_sync(lis->input_dev);
diff --git a/drivers/input/misc/lis302dl.c b/drivers/input/misc/lis302dl.c
index 1ad89b43d3b..56489c9783f 100644
--- a/drivers/input/misc/lis302dl.c
+++ b/drivers/input/misc/lis302dl.c
@@ -616,9 +616,11 @@ static int __devinit lis302dl_probe(struct spi_device *spi)
mdelay(1);
reg_write(lis, LIS302DL_REG_CTRL2, 0);
+
reg_write(lis, LIS302DL_REG_CTRL3, LIS302DL_CTRL3_PP_OD |
LIS302DL_CTRL3_IHL);
- reg_write(lis, LIS302DL_REG_FF_WU_THS_1, 0x0);
+ reg_write(lis, LIS302DL_REG_FF_WU_THS_1, 0x14);
+
reg_write(lis, LIS302DL_REG_FF_WU_DURATION_1, 0x00);
reg_write(lis, LIS302DL_REG_FF_WU_CFG_1, 0x0);
@@ -648,7 +650,7 @@ static int __devinit lis302dl_probe(struct spi_device *spi)
lis->pdata = pdata;
rc = request_irq(lis->spi_dev->irq, lis302dl_interrupt,
- IRQF_TRIGGER_FALLING, "lis302dl", lis);
+ IRQF_TRIGGER_LOW, "lis302dl", lis);
if (rc < 0) {
dev_err(&spi->dev, "error requesting IRQ %d\n",
lis->spi_dev->irq);