linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: btmrvl: support Marvell Bluetooth device SD8797
@ 2011-11-17  4:40 Bing Zhao
  2011-11-21 15:52 ` Gustavo Padovan
  0 siblings, 1 reply; 5+ messages in thread
From: Bing Zhao @ 2011-11-17  4:40 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: linux-wireless, Gustavo Padovan, Bing Zhao, Frank Huang

The SD8797 firmware image is shared with mwifiex driver.
Whoever gets loaded first will be responsible for firmware
downloading.

Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: Frank Huang <frankh@marvell.com>
---
 drivers/bluetooth/Kconfig       |    6 +++---
 drivers/bluetooth/btmrvl_sdio.c |   15 +++++++++++++--
 2 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/drivers/bluetooth/Kconfig b/drivers/bluetooth/Kconfig
index 11b41fd..5ccf142 100644
--- a/drivers/bluetooth/Kconfig
+++ b/drivers/bluetooth/Kconfig
@@ -188,7 +188,7 @@ config BT_MRVL
 	  The core driver to support Marvell Bluetooth devices.
 
 	  This driver is required if you want to support
-	  Marvell Bluetooth devices, such as 8688/8787.
+	  Marvell Bluetooth devices, such as 8688/8787/8797.
 
 	  Say Y here to compile Marvell Bluetooth driver
 	  into the kernel or say M to compile it as module.
@@ -201,8 +201,8 @@ config BT_MRVL_SDIO
 	  The driver for Marvell Bluetooth chipsets with SDIO interface.
 
 	  This driver is required if you want to use Marvell Bluetooth
-	  devices with SDIO interface. Currently SD8688/SD8787 chipsets are
-	  supported.
+	  devices with SDIO interface. Currently SD8688/SD8787/SD8797
+	  chipsets are supported.
 
 	  Say Y here to compile support for Marvell BT-over-SDIO driver
 	  into the kernel or say M to compile it as module.
diff --git a/drivers/bluetooth/btmrvl_sdio.c b/drivers/bluetooth/btmrvl_sdio.c
index c827d73..37b5639 100644
--- a/drivers/bluetooth/btmrvl_sdio.c
+++ b/drivers/bluetooth/btmrvl_sdio.c
@@ -64,7 +64,7 @@ static const struct btmrvl_sdio_card_reg btmrvl_reg_8688 = {
 	.io_port_1 = 0x01,
 	.io_port_2 = 0x02,
 };
-static const struct btmrvl_sdio_card_reg btmrvl_reg_8787 = {
+static const struct btmrvl_sdio_card_reg btmrvl_reg_87xx = {
 	.cfg = 0x00,
 	.host_int_mask = 0x02,
 	.host_intstatus = 0x03,
@@ -91,7 +91,14 @@ static const struct btmrvl_sdio_device btmrvl_sdio_sd8688 = {
 static const struct btmrvl_sdio_device btmrvl_sdio_sd8787 = {
 	.helper		= NULL,
 	.firmware	= "mrvl/sd8787_uapsta.bin",
-	.reg		= &btmrvl_reg_8787,
+	.reg		= &btmrvl_reg_87xx,
+	.sd_blksz_fw_dl	= 256,
+};
+
+static const struct btmrvl_sdio_device btmrvl_sdio_sd8797 = {
+	.helper		= NULL,
+	.firmware	= "mrvl/sd8797_uapsta.bin",
+	.reg		= &btmrvl_reg_87xx,
 	.sd_blksz_fw_dl	= 256,
 };
 
@@ -102,6 +109,9 @@ static const struct sdio_device_id btmrvl_sdio_ids[] = {
 	/* Marvell SD8787 Bluetooth device */
 	{ SDIO_DEVICE(SDIO_VENDOR_ID_MARVELL, 0x911A),
 			.driver_data = (unsigned long) &btmrvl_sdio_sd8787 },
+	/* Marvell SD8797 Bluetooth device */
+	{ SDIO_DEVICE(SDIO_VENDOR_ID_MARVELL, 0x912A),
+			.driver_data = (unsigned long) &btmrvl_sdio_sd8797 },
 
 	{ }	/* Terminating entry */
 };
@@ -1075,3 +1085,4 @@ MODULE_LICENSE("GPL v2");
 MODULE_FIRMWARE("sd8688_helper.bin");
 MODULE_FIRMWARE("sd8688.bin");
 MODULE_FIRMWARE("mrvl/sd8787_uapsta.bin");
+MODULE_FIRMWARE("mrvl/sd8797_uapsta.bin");
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] Bluetooth: btmrvl: support Marvell Bluetooth device SD8797
  2011-11-17  4:40 [PATCH] Bluetooth: btmrvl: support Marvell Bluetooth device SD8797 Bing Zhao
@ 2011-11-21 15:52 ` Gustavo Padovan
  2011-12-15 23:29   ` Bluetooth: btusb: urb->interval speed check in btusb_submit_isoc_urb() Bing Zhao
  0 siblings, 1 reply; 5+ messages in thread
From: Gustavo Padovan @ 2011-11-21 15:52 UTC (permalink / raw)
  To: Bing Zhao; +Cc: linux-bluetooth, linux-wireless, Frank Huang

Hi Bing,

* Bing Zhao <bzhao@marvell.com> [2011-11-16 20:40:42 -0800]:

> The SD8797 firmware image is shared with mwifiex driver.
> Whoever gets loaded first will be responsible for firmware
> downloading.
> 
> Signed-off-by: Bing Zhao <bzhao@marvell.com>
> Signed-off-by: Frank Huang <frankh@marvell.com>
> ---
>  drivers/bluetooth/Kconfig       |    6 +++---
>  drivers/bluetooth/btmrvl_sdio.c |   15 +++++++++++++--
>  2 files changed, 16 insertions(+), 5 deletions(-)

Applied, thanks.

	Gustavo

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Bluetooth: btusb: urb->interval speed check in btusb_submit_isoc_urb()
  2011-11-21 15:52 ` Gustavo Padovan
