diff for duplicates of <87shppk32a.fsf@free-electrons.com> diff --git a/a/1.txt b/N1/1.txt index f7f242e..4f0bd3f 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -1,6 +1,6 @@ Hi Rajat, -=20 - On mer., d=C3=A9c. 14 2016, Rajat Jain <rajatja@google.com> wrote: + + On mer., déc. 14 2016, Rajat Jain <rajatja-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org> wrote: In your title unless you speak about the comic books you should do a s/Marvel/Marvell/ :) @@ -14,21 +14,18 @@ Gregory > Thus, we read the pin number etc from the device tree node and send > a command to the chip. > -> Signed-off-by: Rajat Jain <rajatja@google.com> +> Signed-off-by: Rajat Jain <rajatja-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org> > --- > Note that while I would have liked to name the compatible string as more > like "marvell, usb8997-bt", the devicetrees/bindings/usb/usb-device.txt > requires the compatible property to be of the form "usbVID,PID". > -> .../{marvell-bt-sd8xxx.txt =3D> marvell-bt-8xxx.txt} | 25 ++++++++- -> drivers/bluetooth/btusb.c | 59 ++++++++++++++++= -++++++ +> .../{marvell-bt-sd8xxx.txt => marvell-bt-8xxx.txt} | 25 ++++++++- +> drivers/bluetooth/btusb.c | 59 ++++++++++++++++++++++ > 2 files changed, 82 insertions(+), 2 deletions(-) -> rename Documentation/devicetree/bindings/net/{marvell-bt-sd8xxx.txt =3D>= - marvell-bt-8xxx.txt} (76%) +> rename Documentation/devicetree/bindings/net/{marvell-bt-sd8xxx.txt => marvell-bt-8xxx.txt} (76%) > -> diff --git a/Documentation/devicetree/bindings/net/marvell-bt-sd8xxx.txt = -b/Documentation/devicetree/bindings/net/marvell-bt-8xxx.txt +> diff --git a/Documentation/devicetree/bindings/net/marvell-bt-sd8xxx.txt b/Documentation/devicetree/bindings/net/marvell-bt-8xxx.txt > similarity index 76% > rename from Documentation/devicetree/bindings/net/marvell-bt-sd8xxx.txt > rename to Documentation/devicetree/bindings/net/marvell-bt-8xxx.txt @@ -39,79 +36,75 @@ b/Documentation/devicetree/bindings/net/marvell-bt-8xxx.txt > -Marvell 8897/8997 (sd8897/sd8997) bluetooth SDIO devices > +Marvell 8897/8997 (sd8897/sd8997) bluetooth devices (SDIO or USB based) > ------ ->=20=20 +> > Required properties: > @@ -6,11 +6,13 @@ Required properties: > - compatible : should be one of the following: > * "marvell,sd8897-bt" > * "marvell,sd8997-bt" > + * "usb1286,204e" ->=20=20 +> > Optional properties: ->=20=20 +> > - marvell,cal-data: Calibration data downloaded to the device during > initialization. This is an array of 28 values(u8). > + This is only applicable to SDIO devices. ->=20=20 -> - marvell,wakeup-pin: It represents wakeup pin number of the bluetooth= - chip. +> +> - marvell,wakeup-pin: It represents wakeup pin number of the bluetooth chip. > firmware will use the pin to wakeup host system (u16). > @@ -29,7 +31,9 @@ Example: > IRQ pin 119 is used as system wakeup source interrupt. -> wakeup pin 13 and gap 100ms are configured so that firmware can wakeup h= -ost +> wakeup pin 13 and gap 100ms are configured so that firmware can wakeup host > using this device side pin and wakeup latency. > -calibration data is also available in below example. > + > +Example for SDIO device follows (calibration data is also available in > +below example). ->=20=20 +> > &mmc3 { -> status =3D "okay"; +> status = "okay"; > @@ -54,3 +58,20 @@ calibration data is also available in below example. -> marvell,wakeup-gap-ms =3D /bits/ 16 <0x64>; +> marvell,wakeup-gap-ms = /bits/ 16 <0x64>; > }; > }; > + > +Example for USB device: > + > +&usb_host1_ohci { -> + status =3D "okay"; -> + #address-cells =3D <1>; -> + #size-cells =3D <0>; +> + status = "okay"; +> + #address-cells = <1>; +> + #size-cells = <0>; > + > + mvl_bt1: bt@1 { -> + compatible =3D "usb1286,204e"; -> + reg =3D <1>; -> + interrupt-parent =3D <&gpio0>; -> + interrupts =3D <119 IRQ_TYPE_LEVEL_LOW>; -> + marvell,wakeup-pin =3D /bits/ 16 <0x0d>; -> + marvell,wakeup-gap-ms =3D /bits/ 16 <0x64>; +> + compatible = "usb1286,204e"; +> + reg = <1>; +> + interrupt-parent = <&gpio0>; +> + interrupts = <119 IRQ_TYPE_LEVEL_LOW>; +> + marvell,wakeup-pin = /bits/ 16 <0x0d>; +> + marvell,wakeup-gap-ms = /bits/ 16 <0x64>; > + }; > +}; > diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c > index 32a6f22..99d7f6d 100644 > --- a/drivers/bluetooth/btusb.c > +++ b/drivers/bluetooth/btusb.c -> @@ -2343,6 +2343,58 @@ static int btusb_shutdown_intel(struct hci_dev *hd= -ev) +> @@ -2343,6 +2343,58 @@ static int btusb_shutdown_intel(struct hci_dev *hdev) > return 0; > } ->=20=20 +> > +#ifdef CONFIG_PM -> +static const struct of_device_id mvl_oob_wake_match_table[] =3D { -> + { .compatible =3D "usb1286,204e" }, +> +static const struct of_device_id mvl_oob_wake_match_table[] = { +> + { .compatible = "usb1286,204e" }, > + { } > +}; > +MODULE_DEVICE_TABLE(of, mvl_oob_wake_match_table); > + -> +/* Configure an out-of-band gpio as wake-up pin, if specified in device = -tree */ +> +/* Configure an out-of-band gpio as wake-up pin, if specified in device tree */ > +static int marvell_config_oob_wake(struct hci_dev *hdev) > +{ > + struct sk_buff *skb; -> + struct btusb_data *data =3D hci_get_drvdata(hdev); -> + struct device *dev =3D &data->udev->dev; +> + struct btusb_data *data = hci_get_drvdata(hdev); +> + struct device *dev = &data->udev->dev; > + u16 pin, gap, opcode; > + int ret; > + u8 cmd[5]; @@ -124,24 +117,23 @@ tree */ > + return -EINVAL; > + > + /* Vendor specific command to configure a GPIO as wake-up pin */ -> + opcode =3D hci_opcode_pack(0x3F, 0x59); -> + cmd[0] =3D opcode & 0xFF; -> + cmd[1] =3D opcode >> 8; -> + cmd[2] =3D 2; /* length of parameters that follow */ -> + cmd[3] =3D pin; -> + cmd[4] =3D gap; /* time in ms, for which wakeup pin should be asserted = -*/ +> + opcode = hci_opcode_pack(0x3F, 0x59); +> + cmd[0] = opcode & 0xFF; +> + cmd[1] = opcode >> 8; +> + cmd[2] = 2; /* length of parameters that follow */ +> + cmd[3] = pin; +> + cmd[4] = gap; /* time in ms, for which wakeup pin should be asserted */ > + -> + skb =3D bt_skb_alloc(sizeof(cmd), GFP_KERNEL); +> + skb = bt_skb_alloc(sizeof(cmd), GFP_KERNEL); > + if (!skb) { > + bt_dev_err(hdev, "%s: No memory\n", __func__); > + return -ENOMEM; > + } > + > + memcpy(skb_put(skb, sizeof(cmd)), cmd, sizeof(cmd)); -> + hci_skb_pkt_type(skb) =3D HCI_COMMAND_PKT; +> + hci_skb_pkt_type(skb) = HCI_COMMAND_PKT; > + -> + ret =3D btusb_send_frame(hdev, skb); +> + ret = btusb_send_frame(hdev, skb); > + if (ret) { > + bt_dev_err(hdev, "%s: configuration failed\n", __func__); > + kfree_skb(skb); @@ -156,24 +148,24 @@ tree */ > const bdaddr_t *bdaddr) > { > @@ -2917,6 +2969,13 @@ static int btusb_probe(struct usb_interface *intf, -> err =3D btusb_config_oob_wake(hdev); +> err = btusb_config_oob_wake(hdev); > if (err) > goto out_free_dev; > + > + /* Marvel devices may need a specific chip configuration */ > + if (id->driver_info & BTUSB_MARVELL && data->oob_wake_irq) { -> + err =3D marvell_config_oob_wake(hdev); +> + err = marvell_config_oob_wake(hdev); > + if (err) > + goto out_free_dev; > + } > #endif > if (id->driver_info & BTUSB_CW6622) > set_bit(HCI_QUIRK_BROKEN_STORED_LINK_KEY, &hdev->quirks); -> --=20 +> -- > 2.8.0.rc3.226.g39d4020 > ---=20 +-- Gregory Clement, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. diff --git a/a/content_digest b/N1/content_digest index 3d04a49..95c235e 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -1,27 +1,28 @@ "ref\01481742779-15105-1-git-send-email-rajatja@google.com\0" "ref\01481742779-15105-3-git-send-email-rajatja@google.com\0" - "From\0Gregory CLEMENT <gregory.clement@free-electrons.com>\0" + "ref\01481742779-15105-3-git-send-email-rajatja-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org\0" + "From\0Gregory CLEMENT <gregory.clement-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>\0" "Subject\0Re: [PATCH 3/3] Bluetooth: btusb: Configure Marvel to use one of the pins for oob wakeup\0" "Date\0Thu, 15 Dec 2016 09:29:49 +0100\0" - "To\0Rajat Jain <rajatja@google.com>\0" - "Cc\0Rob Herring <robh+dt@kernel.org>" - Mark Rutland <mark.rutland@arm.com> - Marcel Holtmann <marcel@holtmann.org> - Gustavo Padovan <gustavo@padovan.org> - Johan Hedberg <johan.hedberg@gmail.com> - Amitkumar Karwar <akarwar@marvell.com> - Wei-Ning Huang <wnhuang@chromium.org> - Xinming Hu <huxm@marvell.com> - netdev@vger.kernel.org - devicetree@vger.kernel.org - linux-bluetooth@vger.kernel.org - Brian Norris <briannorris@google.com> - " rajatxjain@gmail.com\0" + "To\0Rajat Jain <rajatja-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>\0" + "Cc\0Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>" + Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org> + Marcel Holtmann <marcel-kz+m5ild9QBg9hUCZPvPmw@public.gmane.org> + Gustavo Padovan <gustavo-THi1TnShQwVAfugRpC6u6w@public.gmane.org> + Johan Hedberg <johan.hedberg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> + Amitkumar Karwar <akarwar-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org> + Wei-Ning Huang <wnhuang-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org> + Xinming Hu <huxm-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org> + netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org + devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org + linux-bluetooth-u79uwXL29TY76Z2rM5mHXA@public.gmane.org + Brian Norris <briannorris-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org> + " rajatxjain-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org\0" "\00:1\0" "b\0" "Hi Rajat,\n" - "=20\n" - " On mer., d=C3=A9c. 14 2016, Rajat Jain <rajatja@google.com> wrote:\n" + " \n" + " On mer., d\303\251c. 14 2016, Rajat Jain <rajatja-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org> wrote:\n" "\n" "In your title unless you speak about the comic books you should do a\n" "s/Marvel/Marvell/ :)\n" @@ -35,21 +36,18 @@ "> Thus, we read the pin number etc from the device tree node and send\n" "> a command to the chip.\n" ">\n" - "> Signed-off-by: Rajat Jain <rajatja@google.com>\n" + "> Signed-off-by: Rajat Jain <rajatja-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>\n" "> ---\n" "> Note that while I would have liked to name the compatible string as more\n" "> like \"marvell, usb8997-bt\", the devicetrees/bindings/usb/usb-device.txt\n" "> requires the compatible property to be of the form \"usbVID,PID\".\n" ">\n" - "> .../{marvell-bt-sd8xxx.txt =3D> marvell-bt-8xxx.txt} | 25 ++++++++-\n" - "> drivers/bluetooth/btusb.c | 59 ++++++++++++++++=\n" - "++++++\n" + "> .../{marvell-bt-sd8xxx.txt => marvell-bt-8xxx.txt} | 25 ++++++++-\n" + "> drivers/bluetooth/btusb.c | 59 ++++++++++++++++++++++\n" "> 2 files changed, 82 insertions(+), 2 deletions(-)\n" - "> rename Documentation/devicetree/bindings/net/{marvell-bt-sd8xxx.txt =3D>=\n" - " marvell-bt-8xxx.txt} (76%)\n" + "> rename Documentation/devicetree/bindings/net/{marvell-bt-sd8xxx.txt => marvell-bt-8xxx.txt} (76%)\n" ">\n" - "> diff --git a/Documentation/devicetree/bindings/net/marvell-bt-sd8xxx.txt =\n" - "b/Documentation/devicetree/bindings/net/marvell-bt-8xxx.txt\n" + "> diff --git a/Documentation/devicetree/bindings/net/marvell-bt-sd8xxx.txt b/Documentation/devicetree/bindings/net/marvell-bt-8xxx.txt\n" "> similarity index 76%\n" "> rename from Documentation/devicetree/bindings/net/marvell-bt-sd8xxx.txt\n" "> rename to Documentation/devicetree/bindings/net/marvell-bt-8xxx.txt\n" @@ -60,79 +58,75 @@ "> -Marvell 8897/8997 (sd8897/sd8997) bluetooth SDIO devices\n" "> +Marvell 8897/8997 (sd8897/sd8997) bluetooth devices (SDIO or USB based)\n" "> ------\n" - ">=20=20\n" + "> \n" "> Required properties:\n" "> @@ -6,11 +6,13 @@ Required properties:\n" "> - compatible : should be one of the following:\n" "> \t* \"marvell,sd8897-bt\"\n" "> \t* \"marvell,sd8997-bt\"\n" "> +\t* \"usb1286,204e\"\n" - ">=20=20\n" + "> \n" "> Optional properties:\n" - ">=20=20\n" + "> \n" "> - marvell,cal-data: Calibration data downloaded to the device during\n" "> \t\t initialization. This is an array of 28 values(u8).\n" "> +\t\t This is only applicable to SDIO devices.\n" - ">=20=20\n" - "> - marvell,wakeup-pin: It represents wakeup pin number of the bluetooth=\n" - " chip.\n" + "> \n" + "> - marvell,wakeup-pin: It represents wakeup pin number of the bluetooth chip.\n" "> \t\t firmware will use the pin to wakeup host system (u16).\n" "> @@ -29,7 +31,9 @@ Example:\n" "> IRQ pin 119 is used as system wakeup source interrupt.\n" - "> wakeup pin 13 and gap 100ms are configured so that firmware can wakeup h=\n" - "ost\n" + "> wakeup pin 13 and gap 100ms are configured so that firmware can wakeup host\n" "> using this device side pin and wakeup latency.\n" "> -calibration data is also available in below example.\n" "> +\n" "> +Example for SDIO device follows (calibration data is also available in\n" "> +below example).\n" - ">=20=20\n" + "> \n" "> &mmc3 {\n" - "> \tstatus =3D \"okay\";\n" + "> \tstatus = \"okay\";\n" "> @@ -54,3 +58,20 @@ calibration data is also available in below example.\n" - "> \t\tmarvell,wakeup-gap-ms =3D /bits/ 16 <0x64>;\n" + "> \t\tmarvell,wakeup-gap-ms = /bits/ 16 <0x64>;\n" "> \t};\n" "> };\n" "> +\n" "> +Example for USB device:\n" "> +\n" "> +&usb_host1_ohci {\n" - "> + status =3D \"okay\";\n" - "> + #address-cells =3D <1>;\n" - "> + #size-cells =3D <0>;\n" + "> + status = \"okay\";\n" + "> + #address-cells = <1>;\n" + "> + #size-cells = <0>;\n" "> +\n" "> + mvl_bt1: bt@1 {\n" - "> +\tcompatible =3D \"usb1286,204e\";\n" - "> +\treg =3D <1>;\n" - "> +\tinterrupt-parent =3D <&gpio0>;\n" - "> +\tinterrupts =3D <119 IRQ_TYPE_LEVEL_LOW>;\n" - "> +\tmarvell,wakeup-pin =3D /bits/ 16 <0x0d>;\n" - "> +\tmarvell,wakeup-gap-ms =3D /bits/ 16 <0x64>;\n" + "> +\tcompatible = \"usb1286,204e\";\n" + "> +\treg = <1>;\n" + "> +\tinterrupt-parent = <&gpio0>;\n" + "> +\tinterrupts = <119 IRQ_TYPE_LEVEL_LOW>;\n" + "> +\tmarvell,wakeup-pin = /bits/ 16 <0x0d>;\n" + "> +\tmarvell,wakeup-gap-ms = /bits/ 16 <0x64>;\n" "> + };\n" "> +};\n" "> diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c\n" "> index 32a6f22..99d7f6d 100644\n" "> --- a/drivers/bluetooth/btusb.c\n" "> +++ b/drivers/bluetooth/btusb.c\n" - "> @@ -2343,6 +2343,58 @@ static int btusb_shutdown_intel(struct hci_dev *hd=\n" - "ev)\n" + "> @@ -2343,6 +2343,58 @@ static int btusb_shutdown_intel(struct hci_dev *hdev)\n" "> \treturn 0;\n" "> }\n" - ">=20=20\n" + "> \n" "> +#ifdef CONFIG_PM\n" - "> +static const struct of_device_id mvl_oob_wake_match_table[] =3D {\n" - "> +\t{ .compatible =3D \"usb1286,204e\" },\n" + "> +static const struct of_device_id mvl_oob_wake_match_table[] = {\n" + "> +\t{ .compatible = \"usb1286,204e\" },\n" "> +\t{ }\n" "> +};\n" "> +MODULE_DEVICE_TABLE(of, mvl_oob_wake_match_table);\n" "> +\n" - "> +/* Configure an out-of-band gpio as wake-up pin, if specified in device =\n" - "tree */\n" + "> +/* Configure an out-of-band gpio as wake-up pin, if specified in device tree */\n" "> +static int marvell_config_oob_wake(struct hci_dev *hdev)\n" "> +{\n" "> +\tstruct sk_buff *skb;\n" - "> +\tstruct btusb_data *data =3D hci_get_drvdata(hdev);\n" - "> +\tstruct device *dev =3D &data->udev->dev;\n" + "> +\tstruct btusb_data *data = hci_get_drvdata(hdev);\n" + "> +\tstruct device *dev = &data->udev->dev;\n" "> +\tu16 pin, gap, opcode;\n" "> +\tint ret;\n" "> +\tu8 cmd[5];\n" @@ -145,24 +139,23 @@ "> +\t\treturn -EINVAL;\n" "> +\n" "> +\t/* Vendor specific command to configure a GPIO as wake-up pin */\n" - "> +\topcode =3D hci_opcode_pack(0x3F, 0x59);\n" - "> +\tcmd[0] =3D opcode & 0xFF;\n" - "> +\tcmd[1] =3D opcode >> 8;\n" - "> +\tcmd[2] =3D 2; /* length of parameters that follow */\n" - "> +\tcmd[3] =3D pin;\n" - "> +\tcmd[4] =3D gap; /* time in ms, for which wakeup pin should be asserted =\n" - "*/\n" + "> +\topcode = hci_opcode_pack(0x3F, 0x59);\n" + "> +\tcmd[0] = opcode & 0xFF;\n" + "> +\tcmd[1] = opcode >> 8;\n" + "> +\tcmd[2] = 2; /* length of parameters that follow */\n" + "> +\tcmd[3] = pin;\n" + "> +\tcmd[4] = gap; /* time in ms, for which wakeup pin should be asserted */\n" "> +\n" - "> +\tskb =3D bt_skb_alloc(sizeof(cmd), GFP_KERNEL);\n" + "> +\tskb = bt_skb_alloc(sizeof(cmd), GFP_KERNEL);\n" "> +\tif (!skb) {\n" "> +\t\tbt_dev_err(hdev, \"%s: No memory\\n\", __func__);\n" "> +\t\treturn -ENOMEM;\n" "> +\t}\n" "> +\n" "> +\tmemcpy(skb_put(skb, sizeof(cmd)), cmd, sizeof(cmd));\n" - "> +\thci_skb_pkt_type(skb) =3D HCI_COMMAND_PKT;\n" + "> +\thci_skb_pkt_type(skb) = HCI_COMMAND_PKT;\n" "> +\n" - "> +\tret =3D btusb_send_frame(hdev, skb);\n" + "> +\tret = btusb_send_frame(hdev, skb);\n" "> +\tif (ret) {\n" "> +\t\tbt_dev_err(hdev, \"%s: configuration failed\\n\", __func__);\n" "> +\t\tkfree_skb(skb);\n" @@ -177,27 +170,27 @@ "> \t\t\t\t const bdaddr_t *bdaddr)\n" "> {\n" "> @@ -2917,6 +2969,13 @@ static int btusb_probe(struct usb_interface *intf,\n" - "> \terr =3D btusb_config_oob_wake(hdev);\n" + "> \terr = btusb_config_oob_wake(hdev);\n" "> \tif (err)\n" "> \t\tgoto out_free_dev;\n" "> +\n" "> +\t/* Marvel devices may need a specific chip configuration */\n" "> +\tif (id->driver_info & BTUSB_MARVELL && data->oob_wake_irq) {\n" - "> +\t\terr =3D marvell_config_oob_wake(hdev);\n" + "> +\t\terr = marvell_config_oob_wake(hdev);\n" "> +\t\tif (err)\n" "> +\t\t\tgoto out_free_dev;\n" "> +\t}\n" "> #endif\n" "> \tif (id->driver_info & BTUSB_CW6622)\n" "> \t\tset_bit(HCI_QUIRK_BROKEN_STORED_LINK_KEY, &hdev->quirks);\n" - "> --=20\n" + "> -- \n" "> 2.8.0.rc3.226.g39d4020\n" ">\n" "\n" - "--=20\n" + "-- \n" "Gregory Clement, Free Electrons\n" "Kernel, drivers, real-time and embedded Linux\n" "development, consulting, training and support.\n" http://free-electrons.com -29c72ec53291d739ce66aac347f2f417097611c36022f580660f4d4f457ff224 +28a39f9a33cd474351602f49ba5dc6a291fac0fcb0c8669b4329b98d25aa8cd0
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.