Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Amitkumar Karwar and committed by
Marcel Holtmann
025a60a7 098ea6bc

+16 -3
+7
Documentation/devicetree/bindings/btmrvl.txt
··· 10 10 - btmrvl,cal-data : Calibration data downloaded to the device during 11 11 initialization. This is an array of 28 values(u8). 12 12 13 + - btmrvl,gpio-gap : gpio and gap (in msecs) combination to be 14 + configured. 15 + 13 16 Example: 17 + 18 + GPIO pin 13 is configured as a wakeup source and GAP is set to 100 msecs 19 + in below example. 14 20 15 21 btmrvl { 16 22 compatible = "btmrvl,cfgdata"; ··· 25 19 0x37 0x01 0x1c 0x00 0xff 0xff 0xff 0xff 0x01 0x7f 0x04 0x02 26 20 0x00 0x00 0xba 0xce 0xc0 0xc6 0x2d 0x00 0x00 0x00 0x00 0x00 27 21 0x00 0x00 0xf0 0x00>; 22 + btmrvl,gpio-gap = <0x0d64>; 28 23 };
+9 -3
drivers/bluetooth/btmrvl_main.c
··· 492 492 return 0; 493 493 } 494 494 495 - static int btmrvl_cal_data_dt(struct btmrvl_private *priv) 495 + static int btmrvl_check_device_tree(struct btmrvl_private *priv) 496 496 { 497 497 struct device_node *dt_node; 498 498 u8 cal_data[BT_CAL_HDR_LEN + BT_CAL_DATA_SIZE]; 499 499 int ret; 500 + u32 val; 500 501 501 502 for_each_compatible_node(dt_node, NULL, "btmrvl,cfgdata") { 503 + ret = of_property_read_u32(dt_node, "btmrvl,gpio-gap", &val); 504 + if (!ret) 505 + priv->btmrvl_dev.gpio_gap = val; 506 + 502 507 ret = of_property_read_u8_array(dt_node, "btmrvl,cal-data", 503 508 cal_data + BT_CAL_HDR_LEN, 504 509 BT_CAL_DATA_SIZE); ··· 528 523 529 524 btmrvl_send_module_cfg_cmd(priv, MODULE_BRINGUP_REQ); 530 525 531 - btmrvl_cal_data_dt(priv); 526 + priv->btmrvl_dev.gpio_gap = 0xffff; 527 + 528 + btmrvl_check_device_tree(priv); 532 529 533 530 btmrvl_pscan_window_reporting(priv, 0x01); 534 531 535 532 priv->btmrvl_dev.psmode = 1; 536 533 btmrvl_enable_ps(priv); 537 534 538 - priv->btmrvl_dev.gpio_gap = 0xffff; 539 535 btmrvl_send_hscfg_cmd(priv); 540 536 541 537 return 0;