summaryrefslogtreecommitdiff
path: root/src/soc/intel/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/soc/intel/common')
-rw-r--r--src/soc/intel/common/block/gpio/gpio.c10
-rw-r--r--src/soc/intel/common/block/include/intelblocks/gpio.h2
2 files changed, 12 insertions, 0 deletions
diff --git a/src/soc/intel/common/block/gpio/gpio.c b/src/soc/intel/common/block/gpio/gpio.c
index 417dfb88b2..ca30fb5dc3 100644
--- a/src/soc/intel/common/block/gpio/gpio.c
+++ b/src/soc/intel/common/block/gpio/gpio.c
@@ -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);
+}
diff --git a/src/soc/intel/common/block/include/intelblocks/gpio.h b/src/soc/intel/common/block/include/intelblocks/gpio.h
index 3f79b19f94..a7419dca59 100644
--- a/src/soc/intel/common/block/include/intelblocks/gpio.h
+++ b/src/soc/intel/common/block/include/intelblocks/gpio.h
@@ -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);
+
#endif
#endif /* _SOC_INTELBLOCKS_GPIO_H_ */