* [U-Boot] [PATCH 0/3] Series short description
@ 2016-06-14 6:26 Benjamin Tietz
2016-06-14 6:26 ` [U-Boot] [PATCH1/3] stm32: gpio: fix otype access Benjamin Tietz
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Benjamin Tietz @ 2016-06-14 6:26 UTC (permalink / raw)
To: u-boot
The following series fixes som issues in the STM32 gpio driver
---
Benjamin Tietz (3):
stm32: gpio: fix otype access
stm32: gpio_direction_output: make sure, output is set to push-pull
stm32: gpio_get_value: always return 0 or 1
drivers/gpio/stm32_gpio.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
--
best regards
Benjamin Tietz
^ permalink raw reply [flat|nested] 4+ messages in thread
* [U-Boot] [PATCH1/3] stm32: gpio: fix otype access
2016-06-14 6:26 [U-Boot] [PATCH 0/3] Series short description Benjamin Tietz
@ 2016-06-14 6:26 ` Benjamin Tietz
2016-06-14 6:27 ` [U-Boot] [PATCH2/3] stm32: gpio_direction_output: make sure, output is set to push-pull Benjamin Tietz
2016-06-14 6:27 ` [U-Boot] [PATCH3/3] stm32: gpio_get_value: always return 0 or 1 Benjamin Tietz
2 siblings, 0 replies; 4+ messages in thread
From: Benjamin Tietz @ 2016-06-14 6:26 UTC (permalink / raw)
To: u-boot
the GPIOx_OTYPER register has only one bit for every pin.
---
drivers/gpio/stm32_gpio.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
-------------- next part --------------
the GPIOx_OTYPER register has only one bit for every pin.
---
drivers/gpio/stm32_gpio.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpio/stm32_gpio.c b/drivers/gpio/stm32_gpio.c
index 50f86d3..2457211 100644
--- a/drivers/gpio/stm32_gpio.c
+++ b/drivers/gpio/stm32_gpio.c
@@ -66,7 +66,7 @@ int stm32_gpio_config(const struct stm32_gpio_dsc *dsc,
i = dsc->pin * 2;
clrsetbits_le32(&gpio_regs->moder, 0x3 << i, ctl->mode << i);
- clrsetbits_le32(&gpio_regs->otyper, 0x3 << i, ctl->otype << i);
+ clrsetbits_le32(&gpio_regs->otyper, 0x1 << dsc->pin, ctl->otype << dsc->pin);
clrsetbits_le32(&gpio_regs->ospeedr, 0x3 << i, ctl->speed << i);
clrsetbits_le32(&gpio_regs->pupdr, 0x3 << i, ctl->pupd << i);
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [U-Boot] [PATCH2/3] stm32: gpio_direction_output: make sure, output is set to push-pull
2016-06-14 6:26 [U-Boot] [PATCH 0/3] Series short description Benjamin Tietz
2016-06-14 6:26 ` [U-Boot] [PATCH1/3] stm32: gpio: fix otype access Benjamin Tietz
@ 2016-06-14 6:27 ` Benjamin Tietz
2016-06-14 6:27 ` [U-Boot] [PATCH3/3] stm32: gpio_get_value: always return 0 or 1 Benjamin Tietz
2 siblings, 0 replies; 4+ messages in thread
From: Benjamin Tietz @ 2016-06-14 6:27 UTC (permalink / raw)
To: u-boot
otherwise, the output type is uninitialized
---
drivers/gpio/stm32_gpio.c | 1 +
1 file changed, 1 insertion(+)
-------------- next part --------------
otherwise, the output type is uninitialized
---
drivers/gpio/stm32_gpio.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/gpio/stm32_gpio.c b/drivers/gpio/stm32_gpio.c
index 2457211..d092c8f 100644
--- a/drivers/gpio/stm32_gpio.c
+++ b/drivers/gpio/stm32_gpio.c
@@ -236,6 +236,7 @@ int gpio_direction_output(unsigned gpio, int value)
#if defined(CONFIG_STM32F4) || defined(CONFIG_STM32F7)
ctl.af = STM32_GPIO_AF0;
ctl.mode = STM32_GPIO_MODE_OUT;
+ ctl.otype = STM32_GPIO_OTYPE_PP;
ctl.pupd = STM32_GPIO_PUPD_NO;
ctl.speed = STM32_GPIO_SPEED_50M;
#elif defined(CONFIG_STM32F1)
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [U-Boot] [PATCH3/3] stm32: gpio_get_value: always return 0 or 1
2016-06-14 6:26 [U-Boot] [PATCH 0/3] Series short description Benjamin Tietz
2016-06-14 6:26 ` [U-Boot] [PATCH1/3] stm32: gpio: fix otype access Benjamin Tietz
2016-06-14 6:27 ` [U-Boot] [PATCH2/3] stm32: gpio_direction_output: make sure, output is set to push-pull Benjamin Tietz
@ 2016-06-14 6:27 ` Benjamin Tietz
2 siblings, 0 replies; 4+ messages in thread
From: Benjamin Tietz @ 2016-06-14 6:27 UTC (permalink / raw)
To: u-boot
Previously, a set gpio had returned any power of 2. Some function check for 1 explicitly.
---
drivers/gpio/stm32_gpio.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
-------------- next part --------------
Previously, a set gpio had returned any power of 2. Some function check for 1 explicitly.
---
drivers/gpio/stm32_gpio.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpio/stm32_gpio.c b/drivers/gpio/stm32_gpio.c
index d092c8f..516dfcc 100644
--- a/drivers/gpio/stm32_gpio.c
+++ b/drivers/gpio/stm32_gpio.c
@@ -263,7 +263,7 @@ int gpio_get_value(unsigned gpio)
dsc.port = stm32_gpio_to_port(gpio);
dsc.pin = stm32_gpio_to_pin(gpio);
- return stm32_gpin_get(&dsc);
+ return !!stm32_gpin_get(&dsc);
}
int gpio_set_value(unsigned gpio, int value)
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-06-14 6:27 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-14 6:26 [U-Boot] [PATCH 0/3] Series short description Benjamin Tietz
2016-06-14 6:26 ` [U-Boot] [PATCH1/3] stm32: gpio: fix otype access Benjamin Tietz
2016-06-14 6:27 ` [U-Boot] [PATCH2/3] stm32: gpio_direction_output: make sure, output is set to push-pull Benjamin Tietz
2016-06-14 6:27 ` [U-Boot] [PATCH3/3] stm32: gpio_get_value: always return 0 or 1 Benjamin Tietz
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.