bluetooth: rfkill-bt: enalbe 32K for ap6356
Change-Id: I71a14f38ab1d46bbf3bfc991140a20d8c6a27eec Signed-off-by: Xu Xuehui <xxh@rock-chips.com>
This commit is contained in:
parent
2d43f4dc41
commit
c75676bb6f
2 changed files with 10 additions and 2 deletions
|
|
@ -22,6 +22,7 @@
|
|||
|
||||
#include <linux/types.h>
|
||||
#include <linux/rfkill.h>
|
||||
#include <linux/clk.h>
|
||||
|
||||
#define RFKILL_RK_GPIO_NAME_SIZE 64
|
||||
|
||||
|
|
@ -63,6 +64,7 @@ struct rfkill_rk_platform_data {
|
|||
struct rfkill_rk_gpio wake_gpio; // Host wake or sleep BT
|
||||
struct rfkill_rk_irq wake_host_irq; // BT wakeup host
|
||||
struct rfkill_rk_gpio rts_gpio;
|
||||
struct clk *ext_clk;
|
||||
};
|
||||
|
||||
int rfkill_get_bt_power_state(int *power, bool *toggle);
|
||||
|
|
|
|||
|
|
@ -522,7 +522,13 @@ static int bluetooth_platdata_parse_dt(struct device *dev,
|
|||
LOG("%s: get property: BT,wake_host_irq = %d.\n", __func__, gpio);
|
||||
} else data->wake_host_irq.gpio.io = -1;
|
||||
|
||||
return 0;
|
||||
data->ext_clk = devm_clk_get(dev, "ext_clock");
|
||||
if (IS_ERR(data->ext_clk)) {
|
||||
LOG("%s: clk_get failed!!!.\n", __func__);
|
||||
} else {
|
||||
clk_prepare_enable(data->ext_clk);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#endif //CONFIG_OF
|
||||
|
||||
|
|
@ -696,7 +702,7 @@ static int rfkill_rk_remove(struct platform_device *pdev)
|
|||
|
||||
if (gpio_is_valid(rfkill->pdata->poweron_gpio.io))
|
||||
gpio_free(rfkill->pdata->poweron_gpio.io);
|
||||
|
||||
clk_disable_unprepare(rfkill->pdata->ext_clk);
|
||||
g_rfkill = NULL;
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue