This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 90c01bd  drivers: Move the common driver to misc folder
90c01bd is described below

commit 90c01bde2813ea321cc4184ddc28077874d71367
Author: Xiang Xiao <xiaoxi...@xiaomi.com>
AuthorDate: Fri Mar 11 22:13:17 2022 +0800

    drivers: Move the common driver to misc folder
    
    Signed-off-by: Xiang Xiao <xiaoxi...@xiaomi.com>
---
 drivers/Kconfig                  | 86 +---------------------------------------
 drivers/Makefile                 | 25 +-----------
 drivers/{ => misc}/Kconfig       | 47 ----------------------
 drivers/misc/Make.defs           | 53 +++++++++++++++++++++++++
 drivers/{ => misc}/addrenv.c     |  2 +-
 drivers/{ => misc}/dev_null.c    |  2 +-
 drivers/{ => misc}/dev_zero.c    |  2 +-
 drivers/{ => misc}/lwl_console.c |  2 +-
 drivers/{ => misc}/mkrd.c        |  2 +-
 drivers/{ => misc}/ramdisk.c     |  2 +-
 drivers/{ => misc}/rwbuffer.c    |  2 +-
 11 files changed, 62 insertions(+), 163 deletions(-)

diff --git a/drivers/Kconfig b/drivers/Kconfig
index 45ea433..8a9d162 100644
--- a/drivers/Kconfig
+++ b/drivers/Kconfig
@@ -3,91 +3,6 @@
 # see the file kconfig-language.txt in the NuttX tools repository.
 #
 
-config DEV_SIMPLE_ADDRENV
-       bool "Simple AddrEnv"
-       default n
-
-config DEV_NULL
-       bool "Enable /dev/null"
-       default y
-
-config DEV_ZERO
-       bool "Enable /dev/zero"
-       default n
-
-config DRVR_MKRD
-       bool "RAM disk wrapper (mkrd)"
-       default n
-       ---help---
-               Build the mkrd() function which serves as a wrapper to simplify
-               creation of RAM disks.  If the boardctrl() interface is enabled,
-               the selecting this option will also enable the BOARDIOC_MKRD
-               command that will support creation of RAM disks from 
applications.
-
-# ARCH needs to support memory access while CPU is running to be able to use
-# the LWL CONSOLE
-
-config ARCH_HAVE_RDWR_MEM_CPU_RUN
-       bool
-       default n
-
-config LWL_CONSOLE
-bool "Lightweight Link Console Support"
-       default n
-       depends on DEV_CONSOLE && ARCH_HAVE_RDWR_MEM_CPU_RUN
-       ---help---
-               Use the lightweight link console which provides console over a
-               debug channel by means of shared memory.  A terminal application
-               for openocd as the debugger is available in tools/ocdconsole.py.
-
-menu "Buffering"
-
-config DRVR_WRITEBUFFER
-       bool "Enable write buffer support"
-       default n
-       ---help---
-               Enable generic write buffering support that can be used by a 
variety
-               of drivers.
-
-if DRVR_WRITEBUFFER
-
-config DRVR_WRDELAY
-       int "Write flush delay"
-       default 350
-       ---help---
-               If there is no write activity for this configured amount of 
time,
-               then the contents will be automatically flushed to the media.  
This
-               reduces the likelihood that data will be stuck in the write 
buffer
-               at the time of power down.
-
-endif # DRVR_WRITEBUFFER
-
-config DRVR_READAHEAD
-       bool "Enable read-ahead buffer support"
-       default n
-       ---help---
-               Enable generic read-ahead buffering support that can be used by 
a
-               variety of drivers.
-
-if DRVR_WRITEBUFFER || DRVR_READAHEAD
-
-config DRVR_READBYTES
-       bool "Support byte read method"
-       default y if MTD_BYTE_WRITE
-       default n if !MTD_BYTE_WRITE
-
-config DRVR_REMOVABLE
-       bool "Support removable media"
-       default n
-
-config DRVR_INVALIDATE
-       bool "Support cache invalidation"
-       default n
-
-endif # DRVR_WRITEBUFFER || DRVR_READAHEAD
-
-endmenu # Buffering
-
 config SPECIFIC_DRIVERS
        bool "Board Specific drivers"
        default n
