Skip to content

Commit 203948e

Browse files
committed
sensors: move grove sensors under drivers/sensor
Grove devices are sensors, so no need to have them under their own category. Signed-off-by: Anas Nashif <[email protected]>
1 parent d2c8d52 commit 203948e

File tree

10 files changed

+15
-19
lines changed

10 files changed

+15
-19
lines changed

drivers/Kconfig

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ source "drivers/timer/Kconfig"
2727

2828
source "drivers/entropy/Kconfig"
2929

30-
source "drivers/grove/Kconfig"
31-
3230
source "drivers/pci/Kconfig"
3331

3432
source "drivers/gpio/Kconfig"

drivers/sensor/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ add_subdirectory_ifdef(CONFIG_CCS811 ccs811)
1414
add_subdirectory_ifdef(CONFIG_DHT dht)
1515
add_subdirectory_ifdef(CONFIG_FXAS21002 fxas21002)
1616
add_subdirectory_ifdef(CONFIG_FXOS8700 fxos8700)
17+
add_subdirectory(grove)
1718
add_subdirectory_ifdef(CONFIG_HDC1008 hdc1008)
1819
add_subdirectory_ifdef(CONFIG_HMC5883L hmc5883l)
1920
add_subdirectory_ifdef(CONFIG_HP206C hp206c)

drivers/sensor/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ source "drivers/sensor/fxas21002/Kconfig"
5757

5858
source "drivers/sensor/fxos8700/Kconfig"
5959

60+
source "drivers/sensor/grove/Kconfig"
61+
6062
source "drivers/sensor/hdc1008/Kconfig"
6163

6264
source "drivers/sensor/hmc5883l/Kconfig"
File renamed without changes.

drivers/grove/Kconfig renamed to drivers/sensor/grove/Kconfig

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,57 +5,53 @@
55
#
66
# SPDX-License-Identifier: Apache-2.0
77
#
8-
9-
10-
8+
if SENSOR
119
config GROVE_LIGHT_SENSOR
1210
bool "Enable the Seeed Grove Light Sensor"
13-
depends on SENSOR && GROVE && ADC && NEWLIB_LIBC
11+
depends on ADC && NEWLIB_LIBC
1412
help
1513
Setting this value will enable driver support for the Grove Light
1614
Sensor.
1715

16+
if GROVE_LIGHT_SENSOR
1817
config GROVE_LIGHT_SENSOR_NAME
1918
string "Driver name"
20-
depends on GROVE_LIGHT_SENSOR
2119
default "GROVE_LIGHT_SENSOR"
2220
help
2321
Specify the device name with which the sensor is identified.
2422

2523
config GROVE_LIGHT_SENSOR_ADC_DEV_NAME
2624
string "ADC where Grove Light Sensor is connected"
27-
depends on GROVE_LIGHT_SENSOR
2825
default "ADC_0"
2926
help
3027
Specify the device name of the ADC to which the Grove Light Sensor
3128
is connected.
3229

3330
config GROVE_LIGHT_SENSOR_ADC_CHANNEL
3431
int "ADC channel used by Grove Light Sensor"
35-
depends on GROVE_LIGHT_SENSOR
3632
default 10
3733
help
3834
Specify the channel of the ADC to which the Grove Light Sensor is
3935
connected.
36+
endif
4037

4138
config GROVE_TEMPERATURE_SENSOR
4239
bool "Enable the Seeed Grove Temperature Sensor"
43-
depends on SENSOR && GROVE && ADC && NEWLIB_LIBC
40+
depends on ADC && NEWLIB_LIBC
4441
help
4542
Setting this value will enable driver support for the Grove
4643
Temperature Sensor.
4744

45+
if GROVE_TEMPERATURE_SENSOR
4846
config GROVE_TEMPERATURE_SENSOR_NAME
4947
string "Driver name"
50-
depends on GROVE_TEMPERATURE_SENSOR
5148
default "GROVE_TEMPERATURE_SENSOR"
5249
help
5350
Specify the device name with which the Grove Temperature Sensor
5451
is identified.
5552

5653
choice
5754
prompt "Sensor version"
58-
depends on GROVE_TEMPERATURE_SENSOR
5955
default GROVE_TEMPERATURE_SENSOR_V1_0
6056
help
6157
Choose the version of the Grove Temperature Sensor.
@@ -74,16 +70,18 @@ endchoice
7470

7571
config GROVE_TEMPERATURE_SENSOR_ADC_DEV_NAME
7672
string "ADC where Grove Temperature Sensor is connected"
77-
depends on GROVE_TEMPERATURE_SENSOR
7873
default "ADC_0"
7974
help
8075
Specify the device name of the ADC to which the Grove Temperature
8176
Sensor is connected.
8277

8378
config GROVE_TEMPERATURE_SENSOR_ADC_CHANNEL
8479
int "ADC channel used by Grove Temperature Sensor"
85-
depends on GROVE_TEMPERATURE_SENSOR
8680
default 10
8781
help
8882
Specify the channel of the ADC to which the Grove Temperature Sensor
8983
is connected.
84+
85+
endif
86+
87+
endif

drivers/grove/light_sensor.c renamed to drivers/sensor/grove/light_sensor.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#include <sensor.h>
1111
#include <zephyr.h>
1212

13-
#define LOG_LEVEL CONFIG_GROVE_LOG_LEVEL
13+
#define LOG_LEVEL CONFIG_SENSOR_LOG_LEVEL
1414
#include <logging/log.h>
1515
LOG_MODULE_REGISTER(grove_light);
1616

drivers/grove/temperature_sensor.c renamed to drivers/sensor/grove/temperature_sensor.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#include <sensor.h>
1111
#include <zephyr.h>
1212

13-
#define LOG_LEVEL CONFIG_GROVE_LOG_LEVEL
13+
#define LOG_LEVEL CONFIG_SENSOR_LOG_LEVEL
1414
#include <logging/log.h>
1515
LOG_MODULE_REGISTER(grove_temp);
1616

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
CONFIG_ADC=y
22
CONFIG_GROVE_LIGHT_SENSOR=y
3-
CONFIG_GROVE=y
43
CONFIG_SENSOR=y
54
CONFIG_NEWLIB_LIBC=y
65
CONFIG_STDOUT_CONSOLE=y

samples/sensor/grove_temperature/prj.conf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ CONFIG_I2C=y
44
CONFIG_ADC=y
55
CONFIG_NEWLIB_LIBC=y
66
CONFIG_DISPLAY=y
7-
CONFIG_GROVE=y
87
CONFIG_GROVE_TEMPERATURE_SENSOR_ADC_CHANNEL=10
98
CONFIG_GROVE_TEMPERATURE_SENSOR=y
109
CONFIG_GROVE_TEMPERATURE_SENSOR_V1_X=y

samples/sensor/th02/prj.conf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,5 @@ CONFIG_SENSOR=y
44
CONFIG_TH02=y
55
CONFIG_LOG=n
66
CONFIG_SENSOR_LOG_LEVEL_DBG=y
7-
CONFIG_GROVE=y
87
CONFIG_GROVE_LCD_RGB=y
98
CONFIG_DISPLAY=y

0 commit comments

Comments
 (0)