From patchwork Fri Sep 8 13:57:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loic Poulain X-Patchwork-Id: 112079 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp356122qgf; Fri, 8 Sep 2017 06:58:06 -0700 (PDT) X-Received: by 10.99.183.4 with SMTP id t4mr3228565pgf.128.1504879086306; Fri, 08 Sep 2017 06:58:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504879086; cv=none; d=google.com; s=arc-20160816; b=CA4miCMQ2pyv5aywaKxxp/1q/sUZ6/NDKPIT1vaVbwFGi8BvsJyqW4nBV2x/i5EaoF W/BFuWImZRwzL9y9E25/hr42DRpI9lGrVUVwh2Pihfgm30SyL+W29b+2OeGBu2OE5fwS sqZSDO0tDiaNpt0aYO1XvXUiZiDW3lPuMWe9QFhFWFg/zbzxmoMJMnoG5vgAQ/lngO4D w+agi/rL+d39ddITzcRetBkWIi2+G6Qs4v0259b2cLAMzn1Dey3sHNc1KQA7/BE9hWn7 EWLSipQak2Z/HOOHM3uP8Q8zfvT/esC1nnqT8MMEk+C3a2P6ztcAr6buLzfRfw42skIy EB5w== 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=4CnXhIy2ThaotC8GR3IZQz6LXeE63oYG28GvIkru1LA=; b=gIM+kV58P4yVezhDr3mkmwyPewZi6ESGjqU0mEjZ50I1L07ODyrI+NeA4KdFd75LSg 3rbRnIS31gAxqPIXprxJsM3lcLxpQEcZCwiAdkux14FzmJPnTE86+WgHnF9ZM7/F4EIe iciHprHZHEql1glh0alfTBviGovlVDKSBCQLk4z/oJPgxLUwHVA1WINlGA6MqiTqTBo4 6O74P/FwGDc/Gv3JyS6qn8vk58mz1FOHwTzaLoMXRZnw/py516PZ3N/BIGvuXGXjkNIB rh8QpUKFRC86ALYr8NJEpDAhDH2a1jBcyTlJI+VqqAIMGlHDsiuUjcPLbbCS02Q/XhYr MiKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=GWxnZNqM; 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 q1si1654027plb.389.2017.09.08.06.58.06; Fri, 08 Sep 2017 06:58:06 -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=GWxnZNqM; 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 S1754454AbdIHN6E (ORCPT + 6 others); Fri, 8 Sep 2017 09:58:04 -0400 Received: from mail-wr0-f173.google.com ([209.85.128.173]:38059 "EHLO mail-wr0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753545AbdIHN6B (ORCPT ); Fri, 8 Sep 2017 09:58:01 -0400 Received: by mail-wr0-f173.google.com with SMTP id 108so4836516wra.5 for ; Fri, 08 Sep 2017 06:58:01 -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=u2NfjXbE56dyIgrFBHKSNu5NHg9doo17AMig7rf4nmc=; b=GWxnZNqMpMuMfgLIMlCUG02V7J2+j4NaVNE8zbAjkVUuVroU+bM0JFVAQxrWoJFswn 5U0b/fY67LQrq3Mm8scs9o3m/gG1hvX2m12vD6fjyRICu2hkZXMaeGRZLqP/XfnqFug9 f6WyVKeDHBVkBFK7j0t+YNudk7CrhIKiio17A= 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=u2NfjXbE56dyIgrFBHKSNu5NHg9doo17AMig7rf4nmc=; b=RUsdfagTbtsHIeey4TuU4d1p0uEQfdSBTGb8KymGhv+lhhZIEYuRFPdcksaw9HWohr pUmi0LIc8z5NRnF9NvFPMQKT2pQXKpvpFCP+BKWz8o7UdwwlSiv5xwcCvfEvJQry1xWY zREXYkIH46uUcT97DYx2nNmHq1epTN4ZGNFW/JNmLAwZELuy+CHZToAadcB9NjQly1FU mHmAp3WrE7MQiXWr884OHBiyzSC1HHL1frUFAiVqTiTNp9BNr3yC9sRYMzC/CV8ui/77 tN+iw4EZeh18C3RyOjA9o/uyFEnl8IziqH4ZqXoxc2fQnwnFlMgOjNOUecDkwIUV8lFr rKSA== X-Gm-Message-State: AHPjjUjNJymb+nBRuZwHYQ6DmWgD5NyYtnvfE04Qo6dC5Ee+wXtGvRhk G3dGNFyqWImyWkAa X-Google-Smtp-Source: ADKCNb4eN6NlUbXDQ3DUWd/UJYWXbjotljPE9/YEeQmN9L2tKTTpHBh5DjKHbpjGbvQ5fYGjpqLJBg== X-Received: by 10.223.169.83 with SMTP id u77mr2036969wrc.268.1504879080440; Fri, 08 Sep 2017 06:58:00 -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 v2sm1869638wmf.40.2017.09.08.06.57.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 08 Sep 2017 06:57:59 -0700 (PDT) From: Loic Poulain To: marcel@holtmann.org, robh+dt@kernel.org, johan.hedberg@gmail.com Cc: linux-bluetooth@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, bjorn.andersson@linaro.org, Loic Poulain Subject: [PATCH v7 2/3] dt-bindings: soc: qcom: Add local-bd-address property to WCNSS-BT Date: Fri, 8 Sep 2017 15:57:54 +0200 Message-Id: <1504879075-587-2-git-send-email-loic.poulain@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1504879075-587-1-git-send-email-loic.poulain@linaro.org> References: <1504879075-587-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 v6: use of_property_read_u8_array instead of of_get_property v7: use dev_info instead of BT_INFO to have dev context 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 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 Fri Sep 8 13:57:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loic Poulain X-Patchwork-Id: 112080 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp356138qgf; Fri, 8 Sep 2017 06:58:06 -0700 (PDT) X-Received: by 10.84.160.204 with SMTP id v12mr3548407plg.382.1504879086838; Fri, 08 Sep 2017 06:58:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504879086; cv=none; d=google.com; s=arc-20160816; b=QOsRWn9ia6EIiWh/Nwc2w9Z70sZR6qc645XbevqPm+Y27x403/wJXbLYm3pCh4ELUq B+QU7CfqiwjEIpdXbXNLT6fQs3VNbwTSWBsVtEQxHZQzDjz47EyajOTN3093sfRHchYs wXt1u/ADpYa1HQ+ysV+Vxq5eqhgbBcfUOmOCei3tNeIkoc1tN1+3qtUdEhBbhCHdQ9v4 FOH+ZavLWzH5qnBZMryRjfR3urq8pgr/x3NZxZvIHD65BAJl0aae3h6FYq8UMaEep70B SZtmo7993/QttJGEtFD4UM/JVjfLNBEgCJ3SZES0EpVd9M0nSP5o6+WBCkeE3FBMxpka aM6Q== 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=jkXxaKAGPtcdCGTA/C+Hm0/cwdpALDnrki+WsgvdMcE=; b=C65uCGHbOSIxo1y//Rvqa8qPlMMo85oDpf0bs5+bZGtlu3yYa+mGxR3tp7HeJpDyoN vQIFeNa51rkHHHpxSayHvfetzEr2ehteHXU22AfXlxu4Cma8G+02AifAhYIL95rUQkXw p1/tRzGt+373b9aEW5QD3TgKR8GCiKIixTBX9yv/wZC4yCDlgJ1ldgCvWlp2NppsXV2C k12XH39pZvwrN4jVqgY1xEDzC7a8H5lXu54vJpH00rcughYYxS7G02PMjZ/pAwz0F2EL sF1fExG8h2J1qE5cPgMKrg0m0OTewmF3IsuuWs4PEo2zkskYJmwaWUXkdGLWma8jZoPL JKag== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=COwLg3Fe; 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 q1si1654027plb.389.2017.09.08.06.58.06; Fri, 08 Sep 2017 06:58:06 -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=COwLg3Fe; 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 S1753740AbdIHN6F (ORCPT + 6 others); Fri, 8 Sep 2017 09:58:05 -0400 Received: from mail-wm0-f42.google.com ([74.125.82.42]:43375 "EHLO mail-wm0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753242AbdIHN6D (ORCPT ); Fri, 8 Sep 2017 09:58:03 -0400 Received: by mail-wm0-f42.google.com with SMTP id f145so6284932wme.0 for ; Fri, 08 Sep 2017 06:58:02 -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=2N4mIUe6U9LD+mrAELqQRux6nvcWu/H9f+8Gpu/lDtk=; b=COwLg3FeP26Oon/d77s8SfD43rqfia7Jq+pRSZuX3rkA8fMc/qQm2tke/8bUtMhsNy 0k+fKewbftUXLkkLlRXfDyl7LhPdPdnqtFn0PU3BkEdOO1xV6DLJh2CexnigY6L8w7Bw OYtCVEArplXz/yg1WRYsJgMLwfDG4dPGcLFJ4= 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=2N4mIUe6U9LD+mrAELqQRux6nvcWu/H9f+8Gpu/lDtk=; b=Nt0aDKL68GPf8WGjPe4KvpPqvKrp37vqZ4a/Kgify+qiKB4w+njVw37S/7wkGYyP3d ZKzURfCXcEhjsPdaSoka6ZWdZeMVmw1zZu+Ngq8jFWodxucuxZOGARQrazJg785cfoO6 Z1+jCsn95vInMIp14VMBPCDjF+DM83FCxsorNemO8q0kO0qggwyhvU1VSbq2lzWOpJd6 IJ8tVlcvlNg8fWGmQTWbU13JqANc7gppTaiVdu6uaHPbaxtTfxUi49Vh1ScJLausgj+h G6Fn2jyBzbAd9vVgvudkjvuNh5POXSS04iTCq7OBkyuLWTEIGgHV5kmGZs2bjRalJZtX WUmg== X-Gm-Message-State: AHPjjUg8mZHn8m/lq0H248TSDF/Ywyzz1lkOZ9B5AwZ7dPruZLTxfP6u VWXtqLzQHhCDYlGW X-Google-Smtp-Source: AOwi7QBplhfK1OGO3uPZ0ARxDh0/ENeH0o9MItyd/sc8UdhP+i1nl8KJNzrwyaqDO8W6U7ioWHxEDA== X-Received: by 10.28.128.131 with SMTP id b125mr1850048wmd.1.1504879081914; Fri, 08 Sep 2017 06:58:01 -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 v2sm1869638wmf.40.2017.09.08.06.58.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 08 Sep 2017 06:58:01 -0700 (PDT) From: Loic Poulain To: marcel@holtmann.org, robh+dt@kernel.org, johan.hedberg@gmail.com Cc: linux-bluetooth@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, bjorn.andersson@linaro.org, Loic Poulain Subject: [PATCH v7 3/3] Bluetooth: btqcomsmd: retrieve BD address from DT property Date: Fri, 8 Sep 2017 15:57:55 +0200 Message-Id: <1504879075-587-3-git-send-email-loic.poulain@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1504879075-587-1-git-send-email-loic.poulain@linaro.org> References: <1504879075-587-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 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 v6: use of_property_read_u8_array instead of of_get_property v7: use dev_info instead of BT_INFO to have dev context drivers/bluetooth/btqcomsmd.c | 11 +++++++++++ 1 file changed, 11 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..663bed6 100644 --- a/drivers/bluetooth/btqcomsmd.c +++ b/drivers/bluetooth/btqcomsmd.c @@ -15,6 +15,8 @@ #include #include #include +#include + #include #include @@ -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;