@@ -108,6 +23,7 @@ source "drivers/input/Kconfig"
 source "drivers/ioexpander/Kconfig"
 source "drivers/lcd/Kconfig"
 source "drivers/leds/Kconfig"
+source "drivers/misc/Kconfig"
 source "drivers/mmcsd/Kconfig"
 source "drivers/modem/Kconfig"
 source "drivers/mtd/Kconfig"
diff --git a/drivers/Makefile b/drivers/Makefile
index 7433c13..d6b5324 100644
--- a/drivers/Makefile
+++ b/drivers/Makefile
@@ -39,6 +39,7 @@ include ioexpander/Make.defs
 include lcd/Make.defs
 include leds/Make.defs
 include loop/Make.defs
+include misc/Make.defs
 include mmcsd/Make.defs
 include modem/Make.defs
 include mtd/Make.defs
@@ -70,30 +71,6 @@ ifeq ($(CONFIG_SPECIFIC_DRIVERS),y)
 -include platform/Make.defs
 endif
 
-ifeq ($(CONFIG_DEV_SIMPLE_ADDRENV),y)
-  CSRCS += addrenv.c
-endif
-
-CSRCS += dev_null.c dev_zero.c
-
-ifeq ($(CONFIG_LWL_CONSOLE),y)
-  CSRCS += lwl_console.c
-endif
-
-ifneq ($(CONFIG_DISABLE_MOUNTPOINT),y)
-  CSRCS += ramdisk.c
-ifeq ($(CONFIG_DRVR_MKRD),y)
-  CSRCS += mkrd.c
-endif
-ifeq ($(CONFIG_DRVR_WRITEBUFFER),y)
-  CSRCS += rwbuffer.c
-else
-ifeq ($(CONFIG_DRVR_READAHEAD),y)
-  CSRCS += rwbuffer.c
-endif
-endif
-endif
-
 AOBJS = $(ASRCS:.S=$(OBJEXT))
 COBJS = $(CSRCS:.c=$(OBJEXT))
 
diff --git a/drivers/Kconfig b/drivers/misc/Kconfig
similarity index 61%
copy from drivers/Kconfig
copy to drivers/misc/Kconfig
index 45ea433..780f805 100644
--- a/drivers/Kconfig
+++ b/drivers/misc/Kconfig
@@ -87,50 +87,3 @@ config DRVR_INVALIDATE
 endif # DRVR_WRITEBUFFER || DRVR_READAHEAD
 
 endmenu # Buffering
