return _dm_gpio_free(desc.dev, desc.offset);
}
-static int check_reserved(struct gpio_desc *desc, const char *func)
+static int check_reserved(const struct gpio_desc *desc, const char *func)
{
struct gpio_dev_priv *uc_priv;
desc.offset, value);
}
-int dm_gpio_get_value(struct gpio_desc *desc)
+int dm_gpio_get_value(const struct gpio_desc *desc)
{
int value;
int ret;
return desc->flags & GPIOD_ACTIVE_LOW ? !value : value;
}
-int dm_gpio_set_value(struct gpio_desc *desc, int value)
+int dm_gpio_set_value(const struct gpio_desc *desc, int value)
{
int ret;
return vector;
}
-int dm_gpio_get_values_as_int(struct gpio_desc *desc_list, int count)
+int dm_gpio_get_values_as_int(const struct gpio_desc *desc_list, int count)
{
unsigned bitmask = 1;
unsigned vector = 0;
return 0;
}
-int gpio_get_number(struct gpio_desc *desc)
+int gpio_get_number(const struct gpio_desc *desc)
{
struct udevice *dev = desc->dev;
struct gpio_dev_priv *uc_priv;
* previously returned by gpio_request_by_name()
* @return true if valid, false if not
*/
-static inline bool dm_gpio_is_valid(struct gpio_desc *desc)
+static inline bool dm_gpio_is_valid(const struct gpio_desc *desc)
{
return desc->dev != NULL;
}
* @count: Number of GPIOs
* @return resulting integer value, or -ve on error
*/
-int dm_gpio_get_values_as_int(struct gpio_desc *desc_list, int count);
+int dm_gpio_get_values_as_int(const struct gpio_desc *desc_list, int count);
/**
* gpio_claim_vector() - claim a number of GPIOs for input
* previously returned by gpio_request_by_name()
* @return GPIO value (0 for inactive, 1 for active) or -ve on error
*/
-int dm_gpio_get_value(struct gpio_desc *desc);
+int dm_gpio_get_value(const struct gpio_desc *desc);
-int dm_gpio_set_value(struct gpio_desc *desc, int value);
+int dm_gpio_set_value(const struct gpio_desc *desc, int value);
/**
* dm_gpio_set_dir() - Set the direction for a GPIO
* previously returned by gpio_request_by_name()
* @return GPIO number, or -ve if not found
*/
-int gpio_get_number(struct gpio_desc *desc);
+int gpio_get_number(const struct gpio_desc *desc);
#endif /* _ASM_GENERIC_GPIO_H_ */