aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/bluetooth/hci_intel.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2016-07-11Bluetooth: hci_intel: Remove LPM enabling from setup procedureLoic Poulain1-21/+7
LPM can be enabled via a DDC write command at specific DDC ID. As any other DDC value, this is up to the DDC config file to include (or not) the low power mode configuration. Signed-off-by: Loic Poulain <loic.poulain@gmail.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2016-05-02Bluetooth: hci_intel: Fix null gpio desc pointer dereferenceLoic Poulain1-4/+2
gpiod_get_optional can return either ERR_PTR or NULL pointer. NULL case is not tested and then dereferenced later in desc_to_gpio. Fix this by using non optional version which returns ERR_PTR in any error case (this is not an optional gpio). Use the same non optional version for the host-wake gpio. Fixes: 765ea3abd116 ("Bluetooth: hci_intel: Retrieve host-wake IRQ") Signed-off-by: Loic Poulain <loic.poulain@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2016-02-23Bluetooth: hci_intel: Fix a wrong comparisonAnton Protopopov1-2/+2
A return value of the intel_wait_booting() function compared with a constant ETIMEDOUT instead of -ETIMEDOUT. Signed-off-by: Anton Protopopov <a.s.protopopov@gmail.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-12-10Bluetooth: btintel: Create common Intel Version Read functionLoic Poulain1-35/+11
The Intel Version Read command is used to retrieve information about hardware and firmware version/revision of Intel Bluetooth controllers. This is an Intel generic command used in USB and UART drivers. Signed-off-by: Loic Poulain <loic.poulain@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-12-10Bluetooth: hci_intel: Use shorter timeout for HCI commandsLoic Poulain1-4/+4
Use the standard HCI_CMD_TIMEOUT(1s) for HCI command instead of HCI_INIT_TIMEOUT(10s) which is not justified in these cases. Signed-off-by: Loic Poulain <loic.poulain@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-11-19Bluetooth: Use new hci_skb_pkt_* wrappers for driversMarcel Holtmann1-7/+7
The new hci_skb_pkt_* wrappers are mainly intented for drivers to require less knowledge about bt_cb(sbk) handling. So after converting the core packet handling, convert all drivers. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2015-10-21Bluetooth: hci_uart: Provide initial manufacturer informationMarcel Holtmann1-0/+1
Provide an early indication about the manufacturer information so that it can be forwarded into monitor channel. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2015-10-21Bluetooth: btintel: Add support for enabling tracing functionalityMarcel Holtmann1-0/+1
For Intel controllers with firmware that allows tracing of baseband functionality this allows enabling it via set_diag driver callback. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2015-10-01Bluetooth: hci_intel: Cleanup the device probe codeJarkko Nikula1-24/+0
There is some unneeded code in "hci_intel" probing. First acpi_match_device() call is needless as driver/platform/acpi core code has already done the matching before calling the probe and the driver does not use the returned pointer to matching _HID other than checking is it NULL. Then tree wide grep for "hci_intel" doesn't reveal that there is any code registering this platform device so it looks this device is always backed with ACPI companion so also ACPI_HANDLE() test can be removed. Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-09-17Bluetooth: hci_intel: Enable IRQ wake capabilityLoic Poulain1-7/+25
We need to explicitly enable the IRQ wakeup mode to let the controller wake the system from sleep states (like suspend-to-ram). PM suspend/resume callbacks now call the generic intel device PM functions after enabling/disabling IRQ wake. Signed-off-by: Loic Poulain <loic.poulain@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-09-17Bluetooth: hci_intel: Give priority to LPM packetsLoic Poulain1-3/+6
Change the way to insert LPM packets into the txq. Use skb_queue_head instead of skb_queue_tail to always prioritise LPM packets over potential tx queue content. Signed-off-by: Loic Poulain <loic.poulain@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-09-17Bluetooth: hci_intel: Add Device configurationLoic Poulain1-0/+7
Apply DDC parameters once controller is in operational mode. Signed-off-by: Loic Poulain <loic.poulain@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-09-17Bluetooth: hci_intel: Fix warnings due to unused lpm functionsLoic Poulain1-0/+2
intel_lpm_suspend/resume are only used in case of CONFIG_PM. Signed-off-by: Loic Poulain <loic.poulain@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-09-17Bluetooth: hci_intel: Show error in case of invalid LPM packet sizeLoic Poulain1-2/+5
Don't hide this packet size error. Signed-off-by: Loic Poulain <loic.poulain@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-09-17Bluetooth: hci_intel: Add runtime PM supportLoic Poulain1-3/+69
Implement runtime PM suspend/resume callbacks. If LPM supported, controller is put into supsend after a delay of inactivity (1s). Inactivity is based on LPM idle notification and host TX traffic. Signed-off-by: Loic Poulain <loic.poulain@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-09-17Bluetooth: hci_intel: Add PM supportLoic Poulain1-0/+53
Add PM suspend/resume callbacks which call lpm_suspend/resume. Add LPM ack in threaded IRQ handler to notify the controller that resume is complete. Protect hci_uart against concurrent removing during suspend/resume. Signed-off-by: Loic Poulain <loic.poulain@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-09-17Bluetooth: hci_intel: Implement LPM suspend/resumeLoic Poulain1-0/+158
Add LPM PM suspend/resume/host_wake LPM functions. A LPM transaction is composed with a LPM request and ack/response. Host can send a LPM suspend/resume request to the controller which should respond with a LPM ack. If resume is requested by the controller (irq), host has to send a LPM ack once resumed. Signed-off-by: Loic Poulain <loic.poulain@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-09-17Bluetooth: hci_intel: Replace spinlock with mutexLoic Poulain1-9/+9
Replace the device_intel list spinlock with a mutex. devm_request_threaded_irq is not atomic and upcomming PM support should be simpler. Signed-off-by: Loic Poulain <loic.poulain@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-09-17Bluetooth: hci_intel: Use bt_dev logging helpersLoic Poulain1-62/+59
Replace BT_ logging calls by the new bt_dev ones. Signed-off-by: Loic Poulain <loic.poulain@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-09-17Bluetooth: hci_intel: Introduce LPM supportLoic Poulain1-3/+90
Enable controller Low-Power-Mode if we have a pdev to manage host wake-up. Once LPM is enabled, controller notifies its TX status via a vendor specific packet (tx_idle/tx_active). tx_active means that there is more data upcoming from controller. tx_idle means that controller can be put in suspended state. Signed-off-by: Loic Poulain <loic.poulain@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-09-17Bluetooth: hci_intel: Retrieve host-wake IRQLoic Poulain1-1/+61
An IRQ can be retrieved from the pdev resources. This irq will be used in case of LPM suspend mode to wake-up the host and resume the link. This resource can be declared as a GPIO-Interrupt which requires to be converted into IRQ. Signed-off-by: Loic Poulain <loic.poulain@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-08-28Bluetooth: hci_intel: Add support for platform driverLoic Poulain1-13/+189
A platform device can be used to provide some specific resources in order to manage the controller. In this first patch we retrieve the reset gpio which is used to power on/off the controller. The main issue is to match the current tty with the correct pdev. In case of ACPI, we can easily find the right tty/pdev pair because they are both child of the same UART port. If controller is powered-on from the driver, we need to wait for a HCI boot event before being able to send any command. Signed-off-by: Loic Poulain <loic.poulain@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-08-28Bluetooth: hci_intel: Add Intel baudrate configuration supportLoic Poulain1-0/+119
Implement the set_baudrate callback for hci_intel. - Controller requires a read Intel version command before updating its baudrate. - The operation consists in an async cmd since the controller does not respond at the same speed. - Wait 100ms to let the controller change its baudrate. - Clear RTS until we change our own UART speed Manage speed change in the setup function, we need to restore the oper speed once chip has booted on patched firmware. Signed-off-by: Loic Poulain <loic.poulain@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-07-23Bluetooth: btintel: Create common function for Intel version infoMarcel Holtmann1-22/+1
The Intel version information is shared between USB and UART drivers and with that move it into a generic function of the Intel module. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2015-07-23Bluetooth: btintel: Create common Intel Secure Send functionMarcel Holtmann1-28/+4
The Intel Secure Send command is used the same in USB and UART drivers and with that move a generic version into the Intel module. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2015-07-23Bluetooth: hci_uart: Add Intel address configuration supportMarcel Holtmann1-0/+2
The Intel specific Bluetooth module provides support for pubic address configuration. So make sure that it is enabled for Intel UART devices. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2015-07-23Bluetooth: hci_uart: Add basic support for Intel Lightning Peak devicesLoic Poulain1-0/+604
The Intel Lightning Peak devices do not come with Bluetooth firmware loaded and thus require a full download of the operational Bluetooth firmware when the device is attached via the Bluetooth line discipline. Lightning Peak devices start with a bootloader mode that only accepts a very limited set of HCI commands. The supported commands are enough to identify the hardware and select the right firmware to load. Signed-off-by: Loic Poulain <loic.poulain@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-04-07Bluetooth: hci_uart: Use generic Intel support for address settingMarcel Holtmann1-17/+0
The Bluetooth address setting for Intel devices is provided by a generic module now. Start using that module instead of relying it being included in the driver. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2015-04-07Bluetooth: hci_uart: Add support Intel address configurationMarcel Holtmann1-0/+48
When using vendor detection, this adds support for the Intel specific address configuration command. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>