]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
mfd: stmpe: Use generic bit mask name
authorPatrice Chotard <patrice.chotard@st.com>
Wed, 10 Aug 2016 07:39:10 +0000 (09:39 +0200)
committerLee Jones <lee.jones@linaro.org>
Wed, 10 Aug 2016 08:24:29 +0000 (09:24 +0100)
In order to prepare the ground to STMPE1600,
as STMPE1600's SYS_CTRL register has the same layout as
STMPE801 variant, unify STMPExxx_REG_SYS_CTRL_RESET/INT_EN/INT_HI
bit masks to more generic STMPE_SYS_CTRL_RESET/INT_EN/INT_HI

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
drivers/mfd/stmpe.c
drivers/mfd/stmpe.h

index 85005253663db9235fc63df15b25c7c70ca0eebe..a0704767a050233e853784a53ab7e0cbbf5846f6 100644 (file)
@@ -1110,7 +1110,7 @@ static int stmpe_chip_init(struct stmpe *stmpe)
 
        if (stmpe->irq >= 0) {
                if (id == STMPE801_ID)
-                       icr = STMPE801_REG_SYS_CTRL_INT_EN;
+                       icr = STMPE_SYS_CTRL_INT_EN;
                else
                        icr = STMPE_ICR_LSB_GIM;
 
@@ -1124,7 +1124,7 @@ static int stmpe_chip_init(struct stmpe *stmpe)
                if (irq_trigger == IRQF_TRIGGER_RISING ||
                                irq_trigger == IRQF_TRIGGER_HIGH) {
                        if (id == STMPE801_ID)
-                               icr |= STMPE801_REG_SYS_CTRL_INT_HI;
+                               icr |= STMPE_SYS_CTRL_INT_HI;
                        else
                                icr |= STMPE_ICR_LSB_HIGH;
                }
index 4ae343de71eb7d93efbe6f0a3033162544548860..4ba112362167ea623af3979f13a8357fd3862fc4 100644 (file)
@@ -105,6 +105,8 @@ int stmpe_remove(struct stmpe *stmpe);
 #define STMPE_ICR_LSB_GIM      (1 << 0)
 
 #define STMPE_SYS_CTRL_RESET   (1 << 7)
+#define STMPE_SYS_CTRL_INT_EN  (1 << 2)
+#define STMPE_SYS_CTRL_INT_HI  (1 << 0)
 
 /*
  * STMPE801
@@ -121,10 +123,6 @@ int stmpe_remove(struct stmpe *stmpe);
 #define STMPE801_REG_GPIO_SET_PIN      0x11
 #define STMPE801_REG_GPIO_DIR          0x12
 
-#define STMPE801_REG_SYS_CTRL_RESET    (1 << 7)
-#define STMPE801_REG_SYS_CTRL_INT_EN   (1 << 2)
-#define STMPE801_REG_SYS_CTRL_INT_HI   (1 << 0)
-
 /*
  * STMPE811
  */