Commit 3b6bf5b1 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull spi updates from Mark Brown:
 "There's been quite a lot of generic activity here, but more
  administrative than featuers. We also have a bunch of new drivers,
  including one that's part of a MFD so we pulled in the core parts of
  that:

   - Lots of work from both Yang Yingliang and Andy Shevchenko on moving
     to host/device/controller based terminology for devices.

   - QuadSPI SPI support for Allwinner sun6i.

   - New device support Cirrus Logic CS43L43, Longsoon, Qualcomm GENI
     QuPv3 and StarFive JH7110 QSPI"

* tag 'spi-v6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: (151 commits)
  spi: at91-usart: Use PTR_ERR_OR_ZERO() to simplify code
  spi: spi-sn-f-ospi: switch to use modern name
  spi: sifive: switch to use modern name
  spi: sh: switch to use modern name
  spi: sh-sci: switch to use modern name
  spi: sh-msiof: switch to use modern name
  spi: sh-hspi: switch to use modern name
  spi: sc18is602: switch to use modern name
  spi: s3c64xx: switch to use modern name
  spi: rzv2m-csi: switch to use devm_spi_alloc_host()
  spi: rspi: switch to use spi_alloc_host()
  spi: rockchip: switch to use modern name
  spi: rockchip-sfc: switch to use modern name
  spi: realtek-rtl: switch to use devm_spi_alloc_host()
  spi: rb4xx: switch to use modern name
  spi: qup: switch to use modern name
  spi: spi-qcom-qspi: switch to use modern name
  spi: pxa2xx: switch to use modern name
  spi: ppc4xx: switch to use modern name
  spi: spl022: switch to use modern name
  ...
parents 65234f96 60ea3db3
Loading
Loading
Loading
Loading
+313 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/sound/cirrus,cs42l43.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Cirrus Logic CS42L43 Audio CODEC

maintainers:
  - patches@opensource.cirrus.com

description: |
  The CS42L43 is an audio CODEC with integrated MIPI SoundWire interface
  (Version 1.2.1 compliant), I2C, SPI, and I2S/TDM interfaces designed
  for portable applications. It provides a high dynamic range, stereo
  DAC for headphone output, two integrated Class D amplifiers for
  loudspeakers, and two ADCs for wired headset microphone input or
  stereo line input. PDM inputs are provided for digital microphones.

allOf:
  - $ref: dai-common.yaml#

properties:
  compatible:
    enum:
      - cirrus,cs42l43

  reg:
    maxItems: 1

  vdd-p-supply:
    description:
      Power supply for the high voltage interface.

  vdd-a-supply:
    description:
      Power supply for internal analog circuits.

  vdd-d-supply:
    description:
      Power supply for internal digital circuits. Can be internally supplied.

  vdd-io-supply:
    description:
      Power supply for external interface and internal digital logic.

  vdd-cp-supply:
    description:
      Power supply for the amplifier 3 and 4 charge pump.

  vdd-amp-supply:
    description:
      Power supply for amplifier 1 and 2.

  reset-gpios:
    maxItems: 1

  interrupt-controller: true

  "#interrupt-cells":
    const: 2

  interrupts:
    maxItems: 1

  "#sound-dai-cells":
    const: 1

  clocks:
    items:
      - description: Synchronous audio clock provided on mclk_in.

  clock-names:
    const: mclk

  cirrus,bias-low:
    type: boolean
    description:
      Select a 1.8V headset micbias rather than 2.8V.

  cirrus,bias-sense-microamp:
    description:
      Current at which the headset micbias sense clamp will engage, 0 to
      disable.
    enum: [ 0, 14, 23, 41, 50, 60, 68, 86, 95 ]
    default: 0

  cirrus,bias-ramp-ms:
    description:
      Time in milliseconds the hardware allows for the headset micbias to
      ramp up.
    enum: [ 10, 40, 90, 170 ]
    default: 170

  cirrus,detect-us:
    description:
      Time in microseconds the type detection will run for. Long values will
      cause more audible effects, but give more accurate detection.
    enum: [ 20, 100, 1000, 10000, 50000, 75000, 100000, 200000 ]
    default: 10000

  cirrus,button-automute:
    type: boolean
    description:
      Enable the hardware automuting of decimator 1 when a headset button is
      pressed.

  cirrus,buttons-ohms:
    description:
      Impedance in Ohms for each headset button, these should be listed in
      ascending order.
    minItems: 1
    maxItems: 6

  cirrus,tip-debounce-ms:
    description:
      Software debounce on tip sense triggering in milliseconds.
    default: 0

  cirrus,tip-invert:
    type: boolean
    description:
      Indicates tip detect polarity, inverted implies open-circuit whilst the
      jack is inserted.

  cirrus,tip-disable-pullup:
    type: boolean
    description:
      Indicates if the internal pullup on the tip detect should be disabled.

  cirrus,tip-fall-db-ms:
    description:
      Time in milliseconds a falling edge on the tip detect should be hardware
      debounced for. Note the falling edge is considered after the invert.
    enum: [ 0, 125, 250, 500, 750, 1000, 1250, 1500 ]
    default: 500

  cirrus,tip-rise-db-ms:
    description:
      Time in milliseconds a rising edge on the tip detect should be hardware
      debounced for. Note the rising edge is considered after the invert.
    enum: [ 0, 125, 250, 500, 750, 1000, 1250, 1500 ]
    default: 500

  cirrus,use-ring-sense:
    type: boolean
    description:
      Indicates if the ring sense should be used.

  cirrus,ring-invert:
    type: boolean
    description:
      Indicates ring detect polarity, inverted implies open-circuit whilst the
      jack is inserted.

  cirrus,ring-disable-pullup:
    type: boolean
    description:
      Indicates if the internal pullup on the ring detect should be disabled.

  cirrus,ring-fall-db-ms:
    description:
      Time in milliseconds a falling edge on the ring detect should be hardware
      debounced for. Note the falling edge is considered after the invert.
    enum: [ 0, 125, 250, 500, 750, 1000, 1250, 1500 ]
    default: 500

  cirrus,ring-rise-db-ms:
    description:
      Time in milliseconds a rising edge on the ring detect should be hardware
      debounced for. Note the rising edge is considered after the invert.
    enum: [ 0, 125, 250, 500, 750, 1000, 1250, 1500 ]
    default: 500

  pinctrl:
    type: object
    $ref: /schemas/pinctrl/pinctrl.yaml#
    additionalProperties: false

    properties:
      gpio-controller: true

      "#gpio-cells":
        const: 2

      gpio-ranges:
        items:
          - description: A phandle to the CODEC pinctrl node
            minimum: 0
          - const: 0
          - const: 0
          - const: 3

    patternProperties:
      "-state$":
        oneOf:
          - $ref: "#/$defs/cirrus-cs42l43-state"
          - patternProperties:
              "-pins$":
                $ref: "#/$defs/cirrus-cs42l43-state"
            additionalProperties: false

  spi:
    type: object
    $ref: /schemas/spi/spi-controller.yaml#
    unevaluatedProperties: false

