[U-Boot] [PATCH v3 4/5] gpio: sandbox: Rename GPIOF_(OUTPUT|HIGH|ODR) to SANDBOX_GPIO_(OUTPUT|HIGH|ODR)

Patrice Chotard patrice.chotard at st.com
Mon Sep 10 16:11:09 UTC 2018


To avoid confusion with enum gpio_func_t GPIOF_OUTPUT defined in
asm-generic/gpio.h, rename all sandbox flags GPIOF_(OUTPUT|HIGH|ODR)
to SANDBOX_GPIO_(OUTPUT|HIGH|ODR)

Signed-off-by: Patrice Chotard <patrice.chotard at st.com>
Reviewed-by: Simon Glass <sjg at chromium.org>
---

Changes in v3:
    - Rename SDBX_GPIO_(OUTPUT|HIGH|ODR) to SANDBOX_GPIO_(OUTPUT|HIGH|ODR)

Changes in v2: None

 drivers/gpio/sandbox.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/gpio/sandbox.c b/drivers/gpio/sandbox.c
index 2ef5c67ad593..e7bed17d0db0 100644
--- a/drivers/gpio/sandbox.c
+++ b/drivers/gpio/sandbox.c
@@ -12,9 +12,9 @@
 #include <dt-bindings/gpio/gpio.h>
 
 /* Flags for each GPIO */
-#define GPIOF_OUTPUT	(1 << 0)	/* Currently set as an output */
-#define GPIOF_HIGH	(1 << 1)	/* Currently set high */
-#define GPIOF_ODR	(1 << 2)	/* Currently set to open drain mode */
+#define SANDBOX_GPIO_OUTPUT	BIT(0)	/* Currently set as an output */
+#define SANDBOX_GPIO_HIGH	BIT(1)	/* Currently set high */
+#define SANDBOX_GPIO_ODR	BIT(2)	/* Currently set to open drain mode */
 
 struct gpio_state {
 	const char *label;	/* label given by requester */
@@ -60,34 +60,34 @@ static int set_gpio_flag(struct udevice *dev, unsigned offset, int flag,
 
 int sandbox_gpio_get_value(struct udevice *dev, unsigned offset)
 {
-	if (get_gpio_flag(dev, offset, GPIOF_OUTPUT))
+	if (get_gpio_flag(dev, offset, SANDBOX_GPIO_OUTPUT))
 		debug("sandbox_gpio: get_value on output gpio %u\n", offset);
-	return get_gpio_flag(dev, offset, GPIOF_HIGH);
+	return get_gpio_flag(dev, offset, SANDBOX_GPIO_HIGH);
 }
 
 int sandbox_gpio_set_value(struct udevice *dev, unsigned offset, int value)
 {
-	return set_gpio_flag(dev, offset, GPIOF_HIGH, value);
+	return set_gpio_flag(dev, offset, SANDBOX_GPIO_HIGH, value);
 }
 
 int sandbox_gpio_get_open_drain(struct udevice *dev, unsigned offset)
 {
-	return get_gpio_flag(dev, offset, GPIOF_ODR);
+	return get_gpio_flag(dev, offset, SANDBOX_GPIO_ODR);
 }
 
 int sandbox_gpio_set_open_drain(struct udevice *dev, unsigned offset, int value)
 {
-	return set_gpio_flag(dev, offset, GPIOF_ODR, value);
+	return set_gpio_flag(dev, offset, SANDBOX_GPIO_ODR, value);
 }
 
 int sandbox_gpio_get_direction(struct udevice *dev, unsigned offset)
 {
-	return get_gpio_flag(dev, offset, GPIOF_OUTPUT);
+	return get_gpio_flag(dev, offset, SANDBOX_GPIO_OUTPUT);
 }
 
 int sandbox_gpio_set_direction(struct udevice *dev, unsigned offset, int output)
 {
-	return set_gpio_flag(dev, offset, GPIOF_OUTPUT, output);
+	return set_gpio_flag(dev, offset, SANDBOX_GPIO_OUTPUT, output);
 }
 
 /*
@@ -158,7 +158,7 @@ static int sb_gpio_set_open_drain(struct udevice *dev, unsigned offset, int valu
 
 static int sb_gpio_get_function(struct udevice *dev, unsigned offset)
 {
-	if (get_gpio_flag(dev, offset, GPIOF_OUTPUT))
+	if (get_gpio_flag(dev, offset, SDBX_GPIO_OUTPUT))
 		return GPIOF_OUTPUT;
 	return GPIOF_INPUT;
 }
-- 
1.9.1



More information about the U-Boot mailing list