diff --git a/boards/arm/hexiwear_k64/Kconfig b/boards/arm/hexiwear_k64/Kconfig deleted file mode 100644 index 6810146b403..00000000000 --- a/boards/arm/hexiwear_k64/Kconfig +++ /dev/null @@ -1,8 +0,0 @@ -# Hexiwear K64 board - -# Copyright (c) 2017, NXP -# SPDX-License-Identifier: Apache-2.0 - -config BATTERY_SENSE - bool "The battery sense circuit" - depends on BOARD_HEXIWEAR_K64 diff --git a/boards/arm/hexiwear_k64/Kconfig.defconfig b/boards/arm/hexiwear_k64/Kconfig.defconfig index ed975dd5774..383abd3d927 100644 --- a/boards/arm/hexiwear_k64/Kconfig.defconfig +++ b/boards/arm/hexiwear_k64/Kconfig.defconfig @@ -20,11 +20,7 @@ config MCG_VDIV0 config MCG_FCRDIV default 1 -if ADC - -config BATTERY_SENSE - default y - -endif # ADC +config REGULATOR + default y if ADC endif # BOARD_HEXIWEAR_K64 diff --git a/boards/arm/hexiwear_k64/doc/index.rst b/boards/arm/hexiwear_k64/doc/index.rst index 1e80b10b1b3..629286fad03 100644 --- a/boards/arm/hexiwear_k64/doc/index.rst +++ b/boards/arm/hexiwear_k64/doc/index.rst @@ -137,6 +137,11 @@ The K64F SoC has five pairs of pinmux/gpio controllers. | PTE25 | UART4_TX | UART BT HCI | +-------+-----------------+---------------------------+ +.. note:: + + To enable battery sensing, you will need to enable the ``en_bat_sens`` + regulator in Devicetree. + System Clock ============ diff --git a/boards/arm/hexiwear_k64/hexiwear_k64.dts b/boards/arm/hexiwear_k64/hexiwear_k64.dts index e1ab79c3a75..f1b0e0dc49e 100644 --- a/boards/arm/hexiwear_k64/hexiwear_k64.dts +++ b/boards/arm/hexiwear_k64/hexiwear_k64.dts @@ -58,6 +58,14 @@ pwms = <&ftm3 5 15625000 PWM_POLARITY_INVERTED>; }; }; + + en_bat_sens: enable-battery-sense { + compatible = "regulator-fixed-sync", "regulator-fixed"; + label = "en_bat_sens"; + regulator-name = "en_bat_sens"; + enable-gpios = <&gpioc 14 GPIO_ACTIVE_LOW>; + regulator-boot-on; + }; }; &sim { diff --git a/boards/arm/hexiwear_k64/pinmux.c b/boards/arm/hexiwear_k64/pinmux.c index 01a54aee7b2..9755f106268 100644 --- a/boards/arm/hexiwear_k64/pinmux.c +++ b/boards/arm/hexiwear_k64/pinmux.c @@ -25,13 +25,6 @@ static int hexiwear_k64_pinmux_init(const struct device *dev) gpio_pin_configure(gpioa, 29, GPIO_OUTPUT_HIGH); #endif -#ifdef CONFIG_BATTERY_SENSE - const struct device *gpioc = - device_get_binding(DT_LABEL(DT_NODELABEL(gpioc))); - - gpio_pin_configure(gpioc, 14, GPIO_OUTPUT_LOW); -#endif - return 0; }