diff options
author | Loic Poulain <loic.poulain@linaro.org> | 2017-09-08 15:57:55 +0200 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2017-10-06 20:35:47 +0200 |
commit | 766154b7d47b092605171df8930b864efc8ef5c8 (patch) | |
tree | f1a48424d4cfff78b41cdae1734edca197c784d9 /drivers/bluetooth | |
parent | e7868a2f71bd9f81494f0c90a64e4dd454248850 (diff) | |
download | linux-766154b7d47b092605171df8930b864efc8ef5c8.tar.gz linux-766154b7d47b092605171df8930b864efc8ef5c8.tar.bz2 linux-766154b7d47b092605171df8930b864efc8ef5c8.zip |
Bluetooth: btqcomsmd: retrieve BD address from DT property
Retrieve BD address from the local-bd-address property.
This address must be unique and is usually added in the DT
by the bootloader which has access to the provisioned data.
Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'drivers/bluetooth')
-rw-r--r-- | drivers/bluetooth/btqcomsmd.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/bluetooth/btqcomsmd.c b/drivers/bluetooth/btqcomsmd.c index bd810d01538a..663bed63b871 100644 --- a/drivers/bluetooth/btqcomsmd.c +++ b/drivers/bluetooth/btqcomsmd.c @@ -15,6 +15,8 @@ #include <linux/module.h> #include <linux/slab.h> #include <linux/rpmsg.h> +#include <linux/of.h> + #include <linux/soc/qcom/wcnss_ctrl.h> #include <linux/platform_device.h> @@ -156,6 +158,15 @@ static int btqcomsmd_probe(struct platform_device *pdev) if (IS_ERR(btq->cmd_channel)) return PTR_ERR(btq->cmd_channel); + /* The local-bd-address property is usually injected by the + * bootloader which has access to the allocated BD address. + */ + if (!of_property_read_u8_array(pdev->dev.of_node, "local-bd-address", + (u8 *)&btq->bdaddr, sizeof(bdaddr_t))) { + dev_info(&pdev->dev, "BD address %pMR retrieved from device-tree", + &btq->bdaddr); + } + hdev = hci_alloc_dev(); if (!hdev) return -ENOMEM; |