Commit f885c8ad authored by Ricardo Rivera-Matos's avatar Ricardo Rivera-Matos Committed by Carles Cufi
Browse files

regulator: cp9314: Uses FIELD_GET to read CHIP_REV

Use FIELD_GET macro to grab CHIP_REV bitfield. This change improves
the readability of the source code and does not change functionality.

Signed-off-by: default avatarRicardo Rivera-Matos <rriveram@opensource.cirrus.com>
parent 0f6d6b2e
Loading
Loading
Loading
Loading
+2 −2
Changes for drivers/regulator/regulator_cp9314.c: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -118,7 +118,7 @@ LOG_MODULE_REGISTER(CP9314, CONFIG_REGULATOR_LOG_LEVEL);

#define CP9314_REG_BC_STS_C  0x62
#define CP9314_CHIP_REV_MASK GENMASK(7, 4)
#define CP9314_CHIP_REV_B0   0x10
#define CP9314_CHIP_REV_B0   0x1

#define CP9314_REG_FORCE_SC_MISC 0x69
#define CP9314_FORCE_CSI_EN      BIT(0)
@@ -516,7 +516,7 @@ static int regulator_cp9314_init(const struct device *dev)
		return ret;
	}

	value &= CP9314_CHIP_REV_MASK;
	value = FIELD_GET(CP9314_CHIP_REV_MASK, value);

	switch (value) {
	case CP9314_CHIP_REV_B0: