Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 730ce397 authored by John Keeping's avatar John Keeping Committed by Marcel Holtmann
Browse files

Bluetooth: hci_bcm: Fix clock (un)prepare



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: default avatarJohn Keeping <john@metanate.com>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent dab6b5da
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -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)
static int bcm_gpio_set_power(struct bcm_device *dev, bool powered)
{
{
	if (powered && !IS_ERR(dev->clk) && !dev->clk_enabled)
	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->shutdown, powered);
	gpiod_set_value(dev->device_wakeup, powered);
	gpiod_set_value(dev->device_wakeup, powered);


	if (!powered && !IS_ERR(dev->clk) && dev->clk_enabled)
	if (!powered && !IS_ERR(dev->clk) && dev->clk_enabled)
		clk_disable(dev->clk);
		clk_disable_unprepare(dev->clk);


	dev->clk_enabled = powered;
	dev->clk_enabled = powered;