On Sun, Dec 11, 2005 at 10:28:46PM -0500, Dmitry Torokhov wrote:
> Hi,
>
> On Saturday 10 December 2005 13:30, Ville Syrjälä wrote:
> > +
> > + input_regs(idev, regs);
> > + input_event(idev, EV_REL, REL_X, (s8) data[1]);
> > + input_event(idev, EV_REL, REL_Y, (s8) data[2]);
> > + input_sync(idev);
> > +}
>
> We have input_report_rel()
That could be used, but since I couldn't use input_report_key() I
decided not to use this one either.
> > +
> > + input_regs(idev, regs);
> > + input_event(idev, EV_KEY, ati_remote2_key_table[index].key_code,
> > data[1]);
> > + input_sync(idev);
> > +}
>
> And input_report_key()
It won't allow repeat events (data[1] == 2).
> > +static int ati_remote2_input_init(struct ati_remote2 *ar2)
> > +{
> > + struct input_dev *idev;
> > + int i;
> > +
> > + idev = input_allocate_device();
> > + if (!idev)
> > + return -ENOMEM;
> > +
> > + ar2->idev = idev;
> > + idev->private = ar2;
> > +
> > + idev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP) | BIT(EV_REL);
> > + idev->keybit[LONG(BTN_MOUSE)] = BIT(BTN_LEFT) | BIT(BTN_RIGHT);
> > + idev->relbit[0] = BIT(REL_X) | BIT(REL_Y);
> > + for (i = 0; ati_remote2_key_table[i].key_code != KEY_RESERVED; i++)
> > + set_bit(ati_remote2_key_table[i].key_code, idev->keybit);
> > +
> > + idev->rep[REP_DELAY] = 250;
> > + idev->rep[REP_PERIOD] = 33;
>
> Do you disable autorepeat on purpose? Because if you set repeat delay and
> period by yourself you also need to provide your own timer handler.
The hardware provides repeat events itself. I just ignore them if not
enough time has elapsed.
> > obj-$(CONFIG_USB_AIPTEK) += aiptek.o
> > obj-$(CONFIG_USB_ATI_REMOTE) += ati_remote.o
> > +obj-$(CONFIG_USB_ATI_REMOTE2) += ati_remote2.o
>
> I wonder - can these 2 drivers be folded into one? They seem somewhat
> similar...
They are more different than similar IMO.
ati_remote hardware has one interface with one in and one out endpoint.
ati_remote2 hardware has two interfaces with one in endpoint each. That
means the init/exit code would need two code paths.
ati_remote2 hardware handles mouse pad accel and keyboard repeat but
ati_remote (I think) handles them in software. So the event handling
would need two code paths.
--
Ville Syrjälä
[EMAIL PROTECTED]
http://www.sci.fi/~syrjala/
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel