Skip to content

Staging/max77978 - #3424

Draft
sean-park-pub wants to merge 3 commits into
mirror_ci/jic23/iio/testingfrom
staging/max77978
Draft

Staging/max77978#3424
sean-park-pub wants to merge 3 commits into
mirror_ci/jic23/iio/testingfrom
staging/max77978

Conversation

@sean-park-pub

Copy link
Copy Markdown
Collaborator

PR Description

  • Please replace this comment with a summary of your changes, and add any context
    necessary to understand them. List any dependencies required for this change.
  • To check the checkboxes below, insert a 'x' between square brackets (without
    any space), or simply check them after publishing the PR.
  • If you changes include a breaking change, please specify dependent PRs in the
    description and try to push all related PRs simultaneously.

PR Type

  • Bug fix (a change that fixes an issue)
  • New feature (a change that adds new functionality)
  • Breaking change (a change that affects other repos or cause CIs to fail)

PR Checklist

  • I have conducted a self-review of my own code changes
  • I have compiled my changes, including the documentation
  • I have tested the changes on the relevant hardware
  • I have updated the documentation outside this repo accordingly
  • I have provided links for the relevant upstream lore

@gastmaier
gastmaier changed the base branch from main to mirror_ci/jic23/iio/testing July 8, 2026 14:22
@gastmaier gastmaier closed this Jul 8, 2026
@gastmaier gastmaier reopened this Jul 8, 2026
@gastmaier

Copy link
Copy Markdown
Collaborator

Hi. Changed the merge target to mirror_ci/jic23/iio/testing.
Please ignore the Azure pipelines results.
Only consider the GitHub Actions output

There a lot of direct actionable auto-checker that needs to be addressed
https://github.com/analogdevicesinc/linux/actions/runs/28950047520/job/85894059869?pr=3424
starting from stylistic issues:

#2008: FILE: drivers/usb/typec/maxim/Kconfig:131:
Error: checkpatch: trailing whitespace
+^I  Say yes here to add support for Maxim Integrated MAX77958. $

Some annotations shows in the File changed tab too; but is limited to the N-first warnings, are there are more. check the ci/cd output

@gastmaier
gastmaier marked this pull request as draft July 8, 2026 14:49
@gastmaier gastmaier added the llm review Request a review from a LLM Reviewer label Jul 8, 2026
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

LLM review

This series adds the MAX77978 USB Type-C CC/PD controller driver under drivers/usb/typec/maxim/, including core I2C, IRQ, CC, PD, BC1.2, alternate-mode and debug sub-drivers.

run: 28953806165

c50f7f0 - max77978 upstream for v1.2.1

Critical build failure — missing MAX77775 source files:

drivers/usb/typec/maxim/Kconfig introduces config CCIC_MAX77775 and the Makefile references max77775_cc.o, max77775_pd.o, max77775_usbc.o, max77775_alternate.o — none of which exist in the tree. auto_set_kconfig enables CONFIG_CCIC_MAX77775=y because the Kconfig block was touched, causing every build job to fail:

make[7]: *** No rule to make target 'drivers/usb/typec/maxim/max77775_cc.o',
         needed by 'drivers/usb/typec/maxim/built-in.a'.  Stop.

This was confirmed by reproducing the build for gcc_aarch64 and gcc_x86. The MAX77775 Kconfig/Makefile entries must be removed (or the corresponding source files must be included) to unblock CI.

Wrong architecture defconfig:

arch/arm64/configs/my_defconfig is stored under arm64/configs/ but its header reads # Linux/x86 6.12.30 Kernel Configuration and enables CONFIG_X86_32=y. This is an x86 config misplaced in the arm64 tree.

Checkpatch errors (strict):

Three lines in Kconfig have trailing whitespace (lines 123, 131, 142) causing checkpatch ERROR: trailing whitespace failures.

Coccicheck warnings:

18 request_threaded_irq() calls in max77978-cc.c (7), max77978-pd.c (3), max77978-bc12.c (6), and max77978-usbc.c (2) pass flags=0 without IRQF_ONESHOT. These are nested IRQs (registered with irq_set_nested_thread()) so the code is technically correct, but adding IRQF_ONESHOT makes intent explicit and silences coccicheck.

Additional issues (not CI-blocking but must be resolved before upstream):

  • CONFIG_ADIENV is referenced in multiple files but never defined in any Kconfig — dead code in upstream builds
  • Multiple typedefs for structs/enums violate kernel coding style
  • Global singleton g_usbc_data prevents multi-instance use
  • No DT binding YAML for adi,max77978 compatible string
  • MAINTAINERS not updated
  • create_singlethread_workqueue() should be alloc_ordered_workqueue()
  • sprintf() with unbounded caller name in max77978_i2c_bulk() (should be snprintf)
  • container_of(dev, struct i2c_client, dev) should use to_i2c_client()

CI warnings

The checkpatch warnings for Kconfig help paragraphs being shorter than 4 lines affect the MAX77775 entries; removing those entries (required to fix the build) will also resolve these warnings.

