[COMMON] pinctrl: Added `exynos_eint_to_pin_num' function.
authorJang JeongHoon <jnghn.jang@samsung.com>
Fri, 18 May 2018 02:31:39 +0000 (11:31 +0900)
committerChungwoo Park <cww.park@samsung.com>
Wed, 23 May 2018 10:52:31 +0000 (19:52 +0900)
Change-Id: If62dc4e9092ee2723de406ea88432c3e49a929c9
Signed-off-by: Jang JeongHoon <jnghn.jang@samsung.com>
drivers/pinctrl/samsung/pinctrl-samsung.c

index a8e49da6b1ec3c6512913bc0089c61856503f133..318f52f6d380e10bec3038e1d458a98b4acf295d 100644 (file)
@@ -1373,6 +1373,26 @@ static void samsung_pinctrl_resume(void)
        }
 }
 
+u32 exynos_eint_to_pin_num(int eint)
+{
+       struct samsung_pinctrl_drv_data *drvdata;
+       struct samsung_pin_bank *pbank;
+       int i, offset = 0;
+
+       drvdata = list_first_entry(&drvdata_list,
+                       struct samsung_pinctrl_drv_data, node);
+
+       for (i = 0; i < drvdata->nr_banks; i++) {
+               pbank = &drvdata->pin_banks[i];
+               if (!strncmp(pbank->name, "gpa0", strlen(pbank->name)))
+                       break;
+
+               offset += pbank->nr_pins;
+       }
+
+       return drvdata->pin_base + eint + offset;
+}
+
 #else
 #define samsung_pinctrl_suspend                NULL
 #define samsung_pinctrl_resume         NULL