From patchwork Thu Apr 6 19:41:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 80421 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1269580vqo; Thu, 6 Apr 2023 13:02:32 -0700 (PDT) X-Google-Smtp-Source: AKy350Z9dXK2FCHtBcg9lGNVvhnmoETLomlJlNBwyElwRrzkPZf4qz7MkDT1ElphfKXltKog0PdG X-Received: by 2002:a62:1d8f:0:b0:627:82a7:11f9 with SMTP id d137-20020a621d8f000000b0062782a711f9mr110456pfd.12.1680811352110; Thu, 06 Apr 2023 13:02:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680811352; cv=none; d=google.com; s=arc-20160816; b=K4y9eBm66CEWNQh2UCca1M3g7+wMDydeBltDGES7QPF9nLC9z61aCLokTGM2/Njqap /IYtzgQVCKBl+1sU3R0C6uz/aNO5P38tyqc7MI9FzjLcXLcol05vASWMrzzvkG5IGWjn sZJUdC/jKX5RheCSKKHH6W4IFBjrCaNlpopQVUcL1hnQGL+6wCCCquXU/mCF7uKo2L/5 W2QbebhJbdP2RneNWqxqMxnAh5UVdD6QsNKJcvifIdYXcZsL/waU+nTU8fZBo0qOWWZi cyzxQErp7owmfL6fM2K3drpWEFOSmLhefrNHrHvoPV0/qVH565tZsWXcJp4nLfSI4NqX dt2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=+HY613/cWpilX/UQhldIyeAAp/lXCX0yrKtKN9LFBRw=; b=phWVQijBVoQ5zEwHows33CrHR+M2kAs0UewdGrrm12WYN9ODMXXD7t7+clLy487OEh 6W2ymxuYPzmewhfK5jFa3wGqWP8hwAPY3EMSPMIf136QYUaACBGPlfjTh3g0yWs1ALZG 0DTUqquUk7knh60eMkAqZZ86HbyjoeEAJZleo3p+AHBF+NguYTS+nrEhMketSVUvPAXd B/4W+9LcWJyjCPZ5tRYn+6xHnR7OliAsllqEees/wUocOXvulwg7tDaFKLN3ZW19kZ4g xeUPje67UI/3ltTPckzYWIRFjPr3Ul4HaCKvE9Mg8Z5mDW2vA8R98k6S2M1Y30ntNS3g z/QA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=TgS7KSHK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a5-20020aa79705000000b00628030da823si1994445pfg.318.2023.04.06.13.02.19; Thu, 06 Apr 2023 13:02:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=TgS7KSHK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238043AbjDFTmi (ORCPT + 99 others); Thu, 6 Apr 2023 15:42:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44158 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237645AbjDFTmV (ORCPT ); Thu, 6 Apr 2023 15:42:21 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D42393EB; Thu, 6 Apr 2023 12:42:19 -0700 (PDT) Received: from localhost (unknown [188.27.34.213]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by madras.collabora.co.uk (Postfix) with ESMTPSA id 1769D66031D9; Thu, 6 Apr 2023 20:42:18 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1680810138; bh=qXAW+NxBtXP2ZLN97K9FdNC+pkjm39ZBXXRQWxqaxDQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TgS7KSHKboSv+CoImq/CKFcCgmLJj45/PlLVqOVMSP3e9kEM8tGV9UzfeUui/1YVX db0p4Be/OLxL3fcUbchrp40Vd5cMCCn3Jqfa+Vf1Ws0qtqJsQhO4D5pVQAvhosTyNv oh0ihIRa7DueIIuVFS+YD/xwGrnhDYjznf22qRohUJxyabGXM5RcjizseK7UtJe1lN J79ftHnjTCQqtusGY8UKy9oxE7sl3u6VORkiE/mdfIRLxFpM6SrW8pI8XV+g6I7xVK n1HA+YidW2h7dvG4e07FAsnnZIZilxeXmZZmEJxQGvnUNzhRjpMrB5ZIE1j1aGpuvF YT1BfbvqXqlhQ== From: Cristian Ciocaltea To: Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Heiko Stuebner , Bjorn Andersson , Joseph Chen , Ezequiel Garcia Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, kernel@collabora.com Subject: [PATCH v3 5/8] regulator: fan53555: Make use of the bit macros Date: Thu, 6 Apr 2023 22:41:55 +0300 Message-Id: <20230406194158.963352-6-cristian.ciocaltea@collabora.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230406194158.963352-1-cristian.ciocaltea@collabora.com> References: <20230406194158.963352-1-cristian.ciocaltea@collabora.com> MIME-Version: 1.0 X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762458444607301443?= X-GMAIL-MSGID: =?utf-8?q?1762458444607301443?= For consistency and improved clarity, use BIT() and GENMASK() macros for defining the bitfields inside the registers. No functional changes intended. While here, also fix DIE_{ID,REV} inconsistent indentation. Signed-off-by: Cristian Ciocaltea --- drivers/regulator/fan53555.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/regulator/fan53555.c b/drivers/regulator/fan53555.c index 68ebcd4ccef7..181e5eb00e7a 100644 --- a/drivers/regulator/fan53555.c +++ b/drivers/regulator/fan53555.c @@ -41,23 +41,23 @@ #define FAN53555_MONITOR 0x05 /* VSEL bit definitions */ -#define VSEL_BUCK_EN (1 << 7) -#define VSEL_MODE (1 << 6) +#define VSEL_BUCK_EN BIT(7) +#define VSEL_MODE BIT(6) /* Chip ID and Verison */ -#define DIE_ID 0x0F /* ID1 */ -#define DIE_REV 0x0F /* ID2 */ +#define DIE_ID 0x0F /* ID1 */ +#define DIE_REV 0x0F /* ID2 */ /* Control bit definitions */ -#define CTL_OUTPUT_DISCHG (1 << 7) -#define CTL_SLEW_MASK (0x7 << 4) -#define CTL_RESET (1 << 2) +#define CTL_OUTPUT_DISCHG BIT(7) +#define CTL_SLEW_MASK GENMASK(6, 4) +#define CTL_RESET BIT(2) #define CTL_MODE_VSEL0_MODE BIT(0) #define CTL_MODE_VSEL1_MODE BIT(1) #define FAN53555_NVOLTAGES 64 /* Numbers of voltages */ #define FAN53526_NVOLTAGES 128 -#define TCS_VSEL0_MODE (1 << 7) -#define TCS_VSEL1_MODE (1 << 6) +#define TCS_VSEL0_MODE BIT(7) +#define TCS_VSEL1_MODE BIT(6) #define TCS_SLEW_MASK GENMASK(4, 3)