$defs:
  cirrus-cs42l43-state:
    type: object

    allOf:
      - $ref: /schemas/pinctrl/pincfg-node.yaml#
      - $ref: /schemas/pinctrl/pinmux-node.yaml#

    oneOf:
      - required: [ groups ]
      - required: [ pins ]

    additionalProperties: false

    properties:
      groups:
        enum: [ gpio1, gpio2, gpio3, asp, pdmout2, pdmout1, i2c, spi ]

      pins:
        enum: [ gpio1, gpio2, gpio3,
                asp_dout, asp_fsync, asp_bclk,
                pdmout2_clk, pdmout2_data, pdmout1_clk, pdmout1_data,
                i2c_sda, i2c_scl,
                spi_miso, spi_sck, spi_ssb ]

      function:
        enum: [ gpio, spdif, irq, mic-shutter, spk-shutter ]

      drive-strength:
        description: Set drive strength in mA
        enum: [ 1, 2, 4, 8, 9, 10, 12, 16 ]

      input-debounce:
        description: Set input debounce in uS
        enum: [ 0, 85 ]

required:
  - compatible
  - reg
  - vdd-p-supply
  - vdd-a-supply
  - vdd-io-supply
  - vdd-cp-supply

additionalProperties: false

examples:
  - |
    #include <dt-bindings/interrupt-controller/irq.h>

    i2c {
        #address-cells = <1>;
        #size-cells = <0>;

        cs42l43: codec@1a {
            compatible = "cirrus,cs42l43";
            reg = <0x1a>;

            vdd-p-supply = <&vdd5v0>;
            vdd-a-supply = <&vdd1v8>;
            vdd-io-supply = <&vdd1v8>;
            vdd-cp-supply = <&vdd1v8>;
            vdd-amp-supply = <&vdd5v0>;

            reset-gpios = <&gpio 0>;

            interrupt-controller;
            #interrupt-cells = <2>;
            interrupt-parent = <&gpio>;
            interrupts = <56 IRQ_TYPE_LEVEL_LOW>;

            #sound-dai-cells = <1>;

            clocks = <&clks 0>;
            clock-names = "mclk";

            cs42l43_pins: pinctrl {
                gpio-controller;
                #gpio-cells = <2>;
                gpio-ranges = <&cs42l43_pins 0 0 3>;

                pinctrl-names = "default";
                pinctrl-0 = <&pinsettings>;

                pinsettings: default-state {
                    shutter-pins {
                        groups = "gpio3";
                        function = "mic-shutter";
                    };
                };
            };

            spi {
                #address-cells = <1>;
                #size-cells = <0>;

                cs-gpios = <&cs42l43_pins 1 0>;

                sensor@0 {
                    compatible = "bosch,bme680";
                    reg = <0>;
                    spi-max-frequency = <1400000>;
                };
            };
        };
    };
+71 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/spi/brcm,bcm63xx-spi.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Broadcom BCM6348/BCM6358 SPI controller

maintainers:
  - Jonas Gorski <jonas.gorski@gmail.com>

