diff options
| author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2011-03-17 01:10:46 -0400 |
|---|---|---|
| committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2011-03-17 02:29:04 -0400 |
| commit | c8b6846a7559e64d7ac4ba1ccdba05f3ee2e34e8 (patch) | |
| tree | d620ed30240c47d5b368f14b9c0f65bd92d1050b /drivers/input | |
| parent | 8dbcc432c2b4adf4ff7183afc5f2b42276b2a987 (diff) | |
Input: tsc2005 - use true/false for boolean variables
Tested-by: Aaro Koskinen <aaro.koskinen@nokia.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input')
| -rw-r--r-- | drivers/input/touchscreen/tsc2005.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/drivers/input/touchscreen/tsc2005.c b/drivers/input/touchscreen/tsc2005.c index bc7e2f974b7e..f457cb95b95b 100644 --- a/drivers/input/touchscreen/tsc2005.c +++ b/drivers/input/touchscreen/tsc2005.c | |||
| @@ -140,7 +140,8 @@ struct tsc2005 { | |||
| 140 | 140 | ||
| 141 | bool disabled; | 141 | bool disabled; |
| 142 | unsigned int disable_depth; | 142 | unsigned int disable_depth; |
| 143 | unsigned int pen_down; | 143 | |
| 144 | bool pen_down; | ||
| 144 | 145 | ||
| 145 | void (*set_reset)(bool enable); | 146 | void (*set_reset)(bool enable); |
| 146 | }; | 147 | }; |
| @@ -197,7 +198,7 @@ static void tsc2005_read(struct tsc2005 *ts, u8 reg, u16 *value) | |||
| 197 | struct spi_message msg; | 198 | struct spi_message msg; |
| 198 | struct tsc2005_spi_rd spi_rd = { { 0 }, 0, 0 }; | 199 | struct tsc2005_spi_rd spi_rd = { { 0 }, 0, 0 }; |
| 199 | 200 | ||
| 200 | tsc2005_setup_read(&spi_rd, reg, 1); | 201 | tsc2005_setup_read(&spi_rd, reg, true); |
| 201 | 202 | ||
| 202 | spi_message_init(&msg); | 203 | spi_message_init(&msg); |
| 203 | spi_message_add_tail(&spi_rd.spi_xfer, &msg); | 204 | spi_message_add_tail(&spi_rd.spi_xfer, &msg); |
| @@ -214,13 +215,13 @@ static void tsc2005_update_pen_state(struct tsc2005 *ts, | |||
| 214 | input_report_abs(ts->idev, ABS_PRESSURE, pressure); | 215 | input_report_abs(ts->idev, ABS_PRESSURE, pressure); |
| 215 | if (!ts->pen_down) { | 216 | if (!ts->pen_down) { |
| 216 | input_report_key(ts->idev, BTN_TOUCH, !!pressure); | 217 | input_report_key(ts->idev, BTN_TOUCH, !!pressure); |
| 217 | ts->pen_down = 1; | 218 | ts->pen_down = true; |
| 218 | } | 219 | } |
| 219 | } else { | 220 | } else { |
| 220 | input_report_abs(ts->idev, ABS_PRESSURE, 0); | 221 | input_report_abs(ts->idev, ABS_PRESSURE, 0); |
| 221 | if (ts->pen_down) { | 222 | if (ts->pen_down) { |
| 222 | input_report_key(ts->idev, BTN_TOUCH, 0); | 223 | input_report_key(ts->idev, BTN_TOUCH, 0); |
| 223 | ts->pen_down = 0; | 224 | ts->pen_down = false; |
| 224 | } | 225 | } |
| 225 | } | 226 | } |
| 226 | input_sync(ts->idev); | 227 | input_sync(ts->idev); |
| @@ -429,9 +430,9 @@ static ssize_t tsc2005_selftest_show(struct device *dev, | |||
| 429 | } | 430 | } |
| 430 | 431 | ||
| 431 | /* hardware reset */ | 432 | /* hardware reset */ |
| 432 | ts->set_reset(0); | 433 | ts->set_reset(false); |
| 433 | usleep_range(100, 500); /* only 10us required */ | 434 | usleep_range(100, 500); /* only 10us required */ |
| 434 | ts->set_reset(1); | 435 | ts->set_reset(true); |
| 435 | tsc2005_enable(ts); | 436 | tsc2005_enable(ts); |
| 436 | 437 | ||
| 437 | /* test that the reset really happened */ | 438 | /* test that the reset really happened */ |
| @@ -500,10 +501,10 @@ static void tsc2005_esd_work(struct work_struct *work) | |||
| 500 | tsc2005_read(ts, TSC2005_REG_CFR0, &r); | 501 | tsc2005_read(ts, TSC2005_REG_CFR0, &r); |
| 501 | if ((r ^ TSC2005_CFR0_INITVALUE) & TSC2005_CFR0_RW_MASK) { | 502 | if ((r ^ TSC2005_CFR0_INITVALUE) & TSC2005_CFR0_RW_MASK) { |
| 502 | dev_info(&ts->spi->dev, "TSC2005 not responding - resetting\n"); | 503 | dev_info(&ts->spi->dev, "TSC2005 not responding - resetting\n"); |
| 503 | ts->set_reset(0); | 504 | ts->set_reset(false); |
| 504 | tsc2005_update_pen_state(ts, 0, 0, 0); | 505 | tsc2005_update_pen_state(ts, 0, 0, 0); |
| 505 | usleep_range(100, 500); /* only 10us required */ | 506 | usleep_range(100, 500); /* only 10us required */ |
| 506 | ts->set_reset(1); | 507 | ts->set_reset(true); |
| 507 | tsc2005_start_scan(ts); | 508 | tsc2005_start_scan(ts); |
| 508 | } | 509 | } |
| 509 | 510 | ||
| @@ -517,10 +518,10 @@ out: | |||
| 517 | 518 | ||
| 518 | static void __devinit tsc2005_setup_spi_xfer(struct tsc2005 *ts) | 519 | static void __devinit tsc2005_setup_spi_xfer(struct tsc2005 *ts) |
| 519 | { | 520 | { |
| 520 | tsc2005_setup_read(&ts->spi_x, TSC2005_REG_X, 0); | 521 | tsc2005_setup_read(&ts->spi_x, TSC2005_REG_X, false); |
| 521 | tsc2005_setup_read(&ts->spi_y, TSC2005_REG_Y, 0); | 522 | tsc2005_setup_read(&ts->spi_y, TSC2005_REG_Y, false); |
| 522 | tsc2005_setup_read(&ts->spi_z1, TSC2005_REG_Z1, 0); | 523 | tsc2005_setup_read(&ts->spi_z1, TSC2005_REG_Z1, false); |
| 523 | tsc2005_setup_read(&ts->spi_z2, TSC2005_REG_Z2, 1); | 524 | tsc2005_setup_read(&ts->spi_z2, TSC2005_REG_Z2, true); |
| 524 | 525 | ||
| 525 | spi_message_init(&ts->spi_read_msg); | 526 | spi_message_init(&ts->spi_read_msg); |
| 526 | spi_message_add_tail(&ts->spi_x.spi_xfer, &ts->spi_read_msg); | 527 | spi_message_add_tail(&ts->spi_x.spi_xfer, &ts->spi_read_msg); |
