BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mangoh-drivers
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
mangoh-drivers
Commits
018d36c2
Commit
018d36c2
authored
Jun 13, 2018
by
David Clark
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed free IRQ bug when driver is removed
parent
1de6b7ca
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
68 additions
and
66 deletions
+68
-66
bme680-i2c.c
linux_kernel_modules/bme680/bme680-i2c.c
+2
-2
bme680_patch.txt
linux_kernel_modules/bme680/bme680_patch.txt
+0
-46
4-bmi088-i2c.mdef
linux_kernel_modules/bmi088/4-bmi088-i2c.mdef
+1
-1
bmi088-i2c.c
linux_kernel_modules/bmi088/bmi088-i2c.c
+0
-0
bmi088.sh
linux_kernel_modules/bmi088/scripts/bmi088.sh
+14
-14
industrialio-core.c
linux_kernel_modules/iio/industrialio-core.c
+13
-3
mangOH.sdef
mangOH.sdef
+4
-0
Component.cdef
.../BoschSensorsMonitor/boschSensorsComponent/Component.cdef
+9
-0
boschSensorsClient.c
...SensorsMonitor/boschSensorsComponent/boschSensorsClient.c
+0
-0
boschSensorsMonitor.adef
samples/BoschSensorsMonitor/boschSensorsMonitor.adef
+25
-0
No files found.
linux_kernel_modules/bme680/bme680-i2c.c
View file @
018d36c2
...
...
@@ -35,7 +35,7 @@ static const struct iio_chan_spec bme680_channels[] = {
.
info_mask_separate
=
BIT
(
IIO_CHAN_INFO_PROCESSED
),
},
{
.
type
=
IIO_
GAS
RESISTANCE
,
.
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_
GAS
RESISTANCE
:
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
);
...
...
linux_kernel_modules/bme680/bme680_patch.txt
deleted
100644 → 0
View file @
1de6b7ca
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;
}
linux_kernel_modules/bmi088/4-bmi088-i2c.mdef
View file @
018d36c2
...
...
@@ -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
}
...
...
linux_kernel_modules/bmi088/bmi088-i2c.c
View file @
018d36c2
This diff is collapsed.
Click to expand it.
linux_kernel_modules/bmi088/scripts/bmi088.sh
View file @
018d36c2
...
...
@@ -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"
...
...
linux_kernel_modules/iio/industrialio-core.c
View file @
018d36c2
...
...
@@ -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
[]
=
{
...
...
mangOH.sdef
View file @
018d36c2
...
...
@@ -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:
...
...
samples/BoschSensorsMonitor/boschSensorsComponent/Component.cdef
0 → 100644
View file @
018d36c2
ldflags:
{
-liio
}
sources:
{
boschSensorsClient.c
}
samples/BoschSensorsMonitor/boschSensorsComponent/boschSensorsClient.c
0 → 100644
View file @
018d36c2
This diff is collapsed.
Click to expand it.
samples/BoschSensorsMonitor/boschSensorsMonitor.adef
0 → 100644
View file @
018d36c2
sandboxed: false
version: 1.0.0
start: manual
executables:
{
boschSensorsClient = ( boschSensorsComponent )
}
processes:
{
envVars:
{
LE_LOG_LEVEL = INFO
}
run:
{
( boschSensorsClient )
}
}
bindings:
{
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment