Message ID | 20240304-rk3588-saradc-v3-16-7424e2ed5d3b@theobroma-systems.com |
---|---|
State | Accepted |
Delegated to: | Kever Yang |
Headers | show |
Series | rockchip: add support for SARADCv2 and RK806 PMIC and regulators | expand |
On 2024/3/4 19:30, Quentin Schulz wrote: > From: Quentin Schulz <quentin.schulz@theobroma-systems.com> > > ADC support is implied by the Rockchip arch Kconfig but that means it > should be possible to disable ADC support and still be able to build. > > However the weak implementation of rockchip_dnl_key_pressed() currently > blindly use functions from the ADC subsystem which do not exist when ADC > is not enabled, failing the build. > > Therefore, let's encapsulate this logic with a check on the ADC symbol > being selected. > > Cc: Quentin Schulz <foss+uboot@0leil.net> > Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com> Reviewed-by: Kever Yang <kever.yang@rock-chips.com> Thanks, - Kever > --- > arch/arm/mach-rockchip/boot_mode.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/arch/arm/mach-rockchip/boot_mode.c b/arch/arm/mach-rockchip/boot_mode.c > index eb8f65ae4e9..f9be396aa55 100644 > --- a/arch/arm/mach-rockchip/boot_mode.c > +++ b/arch/arm/mach-rockchip/boot_mode.c > @@ -40,6 +40,7 @@ void set_back_to_bootrom_dnl_flag(void) > > __weak int rockchip_dnl_key_pressed(void) > { > +#if CONFIG_IS_ENABLED(ADC) > unsigned int val; > struct udevice *dev; > struct uclass *uc; > @@ -69,6 +70,9 @@ __weak int rockchip_dnl_key_pressed(void) > return true; > else > return false; > +#else > + return false; > +#endif > } > > void rockchip_dnl_mode_check(void) >
diff --git a/arch/arm/mach-rockchip/boot_mode.c b/arch/arm/mach-rockchip/boot_mode.c index eb8f65ae4e9..f9be396aa55 100644 --- a/arch/arm/mach-rockchip/boot_mode.c +++ b/arch/arm/mach-rockchip/boot_mode.c @@ -40,6 +40,7 @@ void set_back_to_bootrom_dnl_flag(void) __weak int rockchip_dnl_key_pressed(void) { +#if CONFIG_IS_ENABLED(ADC) unsigned int val; struct udevice *dev; struct uclass *uc; @@ -69,6 +70,9 @@ __weak int rockchip_dnl_key_pressed(void) return true; else return false; +#else + return false; +#endif } void rockchip_dnl_mode_check(void)