OSDN Git Service
Minghao Chi [Tue, 15 Mar 2022 02:31:38 +0000 (02:31 +0000)]
spi: tegra20: Use of_device_get_match_data()
Use of_device_get_match_data() to simplify the code.
Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
Link: https://lore.kernel.org/r/20220315023138.2118293-1-chi.minghao@zte.com.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
Mark Brown [Tue, 15 Mar 2022 13:38:55 +0000 (13:38 +0000)]
fix typos in comments
Merge series from Julia Lawall <Julia.Lawall@inria.fr>:
Various spelling mistakes in comments.
Detected with the help of Coccinelle.
---
drivers/base/devres.c | 4 ++--
drivers/clk/qcom/gcc-sm6125.c | 2 +-
drivers/clk/ti/clkctrl.c | 2 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 4 ++--
drivers/gpu/drm/amd/display/dc/bios/command_table.c | 6 +++---
drivers/gpu/drm/amd/pm/amdgpu_pm.c | 2 +-
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 4 ++--
drivers/gpu/drm/sti/sti_gdp.c | 2 +-
drivers/infiniband/hw/qib/qib_iba7220.c | 4 ++--
drivers/leds/leds-pca963x.c | 2 +-
drivers/media/i2c/ov5695.c | 2 +-
drivers/mfd/rohm-bd9576.c | 2 +-
drivers/mtd/ubi/block.c | 2 +-
drivers/net/can/usb/ucan.c | 4 ++--
drivers/net/ethernet/packetengines/yellowfin.c | 2 +-
drivers/net/wireless/ath/ath6kl/htc_mbox.c | 2 +-
drivers/net/wireless/cisco/airo.c | 2 +-
drivers/net/wireless/mediatek/mt76/mt7915/init.c | 2 +-
drivers/net/wireless/realtek/rtlwifi/rtl8821ae/dm.c | 6 +++---
drivers/platform/x86/uv_sysfs.c | 2 +-
drivers/s390/crypto/pkey_api.c | 2 +-
drivers/scsi/aic7xxx/aicasm/aicasm.c | 2 +-
drivers/scsi/elx/libefc_sli/sli4.c | 2 +-
drivers/scsi/lpfc/lpfc_mbox.c | 2 +-
drivers/scsi/qla2xxx/qla_gs.c | 2 +-
drivers/spi/spi-sun4i.c | 2 +-
drivers/staging/rtl8723bs/core/rtw_mlme.c | 2 +-
drivers/usb/gadget/udc/snps_udc_core.c | 2 +-
fs/kernfs/file.c | 2 +-
kernel/events/core.c | 2 +-
30 files changed, 39 insertions(+), 39 deletions(-)
Leilk Liu [Tue, 15 Mar 2022 03:24:08 +0000 (11:24 +0800)]
spi: mediatek: add ipm design support for MT7986
this patch add the support of ipm design.
Signed-off-by: Leilk Liu <leilk.liu@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20220315032411.2826-4-leilk.liu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Leilk Liu [Tue, 15 Mar 2022 03:24:07 +0000 (11:24 +0800)]
spi: Add compatible for MT7986
This patch adds dt-binding documentation for MT7986.
Signed-off-by: Leilk Liu <leilk.liu@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20220315032411.2826-3-leilk.liu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Julia Lawall [Mon, 14 Mar 2022 11:53:45 +0000 (12:53 +0100)]
spi: sun4i: fix typos in comments
Various spelling mistakes in comments.
Detected with the help of Coccinelle.
Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>
Acked-by: Chen-Yu Tsai <wens@csie.org>
Link: https://lore.kernel.org/r/20220314115354.144023-22-Julia.Lawall@inria.fr
Signed-off-by: Mark Brown <broonie@kernel.org>
Leilk Liu [Tue, 15 Mar 2022 03:24:06 +0000 (11:24 +0800)]
spi: mediatek: support tick_delay without enhance_timing
this patch support tick_delay bit[31:30] without enhance_timing feature.
Fixes:
f84d866ab43f("spi: mediatek: add tick_delay support")
Signed-off-by: Leilk Liu <leilk.liu@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20220315032411.2826-2-leilk.liu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Kuldeep Singh [Wed, 9 Mar 2022 17:18:47 +0000 (22:48 +0530)]
spi: Update clock-names property for arm pl022
PL022 has two input clocks named sspclk and apb_pclk. Current schema
refers to two notations of sspclk which are indeed same and thus one can
be dropped. Update clock-names property to reflect the same.
Signed-off-by: Kuldeep Singh <singh.kuldeep87k@gmail.com>
Link: https://lore.kernel.org/r/20220309171847.5345-1-singh.kuldeep87k@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Yihao Han [Thu, 10 Mar 2022 09:48:06 +0000 (01:48 -0800)]
spi: rockchip-sfc: fix platform_get_irq.cocci warning
Remove dev_err() messages after platform_get_irq*() failures.
platform_get_irq() already prints an error.
Generated by: scripts/coccinelle/api/platform_get_irq.cocci
Signed-off-by: Yihao Han <hanyihao@vivo.com>
Link: https://lore.kernel.org/r/20220310094806.13734-1-hanyihao@vivo.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Mark Brown [Tue, 8 Mar 2022 20:07:09 +0000 (20:07 +0000)]
spi: Tesla FSD support
Merge series from Alim Akhtar:
This series adds support for the SPI controller in the Tesla FSD SoC,
also pulling in:
git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git ib-mfd-spi-dt-v5.18
from the MFD tree which has dependencies for the DT bindings.
Alim Akhtar [Tue, 8 Mar 2022 12:16:40 +0000 (17:46 +0530)]
spi: s3c64xx: Add spi port configuration for Tesla FSD SoC
Add compatible and port configuration for spi controller
for Tesla Full Self-Driving SoC.
Cc: linux-fsd@tesla.com
Signed-off-by: Aswani Reddy <aswani.reddy@samsung.com>
Signed-off-by: Alim Akhtar <alim.akhtar@samsung.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Reviewed-by: Andi Shyti <andi@etezian.org>
Link: https://lore.kernel.org/r/20220308121640.27344-2-alim.akhtar@samsung.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Alim Akhtar [Tue, 8 Mar 2022 12:16:39 +0000 (17:46 +0530)]
spi: dt-bindings: samsung: Add fsd spi compatible
Adds spi controller dt-binding compatible information for
Tesla Full Self-Driving (FSD) SoC.
Cc: linux-fsd@tesla.com
Signed-off-by: Adithya K V <adithya.kv@samsung.com>
Signed-off-by: Alim Akhtar <alim.akhtar@samsung.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Reviewed-by: Andi Shyti <andi@etezian.org>
Link: https://lore.kernel.org/r/20220308121640.27344-1-alim.akhtar@samsung.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Mark Brown [Tue, 8 Mar 2022 17:19:24 +0000 (17:19 +0000)]
Tegra QUAD SPI combined sequence mode
Merge series from Krishna Yarlagadda <kyarlagadda@nvidia.com>:
Add ACPI support for Tegra210 QUAD SPI driver Support new Tegra194
feature, combined sequence mode.
Andy Shevchenko [Mon, 7 Mar 2022 17:37:40 +0000 (19:37 +0200)]
spi: topcliff-pch: Prevent usage of potentially stale DMA device
DMA device is expected to be available while SPI transfer is ongoing.
Prevent usage of potentially stale DMA device by keeping reference
count till the end of the transfer.
Fixes:
4d986ffa036a ("spi: add missing pci_dev_put() before return")
Reported-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20220307173740.80996-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Krishna Yarlagadda [Mon, 7 Mar 2022 16:55:18 +0000 (22:25 +0530)]
spi: tegra210-quad: combined sequence mode
Add combined sequence mode supported by Tegra QSPI controller.
For commands which contain cmd, addr, data parts to it, controller
can accept all 3 transfers at once and avoid interrupt for each
transfer. This would improve read & write performance.
Signed-off-by: Krishna Yarlagadda <kyarlagadda@nvidia.com>
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20220307165519.38380-3-kyarlagadda@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Krishna Yarlagadda [Mon, 7 Mar 2022 16:55:17 +0000 (22:25 +0530)]
spi: tegra210-quad: add acpi support
Add ACPI ID for Tegra QUAD SPI. Switch to common device property calls.
Skip clock calls that are not updated in ACPI boot.
Runtime PM support is not yet enabled with ACPI boot.
Signed-off-by: Krishna Yarlagadda <kyarlagadda@nvidia.com>
Link: https://lore.kernel.org/r/20220307165519.38380-2-kyarlagadda@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Jonathan Neuschäfer [Sun, 6 Mar 2022 14:23:12 +0000 (15:23 +0100)]
spi: npcm-fiu: Fix typo ("npxm")
The platform is called NPCM, not NPXM.
Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
Link: https://lore.kernel.org/r/20220306142312.109017-1-j.neuschaefer@gmx.net
Signed-off-by: Mark Brown <broonie@kernel.org>
Jon Hunter [Mon, 7 Mar 2022 11:35:29 +0000 (11:35 +0000)]
spi: Fix Tegra QSPI example
When running dt_binding_check on the nvidia,tegra210-quad.yaml binding
document the following error is reported ...
nvidia,tegra210-quad.example.dt.yaml:0:0: /example-0/spi@
70410000/flash@0:
failed to match any schema with compatible: ['spi-nor']
Update the example in the binding document to fix the above error.
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Fixes:
9684752e5fe3 ("dt-bindings: spi: Add Tegra Quad SPI device tree binding")
Link: https://lore.kernel.org/r/20220307113529.315685-1-jonathanh@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Xingbang Liu [Wed, 2 Mar 2022 07:15:21 +0000 (15:15 +0800)]
spi: qup: replace spin_lock_irqsave by spin_lock in hard IRQ
The code has been in a irq-disabled context since it is hard IRQ. There
is no necessity to do it again.
Signed-off-by: Xingbang Liu <liu.airalert@gmail.com>
Link: https://lore.kernel.org/r/20220302071521.6638-1-liu.airalert@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Yihao Han [Thu, 3 Mar 2022 12:50:54 +0000 (04:50 -0800)]
spi: cadence: fix platform_get_irq.cocci warning
Remove dev_err() messages after platform_get_irq*() failures.
platform_get_irq() already prints an error.
Generated by: scripts/coccinelle/api/platform_get_irq.cocci
Signed-off-by: Yihao Han <hanyihao@vivo.com>
Link: https://lore.kernel.org/r/20220303125054.3574-1-hanyihao@vivo.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Kuldeep Singh [Wed, 2 Mar 2022 19:29:15 +0000 (00:59 +0530)]
spi: Update NXP Flexspi maintainer details
Add Han Xu as flexspi maintainer.
Also, update my email address as previous one is not working anymore.
Signed-off-by: Kuldeep Singh <singh.kuldeep87k@gmail.com>
Acked-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20220302192915.6193-1-singh.kuldeep87k@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Krzysztof Kozlowski [Tue, 15 Feb 2022 07:53:44 +0000 (08:53 +0100)]
dt-bindings: mfd: maxim,max77802: Convert to dtschema
Convert the MFD part of Maxim MAX77802 PMIC to DT schema format. The
example DTS was copied from existing DTS (exynos5800-peach-pi.dts), so
keep the license as GPL-2.0-only.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20220215075344.31421-3-krzysztof.kozlowski@canonical.com
Krzysztof Kozlowski [Tue, 15 Feb 2022 07:53:43 +0000 (08:53 +0100)]
regulator: dt-bindings: maxim,max77802: Convert to dtschema
Convert the regulators of Maxim MAX77802 PMIC to DT schema format.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Acked-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20220215075344.31421-2-krzysztof.kozlowski@canonical.com
Krzysztof Kozlowski [Tue, 15 Feb 2022 07:47:59 +0000 (08:47 +0100)]
dt-bindings: mfd: maxim,max14577: Convert to dtschema
Convert the MFD part of Maxim MAX14577/MAX77836 MUIC to DT schema
format. The example DTS was copied from existing DTS
(exynos3250-rinato.dts), so keep the license as GPL-2.0-only.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20220215074759.29402-4-krzysztof.kozlowski@canonical.com
Krzysztof Kozlowski [Tue, 15 Feb 2022 07:47:58 +0000 (08:47 +0100)]
regulator: dt-bindings: maxim,max14577: Convert to dtschema
Convert the regulator bindings of Maxim MAX14577/MAX77835 MUIC to DT
schema format. The existing bindings were defined in
../bindings/mfd/max14577.txt.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Reviewed-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20220215074759.29402-3-krzysztof.kozlowski@canonical.com
Krzysztof Kozlowski [Tue, 15 Feb 2022 07:47:57 +0000 (08:47 +0100)]
dt-bindings: power: supply: maxim,max14577: Convert to dtschema
Convert the Charger bindings of Maxim MAX14577/MAX77836 MUIC to DT
schema format. The existing bindings were defined in
../bindings/mfd/max14577.txt.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Acked-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20220215074759.29402-2-krzysztof.kozlowski@canonical.com
Krzysztof Kozlowski [Mon, 24 Jan 2022 08:23:47 +0000 (09:23 +0100)]
spi: s3c64xx: Allow controller-data to be optional
The Samsung SoC SPI driver requires to provide controller-data node
for each of SPI peripheral device nodes. Make this controller-data node
optional, so DTS could be simpler.
Suggested-by: Rob Herring <robh@kernel.org>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Reviewed-by: Sam Protsenko <semen.protsenko@linaro.org>
Reviewed-by: Andi Shyti <andi@etezian.org>
Reviwed-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20220124082347.32747-5-krzysztof.kozlowski@canonical.com
Krzysztof Kozlowski [Mon, 24 Jan 2022 08:23:46 +0000 (09:23 +0100)]
mfd: dt-bindings: google,cros-ec: Fix indentation in example
Correct level of indentation in the example.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20220124082347.32747-4-krzysztof.kozlowski@canonical.com
Krzysztof Kozlowski [Mon, 24 Jan 2022 08:23:45 +0000 (09:23 +0100)]
mfd: dt-bindings: google,cros-ec: Reference Samsung SPI bindings
The ChromeOS Embedded Controller appears on boards with Samsung Exynos
SoC, where Exynos SPI bindings expect controller-data node. Reference
SPI peripheral bindings which include now Samsung SPI peripheral parts.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20220124082347.32747-3-krzysztof.kozlowski@canonical.com
Krzysztof Kozlowski [Mon, 24 Jan 2022 08:23:44 +0000 (09:23 +0100)]
spi: dt-bindings: samsung: Convert to dtschema
Convert the Samsung SoC (S3C24xx, S3C64xx, S5Pv210, Exynos) SPI
controller bindings to DT schema format.
The conversion also drops requirement from providing controller-data and
its data for each of SPI peripheral device nodes. The dtschema cannot
express this and the requirement is being relaxed in the driver now.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Reviewed-by: Sam Protsenko <semen.protsenko@linaro.org>
Acked-by: Pratyush Yadav <p.yadav@ti.com>
Reviewed-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20220124082347.32747-2-krzysztof.kozlowski@canonical.com
Krzysztof Kozlowski [Tue, 11 Jan 2022 17:48:05 +0000 (18:48 +0100)]
MAINTAINERS: mfd: Cover MAX77843 by Maxim PMIC/MUIC for Exynos boards entry
The MAX77843 is used in Exynos5433-based TM2 boards and shares some
parts of code with MAX77693 (regulator and haptic motor drivers).
Include all MAX77843 drivers in the entry for Maxim PMIC/MUIC drivers
for Exynos boards, so they will receive some dedicated review coverage.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20220111174805.223732-6-krzysztof.kozlowski@canonical.com
Krzysztof Kozlowski [Tue, 11 Jan 2022 17:48:04 +0000 (18:48 +0100)]
dt-bindings: mfd: maxim,max77843: Add MAX77843 bindings
Document the bindings for MAX77843 MFD driver, based on Exynos5433 TM2
devicetree. These are neither accurate nor finished bindings but at
least allow parsing existing DTS files.
The example DTS was copied from existing DTS
(exynos5433-tm2-common.dtsi), so keep the license as GPL-2.0-only.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20220111174805.223732-5-krzysztof.kozlowski@canonical.com
Krzysztof Kozlowski [Tue, 11 Jan 2022 17:48:03 +0000 (18:48 +0100)]
regulator: dt-bindings: maxim,max77843: Add MAX77843 bindings
Document the bindings for MAX77843 regulator driver. The bindings are
almost identical to MAX77693 bindings, except the actual names of
regulators.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Reviewed-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20220111174805.223732-4-krzysztof.kozlowski@canonical.com
Krzysztof Kozlowski [Tue, 11 Jan 2022 17:48:02 +0000 (18:48 +0100)]
dt-bindings: extcon: maxim,max77843: Add MAX77843 bindings
Document the bindings for MAX77843 MUIC/extcon driver, based on
Exynos5433 TM2 devicetree. These are neither accurate nor finished
bindings but at least allow parsing existing DTS files.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20220111174805.223732-3-krzysztof.kozlowski@canonical.com
Minghao Chi (CGEL ZTE) [Thu, 3 Mar 2022 09:21:31 +0000 (09:21 +0000)]
spi: Use of_device_get_match_data()
Use of_device_get_match_data() to simplify the code.
Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Minghao Chi (CGEL ZTE) <chi.minghao@zte.com.cn>
Link: https://lore.kernel.org/r/20220303092131.2060044-1-chi.minghao@zte.com.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
Jiasheng Jiang [Wed, 2 Mar 2022 09:20:51 +0000 (17:20 +0800)]
spi: spi-zynqmp-gqspi: Handle error for dma_set_mask
As the potential failure of the dma_set_mask(),
it should be better to check it and return error
if fails.
Fixes:
126bdb606fd2 ("spi: spi-zynqmp-gqspi: return -ENOMEM if dma_map_single fails")
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Link: https://lore.kernel.org/r/20220302092051.121343-1-jiasheng@iscas.ac.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
Rob Herring [Tue, 1 Mar 2022 21:23:57 +0000 (15:23 -0600)]
spi: dt-bindings: mediatek: Set min size for 'mediatek,pad-select'
The minimum array length defaults to the same size as the maximum. For
'mediatek,pad-select', the example has a length of 2 and in-tree .dts
files have a length of 1, but the schema says the length must be 4.
There's currently no warning in the example because the schema fixups
are not handling this case correctly.
Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20220301212358.1887668-1-robh@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Lad Prabhakar [Tue, 1 Mar 2022 13:42:43 +0000 (13:42 +0000)]
spi: dt-bindings: renesas,rspi: Drop comment for generic compatible string
Drop comment "# RZ/A and RZ/G2{L,LC}" for generic compatible string
"renesas,rspi-rz" as this will avoid changing the line for every new SoC
addition.
Suggested-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Link: https://lore.kernel.org/r/20220301134244.20174-1-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Lad Prabhakar [Sun, 27 Feb 2022 22:59:56 +0000 (22:59 +0000)]
spi: dt-bindings: renesas,rspi: Document RZ/V2L SoC
Add RSPI binding documentation for Renesas RZ/V2L SoC.
RSPI block is identical to one found on RZ/A, so no driver changes are
required. The fallback compatible string "renesas,rspi-rz" will be used
on RZ/V2L.
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20220227225956.29570-1-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Yun Zhou [Thu, 17 Feb 2022 14:12:34 +0000 (22:12 +0800)]
spi: use specific last_cs instead of last_cs_enable
Commit
d40f0b6f2e21 instroduced last_cs_enable to avoid setting
chipselect if it's not necessary, but it also introduces a bug. The
chipselect may not be set correctly on multi-device SPI busses. The
reason is that we can't judge the chipselect by bool last_cs_enable,
since chipselect may be modified after other devices were accessed.
So we should record the specific state of chipselect in case of
confusion.
Signed-off-by: Yun Zhou <yun.zhou@windriver.com>
Link: https://lore.kernel.org/r/20220217141234.72737-1-yun.zhou@windriver.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Andy Shevchenko [Fri, 25 Feb 2022 17:23:50 +0000 (19:23 +0200)]
spi: pxa2xx-pci: Constify struct pxa_spi_info variables
Now when there are no dynamical changes required, we may
constify struct pxa_spi_info variables.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20220225172350.69797-11-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Andy Shevchenko [Fri, 25 Feb 2022 17:23:49 +0000 (19:23 +0200)]
spi: pxa2xx-pci: Drop temporary storage use for a handful of members
Instead of using temporary storage, assign the values directly
to the corresponding struct pxa2xx_spi_controller members.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20220225172350.69797-10-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Andy Shevchenko [Fri, 25 Feb 2022 17:23:48 +0000 (19:23 +0200)]
spi: pxa2xx-pci: Extract pxa2xx_spi_pci_clk_register()
Extract pxa2xx_spi_pci_clk_register() from ->probe() in order to reuse it
later on for getting rid of max_clk_rate temporary storage.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20220225172350.69797-9-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Andy Shevchenko [Fri, 25 Feb 2022 17:23:47 +0000 (19:23 +0200)]
spi: pxa2xx-pci: Drop unneeded checks in lpss_spi_setup()
All of the LPSS devices are using DMA and set the parameters up,
hence no need to test for that.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20220225172350.69797-8-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Andy Shevchenko [Fri, 25 Feb 2022 17:23:46 +0000 (19:23 +0200)]
spi: pxa2xx-pci: Replace enum with direct use of PCI IDs
Instead of creating an abstraction on top of PCI IDs, just use them directly.
The corresponding enum can be dropped.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20220225172350.69797-7-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Andy Shevchenko [Fri, 25 Feb 2022 17:23:45 +0000 (19:23 +0200)]
spi: pxa2xx-pci: Move max_clk_rate assignment to ->setup()
Move max_clk_rate to the corresponding ->setup() function to unify
with the rest.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20220225172350.69797-6-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Andy Shevchenko [Fri, 25 Feb 2022 17:23:44 +0000 (19:23 +0200)]
spi: pxa2xx-pci: Move dma_burst_size assignment to ->setup()
Instead of using conditional, move dma_burst_size to the corresponding
->setup() function.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20220225172350.69797-5-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Andy Shevchenko [Fri, 25 Feb 2022 17:23:43 +0000 (19:23 +0200)]
spi: pxa2xx-pci: Move port_id assignment to ->setup()
Instead of using conditional, move port_id to the corresponding
->setup() functions.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20220225172350.69797-4-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Andy Shevchenko [Fri, 25 Feb 2022 17:23:42 +0000 (19:23 +0200)]
spi: pxa2xx-pci: Drop redundant NULL check in ->probe()
Since all platforms are using ->setup() function, drop unneeded check.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20220225172350.69797-3-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Andy Shevchenko [Fri, 25 Feb 2022 17:23:41 +0000 (19:23 +0200)]
spi: pxa2xx-pci: Refactor Quark X1000 to use ->setup()
Refactor Quark X1000 handling code to use ->setup() instead of using
the configuration data structure directly.
It will allow to refactor further to avoid intermediate storage for
the used configuration parameters.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20220225172350.69797-2-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Andy Shevchenko [Fri, 25 Feb 2022 17:23:40 +0000 (19:23 +0200)]
spi: pxa2xx-pci: Refactor CE4100 to use ->setup()
Refactor CE4100 handling code to use ->setup() instead of spreading
potentially confusing conditional.
Besides that, it will allow to refactor further to avoid intermediate
storage for the used configuration parameters.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20220225172350.69797-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Li-hao Kuo [Fri, 25 Feb 2022 06:31:53 +0000 (14:31 +0800)]
spi: dt-bindings: remove unused required property
fix issue
/builds/robherring/linux-dt/Documentation/devicetree/bindings/spi/spi-sunplus-sp7021.example.dt.yaml:
spi@
9C002D80: 'clocks-names' is a required property
From schema: /builds/robherring/linux-dt/Documentation/devicetree/bindings/spi/spi-sunplus-sp7021.yaml
delete unused required(clock-name)
Fixes:
3b8ab4da34 ("spi: Fix test error for sp7021")
Reported-by: Rob Herring <robh+dt@kernel.org>
Signed-off-by: Li-hao Kuo <lhjeff911@gmail.com>
Link: https://lore.kernel.org/r/097bbc8b703b17e8fb3e3f6f6d2f97fe668bd5c5.1645770648.git.lhjeff911@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Mark Brown [Thu, 24 Feb 2022 22:55:45 +0000 (22:55 +0000)]
Tegra QUAD SPI ACPI & device support
Merge series from Krishna Yarlagadda <kyarlagadda@nvidia.com>:
Add ACPI support for Tegra210 QUAD SPI driver and a new compatilbe.
Krishna Yarlagadda [Tue, 22 Feb 2022 17:56:09 +0000 (23:26 +0530)]
spi: tegra210-quad: add new chips to compatible
Add support for Tegra234 and soc data to select capabilities.
Signed-off-by: Krishna Yarlagadda <kyarlagadda@nvidia.com>
Link: https://lore.kernel.org/r/20220222175611.58051-4-kyarlagadda@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Krishna Yarlagadda [Tue, 22 Feb 2022 17:56:08 +0000 (23:26 +0530)]
spi: Add Tegra234 QUAD SPI compatible
Add compatible string for Tegra234 for Tegra QUAD SPI
Signed-off-by: Krishna Yarlagadda <kyarlagadda@nvidia.com>
Link: https://lore.kernel.org/r/20220222175611.58051-3-kyarlagadda@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Krishna Yarlagadda [Tue, 22 Feb 2022 17:56:07 +0000 (23:26 +0530)]
spi: tegra210-quad: use device_reset method
Use device_reset api to replace duplicate code in driver to call
reset_control_get api with reset handle.
Signed-off-by: Krishna Yarlagadda <kyarlagadda@nvidia.com>
Link: https://lore.kernel.org/r/20220222175611.58051-2-kyarlagadda@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Andy Shevchenko [Wed, 23 Feb 2022 19:16:37 +0000 (21:16 +0200)]
spi: pxa2xx-pci: Balance reference count for PCI DMA device
The pci_get_slot() increases its reference count, the caller
must decrement the reference count by calling pci_dev_put().
Fixes:
743485ea3bee ("spi: pxa2xx-pci: Do a specific setup in a separate function")
Fixes:
25014521603f ("spi: pxa2xx-pci: Enable DMA for Intel Merrifield")
Reported-by: Wang Qing <wangqing@vivo.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20220223191637.31147-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Andy Shevchenko [Wed, 23 Feb 2022 19:19:48 +0000 (21:19 +0200)]
spi: pxa2xx-pci: Do not dereference fwnode in struct device
In order to make the underneath API easier to change in the future,
prevent users from dereferencing fwnode from struct device.
Instead, use the specific dev_fwnode() API for that.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20220223191948.31325-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Wang Qing [Tue, 15 Feb 2022 02:00:07 +0000 (18:00 -0800)]
spi: add missing pci_dev_put() before return
pci_get_slot() increases its reference count, the caller must
decrement the reference count by calling pci_dev_put()
Signed-off-by: Wang Qing <wangqing@vivo.com>
Link: https://lore.kernel.org/r/1644890407-65167-1-git-send-email-wangqing@vivo.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Andreas Färber [Sat, 19 Feb 2022 13:15:48 +0000 (14:15 +0100)]
spi: gpio: Implement LSB First bitbang support
Add support for slave DT property spi-lsb-first, i.e., SPI_LSB_FIRST mode.
Duplicate the inline helpers bitbang_txrx_be_cpha{0,1} as LE versions.
Conditionally call them from all the spi-gpio txrx_word callbacks.
Some alternatives to this implementation approach were discussed back
then [0], but eventually it was considered reasonable.
[0] https://lore.kernel.org/linux-arm-kernel/
20191212033952.5967-8-afaerber@suse.de/
Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Tested-by: Christian Hewitt <christianshewitt@gmail.com>
Link: https://lore.kernel.org/r/feac3377-4ad1-77d8-9a18-3588d80fb909@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Ahmad Fatoum [Tue, 1 Feb 2022 11:51:41 +0000 (12:51 +0100)]
spi: stm32: ignore Rx queue not empty in stm32f4 Tx only mode
STM32F4_SPI_SR_RXNE and STM32F4_SPI_SR_OVR are distinct bits in the same
status register. ~STM32F4_SPI_SR_OVR | STM32F4_SPI_SR_RXNE is thus
equal to ~STM32F4_SPI_SR_OVR.
The original intention was likely for transmission-only transfers to
ignore interrupts both for when the Rx queue has bytes (RXNE) as well
as when these bytes haven't been read in time (OVR).
Fix the typo by adding the missing parenthesis.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.kernel.org/r/20220201115142.3999860-1-a.fatoum@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
Mark Brown [Mon, 21 Feb 2022 15:22:33 +0000 (15:22 +0000)]
spi: Stacked/parallel memories bindings
Merge series from Miquel Raynal <miquel.raynal@bootlin.com>:
DT bindings for stacked and parallel flash/memory devices.
base-commit:
e783362eb54cd99b2cac8b3a9aeac942e6f6ac07
Minghao Chi (CGEL ZTE) [Mon, 21 Feb 2022 02:02:33 +0000 (02:02 +0000)]
spi: Use of_device_get_match_data()
Use of_device_get_match_data() to simplify the code.
Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Minghao Chi (CGEL ZTE) <chi.minghao@zte.com.cn>
Link: https://lore.kernel.org/r/20220221020233.1925154-1-chi.minghao@zte.com.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
Miquel Raynal [Wed, 26 Jan 2022 11:26:07 +0000 (12:26 +0100)]
spi: dt-bindings: Add an example with two stacked flashes
Provide an example of how to describe two flashes in eg. stacked mode.
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20220126112608.955728-4-miquel.raynal@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Miquel Raynal [Wed, 26 Jan 2022 11:26:06 +0000 (12:26 +0100)]
spi: dt-bindings: Describe stacked/parallel memories modes
Describe two new memories modes:
- A stacked mode when the bus is common but the address space extended
with an additinals wires.
- A parallel mode with parallel busses accessing parallel flashes where
the data is spread.
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Acked-by: Pratyush Yadav <p.yadav@ti.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20220126112608.955728-3-miquel.raynal@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Miquel Raynal [Wed, 26 Jan 2022 11:26:05 +0000 (12:26 +0100)]
dt-bindings: mtd: spi-nor: Allow two CS per device
The Xilinx QSPI controller has two advanced modes which allow the
controller to behave differently and consider two flashes as one single
storage.
One of these two modes is quite complex to support from a binding point
of view and is the dual parallel memories. In this mode, each byte of
data is stored in both devices: the even bits in one, the odd bits in
the other. The split is automatically handled by the QSPI controller and
is transparent for the user.
The other mode is simpler to support, it is called dual stacked
memories. The controller shares the same SPI bus but each of the devices
contain half of the data. Once in this mode, the controller does not
follow CS requests but instead internally wires the two CS levels with
the value of the most significant address bit.
Supporting these two modes will involve core changes which include the
possibility of providing two CS for a single SPI device
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Acked-by: Rob Herring <robh@kernel.org>
Reviewed-by: Pratyush Yadav <p.yadav@ti.com>
Link: https://lore.kernel.org/r/20220126112608.955728-2-miquel.raynal@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Heiner Kallweit [Fri, 18 Feb 2022 13:58:35 +0000 (14:58 +0100)]
spi: use sysfs_emit() for printing statistics and add trailing newline
Use dedicated function sysfs_emit() that does some extra checking,
e.g. to ensure that no more than PAGESIZE bytes are written.
In addition add a trailing newline to the output, that makes it
better readable from the console.
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Link: https://lore.kernel.org/r/56e1588d-d53b-73e9-fdc8-7fe30bf91f11@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Yang Li [Thu, 17 Feb 2022 01:00:24 +0000 (09:00 +0800)]
spi: clean up some inconsistent indenting
Eliminate the follow smatch warning:
drivers/spi/spi-sunplus-sp7021.c:379 sp7021_spi_slave_transfer_one()
warn: inconsistent indenting
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
Link: https://lore.kernel.org/r/20220217010024.111904-1-yang.lee@linux.alibaba.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Mark Brown [Thu, 17 Feb 2022 18:30:55 +0000 (18:30 +0000)]
spi: New support and problem adjustment of SPI rockchip
Merge series from Jon Lin <jon.lin@rock-chips.com>:
A collection of fixes and support for new features in the Rockchip
driver.
base-commit:
80808768e41324d2e23de89972b5406c1020e6e4
Jon Lin [Wed, 16 Feb 2022 01:40:28 +0000 (09:40 +0800)]
spi: rockchip: clear interrupt status in error handler
The interrupt status bit of the previous error data transmition will
affect the next operation and cause continuous SPI transmission failure.
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
Link: https://lore.kernel.org/r/20220216014028.8123-7-jon.lin@rock-chips.com
Signed-off-by: Mark Brown <broonie@kernel.org>
shengfei Xu [Wed, 16 Feb 2022 01:40:27 +0000 (09:40 +0800)]
spi: rockchip: Suspend and resume the bus during NOIRQ_SYSTEM_SLEEP_PM ops
the wakeup interrupt handler which is guaranteed not to run while
@resume noirq() is being executed. the patch can help to avoid the
wakeup source try to access spi when the spi is in suspend mode.
Signed-off-by: shengfei Xu <xsf@rock-chips.com>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
Link: https://lore.kernel.org/r/20220216014028.8123-6-jon.lin@rock-chips.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Jon Lin [Wed, 16 Feb 2022 01:40:26 +0000 (09:40 +0800)]
spi: rockchip: Preset cs-high and clk polarity in setup progress
After power up, the cs and clock is in default status, and the cs-high
and clock polarity dts property configuration will take no effect until
the calling of rockchip_spi_config in the first transmission.
So preset them to make sure a correct voltage before the first
transmission coming.
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
Link: https://lore.kernel.org/r/20220216014028.8123-5-jon.lin@rock-chips.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Jon Lin [Wed, 16 Feb 2022 01:40:25 +0000 (09:40 +0800)]
spi: rockchip: Stop spi slave dma receiver when cs inactive
The spi which's version is higher than ver 2 will automatically
enable this feature.
If the length of master transmission is uncertain, the RK spi slave
is better to automatically stop after cs inactive instead of waiting
for xfer_completion forever.
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
Link: https://lore.kernel.org/r/20220216014028.8123-4-jon.lin@rock-chips.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Jon Lin [Wed, 16 Feb 2022 01:40:24 +0000 (09:40 +0800)]
spi: rockchip: terminate dma transmission when slave abort
After slave abort, all DMA should be stopped, or it will affect the
next transmission and maybe abort again.
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
Link: https://lore.kernel.org/r/20220216014028.8123-3-jon.lin@rock-chips.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Jon Lin [Wed, 16 Feb 2022 01:40:23 +0000 (09:40 +0800)]
spi: rockchip: Fix error in getting num-cs property
Get num-cs u32 from dts of_node property rather than u16.
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
Link: https://lore.kernel.org/r/20220216014028.8123-2-jon.lin@rock-chips.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Jarkko Nikula [Wed, 16 Feb 2022 09:13:17 +0000 (11:13 +0200)]
spi: pxa2xx: Add support for Intel Raptor Lake PCH-S
Add support for LPSS SPI on Intel Raptor Lake PCH-S. It has four
controllers each having two chip selects.
Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Link: https://lore.kernel.org/r/20220216091317.1302254-1-jarkko.nikula@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
André Almeida [Wed, 16 Feb 2022 16:27:19 +0000 (13:27 -0300)]
spi: amd: Fix building without ACPI enabled
Commit
209043554915 ("spi: amd: Add support for version AMDI0062")
removed the cast ACPI_PTR() for no good reason. This wrapper is
important to make sure that the driver can be compiled with or without
CONFIG_ACPI enabled, useful for compiling test. Give back the cast so
compilation works again.
Fixes:
209043554915 ("spi: amd: Add support for version AMDI0062")
Signed-off-by: André Almeida <andrealmeid@collabora.com>
Link: https://lore.kernel.org/r/20220216162719.116062-1-andrealmeid@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Andy Shevchenko [Tue, 15 Feb 2022 13:51:39 +0000 (15:51 +0200)]
spi: intel-pci: Add support for Intel Ice Lake-N SPI serial flash
Intel Ice Lake-N has the same SPI serial flash controller as Ice Lake-LP.
Add Ice Lake-N PCI ID to the driver list of supported devices.
The device can be found on MacBookPro16,2 [1].
[1]: https://linux-hardware.org/?probe=
f1c5cf0c43
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Link: https://lore.kernel.org/r/20220215135139.4328-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Mark Brown [Tue, 15 Feb 2022 12:53:32 +0000 (12:53 +0000)]
spi: amd: Add support for new controller version
Merge series from André Almeida <andrealmeid@collabora.com>:
This series do some cleanup and add support for new controller version,
AMDI0062.
Mark Brown [Tue, 15 Feb 2022 12:53:31 +0000 (12:53 +0000)]
mtd: spi-nor / spi / MFD: Convert intel-spi to SPI MEM
Merge series from Mika Westerberg <mika.westerberg@linux.intel.com>:
Based on discussion on the patch I sent some time ago here:
http://lists.infradead.org/pipermail/linux-mtd/2021-June/086867.html
it turns out that the preferred way to deal with the SPI flash controller
drivers is through SPI MEM which is part of Linux SPI subsystem.
This series does that for the intel-spi driver. This also renames the
driver to follow the convention used in the SPI subsystem. The first patch
improves the write protection handling to be slightly more safer. The
following two patches do the conversion itself. Note the Intel SPI flash
controller only allows commands such as read, write and so on and it
internally uses whatever addressing etc. it figured from the SFDP on the
flash device.
base-commit:
e783362eb54cd99b2cac8b3a9aeac942e6f6ac07
Linus Walleij [Thu, 10 Feb 2022 23:19:54 +0000 (00:19 +0100)]
spi: Retire legacy GPIO handling
All drivers using GPIOs as chip select have been rewritten to use
GPIO descriptors passing the ->use_gpio_descriptors flag. Retire
the code and fields used by the legacy GPIO API.
Do not drop the ->use_gpio_descriptors flag: it now only indicates
that we want to use GPIOs in addition to native chip selects.
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20220210231954.807904-1-linus.walleij@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Li-hao Kuo [Mon, 14 Feb 2022 02:20:11 +0000 (10:20 +0800)]
spi: Fix warning for Clang build and simplify code
Clang build fails with
spi-sunplus-sp7021.c:405:2: error: variable 'ret' is used
uninitialized whenever switch default is taken
default:
simplify code
Restore initializing ret. and add return error at default
Fixes:
47e8fe57a66f ("spi: Modify irq request position and modify parameters")
Reported-by: Tom Rix <trix@redhat.com>
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Nathan Chancellor <nathan@kernel.org>
Reported-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Li-hao Kuo <lhjeff911@gmail.com>
Link: https://lore.kernel.org/r/7d91e6ce29f9a8df2c53a47b4b977664020e237a.1644805060.git.lhjeff911@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Mika Westerberg [Wed, 9 Feb 2022 12:27:06 +0000 (15:27 +0300)]
Documentation / MTD: Rename the intel-spi driver
Since the driver is renamed (and moved) update the BIOS upgrade guide
accordingly from intel-spi to spi-intel. Keep the guide under MTD
documentation because this is pretty much still about MTD and SPI-NOR.
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Mauro Lima <mauro.lima@eclypsium.com>
Reviewed-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Link: https://lore.kernel.org/r/20220209122706.42439-4-mika.westerberg@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Mika Westerberg [Wed, 9 Feb 2022 12:27:05 +0000 (15:27 +0300)]
mtd: spi-nor: intel-spi: Convert to SPI MEM
The preferred way to implement SPI-NOR controller drivers is through SPI
subsubsystem utilizing the SPI MEM core functions. This converts the
Intel SPI flash controller driver over the SPI MEM by moving the driver
from SPI-NOR subsystem to SPI subsystem and in one go make it use the
SPI MEM functions. The driver name will be changed from intel-spi to
spi-intel to match the convention used in the SPI subsystem.
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Mauro Lima <mauro.lima@eclypsium.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Lee Jones <lee.jones@linaro.org>
Acked-by: Pratyush Yadav <p.yadav@ti.com>
Reviewed-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Link: https://lore.kernel.org/r/20220209122706.42439-3-mika.westerberg@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Mika Westerberg [Wed, 9 Feb 2022 12:27:04 +0000 (15:27 +0300)]
mtd: spi-nor: intel-spi: Disable write protection only if asked
Currently the driver tries to disable the BIOS write protection
automatically even if this is not what the user wants. For this reason
modify the driver so that by default it does not touch the write
protection. Only if specifically asked by the user (setting writeable=1
command line parameter) the driver tries to disable the BIOS write
protection.
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Mauro Lima <mauro.lima@eclypsium.com>
Reviewed-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Acked-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20220209122706.42439-2-mika.westerberg@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
André Almeida [Fri, 11 Feb 2022 14:31:55 +0000 (11:31 -0300)]
spi: amd: Add support for version AMDI0062
Add support for the AMD SPI controller version AMDI0062. Do this in a
modular way where's easy to add new versions.
Signed-off-by: André Almeida <andrealmeid@collabora.com>
Link: https://lore.kernel.org/r/20220211143155.75513-4-andrealmeid@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
André Almeida [Fri, 11 Feb 2022 14:31:54 +0000 (11:31 -0300)]
spi: amd: Remove needless rom_addr variable
rom_addr is not used in the code, so we can just drop it from struct
amd_spi.
Signed-off-by: André Almeida <andrealmeid@collabora.com>
Link: https://lore.kernel.org/r/20220211143155.75513-3-andrealmeid@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
André Almeida [Fri, 11 Feb 2022 14:31:53 +0000 (11:31 -0300)]
spi: amd: Use iopoll for busy waiting
Instead of implementing a custom IO busy wait function, just use
readl_poll_timeout().
Signed-off-by: André Almeida <andrealmeid@collabora.com>
Link: https://lore.kernel.org/r/20220211143155.75513-2-andrealmeid@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Mark Brown [Wed, 9 Feb 2022 14:32:59 +0000 (14:32 +0000)]
spi: make remove callback a void function
Merge series from Uwe Kleine-König <u.kleine-koenig@pengutronix.de>:
this series goal is to change the spi remove callback's return value to void.
After numerous patches nearly all drivers already return 0 unconditionally.
The four first patches in this series convert the remaining three drivers to
return 0, the final patch changes the remove prototype and converts all
implementers.
base-commit:
26291c54e111ff6ba87a164d85d4a4e134b7315c
Uwe Kleine-König [Sun, 23 Jan 2022 17:52:01 +0000 (18:52 +0100)]
spi: make remove callback a void function
The value returned by an spi driver's remove function is mostly ignored.
(Only an error message is printed if the value is non-zero that the
error is ignored.)
So change the prototype of the remove function to return no value. This
way driver authors are not tempted to assume that passing an error to
the upper layer is a good idea. All drivers are adapted accordingly.
There is no intended change of behaviour, all callbacks were prepared to
return 0 before.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Marc Kleine-Budde <mkl@pengutronix.de>
Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Acked-by: Miquel Raynal <miquel.raynal@bootlin.com>
Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Acked-by: Claudius Heine <ch@denx.de>
Acked-by: Stefan Schmidt <stefan@datenfreihafen.org>
Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Acked-by: Ulf Hansson <ulf.hansson@linaro.org> # For MMC
Acked-by: Marcus Folkesson <marcus.folkesson@gmail.com>
Acked-by: Łukasz Stelmach <l.stelmach@samsung.com>
Acked-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20220123175201.34839-6-u.kleine-koenig@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
Uwe Kleine-König [Sun, 23 Jan 2022 17:52:00 +0000 (18:52 +0100)]
platform/chrome: cros_ec: Make cros_ec_unregister() return void
Up to now cros_ec_unregister() returns zero unconditionally. Make it
return void instead which makes it easier to see in the callers that
there is no error to handle.
Also the return value of i2c, platform and spi remove callbacks is
ignored anyway.
Reviewed-by: Guenter Roeck <groeck@chromium.org>
Link: https://lore.kernel.org/r/20211020071753.wltjslmimb6wtlp5@pengutronix.de
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20220123175201.34839-5-u.kleine-koenig@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
Uwe Kleine-König [Sun, 23 Jan 2022 17:51:59 +0000 (18:51 +0100)]
tpm: st33zp24: Make st33zp24_remove() a void function
Up to now st33zp24_remove() returns zero unconditionally. Make it return
no value instead which makes it easier to see in the callers that there is
no error to handle.
Also the return value of i2c and spi remove callbacks is ignored anyway.
Link: https://lore.kernel.org/r/20220104231103.227924-1-u.kleine-koenig@pengutronix.de
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20220123175201.34839-4-u.kleine-koenig@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
Uwe Kleine-König [Sun, 23 Jan 2022 17:51:58 +0000 (18:51 +0100)]
staging: fbtft: Deduplicate driver registration macros
The two macros FBTFT_REGISTER_DRIVER and FBTFT_REGISTER_SPI_DRIVER
contain quite some duplication: Both define an spi driver and an of device
table and the differences are quite subtle.
So create two new macros and use both twice.
Link: https://lore.kernel.org/r/20220118181338.207943-2-u.kleine-koenig@pengutronix.de
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20220123175201.34839-3-u.kleine-koenig@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
Uwe Kleine-König [Sun, 23 Jan 2022 17:51:57 +0000 (18:51 +0100)]
staging: fbtft: Fix error path in fbtft_driver_module_init()
If registering the platform driver fails, the function must not return
without undoing the spi driver registration first.
Fixes:
c296d5f9957c ("staging: fbtft: core support")
Link: https://lore.kernel.org/r/20220118181338.207943-1-u.kleine-koenig@pengutronix.de
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20220123175201.34839-2-u.kleine-koenig@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
Mark Brown [Tue, 8 Feb 2022 18:58:12 +0000 (18:58 +0000)]
spi: Add compatible for Mediatek MT8186
Merge series from Leilk Liu <leilk.liu@mediatek.com>:
This is more YAML conversion than new compatible.
Miaoqian Lin [Fri, 28 Jan 2022 16:59:56 +0000 (16:59 +0000)]
spi: tegra210-quad: Fix missin IRQ check in tegra_qspi_probe
This func misses checking for platform_get_irq()'s call and may passes the
negative error codes to request_threaded_irq(), which takes unsigned IRQ #,
causing it to fail with -EINVAL, overriding an original error code.
Stop calling request_threaded_irq() with invalid IRQ #s.
Fixes:
921fc1838fb0 ("spi: tegra210-quad: Add support for Tegra210 QSPI controller")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Link: https://lore.kernel.org/r/20220128165956.27821-1-linmq006@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Li-hao Kuo [Mon, 7 Feb 2022 01:46:34 +0000 (09:46 +0800)]
spi: Fix test error for sp7021.
Remove the include path and modify parameters for fix error for bt binding test
Fixes:
a708078eeb99 ("spi: Add Sunplus SP7021 schema")
Signed-off-by: Li-hao Kuo <lhjeff911@gmail.com>
Link: https://lore.kernel.org/r/b8a94fbfcab68b1279b09b6297099310c209927b.1644198244.git.lhjeff911@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Miaoqian Lin [Fri, 28 Jan 2022 16:52:38 +0000 (16:52 +0000)]
spi: tegra114: Add missing IRQ check in tegra_spi_probe
This func misses checking for platform_get_irq()'s call and may passes the
negative error codes to request_threaded_irq(), which takes unsigned IRQ #,
causing it to fail with -EINVAL, overriding an original error code.
Stop calling request_threaded_irq() with invalid IRQ #s.
Fixes:
f333a331adfa ("spi/tegra114: add spi driver")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Link: https://lore.kernel.org/r/20220128165238.25615-1-linmq006@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Luiz Angelo Daros de Luca [Sat, 29 Jan 2022 04:04:53 +0000 (01:04 -0300)]
spi: ath79: add mem_ops for fast-read
Reading from memory is 3x faster than bit-bang read operation. Also,
for tl-wr2543nd, the bit-bang read was sporadically returning random
data, possibly a HW defect, while fast-read works as expected.
Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
Link: https://lore.kernel.org/r/20220129040453.8476-1-luizluca@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Li-hao Kuo [Mon, 7 Feb 2022 01:57:22 +0000 (09:57 +0800)]
spi: Modify irq request position and modify parameters
- Change irq request position to the back.
- Add temporary varilable and setting (as suggested by Mr. Andy Shevchenko)
Fixes:
f62ca4e2a863 ("spi: Add spi driver for Sunplus SP7021")
Signed-off-by: Li-hao Kuo <lhjeff911@gmail.com>
Link: https://lore.kernel.org/r/a94e3b123773fe303221d2bd2e4ce36ffa905a1c.1644198957.git.lhjeff911@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Dan Carpenter [Tue, 25 Jan 2022 06:52:02 +0000 (09:52 +0300)]
spi: spidev: prevent spidev->speed_hz from being zero
A zero value for spi->max_speed_hz or spidev->speed_hz does not make
sense and trying to set that can lead to divide by zero crashes in
a some of the drivers.
drivers/spi/spi-s3c64xx.c:874 s3c64xx_spi_setup() error: potential divide by zero bug '/ spi->max_speed_hz'.
drivers/spi/spi-fsl-dspi.c:613 hz_to_spi_baud() error: potential divide by zero bug '/ speed_hz'.
drivers/spi/spi-xlp.c:146 xlp_spi_setup() error: potential divide by zero bug '/ (spi->max_speed_hz)'.
drivers/spi/spi-orion.c:162 orion_spi_baudrate_set() error: potential divide by zero bug '/ speed'.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20220125065202.GA8807@kili
Signed-off-by: Mark Brown <broonie@kernel.org>