Loading Documentation/devicetree/bindings/leds/leds-qpnp-wled.txt +2 −0 Original line number Diff line number Diff line Loading @@ -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 { Loading drivers/leds/leds-qpnp-wled.c +12 −0 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -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; Loading Loading @@ -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, ®, QPNP_WLED_SYNC_REG(wled->sink_base)); Loading Loading @@ -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, Loading Loading
Documentation/devicetree/bindings/leds/leds-qpnp-wled.txt +2 −0 Original line number Diff line number Diff line Loading @@ -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 { Loading
drivers/leds/leds-qpnp-wled.c +12 −0 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -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; Loading Loading @@ -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, ®, QPNP_WLED_SYNC_REG(wled->sink_base)); Loading Loading @@ -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, Loading