On Sunday 11 December 2005 23:40, Ville Syrjälä wrote: > 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. >
OK... > > > + > > > + 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). > Right... > > > +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. > But you can't control hardware repeat rate, can you? If you leave that to input core user can control the delay and repeat rate. > > > 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. > I am not convinced that we should rely on hardware repeat. As fas as initializationm goes you could attach driver-specific data controlling initialization to the device ID table. That would unclutter init/exit routine while allowing sharing bunch of the code. -- Dmitry ------------------------------------------------------- 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 _______________________________________________ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel