From patchwork Sun Feb 25 14:10:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [1/4] Bluetooth: hci_bcm: Make shutdown and device wake GPIO optional From: Stefan Wahren X-Patchwork-Id: 10240917 Message-Id: <1519567855-26105-2-git-send-email-stefan.wahren@i2se.com> To: Loic Poulain , =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Danis?= , Marcel Holtmann , Johan Hedberg , Eric Anholt , Rob Herring , Mark Rutland Cc: Stefan Wahren , devicetree@vger.kernel.org, Florian Fainelli , Phil Elwell , linux-bluetooth@vger.kernel.org, Lukas Wunner , linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org Date: Sun, 25 Feb 2018 15:10:52 +0100 According to the devicetree binding the shutdown and device wake GPIOs are optional. Since commit 3e81a4ca51a1 ("Bluetooth: hci_bcm: Mandate presence of shutdown and device wake GPIO") this driver won't probe anymore on Raspberry Pi 3 and Zero W (no device wake GPIO connected). So fix this regression by reverting this commit partially. Cc: Lukas Wunner Fixes: 3e81a4ca51a1 ("Bluetooth: hci_bcm: Mandate presence of shutdown and device wake GPIO") Signed-off-by: Stefan Wahren --- drivers/bluetooth/hci_bcm.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/bluetooth/hci_bcm.c b/drivers/bluetooth/hci_bcm.c index 0438a64..f8728eb 100644 --- a/drivers/bluetooth/hci_bcm.c +++ b/drivers/bluetooth/hci_bcm.c @@ -922,12 +922,14 @@ static int bcm_get_resources(struct bcm_device *dev) dev->clk = devm_clk_get(dev->dev, NULL); - dev->device_wakeup = devm_gpiod_get(dev->dev, "device-wakeup", - GPIOD_OUT_LOW); + dev->device_wakeup = devm_gpiod_get_optional(dev->dev, + "device-wakeup", + GPIOD_OUT_LOW); if (IS_ERR(dev->device_wakeup)) return PTR_ERR(dev->device_wakeup); - dev->shutdown = devm_gpiod_get(dev->dev, "shutdown", GPIOD_OUT_LOW); + dev->shutdown = devm_gpiod_get_optional(dev->dev, "shutdown", + GPIOD_OUT_LOW); if (IS_ERR(dev->shutdown)) return PTR_ERR(dev->shutdown); From patchwork Sun Feb 25 14:10:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [2/4] ARM: dts: bcm283x: Apply pull settings to Zero W relevant groups From: Stefan Wahren X-Patchwork-Id: 10240919 Message-Id: <1519567855-26105-3-git-send-email-stefan.wahren@i2se.com> To: Loic Poulain , =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Danis?= , Marcel Holtmann , Johan Hedberg , Eric Anholt , Rob Herring , Mark Rutland Cc: Stefan Wahren , devicetree@vger.kernel.org, Florian Fainelli , Phil Elwell , linux-bluetooth@vger.kernel.org, Lukas Wunner , linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org Date: Sun, 25 Feb 2018 15:10:53 +0100 Instead of keeping the firmware's pull settings, we better apply them via the devicetree pin control. Start with the RPi Zero W relevant first to keep the effort low. Signed-off-by: Stefan Wahren --- arch/arm/boot/dts/bcm283x.dtsi | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/arm/boot/dts/bcm283x.dtsi b/arch/arm/boot/dts/bcm283x.dtsi index 8d9a0df..1a50b67 100644 --- a/arch/arm/boot/dts/bcm283x.dtsi +++ b/arch/arm/boot/dts/bcm283x.dtsi @@ -223,6 +223,7 @@ gpclk2_gpio43: gpclk2_gpio43 { brcm,pins = <43>; brcm,function = ; + brcm,pull = ; }; i2c0_gpio0: i2c0_gpio0 { @@ -335,10 +336,12 @@ uart0_ctsrts_gpio30: uart0_ctsrts_gpio30 { brcm,pins = <30 31>; brcm,function = ; + brcm,pull = ; }; uart0_gpio32: uart0_gpio32 { brcm,pins = <32 33>; brcm,function = ; + brcm,pull = ; }; uart0_gpio36: uart0_gpio36 { brcm,pins = <36 37>;