sensors: use one init priority config for all sensors

Sensors are end-devices and usually nothing depends on them,
so set a global priority for all sensors and use it instead of
individual values per sensor.

Change-Id: I5847411e783ef8a8517f0ab1d8234810513707b4
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
Anas Nashif 2016-10-04 09:01:27 -04:00 committed by Anas Nashif
commit 6a534710c0
49 changed files with 33 additions and 213 deletions

View file

@ -23,6 +23,14 @@ menuconfig SENSOR
help
Include sensor drivers in system config
config SENSOR_INIT_PRIORITY
int
prompt "Sensor init priority"
depends on SENSOR
default 90
help
Sensor initialization priority.
source "drivers/sensor/Kconfig.ak8975"
source "drivers/sensor/Kconfig.bma280"

View file

@ -51,14 +51,6 @@ config AK8975_NAME
help
Device name with which the AK8975 sensor is identified.
config AK8975_INIT_PRIORITY
int
prompt "Init priority"
depends on AK8975
default 70
help
Device driver initialization priority.
config AK8975_I2C_ADDR
hex
prompt "I2C address"

View file

@ -74,14 +74,6 @@ config BMA280_NAME
help
Device name with which the sensor is identified.
config BMA280_INIT_PRIORITY
int
prompt "Init priority"
depends on BMA280
default 70
help
Device driver initialization priority.
choice
prompt "I2C address"
depends on BMA280

View file

@ -47,14 +47,6 @@ config BMC150_MAGN_DEV_NAME
depends on BMC150_MAGN
default "bmc150_magn"
config BMC150_MAGN_INIT_PRIORITY
int
depends on BMC150_MAGN
default 70
prompt "Init priority"
help
Device driver initialization priority.
choice
prompt "BMC150_MAGN I2C slave address"
default BMC150_MAGN_I2C_ADDR_12

View file

@ -46,14 +46,6 @@ config BME280_DEV_NAME
depends on BME280
default "BME280"
config BME280_INIT_PRIORITY
int
depends on BME280
default 70
prompt "Init priority"
help
Device driver initialization priority.
choice
prompt "BME280 I2C slave address"
default BME280_I2C_ADDR_76

View file

@ -25,16 +25,6 @@ config BMG160_SYS_LOG_LEVEL
- 4 DEBUG: write SYS_LOG_DBG in addition to previous levels
config BMG160_INIT_PRIORITY
int
prompt "BMG160 Init priority"
default 70
depends on BMG160
help
Device driver initialization priority.
As the device is connected to SPI bus, its driver has
to be initialized after the SPI one.
config BMG160_DRV_NAME
string "Driver's name"
depends on BMG160

View file

@ -73,14 +73,6 @@ config DHT_NAME
help
Device name with which the sensor is identified.
config DHT_INIT_PRIORITY
int
prompt "Init priority"
depends on DHT
default 70
help
Device driver initialization priority.
config DHT_GPIO_DEV_NAME
string
prompt "GPIO device"

View file

@ -49,14 +49,6 @@ config HMC5883L_NAME
help
Device name with which the HMC5883L sensor is identified.
config HMC5883L_INIT_PRIORITY
int
prompt "Init priority"
depends on HMC5883L
default 70
help
Device driver initialization priority.
config HMC5883L_I2C_MASTER_DEV_NAME
string
prompt "I2C master where HMC5883L is connected"

View file

@ -42,16 +42,6 @@ config HP206C_SYS_LOG_LEVEL
- 4 DEBUG: write SYS_LOG_DBG in adition to previous levels
config HP206C_INIT_PRIORITY
int
prompt "HP206C Init priority"
default 70
depends on HP206C
help
Device driver initialization priority.
As the device is connected to SPI bus, its driver has
to be initialized after the SPI one.
config HP206C_DRV_NAME
string "Driver's name"
depends on HP206C

View file

@ -49,14 +49,6 @@ config HTS221_NAME
help
Device name with which the HTS221 sensor is identified.
config HTS221_INIT_PRIORITY
int
prompt "Init priority"
depends on HTS221
default 70
help
Device driver initialization priority.
config HTS221_I2C_MASTER_DEV_NAME
string
prompt "I2C master where HTS221 is connected"

