From: Richard Leitner <richard.leitner@skidata.com> To: <dmitry.torokhov@gmail.com>, <robh+dt@kernel.org>, <mark.rutland@arm.com> Cc: <linux-input@vger.kernel.org>, <devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>, Richard Leitner <richard.leitner@skidata.com> Subject: [PATCH v2 8/8] Input: sx8654 - convert #defined flags to BIT(x) Date: Wed, 17 Oct 2018 14:51:16 +0200 [thread overview] Message-ID: <20181017125116.20077-9-richard.leitner@skidata.com> (raw) In-Reply-To: <20181017125116.20077-1-richard.leitner@skidata.com> 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> --- drivers/input/touchscreen/sx8654.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/input/touchscreen/sx8654.c b/drivers/input/touchscreen/sx8654.c index b7b263ed52af..3746ea855f94 100644 --- a/drivers/input/touchscreen/sx8654.c +++ b/drivers/input/touchscreen/sx8654.c @@ -36,6 +36,7 @@ #include <linux/gpio/consumer.h> #include <linux/delay.h> #include <linux/input/touchscreen.h> +#include <linux/bitops.h> /* register addresses */ #define I2C_REG_TOUCH0 0x00 @@ -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(7) +#define IRQ_PENRELEASE BIT(6) /* 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 -- 2.11.0
next prev parent reply other threads:[~2018-10-17 16:04 UTC|newest] Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top 2018-10-17 12:51 [PATCH v2 0/7] Input: sx8654 - reset-gpio, sx865[056] support, etc Richard Leitner 2018-10-17 12:51 ` [PATCH v2 1/8] dt-bindings: input: touchscreen: sx8654: add reset-gpio property Richard Leitner 2018-10-18 20:34 ` Rob Herring 2018-10-17 12:51 ` [PATCH v2 2/8] Input: sx8654 - add reset-gpio support Richard Leitner 2018-10-17 12:51 ` [PATCH v2 3/8] dt-bindings: input: touchscreen: sx8654: add compatible models Richard Leitner 2018-10-18 20:35 ` Rob Herring 2018-10-17 12:51 ` [PATCH v2 4/8] Input: sx8654 - add sx8655 and sx8656 to compatibles Richard Leitner 2018-10-17 12:51 ` [PATCH v2 5/8] dt-bindings: input: touchscreen: sx8654: add sx8650 to comatibles Richard Leitner 2018-10-18 20:35 ` Rob Herring 2018-10-17 12:51 ` [PATCH v2 6/8] Input: sx8654 - add sx8650 support Richard Leitner 2018-10-17 12:51 ` [PATCH v2 7/8] Input: sx8654 - use common of_touchscreen functions Richard Leitner 2018-10-17 12:51 ` Richard Leitner [this message] 2018-11-04 21:38 ` [PATCH v2 0/7] Input: sx8654 - reset-gpio, sx865[056] support, etc Richard Leitner 2018-12-03 8:25 ` Richard Leitner
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20181017125116.20077-9-richard.leitner@skidata.com \ --to=richard.leitner@skidata.com \ --cc=devicetree@vger.kernel.org \ --cc=dmitry.torokhov@gmail.com \ --cc=linux-input@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=mark.rutland@arm.com \ --cc=robh+dt@kernel.org \ --subject='Re: [PATCH v2 8/8] Input: sx8654 - convert #defined flags to BIT(x)' \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).