|
@@ -222,7 +222,7 @@ static inline void gpiod_put(struct gpio_desc *desc)
|
|
|
might_sleep();
|
|
might_sleep();
|
|
|
|
|
|
|
|
/* GPIO can never have been requested */
|
|
/* GPIO can never have been requested */
|
|
|
- WARN_ON(1);
|
|
|
|
|
|
|
+ WARN_ON(desc);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
static inline void gpiod_put_array(struct gpio_descs *descs)
|
|
static inline void gpiod_put_array(struct gpio_descs *descs)
|
|
@@ -230,7 +230,7 @@ static inline void gpiod_put_array(struct gpio_descs *descs)
|
|
|
might_sleep();
|
|
might_sleep();
|
|
|
|
|
|
|
|
/* GPIO can never have been requested */
|
|
/* GPIO can never have been requested */
|
|
|
- WARN_ON(1);
|
|
|
|
|
|
|
+ WARN_ON(descs);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
static inline struct gpio_desc *__must_check
|
|
static inline struct gpio_desc *__must_check
|
|
@@ -283,7 +283,7 @@ static inline void devm_gpiod_put(struct device *dev, struct gpio_desc *desc)
|
|
|
might_sleep();
|
|
might_sleep();
|
|
|
|
|
|
|
|
/* GPIO can never have been requested */
|
|
/* GPIO can never have been requested */
|
|
|
- WARN_ON(1);
|
|
|
|
|
|
|
+ WARN_ON(desc);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
static inline void devm_gpiod_put_array(struct device *dev,
|
|
static inline void devm_gpiod_put_array(struct device *dev,
|
|
@@ -292,32 +292,32 @@ static inline void devm_gpiod_put_array(struct device *dev,
|
|
|
might_sleep();
|
|
might_sleep();
|
|
|
|
|
|
|
|
/* GPIO can never have been requested */
|
|
/* GPIO can never have been requested */
|
|
|
- WARN_ON(1);
|
|
|
|
|
|
|
+ WARN_ON(descs);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline int gpiod_get_direction(const struct gpio_desc *desc)
|
|
static inline int gpiod_get_direction(const struct gpio_desc *desc)
|
|
|
{
|
|
{
|
|
|
/* GPIO can never have been requested */
|
|
/* GPIO can never have been requested */
|
|
|
- WARN_ON(1);
|
|
|
|
|
|
|
+ WARN_ON(desc);
|
|
|
return -ENOSYS;
|
|
return -ENOSYS;
|
|
|
}
|
|
}
|
|
|
static inline int gpiod_direction_input(struct gpio_desc *desc)
|
|
static inline int gpiod_direction_input(struct gpio_desc *desc)
|
|
|
{
|
|
{
|
|
|
/* GPIO can never have been requested */
|
|
/* GPIO can never have been requested */
|
|
|
- WARN_ON(1);
|
|
|
|
|
|
|
+ WARN_ON(desc);
|
|
|
return -ENOSYS;
|
|
return -ENOSYS;
|
|
|
}
|
|
}
|
|
|
static inline int gpiod_direction_output(struct gpio_desc *desc, int value)
|
|
static inline int gpiod_direction_output(struct gpio_desc *desc, int value)
|
|
|
{
|
|
{
|
|
|
/* GPIO can never have been requested */
|
|
/* GPIO can never have been requested */
|
|
|
- WARN_ON(1);
|
|
|
|
|
|
|
+ WARN_ON(desc);
|
|
|
return -ENOSYS;
|
|
return -ENOSYS;
|
|
|
}
|
|
}
|
|
|
static inline int gpiod_direction_output_raw(struct gpio_desc *desc, int value)
|
|
static inline int gpiod_direction_output_raw(struct gpio_desc *desc, int value)
|
|
|
{
|
|
{
|
|
|
/* GPIO can never have been requested */
|
|
/* GPIO can never have been requested */
|
|
|
- WARN_ON(1);
|
|
|
|
|
|
|
+ WARN_ON(desc);
|
|
|
return -ENOSYS;
|
|
return -ENOSYS;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -325,7 +325,7 @@ static inline int gpiod_direction_output_raw(struct gpio_desc *desc, int value)
|
|
|
static inline int gpiod_get_value(const struct gpio_desc *desc)
|
|
static inline int gpiod_get_value(const struct gpio_desc *desc)
|
|
|
{
|
|
{
|
|
|
/* GPIO can never have been requested */
|
|
/* GPIO can never have been requested */
|
|
|
- WARN_ON(1);
|
|
|
|
|
|
|
+ WARN_ON(desc);
|
|
|
return 0;
|
|
return 0;
|
|
|
}
|
|
}
|
|
|
static inline int gpiod_get_array_value(unsigned int array_size,
|
|
static inline int gpiod_get_array_value(unsigned int array_size,
|
|
@@ -333,25 +333,25 @@ static inline int gpiod_get_array_value(unsigned int array_size,
|
|
|
int *value_array)
|
|
int *value_array)
|
|
|
{
|
|
{
|
|
|
/* GPIO can never have been requested */
|
|
/* GPIO can never have been requested */
|
|
|
- WARN_ON(1);
|
|
|
|
|
|
|
+ WARN_ON(desc_array);
|
|
|
return 0;
|
|
return 0;
|
|
|
}
|
|
}
|
|
|
static inline void gpiod_set_value(struct gpio_desc *desc, int value)
|
|
static inline void gpiod_set_value(struct gpio_desc *desc, int value)
|
|
|
{
|
|
{
|
|
|
/* GPIO can never have been requested */
|
|
/* GPIO can never have been requested */
|
|
|
- WARN_ON(1);
|
|
|
|
|
|
|
+ WARN_ON(desc);
|
|
|
}
|
|
}
|
|
|
static inline void gpiod_set_array_value(unsigned int array_size,
|
|
static inline void gpiod_set_array_value(unsigned int array_size,
|
|
|
struct gpio_desc **desc_array,
|
|
struct gpio_desc **desc_array,
|
|
|
int *value_array)
|
|
int *value_array)
|
|
|
{
|
|
{
|
|
|
/* GPIO can never have been requested */
|
|
/* GPIO can never have been requested */
|
|
|
- WARN_ON(1);
|
|
|
|
|
|
|
+ WARN_ON(desc_array);
|
|
|
}
|
|
}
|
|
|
static inline int gpiod_get_raw_value(const struct gpio_desc *desc)
|
|
static inline int gpiod_get_raw_value(const struct gpio_desc *desc)
|
|
|
{
|
|
{
|
|
|
/* GPIO can never have been requested */
|
|
/* GPIO can never have been requested */
|
|
|
- WARN_ON(1);
|
|
|
|
|
|
|
+ WARN_ON(desc);
|
|
|
return 0;
|
|
return 0;
|
|
|
}
|
|
}
|
|
|
static inline int gpiod_get_raw_array_value(unsigned int array_size,
|
|
static inline int gpiod_get_raw_array_value(unsigned int array_size,
|
|
@@ -359,27 +359,27 @@ static inline int gpiod_get_raw_array_value(unsigned int array_size,
|
|
|
int *value_array)
|
|
int *value_array)
|
|
|
{
|
|
{
|
|
|
/* GPIO can never have been requested */
|
|
/* GPIO can never have been requested */
|
|
|
- WARN_ON(1);
|
|
|
|
|
|
|
+ WARN_ON(desc_array);
|
|
|
return 0;
|
|
return 0;
|
|
|
}
|
|
}
|
|
|
static inline void gpiod_set_raw_value(struct gpio_desc *desc, int value)
|
|
static inline void gpiod_set_raw_value(struct gpio_desc *desc, int value)
|
|
|
{
|
|
{
|
|
|
/* GPIO can never have been requested */
|
|
/* GPIO can never have been requested */
|
|
|
- WARN_ON(1);
|
|
|
|
|
|
|
+ WARN_ON(desc);
|
|
|
}
|
|
}
|
|
|
static inline int gpiod_set_raw_array_value(unsigned int array_size,
|
|
static inline int gpiod_set_raw_array_value(unsigned int array_size,
|
|
|
struct gpio_desc **desc_array,
|
|
struct gpio_desc **desc_array,
|
|
|
int *value_array)
|
|
int *value_array)
|
|
|
{
|
|
{
|
|
|
/* GPIO can never have been requested */
|
|
/* GPIO can never have been requested */
|
|
|
- WARN_ON(1);
|
|
|
|
|
|
|
+ WARN_ON(desc_array);
|
|
|
return 0;
|
|
return 0;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
static inline int gpiod_get_value_cansleep(const struct gpio_desc *desc)
|
|
static inline int gpiod_get_value_cansleep(const struct gpio_desc *desc)
|
|
|
{
|
|
{
|
|
|
/* GPIO can never have been requested */
|
|
/* GPIO can never have been requested */
|
|
|
- WARN_ON(1);
|
|
|
|
|
|
|
+ WARN_ON(desc);
|
|
|
return 0;
|
|
return 0;
|
|
|
}
|
|
}
|
|
|
static inline int gpiod_get_array_value_cansleep(unsigned int array_size,
|
|
static inline int gpiod_get_array_value_cansleep(unsigned int array_size,
|
|
@@ -387,25 +387,25 @@ static inline int gpiod_get_array_value_cansleep(unsigned int array_size,
|
|
|
int *value_array)
|
|
int *value_array)
|
|
|
{
|
|
{
|
|
|
/* GPIO can never have been requested */
|
|
/* GPIO can never have been requested */
|
|
|
- WARN_ON(1);
|
|
|
|
|
|
|
+ WARN_ON(desc_array);
|
|
|
return 0;
|
|
return 0;
|
|
|
}
|
|
}
|
|
|
static inline void gpiod_set_value_cansleep(struct gpio_desc *desc, int value)
|
|
static inline void gpiod_set_value_cansleep(struct gpio_desc *desc, int value)
|
|
|
{
|
|
{
|
|
|
/* GPIO can never have been requested */
|
|
/* GPIO can never have been requested */
|
|
|
- WARN_ON(1);
|
|
|
|
|
|
|
+ WARN_ON(desc);
|
|
|
}
|
|
}
|
|
|
static inline void gpiod_set_array_value_cansleep(unsigned int array_size,
|
|
static inline void gpiod_set_array_value_cansleep(unsigned int array_size,
|
|
|
struct gpio_desc **desc_array,
|
|
struct gpio_desc **desc_array,
|
|
|
int *value_array)
|
|
int *value_array)
|
|
|
{
|
|
{
|
|
|
/* GPIO can never have been requested */
|
|
/* GPIO can never have been requested */
|
|
|
- WARN_ON(1);
|
|
|
|
|
|
|
+ WARN_ON(desc_array);
|
|
|
}
|
|
}
|
|
|
static inline int gpiod_get_raw_value_cansleep(const struct gpio_desc *desc)
|
|
static inline int gpiod_get_raw_value_cansleep(const struct gpio_desc *desc)
|
|
|
{
|
|
{
|
|
|
/* GPIO can never have been requested */
|
|
/* GPIO can never have been requested */
|
|
|
- WARN_ON(1);
|
|
|
|
|
|
|
+ WARN_ON(desc);
|
|
|
return 0;
|
|
return 0;
|
|
|
}
|
|
}
|
|
|
static inline int gpiod_get_raw_array_value_cansleep(unsigned int array_size,
|
|
static inline int gpiod_get_raw_array_value_cansleep(unsigned int array_size,
|
|
@@ -413,55 +413,55 @@ static inline int gpiod_get_raw_array_value_cansleep(unsigned int array_size,
|
|
|
int *value_array)
|
|
int *value_array)
|
|
|
{
|
|
{
|
|
|
/* GPIO can never have been requested */
|
|
/* GPIO can never have been requested */
|
|
|
- WARN_ON(1);
|
|
|
|
|
|
|
+ WARN_ON(desc_array);
|
|
|
return 0;
|
|
return 0;
|
|
|
}
|
|
}
|
|
|
static inline void gpiod_set_raw_value_cansleep(struct gpio_desc *desc,
|
|
static inline void gpiod_set_raw_value_cansleep(struct gpio_desc *desc,
|
|
|
int value)
|
|
int value)
|
|
|
{
|
|
{
|
|
|
/* GPIO can never have been requested */
|
|
/* GPIO can never have been requested */
|
|
|
- WARN_ON(1);
|
|
|
|
|
|
|
+ WARN_ON(desc);
|
|
|
}
|
|
}
|
|
|
static inline int gpiod_set_raw_array_value_cansleep(unsigned int array_size,
|
|
static inline int gpiod_set_raw_array_value_cansleep(unsigned int array_size,
|
|
|
struct gpio_desc **desc_array,
|
|
struct gpio_desc **desc_array,
|
|
|
int *value_array)
|
|
int *value_array)
|
|
|
{
|
|
{
|
|
|
/* GPIO can never have been requested */
|
|
/* GPIO can never have been requested */
|
|
|
- WARN_ON(1);
|
|
|
|
|
|
|
+ WARN_ON(desc_array);
|
|
|
return 0;
|
|
return 0;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
static inline int gpiod_set_debounce(struct gpio_desc *desc, unsigned debounce)
|
|
static inline int gpiod_set_debounce(struct gpio_desc *desc, unsigned debounce)
|
|
|
{
|
|
{
|
|
|
/* GPIO can never have been requested */
|
|
/* GPIO can never have been requested */
|
|
|
- WARN_ON(1);
|
|
|
|
|
|
|
+ WARN_ON(desc);
|
|
|
return -ENOSYS;
|
|
return -ENOSYS;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
static inline int gpiod_set_transitory(struct gpio_desc *desc, bool transitory)
|
|
static inline int gpiod_set_transitory(struct gpio_desc *desc, bool transitory)
|
|
|
{
|
|
{
|
|
|
/* GPIO can never have been requested */
|
|
/* GPIO can never have been requested */
|
|
|
- WARN_ON(1);
|
|
|
|
|
|
|
+ WARN_ON(desc);
|
|
|
return -ENOSYS;
|
|
return -ENOSYS;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
static inline int gpiod_is_active_low(const struct gpio_desc *desc)
|
|
static inline int gpiod_is_active_low(const struct gpio_desc *desc)
|
|
|
{
|
|
{
|
|
|
/* GPIO can never have been requested */
|
|
/* GPIO can never have been requested */
|
|
|
- WARN_ON(1);
|
|
|
|
|
|
|
+ WARN_ON(desc);
|
|
|
return 0;
|
|
return 0;
|
|
|
}
|
|
}
|
|
|
static inline int gpiod_cansleep(const struct gpio_desc *desc)
|
|
static inline int gpiod_cansleep(const struct gpio_desc *desc)
|
|
|
{
|
|
{
|
|
|
/* GPIO can never have been requested */
|
|
/* GPIO can never have been requested */
|
|
|
- WARN_ON(1);
|
|
|
|
|
|
|
+ WARN_ON(desc);
|
|
|
return 0;
|
|
return 0;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
static inline int gpiod_to_irq(const struct gpio_desc *desc)
|
|
static inline int gpiod_to_irq(const struct gpio_desc *desc)
|
|
|
{
|
|
{
|
|
|
/* GPIO can never have been requested */
|
|
/* GPIO can never have been requested */
|
|
|
- WARN_ON(1);
|
|
|
|
|
|
|
+ WARN_ON(desc);
|
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -469,7 +469,7 @@ static inline int gpiod_set_consumer_name(struct gpio_desc *desc,
|
|
|
const char *name)
|
|
const char *name)
|
|
|
{
|
|
{
|
|
|
/* GPIO can never have been requested */
|
|
/* GPIO can never have been requested */
|
|
|
- WARN_ON(1);
|
|
|
|
|
|
|
+ WARN_ON(desc);
|
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -481,7 +481,7 @@ static inline struct gpio_desc *gpio_to_desc(unsigned gpio)
|
|
|
static inline int desc_to_gpio(const struct gpio_desc *desc)
|
|
static inline int desc_to_gpio(const struct gpio_desc *desc)
|
|
|
{
|
|
{
|
|
|
/* GPIO can never have been requested */
|
|
/* GPIO can never have been requested */
|
|
|
- WARN_ON(1);
|
|
|
|
|
|
|
+ WARN_ON(desc);
|
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
|
}
|
|
}
|
|
|
|
|
|