Skip to content

Commit c41cfae

Browse files
committed
Merge tag 'spi-v7.2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi
Pull spi updates from Mark Brown: "This has been quite a busy release, mainly due to the subsystem wide work Johan Hovold has done to modernise resource allocation for the subsystem on probe, the subsystem did some very clever allocation management pre devm which didn't quite mesh comfortably with managed allocations and made it far too easy to introduce error handling and removal bugs. - Cleanup and simplification of controller struct allocation, moving everything over to devm and making the devm APIs more robust, from Johan Hovold - Support for spi-mem devices that don't assert chip select and support for a secondary read command for memory mapped flashes, some commits for this are shared with mtd. - Support for SpacemiT K1" * tag 'spi-v7.2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: (118 commits) spi: Fix mismatched DT property access types spi: xilinx: use FIFO occupancy register to determine buffer size spi: spi-mem: Fix spi_controller_mem_ops kdoc spi: xilinx: let transfers timeout in case of no IRQ spi: dt-bindings: nuvoton,npcm750-fiu: Convert to DT schema spi: meson-spifc: fix runtime PM leak on remove spi: Use named initializers for platform_device_id arrays spi: rzv2h-rspi: Add suspend/resume support spi: dw-pci: remove redundant pci_free_irq_vectors() calls spi: ep93xx: fix double-free of zeropage on DMA setup failure spi: cadence-xspi: Revert COMPILE_TEST support spi: cadence-xspi: Support 32bit and 64bit slave dma interface spi: tegra210-quad: Allocate DMA memory for DMA engine spi: imx: replace dmaengine_terminate_all() with dmaengine_terminate_sync() spi: fsl-lpspi: terminate the RX channel on TX prepare failure path spi: fsl-lpspi: replace dmaengine_terminate_all() with dmaengine_terminate_sync() spi: atmel: fix DMA channel and bounce buffer leaks spi: omap2-mcspi: Use of_device_get_match_data() spi: Use named initializers for arrays of i2c_device_data spi: aspeed: Replace VLA parameter with flat pointer in calibration helper ...
2 parents 1e66d46 + f846d68 commit c41cfae

108 files changed

Lines changed: 2084 additions & 1448 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Documentation/devicetree/bindings/spi/nuvoton,npcm-fiu.txt

Lines changed: 0 additions & 58 deletions
This file was deleted.
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/spi/nuvoton,npcm750-fiu.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Nuvoton NPCM Flash Interface Unit (FIU) SPI Controller
8+
9+
maintainers:
10+
- Tomer Maimon <tmaimon77@gmail.com>
11+
12+
allOf:
13+
- $ref: /schemas/spi/spi-controller.yaml#
14+
15+
description: |
16+
NPCM FIU supports single, dual and quad communication interface.
17+
18+
The NPCM7XX supports three FIU modules:
19+
FIU0 and FIUx support two chip selects
20+
FIU3 supports four chip selects.
21+
22+
The NPCM8XX supports four FIU modules:
23+
FIU0 and FIUx support two chip selects
24+
FIU1 and FIU3 support four chip selects.
25+
26+
The FIU control register block is always required. The direct-mapped
27+
flash window is optional because the controller can still access flash
28+
through the UMA path when that mapping is not described.
29+
30+
Alias convention:
31+
The '/aliases' node should define:
32+
For NPCM7xx: fiu0=&fiu0; fiu1=&fiu3; fiu2=&fiux;
33+
For NPCM8xx: fiu0=&fiu0; fiu1=&fiu3; fiu2=&fiux; fiu3=&fiu1;
34+
35+
properties:
36+
compatible:
37+
enum:
38+
- nuvoton,npcm750-fiu # Poleg NPCM7XX
39+
- nuvoton,npcm845-fiu # Arbel NPCM8XX
40+
41+
reg:
42+
description:
43+
The first resource is the FIU control register block. An optional second
44+
resource describes the direct-mapped flash window used for direct
45+
read/write accesses.
46+
minItems: 1
47+
items:
48+
- description: FIU control registers
49+
- description: Memory-mapped flash contents
50+
51+
reg-names:
52+
description:
53+
Resource names for the control registers and optional direct-mapped
54+
flash window.
55+
minItems: 1
56+
items:
57+
- const: control
58+
- const: memory
59+
60+
clocks:
61+
maxItems: 1
62+
description: FIU reference clock.
63+
64+
nuvoton,spix-mode:
65+
type: boolean
66+
description: Enable SPIX mode for an expansion bus to an ASIC or CPLD.
67+
68+
required:
69+
- compatible
70+
- reg
71+
- reg-names
72+
- clocks
73+
74+
unevaluatedProperties: false
75+
76+
examples:
77+
- |
78+
#include <dt-bindings/clock/nuvoton,npcm7xx-clock.h>
79+
spi@fb000000 {
80+
compatible = "nuvoton,npcm750-fiu";
81+
reg = <0xfb000000 0x1000>, <0x80000000 0x10000000>;
82+
reg-names = "control", "memory";
83+
#address-cells = <1>;
84+
#size-cells = <0>;
85+
clocks = <&clk NPCM7XX_CLK_SPI0>;
86+
87+
flash@0 {
88+
compatible = "jedec,spi-nor";
89+
reg = <0>;
90+
#address-cells = <1>;
91+
#size-cells = <1>;
92+
};
93+
};

