From: Tony Lindgren <tony@atomide.com>
To: Roman Tereshonkov <roman.tereshonkov@nokia.com>
Cc: linux-omap@vger.kernel.org
Subject: Re: [PATCH] Chip message format is either 8-bit cmd or 8-bit cmd + 16-bit data.
Date: Fri, 16 May 2008 10:49:33 -0700 [thread overview]
Message-ID: <20080516174933.GQ23002@atomide.com> (raw)
In-Reply-To: <1210866268-19254-1-git-send-email-roman.tereshonkov@nokia.com>
* Roman Tereshonkov <roman.tereshonkov@nokia.com> [080515 08:48]:
> Fix the touchscreen input device name.
>
> No need in msg.spi = ts->spi assignments. It is done in
> spi_async called from spi_sync.
>
> No need in driver bus assignment. It is done in spi_driver_register.
Pushing.
Tony
>
>
> Signed-off-by: Roman Tereshonkov <roman.tereshonkov@nokia.com>
> ---
> drivers/input/touchscreen/tsc2005.c | 36 ++++++++++++++++------------------
> 1 files changed, 17 insertions(+), 19 deletions(-)
>
> diff --git a/drivers/input/touchscreen/tsc2005.c b/drivers/input/touchscreen/tsc2005.c
> index 035d209..fa01799 100644
> --- a/drivers/input/touchscreen/tsc2005.c
> +++ b/drivers/input/touchscreen/tsc2005.c
> @@ -54,7 +54,13 @@
> * during the last 20ms which means the pen has been lifted.
> */
>
> -#define TSC2005_HZ (14000000)
> +#define TSC2005_VDD_LOWER_27
> +
> +#ifdef TSC2005_VDD_LOWER_27
> +#define TSC2005_HZ (10000000)
> +#else
> +#define TSC2005_HZ (25000000)
> +#endif
>
> #define TSC2005_CMD (0x80)
> #define TSC2005_REG (0x00)
> @@ -226,13 +232,12 @@ static void tsc2005_cmd(struct tsc2005 *ts, u8 cmd)
> struct spi_message msg;
> struct spi_transfer xfer = { 0 };
>
> - spi_message_init(&msg);
> - msg.spi = ts->spi;
> xfer.tx_buf = &data;
> xfer.rx_buf = NULL;
> - xfer.len = 2;
> + xfer.len = 1;
> xfer.bits_per_word = 8;
>
> + spi_message_init(&msg);
> spi_message_add_tail(&xfer, &msg);
> spi_sync(ts->spi, &msg);
> }
> @@ -244,16 +249,15 @@ static void tsc2005_write(struct tsc2005 *ts, u8 reg, u16 value)
> struct spi_transfer xfer = { 0 };
>
> tx = (TSC2005_REG | reg | TSC2005_REG_PND0 |
> - TSC2005_REG_WRITE) << (2 * 8);
> + TSC2005_REG_WRITE) << 16;
> tx |= value;
>
> - spi_message_init(&msg);
> - msg.spi = ts->spi;
> xfer.tx_buf = &tx;
> xfer.rx_buf = NULL;
> xfer.len = 4;
> - xfer.bits_per_word = 3 * 8;
> + xfer.bits_per_word = 24;
>
> + spi_message_init(&msg);
> spi_message_add_tail(&xfer, &msg);
> spi_sync(ts->spi, &msg);
> }
> @@ -271,10 +275,10 @@ static void tsc2005_ts_update_pen_state(struct tsc2005 *ts,
> }
> } else {
> input_report_abs(ts->idev, ABS_PRESSURE, 0);
> - if (ts->pen_down)
> + if (ts->pen_down) {
> input_report_key(ts->idev, BTN_TOUCH, 0);
> -
> - ts->pen_down = 0;
> + ts->pen_down = 0;
> + }
> }
>
> input_sync(ts->idev);
> @@ -377,7 +381,7 @@ static void tsc2005_ts_penup_timer_handler(unsigned long data)
>
> /*
> * This interrupt is called when pen is down and coordinates are
> - * available. That is indicated by a falling edge on DEV line.
> + * available. That is indicated by a falling edge on DAV line.
> */
> static irqreturn_t tsc2005_ts_irq_handler(int irq, void *dev_id)
> {
> @@ -406,7 +410,6 @@ static void tsc2005_ts_setup_spi_xfer(struct tsc2005 *ts)
> int i;
>
> spi_message_init(m);
> - m->spi = ts->spi;
>
> for (i = 0; i < NUM_READ_REGS; i++, x++) {
> x->tx_buf = &tsc2005_read_reg[i];
> @@ -565,11 +568,7 @@ static int __devinit tsc2005_ts_init(struct tsc2005 *ts,
> goto err2;
> }
>
> - /*
> - * TODO: should be "TSC2005 touchscreen", but X has hardcoded these
> - * strings and doesn't accept TSC2005 yet...
> - */
> - idev->name = "TSC2301 touchscreen";
> + idev->name = "TSC2005 touchscreen";
> snprintf(ts->phys, sizeof(ts->phys), "%s/input-ts",
> ts->spi->dev.bus_id);
> idev->phys = ts->phys;
> @@ -709,7 +708,6 @@ static int tsc2005_resume(struct spi_device *spi)
> static struct spi_driver tsc2005_driver = {
> .driver = {
> .name = "tsc2005",
> - .bus = &spi_bus_type,
> .owner = THIS_MODULE,
> },
> #ifdef CONFIG_PM
> --
> 1.5.3.7
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2008-05-16 17:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-15 15:44 [PATCH] Chip message format is either 8-bit cmd or 8-bit cmd + 16-bit data Roman Tereshonkov
2008-05-16 17:49 ` Tony Lindgren [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080516174933.GQ23002@atomide.com \
--to=tony@atomide.com \
--cc=linux-omap@vger.kernel.org \
--cc=roman.tereshonkov@nokia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox