openwrt-cghmn-mt300n/target/linux/bcm27xx/patches-6.6/950-1546-spi-rp2040-gpio-bridge-probe-Cfg-fast_xfer-clk.patch
Álvaro Fernández Rojas 251f76c1c6 bcm27xx: pull 6.6 patches from RPi repo
Adds latest 6.6 patches from the Raspberry Pi repository.

These patches were generated from:
https://github.com/raspberrypi/linux/commits/rpi-6.6.y/
With the following command:
git format-patch -N v6.6.83..HEAD
(HEAD -> 08d4e8f52256bd422d8a1f876411603f627d0a82)

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2025-03-16 08:04:48 +01:00

38 lines
1.4 KiB
Diff

From 2e071057fded90e789c0101498e45a1778be93fe Mon Sep 17 00:00:00 2001
From: Richard Oliver <richard.oliver@raspberrypi.com>
Date: Tue, 25 Feb 2025 15:27:59 +0000
Subject: [PATCH] spi: rp2040-gpio-bridge: probe: Cfg fast_xfer clk
Fast transfer mode requires that the first bit of data is clocked with a
rising edge. This can cause extra bits of data to be clocked on hardware
where the clock signal uses a pull-up. This change ensures that clk is
driven low before fast data transfer mode is entered.
Signed-off-by: Richard Oliver <richard.oliver@raspberrypi.com>
---
drivers/spi/spi-rp2040-gpio-bridge.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
--- a/drivers/spi/spi-rp2040-gpio-bridge.c
+++ b/drivers/spi/spi-rp2040-gpio-bridge.c
@@ -617,7 +617,6 @@ static int rp2040_gbdg_fast_xfer(struct
&clock_mux);
gpiod_direction_output(priv_data->fast_xfer_gpios->desc[0], 1);
- gpiod_direction_output(priv_data->fast_xfer_gpios->desc[1], 0);
rp2040_gbdg_rp1_calc_offsets(priv_data->fast_xfer_data_index,
&data_bank, &data_offset);
@@ -989,6 +988,11 @@ static void rp2040_gbdg_parse_dt(struct
goto node_put;
}
+ /*
+ * fast_xfer mode requires first data bit to be clocked on a rising
+ * edge. Configure as output-low here before fast_xfer mode is entered.
+ */
+ gpiod_direction_output(rp2040_gbdg->fast_xfer_gpios->desc[1], 0);
node_put:
if (of_args[0].np)
of_node_put(of_args[0].np);