From fe2ef61f84352e632996d788063e6acd1d38759b Mon Sep 17 00:00:00 2001 From: OBattler Date: Wed, 23 May 2018 15:47:35 +0200 Subject: [PATCH] Attempt to fix Logitech Bus mouse. --- src/mouse_bus.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/mouse_bus.c b/src/mouse_bus.c index 40b0b2b48..c64f5c433 100644 --- a/src/mouse_bus.c +++ b/src/mouse_bus.c @@ -49,7 +49,7 @@ * * Based on an early driver for MINIX 1.5. * - * Version: @(#)mouse_bus.c 1.0.37 2018/05/22 + * Version: @(#)mouse_bus.c 1.0.38 2018/05/23 * * Authors: Fred N. van Kempen, * @@ -454,7 +454,7 @@ lt_write(mouse_t *dev, uint16_t port, uint8_t val) } /* Save new register value. */ - dev->r_ctrl = val; + dev->r_ctrl = val | 0x0F; /* Clear any pending interrupts. */ picintc(1 << dev->irq); @@ -560,24 +560,25 @@ lt_read(mouse_t *dev, uint16_t port) break; case LTMOUSE_CTRL: /* [02] control register */ - ret = 0x0f; - if (!(dev->r_ctrl & LTCTRL_IDIS) && (dev->seq > 0x3FF) && lt_read_int(dev)) { + ret = dev->r_ctrl; + dev->r_ctrl |= 0x0F; + if ((dev->seq > 0x3FF) && lt_read_int(dev)) { /* !IDIS, return DIP switch setting. */ switch(dev->irq) { case 2: - ret &= ~0x08; + dev->r_ctrl &= ~0x08; break; case 3: - ret &= ~0x04; + dev->r_ctrl &= ~0x04; break; case 4: - ret &= ~0x02; + dev->r_ctrl &= ~0x02; break; case 5: - ret &= ~0x01; + dev->r_ctrl &= ~0x01; break; } }