FP2-19: configure gpio 2 of pm8941 for volume down

in the project, volume down was designed to connected with gpio2 of PM8941.
it is different from the design of qualcomm. so it needs to be re-configured

Change-Id: Ia296ac8a2baa7a61c9bbf1c81116c60c14391ad7
diff --git a/target/fairphone/init.c b/target/fairphone/init.c
index de1fd62..ceb2bb5 100644
--- a/target/fairphone/init.c
+++ b/target/fairphone/init.c
@@ -161,11 +161,27 @@
 /* Return 1 if vol_down pressed */
 uint32_t target_volume_down()
 {
-	/* Volume down button is tied in with RESIN on MSM8974. */
-	if (target_is_8974() && (pmic_ver == PM8X41_VERSION_V2))
-		return pm8x41_v2_resin_status();
-	else
-		return pm8x41_resin_status();
+	uint8_t status = 0;
+	struct pm8x41_gpio gpio;
+
+	if (board_hardware_id() == HW_PLATFORM_SURF)
+		return 0;
+
+	/* Configure the GPIO */
+	gpio.direction = PM_GPIO_DIR_IN;
+	gpio.function  = 0;
+	gpio.pull      = PM_GPIO_PULL_UP_30;
+	gpio.vin_sel   = 2;
+
+	pm8x41_gpio_config(2, &gpio);
+
+	/* Wait for the pmic gpio config to take effect */
+	thread_sleep(1);
+
+	/* Get status of P_GPIO_2 */
+	pm8x41_gpio_get(2, &status);
+
+	return !status; /* active low */
 }
 
 static void target_keystatus()