Skip to content

Commit d250166

Browse files
cristiccbroonie
authored andcommitted
regulator: fan53555: Make use of the bit macros
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent d5edc0e commit d250166

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

drivers/regulator/fan53555.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,23 +41,23 @@
4141
#define FAN53555_MONITOR 0x05
4242

4343
/* VSEL bit definitions */
44-
#define VSEL_BUCK_EN (1 << 7)
45-
#define VSEL_MODE (1 << 6)
44+
#define VSEL_BUCK_EN BIT(7)
45+
#define VSEL_MODE BIT(6)
4646
/* Chip ID and Verison */
47-
#define DIE_ID 0x0F /* ID1 */
48-
#define DIE_REV 0x0F /* ID2 */
47+
#define DIE_ID 0x0F /* ID1 */
48+
#define DIE_REV 0x0F /* ID2 */
4949
/* Control bit definitions */
50-
#define CTL_OUTPUT_DISCHG (1 << 7)
51-
#define CTL_SLEW_MASK (0x7 << 4)
52-
#define CTL_RESET (1 << 2)
50+
#define CTL_OUTPUT_DISCHG BIT(7)
51+
#define CTL_SLEW_MASK GENMASK(6, 4)
52+
#define CTL_RESET BIT(2)
5353
#define CTL_MODE_VSEL0_MODE BIT(0)
5454
#define CTL_MODE_VSEL1_MODE BIT(1)
5555

5656
#define FAN53555_NVOLTAGES 64 /* Numbers of voltages */
5757
#define FAN53526_NVOLTAGES 128
5858

59-
#define TCS_VSEL0_MODE (1 << 7)
60-
#define TCS_VSEL1_MODE (1 << 6)
59+
#define TCS_VSEL0_MODE BIT(7)
60+
#define TCS_VSEL1_MODE BIT(6)
6161

6262
#define TCS_SLEW_MASK GENMASK(4, 3)
6363

0 commit comments

Comments
 (0)