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
0f32c807
Commit
0f32c807
authored
Aug 17, 2018
by
David Frey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bmi160: merge in updates from kernel v4.18.1
parent
36e8895a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
11 deletions
+31
-11
bmi160.h
linux_kernel_modules/bmi160/bmi160.h
+1
-0
bmi160_core.c
linux_kernel_modules/bmi160/bmi160_core.c
+4
-5
bmi160_i2c.c
linux_kernel_modules/bmi160/bmi160_i2c.c
+12
-2
bmi160_spi.c
linux_kernel_modules/bmi160/bmi160_spi.c
+14
-4
No files found.
linux_kernel_modules/bmi160/bmi160.h
View file @
0f32c807
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef BMI160_H_
#define BMI160_H_
...
...
linux_kernel_modules/bmi160/bmi160_core.c
View file @
0f32c807
...
...
@@ -565,9 +565,9 @@ static int bmi160_get_data(struct bmi160_data *data, int chan_type,
__le16
sample
;
enum
bmi160_sensor_type
t
=
bmi160_to_sensor
(
chan_type
);
reg
=
bmi160_regs
[
t
].
data
+
(
axis
-
IIO_MOD_X
)
*
sizeof
(
__le16
);
reg
=
bmi160_regs
[
t
].
data
+
(
axis
-
IIO_MOD_X
)
*
sizeof
(
sample
);
ret
=
regmap_bulk_read
(
data
->
regmap
,
reg
,
&
sample
,
sizeof
(
__le16
));
ret
=
regmap_bulk_read
(
data
->
regmap
,
reg
,
&
sample
,
sizeof
(
sample
));
if
(
ret
<
0
)
return
ret
;
...
...
@@ -632,8 +632,8 @@ static irqreturn_t bmi160_trigger_handler(int irq, void *p)
for_each_set_bit
(
i
,
indio_dev
->
active_scan_mask
,
indio_dev
->
masklength
)
{
ret
=
regmap_bulk_read
(
data
->
regmap
,
base
+
i
*
sizeof
(
__le16
),
&
sample
,
sizeof
(
__le16
));
ret
=
regmap_bulk_read
(
data
->
regmap
,
base
+
i
*
sizeof
(
sample
),
&
sample
,
sizeof
(
sample
));
if
(
ret
<
0
)
goto
done
;
buf
[
j
++
]
=
sample
;
...
...
@@ -851,7 +851,6 @@ static const struct attribute_group bmi160_attrs_group = {
};
static
const
struct
iio_info
bmi160_info
=
{
.
driver_module
=
THIS_MODULE
,
.
read_raw
=
bmi160_read_raw
,
.
write_raw
=
bmi160_write_raw
,
.
attrs
=
&
bmi160_attrs_group
,
...
...
linux_kernel_modules/bmi160/bmi160_i2c.c
View file @
0f32c807
...
...
@@ -11,10 +11,11 @@
* - 0x68 if SDO is pulled to GND
* - 0x69 if SDO is pulled to VDDIO
*/
#include <linux/
module
.h>
#include <linux/
acpi
.h>
#include <linux/i2c.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/regmap.h>
#include <linux/acpi.h>
#include "bmi160.h"
...
...
@@ -56,10 +57,19 @@ static const struct acpi_device_id bmi160_acpi_match[] = {
};
MODULE_DEVICE_TABLE
(
acpi
,
bmi160_acpi_match
);
#ifdef CONFIG_OF
static
const
struct
of_device_id
bmi160_of_match
[]
=
{
{
.
compatible
=
"bosch,bmi160"
},
{
},
};
MODULE_DEVICE_TABLE
(
of
,
bmi160_of_match
);
#endif
static
struct
i2c_driver
bmi160_i2c_driver
=
{
.
driver
=
{
.
name
=
"bmi160_i2c"
,
.
acpi_match_table
=
ACPI_PTR
(
bmi160_acpi_match
),
.
of_match_table
=
of_match_ptr
(
bmi160_of_match
),
},
.
probe
=
bmi160_i2c_probe
,
.
remove
=
bmi160_i2c_remove
,
...
...
linux_kernel_modules/bmi160/bmi160_spi.c
View file @
0f32c807
...
...
@@ -7,10 +7,11 @@
* the GNU General Public License. See the file COPYING in the main
* directory of this archive for more details.
*/
#include <linux/acpi.h>
#include <linux/module.h>
#include <linux/
spi/spi
.h>
#include <linux/
of
.h>
#include <linux/regmap.h>
#include <linux/
ac
pi.h>
#include <linux/
spi/s
pi.h>
#include "bmi160.h"
...
...
@@ -47,13 +48,22 @@ static const struct acpi_device_id bmi160_acpi_match[] = {
};
MODULE_DEVICE_TABLE
(
acpi
,
bmi160_acpi_match
);
#ifdef CONFIG_OF
static
const
struct
of_device_id
bmi160_of_match
[]
=
{
{
.
compatible
=
"bosch,bmi160"
},
{
},
};
MODULE_DEVICE_TABLE
(
of
,
bmi160_of_match
);
#endif
static
struct
spi_driver
bmi160_spi_driver
=
{
.
probe
=
bmi160_spi_probe
,
.
remove
=
bmi160_spi_remove
,
.
id_table
=
bmi160_spi_id
,
.
driver
=
{
.
acpi_match_table
=
ACPI_PTR
(
bmi160_acpi_match
),
.
name
=
"bmi160_spi"
,
.
acpi_match_table
=
ACPI_PTR
(
bmi160_acpi_match
),
.
of_match_table
=
of_match_ptr
(
bmi160_of_match
),
.
name
=
"bmi160_spi"
,
},
};
module_spi_driver
(
bmi160_spi_driver
);
...
...
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