Skip to content

arch/arm/imx9: Add SAR ADC support#18930

Merged
linguini1 merged 1 commit into
apache:masterfrom
PetervdPerk-NXP:pr-imx95-m7-adc
May 22, 2026
Merged

arch/arm/imx9: Add SAR ADC support#18930
linguini1 merged 1 commit into
apache:masterfrom
PetervdPerk-NXP:pr-imx95-m7-adc

Conversation

@PetervdPerk-NXP
Copy link
Copy Markdown
Contributor

@PetervdPerk-NXP PetervdPerk-NXP commented May 21, 2026

Summary

Add support for the i.MX9 SAR ADC block.

Based on the arm64 version but slightly different init due to SCMI and different channel mask for i.MX95.

The driver provides initialization, deinitialization, channel-mask validation, and one-shot reads for the supported ADC channels. It also handles the ADC clock bring-up, power-up sequence, calibration, and raw 12-bit result extraction from the per-channel data registers.

Impact

New ADC feature

Testing

i.MX95 / NavQ95
PX4 ADC Driver, measuring input voltage on channel 0 being 433.
So (432/4096 * 1.8) * 64.4 = 12.22 matching input voltage 12.22V

nsh> board_adc test
DeviceID: -1
Resolution: 4096
Voltage Reference: 1.800000
 0 :   432 1 :  2858 2 :  3781 3 :     3 6 :     0 7 :  3938
 0 :   433 1 :  2858 2 :  3781 3 :     2 6 :     0 7 :  3941
 0 :   432 1 :  2859 2 :  3781 3 :     2 6 :     0 7 :  3938
 0 :   433 1 :  2858 2 :  3781 3 :     2 6 :     1 7 :  3940

Add support for the i.MX9 SAR ADC block.

Based on the arm64 version but slightly different init due to SCMI and
different channel mask for i.MX95.

The driver provides initialization, deinitialization, channel-mask
validation, and one-shot reads for the supported ADC channels. It also
handles the ADC clock bring-up, power-up sequence, calibration, and raw
12-bit result extraction from the per-channel data registers.

Signed-off-by: Peter van der Perk <peter.vanderperk@nxp.com>
@github-actions github-actions Bot added Arch: arm Issues related to ARM (32-bit) architecture Size: L The size of the change in this PR is large labels May 21, 2026
Copy link
Copy Markdown
Contributor

@linguini1 linguini1 left a comment

Choose a reason for hiding this comment

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

Could you please expand on the testing information a little bit more?

@linguini1 linguini1 merged commit 87d8dd7 into apache:master May 22, 2026
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Arch: arm Issues related to ARM (32-bit) architecture Size: L The size of the change in this PR is large

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants