Merge "dev: pqnp_wled: change max precharge time to 500us"
diff --git a/dev/qpnp_wled/include/qpnp_wled.h b/dev/qpnp_wled/include/qpnp_wled.h
index d90ca0b..4ca2379 100644
--- a/dev/qpnp_wled/include/qpnp_wled.h
+++ b/dev/qpnp_wled/include/qpnp_wled.h
@@ -167,6 +167,11 @@
#define QPNP_WLED_LAB_FAST_PC_MASK 0xFB
#define QPNP_WLED_LAB_START_DLY_US 8
#define QPNP_WLED_LAB_FAST_PC_SHIFT 2
+#define QPNP_WLED_PRECHARGE_MASK 0xFC
+#define QPNP_WLED_PRECHARGE_US200 0x00
+#define QPNP_WLED_PRECHARGE_US300 0x01
+#define QPNP_WLED_PRECHARGE_US400 0x02
+#define QPNP_WLED_PRECHARGE_US500 0x03
#define QPNP_WLED_SEC_ACCESS_REG(b) (b + 0xD0)
#define QPNP_WLED_SEC_UNLOCK 0xA5
@@ -282,6 +287,7 @@
bool disp_type_amoled;
bool ibb_bias_active;
bool lab_fast_precharge;
+ uint8_t lab_max_precharge_time;
uint32_t lab_min_volt;
uint32_t lab_max_volt;
uint32_t ibb_min_volt;
diff --git a/dev/qpnp_wled/qpnp_wled.c b/dev/qpnp_wled/qpnp_wled.c
index ad2f5d5..9282a7b 100644
--- a/dev/qpnp_wled/qpnp_wled.c
+++ b/dev/qpnp_wled/qpnp_wled.c
@@ -475,6 +475,9 @@
QPNP_WLED_LAB_FAST_PC_REG(wled->lab_base));
reg &= QPNP_WLED_LAB_FAST_PC_MASK;
reg |= (wled->lab_fast_precharge << QPNP_WLED_LAB_FAST_PC_SHIFT);
+ /* LAB max precharge time */
+ reg &= QPNP_WLED_PRECHARGE_MASK;
+ reg |= (wled->lab_max_precharge_time);
pm8x41_wled_reg_write(QPNP_WLED_LAB_FAST_PC_REG(wled->lab_base), reg);
/* Configure lab display type */
@@ -573,6 +576,7 @@
wled->ibb_bias_active = false;
wled->lab_fast_precharge = false;
+ wled->lab_max_precharge_time = QPNP_WLED_PRECHARGE_US500;
wled->ibb_pwrup_dly_ms = config->pwr_up_delay;
wled->ibb_pwrdn_dly_ms = config->pwr_down_delay;
wled->ibb_discharge_en = config->ibb_discharge_en;