From patchwork Fri Mar 5 13:23:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 393514 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp423711jai; Fri, 5 Mar 2021 05:24:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJwwH8X6tv47qkGeqX9LWFvSrWcv+5MzdGhM9sPduVWJa6CecS/gOUezP8CjrQEEx6imgGSu X-Received: by 2002:a17:906:a896:: with SMTP id ha22mr2187101ejb.503.1614950671228; Fri, 05 Mar 2021 05:24:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614950671; cv=none; d=google.com; s=arc-20160816; b=j+XIM8M9LfcPnzqBlzNrynGLAUUHekImjp2+Ic0M7VKY6jMHvl3T4uj9gML3AuApGi a1UeK9crbk2qDpYGTxAW0VBuO2TFrudAVSsJyfW7k3eCT5SFMRsbilR1VjJsVuryX3ln NfkVNdHaagcsuLwdjtLBLbqHEUxlD9ZsFL6JbPdKfCy+Qt0arVgNVZCZs9tXcKBZ/CiC x/+mItav45nhELy7I818LeCW/+LtjFUKZ2OkzS+DKA3O4+30y3ru2zSPEWWI5wSx7kOw U1pEROSRREonUnBSJFhvAbo+pytCEy5AZBY9F7NOD88sa1GrUcc28oKLGAHTPq9Q7Khe 3oKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=PPJSM/MVU+EIeUzdeZ0OH1Y9gGkhi9PwxkOqz+xt+XI=; b=gR6YgzwAg8Sy62lpbszbarZSjn/jxFSLOIFM6kGiRrjI4SuzgVviw0ElqoVD3hZfgI NJZOekyvQLwY1DhxKocvCOCfOQBiVtits5MSZ+Eei0C29AwywuQF1J4MuhmjuiSrl9VP kuJgsJFrxLuQgOyJBBYvnmMF2anaUHskaN88v2a4iOFfVYL6NFwAZ+YhvnDJqDZAdy+f pefs5YqUBQtZQURPP0Y41zNSGuJ6A/viSxysSO9R/zdZs1gh08piLL3654qhO96nmqLY QqssHX2JDi7aeu7coZlmnNkeSLPP1oKpTaqaRsh0uY+LBUqc6h4D6mvXjFO6v0pifp2a Vz2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NznEWDYT; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l17si1503168eda.91.2021.03.05.05.24.30; Fri, 05 Mar 2021 05:24:31 -0800 (PST) Received-SPF: pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NznEWDYT; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229505AbhCENXz (ORCPT + 6 others); Fri, 5 Mar 2021 08:23:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229711AbhCENXy (ORCPT ); Fri, 5 Mar 2021 08:23:54 -0500 Received: from mail-lj1-x22c.google.com (mail-lj1-x22c.google.com [IPv6:2a00:1450:4864:20::22c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8DABBC061574 for ; Fri, 5 Mar 2021 05:23:53 -0800 (PST) Received: by mail-lj1-x22c.google.com with SMTP id m11so2692773lji.10 for ; Fri, 05 Mar 2021 05:23:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=PPJSM/MVU+EIeUzdeZ0OH1Y9gGkhi9PwxkOqz+xt+XI=; b=NznEWDYTz2RuXsPvJrP+Shu7L6ZRXJ+JW7nqVgW5w+YYBkKRawEATdgWyP+3XnxFhI XGy+FxuPbGjJ3zxlnpKsWwCOK+9lTCmDgykTkOSc/A8TJa2K5x2EpjShDoIE7U3h+8I2 HwFKPyNUAG4TDK3PYlVG9r4uE0UXdvmGwWLV93ssuEUim18fZMM/12DQ2w0VcTYy/iP9 tgNPxx2CZOnIp9u1854ZG/fv+Jc9M3iif33cJRkldvqDr6oZULOGxQ+tp3nFrN2aAGdX GhldROo5wOkfHxJuupNB6OZ6QEXO8QhiutMPMIaRulqHAYzRVCAoKx2gJ58sCTI3k72n puzg== 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:mime-version :content-transfer-encoding; bh=PPJSM/MVU+EIeUzdeZ0OH1Y9gGkhi9PwxkOqz+xt+XI=; b=CvXTvQecSMHZPwmzr/t0p5IHYZfoBvZ0tgOuDIqjEf7o9juN4UapHiDQCxucdY25P+ qtf0CHfpo8JtjMsxa8w1vdI6HszA+MGgRVMV+2JqSAMg9L7jT6M2nJDGDTPt1NUmKBvY KBrCJdwv/LUtOFkzblq2MjsY72PKSMAM7BGWd9ZsxXBhI0k+KvsKi8VfamEJpk7hnz1o 5KWwttgTTWasFvw3OWnERFaayaCXgmrebPrjglbMofI4IG4mRHYsLQV7NzTIOS8T2Fel dYFmkh+SPnP0MUTkWSUZh75W2pK211ZAIUJBonIV5dxRbXEnUNtpsuUVcr2J/BlI45n4 xrpw== X-Gm-Message-State: AOAM53165PuX0EiN9SGGH2ChSE0vnjdiCFFd9S/jc8IeOpqIP/La4jh1 o13Qb9fMaig/EulDEclrdDL/AA== X-Received: by 2002:a2e:7403:: with SMTP id p3mr5086835ljc.239.1614950631842; Fri, 05 Mar 2021 05:23:51 -0800 (PST) Received: from localhost.localdomain (c-d7cb225c.014-348-6c756e10.bbcust.telenor.se. [92.34.203.215]) by smtp.gmail.com with ESMTPSA id v28sm298420ljv.66.2021.03.05.05.23.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Mar 2021 05:23:51 -0800 (PST) From: Linus Walleij To: Marcel Holtmann , Johan Hedberg Cc: linux-bluetooth@vger.kernel.org, Linus Walleij , devicetree@vger.kernel.org Subject: [PATCH 1/2 v2] Bluetooth: btbcm: Rewrite bindings in YAML and add reset Date: Fri, 5 Mar 2021 14:23:42 +0100 Message-Id: <20210305132343.2070583-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org This rewrites the Broadcom bluetooth bindings in YAML and adds a GPIO handle for the BT_RST_N line as used on some platforms. The Ingenic UART binding was using this binding in its example DTS fragment, however mistakenly using "vcc-supply" for what is called "vbat-supply". The proper DTS files and the code in the kernel all use "vbat-supply" so fix up the example in this patch so we ge a clean check. Cc: devicetree@vger.kernel.org Signed-off-by: Linus Walleij --- ChangeLog v1->v2: - Fix the error in the Ingenic UART binding example as part of adding this patch. --- .../bindings/net/broadcom-bluetooth.txt | 56 --------- .../bindings/net/broadcom-bluetooth.yaml | 117 ++++++++++++++++++ 2 files changed, 117 insertions(+), 56 deletions(-) delete mode 100644 Documentation/devicetree/bindings/net/broadcom-bluetooth.txt create mode 100644 Documentation/devicetree/bindings/net/broadcom-bluetooth.yaml -- 2.29.2 diff --git a/Documentation/devicetree/bindings/net/broadcom-bluetooth.txt b/Documentation/devicetree/bindings/net/broadcom-bluetooth.txt deleted file mode 100644 index a7d57ba5f2ac..000000000000 --- a/Documentation/devicetree/bindings/net/broadcom-bluetooth.txt +++ /dev/null @@ -1,56 +0,0 @@ -Broadcom Bluetooth Chips ---------------------- - -This documents the binding structure and common properties for serial -attached Broadcom devices. - -Serial attached Broadcom devices shall be a child node of the host UART -device the slave device is attached to. - -Required properties: - - - compatible: should contain one of the following: - * "brcm,bcm20702a1" - * "brcm,bcm4329-bt" - * "brcm,bcm4330-bt" - * "brcm,bcm43438-bt" - * "brcm,bcm4345c5" - * "brcm,bcm43540-bt" - * "brcm,bcm4335a0" - -Optional properties: - - - max-speed: see Documentation/devicetree/bindings/serial/serial.yaml - - shutdown-gpios: GPIO specifier, used to enable the BT module - - device-wakeup-gpios: GPIO specifier, used to wakeup the controller - - host-wakeup-gpios: GPIO specifier, used to wakeup the host processor. - deprecated, replaced by interrupts and - "host-wakeup" interrupt-names - - clocks: 1 or 2 clocks as defined in clock-names below, in that order - - clock-names: names for clock inputs, matching the clocks given - - "extclk": deprecated, replaced by "txco" - - "txco": external reference clock (not a standalone crystal) - - "lpo": external low power 32.768 kHz clock - - vbat-supply: phandle to regulator supply for VBAT - - vddio-supply: phandle to regulator supply for VDDIO - - brcm,bt-pcm-int-params: configure PCM parameters via a 5-byte array - - sco-routing: 0 = PCM, 1 = Transport, 2 = Codec, 3 = I2S - - pcm-interface-rate: 128KBps, 256KBps, 512KBps, 1024KBps, 2048KBps - - pcm-frame-type: short, long - - pcm-sync-mode: slave, master - - pcm-clock-mode: slave, master - - interrupts: must be one, used to wakeup the host processor - - interrupt-names: must be "host-wakeup" - -Example: - -&uart2 { - pinctrl-names = "default"; - pinctrl-0 = <&uart2_pins>; - - bluetooth { - compatible = "brcm,bcm43438-bt"; - max-speed = <921600>; - brcm,bt-pcm-int-params = [01 02 00 01 01]; - }; -}; diff --git a/Documentation/devicetree/bindings/net/broadcom-bluetooth.yaml b/Documentation/devicetree/bindings/net/broadcom-bluetooth.yaml new file mode 100644 index 000000000000..bdd6ca617e23 --- /dev/null +++ b/Documentation/devicetree/bindings/net/broadcom-bluetooth.yaml @@ -0,0 +1,117 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/net/broadcom-bluetooth.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Broadcom Bluetooth Chips + +maintainers: + - Linus Walleij + +description: + This binding describes Broadcom UART-attached bluetooth chips. + +properties: + compatible: + enum: + - brcm,bcm20702a1 + - brcm,bcm4329-bt + - brcm,bcm4330-bt + - brcm,bcm43438-bt + - brcm,bcm4345c5 + - brcm,bcm43540-bt + - brcm,bcm4335a0 + + shutdown-gpios: + maxItems: 1 + description: GPIO specifier for the line BT_REG_ON used to + power on the BT module + + reset-gpios: + maxItems: 1 + description: GPIO specifier for the line BT_RST_N used to + reset the BT module. This should be marked as + GPIO_ACTIVE_LOW. + + device-wakeup-gpios: + maxItems: 1 + description: GPIO specifier for the line BT_WAKE used to + wakeup the controller. This is using the BT_GPIO_0 + pin on the chip when in use. + + host-wakeup-gpios: + maxItems: 1 + deprecated: true + description: GPIO specifier for the line HOST_WAKE used + to wakeup the host processor. This is using he BT_GPIO_1 + pin on the chip when in use. This is deprecated and replaced + by interrupts and "host-wakeup" interrupt-names + + clocks: + maxItems: 2 + description: 1 or 2 clocks as defined in clock-names below, + in that order + + clock-names: + description: Names of the 1 to 2 supplied clocks + items: + - const: txco + - const: lpo + - const: extclk + + vbat-supply: + description: phandle to regulator supply for VBAT + + vddio-supply: + description: phandle to regulator supply for VDDIO + + brcm,bt-pcm-int-params: + $ref: /schemas/types.yaml#/definitions/uint8-array + minItems: 5 + maxItems: 5 + description: |- + configure PCM parameters via a 5-byte array: + sco-routing: 0 = PCM, 1 = Transport, 2 = Codec, 3 = I2S + pcm-interface-rate: 128KBps, 256KBps, 512KBps, 1024KBps, 2048KBps + pcm-frame-type: short, long + pcm-sync-mode: slave, master + pcm-clock-mode: slave, master + + interrupts: + items: + - description: Handle to the line HOST_WAKE used to wake + up the host processor. This uses the BT_GPIO_1 pin on + the chip when in use. + + interrupt-names: + items: + - const: host-wakeup + + max-speed: true + current-speed: true + +required: + - compatible + +additionalProperties: false + +examples: + - | + #include + #include + + uart { + uart-has-rtscts; + + bluetooth { + compatible = "brcm,bcm4330-bt"; + max-speed = <921600>; + brcm,bt-pcm-int-params = [01 02 00 01 01]; + shutdown-gpios = <&gpio 30 GPIO_ACTIVE_HIGH>; + device-wakeup-gpios = <&gpio 7 GPIO_ACTIVE_HIGH>; + reset-gpios = <&gpio 9 GPIO_ACTIVE_LOW>; + interrupt-parent = <&gpio>; + interrupts = <8 IRQ_TYPE_EDGE_FALLING>; + }; + };