#include <linux/types.h>
#include <linux/rfkill.h>
+#include <linux/clk.h>
#define RFKILL_RK_GPIO_NAME_SIZE 64
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);
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
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;