mirror of
https://github.com/u-boot/u-boot.git
synced 2024-11-29 15:43:44 +08:00
gpio: Rename dm_gpio_get_dir_flags() to dm_gpio_get_flags()
This function can be used to get any flags, not just direction flags. Rename it to avoid confusion. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Pratyush Yadav <p.yadav@ti.com>
This commit is contained in:
parent
9648789e26
commit
c0c1e62c6e
@ -683,7 +683,7 @@ int dm_gpio_set_dir(struct gpio_desc *desc)
|
||||
return _dm_gpio_set_flags(desc, desc->flags);
|
||||
}
|
||||
|
||||
int dm_gpio_get_dir_flags(struct gpio_desc *desc, ulong *flagsp)
|
||||
int dm_gpio_get_flags(struct gpio_desc *desc, ulong *flagsp)
|
||||
{
|
||||
struct udevice *dev = desc->dev;
|
||||
int ret, value;
|
||||
|
@ -683,16 +683,16 @@ int dm_gpio_set_dir(struct gpio_desc *desc);
|
||||
int dm_gpio_set_dir_flags(struct gpio_desc *desc, ulong flags);
|
||||
|
||||
/**
|
||||
* dm_gpio_get_dir_flags() - Get direction flags
|
||||
* dm_gpio_get_flags() - Get flags
|
||||
*
|
||||
* read the current direction flags
|
||||
* Read the current flags
|
||||
*
|
||||
* @desc: GPIO description containing device, offset and flags,
|
||||
* previously returned by gpio_request_by_name()
|
||||
* @flags: place to put the used flags
|
||||
* @return 0 if OK, -ve on error, in which case desc->flags is not updated
|
||||
*/
|
||||
int dm_gpio_get_dir_flags(struct gpio_desc *desc, ulong *flags);
|
||||
int dm_gpio_get_flags(struct gpio_desc *desc, ulong *flags);
|
||||
|
||||
/**
|
||||
* gpio_get_number() - Get the global GPIO number of a GPIO
|
||||
|
@ -397,22 +397,22 @@ static int dm_test_gpio_get_dir_flags(struct unit_test_state *uts)
|
||||
ut_asserteq(6, gpio_request_list_by_name(dev, "test3-gpios", desc_list,
|
||||
ARRAY_SIZE(desc_list), 0));
|
||||
|
||||
ut_assertok(dm_gpio_get_dir_flags(&desc_list[0], &flags));
|
||||
ut_assertok(dm_gpio_get_flags(&desc_list[0], &flags));
|
||||
ut_asserteq(GPIOD_IS_OUT | GPIOD_OPEN_DRAIN, flags);
|
||||
|
||||
ut_assertok(dm_gpio_get_dir_flags(&desc_list[1], &flags));
|
||||
ut_assertok(dm_gpio_get_flags(&desc_list[1], &flags));
|
||||
ut_asserteq(GPIOD_IS_OUT | GPIOD_OPEN_SOURCE, flags);
|
||||
|
||||
ut_assertok(dm_gpio_get_dir_flags(&desc_list[2], &flags));
|
||||
ut_assertok(dm_gpio_get_flags(&desc_list[2], &flags));
|
||||
ut_asserteq(GPIOD_IS_OUT, flags);
|
||||
|
||||
ut_assertok(dm_gpio_get_dir_flags(&desc_list[3], &flags));
|
||||
ut_assertok(dm_gpio_get_flags(&desc_list[3], &flags));
|
||||
ut_asserteq(GPIOD_IS_IN | GPIOD_PULL_UP, flags);
|
||||
|
||||
ut_assertok(dm_gpio_get_dir_flags(&desc_list[4], &flags));
|
||||
ut_assertok(dm_gpio_get_flags(&desc_list[4], &flags));
|
||||
ut_asserteq(GPIOD_IS_IN | GPIOD_PULL_DOWN, flags);
|
||||
|
||||
ut_assertok(dm_gpio_get_dir_flags(&desc_list[5], &flags));
|
||||
ut_assertok(dm_gpio_get_flags(&desc_list[5], &flags));
|
||||
ut_asserteq(GPIOD_IS_IN, flags);
|
||||
|
||||
ut_assertok(gpio_free_list(dev, desc_list, 6));
|
||||
|
Loading…
Reference in New Issue
Block a user