Skip to content

Commit

Permalink
drivers: adc: stm32: fix clock check for stm32f1
Browse files Browse the repository at this point in the history
STM32F1 doesn't have synchronous/asynchronous source clock choice.
The recently added clock check was failing compilation for these series.
This commit removes the check for F1.

(cherry picked from commit f4f1b1a)

Original-Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
GitOrigin-RevId: f4f1b1a
Cr-Build-Id: 8733746390213692641
Cr-Build-Url: https://cr-buildbucket.appspot.com/build/8733746390213692641
Copybot-Job-Name: zephyr-main-copybot-downstream
Change-Id: I0ea3563e75ac23627233bf1fca207f8267dadffd
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/zephyr/+/5934665
Commit-Queue: Dawid Niedźwiecki <dawidn@google.com>
Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
Reviewed-by: Dawid Niedźwiecki <dawidn@google.com>
Tested-by: Dawid Niedźwiecki <dawidn@google.com>
  • Loading branch information
gautierg-st authored and Chromeos LUCI committed Oct 18, 2024
1 parent 6c840c3 commit 8bd91e2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/adc/adc_stm32.c
Original file line number Diff line number Diff line change
Expand Up @@ -1754,15 +1754,16 @@ static const struct adc_driver_api api_stm32_driver_api = {
/* Concat prefix (1st element) and DIV value (2nd element) of st,adc-prescaler */
#if DT_HAS_COMPAT_STATUS_OKAY(st_stm32f1_adc)
#define ADC_STM32_DT_PRESC(x) 0
#define ADC_STM32_CHECK_DT_CLOCK(x)
#else
#define ADC_STM32_DT_PRESC(x) \
_CONCAT(ADC_STM32_CLOCK_PREFIX(x), ADC_STM32_DIV(x))
#endif

/* Macro to check if the ADC instance clock setup is correct */
#define ADC_STM32_CHECK_DT_CLOCK(x) \
BUILD_ASSERT(IS_EQ(ADC_STM32_CLOCK(x), SYNC) || (DT_INST_NUM_CLOCKS(x) > 1), \
"ASYNC clock mode defined without ASYNC clock defined in device tree")
#endif


#if defined(CONFIG_ADC_STM32_DMA)

Expand Down

0 comments on commit 8bd91e2

Please sign in to comment.