View file

@ -51,15 +51,6 @@ config ISL29035_NAME
help
Device name with which the ISL29035 sensor is identified.
config ISL29035_INIT_PRIORITY
int
prompt "Init priority"
default 70
depends on ISL29035
help
Device driver initialization priority for ISL29035.
The device should be initialized after I2C.
config ISL29035_I2C_MASTER_DEV_NAME
string
prompt "I2C Master"

View file

@ -51,14 +51,6 @@ config LIS3DH_NAME
help
Device name with which the LIS3DH sensor is identified.
config LIS3DH_INIT_PRIORITY
int
prompt "Init priority"
depends on LIS3DH
default 70
help
Device driver initialization priority.
choice
prompt "I2C address"
depends on LIS3DH

View file

@ -49,14 +49,6 @@ config LIS3MDL_NAME
help
Device name with which the LIS3MDL sensor is identified.
config LIS3MDL_INIT_PRIORITY
int
prompt "Init priority"
depends on LIS3MDL
default 70
help
Device driver initialization priority.
config LIS3MDL_I2C_ADDR
hex
prompt "I2C address"

View file

@ -51,14 +51,6 @@ config LPS25HB_DEV_NAME
help
Device name with which the LPS25HB sensor is identified.
config LPS25HB_INIT_PRIORITY
int
prompt "Init priority"
depends on LPS25HB
default 70
help
Device driver initialization priority.
config LPS25HB_I2C_ADDR
hex
prompt "I2C address"

View file

@ -49,14 +49,6 @@ config LSM6DS0_DEV_NAME
depends on LSM6DS0
default "lsm6ds0"
config LSM6DS0_INIT_PRIORITY
int
depends on LSM6DS0
default 70
prompt "Init priority"
help
Device driver initialization priority.
config LSM6DS0_I2C_ADDR
hex
prompt "I2C address"

View file

@ -47,14 +47,6 @@ config LSM9DS0_GYRO_DEV_NAME
depends on LSM9DS0_GYRO
default "lsm9ds0_gyro"
config LSM9DS0_GYRO_INIT_PRIORITY
int
depends on LSM9DS0_GYRO
default 70
prompt "Init priority"
help
Device driver initialization priority.
choice
prompt "LSM9DS0_GYRO I2C slave address"
default LSM9DS0_GYRO_I2C_ADDR_6A

View file

@ -48,14 +48,6 @@ config LSM9DS0_MFD_DEV_NAME
depends on LSM9DS0_MFD
default "lsm9ds0_mfd"
config LSM9DS0_MFD_INIT_PRIORITY
int
depends on LSM9DS0_MFD
default 70
prompt "Init priority"
help
Device driver initialization priority.
choice
prompt "LSM9DS0_MFD I2C slave address"
default LSM9DS0_MFD_I2C_ADDR_1E

View file

@ -51,14 +51,6 @@ config MAX44009_DRV_NAME
help
Device name with which the MAX44009 light is identified.
config MAX44009_INIT_PRIORITY
int
prompt "Init priority"
depends on MAX44009
default 70
help
Device driver initialization priority.
choice
prompt "I2C address"
depends on MAX44009

View file

@ -47,13 +47,6 @@ config MCP9808_DEV_NAME
depends on MCP9808
default "MCP9808"
config MCP9808_INIT_PRIORITY
int
depends on MCP9808
default 70
prompt "Init priority"
help
Device driver initialization priority.
config MCP9808_I2C_ADDR
hex "MCP9808 I2C slave address"

View file

@ -51,14 +51,6 @@ config MPU6050_NAME
help
Device name with which the MPU6050 sensor is identified.
config MPU6050_INIT_PRIORITY
int
prompt "Init priority"
depends on MPU6050
default 70
help
Device driver initialization priority.
config MPU6050_I2C_ADDR
hex
prompt "I2C address"

View file

