Date: Tue, 15 Jul 2014 10:34:21 +0000 (UTC) From: Jakub Wojciech Klama <jceel@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r268665 - user/jceel/soc2014_evdev/head/sys/dev/usb/input Message-ID: <201407151034.s6FAYL6a084598@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jceel Date: Tue Jul 15 10:34:21 2014 New Revision: 268665 URL: http://svnweb.freebsd.org/changeset/base/268665 Log: Properly #ifdef evdev-related code. Modified: user/jceel/soc2014_evdev/head/sys/dev/usb/input/ukbd.c Modified: user/jceel/soc2014_evdev/head/sys/dev/usb/input/ukbd.c ============================================================================== --- user/jceel/soc2014_evdev/head/sys/dev/usb/input/ukbd.c Tue Jul 15 10:07:05 2014 (r268664) +++ user/jceel/soc2014_evdev/head/sys/dev/usb/input/ukbd.c Tue Jul 15 10:34:21 2014 (r268665) @@ -172,7 +172,7 @@ struct ukbd_softc { struct usb_xfer *sc_xfer[UKBD_N_TRANSFER]; #ifdef EVDEV struct evdev_dev *sc_evdev; -#endif /* EVDEV */ +#endif uint32_t sc_ntime[UKBD_NKEYCODE]; uint32_t sc_otime[UKBD_NKEYCODE]; @@ -382,9 +382,10 @@ static device_probe_t ukbd_probe; static device_attach_t ukbd_attach; static device_detach_t ukbd_detach; static device_resume_t ukbd_resume; -static evdev_event_t ukbd_ev_event; #ifdef EVDEV +static evdev_event_t ukbd_ev_event; + static struct evdev_methods ukbd_evdev_methods = { .ev_open = NULL, .ev_close = NULL, @@ -1425,6 +1426,7 @@ ukbd_resume(device_t dev) return (0); } +#ifdef EVDEV static void ukbd_ev_event(struct evdev_dev *evdev, void *softc, uint16_t type, uint16_t code, int32_t value) @@ -1437,6 +1439,7 @@ ukbd_ev_event(struct evdev_dev *evdev, v if (type == EV_REP && code == REP_PERIOD) sc->sc_kbd.kb_delay2 = value; } +#endif /* early keyboard probe, not supported */ static int @@ -1937,10 +1940,12 @@ ukbd_ioctl_locked(keyboard_t *kbd, u_lon else kbd->kb_delay1 = ((int *)arg)[0]; kbd->kb_delay2 = ((int *)arg)[1]; +#ifdef EVDEV evdev_set_repeat_params(sc->sc_evdev, REP_DELAY, kbd->kb_delay1); evdev_set_repeat_params(sc->sc_evdev, REP_PERIOD, kbd->kb_delay2); +#endif return (0); #if defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD5) || \ @@ -2080,7 +2085,9 @@ ukbd_set_leds(struct ukbd_softc *sc, uin static int ukbd_set_typematic(keyboard_t *kbd, int code) { +#ifdef EVDEV struct ukbd_softc *sc = kbd->kb_data; +#endif static const int delays[] = {250, 500, 750, 1000}; static const int rates[] = {34, 38, 42, 46, 50, 55, 59, 63, 68, 76, 84, 92, 100, 110, 118, 126, @@ -2092,8 +2099,10 @@ ukbd_set_typematic(keyboard_t *kbd, int } kbd->kb_delay1 = delays[(code >> 5) & 3]; kbd->kb_delay2 = rates[code & 0x1f]; +#ifdef EVDEV evdev_set_repeat_params(sc->sc_evdev, REP_DELAY, kbd->kb_delay1); evdev_set_repeat_params(sc->sc_evdev, REP_PERIOD, kbd->kb_delay2); +#endif return (0); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201407151034.s6FAYL6a084598>