Documentation/devicetree/bindings/spi/qcom,spi-qcom-qspi.yaml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,11 @@ description: The QSPI controller allows SPI protocol communication in single,
1313
dual, or quad wire transmission modes for read/write access to slaves such
1414
as NOR flash.
1515

16-
allOf:
17-
- $ref: /schemas/spi/spi-controller.yaml#
18-
1916
properties:
2017
compatible:
2118
items:
2219
- enum:
20+
- qcom,qcs615-qspi
2321
- qcom,sc7180-qspi
2422
- qcom,sc7280-qspi
2523
- qcom,sdm845-qspi
@@ -67,6 +65,23 @@ required:
6765
- clock-names
6866
- clocks
6967

68+
allOf:
69+
- $ref: /schemas/spi/spi-controller.yaml#
70+
- if:
71+
properties:
72+
compatible:
73+
contains:
74+
const: qcom,qcs615-qspi
75+
then:
76+
properties:
77+
interconnects:
78+
minItems: 2
79+
interconnect-names:
80+
minItems: 2
81+
required:
82+
- interconnects
83+
- interconnect-names
84+
7085
unevaluatedProperties: false
7186

7287
examples:
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/spi/spacemit,k1-spi.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: SpacemiT K1 SoC Serial Peripheral Interface (SPI)
8+
9+
maintainers:
10+
- Alex Elder <elder@kernel.org>
11+
12+
description:
13+
The SpacemiT K1 SoC implements a SPI controller that has two 32-entry
14+
FIFOs, for transmit and receive. Details are currently available in
15+
section 18.2.1 of the K1 User Manual, found in the SpacemiT Keystone
16+
K1 Documentation[1]. The controller transfers words using PIO. DMA
17+
transfers are supported as well, if both TX and RX DMA channels are
18+
specified,
19+
20+
[1] https://developer.spacemit.com/documentation
21+
22+
allOf:
23+
- $ref: /schemas/spi/spi-controller.yaml#
24+
25+
properties:
26+
compatible:
27+
const: spacemit,k1-spi
28+
29+
reg:
30+
maxItems: 1
31+
32+
clocks:
33+
items:
34+
- description: Core clock
35+
- description: Bus clock
36+
37+
clock-names:
38+
items:
39+
- const: core
40+
- const: bus
41+
42+
resets:
43+
maxItems: 1
44+
45+
interrupts:
46+
maxItems: 1
47+
48+
dmas:
49+
items:
50+
- description: RX DMA channel
51+
- description: TX DMA channel
52+
53+
dma-names:
54+
items:
55+
- const: rx
56+
- const: tx
57+
58+
required:
59+
- compatible
60+
- reg
61+
- clocks
62+
- clock-names
63+
- resets
64+
- interrupts
65+
66+
unevaluatedProperties: false
67+
68+
examples:
69+
- |
70+
71+
#include <dt-bindings/clock/spacemit,k1-syscon.h>
72+
spi@d401c000 {
73+
compatible = "spacemit,k1-spi";
74+
reg = <0xd401c000 0x30>;
75+
#address-cells = <1>;
76+
#size-cells = <0>;
77+
clocks = <&syscon_apbc CLK_SSP3>,
78+
<&syscon_apbc CLK_SSP3_BUS>;
79+
clock-names = "core", "bus";
80+
resets = <&syscon_apbc RESET_SSP3>;
81+
interrupts = <55>;
82+
dmas = <&pdma 20>, <&pdma 19>;
83+
dma-names = "rx", "tx";
84+
};