@ -51,14 +51,6 @@ config SHT3XD_NAME
help
Device name with which the SHT3xD sensor is identified.
config SHT3XD_INIT_PRIORITY
int
prompt "Init priority"
depends on SHT3XD
default 70
help
Device driver initialization priority.
choice
prompt "I2C address"
depends on SHT3XD

View file

@ -47,14 +47,6 @@ config SX9500_DEV_NAME
depends on SX9500
default "SX9500"
config SX9500_INIT_PRIORITY
int
depends on SX9500
default 70
prompt "Init priority"
help
Device driver initialization priority.
config SX9500_I2C_ADDR
hex "SX9500 I2C slave address"
depends on SX9500

View file

@ -51,14 +51,6 @@ config TMP007_NAME
help
Device name with which the TMP007 sensor is identified.
config TMP007_INIT_PRIORITY
int
prompt "Init priority"
depends on TMP007
default 70
help
Device driver initialization priority.
choice
prompt "I2C address"
depends on TMP007

View file

@ -51,14 +51,6 @@ config TMP112_NAME
help
Device name with which the TMP112 sensor is identified.
config TMP112_INIT_PRIORITY
int
prompt "Init priority"
depends on TMP112
default 70
help
Device driver initialization priority.
choice
prompt "I2C address"
depends on TMP112

View file

@ -170,4 +170,4 @@ int ak8975_init(struct device *dev)
struct ak8975_data ak8975_data;
DEVICE_INIT(ak8975, CONFIG_AK8975_NAME, ak8975_init, &ak8975_data,
NULL, SECONDARY, CONFIG_AK8975_INIT_PRIORITY);
NULL, SECONDARY, CONFIG_SENSOR_INIT_PRIORITY);

View file

@ -172,4 +172,4 @@ int bma280_init(struct device *dev)
struct bma280_data bma280_driver;
DEVICE_INIT(bma280, CONFIG_BMA280_NAME, bma280_init, &bma280_driver,
NULL, SECONDARY, CONFIG_BMA280_INIT_PRIORITY);
NULL, SECONDARY, CONFIG_SENSOR_INIT_PRIORITY);

View file

@ -625,4 +625,4 @@ struct bmc150_magn_data bmc150_magn_data;
DEVICE_INIT(bmc150_magn, CONFIG_BMC150_MAGN_DEV_NAME, bmc150_magn_init,
&bmc150_magn_data, &bmc150_magn_config, NANOKERNEL,
CONFIG_BMC150_MAGN_INIT_PRIORITY);
CONFIG_SENSOR_INIT_PRIORITY);

View file

@ -266,4 +266,4 @@ int bme280_init(struct device *dev)
static struct bme280_data bme280_data;
DEVICE_INIT(bme280, CONFIG_BME280_DEV_NAME, bme280_init, &bme280_data,
NULL, SECONDARY, CONFIG_BME280_INIT_PRIORITY);
NULL, SECONDARY, CONFIG_SENSOR_INIT_PRIORITY);

View file

@ -360,4 +360,4 @@ struct bmg160_device_config bmg160_config = {
};
DEVICE_INIT(bmg160, CONFIG_BMG160_DRV_NAME, bmg160_init, &bmg160_data,
&bmg160_config, SECONDARY, CONFIG_BMG160_INIT_PRIORITY);
&bmg160_config, SECONDARY, CONFIG_SENSOR_INIT_PRIORITY);

View file

@ -949,4 +949,4 @@ struct bmi160_device_config bmi160_config = {
};
DEVICE_INIT(bmi160, CONFIG_BMI160_NAME, bmi160_init, &bmi160_data,
&bmi160_config, NANOKERNEL, CONFIG_BMI160_INIT_PRIORITY);
&bmi160_config, NANOKERNEL, CONFIG_SENSOR_INIT_PRIORITY);

View file

@ -245,4 +245,4 @@ static int dht_init(struct device *dev)
struct dht_data dht_data;
DEVICE_INIT(dht_dev, CONFIG_DHT_NAME, &dht_init, &dht_data,
NULL, SECONDARY, CONFIG_DHT_INIT_PRIORITY);
NULL, SECONDARY, CONFIG_SENSOR_INIT_PRIORITY);

