linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: hci_bcm: Fix clock (un)prepare
@ 2017-03-15 12:20 John Keeping
  2017-03-15 12:20 ` John Keeping
  0 siblings, 1 reply; 3+ messages in thread
From: John Keeping @ 2017-03-15 12:20 UTC (permalink / raw)
  To: linux-bluetooth
  Cc: linux-kernel, Marcel Holtmann, Gustavo Padovan, Johan Hedberg,
	John Keeping

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

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

* [PATCH] Bluetooth: hci_bcm: Fix clock (un)prepare
  2017-03-15 12:20 [PATCH] Bluetooth: hci_bcm: Fix clock (un)prepare John Keeping
@ 2017-03-15 12:20 ` John Keeping
  2017-03-27 14:07   ` Marcel Holtmann
  0 siblings, 1 reply; 3+ messages in thread
From: John Keeping @ 2017-03-15 12:20 UTC (permalink / raw)
  To: linux-bluetooth
  Cc: linux-kernel, Marcel Holtmann, Gustavo Padovan, Johan Hedberg,
	John Keeping

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

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

* Re: [PATCH] Bluetooth: hci_bcm: Fix clock (un)prepare
  2017-03-15 12:20 ` John Keeping
@ 2017-03-27 14:07   ` Marcel Holtmann
  0 siblings, 0 replies; 3+ messages in thread
From: Marcel Holtmann @ 2017-03-27 14:07 UTC (permalink / raw)
  To: John Keeping
  Cc: linux-bluetooth, linux-kernel, Gustavo F. Padovan, Johan Hedberg

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


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

end of thread, other threads:[~2017-03-27 14:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-15 12:20 [PATCH] Bluetooth: hci_bcm: Fix clock (un)prepare John Keeping
2017-03-15 12:20 ` John Keeping
2017-03-27 14:07   ` Marcel Holtmann

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