From 7d57a2b2bd2a38fcd9305546dee0c102ae4bb27f Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 25 Mar 2017 10:38:41 -0600 Subject: [PATCH] Trivial changes from review of last PR. --- arch/arm/src/stm32/stm32_comp.c | 1 + configs/nucleo-f334r8/src/stm32_comp.c | 4 ++++ drivers/analog/Kconfig | 7 +++---- drivers/analog/Make.defs | 3 +-- drivers/analog/comp.c | 5 ++++- 5 files changed, 13 insertions(+), 7 deletions(-) diff --git a/arch/arm/src/stm32/stm32_comp.c b/arch/arm/src/stm32/stm32_comp.c index 9486c77f217..a03f6a767ee 100644 --- a/arch/arm/src/stm32/stm32_comp.c +++ b/arch/arm/src/stm32/stm32_comp.c @@ -87,6 +87,7 @@ /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ + /* COMP2 default configuration **********************************************/ #ifdef CONFIG_STM32_COMP2 diff --git a/configs/nucleo-f334r8/src/stm32_comp.c b/configs/nucleo-f334r8/src/stm32_comp.c index 7b45b385a45..c6b8be8249c 100644 --- a/configs/nucleo-f334r8/src/stm32_comp.c +++ b/configs/nucleo-f334r8/src/stm32_comp.c @@ -86,6 +86,8 @@ int stm32_comp_setup(void) if (!initialized) { + /* Get the comparator interface */ + #ifdef CONFIG_STM32_COMP2 comp = stm32_compinitialize(2); if (comp == NULL) @@ -113,6 +115,8 @@ int stm32_comp_setup(void) } #endif + /* Register the comparator character driver at /dev/comp0 */ + ret = comp_register("/dev/comp0", comp); if (ret < 0) { diff --git a/drivers/analog/Kconfig b/drivers/analog/Kconfig index 99ff6b8fbaa..c9a2334361b 100644 --- a/drivers/analog/Kconfig +++ b/drivers/analog/Kconfig @@ -110,12 +110,11 @@ endif # if ADC_PGA11X endif # ADC config COMP - bool "Analog Comparator" - default n - ---help--- + bool "Analog Comparator" + default n + ---help--- Select to enable support for Analog Comparators (COMPs). - config DAC bool "Digital-to-Analog Conversion" default n diff --git a/drivers/analog/Make.defs b/drivers/analog/Make.defs index 580a44ae84a..fbcc369a4ce 100644 --- a/drivers/analog/Make.defs +++ b/drivers/analog/Make.defs @@ -1,7 +1,7 @@ ############################################################################ # drivers/analog/Make.defs # -# Copyright (C) 2011-2012 Gregory Nutt. All rights reserved. +# Copyright (C) 2011-2012, 2017 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -104,4 +104,3 @@ ifeq ($(CONFIG_COMP),y) endif endif endif - diff --git a/drivers/analog/comp.c b/drivers/analog/comp.c index 5ebc2e87c27..d2b95d77674 100644 --- a/drivers/analog/comp.c +++ b/drivers/analog/comp.c @@ -77,7 +77,10 @@ static const struct file_operations comp_fops = NULL, /* seek */ comp_ioctl /* ioctl */ #ifndef CONFIG_DISABLE_POLL - , 0 + , NULL /* poll */ +#endif +#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS + , NULL /* unlink */ #endif };