Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3597005imu; Tue, 18 Dec 2018 00:41:38 -0800 (PST) X-Google-Smtp-Source: AFSGD/XuRzreVhAFiL8+trR8tx/IqcY5zBOL9hpLUNO7hVTb5ZSiYnfU2ck71PdvtFOJVCmJMKg1 X-Received: by 2002:a63:2c0e:: with SMTP id s14mr15310317pgs.132.1545122498073; Tue, 18 Dec 2018 00:41:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545122498; cv=none; d=google.com; s=arc-20160816; b=Rof+qOWwLOh3NufB/YMpmaGOYmPCCy1Cq2y6POG4nBnG767DZC+WE41tGSKH2ABo3k eCWA4f6X09aDjRUUmIHmC0Y9RDzjw/Ru94ZUMbyEWWOtYzvDSU2OtuQWKhpCQHqo3IhK 9lLayEjBlnhVc0aXJPr3dbYYJdLJlMV1dERAOhsFwkZlBftYf16bzUFuOnhP4SyWtCBB b6E2TP4GgHhKSX+2aKWOt/iGGtZ6IS58XOXHPCa1fvTzUZxy9EAMjBqV53EsG2uAqlfF kIVnbj7W2AgE/Uqkmm/sYcpDs20XGx6wdqglp4UZykWe701neX/K43ULDWO3L4ilUDng Xmcg== 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=x2Nm4f3QwPpGucupWPOBwAxJzO8vjKUSE/8t9IrLfCzaDLtQoZLDcnVEUmgtoh1QH4 ofdC2zvyGAOqgmCtuRozr80K4rTMW70Cnnyf6DJEs3/JdoYT+yijYW7HoQAJMq53KD9z 7R5npZr/RN3EilblFnSz5IUWD4r1qHU5gdl44VfOKrjKP1K8QAWTCdAy5YvmYf10KqAm h/ubeu/LVL/TXWs5z1S31ljHHky2eOUv3WYGWf2a7CpAMLjzEmtozFLXHQ/A3WmVmihd nr44DtljNbTW5VaaKA/KD9SXf+31vgVQfoey7Gi58CGQ1vKbQUKGmcl/deyt4FMiSHIY WnEQ== 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 g6si12915499pgn.57.2018.12.18.00.41.22; Tue, 18 Dec 2018 00:41:38 -0800 (PST) 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 S1726827AbeLRIkJ (ORCPT + 99 others); Tue, 18 Dec 2018 03:40:09 -0500 Received: from mail1.skidata.com ([91.230.2.99]:20838 "EHLO mail1.skidata.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726386AbeLRIkJ (ORCPT ); Tue, 18 Dec 2018 03:40:09 -0500 X-IronPort-AV: E=Sophos;i="5.56,367,1539640800"; d="scan'208";a="14044705" From: Richard Leitner To: , CC: , , , , Subject: [RESEND PATCH v2 8/8] Input: sx8654 - convert #defined flags to BIT(x) Date: Tue, 18 Dec 2018 09:40:02 +0100 Message-ID: <20181218084002.19454-1-richard.leitner@skidata.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20181218083606.25795-1-richard.leitner@skidata.com> References: <20181218083606.25795-1-richard.leitner@skidata.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [192.168.111.252] X-ClientProxiedBy: sdex3srv.skidata.net (192.168.111.81) 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