Commit 098ea6bc authored by Amitkumar Karwar's avatar Amitkumar Karwar Committed by Marcel Holtmann

Bluetooth: btmrvl: add DT bindings documentation

Calibration data can be downloaded through device tree method. This
patch adds the documentation. Also, instead of searching device tree
node by name using of_find_node_by_name() API, let's use
for_each_compatible_node().
Signed-off-by: default avatarAmitkumar Karwar <akarwar@marvell.com>
Signed-off-by: default avatarCathy Luo <cluo@marvell.com>
Signed-off-by: default avatarAvinash Patil <patila@marvell.com>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent 0378b597
btmrvl
------
Required properties:
- compatible : must be "btmrvl,cfgdata"
Optional properties:
- btmrvl,cal-data : Calibration data downloaded to the device during
initialization. This is an array of 28 values(u8).
Example:
btmrvl {
compatible = "btmrvl,cfgdata";
btmrvl,cal-data = /bits/ 8 <
0x37 0x01 0x1c 0x00 0xff 0xff 0xff 0xff 0x01 0x7f 0x04 0x02
0x00 0x00 0xba 0xce 0xc0 0xc6 0x2d 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0xf0 0x00>;
};
...@@ -496,25 +496,22 @@ static int btmrvl_cal_data_dt(struct btmrvl_private *priv) ...@@ -496,25 +496,22 @@ static int btmrvl_cal_data_dt(struct btmrvl_private *priv)
{ {
struct device_node *dt_node; struct device_node *dt_node;
u8 cal_data[BT_CAL_HDR_LEN + BT_CAL_DATA_SIZE]; u8 cal_data[BT_CAL_HDR_LEN + BT_CAL_DATA_SIZE];
const char name[] = "btmrvl_caldata";
const char property[] = "btmrvl,caldata";
int ret; int ret;
dt_node = of_find_node_by_name(NULL, name); for_each_compatible_node(dt_node, NULL, "btmrvl,cfgdata") {
if (!dt_node) ret = of_property_read_u8_array(dt_node, "btmrvl,cal-data",
return -ENODEV; cal_data + BT_CAL_HDR_LEN,
BT_CAL_DATA_SIZE);
ret = of_property_read_u8_array(dt_node, property, if (ret)
cal_data + BT_CAL_HDR_LEN, return ret;
BT_CAL_DATA_SIZE);
if (ret) BT_DBG("Use cal data from device tree");
return ret; ret = btmrvl_download_cal_data(priv, cal_data,
BT_CAL_DATA_SIZE);
BT_DBG("Use cal data from device tree"); if (ret) {
ret = btmrvl_download_cal_data(priv, cal_data, BT_CAL_DATA_SIZE); BT_ERR("Fail to download calibrate data");
if (ret) { return ret;
BT_ERR("Fail to download calibrate data"); }
return ret;
} }
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment