Skip to content

Commit

Permalink
Merge tag 'staging-3.9-rc1' of git://git.kernel.org/pub/scm/linux/ker…
Browse files Browse the repository at this point in the history
…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
Linus Torvalds committed Feb 21, 2013
2 parents 06991c2 + 951348b commit b5c78e0
Show file tree
Hide file tree
Showing 621 changed files with 28,253 additions and 28,402 deletions.
13 changes: 13 additions & 0 deletions Documentation/ABI/testing/sysfs-bus-iio-mpu6050
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.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ Required properties:
- reg: Address and length of the register set for the device
- interrupts: Should contain the LRADC interrupts

Optional properties:
- fsl,lradc-touchscreen-wires: Number of wires used to connect the touchscreen
to LRADC. Valid value is either 4 or 5. If this
property is not present, then the touchscreen is
disabled.

Examples:

lradc@80050000 {
Expand Down
3 changes: 1 addition & 2 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -7299,8 +7299,7 @@ S: Odd Fixes
F: drivers/staging/olpc_dcon/

STAGING - OZMO DEVICES USB OVER WIFI DRIVER
M: Rupesh Gujare <rgujare@ozmodevices.com>
M: Chris Kelly <ckelly@ozmodevices.com>
M: Rupesh Gujare <rupesh.gujare@atmel.com>
S: Maintained
F: drivers/staging/ozwpan/

Expand Down
2 changes: 2 additions & 0 deletions arch/arm/boot/dts/imx23.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,9 @@
};

lradc@80050000 {
compatible = "fsl,imx23-lradc";
reg = <0x80050000 0x2000>;
interrupts = <36 37 38 39 40 41 42 43 44>;
status = "disabled";
};

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-omap2/board-rx51-peripherals.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
#include <media/si4713.h>
#include <linux/leds-lp5523.h>

#include <../drivers/staging/iio/light/tsl2563.h>
#include <linux/platform_data/tsl2563.h>
#include <linux/lis3lv02d.h>

#if defined(CONFIG_IR_RX51) || defined(CONFIG_IR_RX51_MODULE)
Expand Down
3 changes: 1 addition & 2 deletions drivers/extcon/extcon-adc-jack.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,7 @@ static int adc_jack_probe(struct platform_device *pdev)
;
data->num_conditions = i;

