Skip to content

FROMLIST: power: supply: qcom_battmgr: Add multi-port USB-C power supply support - #884

Open
raryan-qcom wants to merge 1 commit into
qualcomm-linux:qcom-6.18.yfrom
raryan-qcom:for-battmgr
Open

FROMLIST: power: supply: qcom_battmgr: Add multi-port USB-C power supply support#884
raryan-qcom wants to merge 1 commit into
qualcomm-linux:qcom-6.18.yfrom
raryan-qcom:for-battmgr

Conversation

@raryan-qcom

@raryan-qcom raryan-qcom commented Aug 1, 2026

Copy link
Copy Markdown

Extend the qcom_battmgr driver to report up to MAX_USB_PORTS (3) USB-C power supply ports on the X1E80100 & Glymur platform, which exposes more than one charger port to firmware.

At firmware-enable time, query USB_NUM_PORTS over the existing BATTMGR_USB_PROPERTY_GET opcode to discover how many ports the firmware actually reports, and register the additional "qcom-battmgr-usb2"/"qcom-battmgr-usb3" power supplies only when the firmware confirms a second/third port. Each additional port is polled independently via new BATTMGR_USB2_PROPERTY_GET/SET (0xC0/0xC1) and BATTMGR_USB3_PROPERTY_GET/SET (0xC2/0xC3) opcodes so its properties are not aliased to the primary port's state.

Also add the POWER_SUPPLY_PROP_CAPACITY entry to x1e80100_bat_props[].

Link: https://lore.kernel.org/all/20260801-b4-battmgr-multiport-usb-v1-1-89d90bf5de1f@oss.qualcomm.com/
Assisted-by: Claude:claude-sonnet-5

CRs-Fixed: 4630144

@qswat-orbit-external

Copy link
Copy Markdown

Merge Check Failed: No CR Numbers Found

Error: No Change Request numbers were found.

Please add Change Request numbers to your pull request description in the format CRs-Fixed: 12345 or link GitHub issues that are associated with Change Requests.

@qswat-orbit-external

Copy link
Copy Markdown

Merge Check Failed: CR Not Eligible for Merge

CR 4630144 is not eligible for merge.

The parent software image for kernel.qli.2.0 is not development complete.

Entity: kernel.qli.2.0
CR: 4630144
Reason: CR_CANNOT_MERGE

Please ensure the CR passes both CCT (ComponentChangeTasks) and ICT (Integration Change Tasks) validations.

@qlijarvis

Copy link
Copy Markdown

PR #884 — validate-patch

PR: #884

Verdict Issues Detailed Report
0 Full report

Final Summary

  1. Lore link present: Yes — https://lore.kernel.org/all/20260801-b4-battmgr-multiport-usb-v1-1-89d90bf5de1f@oss.qualcomm.com/
  2. Lore link matches PR commits: Yes — diff content fingerprint identical; hunk line numbers differ due to context (expected for FROMLIST on different base)
  3. Upstream patch status: In review — posted 2026-08-01 to linux-arm-msm@vger.kernel.org; no maintainer decision yet
  4. PR present in qcom-next/topics: Partial - 1/1 commit(s) only have partial integration evidence
Verdict: ✅ — click to expand

🔍 Patch Validation

PR: #884 - FROMLIST: power: supply: qcom_battmgr: Add multi-port USB-C power supply support
Upstream commit: https://lore.kernel.org/all/20260801-b4-battmgr-multiport-usb-v1-1-89d90bf5de1f@oss.qualcomm.com/
Verdict: ✅ PASS

Commit Message

Check Status Note
Subject matches upstream Subject correctly prefixed with FROMLIST:
Body preserves rationale Body text identical to lore patch
Fixes tag present/correct N/A No Fixes tag in upstream patch
Authorship preserved From: matches lore author (Kamal Wadhwa) - correct for FROMLIST
Backport note (if applicable) N/A FROMLIST commit, not a backport
Link tag present Correct lore.kernel.org link included
Assisted-by tag Present in both PR and lore patch

Diff

File Status Notes
drivers/power/supply/qcom_battmgr.c Diff content identical (fingerprint match: 758fa329ed15dea610bcf2b34829d17b); hunk line numbers differ due to different base tree (expected for FROMLIST)

