History

gpiolib: introduce fwnode_gpiod_get_index()

This introduces fwnode_gpiod_get_index() that iterates through common gpio suffixes when trying to locate a GPIO within a given firmware node. We also switch devm_fwnode_gpiod_get_index() to call fwnode_gpiod_get_index() instead of iterating through GPIO suffixes on its own.

Dmitry Torokhov committed 7 years ago

Commit 13949fa1 parent 2d2f1163 files · +62 −15Browse files

Showing the changes to include/linux/gpio (1 of 3 files). Show all

Unified · Split

include/linux/gpio/consumer.h+13−0
@@ -176,6 +176,10 @@ struct gpio_desc *fwnode_get_named_gpiod(struct fwnode_handle *fwnode, · 175 unmodified lines
176 const char *propname, int index,176 const char *propname, int index,
177 enum gpiod_flags dflags,177 enum gpiod_flags dflags,
178 const char *label);178 const char *label);
179struct gpio_desc *fwnode_gpiod_get_index(struct fwnode_handle *fwnode,
180 const char *con_id, int index,
181 enum gpiod_flags flags,
182 const char *label);
179struct gpio_desc *devm_fwnode_gpiod_get_index(struct device *dev,183struct gpio_desc *devm_fwnode_gpiod_get_index(struct device *dev,
180 struct fwnode_handle *child,184 struct fwnode_handle *child,
181 const char *con_id, int index,185 const char *con_id, int index,
@@ -531,6 +535,15 @@ struct gpio_desc *fwnode_get_named_gpiod(struct fwnode_handle *fwnode, · 349 unmodified lines
531 return ERR_PTR(-ENOSYS);535 return ERR_PTR(-ENOSYS);
532}536}
533 537
538static inline
539struct gpio_desc *fwnode_gpiod_get_index(struct fwnode_handle *fwnode,
540 const char *con_id, int index,
541 enum gpiod_flags flags,
542 const char *label)
543{
544 return ERR_PTR(-ENOSYS);
545}
546
534static inline547static inline
535struct gpio_desc *devm_fwnode_gpiod_get_index(struct device *dev,548struct gpio_desc *devm_fwnode_gpiod_get_index(struct device *dev,
536 struct fwnode_handle *fwnode,549 struct fwnode_handle *fwnode,

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t