Add the device resume method to keyboard drivers.
MFC after: 4 weeks
This commit is contained in:
parent
091c568405
commit
d87358963e
@ -53,11 +53,13 @@ devclass_t atkbd_devclass;
|
||||
|
||||
static int atkbdprobe(device_t dev);
|
||||
static int atkbdattach(device_t dev);
|
||||
static int atkbdresume(device_t dev);
|
||||
static void atkbd_isa_intr(void *arg);
|
||||
|
||||
static device_method_t atkbd_methods[] = {
|
||||
DEVMETHOD(device_probe, atkbdprobe),
|
||||
DEVMETHOD(device_attach, atkbdattach),
|
||||
DEVMETHOD(device_resume, atkbdresume),
|
||||
{ 0, 0 }
|
||||
};
|
||||
|
||||
@ -116,6 +118,18 @@ atkbdattach(device_t dev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
atkbdresume(device_t dev)
|
||||
{
|
||||
keyboard_t *kbd;
|
||||
|
||||
kbd = kbd_get_keyboard(kbd_find_keyboard(ATKBD_DRIVER_NAME,
|
||||
device_get_unit(dev)));
|
||||
if (kbd)
|
||||
(*kbdsw[kbd->kb_index]->clear_state)(kbd);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
atkbd_isa_intr(void *arg)
|
||||
{
|
||||
|
@ -53,11 +53,13 @@ devclass_t atkbd_devclass;
|
||||
|
||||
static int atkbdprobe(device_t dev);
|
||||
static int atkbdattach(device_t dev);
|
||||
static int atkbdresume(device_t dev);
|
||||
static void atkbd_isa_intr(void *arg);
|
||||
|
||||
static device_method_t atkbd_methods[] = {
|
||||
DEVMETHOD(device_probe, atkbdprobe),
|
||||
DEVMETHOD(device_attach, atkbdattach),
|
||||
DEVMETHOD(device_resume, atkbdresume),
|
||||
{ 0, 0 }
|
||||
};
|
||||
|
||||
@ -116,6 +118,18 @@ atkbdattach(device_t dev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
atkbdresume(device_t dev)
|
||||
{
|
||||
keyboard_t *kbd;
|
||||
|
||||
kbd = kbd_get_keyboard(kbd_find_keyboard(ATKBD_DRIVER_NAME,
|
||||
device_get_unit(dev)));
|
||||
if (kbd)
|
||||
(*kbdsw[kbd->kb_index]->clear_state)(kbd);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
atkbd_isa_intr(void *arg)
|
||||
{
|
||||
|
@ -113,10 +113,11 @@ typedef struct ukbd_softc {
|
||||
typedef void usbd_intr_t(usbd_xfer_handle, usbd_private_handle, usbd_status);
|
||||
typedef void usbd_disco_t(void *);
|
||||
|
||||
Static int ukbd_resume(device_t self);
|
||||
Static usbd_intr_t ukbd_intr;
|
||||
Static int ukbd_driver_load(module_t mod, int what, void *arg);
|
||||
|
||||
USB_DECLARE_DRIVER(ukbd);
|
||||
USB_DECLARE_DRIVER_INIT(ukbd, DEVMETHOD(device_resume, ukbd_resume));
|
||||
|
||||
USB_MATCH(ukbd)
|
||||
{
|
||||
@ -207,6 +208,18 @@ ukbd_detach(device_t self)
|
||||
return (0);
|
||||
}
|
||||
|
||||
Static int
|
||||
ukbd_resume(device_t self)
|
||||
{
|
||||
keyboard_t *kbd;
|
||||
|
||||
kbd = kbd_get_keyboard(kbd_find_keyboard(DRIVER_NAME,
|
||||
device_get_unit(self)));
|
||||
if (kbd)
|
||||
(*kbdsw[kbd->kb_index]->clear_state)(kbd);
|
||||
return (0);
|
||||
}
|
||||
|
||||
void
|
||||
ukbd_intr(usbd_xfer_handle xfer, usbd_private_handle addr, usbd_status status)
|
||||
{
|
||||
|
@ -53,11 +53,13 @@ devclass_t atkbd_devclass;
|
||||
|
||||
static int atkbdprobe(device_t dev);
|
||||
static int atkbdattach(device_t dev);
|
||||
static int atkbdresume(device_t dev);
|
||||
static void atkbd_isa_intr(void *arg);
|
||||
|
||||
static device_method_t atkbd_methods[] = {
|
||||
DEVMETHOD(device_probe, atkbdprobe),
|
||||
DEVMETHOD(device_attach, atkbdattach),
|
||||
DEVMETHOD(device_resume, atkbdresume),
|
||||
{ 0, 0 }
|
||||
};
|
||||
|
||||
@ -116,6 +118,18 @@ atkbdattach(device_t dev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
atkbdresume(device_t dev)
|
||||
{
|
||||
keyboard_t *kbd;
|
||||
|
||||
kbd = kbd_get_keyboard(kbd_find_keyboard(ATKBD_DRIVER_NAME,
|
||||
device_get_unit(dev)));
|
||||
if (kbd)
|
||||
(*kbdsw[kbd->kb_index]->clear_state)(kbd);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
atkbd_isa_intr(void *arg)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user