Re: [PATCH v2 2/2] power: supply: qcom_smbx: add SMB5 support
From: Krzysztof Kozlowski
Date: Thu Aug 13 2026 - 04:55:16 EST
On Wed, Aug 12, 2026 at 01:57:00AM +0200, Robin Snyders wrote:
> + if (chip->gen == SMB5) {
> + rc = regmap_update_bits(chip->regmap,
> + chip->base + CHARGING_ENABLE_CMD,
> + CHARGING_ENABLE_CMD_BIT,
> + CHARGING_ENABLE_CMD_BIT);
> + if (rc < 0)
> + return dev_err_probe(chip->dev, rc,
> + "could not enable charging\n");
> +
> + rc = regmap_update_bits(chip->regmap,
> + chip->base + USBIN_CMD_IL,
> + USBIN_SUSPEND_BIT, 0);
> + if (rc < 0)
> + return dev_err_probe(chip->dev, rc,
> + "could not enable USB input\n");
> +
> + devm_remove_action(chip->dev, smb_restore_charge_state, chip);
> + }
>
> platform_set_drvdata(pdev, chip);
> + WRITE_ONCE(chip->probe_complete, true);
No, please do not invent custom probe ordering/synchronization patterns.
If you need this, it means either core is broken or your driver has
issues. In both cases the source must be fixed, not through custom
one-driver solution.
>
> /* Initialise charger state */
> schedule_delayed_work(&chip->status_change_work, 0);
> @@ -1095,8 +1543,10 @@ static int smb_probe(struct platform_device *pdev)
> }
>
> static const struct of_device_id smb_match_id_table[] = {
> - { .compatible = "qcom,pmi8998-charger", .data = "pmi8998" },
> - { .compatible = "qcom,pm660-charger", .data = "pm660" },
> + { .compatible = "qcom,pmi8998-charger", .data = &pmi8998_match_data },
> + { .compatible = "qcom,pm660-charger", .data = &pm660_match_data },
> + { .compatible = "qcom,pm7250b-charger", .data = &pm7250b_match_data },
Your bindings commit msg claims this is fully compatible with pm8150b,
so above is confusing. Is one superset of another? Then it should be
explained in commit msg of the binding.
> + { .compatible = "qcom,pm8150b-charger", .data = &pm8150b_match_data },
> { /* sentinal */ }
> };
> MODULE_DEVICE_TABLE(of, smb_match_id_table);
> @@ -1112,5 +1562,5 @@ static struct platform_driver qcom_spmi_smb = {
> module_platform_driver(qcom_spmi_smb);
>
> MODULE_AUTHOR("Casey Connolly <casey.connolly@xxxxxxxxxx>");
> -MODULE_DESCRIPTION("Qualcomm SMB2 Charger Driver");
> +MODULE_DESCRIPTION("Qualcomm SMB2 and SMB5 Charger Driver");
> MODULE_LICENSE("GPL");
>
> --
> 2.54.0
>
>