Commit a603e443 authored by Tim Wawrzynczak's avatar Tim Wawrzynczak Committed by Patrick Georgi
Browse files

soc/intel/common/gpio: Add function to get GPIO index in group

The gpio_get_index_in_group function returns the index of the GPIO
within its own group
Signed-off-by: default avatarTim Wawrzynczak <>
Change-Id: I7f6b312bd1d0388ef799cd127c88b17bad6a3886

Tested-by: default avatarbuild bot (Jenkins) <>
Reviewed-by: default avatarFurquan Shaikh <>
parent 5b90c0f1
......@@ -668,3 +668,13 @@ void gpio_pm_configure(const uint8_t *misccfg_pm_values, size_t num)
pcr_rmw8(comm->port, GPIO_MISCCFG,
misccfg_pm_mask, misccfg_pm_values[i]);
size_t gpio_get_index_in_group(gpio_t pad)
const struct pad_community *comm;
size_t pin;
comm = gpio_get_community(pad);
pin = relative_pad_in_comm(comm, pad);
return gpio_within_group(comm, pin);
......@@ -235,5 +235,7 @@ void block_gpio_enable(struct device *dev);
bool gpio_routes_ioapic_irq(unsigned int irq);
size_t gpio_get_index_in_group(gpio_t pad);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment