Ticket #3678: touchpad_reset_r29384.diff

File touchpad_reset_r29384.diff, 1.5 KB (added by oco, 11 years ago)
  • ps2_synaptics.c

     
    630630status_t
    631631synaptics_close(void *_cookie)
    632632{
     633    status_t status;
    633634    synaptics_cookie *cookie = _cookie;
    634635
    635636    ps2_dev_command_timeout(cookie->dev, PS2_CMD_DISABLE, NULL, 0, NULL, 0,
     
    641642    atomic_and(&cookie->dev->flags, ~PS2_FLAG_OPEN);
    642643    atomic_and(&cookie->dev->flags, ~PS2_FLAG_ENABLED);
    643644
     645    // Reset the touchpad so it generate standard ps2 packets instead of
     646    // extended ones. If not, BeOS is confused with such packets when rebooting
     647    // without a complete shutdown.
     648    status = ps2_reset_mouse(cookie->dev);
     649    if (status != B_OK) {
     650        INFO("ps2: reset failed\n");
     651        return B_ERROR;
     652    }
     653       
    644654    if (gTouchpadInfo.capPassThrough)
    645655        ps2_service_notify_device_removed(gPassthroughDevice);
    646656
  • ps2_dev.c

     
    6666};
    6767
    6868
    69 static status_t
     69status_t
    7070ps2_reset_mouse(ps2_dev *dev)
    7171{
    7272    uint8 data[2];
  • ps2_dev.h

     
    7474status_t    ps2_dev_command_timeout(ps2_dev *dev, uint8 cmd, const uint8 *out,
    7575                int out_count, uint8 *in, int in_count, bigtime_t timeout);
    7676
     77status_t    ps2_reset_mouse(ps2_dev *dev);
     78
    7779void        ps2_dev_publish(ps2_dev *dev);
    7880void        ps2_dev_unpublish(ps2_dev *dev);
    7981