diff options
author | Amitkumar Karwar <akarwar@marvell.com> | 2014-11-19 01:28:33 -0800 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2014-11-19 16:22:42 +0100 |
commit | 025a60a752261fd479a4bb74cf7cb04fdc313ec7 (patch) | |
tree | 8a8d400406c7e9cb31d58565a9aa0d821c3407b7 /drivers/bluetooth | |
parent | 098ea6bc4cb5890d09b1b79154fa11182e0f71e0 (diff) | |
download | linux-025a60a752261fd479a4bb74cf7cb04fdc313ec7.tar.gz linux-025a60a752261fd479a4bb74cf7cb04fdc313ec7.tar.bz2 linux-025a60a752261fd479a4bb74cf7cb04fdc313ec7.zip |
Bluetooth: btmrvl: add DT-bindings for gpio-gap
This can be used to have GPIO host wakeup method suitable for the
platform and configurable GAP for host sleep handshake.
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'drivers/bluetooth')
-rw-r--r-- | drivers/bluetooth/btmrvl_main.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/bluetooth/btmrvl_main.c b/drivers/bluetooth/btmrvl_main.c index 2909bca6b8b6..e43c495e8181 100644 --- a/drivers/bluetooth/btmrvl_main.c +++ b/drivers/bluetooth/btmrvl_main.c @@ -492,13 +492,18 @@ static int btmrvl_download_cal_data(struct btmrvl_private *priv, return 0; } -static int btmrvl_cal_data_dt(struct btmrvl_private *priv) +static int btmrvl_check_device_tree(struct btmrvl_private *priv) { struct device_node *dt_node; u8 cal_data[BT_CAL_HDR_LEN + BT_CAL_DATA_SIZE]; int ret; + u32 val; for_each_compatible_node(dt_node, NULL, "btmrvl,cfgdata") { + ret = of_property_read_u32(dt_node, "btmrvl,gpio-gap", &val); + if (!ret) + priv->btmrvl_dev.gpio_gap = val; + ret = of_property_read_u8_array(dt_node, "btmrvl,cal-data", cal_data + BT_CAL_HDR_LEN, BT_CAL_DATA_SIZE); @@ -523,14 +528,15 @@ static int btmrvl_setup(struct hci_dev *hdev) btmrvl_send_module_cfg_cmd(priv, MODULE_BRINGUP_REQ); - btmrvl_cal_data_dt(priv); + priv->btmrvl_dev.gpio_gap = 0xffff; + + btmrvl_check_device_tree(priv); btmrvl_pscan_window_reporting(priv, 0x01); priv->btmrvl_dev.psmode = 1; btmrvl_enable_ps(priv); - priv->btmrvl_dev.gpio_gap = 0xffff; btmrvl_send_hscfg_cmd(priv); return 0; |