Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 75241994 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "backlight: qcom-spmi-wled: Update CABC disable sequence for PM7325B WLED"

parents b17dd44e 5441b6ac
Loading
Loading
Loading
Loading
+21 −1
Original line number Diff line number Diff line
@@ -147,6 +147,9 @@
#define WLED5_SINK_MOD_B_BRT_LSB_REG	0x63
#define WLED5_SINK_MOD_B_BRT_MSB_REG	0x64

#define WLED5_SINK_CABC_STRETCH_CTL_REG	0x57
#define WLED5_SINK_EN_CABC_STRETCH	BIT(7)

#define WLED5_SINK_MOD_SYNC_BIT_REG	0x65
#define  WLED5_SINK_SYNC_MODA_BIT	BIT(0)
#define  WLED5_SINK_SYNC_MODB_BIT	BIT(1)
@@ -185,6 +188,9 @@
#define WLED5_EN_EXP_LUT	BIT(6)
#define WLED5_SLEW_RAMP_TIME_SEL	GENMASK(3, 0)

#define  WLED5_SINK_DIG_HYS_FILT_REG	0xbc
#define  WLED5_SINK_LSB_NOISE_THRESH	GENMASK(2, 0)

#define WLED5_SINK_DIMMING_EXP_LUT0_LSB_REG	0xc0
#define WLED5_SINK_DIMMING_EXP_LUT0_MSB_REG	0xc1
#define WLED5_SINK_DIMMING_EXP_LUT1_LSB_REG	0xc2
@@ -683,8 +689,22 @@ static int wled5_cabc_config(struct wled *wled, bool enable)
		return rc;
	}

	if (!wled->cfg.cabc_sel)
	if (!wled->cfg.cabc_sel) {
		wled->cabc_disabled = true;
		if (*wled->version == WLED_PM7325B) {
			rc = regmap_update_bits(wled->regmap,
				wled->sink_addr + WLED5_SINK_CABC_STRETCH_CTL_REG,
				WLED5_SINK_EN_CABC_STRETCH, 0);
			if (rc < 0)
				return rc;

			rc = regmap_update_bits(wled->regmap,
				wled->sink_addr + WLED5_SINK_DIG_HYS_FILT_REG,
				WLED5_SINK_LSB_NOISE_THRESH, 0);
			if (rc < 0)
				return rc;
		}
	}

	return 0;
}