Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp842073imm; Wed, 17 Oct 2018 09:07:02 -0700 (PDT) X-Google-Smtp-Source: ACcGV62Wgf/KFZpcAGewOjulQkugbnMnoomtHzc1fGjarjocFFvya+u+RT3zXagDnPc1hTg1r213 X-Received: by 2002:a63:5308:: with SMTP id h8-v6mr24265095pgb.358.1539792422631; Wed, 17 Oct 2018 09:07:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539792422; cv=none; d=google.com; s=arc-20160816; b=uFlF2q0iTFONa+mE+jUqV62CM07xm27gX3tKjjUeXX24V23iMarQzh+SgANLhKFFbz SpCi+aMmkyPXAGSTlF05RU3ApnDKAh/LRY13R8EZSv/1rx9bGLd5ZuJ8M674bZAzMqHJ tJ4zzfPTHgsCXjM7eTmdi9ah+HcMB2P9SX7QuCXN23i+ToGZ+GcBHHUK1Qujak89zYjo gzjXKJPmMXYdWaFF/8axAWyJyAkJt2HfpaYsFYbfAI6FVoWAIGFRIxXzMMOwNEDOpkKJ f7osPw2KQgZusTaUCiaZmXRnomsj0NphAXehSvSCt3T+LvUyBWDXOdJJ0S0TPFE1BH2n SzmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=IE2mUgTzUbIa88W0Fh4zPSBrIAIvlQfZNu5GS7fZKCc=; b=bGQtEqAen9kR01sKu5qmjaEUqXKGAMVqb0qkRQQ95xbSGlD3vC+GPx6RURxOevYuvF sah9xrxQK+KvdB3DUKmXWhJoIGOBIl2V2QJh9S7RHziX7BNLqAimlODd3TVizOptCgmC SEkszcLK3suCGTnXwfhiUkGMK7W7ADfk7nsgMGvjxGWW56KqSPEvYDGD10NN0XFHuEb4 QMKRSqfbyYLYYbqWb9QExWEq/NObCw0d89+Pz07szKHZot0BEMGDvOPY/5MIFMGn0UqV NKOnnVCzzEAu2npPAMKNZjVRjR+ltgiVwvDZ80QSM4RD+83HXyfefTv1EK3yR1RF3m+Q 6RWA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w18-v6si18490733pfg.70.2018.10.17.09.06.39; Wed, 17 Oct 2018 09:07:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727998AbeJRAAi (ORCPT + 99 others); Wed, 17 Oct 2018 20:00:38 -0400 Received: from mail1.skidata.com ([91.230.2.99]:30634 "EHLO mail1.skidata.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727048AbeJRAAi (ORCPT ); Wed, 17 Oct 2018 20:00:38 -0400 X-IronPort-AV: E=Sophos;i="5.54,393,1534802400"; d="scan'208";a="12919620" From: Richard Leitner To: , , CC: , , , Richard Leitner Subject: [PATCH v2 8/8] Input: sx8654 - convert #defined flags to BIT(x) Date: Wed, 17 Oct 2018 14:51:16 +0200 Message-ID: <20181017125116.20077-9-richard.leitner@skidata.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20181017125116.20077-1-richard.leitner@skidata.com> References: <20181017125116.20077-1-richard.leitner@skidata.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [192.168.111.252] X-ClientProxiedBy: sdex5srv.skidata.net (192.168.111.83) To sdex5srv.skidata.net (192.168.111.83) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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 #include #include +#include /* 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