gpio: qpnp-gpio: Remove config param inv_int_pol

This configuration option should never have existed. It does not
exist in the qpnp-gpio block. It was mistakenly being used to
represent the 'output_value' parameter within the code. Fix such
occurrences so that the semantics are consistent.

Also move qpnp-gpio documentation to a more meaningful location.
It belongs in the gpio directory and not spmi.

Change-Id: I48b37aef02793934f60b9886347068cf37331c3f
Signed-off-by: Michael Bohan <mbohan@codeaurora.org>
diff --git a/Documentation/devicetree/bindings/spmi/msm-qpnp-gpio.txt b/Documentation/devicetree/bindings/gpio/qpnp-gpio.txt
similarity index 94%
rename from Documentation/devicetree/bindings/spmi/msm-qpnp-gpio.txt
rename to Documentation/devicetree/bindings/gpio/qpnp-gpio.txt
index f07d3c2..dff6a3e 100644
--- a/Documentation/devicetree/bindings/spmi/msm-qpnp-gpio.txt
+++ b/Documentation/devicetree/bindings/gpio/qpnp-gpio.txt
@@ -84,10 +84,6 @@
 			QPNP_GPIO_DTEST3	= 6,
 			QPNP_GPIO_DTEST4	= 7
 
-  @inv_int_pol:		Invert polarity before feeding the line to the interrupt
-			module in pmic. This feature will almost be never used
-			since the pm8xxx interrupt block can detect both edges
-			and both levels.
   @master_en:		1 = Enable features within the GPIO block based on
 			configurations.
 			0 = Completely disable the GPIO block and let the pin
diff --git a/drivers/gpio/qpnp-gpio.c b/drivers/gpio/qpnp-gpio.c
index 263ead3..90cc798 100644
--- a/drivers/gpio/qpnp-gpio.c
+++ b/drivers/gpio/qpnp-gpio.c
@@ -168,7 +168,7 @@
 	}
 
 	if (param->direction & QPNP_GPIO_DIR_OUT) {
-		q_spec->regs[Q_REG_I_OUTPUT_CTL2] = (param->inv_int_pol
+		q_spec->regs[Q_REG_I_OUTPUT_CTL2] = (param->output_value
 			    << Q_REG_OUT_INVERT_SHIFT) & Q_REG_OUT_INVERT_MASK;
 		q_spec->regs[Q_REG_I_OUTPUT_CTL2] |= (param->src_select
 			    << Q_REG_SRC_SEL_SHIFT) & Q_REG_SRC_SEL_MASK;
@@ -398,13 +398,11 @@
 	int rc;
 
 	dev_dbg(&spmi->dev, "%s: p[0]: 0x%x p[1]: 0x%x p[2]: 0x%x p[3]:"
-		" 0x%x p[4]: 0x%x p[5]: 0x%x p[6]: 0x%x p[7]: 0x%x"
-		" p[8]: 0x%x\n", __func__,
+		" 0x%x p[4]: 0x%x p[5]: 0x%x p[6]: 0x%x p[7]: 0x%x\n", __func__,
 		be32_to_cpup(&prop[0]), be32_to_cpup(&prop[1]),
 		be32_to_cpup(&prop[2]), be32_to_cpup(&prop[3]),
 		be32_to_cpup(&prop[4]), be32_to_cpup(&prop[5]),
-		be32_to_cpup(&prop[6]), be32_to_cpup(&prop[7]),
-		be32_to_cpup(&prop[8]));
+		be32_to_cpup(&prop[6]), be32_to_cpup(&prop[7]));
 
 	param.direction    =	be32_to_cpup(&prop[0]);
 	param.output_type  =	be32_to_cpup(&prop[1]);
@@ -413,8 +411,7 @@
 	param.vin_sel	   =	be32_to_cpup(&prop[4]);
 	param.out_strength =	be32_to_cpup(&prop[5]);
 	param.src_select   =	be32_to_cpup(&prop[6]);
-	param.inv_int_pol  =	be32_to_cpup(&prop[7]);
-	param.master_en    =	be32_to_cpup(&prop[8]);
+	param.master_en    =	be32_to_cpup(&prop[7]);
 
 	rc = qpnp_gpio_config(gpio, &param);
 	if (rc)
@@ -613,8 +610,8 @@
 		/* It's not an error to not config a default */
 		prop = of_get_property(spmi->dev_node[i].of_node,
 				"qcom,qpnp-gpio-cfg", &len);
-		/* 9 data values constitute one tuple */
-		if (prop && (len != (9 * sizeof(__be32)))) {
+		/* 8 data values constitute one tuple */
+		if (prop && (len != (8 * sizeof(__be32)))) {
 			dev_err(&spmi->dev, "%s: invalid format for"
 				" qcom,qpnp-gpio-cfg property\n",
 							__func__);
diff --git a/include/linux/qpnp/gpio.h b/include/linux/qpnp/gpio.h
index 0447a08..a31b7f37 100644
--- a/include/linux/qpnp/gpio.h
+++ b/include/linux/qpnp/gpio.h
@@ -69,10 +69,6 @@
  *			can be paired (shorted) with each other. Some gpio pin
  *			can act as alternate functions. This parameter should
  *			be of type QPNP_GPIO_FUNC_*
- * @inv_int_pol:	Invert polarity before feeding the line to the interrupt
- *			module in pmic. This feature will almost be never used
- *			since the pm8xxx interrupt block can detect both edges
- *			and both levels.
  * @master_en:		1 = Enable features within the GPIO block based on
  *			configurations.
  *			0 = Completely disable the GPIO block and let the pin
@@ -86,7 +82,6 @@
 	int		vin_sel;
 	int		out_strength;
 	int		src_select;
-	int		inv_int_pol;
 	int		master_en;
 };