Skip to content

Commit 3a42a8e

Browse files
roliver-rpipopcornmix
authored andcommitted
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 <[email protected]>
1 parent 0683c97 commit 3a42a8e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/spi/spi-rp2040-gpio-bridge.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,6 @@ static int rp2040_gbdg_fast_xfer(struct rp2040_gbdg *priv_data, const u8 *data,
617617
&clock_mux);
618618

619619
gpiod_direction_output(priv_data->fast_xfer_gpios->desc[0], 1);
620-
gpiod_direction_output(priv_data->fast_xfer_gpios->desc[1], 0);
621620

622621
rp2040_gbdg_rp1_calc_offsets(priv_data->fast_xfer_data_index,
623622
&data_bank, &data_offset);
@@ -989,6 +988,11 @@ static void rp2040_gbdg_parse_dt(struct rp2040_gbdg *rp2040_gbdg)
989988
goto node_put;
990989
}
991990

991+
/*
992+
* fast_xfer mode requires first data bit to be clocked on a rising
993+
* edge. Configure as output-low here before fast_xfer mode is entered.
994+
*/
995+
gpiod_direction_output(rp2040_gbdg->fast_xfer_gpios->desc[1], 0);
992996
node_put:
993997
if (of_args[0].np)
994998
of_node_put(of_args[0].np);

0 commit comments

Comments
 (0)