View file

@ -143,4 +143,4 @@ int hdc1008_init(struct device *dev)
struct hdc1008_data hdc1008_data;
DEVICE_INIT(hdc1008, CONFIG_HDC1008_NAME, hdc1008_init, &hdc1008_data,
NULL, SECONDARY, CONFIG_HDC1008_INIT_PRIORITY);
NULL, SECONDARY, CONFIG_SENSOR_INIT_PRIORITY);

View file

@ -165,4 +165,4 @@ int hmc5883l_init(struct device *dev)
struct hmc5883l_data hmc5883l_driver;
DEVICE_INIT(hmc5883l, CONFIG_HMC5883L_NAME, hmc5883l_init, &hmc5883l_driver,
NULL, SECONDARY, CONFIG_HMC5883L_INIT_PRIORITY);
NULL, SECONDARY, CONFIG_SENSOR_INIT_PRIORITY);

View file

@ -342,4 +342,4 @@ int hp206c_init(struct device *dev)
static struct hp206c_device_data hp206c_data;
DEVICE_INIT(hp206c, CONFIG_HP206C_DRV_NAME, hp206c_init, &hp206c_data,
NULL, NANOKERNEL, CONFIG_HP206C_INIT_PRIORITY);
NULL, NANOKERNEL, CONFIG_SENSOR_INIT_PRIORITY);

View file

@ -176,4 +176,4 @@ int hts221_init(struct device *dev)
struct hts221_data hts221_driver;
DEVICE_INIT(hts221, CONFIG_HTS221_NAME, hts221_init, &hts221_driver,
NULL, SECONDARY, CONFIG_HTS221_INIT_PRIORITY);
NULL, SECONDARY, CONFIG_SENSOR_INIT_PRIORITY);

View file

@ -155,4 +155,4 @@ static int isl29035_init(struct device *dev)
struct isl29035_driver_data isl29035_data;
DEVICE_INIT(isl29035_dev, CONFIG_ISL29035_NAME, &isl29035_init,
&isl29035_data, NULL, SECONDARY, CONFIG_ISL29035_INIT_PRIORITY);
&isl29035_data, NULL, SECONDARY, CONFIG_SENSOR_INIT_PRIORITY);

View file

@ -131,4 +131,4 @@ int lis3dh_init(struct device *dev)
struct lis3dh_data lis3dh_driver;
DEVICE_INIT(lis3dh, CONFIG_LIS3DH_NAME, lis3dh_init, &lis3dh_driver,
NULL, SECONDARY, CONFIG_LIS3DH_INIT_PRIORITY);
NULL, SECONDARY, CONFIG_SENSOR_INIT_PRIORITY);

View file

@ -173,4 +173,4 @@ int lis3mdl_init(struct device *dev)
struct lis3mdl_data lis3mdl_driver;
DEVICE_INIT(lis3mdl, CONFIG_LIS3MDL_NAME, lis3mdl_init, &lis3mdl_driver,
NULL, SECONDARY, CONFIG_LIS3MDL_INIT_PRIORITY);
NULL, SECONDARY, CONFIG_SENSOR_INIT_PRIORITY);

View file

@ -191,4 +191,4 @@ struct lps25hb_data lps25hb_data;
DEVICE_INIT(lps25hb, CONFIG_LPS25HB_DEV_NAME, lps25hb_init,
&lps25hb_data, &lps25hb_config, NANOKERNEL,
CONFIG_LPS25HB_INIT_PRIORITY);
CONFIG_SENSOR_INIT_PRIORITY);

View file

@ -506,4 +506,4 @@ struct lsm6ds0_data lsm6ds0_data;
DEVICE_INIT(lsm6ds0, CONFIG_LSM6DS0_DEV_NAME, lsm6ds0_init,
&lsm6ds0_data, &lsm6ds0_config, NANOKERNEL,
CONFIG_LSM6DS0_INIT_PRIORITY);
CONFIG_SENSOR_INIT_PRIORITY);

