BigW Consortium Gitlab

Commit 018d36c2 by David Clark

Fixed free IRQ bug when driver is removed

parent 1de6b7ca
......@@ -35,7 +35,7 @@ static const struct iio_chan_spec bme680_channels[] = {
.info_mask_separate = BIT(IIO_CHAN_INFO_PROCESSED),
},
{
.type = IIO_GASRESISTANCE,
.type = IIO_RESISTANCE,
.info_mask_separate = BIT(IIO_CHAN_INFO_PROCESSED),
},
};
......@@ -106,7 +106,7 @@ static int bme680_read_raw(struct iio_dev *indio_dev,
}
switch (chan->type) {
case IIO_GASRESISTANCE:
case IIO_RESISTANCE:
if (data->field_data.status & BME680_GASM_VALID_MSK) {
dev_dbg(&indio_dev->dev, "%s(): gas resistance(%d ohms)\n",
__func__, data->field_data.gas_resistance);
......
diff --git a/bme680.c b/bme680.c
index 5b6bfd7..aefa886 100644
--- a/bme680.c
+++ b/bme680.c
@@ -358,13 +358,20 @@ int8_t bme680_set_regs(const uint8_t *reg_addr, const uint8_t *reg_data, uint8_t
tmp_buff[(2 * index)] = reg_addr[index];
}
tmp_buff[(2 * index) + 1] = reg_data[index];
+#ifdef SIERRA
+ dev->com_rslt = dev->write(dev->dev_id, tmp_buff[2 * index], &tmp_buff[(2 * index) + 1], 1);
+ if (dev->com_rslt != 0)
+ rslt = BME680_E_COM_FAIL;
+#endif
}
+#ifndef SIERRA
/* Write the interleaved array */
if (rslt == BME680_OK) {
dev->com_rslt = dev->write(dev->dev_id, tmp_buff[0], &tmp_buff[1], (2 * len) - 1);
if (dev->com_rslt != 0)
rslt = BME680_E_COM_FAIL;
}
+#endif
} else {
rslt = BME680_E_INVALID_LENGTH;
}
@@ -770,6 +777,7 @@ static int8_t get_calib_data(struct bme680_dev *dev)
| (coeff_array[BME680_H1_LSB_REG] & BME680_BIT_H1_DATA_MSK));
dev->calib.par_h2 = (uint16_t) (((uint16_t) coeff_array[BME680_H2_MSB_REG] << BME680_HUM_REG_SHIFT_VAL)
| ((coeff_array[BME680_H2_LSB_REG]) >> BME680_HUM_REG_SHIFT_VAL));
+
dev->calib.par_h3 = (int8_t) coeff_array[BME680_H3_REG];
dev->calib.par_h4 = (int8_t) coeff_array[BME680_H4_REG];
dev->calib.par_h5 = (int8_t) coeff_array[BME680_H5_REG];
@@ -991,7 +999,12 @@ static uint32_t calc_gas_resistance(uint16_t gas_res_adc, uint8_t gas_range, con
((int64_t) lookupTable1[gas_range])) >> 16;
var2 = (((int64_t) ((int64_t) gas_res_adc << 15) - (int64_t) (16777216)) + var1);
var3 = (((int64_t) lookupTable2[gas_range] * (int64_t) var1) >> 9);
+#ifdef SIERRA
+ var3 += (int64_t) var2 >> 1;
+ calc_gas_res = (uint32_t) do_div(var3, (int64_t) var2);
+#else
calc_gas_res = (uint32_t) ((var3 + ((int64_t) var2 >> 1)) / (int64_t) var2);
+#endif
return calc_gas_res;
}
......@@ -3,7 +3,7 @@ cflags:
-DBMI08X_ENABLE_BMI088=1
-DBMI08X_ENABLE_BMI085=0
-DCONFIG_IIO
//-DDEBUG
-DDEBUG
-DSIERRA
-I$MANGOH_ROOT/linux_kernel_modules/bmi088/BMI08x-Sensor-API
}
......
......@@ -7,42 +7,42 @@ insmod 3-bme680-i2c.ko
insmod 4-bmi088-i2c.ko
insmod 9-mangoh_yellow_dv1.ko
echo 1 > /sys/devices/78b8000.i2c/i2c-4/4-0018/iio:device1/in_accel_x_en
echo 1 > /sys/devices/78b8000.i2c/i2c-4/4-0018/iio:device1/accel_x_en
echo "ACCEL-X enable"
cat /sys/devices/78b8000.i2c/i2c-4/4-0018/iio:device1/in_accel_x_en
cat /sys/devices/78b8000.i2c/i2c-4/4-0018/iio:device1/accel_x_en
echo 1 > /sys/devices/78b8000.i2c/i2c-4/4-0018/iio:device1/in_accel_y_en
echo 1 > /sys/devices/78b8000.i2c/i2c-4/4-0018/iio:device1/accel_y_en
echo "ACCEL-Y enable"
cat /sys/devices/78b8000.i2c/i2c-4/4-0018/iio:device1/in_accel_y_en
cat /sys/devices/78b8000.i2c/i2c-4/4-0018/iio:device1/accel_y_en
echo 1 > /sys/devices/78b8000.i2c/i2c-4/4-0018/iio:device1/in_accel_z_en
echo 1 > /sys/devices/78b8000.i2c/i2c-4/4-0018/iio:device1/accel_z_en
echo "ACCEL-Z enable"
cat /sys/devices/78b8000.i2c/i2c-4/4-0018/iio:device1/in_accel_z_en
cat /sys/devices/78b8000.i2c/i2c-4/4-0018/iio:device1/accel_z_en
echo 0 > /sys/devices/78b8000.i2c/i2c-4/4-0018/iio:device1/in_accel_nomotion_sel
echo 0 > /sys/devices/78b8000.i2c/i2c-4/4-0018/iio:device1/accel_nomotion_sel
echo "ACCEL no motion selected"
cat /sys/devices/78b8000.i2c/i2c-4/4-0018/iio:device1/in_accel_nomotion_sel
cat /sys/devices/78b8000.i2c/i2c-4/4-0018/iio:device1/accel_nomotion_sel
echo 100 > /sys/devices/78b8000.i2c/i2c-4/4-0018/iio:device1/in_accel_duration
echo 100 > /sys/devices/78b8000.i2c/i2c-4/4-0018/iio:device1/accel_duration
echo "ACCEL duration"
cat /sys/devices/78b8000.i2c/i2c-4/4-0018/iio:device1/in_accel_duration
cat /sys/devices/78b8000.i2c/i2c-4/4-0018/iio:device1/accel_duration
echo 100 > /sys/devices/78b8000.i2c/i2c-4/4-0018/iio:device1/in_accel_threshold
echo 100 > /sys/devices/78b8000.i2c/i2c-4/4-0018/iio:device1/accel_threshold
echo "ACCEL threshold"
cat /sys/devices/78b8000.i2c/i2c-4/4-0018/iio:device1/in_accel_threshold
cat /sys/devices/78b8000.i2c/i2c-4/4-0018/iio:device1/accel_threshold
echo 1 > /sys/devices/78b8000.i2c/i2c-4/4-0068/iio\:device2/scan_elements/in_anglvel_x_en
echo 1 > /sys/devices/78b8000.i2c/i2c-4/4-0068/iio\:device2/scan_elements/in_anglvel_y_en
echo 1 > /sys/devices/78b8000.i2c/i2c-4/4-0068/iio\:device2/scan_elements/in_anglvel_z_en
echo 1 > /sys/devices/78b8000.i2c/i2c-4/4-0068/iio\:device2/scan_elements/in_timestamp_en
echo 5 > /sys/devices/78b8000.i2c/i2c-4/4-0068/iio\:device2/buffer/length
echo 20 > /sys/devices/78b8000.i2c/i2c-4/4-0068/iio\:device2/buffer/length
echo 1 > /sys/devices/78b8000.i2c/i2c-4/4-0068/iio\:device2/buffer/enable
echo 1 > /sys/devices/78b8000.i2c/i2c-4/4-0018/iio\:device1/scan_elements/in_accel_x_en
echo 1 > /sys/devices/78b8000.i2c/i2c-4/4-0018/iio\:device1/scan_elements/in_accel_y_en
echo 1 > /sys/devices/78b8000.i2c/i2c-4/4-0018/iio\:device1/scan_elements/in_accel_z_en
echo 1 > /sys/devices/78b8000.i2c/i2c-4/4-0018/iio\:device1/scan_elements/in_timestamp_en
echo 5 > /sys/devices/78b8000.i2c/i2c-4/4-0018/iio\:device1/buffer/length
echo 20 > /sys/devices/78b8000.i2c/i2c-4/4-0018/iio\:device1/buffer/length
echo 1 > /sys/devices/78b8000.i2c/i2c-4/4-0018/iio\:device1/buffer/enable
echo "TEMP"
......
......@@ -70,9 +70,19 @@ static const char * const iio_chan_type_name_spec[] = {
[IIO_CCT] = "cct",
[IIO_PRESSURE] = "pressure",
[IIO_HUMIDITYRELATIVE] = "humidityrelative",
#ifdef CONFIG_IIO_CHAN_TYPE_GASRESISTANCE
[IIO_GASRESISTANCE] = "gasresistance",
#endif /* CONFIG_IIO_CHAN_TYPE_GASRESISTANCE */
[IIO_ACTIVITY] = "activity",
[IIO_STEPS] = "steps",
[IIO_ENERGY] = "energy",
[IIO_DISTANCE] = "distance",
[IIO_VELOCITY] = "velocity",
[IIO_CONCENTRATION] = "concentration",
[IIO_RESISTANCE] = "resistance",
[IIO_PH] = "ph",
[IIO_UVINDEX] = "uvindex",
[IIO_ELECTRICALCONDUCTIVITY] = "electricalconductivity",
[IIO_COUNT] = "count",
[IIO_INDEX] = "index",
[IIO_GRAVITY] = "gravity",
};
static const char * const iio_modifier_names[] = {
......
......@@ -59,6 +59,10 @@ apps:
$MANGOH_ROOT/apps/DataRouter/drTool/drTool
$MANGOH_ROOT/apps/SocialService/socialService
$LEGATO_ROOT/apps/tools/devMode
#if ${MANGOH_BOARD} = YELLOW
$MANGOH_ROOT/samples/BoschSensorsMonitor/boschSensorsMonitor
#endif
}
commands:
......
ldflags:
{
-liio
}
sources:
{
boschSensorsClient.c
}
sandboxed: false
version: 1.0.0
start: manual
executables:
{
boschSensorsClient = ( boschSensorsComponent )
}
processes:
{
envVars:
{
LE_LOG_LEVEL = INFO
}
run:
{
( boschSensorsClient )
}
}
bindings:
{
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment