Date: Sun, 22 Dec 2019 17:15:51 +0000 (UTC) From: Kyle Evans <kevans@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r356013 - in stable: 11/sys/arm/samsung/exynos 11/sys/dev/adb 11/sys/dev/atkbdc 11/sys/dev/gpio 11/sys/dev/hyperv/input 11/sys/dev/kbd 11/sys/dev/kbdmux 11/sys/dev/uart 11/sys/dev/usb/i... Message-ID: <201912221715.xBMHFpV5055321@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kevans Date: Sun Dec 22 17:15:48 2019 New Revision: 356013 URL: https://svnweb.freebsd.org/changeset/base/356013 Log: MFC r355796-r355797, r355799: kbd: defaults for get_fkeystr/diag The genkbd version of these remains exposed for stable branches, but keyboard drivers that just want to use the defaults can simply not provide their own. There shouldn't be any unset in the wild. r355796: kbd: provide default implementations of get_fkeystr/diag Most keyboard drivers are using the genkbd implementations as it is; formally use them for any that aren't set. r355797: chrome_kb: remove default get_fkeystr/diag implementations This file was missed in r355796, but no harm would have come from this. r355799: kbd: patch linker set methods, too This is needed after r355796. Some double-registration of kbd drivers needs to be sorted out, then this sysinit will simply add these drivers into the normal list and kill off any other bits in the driver that are aware of the linker set, for simplicity. Modified: stable/12/sys/arm/samsung/exynos/chrome_kb.c stable/12/sys/dev/adb/adb_kbd.c stable/12/sys/dev/atkbdc/atkbd.c stable/12/sys/dev/gpio/gpiokeys.c stable/12/sys/dev/hyperv/input/hv_kbd.c stable/12/sys/dev/kbd/kbd.c stable/12/sys/dev/kbdmux/kbdmux.c stable/12/sys/dev/uart/uart_kbd_sun.c stable/12/sys/dev/usb/input/ukbd.c stable/12/sys/dev/vkbd/vkbd.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/arm/samsung/exynos/chrome_kb.c stable/11/sys/dev/adb/adb_kbd.c stable/11/sys/dev/atkbdc/atkbd.c stable/11/sys/dev/gpio/gpiokeys.c stable/11/sys/dev/hyperv/input/hv_kbd.c stable/11/sys/dev/kbd/kbd.c stable/11/sys/dev/kbdmux/kbdmux.c stable/11/sys/dev/uart/uart_kbd_sun.c stable/11/sys/dev/usb/input/ukbd.c stable/11/sys/dev/vkbd/vkbd.c Directory Properties: stable/11/ (props changed) Modified: stable/12/sys/arm/samsung/exynos/chrome_kb.c ============================================================================== --- stable/12/sys/arm/samsung/exynos/chrome_kb.c Sun Dec 22 17:06:56 2019 (r356012) +++ stable/12/sys/arm/samsung/exynos/chrome_kb.c Sun Dec 22 17:15:48 2019 (r356013) @@ -663,9 +663,7 @@ keyboard_switch_t ckbdsw = { .clear_state = &ckb_clear_state, .get_state = &ckb_get_state, .set_state = &ckb_set_state, - .get_fkeystr = &genkbd_get_fkeystr, .poll = &ckb_poll, - .diag = &genkbd_diag, }; static int Modified: stable/12/sys/dev/adb/adb_kbd.c ============================================================================== --- stable/12/sys/dev/adb/adb_kbd.c Sun Dec 22 17:06:56 2019 (r356012) +++ stable/12/sys/dev/adb/adb_kbd.c Sun Dec 22 17:15:48 2019 (r356013) @@ -212,9 +212,7 @@ keyboard_switch_t akbdsw = { .clear_state = akbd_clear_state, .get_state = akbd_get_state, .set_state = akbd_set_state, - .get_fkeystr = genkbd_get_fkeystr, .poll = akbd_poll, - .diag = genkbd_diag, }; KEYBOARD_DRIVER(akbd, akbdsw, akbd_configure); Modified: stable/12/sys/dev/atkbdc/atkbd.c ============================================================================== --- stable/12/sys/dev/atkbdc/atkbd.c Sun Dec 22 17:06:56 2019 (r356012) +++ stable/12/sys/dev/atkbdc/atkbd.c Sun Dec 22 17:15:48 2019 (r356013) @@ -247,9 +247,7 @@ static keyboard_switch_t atkbdsw = { .clear_state = atkbd_clear_state, .get_state = atkbd_get_state, .set_state = atkbd_set_state, - .get_fkeystr = genkbd_get_fkeystr, .poll = atkbd_poll, - .diag = genkbd_diag, }; KEYBOARD_DRIVER(atkbd, atkbdsw, atkbd_configure); Modified: stable/12/sys/dev/gpio/gpiokeys.c ============================================================================== --- stable/12/sys/dev/gpio/gpiokeys.c Sun Dec 22 17:06:56 2019 (r356012) +++ stable/12/sys/dev/gpio/gpiokeys.c Sun Dec 22 17:15:48 2019 (r356013) @@ -976,9 +976,7 @@ static keyboard_switch_t gpiokeyssw = { .clear_state = &gpiokeys_clear_state, .get_state = &gpiokeys_get_state, .set_state = &gpiokeys_set_state, - .get_fkeystr = &genkbd_get_fkeystr, .poll = &gpiokeys_poll, - .diag = &genkbd_diag, }; KEYBOARD_DRIVER(gpiokeys, gpiokeyssw, gpiokeys_configure); Modified: stable/12/sys/dev/hyperv/input/hv_kbd.c ============================================================================== --- stable/12/sys/dev/hyperv/input/hv_kbd.c Sun Dec 22 17:06:56 2019 (r356012) +++ stable/12/sys/dev/hyperv/input/hv_kbd.c Sun Dec 22 17:15:48 2019 (r356013) @@ -462,9 +462,7 @@ static keyboard_switch_t hvkbdsw = { .clear_state = hvkbd_clear_state, .get_state = hvkbd_get_state, /* not used */ .set_state = hvkbd_set_state, /* not used */ - .get_fkeystr = genkbd_get_fkeystr, .poll = hvkbd_poll, - .diag = genkbd_diag, }; KEYBOARD_DRIVER(hvkbd, hvkbdsw, hvkbd_configure); Modified: stable/12/sys/dev/kbd/kbd.c ============================================================================== --- stable/12/sys/dev/kbd/kbd.c Sun Dec 22 17:06:56 2019 (r356012) +++ stable/12/sys/dev/kbd/kbd.c Sun Dec 22 17:15:48 2019 (r356013) @@ -176,6 +176,10 @@ kbd_add_driver(keyboard_driver_t *driver) { if (SLIST_NEXT(driver, link)) return (EINVAL); + if (driver->kbdsw->get_fkeystr == NULL) + driver->kbdsw->get_fkeystr = genkbd_get_fkeystr; + if (driver->kbdsw->diag == NULL) + driver->kbdsw->diag = genkbd_diag; SLIST_INSERT_HEAD(&keyboard_drivers, driver, link); return (0); } @@ -1514,3 +1518,20 @@ kbd_ev_event(keyboard_t *kbd, uint16_t type, uint16_t kbdd_ioctl(kbd, KDSETREPEAT, (caddr_t)delay); } } + +static void +kbd_drv_init(void) +{ + const keyboard_driver_t **list; + const keyboard_driver_t *p; + + SET_FOREACH(list, kbddriver_set) { + p = *list; + if (p->kbdsw->get_fkeystr == NULL) + p->kbdsw->get_fkeystr = genkbd_get_fkeystr; + if (p->kbdsw->diag == NULL) + p->kbdsw->diag = genkbd_diag; + } +} + +SYSINIT(kbd_drv_init, SI_SUB_DRIVERS, SI_ORDER_FIRST, kbd_drv_init, NULL); Modified: stable/12/sys/dev/kbdmux/kbdmux.c ============================================================================== --- stable/12/sys/dev/kbdmux/kbdmux.c Sun Dec 22 17:06:56 2019 (r356012) +++ stable/12/sys/dev/kbdmux/kbdmux.c Sun Dec 22 17:15:48 2019 (r356013) @@ -378,9 +378,7 @@ static keyboard_switch_t kbdmuxsw = { .clear_state = kbdmux_clear_state, .get_state = kbdmux_get_state, .set_state = kbdmux_set_state, - .get_fkeystr = genkbd_get_fkeystr, .poll = kbdmux_poll, - .diag = genkbd_diag, }; #ifdef EVDEV_SUPPORT Modified: stable/12/sys/dev/uart/uart_kbd_sun.c ============================================================================== --- stable/12/sys/dev/uart/uart_kbd_sun.c Sun Dec 22 17:06:56 2019 (r356012) +++ stable/12/sys/dev/uart/uart_kbd_sun.c Sun Dec 22 17:15:48 2019 (r356013) @@ -134,7 +134,6 @@ static keyboard_switch_t sunkbdsw = { .clear_state = sunkbd_clear_state, .get_state = sunkbd_get_state, .set_state = sunkbd_set_state, - .get_fkeystr = genkbd_get_fkeystr, .poll = sunkbd_poll_mode, .diag = sunkbd_diag }; Modified: stable/12/sys/dev/usb/input/ukbd.c ============================================================================== --- stable/12/sys/dev/usb/input/ukbd.c Sun Dec 22 17:06:56 2019 (r356012) +++ stable/12/sys/dev/usb/input/ukbd.c Sun Dec 22 17:15:48 2019 (r356013) @@ -2283,9 +2283,7 @@ static keyboard_switch_t ukbdsw = { .clear_state = &ukbd_clear_state, .get_state = &ukbd_get_state, .set_state = &ukbd_set_state, - .get_fkeystr = &genkbd_get_fkeystr, .poll = &ukbd_poll, - .diag = &genkbd_diag, }; KEYBOARD_DRIVER(ukbd, ukbdsw, ukbd_configure); Modified: stable/12/sys/dev/vkbd/vkbd.c ============================================================================== --- stable/12/sys/dev/vkbd/vkbd.c Sun Dec 22 17:06:56 2019 (r356012) +++ stable/12/sys/dev/vkbd/vkbd.c Sun Dec 22 17:15:48 2019 (r356013) @@ -578,9 +578,7 @@ static keyboard_switch_t vkbdsw = { .clear_state = vkbd_clear_state, .get_state = vkbd_get_state, .set_state = vkbd_set_state, - .get_fkeystr = genkbd_get_fkeystr, .poll = vkbd_poll, - .diag = genkbd_diag, }; static int typematic(int delay, int rate);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201912221715.xBMHFpV5055321>