lede/target/linux/bcm27xx/patches-6.6/950-1546-spi-rp2040-gpio-bridge-probe-Cfg-fast_xfer-clk.patch
=?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= 975ce33610 bcm27xx: pull 6.6 patches from RPi
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/

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2025-04-29 23:01:01 +08: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);