summaryrefslogtreecommitdiffstats
path: root/drivers/bluetooth/hci_bcm.c
AgeCommit message (Collapse)Author
2018-04-19Bluetooth: hci_bcm: Treat Interrupt ACPI resources as always being active-lowHans de Goede
commit bb5208b314c5127b716b2ee4f55803a8bb73b750 upstream. Older devices with a serdev attached bcm bt hci, use an Interrupt ACPI resource to describe the IRQ (rather then a GpioInt resource). These device seem to all claim the IRQ is active-high and seem to all need a DMI quirk to treat it as active-low. Instead simply always assume that Interrupt resource specified IRQs are always active-low. This fixes the bt device not being able to wake the host from runtime- suspend on the: Asus T100TAM, Asus T200TA, Lenovo Yoga2 and the Toshiba Encore, without the need to add 4 new DMI quirks for these models. This also allows us to remove 2 DMI quirks for the Asus T100TA and Asus T100CHI series. Likely the 2 remaining quirks can also be removed but I could not find a DSDT of these devices to verify this. Cc: stable@vger.kernel.org Buglink: https://bugzilla.kernel.org/show_bug.cgi?id=198953 Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1554835 Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-25Bluetooth: hci_bcm: Fix setting of irq trigger typeHans de Goede
[ Upstream commit 227630cccdbb8f8a1b24ac26517b75079c9a69c9 ] This commit fixes 2 issues with host-wake irq trigger type handling in hci_bcm: 1) bcm_setup_sleep sets sleep_params.host_wake_active based on bcm_device.irq_polarity, but bcm_request_irq was always requesting IRQF_TRIGGER_RISING as trigger type independent of irq_polarity. This was a problem when the irq is described as a GpioInt rather then an Interrupt in the DSDT as for GpioInt-s the value passed to request_irq is honored. This commit fixes this by requesting the correct trigger type depending on bcm_device.irq_polarity. 2) bcm_device.irq_polarity was used to directly store an ACPI polarity value (ACPI_ACTIVE_*). This is undesirable because hci_bcm is also used with device-tree and checking for something like ACPI_ACTIVE_LOW in a non ACPI specific function like bcm_request_irq feels wrong. This commit fixes this by renaming irq_polarity to irq_active_low and changing its type to a bool. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Sasha Levin <alexander.levin@verizon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-08-17Bluetooth: hci_bcm: Handle empty packet after firmware loadingMarcel Holtmann
The Broadcom controller on the Raspberry Pi3 sends an empty packet with packet type 0x00 after launching the firmware. This will cause logging of errors. Bluetooth: hci0: Frame reassembly failed (-84) Since this seems to be an intented behaviour of the controller, handle it gracefully by parsing that empty packet with packet type 0x00 and then just simply report it as diagnostic packet. With that change no errors are logging and the packet itself is actually recorded in the Bluetooth monitor traces. < HCI Command: Broadcom Launch RAM (0x3f|0x004e) plen 4 Address: 0xffffffff > HCI Event: Command Complete (0x0e) plen 4 Broadcom Launch RAM (0x3f|0x004e) ncmd 1 Status: Success (0x00) = Vendor Diagnostic (len 0) < HCI Command: Broadcom Update UART Baud Rate (0x3f|0x0018) plen 6 00 00 00 10 0e 00 ...... > HCI Event: Command Complete (0x0e) plen 4 Broadcom Update UART Baud Rate (0x3f|0x0018) ncmd 1 Status: Success (0x00) < HCI Command: Reset (0x03|0x0003) plen 0 > HCI Event: Command Complete (0x0e) plen 4 Reset (0x03|0x0003) ncmd 1 Status: Success (0x00) Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-08-17Bluetooth: hci_bcm: Add serdev supportLoic Poulain
Add basic support for Broadcom serial slave devices. Probe the serial device, retrieve its maximum speed and register a new hci uart device. Tested/compatible with bcm43438 (RPi3). Signed-off-by: Loic Poulain <loic.poulain@gmail.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2017-08-16Bluetooth: hci_bcm: Use operation speed of 4Mbps only for ACPI devicesMarcel Holtmann
Not all Broadcom controller support the 4Mbps operational speed on UART devices. This is because the UART clock setting changes might not be supported. < HCI Command: Broadcom Write UART Clock Setting (0x3f|0x0045) plen 1 01 . > HCI Event: Command Complete (0x0e) plen 4 Broadcom Write UART Clock Setting (0x3f|0x0045) ncmd 1 Status: Unknown HCI Command (0x01) To support any operational speed higher than 3Mbps, support for this command is required. With that respect it is better to not enforce any operational speed by default. Only when its support is known, then allow for higher operational speed. This patch assigns the 4Mbps opertional speed only for devices discovered through ACPI and leave all others at the default 115200. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-07-20Bluetooth: hci_bcm: Make bcm_request_irq fail if no IRQ resourceLoic Poulain
In case of no IRQ resource associated to the bcm_device, requesting IRQ should return an error in order to not enable low power mgmt. Signed-off-by: Loic Poulain <loic.poulain@gmail.com> Reported-by: Ian Molton <ian@mnementh.co.uk> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2017-06-29Bluetooth: hci_bcm: Add active_low irq polarity quirk for Asus T100CHIHans de Goede
Just like the T100TA the host-wake irq on the Asus T100CHI is active low. Having a quirk for this is actually extra important on the T100CHI as it ships with a bluetooth keyboard dock, which does not work properly without this quirk. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2017-06-27Bluetooth: hci_bcm: Fix unwanted error reporting if no bcm devLoic Poulain
The hci_bcm proto is able to operate without bcm platform device linked to its uart port. In that case, firmware can be applied, but there is no power operation (no gpio/irq resources mgmt). However, the current implementation breaks this use case because of reporting a ENODEV error in the bcm setup procedure if bcm_request_irq fails (which is the case if no bcm device linked). Fix this by removing bcm_request_irq error forwarding. Signed-off-by: Loic Poulain <loic.poulain@intel.com> Reported-by: Ian Molton <ian@mnementh.co.uk> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2017-06-16networking: add and use skb_put_u8()Johannes Berg
Joe and Bjørn suggested that it'd be nicer to not have the cast in the fairly common case of doing *(u8 *)skb_put(skb, 1) = c; Add skb_put_u8() for this case, and use it across the code, using the following spatch: @@ expression SKB, C, S; typedef u8; identifier fn = {skb_put}; fresh identifier fn2 = fn ## "_u8"; @@ - *(u8 *)fn(SKB, S) = C; + fn2(SKB, C); Note that due to the "S", the spatch isn't perfect, it should have checked that S is 1, but there's also places that use a sizeof expression like sizeof(var) or sizeof(u8) etc. Turns out that nobody ever did something like *(u8 *)skb_put(skb, 2) = c; which would be wrong anyway since the second byte wouldn't be initialized. Suggested-by: Joe Perches <joe@perches.com> Suggested-by: Bjørn Mork <bjorn@mork.no> Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-06-16networking: make skb_put & friends return void pointersJohannes Berg
It seems like a historic accident that these return unsigned char *, and in many places that means casts are required, more often than not. Make these functions (skb_put, __skb_put and pskb_put) return void * and remove all the casts across the tree, adding a (u8 *) cast only where the unsigned char pointer was used directly, all done with the following spatch: @@ expression SKB, LEN; typedef u8; identifier fn = { skb_put, __skb_put }; @@ - *(fn(SKB, LEN)) + *(u8 *)fn(SKB, LEN) @@ expression E, SKB, LEN; identifier fn = { skb_put, __skb_put }; type T; @@ - E = ((T *)(fn(SKB, LEN))) + E = fn(SKB, LEN) which actually doesn't cover pskb_put since there are only three users overall. A handful of stragglers were converted manually, notably a macro in drivers/isdn/i4l/isdn_bsdcomp.c and, oddly enough, one of the many instances in net/bluetooth/hci_sock.c. In the former file, I also had to fix one whitespace problem spatch introduced. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-06-09Bluetooth: hci_bcm: Switch to devm_acpi_dev_add_driver_gpios()Andy Shevchenko
Switch to use managed variant of acpi_dev_add_driver_gpios() to simplify error path and fix potentially wrong assingment if ->probe() fails. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2017-04-12Bluetooth: hci_bcm: add missing tty-device sanity checkJohan Hovold
Make sure to check the tty-device pointer before looking up the sibling platform device to avoid dereferencing a NULL-pointer when the tty is one end of a Unix98 pty. Fixes: 0395ffc1ee05 ("Bluetooth: hci_bcm: Add PM for BCM devices") Cc: stable <stable@vger.kernel.org> # 4.3 Cc: Frederic Danis <frederic.danis@linux.intel.com> Signed-off-by: Johan Hovold <johan@kernel.org> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2017-04-12Bluetooth: hci_bcm: Support platform enumerationAndy Shevchenko
Until now the driver supports only ACPI enumeration. Nevertheless Intel Edison SoM has Broadcom Wi-Fi + BT chip and neither ACPI nor DT enumeration mechanism. Enable pure platform driver in order to support Intel Edison SoM. Cc: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2017-04-12Bluetooth: hci_bcm: Fix clock (un)prepareJohn Keeping
The hci_bcm driver currently does not prepare/unprepare the clock and goes directly to enable, but as the documentation for clk_enable says, clk_prepare must be called before clk_enable. Signed-off-by: John Keeping <john@metanate.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2017-02-16Bluetooth: hci_bcm: Add support for BCM2E95 and BCM2E96Daniel Drake
The BCM2E96 ID is used by the ECS EF20 laptop, and BCM2E95 is present in the Weibu F3C. Both are now logged as: hci0: BCM: chip id 82 hci0: BCM43341B0 (002.001.014) build 0000 hci0: BCM (002.001.014) build 0158 The ECS vendor kernel predates the host-wakeup support in hci_bcm but it explicitly has a comment saying that the GPIO assignment needs to be reordered for BCM2E96: 1. (not used in vendor driver) 2. Device wakeup 3. Shutdown For both devices in question, the DSDT has these GPIOs listed in order of GpioInt, GpioIo, GpioIo. And if we use the first one listed (GpioInt) as the host wakeup, that interrupt handler fires while doing bluetooth I/O. I am assuming the convention of GPIO ordering has been changed for these new device IDs, so lets use the new ordering on such devices. Signed-off-by: Daniel Drake <drake@endlessm.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2016-10-13Bluetooth: hci_bcm: Fix autosuspend PM for Lenovo ThinkPad 8Jérôme de Bretagne
ACPI table for BCM2E55 of Lenovo ThinkPad 8 is not correct. Set correctly IRQ polarity for this device, fixing the issue of bluetooth never resuming after autosuspend PM. Signed-off-by: Jérôme de Bretagne <jerome.debretagne@gmail.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2016-09-19Bluetooth: hci_bcm: Change protocol nameLoic Poulain
Use full name instead of abbreviation. Signed-off-by: Loic Poulain <loic.poulain@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2016-04-08Bluetooth: hci_bcm: Add BCM2E71 ACPI IDLoic Poulain
This ID is used at least by Asus T100-CHI. Signed-off-by: Loic Poulain <loic.poulain@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2016-03-10Bluetooth: hci_bcm: Add BCM2E55 ACPI ID used in Lenovo ThinkPad Tablet 8Jérôme de Bretagne
Lenovo ThinkPad Tablet 8 with BCM43241 rev B5 chipset uses the BCM2E55 ACPI ID for Bluetooth. Add it to the list of supported devices. Signed-off-by: Jérôme de Bretagne <jerome.debretagne@gmail.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2016-02-23Bluetooth: hci_bcm: Add BCM2E7C ACPI IDMika Westerberg
Recent macbooks (early 2015) with BCM43241 use this ACPI ID. Add it to the list of supported devices. Reported-by: Leif Liddy <leif.liddy@gmail.com> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2016-02-23Bluetooth: hci_bcm: Add new ACPI ID for bcm43241J.J. Meijer
This ACPI ID is used at least by HP for their Omni 10 5600eg tablet. Signed-off-by: J.J. Meijer <jjmeijer88@gmail.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2016-01-04Bluetooth: hci_bcm: new ACPI IDsHeikki Krogerus
These are used at least by Acer with BCM43241. Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2016-01-04Bluetooth: hci_bcm: move all Broadcom ACPI IDs to BCM HCI driverHeikki Krogerus
The IDs should all be for Broadcom BCM43241 module, and hci_bcm is now the proper driver for them. This removes one of two different ways of handling PM with the module. Cc: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-12-20Bluetooth: hci_bcm: Add BCM2E65 ACPI IDLuka Karinja
Add BCM2E65 device in acpi_device_id table used on Asus T100TAF. Signed-off-by: Luka Karinja <luka.karinja@gmail.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-11-19Bluetooth: Use new hci_skb_pkt_* wrappers for driversMarcel Holtmann
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-22Bluetooth: hci_bcm: checking for ERR_PTR instead of NULLDan Carpenter
bt_skb_alloc() returns NULL on error, it never returns an ERR_PTR. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-10-21Bluetooth: hci_uart: Provide initial manufacturer informationMarcel Holtmann
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-08Bluetooth: hci_bcm: Enable support for set_diag driver callbackMarcel Holtmann
The set_diag driver callback allows enabling and disabling the vendor specific diagnostic information. Since Broadcom chips have support for a dedicated LM_DIAG channel, hook it up accordingly. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2015-10-08Bluetooth: hci_bcm: Enable parsing of LM_DIAG messagesMarcel Holtmann
The Broadcom UART based controllers can send LM_DIAG messages with the identifier 0x07 inside the HCI stream. These messages are 63 octets in size and have no variable payload or length indicator. This patch adds correct parsing information for the h4_recv_buf handler and in case these packets are received, they are forwarded to the Bluetooth core via hci_recv_diag interface. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2015-10-01Bluetooth: hci_bcm: Do not test ACPI companion in bcm_acpi_probe()Jarkko Nikula
This device has always ACPI companion because driver supports only ACPI enumeration. Therefore there is no need to test it in bcm_acpi_probe() and we can pass it directly to acpi_dev_get_resources() (which will return -EINVAL in case of NULL argument is passed). Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-10-01Bluetooth: hci_bcm: Remove needless looking codeJarkko Nikula
Tree wide grep for "hci_bcm" doesn't reveal there is any code registering this platform device and "struct acpi_device_id" use for passing the platform data looks a debug/test code leftover to me. I'm assuming this driver effectively supports only ACPI enumeration and thus test for ACPI_HANDLE() and platform data can be removed. Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-10-01Bluetooth: hci_bcm: Remove needless acpi_match_device() callJarkko Nikula
There is no need to call acpi_match_device() in driver's probe path and verify does it find a match to given ACPI _HIDs in .acpi_match_table as driver/platform/acpi core code has found the match prior calling the probe. Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-10-01Bluetooth: hci_bcm: Handle possible error from acpi_dev_get_resources()Jarkko Nikula
Driver doesn't handle possible error from acpi_dev_get_resources(). Test it and return the error code in case of error. Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-10-01Bluetooth: hci_bcm: Add missing acpi_dev_free_resource_list()Jarkko Nikula
Caller of acpi_dev_get_resources() should free the constructed resource list by calling the acpi_dev_free_resource_list() in order to avoid memory leak. Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-09-24Bluetooth: hci_bcm: Add suspend/resume runtime PM functionsFrederic Danis
Adds autosuspend runtime functionality to BCM UART driver. Autosuspend is enabled at end of bcm_setup. bcm_device_lock is used for system sleep functions as they can be called at any time. bcm_device_lock is not held for runtime suspend functions as this is only enabled as long as platform device is opened. Signed-off-by: Frederic Danis <frederic.danis@linux.intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-09-24Bluetooth: hci_bcm: Prepare PM runtime supportFrederic Danis
Change some CONFIG_PM_SLEEP to CONFIG_PM as hu and is_suspended parameters will be used during PM runtime callbacks. Add bcm_suspend_device() and bcm_resume_device() which performs link management for PM callbacks. These functions will be used for runtime management. Signed-off-by: Frederic Danis <frederic.danis@linux.intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-09-24Bluetooth: hci_bcm: Fix IRQ polarity for T100Frederic Danis
ACPI table for BCM2E39 of T100TA is not correct. Set correct irq_polarity for this device. Signed-off-by: Frederic Danis <frederic.danis@linux.intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-09-17Bluetooth: hci_bcm: Add wake-up capabilityFrederic Danis
Retrieve the Interruption used by BCM device, which can be declared as Interruption or GpioInt in the ACPI table. Retrieve IRQ polarity from the ACPI table to use it for host_wake_active parameter of Setup Sleep vendor specific command. Configure BCM device to wake-up the host. Enable IRQ wake while suspended. Signed-off-by: Frederic Danis <frederic.danis@linux.intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-09-17Bluetooth: hci_bcm: Use bt_dev logging helpersFrederic Danis
Replace BT_ logging calls by the new bt_dev ones. Signed-off-by: Frederic Danis <frederic.danis@linux.intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-09-17Bluetooth: hci_bcm: Replace spinlock by mutexFrederic Danis
Replace spinlock by mutex to be able to use bcm_device_lock in sleepable context like devm_request_threaded_irq or upcomming PM support. Signed-off-by: Frederic Danis <frederic.danis@linux.intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-08-28Bluetooth: hci_bcm: Fix crash on suspendFrederic Danis
If bcm_suspend is called whithout device opened there is a crash as it tries to use bdev->hu which is NULL. Rename bcm_device_list_lock to bcm_device_lock as it does not only apply to bcm_device_list. Signed-off-by: Frederic Danis <frederic.danis@linux.intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-08-18Bluetooth: hci_bcm: Use non-sleep version of gpio_set_valueLoic Poulain
We should not sleep while holding a spinlock. bcm_gpio_set_power is called while holding the bcm_device_list lock. Signed-off-by: Loic Poulain <loic.poulain@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-08-12Bluetooth: hci_bcm: Fix "implicit declaration"Frederic Danis
The kbuild test robot reported implicit declaration of function 'acpi_dev_get_resources'. Surround ACPI function by CONFIG_ACPI test. Reported-by: kbuild test robot <fengguang.wu@intel.com> Signed-off-by: Frederic Danis <frederic.danis@linux.intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-08-12Bluetooth: hci_bcm: improve use of gpios APIUwe Kleine-König
devm_gpiod_get currently has an optional parameter to set initial direction and value for the requested gpio. Make use of this to simplify the driver and make it not fail to build when this parameter is made mandatory (which is scheduled for 4.3-rc1). Moreover use the _optional variant of devm_gpiod_get to simplify error handling (which also gets more strict for free). Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-08-11Bluetooth: hci_bcm: Add suspend/resume PM functionsFrederic Danis
Add reference to hci_uart structure to bcm_device. This allows suspend/resume callbacks to manage UART flow control. Signed-off-by: Frederic Danis <frederic.danis@linux.intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-08-11Bluetooth: hci_bcm: Retrieve UART speed from ACPIFrederic Danis
Parse platform_device's ACPI to retrieve UART init speed. When BCM device is open, check if its TTY has same parent as one of the platform devices saved. If yes, use platform_device's init speed. Signed-off-by: Frederic Danis <frederic.danis@linux.intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-08-11Bluetooth: hci_bcm: Add PM for BCM devicesFrederic Danis
Retrieve "shutdown" and "device_wakeup" GPIOs from ACPI. Set device off during platform device enumeration. Set device on only when attached. As driver can be unbound we need to check if the bcm_device still exists before calling GPIO's functions, this is protected using device_list_lock. Signed-off-by: Frederic Danis <frederic.danis@linux.intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-06-18Bluetooth: hci_uart: Fix speed selectionFrederic Danis
hu->proto->*speed will always be used for all device where it is set. But hu->*speed should be used if exist, so the test should be swapped. The equivalent change is needed in bcm_setup() of hci_bcm.c. Signed-off-by: Frederic Danis <frederic.danis@linux.intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-06-17Bluetooth: hci_uart: Fix dereferencing of ERR_PTRChan-yeol Park
If h4_recv_buf() return ERR_PTR instead sk_buff pointer, it should be cleared once PTR_ERR is completed for the further dereference such as h4_recv(), or h4_close(). Signed-off-by: Chan-yeol Park <chanyeol.park@samsung.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-06-09Bluetooth: hci_uart: Add bcm_set_baudrate()Frederic Danis
Add vendor specific command to change controller device speed. Signed-off-by: Frederic Danis <frederic.danis@linux.intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>