@ 2011-12-15 23:29   ` Bing Zhao
  2011-12-19  1:28     ` Marcel Holtmann
  0 siblings, 1 reply; 5+ messages in thread
From: Bing Zhao @ 2011-12-15 23:29 UTC (permalink / raw)
  To: Gustavo Padovan, Marcel Holtmann; +Cc: linux-bluetooth@vger.kernel.org

Hi Gustavo, Marcel,

In drivers/Bluetooth/btusb.c, function btusb_send_frame(), we call

        usb_fill_int_urb(urb, data->udev, pipe,
                        skb->data, skb->len, btusb_isoc_tx_complete,
                        skb, data->isoc_tx_ep->bInterval);

in case HCI_SCODATA_PKT. The inline function usb_fill_int_urb will check US=
B_SPEED_HIGH or USB_SPEED_SUPER to assign different value to urb->interval.

        if (dev->speed =3D=3D USB_SPEED_HIGH || dev->speed =3D=3D USB_SPEED=
_SUPER)
                urb->interval =3D 1 << (interval - 1);
        else
                urb->interval =3D interval;

Shall we do the same check for btusb_submit_isoc_urb()?

---
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index ea5ad1c..27ecf40 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -512,7 +512,11 @@ static int btusb_submit_isoc_urb(struct hci_dev *hdev,=
 gfp_
        urb->pipe     =3D pipe;
        urb->context  =3D hdev;
        urb->complete =3D btusb_isoc_complete;
-       urb->interval =3D data->isoc_rx_ep->bInterval;
+       if (data->udev->speed =3D=3D USB_SPEED_HIGH
+                               || data->udev->speed =3D=3D USB_SPEED_SUPER=
)
+               urb->interval =3D 1 << (data->isoc_rx_ep->bInterval - 1);
+       else
+               urb->interval =3D data->isoc_rx_ep->bInterval;

        urb->transfer_flags  =3D URB_FREE_BUFFER | URB_ISO_ASAP;
        urb->transfer_buffer =3D buf;
--

Thanks,
Bing

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: Bluetooth: btusb: urb->interval speed check in btusb_submit_isoc_urb()
  2011-12-15 23:29   ` Bluetooth: btusb: urb->interval speed check in btusb_submit_isoc_urb() Bing Zhao
@ 2011-12-19  1:28     ` Marcel Holtmann
  2011-12-20 23:30       ` Bing Zhao
  0 siblings, 1 reply; 5+ messages in thread
From: Marcel Holtmann @ 2011-12-19  1:28 UTC (permalink / raw)
  To: Bing Zhao; +Cc: Gustavo Padovan, linux-bluetooth@vger.kernel.org

Hi Bing,

> In drivers/Bluetooth/btusb.c, function btusb_send_frame(), we call
> 
>         usb_fill_int_urb(urb, data->udev, pipe,
>                         skb->data, skb->len, btusb_isoc_tx_complete,
>                         skb, data->isoc_tx_ep->bInterval);
> 
> in case HCI_SCODATA_PKT. The inline function usb_fill_int_urb will check USB_SPEED_HIGH or USB_SPEED_SUPER to assign different value to urb->interval.
> 
>         if (dev->speed == USB_SPEED_HIGH || dev->speed == USB_SPEED_SUPER)
>                 urb->interval = 1 << (interval - 1);
>         else
>                 urb->interval = interval;
> 
> Shall we do the same check for btusb_submit_isoc_urb()?

I honestly do not know. Maybe just using usb_fill_int_urb here might be
a good idea. One is the TX and one is the RX URB. You need to go into
the USB subsystem and see if it actually makes a different.

However we should not handcode anything from the USB subsystem. We made
that mistake before with hci_usb.c from the 2.4.x times and it was a
valuable lesson learned on things not to do.

Regards

Marcel



^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: Bluetooth: btusb: urb->interval speed check in btusb_submit_isoc_urb()
  2011-12-19  1:28     ` Marcel Holtmann
@ 2011-12-20 23:30       ` Bing Zhao
  0 siblings, 0 replies; 5+ messages in thread
From: Bing Zhao @ 2011-12-20 23:30 UTC (permalink / raw)
  To: Marcel Holtmann; +Cc: Gustavo Padovan, linux-bluetooth@vger.kernel.org

SGkgTWFyY2VsLA0KDQo+IFN1YmplY3Q6IFJlOiBCbHVldG9vdGg6IGJ0dXNiOiB1cmItPmludGVy
dmFsIHNwZWVkIGNoZWNrIGluIGJ0dXNiX3N1Ym1pdF9pc29jX3VyYigpDQo+IA0KPiBIaSBCaW5n
LA0KPiANCj4gPiBJbiBkcml2ZXJzL0JsdWV0b290aC9idHVzYi5jLCBmdW5jdGlvbiBidHVzYl9z
ZW5kX2ZyYW1lKCksIHdlIGNhbGwNCj4gPg0KPiA+ICAgICAgICAgdXNiX2ZpbGxfaW50X3VyYih1
cmIsIGRhdGEtPnVkZXYsIHBpcGUsDQo+ID4gICAgICAgICAgICAgICAgICAgICAgICAgc2tiLT5k
YXRhLCBza2ItPmxlbiwgYnR1c2JfaXNvY190eF9jb21wbGV0ZSwNCj4gPiAgICAgICAgICAgICAg
ICAgICAgICAgICBza2IsIGRhdGEtPmlzb2NfdHhfZXAtPmJJbnRlcnZhbCk7DQo+ID4NCj4gPiBp
biBjYXNlIEhDSV9TQ09EQVRBX1BLVC4gVGhlIGlubGluZSBmdW5jdGlvbiB1c2JfZmlsbF9pbnRf
dXJiIHdpbGwgY2hlY2sgVVNCX1NQRUVEX0hJR0ggb3INCj4gVVNCX1NQRUVEX1NVUEVSIHRvIGFz
c2lnbiBkaWZmZX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bHVhYmxl
IGxlc3NvbiBsZWFybmVkIG9uIHRoaW5ncyBub3QgdG8gZG8uDQo+IA0KPiBSZWdhcmRzDQo+IA0K
PiBNYXJjZWwNCj4gDQoNCg==

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-12-20 23:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-17  4:40 [PATCH] Bluetooth: btmrvl: support Marvell Bluetooth device SD8797 Bing Zhao
2011-11-21 15:52 ` Gustavo Padovan
2011-12-15 23:29   ` Bluetooth: btusb: urb->interval speed check in btusb_submit_isoc_urb() Bing Zhao
2011-12-19  1:28     ` Marcel Holtmann
2011-12-20 23:30       ` Bing Zhao

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).