From 71b25a12c3f64f6d3628aeb40dd20d814b1ca3dd Mon Sep 17 00:00:00 2001 From: Florian Vaussard Date: Thu, 20 Jul 2017 10:32:42 +0200 Subject: [PATCH] spim_nrf52: Prevent glitch on CS line in spim_nrf52_init() The output state of the CS GPIO must be configured with a pull-up while setting the GPIO as output. Otherwise the GPIO will be forced low, before being set high by the call to spim_nrf52_csn(). This results in a glitch of 1us on the CS line, which may confuse some ICs in the worst case. Signed-off-by: Florian Vaussard --- drivers/spi/spim_nrf52_legacy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/spi/spim_nrf52_legacy.c b/drivers/spi/spim_nrf52_legacy.c index 061dfcc9dfa..9fdfce3b76a 100644 --- a/drivers/spi/spim_nrf52_legacy.c +++ b/drivers/spi/spim_nrf52_legacy.c @@ -329,7 +329,7 @@ static int spim_nrf52_init(struct device *dev) if (config->psel.ss[i] != SS_UNUSED) { status = gpio_pin_configure(data->gpio_port, config->psel.ss[i], - GPIO_DIR_OUT); + GPIO_DIR_OUT | GPIO_PUD_PULL_UP); __ASSERT_NO_MSG(status == 0); spim_nrf52_csn(data->gpio_port, config->psel.ss[i],