Upstream Patch Status

Commit Community Verdict
power: supply: qcom_battmgr: Add multi-port USB-C power supply support ⏳ Decision Pending — posted 2026-08-01; no maintainer replies yet; thread contains only the original posting

qcom-next/topics Presence

Commit Status
FROMLIST: power: supply: qcom_battmgr: Add multi-port USB-C ⚠️ Partial — subject or partial tree evidence found in qcom-next, but full change not verified; missing from topics

Verdict

Merge as-is. The PR commit faithfully represents the lore patch with correct FROMLIST prefix, matching authorship, identical diff content, and proper Link tag. The hunk line number differences are legitimate context shifts due to different base tree states.

Final Summary

  1. Lore link present: Yes — https://lore.kernel.org/all/20260801-b4-battmgr-multiport-usb-v1-1-89d90bf5de1f@oss.qualcomm.com/
  2. Lore link matches PR commits: Yes — diff content fingerprint identical; hunk line numbers differ due to context (expected for FROMLIST on different base)
  3. Upstream patch status: In review — posted 2026-08-01 to linux-arm-msm@vger.kernel.org; no maintainer decision yet
  4. PR present in qcom-next/topics: Partial — subject or partial tree evidence found in qcom-next (ref 8d5dbc1), but full change not verified; missing from topics

Deterministic Integration Presence

Integration Presence Report

This report is generated by Jarvis before validate-patch runs.
It is the authoritative source for whether PR changes are already present
in qcom-next or in the kernel topic branches.

Kernel repo: /local/mnt/workspace/sgaud/Qgenie/image_pipeline/kernel
qcom-next ref: 8d5dbc1b17adf8fe86a41adcda686785e73f5414
topics remote: topics -> https://github.com/qualcomm-linux/kernel-topics
topics fetch: fetched

Commit Subject qcom-next topics Final
1/1 [PATCH] FROMLIST: power: supply: qcom_battmgr: Add multi-port USB-C partial - subject or partial tree evidence found, but full change was not verified missing - no subject, patch-id, or full tree-content match found partial

Final Status

overall_status: PARTIAL
present_commits: 0/1
partial_commits: 1/1
missing_commits: 0/1
topics_checked_for_commits: 1/1
final_summary: PR present in qcom-next/topics: Partial - 1/1 commit(s) only have partial integration evidence

@qlijarvis

Copy link
Copy Markdown

PR #884 — checker-log-analyzer

PR: #884
Checker run: https://github.com/qualcomm-linux/kernel-config/actions/runs/30692194972

Checker Result Summary
Checker Result Summary
checkpatch ⚠️ 3 alignment style checks
dt-binding-check ⏭️ No DT binding changes
dtb-check ⏭️ No devicetree changes
sparse-check Passed
check-uapi-headers No UAPI changes
check-patch-compliance Passed
tag-check Valid FROMLIST: prefix

Detailed report: Full report

Checker analysis — click to expand

🤖 CI Checker Analysis (checker-log-analyzer)

PR: #884 - FROMLIST: power: supply: qcom_battmgr: Add multi-port USB-C power supply support
Source: https://github.com/qualcomm-linux/kernel-config/actions/runs/30692194972
Target branch: qcom-6.18.y

Checker Result Summary
checkpatch ⚠️ 3 alignment style checks
dt-binding-check ⏭️ No DT binding changes
dtb-check ⏭️ No devicetree changes
sparse-check Passed
check-uapi-headers No UAPI changes
check-patch-compliance Passed
tag-check Valid FROMLIST: prefix

⚠️ checkpatch

Root cause: Three alignment style warnings where function call arguments don't align with the opening parenthesis.

Failure details:

CHECK: Alignment should match open parenthesis
#450: FILE: drivers/power/supply/qcom_battmgr.c:1916:
+		ret = qcom_battmgr_request_property(battmgr, BATTMGR_USB_PROPERTY_GET,
+						     USB_NUM_PORTS, 0);

CHECK: Alignment should match open parenthesis
#466: FILE: drivers/power/supply/qcom_battmgr.c:1932:
+			psy = devm_power_supply_register(battmgr->dev, &x1e80100_usb2_psy_desc,
+							  &battmgr->usb_psy_cfg);

