From 613535e3904f7615aff655384c65cd897312e3b0 Mon Sep 17 00:00:00 2001 From: Lionel VITTE Date: Thu, 11 Jul 2019 14:11:59 +0200 Subject: [PATCH 03/30] ARM stm32mp1 r2 BLUETOOTH CHAR --- drivers/bluetooth/hci_bcm.c | 3 ++- drivers/char/hw_random/stm32-rng.c | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/bluetooth/hci_bcm.c b/drivers/bluetooth/hci_bcm.c index 8001323..31da580 100644 --- a/drivers/bluetooth/hci_bcm.c +++ b/drivers/bluetooth/hci_bcm.c @@ -1299,7 +1299,8 @@ static int bcm_serdev_probe(struct serdev_device *serdev) if (!bcmdev->shutdown) { dev_warn(&serdev->dev, "No reset resource, using default baud rate\n"); - bcmdev->oper_speed = bcmdev->init_speed; + if (!bcmdev->oper_speed) + bcmdev->oper_speed = bcmdev->init_speed; } err = bcm_gpio_set_power(bcmdev, false); diff --git a/drivers/char/hw_random/stm32-rng.c b/drivers/char/hw_random/stm32-rng.c index 042860d..0ef5b6a 100644 --- a/drivers/char/hw_random/stm32-rng.c +++ b/drivers/char/hw_random/stm32-rng.c @@ -161,6 +161,7 @@ static int stm32_rng_probe(struct platform_device *ofdev) #endif priv->rng.read = stm32_rng_read, priv->rng.priv = (unsigned long) dev; + priv->rng.quality = 900; pm_runtime_set_autosuspend_delay(dev, 100); pm_runtime_use_autosuspend(dev); @@ -169,6 +170,13 @@ static int stm32_rng_probe(struct platform_device *ofdev) return devm_hwrng_register(dev, &priv->rng); } +static int stm32_rng_remove(struct platform_device *ofdev) +{ + pm_runtime_disable(&ofdev->dev); + + return 0; +} + #ifdef CONFIG_PM static int stm32_rng_runtime_suspend(struct device *dev) { @@ -210,6 +218,7 @@ static struct platform_driver stm32_rng_driver = { .of_match_table = stm32_rng_match, }, .probe = stm32_rng_probe, + .remove = stm32_rng_remove, }; module_platform_driver(stm32_rng_driver); -- 2.7.4