-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge tag 'staging-3.9-rc1' of git://git.kernel.org/pub/scm/linux/ker…
…nel/git/gregkh/staging Pull staging tree update from Greg Kroah-Hartman: "Here's the big staging tree merge for 3.9-rc1 Lots of cleanups and updates for drivers all through the staging tree. We are pretty much "code neutral" here, adding just about as many lines as we removed. All of these have been in linux-next for a while." * tag 'staging-3.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (804 commits) staging: comedi: vmk80xx: wait for URBs to complete staging: comedi: drivers: addi-data: hwdrv_apci3200.c: Add a missing semicolon staging: et131x: Update TODO list staging: et131x: Remove assignment of skb->dev staging: wlan-ng: hfa384x.h: fix for error reported by smatch staging/zache checkpatch ERROR: spaces prohibited around that staging/ozwpan: Mark read only parameters and structs as const staging/ozwpan: Remove empty and unused function oz_cdev_heartbeat staging/ozwpan: Mark local functions as static (fix sparse warnings) staging/ozwpan: Add missing header includes staging/usbip: Mark local functions as static (fix sparse warnings) staging/xgifb: Remove duplicated code in loops. staging/xgifb: Consolidate return paths staging/xgifb: Remove code without effect staging/xgifb: Remove unnecessary casts staging/xgifb: Consolidate if/else if with identical code branches staging: vt6656: replaced custom TRUE definition with true staging: vt6656: replaced custom FALSE definition with false staging: vt6656: replace custom BOOL definition with bool staging/rtl8187se: Mark functions as static to silence sparse ...
- Loading branch information
Showing
621 changed files
with
28,253 additions
and
28,402 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
What: /sys/bus/iio/devices/iio:deviceX/in_gyro_matrix | ||
What: /sys/bus/iio/devices/iio:deviceX/in_accel_matrix | ||
What: /sys/bus/iio/devices/iio:deviceX/in_magn_matrix | ||
KernelVersion: 3.4.0 | ||
Contact: linux-iio@vger.kernel.org | ||
Description: | ||
This is mounting matrix for motion sensors. Mounting matrix | ||
is a 3x3 unitary matrix. A typical mounting matrix would look like | ||
[0, 1, 0; 1, 0, 0; 0, 0, -1]. Using this information, it would be | ||
easy to tell the relative positions among sensors as well as their | ||
positions relative to the board that holds these sensors. Identity matrix | ||
[1, 0, 0; 0, 1, 0; 0, 0, 1] means sensor chip and device are perfectly | ||
aligned with each other. All axes are exactly the same. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* | ||
* STMicroelectronics accelerometers driver | ||
* | ||
* Copyright 2012-2013 STMicroelectronics Inc. | ||
* | ||
* Denis Ciocca <denis.ciocca@st.com> | ||
* v. 1.0.0 | ||
* Licensed under the GPL-2. | ||
*/ | ||
|
||
#ifndef ST_ACCEL_H | ||
#define ST_ACCEL_H | ||
|
||
#include <linux/types.h> | ||
#include <linux/iio/common/st_sensors.h> | ||
|
||
#define LSM303DLHC_ACCEL_DEV_NAME "lsm303dlhc_accel" | ||
#define LIS3DH_ACCEL_DEV_NAME "lis3dh" | ||
#define LSM330D_ACCEL_DEV_NAME "lsm330d_accel" | ||
#define LSM330DL_ACCEL_DEV_NAME "lsm330dl_accel" | ||
#define LSM330DLC_ACCEL_DEV_NAME "lsm330dlc_accel" | ||
#define LIS331DLH_ACCEL_DEV_NAME "lis331dlh" | ||
#define LSM303DL_ACCEL_DEV_NAME "lsm303dl_accel" | ||
#define LSM303DLH_ACCEL_DEV_NAME "lsm303dlh_accel" | ||
#define LSM303DLM_ACCEL_DEV_NAME "lsm303dlm_accel" | ||
#define LSM330_ACCEL_DEV_NAME "lsm330_accel" | ||
|
||
int st_accel_common_probe(struct iio_dev *indio_dev); | ||
void st_accel_common_remove(struct iio_dev *indio_dev); | ||
|
||
#ifdef CONFIG_IIO_BUFFER | ||
int st_accel_allocate_ring(struct iio_dev *indio_dev); | ||
void st_accel_deallocate_ring(struct iio_dev *indio_dev); | ||
int st_accel_trig_set_state(struct iio_trigger *trig, bool state); | ||
#define ST_ACCEL_TRIGGER_SET_STATE (&st_accel_trig_set_state) | ||
#else /* CONFIG_IIO_BUFFER */ | ||
static inline int st_accel_allocate_ring(struct iio_dev *indio_dev) | ||
{ | ||
return 0; | ||
} | ||
static inline void st_accel_deallocate_ring(struct iio_dev *indio_dev) | ||
{ | ||
} | ||
#define ST_ACCEL_TRIGGER_SET_STATE NULL | ||
#endif /* CONFIG_IIO_BUFFER */ | ||
|
||
#endif /* ST_ACCEL_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
/* | ||
* STMicroelectronics accelerometers driver | ||
* | ||
* Copyright 2012-2013 STMicroelectronics Inc. | ||
* | ||
* Denis Ciocca <denis.ciocca@st.com> | ||
* | ||
* Licensed under the GPL-2. | ||
*/ | ||
|
||
#include <linux/module.h> | ||
#include <linux/kernel.h> | ||
#include <linux/slab.h> | ||
#include <linux/stat.h> | ||
#include <linux/interrupt.h> | ||
#include <linux/i2c.h> | ||
#include <linux/delay.h> | ||
#include <linux/iio/iio.h> | ||
#include <linux/iio/buffer.h> | ||
#include <linux/iio/trigger_consumer.h> | ||
#include <linux/iio/triggered_buffer.h> | ||
|
||
#include <linux/iio/common/st_sensors.h> | ||
#include "st_accel.h" | ||
|
||
int st_accel_trig_set_state(struct iio_trigger *trig, bool state) | ||
{ | ||
struct iio_dev *indio_dev = trig->private_data; | ||
|
||
return st_sensors_set_dataready_irq(indio_dev, state); | ||
} | ||
|
||
static int st_accel_buffer_preenable(struct iio_dev *indio_dev) | ||
{ | ||
int err; | ||
|
||
err = st_sensors_set_enable(indio_dev, true); | ||
if (err < 0) | ||
goto st_accel_set_enable_error; | ||
|
||
err = iio_sw_buffer_preenable(indio_dev); | ||
|
||
st_accel_set_enable_error: | ||
return err; | ||
} | ||
|
||
static int st_accel_buffer_postenable(struct iio_dev *indio_dev) | ||
{ | ||
int err; | ||
struct st_sensor_data *adata = iio_priv(indio_dev); | ||
|
||
adata->buffer_data = kmalloc(indio_dev->scan_bytes, GFP_KERNEL); | ||
if (adata->buffer_data == NULL) { | ||
err = -ENOMEM; | ||
goto allocate_memory_error; | ||
} | ||
|
||
err = st_sensors_set_axis_enable(indio_dev, | ||
(u8)indio_dev->active_scan_mask[0]); | ||
if (err < 0) | ||
goto st_accel_buffer_postenable_error; | ||
|
||
err = iio_triggered_buffer_postenable(indio_dev); | ||
if (err < 0) | ||
goto st_accel_buffer_postenable_error; | ||
|
||
return err; | ||
|
||
st_accel_buffer_postenable_error: | ||
kfree(adata->buffer_data); | ||
allocate_memory_error: | ||
return err; | ||
} | ||
|
||
static int st_accel_buffer_predisable(struct iio_dev *indio_dev) | ||
{ | ||
int err; | ||
struct st_sensor_data *adata = iio_priv(indio_dev); | ||
|
||
err = iio_triggered_buffer_predisable(indio_dev); | ||
if (err < 0) | ||
goto st_accel_buffer_predisable_error; | ||
|
||
err = st_sensors_set_axis_enable(indio_dev, ST_SENSORS_ENABLE_ALL_AXIS); | ||
if (err < 0) | ||
goto st_accel_buffer_predisable_error; | ||
|
||
err = st_sensors_set_enable(indio_dev, false); | ||
|
||
st_accel_buffer_predisable_error: | ||
kfree(adata->buffer_data); | ||
return err; | ||
} | ||
|
||
static const struct iio_buffer_setup_ops st_accel_buffer_setup_ops = { | ||
.preenable = &st_accel_buffer_preenable, | ||
.postenable = &st_accel_buffer_postenable, | ||
.predisable = &st_accel_buffer_predisable, | ||
}; | ||
|
||
int st_accel_allocate_ring(struct iio_dev *indio_dev) | ||
{ | ||
return iio_triggered_buffer_setup(indio_dev, &iio_pollfunc_store_time, | ||
&st_sensors_trigger_handler, &st_accel_buffer_setup_ops); | ||
} | ||
|
||
void st_accel_deallocate_ring(struct iio_dev *indio_dev) | ||
{ | ||
iio_triggered_buffer_cleanup(indio_dev); | ||
} | ||
|
||
MODULE_AUTHOR("Denis Ciocca <denis.ciocca@st.com>"); | ||
MODULE_DESCRIPTION("STMicroelectronics accelerometers buffer"); | ||
MODULE_LICENSE("GPL v2"); |
Oops, something went wrong.