View file

@ -370,4 +370,4 @@ struct lsm9ds0_gyro_data lsm9ds0_gyro_data;
DEVICE_INIT(lsm9ds0_gyro, CONFIG_LSM9DS0_GYRO_DEV_NAME, lsm9ds0_gyro_init,
&lsm9ds0_gyro_data, &lsm9ds0_gyro_config, SECONDARY,
CONFIG_LSM9DS0_GYRO_INIT_PRIORITY);
CONFIG_LSM9DS0_SENSOR_INIT_PRIORITY);

View file

@ -819,4 +819,4 @@ static struct lsm9ds0_mfd_data lsm9ds0_mfd_data;
DEVICE_INIT(lsm9ds0_mfd, CONFIG_LSM9DS0_MFD_DEV_NAME, lsm9ds0_mfd_init,
&lsm9ds0_mfd_data, &lsm9ds0_mfd_config, NANOKERNEL,
CONFIG_LSM9DS0_MFD_INIT_PRIORITY);
CONFIG_SENSOR_INIT_PRIORITY);

View file

@ -197,4 +197,4 @@ static struct max44009_data max44009_drv_data;
DEVICE_INIT(max44009, CONFIG_MAX44009_DRV_NAME, max44009_init,
&max44009_drv_data, NULL, SECONDARY,
CONFIG_MAX44009_INIT_PRIORITY);
CONFIG_SENSOR_INIT_PRIORITY);

View file

@ -112,4 +112,4 @@ int mcp9808_init(struct device *dev)
struct mcp9808_data mcp9808_data;
DEVICE_INIT(mcp9808, CONFIG_MCP9808_DEV_NAME, mcp9808_init, &mcp9808_data,
NULL, SECONDARY, CONFIG_MCP9808_INIT_PRIORITY);
NULL, SECONDARY, CONFIG_SENSOR_INIT_PRIORITY);

View file

@ -236,4 +236,4 @@ int mpu6050_init(struct device *dev)
struct mpu6050_data mpu6050_driver;
DEVICE_INIT(mpu6050, CONFIG_MPU6050_NAME, mpu6050_init, &mpu6050_driver,
NULL, SECONDARY, CONFIG_MPU6050_INIT_PRIORITY);
NULL, SECONDARY, CONFIG_SENSOR_INIT_PRIORITY);

View file

@ -202,4 +202,4 @@ static int sht3xd_init(struct device *dev)
struct sht3xd_data sht3xd_driver;
DEVICE_INIT(sht3xd, CONFIG_SHT3XD_NAME, sht3xd_init, &sht3xd_driver,
NULL, SECONDARY, CONFIG_SHT3XD_INIT_PRIORITY);
NULL, SECONDARY, CONFIG_SENSOR_INIT_PRIORITY);

View file

@ -144,4 +144,4 @@ int sx9500_init(struct device *dev)
struct sx9500_data sx9500_data;
DEVICE_INIT(sx9500, CONFIG_SX9500_DEV_NAME, sx9500_init, &sx9500_data,
NULL, SECONDARY, CONFIG_SX9500_INIT_PRIORITY);
NULL, SECONDARY, CONFIG_SENSOR_INIT_PRIORITY);

View file

@ -147,4 +147,4 @@ int tmp007_init(struct device *dev)
struct tmp007_data tmp007_driver;
DEVICE_INIT(tmp007, CONFIG_TMP007_NAME, tmp007_init, &tmp007_driver,
NULL, SECONDARY, CONFIG_TMP007_INIT_PRIORITY);
NULL, SECONDARY, CONFIG_SENSOR_INIT_PRIORITY);

View file

@ -252,4 +252,4 @@ int tmp112_init(struct device *dev)
static struct tmp112_data tmp112_driver;
DEVICE_INIT(tmp112, CONFIG_TMP112_NAME, tmp112_init, &tmp112_driver,
NULL, SECONDARY, CONFIG_TMP112_INIT_PRIORITY);
NULL, SECONDARY, CONFIG_SENSOR_INIT_PRIORITY);