attempt to fix bug #1185
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20883 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -108,6 +108,20 @@ ps2_flush(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static status_t
|
||||||
|
ps2_selftest()
|
||||||
|
{
|
||||||
|
status_t res;
|
||||||
|
uint8 in;
|
||||||
|
res = ps2_command(PS2_CTRL_SELF_TEST, NULL, 0, &in, 1);
|
||||||
|
if (res != B_OK || in != 0x55) {
|
||||||
|
INFO("ps2: controller self test failed, status 0x%08lx, data 0x%02x\n", res, in);
|
||||||
|
return B_ERROR;
|
||||||
|
}
|
||||||
|
return B_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static status_t
|
static status_t
|
||||||
ps2_setup_command_byte()
|
ps2_setup_command_byte()
|
||||||
{
|
{
|
||||||
@@ -171,11 +185,13 @@ ps2_setup_active_multiplexing(bool *enabled)
|
|||||||
|
|
||||||
INFO("ps2: active multiplexing v%d.%d enabled\n", (in >> 4), in & 0xf);
|
INFO("ps2: active multiplexing v%d.%d enabled\n", (in >> 4), in & 0xf);
|
||||||
*enabled = true;
|
*enabled = true;
|
||||||
return B_OK;
|
goto done;
|
||||||
|
|
||||||
no_support:
|
no_support:
|
||||||
TRACE("ps2: active multiplexing not supported\n");
|
TRACE("ps2: active multiplexing not supported\n");
|
||||||
*enabled = false;
|
*enabled = false;
|
||||||
|
|
||||||
|
done:
|
||||||
// Some controllers get upset by the d3 command and will continue data loopback,
|
// Some controllers get upset by the d3 command and will continue data loopback,
|
||||||
// thus we need to send a harmless command (enable keyboard interface) next
|
// thus we need to send a harmless command (enable keyboard interface) next
|
||||||
// This fixes bug report #1175
|
// This fixes bug report #1175
|
||||||
@@ -190,9 +206,9 @@ fail:
|
|||||||
*enabled = false;
|
*enabled = false;
|
||||||
// this should revert the controller into legacy mode,
|
// this should revert the controller into legacy mode,
|
||||||
// just in case it has switched to multiplexed mode
|
// just in case it has switched to multiplexed mode
|
||||||
res = ps2_command(PS2_CTRL_SELF_TEST, NULL, 0, &out, 1);
|
res = ps2_command(PS2_CTRL_SELF_TEST, NULL, 0, &in, 1);
|
||||||
if (res != B_OK || out != 0x55) {
|
if (res != B_OK || in != 0x55) {
|
||||||
INFO("ps2: controller self test failed, status 0x%08lx, data 0x%02x\n", res, out);
|
INFO("ps2: controller self test failed, status 0x%08lx, data 0x%02x\n", res, in);
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
}
|
}
|
||||||
return B_OK;
|
return B_OK;
|
||||||
@@ -329,6 +345,8 @@ ps2_init(void)
|
|||||||
status = install_io_interrupt_handler(INT_PS2_MOUSE, &ps2_interrupt, NULL, 0);
|
status = install_io_interrupt_handler(INT_PS2_MOUSE, &ps2_interrupt, NULL, 0);
|
||||||
if (status)
|
if (status)
|
||||||
goto err4;
|
goto err4;
|
||||||
|
|
||||||
|
ps2_selftest();
|
||||||
|
|
||||||
status = ps2_setup_command_byte();
|
status = ps2_setup_command_byte();
|
||||||
if (status) {
|
if (status) {
|
||||||
|
|||||||
Reference in New Issue
Block a user