Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drivers: adc: adc_sam_afec: rework device tree support #24580

Merged
merged 1 commit into from
Apr 23, 2020

Conversation

galak
Copy link
Collaborator

@galak galak commented Apr 22, 2020

Reworked adc_sam_afec driver to utilize new DT_INST macros as part of
this rework we also now get pin ctrl/mux configuration information
from the device tree instead of via Kconfig and defines in soc_pinmap.h

We remove defines from dts_fixup.h and soc_pinmap.h and associated
Kconfig symbols that are no longer needed due to getting all that
information from devicetree.

Signed-off-by: Kumar Gala [email protected]

Reworked adc_sam_afec driver to utilize new DT_INST macros as part of
this rework we also now get pin ctrl/mux configuration information
from the device tree instead of via Kconfig and defines in soc_pinmap.h

We remove defines from dts_fixup.h and soc_pinmap.h and associated
Kconfig symbols that are no longer needed due to getting all that
information from devicetree.

Signed-off-by: Kumar Gala <[email protected]>
@galak galak requested review from anangl and nandojve as code owners April 22, 2020 02:20
@galak galak requested a review from stephanosio April 22, 2020 02:20
@galak galak added area: ADC Analog-to-Digital Converter (ADC) area: Devicetree platform: Microchip SAM Microchip SAM Platform (formerly Atmel SAM) labels Apr 22, 2020
@nandojve nandojve mentioned this pull request Apr 22, 2020
61 tasks
Copy link
Member

@nandojve nandojve left a comment

Choose a reason for hiding this comment

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

Tested with SAM_V71_XULT

*** Booting Zephyr OS build zephyr-v2.2.0-1872-ga568a5ef993d  ***
Running test suite adc_basic_test
===================================================================
starting test - test_adc_sample_one_channel
Samples read: 0x0fc6 0x0000 0x0000 0x0000 0x0000 0x0000 
PASS - test_adc_sample_one_channel
===================================================================
starting test - test_adc_sample_two_channels
SKIP - test_adc_sample_two_channels
===================================================================
starting test - test_adc_asynchronous_call
Samples read: 0x0f51 0x0f8c 0x0f81 0x0f91 0x0f81 0x0000 
PASS - test_adc_asynchronous_call
===================================================================
starting test - test_adc_sample_with_interval
sample_with_interval_callback: sampling 0
sample_with_interval_callback: sampling 1
sample_with_interval_callback: sampling 2
sample_with_interval_callback: sampling 3
sample_with_interval_callback: sampling 4
Samples read: 0x0f4c 0x0f4f 0x0f50 0x0f4f 0x0f52 0x0000 
PASS - test_adc_sample_with_interval
===================================================================
starting test - test_adc_repeated_samplings
repeated_samplings_callback: done 1
Samples read: 0x0f59 0x0000 0x0000 0x0000 0x0000 0x0000 
repeated_samplings_callback: done 2
Samples read: 0x0f59 0x0f53 0x0000 0x0000 0x0000 0x0000 
repeated_samplings_callback: done 3
Samples read: 0x0f52 0x0f53 0x0000 0x0000 0x0000 0x0000 
repeated_samplings_callback: done 4
Samples read: 0x0f53 0x0f53 0x0000 0x0000 0x0000 0x0000 
repeated_samplings_callback: done 5
Samples read: 0x0f51 0x0f53 0x0000 0x0000 0x0000 0x0000 
repeated_samplings_callback: done 6
Samples read: 0x0f58 0x0f53 0x0000 0x0000 0x0000 0x0000 
repeated_samplings_callback: done 7
Samples read: 0x0f50 0x0f53 0x0000 0x0000 0x0000 0x0000 
repeated_samplings_callback: done 8
Samples read: 0x0f51 0x0f53 0x0000 0x0000 0x0000 0x0000 
repeated_samplings_callback: done 9
Samples read: 0x0f51 0x0f53 0x0000 0x0000 0x0000 0x0000 
repeated_samplings_callback: done 10
Samples read: 0x0f54 0x0f53 0x0000 0x0000 0x0000 0x0000 
PASS - test_adc_repeated_samplings
===================================================================
starting test - test_adc_invalid_request
E: ADC resolution value 0 is not valid
E: ADC resolution value 0 is not valid
Samples read: 0x0f56 0x0000 0x0000 0x0000 0x0000 0x0000 
PASS - test_adc_invalid_request
===================================================================
Test suite adc_basic_test succeeded
===================================================================
PROJECT EXECUTION SUCCESSFUL

Copy link
Member

@stephanosio stephanosio left a comment

Choose a reason for hiding this comment

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

Did a quick pass and there does not seem to be anything obviously wrong with it.

Tested and verified working on sam_e70_xplained.

@galak galak merged commit 94fcf2e into zephyrproject-rtos:master Apr 23, 2020
@galak galak deleted the dt-sam-adc branch April 23, 2020 11:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: ADC Analog-to-Digital Converter (ADC) area: Devicetree platform: Microchip SAM Microchip SAM Platform (formerly Atmel SAM)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants