Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1601358 > unrolled thread

[PATCH] Bluetooth: hci_bcm: Fix clock (un)prepare

Started byJohn Keeping <john@metanate.com>
First post2017-03-15 13:30 +0100
Last post2017-03-27 16:10 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH] Bluetooth: hci_bcm: Fix clock (un)prepare John Keeping <john@metanate.com> - 2017-03-15 13:30 +0100
    Re: [PATCH] Bluetooth: hci_bcm: Fix clock (un)prepare Marcel Holtmann <marcel@holtmann.org> - 2017-03-27 16:10 +0200

#1601358 — [PATCH] Bluetooth: hci_bcm: Fix clock (un)prepare

FromJohn Keeping <john@metanate.com>
Date2017-03-15 13:30 +0100
Subject[PATCH] Bluetooth: hci_bcm: Fix clock (un)prepare
Message-ID<tlgdY-7yR-5@gated-at.bofh.it>
The hci_bcm driver currently does not prepare/unprepare the clock and
goes directly to enable, but as the documentation for clk_enable says,
clk_prepare must be called before clk_enable.

Signed-off-by: John Keeping <john@metanate.com>
---
 drivers/bluetooth/hci_bcm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/bluetooth/hci_bcm.c b/drivers/bluetooth/hci_bcm.c
index 5262a2077d7a..c7d3c6842bcf 100644
--- a/drivers/bluetooth/hci_bcm.c
+++ b/drivers/bluetooth/hci_bcm.c
@@ -146,13 +146,13 @@ static bool bcm_device_exists(struct bcm_device *device)
 static int bcm_gpio_set_power(struct bcm_device *dev, bool powered)
 {
 	if (powered && !IS_ERR(dev->clk) && !dev->clk_enabled)
-		clk_enable(dev->clk);
+		clk_prepare_enable(dev->clk);
 
 	gpiod_set_value(dev->shutdown, powered);
 	gpiod_set_value(dev->device_wakeup, powered);
 
 	if (!powered && !IS_ERR(dev->clk) && dev->clk_enabled)
-		clk_disable(dev->clk);
+		clk_disable_unprepare(dev->clk);
 
 	dev->clk_enabled = powered;
 
-- 
2.12.0.377.gf910686b23.dirty

[toc] | [next] | [standalone]


#1609870

FromMarcel Holtmann <marcel@holtmann.org>
Date2017-03-27 16:10 +0200
Message-ID<tpDvl-Li-29@gated-at.bofh.it>
In reply to#1601358
Hi John,

> The hci_bcm driver currently does not prepare/unprepare the clock and
> goes directly to enable, but as the documentation for clk_enable says,
> clk_prepare must be called before clk_enable.
> 
> Signed-off-by: John Keeping <john@metanate.com>
> ---
> drivers/bluetooth/hci_bcm.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)

patch has been applied to bluetooth-next tree.

Regards

Marcel

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web