CHECK: Alignment should match open parenthesis
#477: FILE: drivers/power/supply/qcom_battmgr.c:1943:
+			psy = devm_power_supply_register(battmgr->dev, &x1e80100_usb3_psy_desc,
+							  &battmgr->usb_psy_cfg);

7677c98dfb286a95076bdfab4350b2102e105e5a total: 0 errors, 0 warnings, 3 checks, 458 lines checked

Fix: Adjust the indentation of continuation lines to align with the opening parenthesis:

git rebase -i 1bc9614caed6d787783330f1fbd09003ff6a9741
# mark commit as 'edit'

# Fix alignment in drivers/power/supply/qcom_battmgr.c:
# Line 1916-1917:
ret = qcom_battmgr_request_property(battmgr, BATTMGR_USB_PROPERTY_GET,
				    USB_NUM_PORTS, 0);

# Line 1932-1933:
psy = devm_power_supply_register(battmgr->dev, &x1e80100_usb2_psy_desc,
				 &battmgr->usb_psy_cfg);

# Line 1943-1944:
psy = devm_power_supply_register(battmgr->dev, &x1e80100_usb3_psy_desc,
				 &battmgr->usb_psy_cfg);

git add drivers/power/supply/qcom_battmgr.c
git commit --amend --no-edit
git rebase --continue

Reproduce locally:

./scripts/checkpatch.pl --strict --ignore FILE_PATH_CHANGES --git 1bc9614caed6d787783330f1fbd09003ff6a9741..7677c98dfb286a95076bdfab4350b2102e105e5a

✅ All other checkers passed

  • dt-binding-check: Skipped (no changes in Documentation/devicetree/bindings)
  • dtb-check: Skipped (no devicetree changes)
  • sparse-check: Passed (no static analysis warnings)
  • check-uapi-headers: Passed (no UAPI header changes)
  • check-patch-compliance: Passed (valid FROMLIST: prefix, valid lore link, no author mismatch)
  • tag-check: Passed (commit subject starts with FROMLIST:, which is required for qcom-6.18.y branch)

Verdict

3 minor style issues to fix before merge. The checkpatch alignment warnings are cosmetic but should be addressed to maintain kernel coding style consistency. All functional checkers passed cleanly.

Note: The commit includes an Assisted-by: Claude:claude-sonnet-5 trailer, which is non-standard for kernel commits. While not flagged by the checkers, consider whether this should be retained for upstream submission or removed to match typical kernel commit conventions.

…ply support

Extend the qcom_battmgr driver to report up to MAX_USB_PORTS (3)
USB-C power supply ports on the X1E80100 & Glymur platform, which
exposes more than one charger port to firmware.

At firmware-enable time, query USB_NUM_PORTS over the existing
BATTMGR_USB_PROPERTY_GET opcode to discover how many ports the
firmware actually reports, and register the additional
"qcom-battmgr-usb2"/"qcom-battmgr-usb3" power supplies only when the
firmware confirms a second/third port. Each additional port is polled
independently via new BATTMGR_USB2_PROPERTY_GET/SET (0xC0/0xC1) and
BATTMGR_USB3_PROPERTY_GET/SET (0xC2/0xC3) opcodes so its properties
are not aliased to the primary port's state.

X1E80100 ports report their USB-C adapter type on USB_ADAP_TYPE
rather than the SM8350/SC8280XP USB_TYPE property, so add a dedicated
x1e80100_usb_prop_map[] mapping POWER_SUPPLY_PROP_USB_TYPE to
USB_ADAP_TYPE, and use it for all three X1E80100 USB ports.

Give the primary X1E80100 USB port its own update/get_property
callback (qcom_battmgr_usb_x1e80100_update()/
qcom_battmgr_usb_x1e80100_get_property()) instead of routing it
through the SC8280XP battery-status update path, mirroring the
pattern already used for the usb2/usb3 ports.

Also add the POWER_SUPPLY_PROP_CAPACITY entry to x1e80100_bat_props[].

