From 6494ce26073b08a5b6722aa494e525d39d790abc Mon Sep 17 00:00:00 2001 From: Henrik Brix Andersen Date: Fri, 22 May 2020 10:10:26 +0200 Subject: [PATCH] drivers: dac: mcux_dac32: add Kconfig option for enabling test output Add a Kconfig option for enabling the DAC test output. On the NXP KE1xF the DAC test output is internally routed to ADCx SE23. Signed-off-by: Henrik Brix Andersen --- drivers/dac/Kconfig.mcux | 6 ++++++ drivers/dac/dac_mcux_dac32.c | 3 +++ 2 files changed, 9 insertions(+) diff --git a/drivers/dac/Kconfig.mcux b/drivers/dac/Kconfig.mcux index e824391838e..7a76c6eb136 100644 --- a/drivers/dac/Kconfig.mcux +++ b/drivers/dac/Kconfig.mcux @@ -15,3 +15,9 @@ config DAC_MCUX_DAC32 depends on HAS_MCUX_DAC32 help Enable the driver for the NXP Kinetis MCUX DAC32. + +config DAC_MCUX_DAC32_TESTOUT + bool "Enable DAC test output" + depends on DAC_MCUX_DAC32 + help + Enable the DAC test output. diff --git a/drivers/dac/dac_mcux_dac32.c b/drivers/dac/dac_mcux_dac32.c index 14818ae3977..424872c1fd4 100644 --- a/drivers/dac/dac_mcux_dac32.c +++ b/drivers/dac/dac_mcux_dac32.c @@ -49,6 +49,9 @@ static int mcux_dac32_channel_setup(struct device *dev, DAC32_Init(config->base, &dac32_config); DAC32_EnableBufferOutput(config->base, config->buffered); + DAC32_EnableTestOutput(config->base, + IS_ENABLED(CONFIG_DAC_MCUX_DAC32_TESTOUT)); + data->configured = true; return 0;