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

Commit ef378c4a authored by Jigarkumar Kishorkumar Zala's avatar Jigarkumar Kishorkumar Zala
Browse files

leds: leds-qpnp-flash: add support to reset/deset module



Add support to reset/deset bit for FOLLOW_OTST2_RB when
MASK3 module is enabled.

Change-Id: If14115e4cd007b117b131e5f239254a7049644d1
Signed-off-by: default avatarJigarkumar Kishorkumar Zala <j_zala@codeaurora.org>
parent c049a981
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 {
@@ -1563,7 +1564,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),
@@ -1930,6 +1931,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,
@@ -1958,8 +1965,6 @@ static int qpnp_flash_led_parse_common_dt(
		}
	}

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