From: Xu Xuehui Date: Wed, 17 Aug 2016 09:41:08 +0000 (+0800) Subject: bluetooth: rfkill-bt: enalbe 32K for ap6356 X-Git-Tag: firefly_0821_release~1693 X-Git-Url: http://plrg.eecs.uci.edu/git/?p=firefly-linux-kernel-4.4.55.git;a=commitdiff_plain;h=c75676bb6f1a2dd45d3074dc854445ec37507a2b;ds=sidebyside bluetooth: rfkill-bt: enalbe 32K for ap6356 Change-Id: I71a14f38ab1d46bbf3bfc991140a20d8c6a27eec Signed-off-by: Xu Xuehui --- diff --git a/include/linux/rfkill-bt.h b/include/linux/rfkill-bt.h index 4a014b64a92c..c4174b156580 100755 --- a/include/linux/rfkill-bt.h +++ b/include/linux/rfkill-bt.h @@ -22,6 +22,7 @@ #include #include +#include #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); diff --git a/net/rfkill/rfkill-bt.c b/net/rfkill/rfkill-bt.c index 11e182882365..332eb47b0986 100644 --- a/net/rfkill/rfkill-bt.c +++ b/net/rfkill/rfkill-bt.c @@ -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;