description: |
  Broadcom "Low Speed" SPI controller found in many older MIPS based Broadband
  SoCs.

  This controller has a limitation that can not keep the chip select line active
  between the SPI transfers within the same SPI message. This can terminate the
  transaction to some SPI devices prematurely. The issue can be worked around by
  the controller's prepend mode.

allOf:
  - $ref: spi-controller.yaml#

properties:
  compatible:
    oneOf:
      - items:
          - enum:
              - brcm,bcm6368-spi
              - brcm,bcm6362-spi
              - brcm,bcm63268-spi
          - const: brcm,bcm6358-spi
      - enum:
          - brcm,bcm6348-spi
          - brcm,bcm6358-spi

  reg:
    maxItems: 1

  clocks:
    items:
      - description: SPI master reference clock

  clock-names:
    items:
      - const: spi

  interrupts:
    maxItems: 1

required:
  - compatible
  - reg
  - clocks
  - clock-names
  - interrupts

unevaluatedProperties: false

examples:
  - |
    spi@10000800 {
        compatible = "brcm,bcm6368-spi", "brcm,bcm6358-spi";
        reg = <0x10000800 0x70c>;
        interrupts = <1>;
        clocks = <&clkctl 9>;
        clock-names = "spi";
        num-cs = <5>;
        #address-cells = <1>;
        #size-cells = <0>;
    };
+11 −1
Original line number Diff line number Diff line
@@ -86,7 +86,17 @@ properties:
    maxItems: 1

  clocks:
    maxItems: 1
    minItems: 1
    maxItems: 3

  clock-names:
    oneOf:
      - items:
          - const: ref
      - items:
          - const: ref
          - const: ahb
          - const: apb

  cdns,fifo-depth:
    description:
+46 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/spi/loongson,ls2k-spi.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Loongson SPI controller

maintainers:
  - Yinbo Zhu <zhuyinbo@loongson.cn>

allOf:
  - $ref: /schemas/spi/spi-controller.yaml#

properties:
  compatible:
    oneOf:
      - enum:
          - loongson,ls2k1000-spi
      - items:
          - enum:
              - loongson,ls2k0500-spi
          - const: loongson,ls2k1000-spi

  reg:
    maxItems: 1

  clocks:
    maxItems: 1

required:
  - compatible
  - reg
  - clocks

unevaluatedProperties: false

examples:
  - |
    spi0: spi@1fff0220{
        compatible = "loongson,ls2k1000-spi";
        reg = <0x1fff0220 0x10>;
        clocks = <&clk 17>;
        #address-cells = <1>;
        #size-cells = <0>;
    };
+0 −61
Original line number Diff line number Diff line
NVIDIA Tegra114 SPI controller.

Required properties:
- compatible : For Tegra114, must contain "nvidia,tegra114-spi".
  Otherwise, must contain '"nvidia,<chip>-spi", "nvidia,tegra114-spi"' where
  <chip> is tegra124, tegra132, or tegra210.
- reg: Should contain SPI registers location and length.
- interrupts: Should contain SPI interrupts.
- clock-names : Must include the following entries:
  - spi
- resets : Must contain an entry for each entry in reset-names.
  See ../reset/reset.txt for details.
- reset-names : Must include the following entries:
  - spi
- dmas : Must contain an entry for each entry in clock-names.
  See ../dma/dma.txt for details.
- dma-names : Must include the following entries:
  - rx
  - tx
- clocks : Must contain an entry for each entry in clock-names.
  See ../clocks/clock-bindings.txt for details.

Recommended properties:
- spi-max-frequency: Definition as per
                     Documentation/devicetree/bindings/spi/spi-bus.txt
Optional properties:
- nvidia,tx-clk-tap-delay: Delays the clock going out to the external device
  with this tap value. This property is used to tune the outgoing data from
  Tegra SPI master with respect to outgoing Tegra SPI master clock.
  Tap values vary based on the platform design trace lengths from Tegra SPI
  to corresponding slave devices. Valid tap values are from 0 thru 63.
- nvidia,rx-clk-tap-delay: Delays the clock coming in from the external device
  with this tap value. This property is used to adjust the Tegra SPI master
  clock with respect to the data from the SPI slave device.
  Tap values vary based on the platform design trace lengths from Tegra SPI
  to corresponding slave devices. Valid tap values are from 0 thru 63.

Example:

spi@7000d600 {
	compatible = "nvidia,tegra114-spi";
	reg = <0x7000d600 0x200>;
	interrupts = <0 82 0x04>;
	spi-max-frequency = <25000000>;
	#address-cells = <1>;
	#size-cells = <0>;
	clocks = <&tegra_car 44>;
	clock-names = "spi";
	resets = <&tegra_car 44>;
	reset-names = "spi";
	dmas = <&apbdma 16>, <&apbdma 16>;
	dma-names = "rx", "tx";
	<spi-client>@<bus_num> {
		...
		...
		nvidia,rx-clk-tap-delay = <0>;
		nvidia,tx-clk-tap-delay = <16>;
		...
	};

};
Loading