From 1813594755c38c3a75761886aab188ec57fa04c1 Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Wed, 14 Jun 2017 17:39:17 +0100 Subject: Add patch set to fix Hikey bluetooth --- arm-hikey-fixWiFi.patch | 180 ++++++++++++++++++++++++++++++++++++++++++++++++ kernel.spec | 1 + 2 files changed, 181 insertions(+) diff --git a/arm-hikey-fixWiFi.patch b/arm-hikey-fixWiFi.patch index 9ea70efd5..61d838d3f 100644 --- a/arm-hikey-fixWiFi.patch +++ b/arm-hikey-fixWiFi.patch @@ -499,3 +499,183 @@ index 5132d8ed4664..49f6a6242cf9 100644 -- 2.13.0 +From patchwork Wed Jun 7 09:08:20 2017 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Subject: [1/3] dt-bindings: net: Add binding for the external clock for TI + WiLink +From: Ulf Hansson +X-Patchwork-Id: 9770985 +Message-Id: <1496826502-1339-2-git-send-email-ulf.hansson@linaro.org> +To: Marcel Holtmann , + Gustavo Padovan , + Johan Hedberg , linux-bluetooth@vger.kernel.org +Cc: Rob Herring , Ulf Hansson , + Arnd Bergmann , Satish Patel , + Daniel Lezcano , Wei Xu , + John Stultz , Olof Johansson , + linux-arm-kernel@lists.infradead.org +Date: Wed, 7 Jun 2017 11:08:20 +0200 + +The external clock is provided to the TI WiLink combo chip and it's needed +for any of the transport interfaces. However let's make it optional to +avoid breaking existing platforms that yet doesn't specify the clock. + +Fixes: ea452678734e ("arm64: dts: hikey: Fix WiFi support") +Signed-off-by: Ulf Hansson +--- + Documentation/devicetree/bindings/net/ti,wilink-st.txt | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/Documentation/devicetree/bindings/net/ti,wilink-st.txt b/Documentation/devicetree/bindings/net/ti,wilink-st.txt +index cbad73a..3404a4a 100644 +--- a/Documentation/devicetree/bindings/net/ti,wilink-st.txt ++++ b/Documentation/devicetree/bindings/net/ti,wilink-st.txt +@@ -22,6 +22,10 @@ Optional properties: + - enable-gpios : GPIO signal controlling enabling of BT. Active high. + - vio-supply : Vio input supply (1.8V) + - vbat-supply : Vbat input supply (2.9-4.8V) ++ - clocks : Must contain an entry, for each entry in clock-names. ++ See ../clocks/clock-bindings.txt for details. ++ - clock-names : Must include the following entry: ++ "ext_clock" (External clock provided to the TI combo chip). + + Example: + +@@ -31,5 +35,7 @@ Example: + bluetooth { + compatible = "ti,wl1835-st"; + enable-gpios = <&gpio1 7 GPIO_ACTIVE_HIGH>; ++ clocks = <&clk32k_wl18xx>; ++ clock-names = "ext_clock"; + }; + }; +From patchwork Wed Jun 7 09:08:21 2017 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Subject: [2/3] Bluetooth: hci_ll: Add support for the external clock +From: Ulf Hansson +X-Patchwork-Id: 9770987 +Message-Id: <1496826502-1339-3-git-send-email-ulf.hansson@linaro.org> +To: Marcel Holtmann , + Gustavo Padovan , + Johan Hedberg , linux-bluetooth@vger.kernel.org +Cc: Rob Herring , Ulf Hansson , + Arnd Bergmann , Satish Patel , + Daniel Lezcano , Wei Xu , + John Stultz , Olof Johansson , + linux-arm-kernel@lists.infradead.org +Date: Wed, 7 Jun 2017 11:08:21 +0200 + +Add support to manage the external clock provided to the WiLink combo chip +as it's needed for any of the transport interfaces. + +To avoid breaking platforms not yet specifying the external clock, we make +it optional. In case the clock is successfully fetched during ->probe(), +let's manage it via the ->open|close() callbacks, to make sure the device +get properly powered on/off. + +Fixes: ea452678734e ("arm64: dts: hikey: Fix WiFi support") +Signed-off-by: Ulf Hansson +--- + drivers/bluetooth/hci_ll.c | 14 +++++++++++++- + 1 file changed, 13 insertions(+), 1 deletion(-) + +diff --git a/drivers/bluetooth/hci_ll.c b/drivers/bluetooth/hci_ll.c +index adc444f..68f3d16 100644 +--- a/drivers/bluetooth/hci_ll.c ++++ b/drivers/bluetooth/hci_ll.c +@@ -48,6 +48,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -84,6 +85,7 @@ struct ll_device { + struct hci_uart hu; + struct serdev_device *serdev; + struct gpio_desc *enable_gpio; ++ struct clk *ext_clk; + }; + + struct ll_struct { +@@ -146,8 +148,12 @@ static int ll_open(struct hci_uart *hu) + + hu->priv = ll; + +- if (hu->serdev) ++ if (hu->serdev) { ++ struct ll_device *lldev = serdev_device_get_drvdata(hu->serdev); + serdev_device_open(hu->serdev); ++ if (!IS_ERR(lldev->ext_clk)) ++ clk_prepare_enable(lldev->ext_clk); ++ } + + return 0; + } +@@ -181,6 +187,8 @@ static int ll_close(struct hci_uart *hu) + struct ll_device *lldev = serdev_device_get_drvdata(hu->serdev); + gpiod_set_value_cansleep(lldev->enable_gpio, 0); + ++ clk_disable_unprepare(lldev->ext_clk); ++ + serdev_device_close(hu->serdev); + } + +@@ -720,6 +728,10 @@ static int hci_ti_probe(struct serdev_device *serdev) + if (IS_ERR(lldev->enable_gpio)) + return PTR_ERR(lldev->enable_gpio); + ++ lldev->ext_clk = devm_clk_get(&serdev->dev, "ext_clock"); ++ if (IS_ERR(lldev->ext_clk) && PTR_ERR(lldev->ext_clk) != -ENOENT) ++ return PTR_ERR(lldev->ext_clk); ++ + of_property_read_u32(serdev->dev.of_node, "max-speed", &max_speed); + hci_uart_set_speeds(hu, 115200, max_speed); + +From patchwork Wed Jun 7 09:08:22 2017 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Subject: [3/3] arm64: dts: hikey: Add external clock to the Bluetooth node +From: Ulf Hansson +X-Patchwork-Id: 9770989 +Message-Id: <1496826502-1339-4-git-send-email-ulf.hansson@linaro.org> +To: Marcel Holtmann , + Gustavo Padovan , + Johan Hedberg , linux-bluetooth@vger.kernel.org +Cc: Rob Herring , Ulf Hansson , + Arnd Bergmann , Satish Patel , + Daniel Lezcano , Wei Xu , + John Stultz , Olof Johansson , + linux-arm-kernel@lists.infradead.org +Date: Wed, 7 Jun 2017 11:08:22 +0200 + +To make the TI WiLink chip work again for Bluetooth, let's add the missing +external clock to the Bluetooth node, such the driver can deal properly +with it during power on/off. + +Fixes: ea452678734e ("arm64: dts: hikey: Fix WiFi support") +Cc: Wei Xu +Signed-off-by: Ulf Hansson +--- + arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts b/arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts +index 49f6a62..5cdfe73 100644 +--- a/arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts ++++ b/arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts +@@ -141,6 +141,8 @@ + bluetooth { + compatible = "ti,wl1835-st"; + enable-gpios = <&gpio1 7 GPIO_ACTIVE_HIGH>; ++ clocks = <&pmic>; ++ clock-names = "ext_clock"; + }; + }; + diff --git a/kernel.spec b/kernel.spec index 5ea600790..cce87fbc7 100644 --- a/kernel.spec +++ b/kernel.spec @@ -2226,6 +2226,7 @@ fi %changelog * Wed Jun 14 2017 Peter Robinson - Minor fixes for sun8i-dwmac plus extra device support +- Add patch set to fix Hikey bluetooth * Wed Jun 14 2017 Laura Abbott - Add fix for EFI BGRT crash (rhbz 1461337) -- cgit