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

Commit 35afb780 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-flash: add support to reset/deset module"

parents 127c764c ef378c4a
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -57,6 +57,9 @@ Optional properties:
- qcom,duration			: Duration for flash LED. When duration time expires, hardware
				will turn off flash LED. Values should be from 10 ms to 1280 ms
				with 10 ms incremental step. Not applicable to torch.
- qcom,follow-otst2-rb-disabled	: Boolean type. This allows driver to reset/deset module.
				By default, driver resets module. This entry allows driver to
				bypass reset module sequence.

Required properties inside child node. Chile node contains settings for each individual LED.
Each LED hardware needs a node for itself and a switch node to control brightness.
+8 −3
Original line number Diff line number Diff line
@@ -204,6 +204,7 @@ struct flash_led_platform_data {
	bool				hdrm_sns_ch1_en;
	bool				power_detect_en;
	bool				mask3_en;
	bool				follow_rb_disable;
};

struct qpnp_flash_led_buffer {
@@ -1589,7 +1590,7 @@ static int qpnp_flash_led_init_settings(struct qpnp_flash_led *led)
		return rc;
	}

	if (led->pdata->mask3_en) {
	if (led->pdata->mask3_en && led->pdata->follow_rb_disable) {
		rc = spmi_ext_register_readl(led->spmi_dev->ctrl,
				led->spmi_dev->sid,
				FLASH_PERPH_RESET_CTRL(led->base),
@@ -1956,6 +1957,12 @@ static int qpnp_flash_led_parse_common_dt(
	led->pdata->power_detect_en = of_property_read_bool(node,
						"qcom,power-detect-enabled");

	led->pdata->mask3_en = of_property_read_bool(node,
						"qcom,otst2-module-enabled");

	led->pdata->follow_rb_disable = of_property_read_bool(node,
						"qcom,follow-otst2-rb-disabled");

	led->pinctrl = devm_pinctrl_get(&led->spmi_dev->dev);
	if (IS_ERR_OR_NULL(led->pinctrl)) {
		dev_err(&led->spmi_dev->dev,
@@ -1984,8 +1991,6 @@ static int qpnp_flash_led_parse_common_dt(
		}
	}

	led->pdata->mask3_en = of_property_read_bool(node,
						"qcom,otst2-module-enabled");
	return 0;
}