Link: https://lore.kernel.org/all/20260806-b4-battmgr-multiport-usb-v2-1-1a6dd1e06cc2@oss.qualcomm.com/
Assisted-by: Claude:claude-sonnet-5
Signed-off-by: Kamal Wadhwa <kamal.wadhwa@oss.qualcomm.com>
@qlijarvis

Copy link
Copy Markdown

PR #884 — validate-patch

PR: #884

Verdict Issues Detailed Report
0 Full report

Final Summary

  1. Lore link present: Yes - https://lore.kernel.org/all/20260806-b4-battmgr-multiport-usb-v2-1-1a6dd1e06cc2@oss.qualcomm.com/
  2. Lore link matches PR commits: Yes - commit message body, trailers (including Assisted-by: Claude:claude-sonnet-5), and diff content are identical; index line difference is expected due to different base commits
  3. Upstream patch status: ⏳ In review - patch posted to linux-arm-msm@vger.kernel.org on 2026-08-06 (1 day ago); no maintainer response yet; no acceptance/rejection signals found in thread
  4. PR present in qcom-next/topics: Partial - 1/1 commit(s) only have partial integration evidence
Verdict: ✅ — click to expand

🔍 Patch Validation

PR: #884 - FROMLIST: power: supply: qcom_battmgr: Add multi-port USB-C power supply support
Upstream commit: https://lore.kernel.org/all/20260806-b4-battmgr-multiport-usb-v2-1-1a6dd1e06cc2@oss.qualcomm.com/
Verdict: ✅ PASS

Commit Message

Check Status Note
Subject matches upstream Subject identical except for FROMLIST: prefix (expected)
Body preserves rationale Full commit message body preserved verbatim
Fixes tag present/correct N/A No Fixes tag in upstream patch
Authorship preserved From: matches lore author (Kamal Wadhwa kamal.wadhwa@oss.qualcomm.com)
Backport note (if applicable) N/A Not a backport - FROMLIST: prefix indicates pending upstream patch

Diff

File Status Notes
drivers/power/supply/qcom_battmgr.c Code changes identical; index lines differ due to different base commits (ff77dba29a3ef vs 490137a23d00) - expected for integration into different tree

Issues

None. The PR faithfully represents the upstream lore patch with appropriate FROMLIST: prefix.

Verdict

Merge as-is. The patch is a faithful representation of the v2 upstream submission with correct authorship, complete commit message, and identical code changes. The FROMLIST: prefix is appropriate for a patch posted to the mailing list but not yet merged upstream.

Final Summary

  1. Lore link present: Yes - https://lore.kernel.org/all/20260806-b4-battmgr-multiport-usb-v2-1-1a6dd1e06cc2@oss.qualcomm.com/
  2. Lore link matches PR commits: Yes - commit message body, trailers (including Assisted-by: Claude:claude-sonnet-5), and diff content are identical; index line difference is expected due to different base commits
  3. Upstream patch status: ⏳ In review - patch posted to linux-arm-msm@vger.kernel.org on 2026-08-06 (1 day ago); no maintainer response yet; no acceptance/rejection signals found in thread
  4. PR present in qcom-next/topics: Partial - subject or partial tree evidence found in qcom-next/topics, but full change not verified (per integration_presence_report.md)

Deterministic Integration Presence

Integration Presence Report

This report is generated by Jarvis before validate-patch runs.
It is the authoritative source for whether PR changes are already present
in qcom-next or in the kernel topic branches.

Kernel repo: /local/mnt/workspace/sgaud/Qgenie/image_pipeline/kernel
qcom-next ref: 8d5dbc1b17adf8fe86a41adcda686785e73f5414
topics remote: topics -> https://github.com/qualcomm-linux/kernel-topics
topics fetch: fetched

Commit Subject qcom-next topics Final
1/1 [PATCH] FROMLIST: power: supply: qcom_battmgr: Add multi-port USB-C partial - subject or partial tree evidence found, but full change was not verified partial - subject or partial tree evidence found, but full change was not verified partial

Final Status

overall_status: PARTIAL
present_commits: 0/1
partial_commits: 1/1
missing_commits: 0/1
topics_checked_for_commits: 1/1
final_summary: PR present in qcom-next/topics: Partial - 1/1 commit(s) only have partial integration evidence