drivers/acpi/acpi_apd.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,11 @@ static const struct apd_device_desc hip08_spi_desc = {
182182
.fixed_clk_rate = 250000000,
183183
};
184184

185+
static const struct apd_device_desc leca_spi_desc = {
186+
.setup = acpi_apd_setup,
187+
.fixed_clk_rate = 400000000,
188+
};
189+
185190
static const struct apd_device_desc leca_i2c_desc = {
186191
.setup = acpi_apd_setup,
187192
.fixed_clk_rate = 250000000,
@@ -257,6 +262,7 @@ static const struct acpi_device_id acpi_apd_device_ids[] = {
257262
{ "HISI02A2", APD_ADDR(hip08_i2c_desc) },
258263
{ "HISI02A3", APD_ADDR(hip08_lite_i2c_desc) },
259264
{ "HISI0173", APD_ADDR(hip08_spi_desc) },
265+
{ "LECA0002", APD_ADDR(leca_spi_desc) },
260266
{ "LECA0003", APD_ADDR(leca_i2c_desc) },
261267
{ "NXP0001", APD_ADDR(nxp_i2c_desc) },
262268
#endif

drivers/media/usb/msi2500/msi2500.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -575,6 +575,7 @@ static void msi2500_disconnect(struct usb_interface *intf)
575575
v4l2_device_disconnect(&dev->v4l2_dev);
576576
video_unregister_device(&dev->vdev);
577577
spi_unregister_controller(dev->ctlr);
578+
spi_controller_put(dev->ctlr);
578579
mutex_unlock(&dev->v4l2_lock);
579580
mutex_unlock(&dev->vb_queue_lock);
580581

@@ -1230,10 +1231,8 @@ static int msi2500_probe(struct usb_interface *intf,
12301231
ctlr->transfer_one_message = msi2500_transfer_one_message;
12311232
spi_controller_set_devdata(ctlr, dev);
12321233
ret = spi_register_controller(ctlr);
1233-
if (ret) {
1234-
spi_controller_put(ctlr);
1235-
goto err_unregister_v4l2_dev;
1236-
}
1234+
if (ret)
1235+
goto err_put_controller;
12371236

12381237
/* load v4l2 subdevice */
12391238
sd = v4l2_spi_new_subdev(&dev->v4l2_dev, ctlr, &board_info);
@@ -1276,6 +1275,8 @@ static int msi2500_probe(struct usb_interface *intf,
12761275
v4l2_ctrl_handler_free(&dev->hdl);
12771276
err_unregister_controller:
12781277
spi_unregister_controller(dev->ctlr);
1278+
err_put_controller:
1279+
spi_controller_put(dev->ctlr);
12791280
err_unregister_v4l2_dev:
12801281
v4l2_device_unregister(&dev->v4l2_dev);
12811282
err_free_mem:

0 commit comments

Comments
 (0)