From patchwork Tue Sep 5 18:58:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loic Poulain X-Patchwork-Id: 111709 Delivered-To: patch@linaro.org Received: by 10.140.94.166 with SMTP id g35csp3230174qge; Tue, 5 Sep 2017 11:58:54 -0700 (PDT) X-Received: by 10.84.148.203 with SMTP id y11mr2133398plg.277.1504637934370; Tue, 05 Sep 2017 11:58:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504637934; cv=none; d=google.com; s=arc-20160816; b=ZQy1qgllhaONJvPcITEpLLBSJVk1Df+OJMxDGQCCvNXdVNrg/6wSXvypsZsgx6coAb zG/XmoM67e0Dp0ShABekBWGTrWq6hFnxB4P+BiDsVYAm24NOIlMOCu4DPKhNB/zb9egX KGTdwRny2Ql7tnEaGoKNwdZNxUHkyxx+gBFutuCzynTcCpBSczACvSilfXgDWLQKYwCM poKcj9/TR+tuAKo0qzQQYLdw+CAPMT6VHYeLFSUjyFocctd9Ypc3KWP3iEdzKw0GIDT1 gB3/tv+1eC4fM3Xy8WE0NkKC4SwKdEBCTN5m5wbh1nx4xN3lqr2JX/HOYnyQdBNaZxci 8s5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=Y1xQnJkDxq7YX+A/l5cSyVnHIy5pt+khPrFDCFk5SNY=; b=qrjrVmXst+emfwDTCwhlU0RxCRyPJpxA0v1oGFbRHjjSu2ELEFHCNxou0+6LQ5buda MCS2xFpwPwMGrW0/hVdhv2U9grP7BQ+6dT4AxSgJYdrvF03IVD+N7Gs9QkkXf9EZnWo5 ui9e6DS6steVHnTj9RLnAvybKCCg2HWTqb6TE+HSl7/77Obu8icevUlueDqpgRRkW4u2 dmX7MHU4YPiOTR+TqsK8En24va31YqTEdO912xRpP8eJo3K2aitJYn0bzjWYhn/K/LZs Sz5/5ahoALKNrpjDTUPS2U5vIGLIQDKfjHK4HN4LFl81tfZw/+bH/bJB0OPO2imdBDM+ BeVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=RUi5vp2G; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 33si796789pla.341.2017.09.05.11.58.54; Tue, 05 Sep 2017 11:58:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=RUi5vp2G; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752460AbdIES6x (ORCPT + 6 others); Tue, 5 Sep 2017 14:58:53 -0400 Received: from mail-wr0-f179.google.com ([209.85.128.179]:33053 "EHLO mail-wr0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751413AbdIES6u (ORCPT ); Tue, 5 Sep 2017 14:58:50 -0400 Received: by mail-wr0-f179.google.com with SMTP id a43so10463475wrc.0 for ; Tue, 05 Sep 2017 11:58:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=A9rU24hAWC4UF28ShfbfEhCQDUXvfi98MjVzHjNzG1k=; b=RUi5vp2G3qtXpr6DgmdBusNsR8coP4zpEZkl0RUHDYjRWXoi0MNQWLMp+vd2+YXXLP PPSwb/QsELnxmumQJ+EN2hsFvW1PqaoI0rjbwVOOlGXrlq5JX29ZsuRnhTiH+J6DbAtW /aUrij+dvP3+bj+2apQhT+6HsBVmBf9Vkl6hQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=A9rU24hAWC4UF28ShfbfEhCQDUXvfi98MjVzHjNzG1k=; b=BOUi66cC/5lhGo9xB5CLKd3Z/3KdJ4MmFWIvW82hRytgA0Wib2+cS6FTfHV9fuCMim 4zEMKKplg+CBUp9c8WZern1dbpiw+lEJbpp0GoB5zU737kHmpu4N5KZnwL5z1g4nzqw7 1RSSYJtkAMwmTQEkYKM2suxGjFo9vGF69E+WqDlPY0NHk/TXmkuBaC1Rju4jW0xIsDR4 uGIZsTwnBZSk/5fp/5rhOd6PYPXr5b7DsW3LVR76eWY/EtRvul2ac1xoXLS+SZ43/jEE eFh3M6bBYL9c095bLYvC773j9fT1ktVzGukJaSzyN8H5gEGdovcXXkTGpWB7V5njdmoG p3Kg== X-Gm-Message-State: AHPjjUgZQ6MDdmyqEzgYF4xfyKDE6m+hHSDS4HJpeloSADDRQ0IpxlxV Yl5RPl9UTck7B+TG X-Google-Smtp-Source: ADKCNb74Rmms1LrowzODtvxCgdwuWJ9HB2+Hv8lGonKq3Dld1VDnRHqfo1xSjAa8/kf9VQsEasZKvA== X-Received: by 10.223.167.4 with SMTP id c4mr38616wrd.88.1504637929214; Tue, 05 Sep 2017 11:58:49 -0700 (PDT) Received: from loic-XPS-12.home (LFbn-1-2083-208.w90-76.abo.wanadoo.fr. [90.76.148.208]) by smtp.gmail.com with ESMTPSA id i15sm1312935wmg.26.2017.09.05.11.58.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 05 Sep 2017 11:58:48 -0700 (PDT) From: Loic Poulain To: marcel@holtmann.org, johan.hedberg@gmail.com, robh+dt@kernel.org Cc: linux-bluetooth@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, bjorn.andersson@linaro.org, Loic Poulain Subject: [PATCH v5 2/3] dt-bindings: soc: qcom: Add local-bd-address property to WCNSS-BT Date: Tue, 5 Sep 2017 20:58:42 +0200 Message-Id: <1504637923-21652-2-git-send-email-loic.poulain@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1504637923-21652-1-git-send-email-loic.poulain@linaro.org> References: <1504637923-21652-1-git-send-email-loic.poulain@linaro.org> Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Add optional local-bd-address property which is a 6-byte array storing the assigned BD address. Since having a unique BD address is critical, a per-device property value should be allocated. This property is usually added by the boot loader which has access to the provisioned data. Signed-off-by: Loic Poulain --- 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 Documentation/devicetree/bindings/soc/qcom/qcom,wcnss.txt | 8 ++++++++ 1 file changed, 8 insertions(+) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Acked-by: Rob Herring diff --git a/Documentation/devicetree/bindings/soc/qcom/qcom,wcnss.txt b/Documentation/devicetree/bindings/soc/qcom/qcom,wcnss.txt index 4ea39e9..042a2e4 100644 --- a/Documentation/devicetree/bindings/soc/qcom/qcom,wcnss.txt +++ b/Documentation/devicetree/bindings/soc/qcom/qcom,wcnss.txt @@ -37,6 +37,11 @@ The following properties are defined to the bluetooth node: Definition: must be: "qcom,wcnss-bt" +- local-bd-address: + Usage: optional + Value type: + Definition: see Documentation/devicetree/bindings/net/bluetooth.txt + == WiFi The following properties are defined to the WiFi node: @@ -91,6 +96,9 @@ smd { bt { compatible = "qcom,wcnss-bt"; + + /* BD address 00:11:22:33:44:55 */ + local-bd-address = [ 55 44 33 22 11 00 ]; }; wlan { From patchwork Tue Sep 5 18:58:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loic Poulain X-Patchwork-Id: 111710 Delivered-To: patch@linaro.org Received: by 10.140.94.166 with SMTP id g35csp3230211qge; Tue, 5 Sep 2017 11:58:57 -0700 (PDT) X-Received: by 10.84.246.200 with SMTP id j8mr5412721plt.360.1504637937132; Tue, 05 Sep 2017 11:58:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504637937; cv=none; d=google.com; s=arc-20160816; b=gV9JKPT0T5ab9eIMuHVlFkPCu9VXHx9otQed7Jx+qTneViERJL7rAhFsXWmdlQ8u0m yMxZXqRmG9yLnn5f50Fjc7NUxc17/4yFs0jEOZYDwN1dedFqxIU00onxdzf1O/ubsf6A pyjD/8T5EPJ+6bMlclDzYJE5DW5KGBpVOBFw/mzl33oiq/sIfVH1vWyEYcLj3QK+cRyq xzAWQ1U8iPkT8HlnV3csuGuGSx4u+RlbmIp7ksHqUgJU0DqW+eKBMBsV402PKQ7d93tv keAjUbklD7gUSyAYjjfFApPSU3J/4eZxc/X4vdYoiQgqrwK/zih2/aR3qG6lwxcMhZ03 zphg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=G1dl8ZQPfDkDlkaqyYSGlVXlnaq4/JMTkTO6ufRxJfo=; b=OXtulewD3ZbImxTCIce7YwhfWDwA8cirfu23CfOg2aqln2WeMWzpItg+VUFelSfb8K hLF9gywEQrXoFn1HWt8EaUeCKKbVctXTcUMPgDhIJRAOV8j/lptu+oLYAFNtbtucsai/ u9vjor3mUWPPGUiK511GubQMnT9K6SX2q1Uq2YEpMyotSTTaisxxFUzG0WBF+0jfj5Vb ptPFpnyWweRQe/RzLvMeHXW1vWN6kL14HeoWMhp2AKYBBdgMYmBzQA3TdyjASU/uA2pg iacT1ZOAka4rjdTttuzO3XuGXPNNj8PvpxEcR+KCHChMC4SxGxoP6aQSx4SmP1JJeEU/ C0+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=KpJLVxCo; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 33si796789pla.341.2017.09.05.11.58.56; Tue, 05 Sep 2017 11:58:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=KpJLVxCo; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751413AbdIES6x (ORCPT + 6 others); Tue, 5 Sep 2017 14:58:53 -0400 Received: from mail-wr0-f179.google.com ([209.85.128.179]:35416 "EHLO mail-wr0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752384AbdIES6w (ORCPT ); Tue, 5 Sep 2017 14:58:52 -0400 Received: by mail-wr0-f179.google.com with SMTP id y15so10417273wrc.2 for ; Tue, 05 Sep 2017 11:58:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=yeeGYQ6i2SMXzivn0GbTL2Z3a4WjMgSl9NaAvYtpkTo=; b=KpJLVxCoJdzTdCem3Q2TICjGoDh684qhjAyQHTxr7YHqAadoTQN28gLi/9RQ6BBV4r gld39iNBSx24ZqFMN84JzQJzTLGNzDnucW62XbzKbqWRQ4OCvJV+QU//lBDBL8cy+zj0 pd05F2vuaEAskb9vSgVVUKUOa6SADJdVsIgRc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=yeeGYQ6i2SMXzivn0GbTL2Z3a4WjMgSl9NaAvYtpkTo=; b=rT9CPxKKVSR3X/hTe+ftZYmNInuIfSXd2ilILLvMoeA5zCW5KUJdOLzMjzuC++n0MU s9boUDIJ2NjRjFc0AA+KRnt6bRJ3WNqQV2bTD6XQfZ+Q9cweisDtEAFirMxEqKCXPvzr UTLPUN2tGHeeNLNG4ZXvRDApT5XnqwJGGl83/xu0FffjyJWOPXFy23sR1RToTVCL+ZuN 9UyiAUcx29D18RxWZgMBASEF7++vn8VNRVKu8Y5v8pXDIhV4TWqXMCzXjGKnMRCzK2EP tm2H3a//1f5srJDbiKnO9TfvgGvQCo/XuXdtXL61jxkEAXJvBVOHG+5Qd8M+UzdD7jHs PJbg== X-Gm-Message-State: AHPjjUjdYT5Rdc7oyIL0QlStX1jTEtU/Nebvho5iaSFbWnhU7PXw83EV kALI7JzW5Qa9VGlQ X-Google-Smtp-Source: ADKCNb7D9WSFbMaKlWtJgeuWBFcrca9ZkyGGil2igaCllOLeAV5wdhIkocWiSk2IwIG8vGmFBOJQ9Q== X-Received: by 10.223.165.137 with SMTP id g9mr13688wrc.269.1504637930905; Tue, 05 Sep 2017 11:58:50 -0700 (PDT) Received: from loic-XPS-12.home (LFbn-1-2083-208.w90-76.abo.wanadoo.fr. [90.76.148.208]) by smtp.gmail.com with ESMTPSA id i15sm1312935wmg.26.2017.09.05.11.58.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 05 Sep 2017 11:58:50 -0700 (PDT) From: Loic Poulain To: marcel@holtmann.org, johan.hedberg@gmail.com, robh+dt@kernel.org Cc: linux-bluetooth@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, bjorn.andersson@linaro.org, Loic Poulain Subject: [PATCH v5 3/3] Bluetooth: btqcomsmd: retieve BD address from DT Date: Tue, 5 Sep 2017 20:58:43 +0200 Message-Id: <1504637923-21652-3-git-send-email-loic.poulain@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1504637923-21652-1-git-send-email-loic.poulain@linaro.org> References: <1504637923-21652-1-git-send-email-loic.poulain@linaro.org> Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Retrieve BD address from the DT 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 --- 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 drivers/bluetooth/btqcomsmd.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe devicetree" 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..c6d3fd9 100644 --- a/drivers/bluetooth/btqcomsmd.c +++ b/drivers/bluetooth/btqcomsmd.c @@ -15,6 +15,8 @@ #include #include #include +#include + #include #include @@ -135,6 +137,7 @@ static int btqcomsmd_setup(struct hci_dev *hdev) static int btqcomsmd_probe(struct platform_device *pdev) { + const bdaddr_t *bdaddr; struct btqcomsmd *btq; struct hci_dev *hdev; void *wcnss; @@ -156,6 +159,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 DT property is usually injected by the + * bootloader which has access to the allocated BD address. + */ + bdaddr = of_get_property(pdev->dev.of_node, "local-bd-address", &ret); + if (bdaddr && ret == sizeof(bdaddr_t)) { + BT_INFO("BD address %pMR retrieved from device-tree", bdaddr); + bacpy(&btq->bdaddr, bdaddr); + } + hdev = hci_alloc_dev(); if (!hdev) return -ENOMEM;