// SPDX-License-Identifier: GPL-2.0-only /* * Toshiba Bluetooth Enable Driver * * Copyright (C) 2009 Jes Sorensen <Jes.Sorensen@gmail.com> * Copyright (C) 2015 Azael Avalos <coproscefalo@gmail.com> * * Thanks to Matthew Garrett for background info on ACPI innards which * normal people aren't meant to understand :-)
*/
/* * Some Toshiba laptops may have a fake TOS6205 device in * their ACPI BIOS, so query the _STA method to see if there * is really anything there.
*/
result = acpi_evaluate_integer(handle, "_STA", NULL, &bt_present); if (ACPI_FAILURE(result)) {
pr_err("ACPI call to query Bluetooth presence failed\n"); return -ENXIO;
}
if (!bt_present) {
pr_info("Bluetooth device not present\n"); return -ENODEV;
}
result = acpi_evaluate_integer(handle, "BTST", NULL, &status); if (ACPI_FAILURE(result)) {
pr_err("Could not get Bluetooth device status\n"); return -ENXIO;
}
result = acpi_evaluate_object(handle, "AUSB", NULL, NULL); if (ACPI_FAILURE(result)) {
pr_err("Could not attach USB Bluetooth device\n"); return -ENXIO;
}
result = acpi_evaluate_object(handle, "BTPO", NULL, NULL); if (ACPI_FAILURE(result)) {
pr_err("Could not power ON Bluetooth device\n"); return -ENXIO;
}
result = acpi_evaluate_object(handle, "BTPF", NULL, NULL); if (ACPI_FAILURE(result)) {
pr_err("Could not power OFF Bluetooth device\n"); return -ENXIO;
}
result = acpi_evaluate_object(handle, "DUSB", NULL, NULL); if (ACPI_FAILURE(result)) {
pr_err("Could not detach USB Bluetooth device\n"); return -ENXIO;
}
return 0;
}
/* Helper function */ staticint toshiba_bluetooth_sync_status(struct toshiba_bluetooth_dev *bt_dev)
{ int status;
status = toshiba_bluetooth_status(bt_dev->acpi_dev->handle); if (status < 0) {
pr_err("Could not sync bluetooth device status\n"); return status;
}
if (toshiba_bluetooth_sync_status(bt_dev)) return;
/* * Note the Toshiba Bluetooth RFKill switch seems to be a strange * fish. It only provides a BT event when the switch is flipped to * the 'on' position. When flipping it to 'off', the USB device is * simply pulled away underneath us, without any BT event being * delivered.
*/
rfkill_set_hw_state(bt_dev->rfk, !bt_dev->killswitch);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.