@qlijarvis

Copy link
Copy Markdown

PR #884 — checker-log-analyzer

PR: #884
Checker run: https://github.com/qualcomm-linux/kernel-config/actions/runs/31153098955

Checker Result Summary
Checker Result Summary
checkpatch 9 alignment style checks
dt-binding-check ⏭️ No DT binding changes
dtb-check ⏭️ No devicetree changes
sparse-check Passed
check-uapi-headers Passed
check-patch-compliance Passed
tag-check Subject has valid FROMLIST: prefix

Detailed report: Full report

Checker analysis — click to expand

🤖 CI Checker Analysis (checker-log-analyzer)

PR: #884 - FROMLIST: power: supply: qcom_battmgr: Add multi-port USB-C power supply support
Source: https://github.com/qualcomm-linux/kernel-config/actions/runs/31153098955

Checker Result Summary
checkpatch 9 alignment style checks
dt-binding-check ⏭️ No DT binding changes
dtb-check ⏭️ No devicetree changes
sparse-check Passed
check-uapi-headers Passed
check-patch-compliance Passed
tag-check Subject has valid FROMLIST: prefix

❌ checkpatch

Root cause: Nine alignment style violations where function arguments don't align with the opening parenthesis.

Failure details:

CHECK: Alignment should match open parenthesis
#657: FILE: drivers/power/supply/qcom_battmgr.c:2126:
+		battmgr->wls_psy = devm_power_supply_register(dev, &sc8280xp_wls_psy_desc,
+								&psy_cfg_supply);

CHECK: Alignment should match open parenthesis
#663: FILE: drivers/power/supply/qcom_battmgr.c:2132:
+		battmgr->bat_psy = devm_power_supply_register(dev, &x1e80100_bat_psy_desc,
+								&psy_cfg);

CHECK: Alignment should match open parenthesis
#669: FILE: drivers/power/supply/qcom_battmgr.c:2138:
+		battmgr->ac_psy = devm_power_supply_register(dev, &sc8280xp_ac_psy_desc,
+								&psy_cfg_supply);

CHECK: Alignment should match open parenthesis
#675: FILE: drivers/power/supply/qcom_battmgr.c:2144:
+		battmgr->usb_psy = devm_power_supply_register(dev, &x1e80100_usb_psy_desc,
+								&psy_cfg_supply);

[... 5 more similar alignment checks ...]

3251c1f5c05692adb8c1428f1722d2c87cec4f9d total: 0 errors, 0 warnings, 9 checks, 618 lines checked

Fix: Align the second argument with the opening parenthesis of devm_power_supply_register(). The continuation line should start at the same column as the first argument after the opening (.

Example fix for line 2126:

// Current (incorrect):
battmgr->wls_psy = devm_power_supply_register(dev, &sc8280xp_wls_psy_desc,
                                               &psy_cfg_supply);

// Correct alignment:
battmgr->wls_psy = devm_power_supply_register(dev, &sc8280xp_wls_psy_desc,
                                               &psy_cfg_supply);

Apply the same fix pattern to all 9 occurrences in drivers/power/supply/qcom_battmgr.c:2126.

Reproduce locally:

./scripts/checkpatch.pl --strict --ignore FILE_PATH_CHANGES --git 8635749eab9a8a3a2e3533b2077d70c8b16857ba..366aae453e97dd83daf484ad1863aa1cf48f954a

Fix command:

git rebase -i 8635749eab9a8a3a2e3533b2077d70c8b16857ba   # mark commit 3251c1f5c056 as 'edit'
# Edit drivers/power/supply/qcom_battmgr.c to fix alignment
git add drivers/power/supply/qcom_battmgr.c
git commit --amend --no-edit
git rebase --continue

Verdict

9 style checks to fix before merge. These are CHECK: level issues (not ERROR: or WARNING:), which means they are coding style recommendations rather than hard blockers. However, kernel maintainers expect strict adherence to alignment rules, especially for new code.

The alignment fixes are mechanical and straightforward — adjust the indentation of continuation lines to match the opening parenthesis. All other checkers passed cleanly, including the critical check-patch-compliance which verified the FROMLIST: prefix and Link: tag are correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants