dev: pmic: pm8x41: add support to configure pmic gpio params
Add support to configure the output source select for pmic gpio.
Define the values for the configuration for the source select.
Change-Id: Icb0980771f033afa125022cc399943295ba09c6c
diff --git a/dev/pmic/pm8x41/pm8x41.c b/dev/pmic/pm8x41/pm8x41.c
index 4a4da3a..51a0f96 100644
--- a/dev/pmic/pm8x41/pm8x41.c
+++ b/dev/pmic/pm8x41/pm8x41.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012-2015, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2012-2015, 2017, The Linux Foundation. All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -186,6 +186,10 @@
REG_WRITE(gpio_base + GPIO_DIG_OUT_CTL, val);
}
+ /* Output source sel and output invert */
+ val = config->inv_int_pol << 7;
+ REG_WRITE(gpio_base + GPIO_DIG_OUT_SRC_CTL, val);
+
/* Enable the GPIO */
val = REG_READ(gpio_base + GPIO_EN_CTL);
val |= BIT(PERPH_EN_BIT);