Skip to content

Conversation

@benys
Copy link
Contributor

@benys benys commented Sep 19, 2022

According to #50384 this is fix for compilations for SAMs
C21 doesn't have ADC_REFCTRL_REFSEL_AREFB and have different APBs

Signed-off-by: Kamil Serwus [email protected]

@zephyrbot zephyrbot added area: ADC Analog-to-Digital Converter (ADC) platform: Microchip SAM Microchip SAM Platform (formerly Atmel SAM) labels Sep 19, 2022
@nandojve nandojve changed the title fix compliation for feature SAMs for C21. drivers: adc: sam0: Add support for C2x Oct 3, 2022
@nandojve
Copy link
Member

nandojve commented Oct 3, 2022

Hi @benys ,

You need make CI happy. Add drivers: adc: sam0: prefix in the commit too.

CC: @attie-argentum , @lucasssvaz

@nandojve nandojve added this to the v3.3.0 milestone Oct 3, 2022
Copy link
Member

@attie-argentum attie-argentum left a comment

Choose a reason for hiding this comment

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

Otherwise, LGTM, thanks for the PR!

@lucasssvaz
Copy link

Besides what @attie-argentum noted, looks good.

@benys benys force-pushed the fix_compliation_adc_for_sam0 branch 2 times, most recently from bff9692 to 654560c Compare October 4, 2022 18:12
@benys
Copy link
Contributor Author

benys commented Oct 4, 2022

@attie-argentum I hope that I fix your issues;)

Copy link
Member

@attie-argentum attie-argentum left a comment

Choose a reason for hiding this comment

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

Thanks for your changes... please use defined() and remove the & / * (ref/deref) - both for consistency. 🙂

@benys benys force-pushed the fix_compliation_adc_for_sam0 branch from 654560c to c340c10 Compare October 12, 2022 15:35
@benys
Copy link
Contributor Author

benys commented Oct 12, 2022

I hope that it is now fine :)

C21 doesn't have ADC_REFCTRL_REFSEL_AREFB and have different APBs.

Signed-off-by: Kamil Serwus <[email protected]>
@benys benys force-pushed the fix_compliation_adc_for_sam0 branch from c340c10 to 8bb532e Compare October 12, 2022 16:01
Copy link
Member

@attie-argentum attie-argentum left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@mbolivar-nordic mbolivar-nordic merged commit c707f1e into zephyrproject-rtos:main Oct 25, 2022
Comment on lines +109 to +118
* The following MCLK clock configuration fix-up symbols map to the applicable
* APB-specific symbols, in order to accommodate different SoC series with the
* ADC core connected to different APBs.
*/
#if defined(MCLK_APBDMASK_ADC) || defined(MCLK_APBDMASK_ADC0)
# define MCLK_ADC (MCLK->APBDMASK.reg)
#elif defined(MCLK_APBCMASK_ADC0)
# define MCLK_ADC (MCLK->APBCMASK.reg)
#else
# error ADC not supported...
Copy link
Contributor

Choose a reason for hiding this comment

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

Why can't this be supported in devicetree?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

At SAM MCU clock connection to ADC module is located in some processor in ABPD registry and some at APBC.
I don't find any usage at devicetree to set / get valid registry.
SAM Drives uses constraints from ASF headers.

@benys benys deleted the fix_compliation_adc_for_sam0 branch October 26, 2022 06:35
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) platform: Microchip SAM Microchip SAM Platform (formerly Atmel SAM)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants