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

Commit f7abbafc authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "leds: leds-qpnp-wled: add delay between consecutive writes to WLED SYNC"

parents df52f22f 8328758b
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -46,6 +46,8 @@ Optional properties for WLED:
			  are operated individually. specify the list of strings used by the device.
			  any combination of led strings can be used. default value is [00 01 02 03]
- qcom,en-ext-pfet-sc-pro : Specify if external pfet short circuit protection is needed
- qcom,cons-sync-write-delay-us : Specify in 'us' the duration of delay between two consecutive writes to
				  SYNC register.

Example:
	qcom,leds@d800 {
+12 −0
Original line number Diff line number Diff line
@@ -212,6 +212,7 @@ static u8 qpnp_wled_sink_dbg_regs[] = {
 *  @ fs_curr_ua - full scale current in ua
 *  @ ramp_ms - delay between ramp steps in ms
 *  @ ramp_step - ramp step size
 *  @ cons_sync_write_delay_us - delay between two consecutive writes to SYNC
 *  @ strings - supported list of strings
 *  @ num_strings - number of strings
 *  @ en_9b_dim_res - enable or disable 9bit dimming
@@ -245,6 +246,7 @@ struct qpnp_wled {
	u16 fs_curr_ua;
	u16 ramp_ms;
	u16 ramp_step;
	u16 cons_sync_write_delay_us;
	u8 strings[QPNP_WLED_MAX_STRINGS];
	u8 num_strings;
	bool en_9b_dim_res;
@@ -328,6 +330,10 @@ static int qpnp_wled_set_level(struct qpnp_wled *wled, int level)
	if (rc < 0)
		return rc;

	if (wled->cons_sync_write_delay_us)
		usleep_range(wled->cons_sync_write_delay_us,
				wled->cons_sync_write_delay_us + 1);

	reg = QPNP_WLED_SYNC_RESET;
	rc = qpnp_wled_write_reg(wled, &reg,
		QPNP_WLED_SYNC_REG(wled->sink_base));
@@ -1276,6 +1282,12 @@ static int qpnp_wled_parse_dt(struct qpnp_wled *wled)
		return rc;
	}

	wled->cons_sync_write_delay_us = 0;
	rc = of_property_read_u32(spmi->dev.of_node,
			"qcom,cons-sync-write-delay-us", &temp_val);
	if (!rc)
		wled->cons_sync_write_delay_us = temp_val;

	wled->en_9b_dim_res = of_property_read_bool(spmi->dev.of_node,
			"qcom,en-9b-dim-res");
	wled->en_phase_stag = of_property_read_bool(spmi->dev.of_node,