aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform/x86/toshiba_bluetooth.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2016-09-23platform/x86: toshiba_bluetooth: Decouple an error checking status codeAzael Avalos1-1/+3
This patch simply decouples the error checking of the ACPI status and the actual BT status, as those two were nested in an if/else check, but are completely unrelated. Signed-off-by: Azael Avalos <coproscefalo@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2015-11-20toshiba_bluetooth: Add missing newline in toshiba_bluetooth_present functionAzael Avalos1-1/+1
This patch simply adds a missing newline in the error string printed by the toshiba_bluetooth_present function. This is just a cosmetic change, no functionality was changed. Signed-off-by: Azael Avalos <coproscefalo@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2015-05-11toshiba_bluetooth: Change BT status message to debugAzael Avalos1-2/+3
The function toshiba_bluetooth_status is currently printing the status of the device whenever it is queried, but since the introduction of the rfkill poll code, this value will get printed everytime the poll occurs. This patch removes the status message from the *_status function, and adds a debug message to the *_sync_status function printing the bluetooth device raw status, killswitch, plug and power states of the device as well. Signed-off-by: Azael Avalos <coproscefalo@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2015-05-06toshiba_bluetooth: Adapt *_enable, *_notify and *_resume functions to rfkillAzael Avalos1-29/+18
This patch adapts toshiba_bluetooth_enable, toshiba_bt_rfkill_notify and toshiba_bt_resume functions to rfkill. The *_enable function was cleaned from code that the rfkill code now provides, and the other two functions were modified to update the rfkill switch status, as they were only calling toshiba_bluetooth_enable. Signed-off-by: Azael Avalos <coproscefalo@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2015-05-06toshiba_bluetooth: Add RFKill handler functionsAzael Avalos1-9/+68
This patch adds RFKill handler functions to the driver, allowing it to register and update the rfkill switch status. Also, a comment block was moved from the header to the poll function, as it explains why we need to poll the killswitch on older devices. Signed-off-by: Azael Avalos <coproscefalo@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2015-05-06toshiba_bluetooth: Add a container struct named toshiba_bluetooth_devAzael Avalos1-1/+46
This patch adds a struct named toshiba_bluetooth_dev, which will be used to contain the acpi_device struct and bluetooth status booleans. This struct will also be used by later patches to store the rfkill struct as well. Also, a helper function named toshiba_bluetooth_sync_status was added to be also used by upcomming patches. Signed-off-by: Azael Avalos <coproscefalo@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2015-03-26toshiba_bluetooth: Fix enabling/disabling loop on recent devicesAzael Avalos1-13/+37
Bug 93911 reported a broken handling of the BT device, causing the driver to get stuck in a loop enabling/disabling the device whenever the device is deactivated by the kill switch as follows: 1. The user activated the kill switch, causing the system to generate a 0x90 (status change) event and disabling the BT device. 2. The driver catches the event and re-enables the BT device. 3. The system detects the device being activated, but since the kill switch is activated, disables the BT device (again) and generates a 0x90 event (again). 4. Repeat from 2. This patch adds an extra check to verify the status of the BT device, returning silently if it is already activated. Also, checks and returns appropriate error values while evaluating the AUSB and BTPO methods. Signed-off-by: Azael Avalos <coproscefalo@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2015-03-26toshiba_bluetooth: Clean up *_add function and disable BT device at removalAzael Avalos1-16/+16
This patch cleans the toshiba_bluetooth_add function by using the recently introduced function toshiba_bluetooth_present, simplifying its code and returning appropriate error values. Also, disables the BT device at the removal of the driver, by using the function toshiba_bluetooth_disable. Signed-off-by: Azael Avalos <coproscefalo@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2015-03-26toshiba_bluetooth: Add three new functions to the driverAzael Avalos1-0/+51
This patch introduces three new functions, which are going to be used by the next patches. The functions introduced are toshiba_bluetooth_present, toshiba_bluetooth_status and toshiba_bluetooth_disable, which queries the presence of the device, queries the status and disables the device respectively. Signed-off-by: Azael Avalos <coproscefalo@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2013-12-07ACPI: Clean up inclusions of ACPI header filesLv Zheng1-3/+1
Replace direct inclusions of <acpi/acpi.h>, <acpi/acpi_bus.h> and <acpi/acpi_drivers.h>, which are incorrect, with <linux/acpi.h> inclusions and remove some inclusions of those files that aren't necessary. First of all, <acpi/acpi.h>, <acpi/acpi_bus.h> and <acpi/acpi_drivers.h> should not be included directly from any files that are built for CONFIG_ACPI unset, because that generally leads to build warnings about undefined symbols in !CONFIG_ACPI builds. For CONFIG_ACPI set, <linux/acpi.h> includes those files and for CONFIG_ACPI unset it provides stub ACPI symbols to be used in that case. Second, there are ordering dependencies between those files that always have to be met. Namely, it is required that <acpi/acpi_bus.h> be included prior to <acpi/acpi_drivers.h> so that the acpi_pci_root declarations the latter depends on are always there. And <acpi/acpi.h> which provides basic ACPICA type declarations should always be included prior to any other ACPI headers in CONFIG_ACPI builds. That also is taken care of including <linux/acpi.h> as appropriate. Signed-off-by: Lv Zheng <lv.zheng@intel.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Matthew Garrett <mjg59@srcf.ucam.org> Cc: Tony Luck <tony.luck@intel.com> Cc: "H. Peter Anvin" <hpa@zytor.com> Acked-by: Bjorn Helgaas <bhelgaas@google.com> (drivers/pci stuff) Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> (Xen stuff) Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2013-01-26ACPI: Remove useless type argument of driver .remove() operationRafael J. Wysocki1-2/+2
The second argument of ACPI driver .remove() operation is only used by the ACPI processor driver and the value passed to that driver through it is always available from the given struct acpi_device object's removal_type field. For this reason, the second ACPI driver .remove() argument is in fact useless, so drop it. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Reviewed-by: Jiang Liu <jiang.liu@huawei.com> Acked-by: Toshi Kani <toshi.kani@hp.com> Acked-by: Yinghai Lu <yinghai@kernel.org>
2012-09-21toshiba_bluetooth: convert to module_acpi_driver()Mika Westerberg1-21/+1
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2012-08-10platform / x86 / PM: Fix unused function warnings for CONFIG_PM_SLEEPRafael J. Wysocki1-0/+4
According to compiler warnings, quite some suspend/resume functions in platform x86 drivers are not used for CONFIG_PM_SLEEP unset, so add #ifdefs to prevent them from being built in that case. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2012-07-01toshiba_bluetooth: Use struct dev_pm_ops for power managementRafael J. Wysocki1-4/+6
Make the toshiba_bluetooth driver define its PM callbacks through a struct dev_pm_ops object rather than by using legacy PM hooks in struct acpi_device_ops. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Reviewed-by: Vikram Dhillon <opensolarisdev@gmail.com>
2011-05-27toshiba: Convert printks to pr_<level>Joe Perches1-5/+6
Add pr_fmt. Remove local MY_<foo> #defines. Convert printks to pr_<level>. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-01-28ACPI: replace acpi_integer by u64Lin Ming1-2/+2
acpi_integer is now obsolete and removed from the ACPICA code base, replaced by u64. Signed-off-by: Lin Ming <ming.m.lin@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2009-12-16Toshiba Bluetooth Enabling driver (RFKill handler v3)Jes Sorensen1-0/+144
This patch adds support for the ACPI events generated by the RFKill switch on modern Toshiba laptops, and re-enables the Bluetooth USB device when the switch is flipped back to the 'on' position. The RFKill switch brute force pulls out the USB device when flipped to 'off', but it doesn't automatically re-enable it. Without this driver, the Bluetooth is gone until after a reboot on my Portege R500. Signed-off-by: Jes Sorensen <Jes.Sorensen@gmail.com> Signed-off-by: Len Brown <len.brown@intel.com>