summaryrefslogtreecommitdiff
path: root/src/soc/intel/skylake/gpio.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/soc/intel/skylake/gpio.c')
-rw-r--r--src/soc/intel/skylake/gpio.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/soc/intel/skylake/gpio.c b/src/soc/intel/skylake/gpio.c
index 5b9babfde3..6334b3e9bd 100644
--- a/src/soc/intel/skylake/gpio.c
+++ b/src/soc/intel/skylake/gpio.c
@@ -226,7 +226,8 @@ static void *gpio_dw_regs(gpio_t pad)
pad_relative = pad - comm->min;
/* DW0 and DW1 regs are 4 bytes each. */
- return &regs[PAD_CFG_DW_OFFSET + pad_relative * 8];
+ return &regs[PAD_CFG_DW_OFFSET + pad_relative *
+ GPIO_DWx_SIZE(GPIO_DWx_COUNT)];
}
static void *gpio_hostsw_reg(gpio_t pad, size_t *bit)