c62c3789806962e2630a5cdd01becc4e210a969c
[openwrt/staging/stintel.git] /
1 From 232af1e58a977f3857074d3aba3709c860bd8058 Mon Sep 17 00:00:00 2001
2 From: Jonas Karlman <jonas@kwiboo.se>
3 Date: Fri, 2 Aug 2024 22:12:22 +0000
4 Subject: [PATCH] dm: adc: Add SPL_ADC Kconfig symbol for use of ADC in SPL
5
6 What model of Radxa ZERO 3W/3E board can be identified using ADC at
7 runtime, add a Kconfig symbol to allow use of ADC in SPL.
8
9 This will be used to identify board model in SPL to allow loading
10 correct FIT configuration and FDT for U-Boot proper at SPL phase.
11
12 Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
13 Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
14 ---
15 drivers/Makefile | 2 +-
16 drivers/adc/Kconfig | 5 +++++
17 drivers/adc/Makefile | 2 +-
18 3 files changed, 7 insertions(+), 2 deletions(-)
19
20 --- a/drivers/Makefile
21 +++ b/drivers/Makefile
22 @@ -1,5 +1,6 @@
23 # SPDX-License-Identifier: GPL-2.0+
24
25 +obj-$(CONFIG_$(SPL_TPL_)ADC) += adc/
26 obj-$(CONFIG_$(SPL_TPL_)BIOSEMU) += bios_emulator/
27 obj-$(CONFIG_$(SPL_TPL_)BLK) += block/
28 obj-$(CONFIG_$(SPL_TPL_)BOOTCOUNT_LIMIT) += bootcount/
29 @@ -81,7 +82,6 @@ endif
30
31 ifeq ($(CONFIG_SPL_BUILD)$(CONFIG_TPL_BUILD),)
32
33 -obj-y += adc/
34 obj-y += ata/
35 obj-$(CONFIG_DM_DEMO) += demo/
36 obj-y += block/
37 --- a/drivers/adc/Kconfig
38 +++ b/drivers/adc/Kconfig
39 @@ -1,5 +1,6 @@
40 config ADC
41 bool "Enable ADC drivers using Driver Model"
42 + depends on DM
43 help
44 This enables ADC API for drivers, which allows driving ADC features
45 by single and multi-channel methods for:
46 @@ -11,6 +12,10 @@ config ADC
47 - support supply's phandle with auto-enable
48 - supply polarity setting in fdt
49
50 +config SPL_ADC
51 + bool "Enable ADC drivers using Driver Model in SPL"
52 + depends on SPL_DM
53 +
54 config ADC_EXYNOS
55 bool "Enable Exynos 54xx ADC driver"
56 depends on ADC
57 --- a/drivers/adc/Makefile
58 +++ b/drivers/adc/Makefile
59 @@ -4,7 +4,7 @@
60 # Przemyslaw Marczak <p.marczak@samsung.com>
61 #
62
63 -obj-$(CONFIG_ADC) += adc-uclass.o
64 +obj-$(CONFIG_$(SPL_TPL_)ADC) += adc-uclass.o
65 obj-$(CONFIG_ADC_EXYNOS) += exynos-adc.o
66 obj-$(CONFIG_ADC_SANDBOX) += sandbox.o
67 obj-$(CONFIG_SARADC_ROCKCHIP) += rockchip-saradc.o