From 672715d5c4d5da3b77ea8b0c31961052ee355c33 Mon Sep 17 00:00:00 2001 From: Richard Oliver 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 --- 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);