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

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

Merge "leds: qpnp-flash-v2: Fix low current configuration for PM8150L"

parents fa062a8f 0c9f6e95
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -188,6 +188,10 @@ enum strobe_type {
	LPG_STROBE,
};

enum wa_flags {
	PM8150L_IRES_WA = BIT(0),
};

/*
 * Configurations for each individual LED
 */
@@ -286,6 +290,7 @@ struct qpnp_flash_led {
	int				num_snodes;
	int				enable;
	int				total_current_ma;
	u32				wa_flags;
	u16				base;
	bool				trigger_lmh;
	bool				trigger_chgr;
@@ -1028,7 +1033,12 @@ static void qpnp_flash_led_node_set(struct flash_node_data *fnode, int value)
				break;
			}
		}
	} else if (prgm_current_ma <= 20 &&
			(led->wa_flags & PM8150L_IRES_WA)) {
		fnode->ires_idx = FLASH_LED_IRES_BASE;
		fnode->ires_ua = FLASH_LED_IRES_MIN_UA;
	}

	fnode->current_ma = prgm_current_ma;
	fnode->cdev.brightness = prgm_current_ma;
	fnode->current_reg_val = get_current_reg_code(prgm_current_ma,
@@ -1927,6 +1937,9 @@ static int qpnp_flash_led_parse_common_dt(struct qpnp_flash_led *led,
		led->pdata->pmic_rev_id->pmic_subtype,
		led->pdata->pmic_rev_id->rev4);

	if (led->pdata->pmic_rev_id->pmic_subtype == PM8150L_SUBTYPE)
		led->wa_flags |= PM8150L_IRES_WA;

	led->pdata->hdrm_auto_mode_en = of_property_read_bool(node,
							"qcom,hdrm-auto-mode");