mirror of
https://github.com/u-boot/u-boot.git
synced 2024-12-04 01:53:27 +08:00
powerpc/mpc85xx: Fix compiling error for common/cmd_gpio.c
To replicate: 1. add to include/configs/p1_p2_rdb_pc.h "#define CONFIG_CMD_GPIO" 2. run `make P1020RDB-PC_defconfig` 3. run CROSS_COMPILE=powerpc-linux- make and you will get: common/built-in.o: In function `do_gpio': u-boot/common/cmd_gpio.c:186: undefined reference to `gpio_request' u-boot/common/cmd_gpio.c:194: undefined reference to `gpio_direction_input' u-boot/common/cmd_gpio.c:195: undefined reference to `gpio_get_value' u-boot/common/cmd_gpio.c:200: undefined reference to `gpio_get_value' u-boot/common/cmd_gpio.c:203: undefined reference to `gpio_direction_output' u-boot/common/cmd_gpio.c:209: undefined reference to `gpio_free Signed-off-by: Michael Durrant <mdurrant@arcturusnetworks.com> Signed-off-by: Oleksandr G Zhadan <oleks@arcturusnetworks.com> Reviewed-by: York Sun <yorksun@freescale.com>
This commit is contained in:
parent
38289c6945
commit
d7732faad3
@ -12,4 +12,6 @@
|
|||||||
#ifndef __ASM_ARCH_MX85XX_GPIO_H
|
#ifndef __ASM_ARCH_MX85XX_GPIO_H
|
||||||
#define __ASM_ARCH_MX85XX_GPIO_H
|
#define __ASM_ARCH_MX85XX_GPIO_H
|
||||||
|
|
||||||
|
#include <asm/mpc85xx_gpio.h>
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -72,9 +72,10 @@ static inline int gpio_request(unsigned gpio, const char *label)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void gpio_free(unsigned gpio)
|
static inline int gpio_free(unsigned gpio)
|
||||||
{
|
{
|
||||||
/* Compatibility shim */
|
/* Compatibility shim */
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int gpio_direction_input(unsigned gpio)
|
static inline int gpio_direction_input(unsigned gpio)
|
||||||
@ -97,12 +98,13 @@ static inline int gpio_get_value(unsigned gpio)
|
|||||||
return !!mpc85xx_gpio_get(1U << gpio);
|
return !!mpc85xx_gpio_get(1U << gpio);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void gpio_set_value(unsigned gpio, int value)
|
static inline int gpio_set_value(unsigned gpio, int value)
|
||||||
{
|
{
|
||||||
if (value)
|
if (value)
|
||||||
mpc85xx_gpio_set_high(1U << gpio);
|
mpc85xx_gpio_set_high(1U << gpio);
|
||||||
else
|
else
|
||||||
mpc85xx_gpio_set_low(1U << gpio);
|
mpc85xx_gpio_set_low(1U << gpio);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int gpio_is_valid(int gpio)
|
static inline int gpio_is_valid(int gpio)
|
||||||
|
Loading…
Reference in New Issue
Block a user