From: Marcin Slusarz <marcin.slusarz@gmail.com>
To: Pau Oliva Fora <pau@eslack.org>
Cc: dmitry.torokhov@gmail.com, sam@ravnborg.org,
penberg@cs.helsinki.fi, linux-input@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Add support for HTC Shift Touchscreen
Date: Sun, 18 May 2008 11:26:50 +0200 [thread overview]
Message-ID: <20080518092627.GA21237@joi> (raw)
In-Reply-To: <482F09FC.9050403@eslack.org>
On Sat, May 17, 2008 at 06:38:20PM +0200, Pau Oliva Fora wrote:
> +static int __init htcpen_init(void)
> +{
> + int err;
> +
> + printk(KERN_INFO "htcpen: module inserted\n");
> +
> + inb_p(HTCPEN_PORT_IRQ_CLEAR);
> +
> + htcpen_dev = input_allocate_device();
> + if (!htcpen_dev) {
> + printk(KERN_ERR "htcpen: can't allocate device\n");
> + err = -ENOMEM;
> + goto fail1;
htcpen_dev is null here, so no need to call input_free_device
> + }
> +
> + htcpen_dev->name = "HTC Pen TouchScreen";
> + htcpen_dev->id.bustype = BUS_ISA;
> + htcpen_dev->id.vendor = 0;
> + htcpen_dev->id.product = 0;
> + htcpen_dev->id.version = 0;
> +
> + input_set_abs_params(htcpen_dev, ABS_X, 0, X_AXIS_MAX, 0, 0);
> + input_set_abs_params(htcpen_dev, ABS_Y, 0, Y_AXIS_MAX, 0, 0);
> +
> + htcpen_dev->evbit[0] = BIT_MASK(EV_ABS) | BIT_MASK(EV_KEY);
> + htcpen_dev->absbit[0] = BIT_MASK(ABS_X) | BIT_MASK(ABS_Y);
> + htcpen_dev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH);
> +
> + err = request_irq(HTCPEN_IRQ, htcpen_interrupt, 0, "htcpen",
> + htcpen_dev);
> + if (err) {
> + printk(KERN_ERR "htcpen: irq busy\n");
> + err = -EBUSY;
> + goto fail1;
> + }
> +
> + err = input_register_device(htcpen_dev);
> + if (err)
> + goto fail2;
> +
> + outb_p(DEVICE_ENABLE, HTCPEN_PORT_INIT);
> +
> + return 0;
> +
> + fail2: free_irq(HTCPEN_IRQ, htcpen_dev);
> + fail1: input_free_device(htcpen_dev);
> + return err;
> +}
> +
> +static void __exit htcpen_exit(void)
> +{
> + input_unregister_device(htcpen_dev);
> + free_irq(HTCPEN_IRQ, htcpen_dev);
input_free_device ?
> + printk(KERN_INFO "htcpen: module removed\n");
> +}
Marcin
next prev parent reply other threads:[~2008-05-18 9:27 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-17 12:44 [PATCH] Add support for HTC Shift Touchscreen Pau Oliva Fora
2008-05-17 13:01 ` Sam Ravnborg
2008-05-17 13:02 ` Pekka Enberg
2008-05-17 16:38 ` Pau Oliva Fora
2008-05-18 9:26 ` Marcin Slusarz [this message]
2008-05-18 9:39 ` Pekka Enberg
2008-05-19 3:16 ` Pau Oliva Fora
2008-05-19 5:22 ` Pekka Enberg
2008-05-19 15:12 ` Pau Oliva Fora
2008-05-19 15:35 ` Dmitry Torokhov
2008-05-19 23:08 ` Pau Oliva Fora
2008-05-20 1:49 ` Dmitry Torokhov
2008-05-20 11:02 ` Pau Oliva Fora
2008-05-20 13:54 ` Dmitry Torokhov
2008-05-20 19:09 ` Pau Oliva Fora
2008-05-22 0:47 ` Pau Oliva Fora
2008-05-20 12:37 ` Andrey Panin
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=20080518092627.GA21237@joi \
--to=marcin.slusarz@gmail.com \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pau@eslack.org \
--cc=penberg@cs.helsinki.fi \
--cc=sam@ravnborg.org \
/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).