* btbcm issue
@ 2016-07-21 7:39 Ryan
2016-07-21 8:00 ` Marcel Holtmann
0 siblings, 1 reply; 4+ messages in thread
From: Ryan @ 2016-07-21 7:39 UTC (permalink / raw)
To: linux-bluetooth
Hi,
I am using btbcm on an embedded device which has a broadcom bt module.
I understand that the below code suspends the bt device. Can anyone show
me where i need to specify wakeup irq and device_wakeup gpios?
I cant find examples of boards which do these? I understand that device_wakeup
is required for suspending the device.
Below is the code segment for suspend-resume which i suppose will be
called to suspend the device.
+static int bcm_suspend(struct device *pdev)
+{
+ struct bcm_device *dev = platform_get_drvdata(to_platform_device(pdev));
+
+ BT_DBG("suspend (%p): is_suspended %d", dev, dev->is_suspended);
+
+ if (!dev->is_suspended) {
+ hci_uart_set_flow_control(dev->hu, true);
+
+ /* Once this callback returns, driver suspends BT via GPIO */
+ dev->is_suspended = true;
+ }
+
+ /* Suspend the device */
+ if (dev->device_wakeup) {
+ gpiod_set_value(dev->device_wakeup, false);
+ BT_DBG("suspend, delaying 15 ms");
+ mdelay(15);
+ }
+
+ return 0;
+}
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: btbcm issue
2016-07-21 7:39 btbcm issue Ryan
@ 2016-07-21 8:00 ` Marcel Holtmann
[not found] ` <CANMsd01O4s=g-B3i+Z-w4LY52CzfOKhGPhfHxD29sVn0JR245A@mail.gmail.com>
0 siblings, 1 reply; 4+ messages in thread
From: Marcel Holtmann @ 2016-07-21 8:00 UTC (permalink / raw)
To: Ryan; +Cc: linux-bluetooth
Hi Ryan,
> I am using btbcm on an embedded device which has a broadcom bt module.
>
> I understand that the below code suspends the bt device. Can anyone show
> me where i need to specify wakeup irq and device_wakeup gpios?
>
> I cant find examples of boards which do these? I understand that device_wakeup
> is required for suspending the device.
>
> Below is the code segment for suspend-resume which i suppose will be
> called to suspend the device.
>
>
> +static int bcm_suspend(struct device *pdev)
> +{
> + struct bcm_device *dev = platform_get_drvdata(to_platform_device(pdev));
> +
> + BT_DBG("suspend (%p): is_suspended %d", dev, dev->is_suspended);
> +
> + if (!dev->is_suspended) {
> + hci_uart_set_flow_control(dev->hu, true);
> +
> + /* Once this callback returns, driver suspends BT via GPIO */
> + dev->is_suspended = true;
> + }
> +
> + /* Suspend the device */
> + if (dev->device_wakeup) {
> + gpiod_set_value(dev->device_wakeup, false);
> + BT_DBG("suspend, delaying 15 ms");
> + mdelay(15);
> + }
> +
> + return 0;
> +}
I think the current hci_bcm.c (and btbcm.c) only ever enabled ACPI enumeration. Meaning someone might want to update that to support device tree (DT). There were efforts from Broadcom to add support for this, but they never agreed with the DT maintainer on the definitions.
Regards
Marcel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: btbcm issue
[not found] ` <CANMsd01O4s=g-B3i+Z-w4LY52CzfOKhGPhfHxD29sVn0JR245A@mail.gmail.com>
@ 2016-08-09 7:37 ` Marcel Holtmann
2016-08-09 12:42 ` Ryan
0 siblings, 1 reply; 4+ messages in thread
From: Marcel Holtmann @ 2016-08-09 7:37 UTC (permalink / raw)
To: Ryan; +Cc: open list:BLUETOOTH DRIVERS
Hi Ryan,
> I wanted to check whats the best way of going about adding
> suspend-resume support for bcm bt chip
>
> Should one have a separate driver
> (https://android.googlesource.com/kernel/bcm/+/3d6d35972004824a9111f13926bed2a4a495b668/drivers/misc/bcm-bt-lpm.c)
>
> or should i use the existing hci_bcm.c driver & add dt support or use
> a platform device to pass the gpiod_desc for wakeup/sleep?
no separate driver please. As soon as btattach links the UART and we enable the device, everything should be done in background by the driver. The Broadcom LPM driver is just a hack for Android since they still haven't switched to using HCI User Channel for Android (like Intel for example).
In general DT and ACPI are the same. They describe the hardware and there are methods to read these descriptions from them and then use them. The only problem with DT was that Broadcom never got the definition acked by the DT maintainer. Otherwise all the functionality should be already in hci_bcm.c right now.
Regards
Marcel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: btbcm issue
2016-08-09 7:37 ` Marcel Holtmann
@ 2016-08-09 12:42 ` Ryan
0 siblings, 0 replies; 4+ messages in thread
From: Ryan @ 2016-08-09 12:42 UTC (permalink / raw)
To: Marcel Holtmann; +Cc: open list:BLUETOOTH DRIVERS
Hi Marcel,
Is this what you are referring to?
http://www.spinics.net/lists/linux-bluetooth/msg61742.html
In this patchset, bcm tried to create new functionality/files for uart and =
bcm.
If not, can you point me to the right set of patches?
Regards,
ryan
On Tue, Aug 9, 2016 at 1:07 PM, Marcel Holtmann <marcel@holtmann.org> wrote=
:
> Hi Ryan,
>
>> I wanted to check whats the best way of going about adding
>> suspend-resume support for bcm bt chip
>>
>> Should one have a separate driver
>> (https://android.googlesource.com/kernel/bcm/+/3d6d35972004824a9111f1392=
6bed2a4a495b668/drivers/misc/bcm-bt-lpm.c)
>>
>> or should i use the existing hci_bcm.c driver & add dt support or use
>> a platform device to pass the gpiod_desc for wakeup/sleep?
>
> no separate driver please. As soon as btattach links the UART and we enab=
le the device, everything should be done in background by the driver. The B=
roadcom LPM driver is just a hack for Android since they still haven't swit=
ched to using HCI User Channel for Android (like Intel for example).
>
> In general DT and ACPI are the same. They describe the hardware and there=
are methods to read these descriptions from them and then use them. The on=
ly problem with DT was that Broadcom never got the definition acked by the =
DT maintainer. Otherwise all the functionality should be already in hci_bcm=
.c right now.
>
> Regards
>
> Marcel
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-08-09 12:42 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-21 7:39 btbcm issue Ryan
2016-07-21 8:00 ` Marcel Holtmann
[not found] ` <CANMsd01O4s=g-B3i+Z-w4LY52CzfOKhGPhfHxD29sVn0JR245A@mail.gmail.com>
2016-08-09 7:37 ` Marcel Holtmann
2016-08-09 12:42 ` Ryan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).