data->chan = iio_channel_get(dev_name(&pdev->dev),
pdata->consumer_channel);
data->chan = iio_channel_get(&pdev->dev, pdata->consumer_channel);
if (IS_ERR(data->chan)) {
err = PTR_ERR(data->chan);
goto out;
Expand Down
38 changes: 38 additions & 0 deletions drivers/iio/accel/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,42 @@ config HID_SENSOR_ACCEL_3D
Say yes here to build support for the HID SENSOR
accelerometers 3D.

config KXSD9
tristate "Kionix KXSD9 Accelerometer Driver"
depends on SPI
help
Say yes here to build support for the Kionix KXSD9 accelerometer.
Currently this only supports the device via an SPI interface.

config IIO_ST_ACCEL_3AXIS
tristate "STMicroelectronics accelerometers 3-Axis Driver"
depends on (I2C || SPI_MASTER) && SYSFS
select IIO_ST_SENSORS_CORE
select IIO_ST_ACCEL_I2C_3AXIS if (I2C)
select IIO_ST_ACCEL_SPI_3AXIS if (SPI_MASTER)
select IIO_TRIGGERED_BUFFER if (IIO_BUFFER)
select IIO_ST_ACCEL_BUFFER if (IIO_TRIGGERED_BUFFER)
help
Say yes here to build support for STMicroelectronics accelerometers:
LSM303DLH, LSM303DLHC, LIS3DH, LSM330D, LSM330DL, LSM330DLC,
LIS331DLH, LSM303DL, LSM303DLM, LSM330.

This driver can also be built as a module. If so, will be created
these modules:
- st_accel (core functions for the driver [it is mandatory]);
- st_accel_i2c (necessary for the I2C devices [optional*]);
- st_accel_spi (necessary for the SPI devices [optional*]);

(*) one of these is necessary to do something.

config IIO_ST_ACCEL_I2C_3AXIS
tristate
depends on IIO_ST_ACCEL_3AXIS
depends on IIO_ST_SENSORS_I2C

config IIO_ST_ACCEL_SPI_3AXIS
tristate
depends on IIO_ST_ACCEL_3AXIS
depends on IIO_ST_SENSORS_SPI

endmenu
9 changes: 9 additions & 0 deletions drivers/iio/accel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,12 @@
#

obj-$(CONFIG_HID_SENSOR_ACCEL_3D) += hid-sensor-accel-3d.o

obj-$(CONFIG_IIO_ST_ACCEL_3AXIS) += st_accel.o
st_accel-y := st_accel_core.o
st_accel-$(CONFIG_IIO_BUFFER) += st_accel_buffer.o

obj-$(CONFIG_IIO_ST_ACCEL_I2C_3AXIS) += st_accel_i2c.o
obj-$(CONFIG_IIO_ST_ACCEL_SPI_3AXIS) += st_accel_spi.o

obj-$(CONFIG_KXSD9) += kxsd9.o
3 changes: 1 addition & 2 deletions drivers/iio/accel/hid-sensor-accel-3d.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#include <linux/iio/buffer.h>
#include <linux/iio/trigger_consumer.h>
#include <linux/iio/triggered_buffer.h>
#include "../common/hid-sensors/hid-sensor-attributes.h"
#include "../common/hid-sensors/hid-sensor-trigger.h"

/*Format: HID-SENSOR-usage_id_in_hex*/
Expand All @@ -44,7 +43,7 @@ enum accel_3d_channel {

struct accel_3d_state {
struct hid_sensor_hub_callbacks callbacks;
struct hid_sensor_iio_common common_attributes;
struct hid_sensor_common common_attributes;
struct hid_sensor_hub_attribute_info accel[ACCEL_3D_CHANNEL_MAX];
u32 accel_val[ACCEL_3D_CHANNEL_MAX];
};
Expand Down
16 changes: 6 additions & 10 deletions drivers/staging/iio/accel/kxsd9.c → drivers/iio/accel/kxsd9.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ static int kxsd9_write_scale(struct iio_dev *indio_dev, int micro)

static int kxsd9_read(struct iio_dev *indio_dev, u8 address)
{
struct spi_message msg;
int ret;
struct kxsd9_state *st = iio_priv(indio_dev);
struct spi_transfer xfers[] = {
Expand All @@ -112,10 +111,7 @@ static int kxsd9_read(struct iio_dev *indio_dev, u8 address)

mutex_lock(&st->buf_lock);
st->tx[0] = KXSD9_READ(address);
spi_message_init(&msg);
spi_message_add_tail(&xfers[0], &msg);
spi_message_add_tail(&xfers[1], &msg);
ret = spi_sync(st->us, &msg);
ret = spi_sync_transfer(st->us, xfers, ARRAY_SIZE(xfers));
if (ret)
return ret;
return (((u16)(st->rx[0])) << 8) | (st->rx[1] & 0xF0);
Expand Down Expand Up @@ -226,7 +222,7 @@ static int kxsd9_probe(struct spi_device *spi)
{
struct iio_dev *indio_dev;
struct kxsd9_state *st;
int ret = 0;
int ret;

indio_dev = iio_device_alloc(sizeof(*st));
if (indio_dev == NULL) {
Expand All @@ -245,14 +241,14 @@ static int kxsd9_probe(struct spi_device *spi)
indio_dev->info = &kxsd9_info;
indio_dev->modes = INDIO_DIRECT_MODE;

ret = iio_device_register(indio_dev);
if (ret)
goto error_free_dev;

spi->mode = SPI_MODE_0;
spi_setup(spi);
kxsd9_power_up(st);

ret = iio_device_register(indio_dev);
if (ret)
goto error_free_dev;

return 0;

error_free_dev:
Expand Down
47 changes: 47 additions & 0 deletions drivers/iio/accel/st_accel.h
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 */
114 changes: 114 additions & 0 deletions drivers/iio/accel/st_accel_buffer.c
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");
Loading

0 comments on commit b5c78e0

Please sign in to comment.