Loading Documentation/devicetree/bindings/power/supply/qcom/smb1390-charger-psy.txt +6 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,12 @@ Charger specific properties: Definition: For details about IIO bindings see: Documentation/devicetree/bindings/iio/iio-bindings.txt - qcom,min-ilim-ua Usage: optional Value type: <u32> Definition: Minimum ILIM supported, if requested ILIM goes below this value disable SMB1390. If this values is not specified default minimum ILIM is 1A. ================================================ Second Level Nodes - SMB1390 Charger Peripherals ================================================ Loading drivers/power/supply/qcom/smb1390-charger-psy.c +11 −4 Original line number Diff line number Diff line Loading @@ -170,6 +170,7 @@ struct smb1390 { int die_temp; bool suspended; u32 debug_mask; u32 min_ilim_ua; }; struct smb_irq { Loading Loading @@ -502,8 +503,8 @@ static int smb1390_ilim_vote_cb(struct votable *votable, void *data, return rc; } /* ILIM less than 1A is not accurate; disable charging */ if (ilim_uA < 1000000) { /* ILIM less than min_ilim_ua, disable charging */ if (ilim_uA < chip->min_ilim_ua) { smb1390_dbg(chip, PR_INFO, "ILIM %duA is too low to allow charging\n", ilim_uA); vote(chip->disable_votable, ILIM_VOTER, true, 0); Loading Loading @@ -669,7 +670,7 @@ static void smb1390_taper_work(struct work_struct *work) fcc_uA); vote(chip->fcc_votable, CP_VOTER, true, fcc_uA); if (fcc_uA < 2000000) { if (fcc_uA < (chip->min_ilim_ua * 2)) { vote(chip->disable_votable, TAPER_END_VOTER, true, 0); goto out; Loading Loading @@ -868,9 +869,15 @@ static int smb1390_parse_dt(struct smb1390 *chip) chip->iio.die_temp_chan = NULL; return rc; } } else { return rc; } return rc; chip->min_ilim_ua = 1000000; /* 1A */ of_property_read_u32(chip->dev->of_node, "qcom,min-ilim-ua", &chip->min_ilim_ua); return 0; } static void smb1390_release_channels(struct smb1390 *chip) Loading Loading
Documentation/devicetree/bindings/power/supply/qcom/smb1390-charger-psy.txt +6 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,12 @@ Charger specific properties: Definition: For details about IIO bindings see: Documentation/devicetree/bindings/iio/iio-bindings.txt - qcom,min-ilim-ua Usage: optional Value type: <u32> Definition: Minimum ILIM supported, if requested ILIM goes below this value disable SMB1390. If this values is not specified default minimum ILIM is 1A. ================================================ Second Level Nodes - SMB1390 Charger Peripherals ================================================ Loading
drivers/power/supply/qcom/smb1390-charger-psy.c +11 −4 Original line number Diff line number Diff line Loading @@ -170,6 +170,7 @@ struct smb1390 { int die_temp; bool suspended; u32 debug_mask; u32 min_ilim_ua; }; struct smb_irq { Loading Loading @@ -502,8 +503,8 @@ static int smb1390_ilim_vote_cb(struct votable *votable, void *data, return rc; } /* ILIM less than 1A is not accurate; disable charging */ if (ilim_uA < 1000000) { /* ILIM less than min_ilim_ua, disable charging */ if (ilim_uA < chip->min_ilim_ua) { smb1390_dbg(chip, PR_INFO, "ILIM %duA is too low to allow charging\n", ilim_uA); vote(chip->disable_votable, ILIM_VOTER, true, 0); Loading Loading @@ -669,7 +670,7 @@ static void smb1390_taper_work(struct work_struct *work) fcc_uA); vote(chip->fcc_votable, CP_VOTER, true, fcc_uA); if (fcc_uA < 2000000) { if (fcc_uA < (chip->min_ilim_ua * 2)) { vote(chip->disable_votable, TAPER_END_VOTER, true, 0); goto out; Loading Loading @@ -868,9 +869,15 @@ static int smb1390_parse_dt(struct smb1390 *chip) chip->iio.die_temp_chan = NULL; return rc; } } else { return rc; } return rc; chip->min_ilim_ua = 1000000; /* 1A */ of_property_read_u32(chip->dev->of_node, "qcom,min-ilim-ua", &chip->min_ilim_ua); return 0; } static void smb1390_release_channels(struct smb1390 *chip) Loading