Message ID | 1504699898-28011-3-git-send-email-loic.poulain@linaro.org (mailing list archive) |
---|---|
State | Not Applicable, archived |
Headers | show |
Hi Loic, > 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> > --- > v2: Set device as unconfigured if default address detected > Add warning if BD addr retrieved from DT > v3: if no addr retrieved from DT, unconditionally set > the invalid BD addr flag. > swap and set bdaddr in the platform probe > v4: Add dt-bindings documentation > split patch in two parts (setup, dt prop) > use local-bd-address name instead of local-mac-address > v5: remove 2/3 merged in bluetooth-next tree > Add bluetooth.txt for common BT bindings > expect local-bd-address in little-endian format > v6: use of_property_read_u8_array instead of of_get_property > > drivers/bluetooth/btqcomsmd.c | 11 +++++++++++ > 1 file changed, 11 insertions(+) > > diff --git a/drivers/bluetooth/btqcomsmd.c b/drivers/bluetooth/btqcomsmd.c > index bd810d0..b5716f0 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))) { > + BT_INFO("BD address %pMR retrieved from device-tree", > + &btq->bdaddr); > + } any reason you are not using bt_dev_info here? I think it would be important to print the device information prefix. Otherwise the patch set looks good to me. However I would prefer if we get an ack from Rob. Regards Marcel -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Hi Loic, > > + /* 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))) { > > + BT_INFO("BD address %pMR retrieved from device-tree", > > + &btq->bdaddr); > > + } > > any reason you are not using bt_dev_info here? I think it would be important to print the device information prefix. > > Yes, hdev does not have any allocated name/number before being registered. > I can move this after hci_register_dev if you prefer. if that is possible, then that would be good. Regards Marcel -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/bluetooth/btqcomsmd.c b/drivers/bluetooth/btqcomsmd.c index bd810d0..b5716f0 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))) { + BT_INFO("BD address %pMR retrieved from device-tree", + &btq->bdaddr); + } + hdev = hci_alloc_dev(); if (!hdev) return -ENOMEM;
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> --- v2: Set device as unconfigured if default address detected Add warning if BD addr retrieved from DT v3: if no addr retrieved from DT, unconditionally set the invalid BD addr flag. swap and set bdaddr in the platform probe v4: Add dt-bindings documentation split patch in two parts (setup, dt prop) use local-bd-address name instead of local-mac-address v5: remove 2/3 merged in bluetooth-next tree Add bluetooth.txt for common BT bindings expect local-bd-address in little-endian format v6: use of_property_read_u8_array instead of of_get_property drivers/bluetooth/btqcomsmd.c | 11 +++++++++++ 1 file changed, 11 insertions(+)