-
-config SPECIFIC_DRIVERS
-       bool "Board Specific drivers"
-       default n
-
-source "drivers/crypto/Kconfig"
-source "drivers/loop/Kconfig"
-source "drivers/can/Kconfig"
-source "drivers/clk/Kconfig"
-source "drivers/i2c/Kconfig"
-source "drivers/spi/Kconfig"
-source "drivers/i2s/Kconfig"
-source "drivers/timers/Kconfig"
-source "drivers/analog/Kconfig"
-source "drivers/audio/Kconfig"
-source "drivers/video/Kconfig"
-source "drivers/bch/Kconfig"
-source "drivers/input/Kconfig"
-source "drivers/ioexpander/Kconfig"
-source "drivers/lcd/Kconfig"
-source "drivers/leds/Kconfig"
-source "drivers/mmcsd/Kconfig"
-source "drivers/modem/Kconfig"
-source "drivers/mtd/Kconfig"
-source "drivers/eeprom/Kconfig"
-source "drivers/efuse/Kconfig"
-source "drivers/net/Kconfig"
-source "drivers/note/Kconfig"
-source "drivers/pipes/Kconfig"
-source "drivers/power/Kconfig"
-source "drivers/rptun/Kconfig"
-source "drivers/sensors/Kconfig"
-source "drivers/serial/Kconfig"
-source "drivers/usbdev/Kconfig"
-source "drivers/usbhost/Kconfig"
-source "drivers/usbmisc/Kconfig"
-source "drivers/usbmonitor/Kconfig"
-source "drivers/wireless/Kconfig"
-source "drivers/contactless/Kconfig"
-source "drivers/1wire/Kconfig"
-source "drivers/syslog/Kconfig"
-source "drivers/platform/Kconfig"
-source "drivers/rf/Kconfig"
-source "drivers/rc/Kconfig"
-source "drivers/motor/Kconfig"
-source "drivers/math/Kconfig"
-source "drivers/segger/Kconfig"
diff --git a/drivers/misc/Make.defs b/drivers/misc/Make.defs
new file mode 100644
index 0000000..ae0e3b6
--- /dev/null
+++ b/drivers/misc/Make.defs
@@ -0,0 +1,53 @@
+############################################################################
+# drivers/misc/Make.defs
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.  The
+# ASF licenses this file to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance with the
+# License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+############################################################################
+
+ifeq ($(CONFIG_DEV_SIMPLE_ADDRENV),y)
+  CSRCS += addrenv.c
+endif
+
+ifeq ($(CONFIG_DEV_NULL),y)
+  CSRCS += dev_null.c
+endif
+
+ifeq ($(CONFIG_DEV_ZERO),y)
+  CSRCS += dev_zero.c
+endif
+
+ifeq ($(CONFIG_LWL_CONSOLE),y)
+  CSRCS += lwl_console.c
+endif
+
+ifneq ($(CONFIG_DISABLE_MOUNTPOINT),y)
+  CSRCS += ramdisk.c
+ifeq ($(CONFIG_DRVR_MKRD),y)
+  CSRCS += mkrd.c
+endif
+endif
+
+ifeq ($(CONFIG_DRVR_WRITEBUFFER),y)
+  CSRCS += rwbuffer.c
+else ifeq ($(CONFIG_DRVR_READAHEAD),y)
+  CSRCS += rwbuffer.c
+endif
+
+# Include build support
+
+DEPPATH += --dep-path misc
+VPATH += :misc
diff --git a/drivers/addrenv.c b/drivers/misc/addrenv.c
similarity index 99%
rename from drivers/addrenv.c
rename to drivers/misc/addrenv.c
index 82063c4..b22ede3 100644
--- a/drivers/addrenv.c
+++ b/drivers/misc/addrenv.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * drivers/addrenv.c
+ * drivers/misc/addrenv.c
  *
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
diff --git a/drivers/dev_null.c b/drivers/misc/dev_null.c
similarity index 99%
rename from drivers/dev_null.c
rename to drivers/misc/dev_null.c
index cab9fd1..5bb27a7 100644
--- a/drivers/dev_null.c
+++ b/drivers/misc/dev_null.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * drivers/dev_null.c
+ * drivers/misc/dev_null.c
  *
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
diff --git a/drivers/dev_zero.c b/drivers/misc/dev_zero.c
similarity index 99%
rename from drivers/dev_zero.c
rename to drivers/misc/dev_zero.c
index e49e810..4ceab41 100644
--- a/drivers/dev_zero.c
+++ b/drivers/misc/dev_zero.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * drivers/dev_zero.c
+ * drivers/misc/dev_zero.c
  *
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
diff --git a/drivers/lwl_console.c b/drivers/misc/lwl_console.c
similarity index 99%
rename from drivers/lwl_console.c
rename to drivers/misc/lwl_console.c
index 29ad086..5b0234d 100644
--- a/drivers/lwl_console.c
+++ b/drivers/misc/lwl_console.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * drivers/lwl_console.c
+ * drivers/misc/lwl_console.c
  *
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
diff --git a/drivers/mkrd.c b/drivers/misc/mkrd.c
similarity index 99%
rename from drivers/mkrd.c
rename to drivers/misc/mkrd.c
index 25f374f..7c6a967 100644
--- a/drivers/mkrd.c
+++ b/drivers/misc/mkrd.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * drivers/mkrd.c
+ * drivers/misc/mkrd.c
  *
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
diff --git a/drivers/ramdisk.c b/drivers/misc/ramdisk.c
similarity index 99%
rename from drivers/ramdisk.c
rename to drivers/misc/ramdisk.c
index fb1e2f3..0c85a13 100644
--- a/drivers/ramdisk.c
+++ b/drivers/misc/ramdisk.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * drivers/ramdisk.c
+ * drivers/misc/ramdisk.c
  *
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
diff --git a/drivers/rwbuffer.c b/drivers/misc/rwbuffer.c
similarity index 99%
rename from drivers/rwbuffer.c
rename to drivers/misc/rwbuffer.c
index 60e6306..fe7698e 100644
--- a/drivers/rwbuffer.c
+++ b/drivers/misc/rwbuffer.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * drivers/rwbuffer.c
+ * drivers/misc/rwbuffer.c
  *
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with

Reply via email to