summaryrefslogtreecommitdiffstats
path: root/drivers/input
diff options
context:
space:
mode:
authorRichard Leitner <richard.leitner@skidata.com>2019-01-29 01:17:58 +0100
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2019-02-05 08:25:54 +0100
commite47ff893bc674c32ac21094d623533ac6e585ca7 (patch)
tree3737d22ceb78e7d0ead456b26c996d83b694aef5 /drivers/input
parentInput: sx8654 - use common of_touchscreen functions (diff)
downloadlinux-e47ff893bc674c32ac21094d623533ac6e585ca7.tar.xz
linux-e47ff893bc674c32ac21094d623533ac6e585ca7.zip
Input: sx8654 - convert #defined flags to BIT(x)
Some of the #defined register values are one-bit flags. Convert them to use the BIT(x) macro instead of 1 byte hexadecimal values. This improves readability and clarifies the intent. Signed-off-by: Richard Leitner <richard.leitner@skidata.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/touchscreen/sx8654.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/input/touchscreen/sx8654.c b/drivers/input/touchscreen/sx8654.c
index de83ed1da36e..477533cd40ab 100644
--- a/drivers/input/touchscreen/sx8654.c
+++ b/drivers/input/touchscreen/sx8654.c
@@ -27,6 +27,7 @@
* published by the Free Software Foundation.
*/
+#include <linux/bitops.h>
#include <linux/delay.h>
#include <linux/gpio/consumer.h>
#include <linux/i2c.h>
@@ -46,7 +47,7 @@
#define I2C_REG_SOFTRESET 0x3f
#define I2C_REG_SX8650_STAT 0x05
-#define SX8650_STAT_CONVIRQ 0x80
+#define SX8650_STAT_CONVIRQ BIT(7)
/* commands */
#define CMD_READ_REGISTER 0x40
@@ -56,8 +57,8 @@
#define SOFTRESET_VALUE 0xde
/* bits for I2C_REG_IRQSRC */
-#define IRQ_PENTOUCH_TOUCHCONVDONE 0x08
-#define IRQ_PENRELEASE 0x04
+#define IRQ_PENTOUCH_TOUCHCONVDONE BIT(3)
+#define IRQ_PENRELEASE BIT(2)
/* bits for RegTouch1 */
#define CONDIRQ 0x20
@@ -65,8 +66,8 @@
#define FILT_7SA 0x03
/* bits for I2C_REG_CHANMASK */
-#define CONV_X 0x80
-#define CONV_Y 0x40
+#define CONV_X BIT(7)
+#define CONV_Y BIT(6)
/* coordinates rate: higher nibble of CTRL0 register */
#define RATE_MANUAL 0x00