linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Trilok Soni <soni.trilok@gmail.com>
To: Daniel Ribeiro <drwyrm@gmail.com>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	linux-input@vger.kernel.org,
	linux-kernel <linux-kernel@vger.kernel.org>,
	openezx-devel <openezx-devel@lists.openezx.org>,
	Harald Welte <laforge@gnumonks.org>,
	Samuel Ortiz <sameo@linux.intel.com>
Subject: Re: [PATCH] PCAP touchscreen driver (for 2.6.32)
Date: Sun, 28 Jun 2009 12:45:17 +0530	[thread overview]
Message-ID: <5d5443650906280015x4bddefa5v9dd36f888c5f2e92@mail.gmail.com> (raw)
In-Reply-To: <1246122138.3727.12.camel@brutus>

Hi Daniel,

2009/6/27 Daniel Ribeiro <drwyrm@gmail.com>:
> Touchscreen driver for PCAP2 PMIC.
>

Some more description in commit text really helps.

> +static irqreturn_t pcap_ts_event_touch(int pirq, void *data)
> +{
> +       struct pcap_ts *pcap_ts = data;
> +
> +       if (pcap_ts->read_state == PCAP_ADC_TS_M_STANDBY) {
> +               pcap_ts->read_state = PCAP_ADC_TS_M_PRESSURE;
> +               schedule_delayed_work(&pcap_ts->work, 0);
> +       }
> +       return IRQ_HANDLED;
> +}
> +
> +static int __devinit pcap_ts_probe(struct platform_device *pdev)
> +{
> +       struct input_dev *input_dev;
> +       struct pcap_ts *pcap_ts;
> +       int err = -ENOMEM;
> +
> +       pcap_ts = kzalloc(sizeof(*pcap_ts), GFP_KERNEL);
> +       if (!pcap_ts)
> +               return err;
> +
> +       pcap_ts->pcap = platform_get_drvdata(pdev);
> +       platform_set_drvdata(pdev, pcap_ts);
> +
> +       input_dev = input_allocate_device();
> +       if (!pcap_ts || !input_dev)
> +               goto fail;
> +
> +       INIT_DELAYED_WORK(&pcap_ts->work, pcap_ts_work);
> +
> +       pcap_ts->read_state = PCAP_ADC_TS_M_STANDBY;
> +
> +       pcap_ts->input = input_dev;
> +
> +       input_dev->name = "pcap-touchscreen";
> +       input_dev->phys = "pcap_ts/input0";
> +       input_dev->id.bustype = BUS_HOST;
> +       input_dev->id.vendor = 0x0001;
> +       input_dev->id.product = 0x0002;
> +       input_dev->id.version = 0x0100;
> +       input_dev->dev.parent = &pdev->dev;
> +
> +       input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
> +       input_dev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH);
> +       input_set_abs_params(input_dev, ABS_X, X_AXIS_MIN, X_AXIS_MAX, 0, 0);
> +       input_set_abs_params(input_dev, ABS_Y, Y_AXIS_MIN, Y_AXIS_MAX, 0, 0);
> +       input_set_abs_params(input_dev, ABS_PRESSURE, PRESSURE_MIN,
> +                            PRESSURE_MAX, 0, 0);
> +
> +       err = request_irq(pcap_to_irq(pcap_ts->pcap, PCAP_IRQ_TS),
> +                       pcap_ts_event_touch, 0, "Touch Screen", pcap_ts);
> +       if (err)
> +               goto fail;
> +
> +       err = input_register_device(pcap_ts->input);
> +       if (err)
> +               goto fail_touch;

Please move request_irq after input_register_device, as IRQ can get
fired before input device gets available, right?

Overall driver is nice and clean.

-- 
---Trilok Soni
http://triloksoni.wordpress.com
http://www.linkedin.com/in/triloksoni
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2009-06-28  7:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-27 17:02 [PATCH] PCAP touchscreen driver (for 2.6.32) Daniel Ribeiro
2009-06-28  7:15 ` Trilok Soni [this message]
2009-06-28 17:49   ` Daniel Ribeiro
2009-06-29  6:19   ` Dmitry Torokhov
2009-06-28 14:35 ` Antonio Ospite
2009-06-28 17:45   ` Daniel Ribeiro
2009-06-29  6:29 ` Dmitry Torokhov

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=5d5443650906280015x4bddefa5v9dd36f888c5f2e92@mail.gmail.com \
    --to=soni.trilok@gmail.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=drwyrm@gmail.com \
    --cc=laforge@gnumonks.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=openezx-devel@lists.openezx.org \
    --cc=sameo@linux.intel.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;
as well as URLs for NNTP newsgroup(s).