Verification data

  • Build failures reproduced locally with set_arch gcc_aarch64 + auto_set_kconfig + make drivers/usb/typec/maxim/ — confirmed max77775_cc.o missing
  • Build passes after disabling CONFIG_CCIC_MAX77775 and applying the two fixup patches
  • perl scripts/checkpatch.pl --no-tree -f drivers/usb/typec/maxim/Kconfig confirmed trailing whitespace errors and help-length warnings
  • irq_set_nested_thread() verified in max77978-irq.c:293 — sub-IRQs are nested threads

Suggested patches

Apply the suggested patches with:

cd path/to/repository
export GITHUB_TOKEN=ghp_***
apply-patches --repo=analogdevicesinc/linux 28953806165
Install instructions

The following one-liner installs the script if not present already:

curl -fSsL "https://raw.githubusercontent.com/analogdevicesinc/doctools/refs/heads/main/ci/scripts/apply-patches.sh"      -o ~/.local/bin/apply-patches.sh &&   grep -q "/apply-patches.sh" ~/.bashrc || echo "source ~/.local/bin/apply-patches.sh" >> $_ ; . $_

More information at AI Usage.

@gastmaier
gastmaier force-pushed the mirror_ci/jic23/iio/testing branch from b75697e to 4e928e1 Compare July 10, 2026 00:02
@gastmaier
gastmaier force-pushed the mirror_ci/jic23/iio/testing branch 4 times, most recently from 831d618 to a942294 Compare July 14, 2026 00:08
@gastmaier
gastmaier force-pushed the mirror_ci/jic23/iio/testing branch 4 times, most recently from 6c4206e to 177ff1f Compare July 18, 2026 00:00
@gastmaier
gastmaier force-pushed the mirror_ci/jic23/iio/testing branch 4 times, most recently from c3dd66c to 84198ca Compare July 22, 2026 00:00
@gastmaier gastmaier self-assigned this Jul 22, 2026
Signed-off-by: Park, Sean <Sean.Park@analog.com>
Signed-off-by: Park, Sean <Sean.Park@analog.com>
Signed-off-by: Park, Sean <Sean.Park@analog.com>

@gastmaier gastmaier left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Sean, I broke down the single commit into three commits:

  • sample defconfig
  • dt-bindings
  • driver

Only dt-bindings and driver commit are meaningful for upstream.
On submission, a series is composed of multiple commits, each adding a change "adds documentation", "adds dt-bindings", "adds driver"

For now, let's focus in the dt-bindings, once you are finished, let me know.

max77978: usb-typec@25 {
compatible = "adi,max77978";
reg = <0x25>;
irq-gpios = <&gpio 27 IRQ_TYPE_LEVEL_LOW>;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

irq-gpio uses GPIO specifiers, not IRQ_*; BUT see my interrupt comment [1]

Comment on lines +24 to +25
interrupts:
maxItems: 1

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[1]
This is never used by the driver and seems to be duplication from irq-gpios, which is actually used at max77978-core.c#362 .

BUT the preferable approach is to use interrupts, with irq-gpios you are saying that your device must use a interrupt from a gpio, which is untrue.

The correct semantic is the user sets interrupt-parent pointing to who provides the interrupt, in this case a gpio controller:


      max77978: usb-typec@25 {
            // [ ... ]
            interrupt-parent = <&gpio>;
            interrupts = <0 0 IRQ_TYPE_LEVEL_LOW>;
            interrupt-names = "intb";
        };

example: https://github.com/torvalds/linux/blob/master/Documentation/devicetree/bindings/iio/adc/adi%2Cad4062.yaml#L28-L46
or any ti,tps6598x.yaml, nxp,ptn5110.yaml, maxim,max33359.yaml

Also, I named intb in the example, due to page 18 of
https://www.analog.com/media/en/technical-documentation/data-sheets/max77789.pdf

Active-Low, Open-Drain Interrupt Output. Connect a pullup resistor to the pullup power source.

which matches IRQ_TYPE_LEVEL_LOW

DO:

  • Use interrupts only, no irq-gpios at all.


connector:
$ref: /schemas/connector/usb-connector.yaml#
unevaluatedProperties: false

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
unevaluatedProperties: false
connector:
type: object
$ref: /schemas/connector/usb-connector.yaml#
unevaluatedProperties: false

nit: just to match other bindings


wakeup-source: true

connector:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also describe the capabilities (power-role, data-role, ...)?
see fcs,fusb302.yaml, nxp,ptn5110.yaml, analogix,anx7411.yaml, maxim,max33359.yaml

#address-cells = <1>;
#size-cells = <0>;

max77978: usb-typec@25 {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a child example?
see maxim,max33359.yaml

            connector {
                compatible = "usb-c-connector";
                label = "USB-C";
                / [...]

description:
GPIO connected to the interrupt line of the MAX77978.

wakeup-source: true

@gastmaier gastmaier Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Driver reads wakeup not wakeup-source please identify the appropriate and update the mismatch.

max77978-core.c#367

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

Labels

llm review Request a review from a LLM Reviewer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants