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

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

Merge "backlight: qcom-spmi-wled: Change the SYNC toggle sequence"

parents 821a0d89 00adef1d
Loading
Loading
Loading
Loading
+11 −14
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@
 * Copyright (c) 2015, Sony Mobile Communications, AB.
 */
/*
 * Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
 * Copyright (c) 2018-2021, The Linux Foundation. All rights reserved.
 */

#define pr_fmt(fmt)	"WLED: %s: " fmt, __func__
@@ -359,15 +359,13 @@ static int wled_sync_toggle(struct wled *wled)

	rc = regmap_update_bits(wled->regmap,
			wled->sink_addr + WLED_SINK_SYNC,
			WLED_SINK_SYNC_MASK, WLED_SINK_SYNC_MASK);
			WLED_SINK_SYNC_MASK, WLED_SINK_SYNC_CLEAR);
	if (rc < 0)
		return rc;

	rc = regmap_update_bits(wled->regmap,
	return regmap_update_bits(wled->regmap,
			wled->sink_addr + WLED_SINK_SYNC,
			WLED_SINK_SYNC_MASK, WLED_SINK_SYNC_CLEAR);

	return rc;
			WLED_SINK_SYNC_MASK, WLED_SINK_SYNC_MASK);
}

static int wled5_sample_hold_control(struct wled *wled, u16 brightness,
@@ -441,20 +439,19 @@ static int wled5_set_brightness(struct wled *wled, u16 brightness)
	if (rc < 0)
		return rc;

	/* Update brightness values to modulator in WLED5 */
	val = (wled->cfg.mod_sel == MOD_A) ? WLED5_SINK_SYNC_MODA_BIT :
		WLED5_SINK_SYNC_MODB_BIT;
	val = 0;
	rc = regmap_update_bits(wled->regmap,
			wled->sink_addr + WLED5_SINK_MOD_SYNC_BIT_REG,
			WLED5_SINK_SYNC_MASK, val);
			WLED_SINK_SYNC_MASK, val);
	/* Update brightness values to modulator in WLED5 */
	if (rc < 0)
		return rc;

	val = 0;
	rc = regmap_update_bits(wled->regmap,
	val = (wled->cfg.mod_sel == MOD_A) ? WLED5_SINK_SYNC_MODA_BIT :
		WLED5_SINK_SYNC_MODB_BIT;
	return regmap_update_bits(wled->regmap,
			wled->sink_addr + WLED5_SINK_MOD_SYNC_BIT_REG,
			WLED_SINK_SYNC_MASK, val);
	return rc;
			WLED5_SINK_SYNC_MASK, val);
}

static int wled4_set_brightness(struct wled *wled, u16 brightness)