You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
Merge tag 'iio-for-3.18b' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next
Jonathan writes:
Second round of new IIO drivers, features and cleanups for the 3.18 cycle.
New drivers and part support
* Bosch bmg160 Gyroscope driver
* Dyna-Image al3320a ambient light sensor driver
* Bosh bmi055 gyroscope part driver (accelerometer part supported by bmc150)
* isl29018 - add support for isl29023 and isl29035
* kxcjk-1013 - add support for kxcj9-1008 and kxtj2-1009
* bmc150 - additional part support (BMI055 accelerometer part, BMA255,
BMA222E, BMA250E and BMA280). Different resolutions but otherwise similar
parts.
* bma180 - add BMA250 (note different from the BMA250E support above despite
the naming). A lot of driver reworking lead up to this - described below.
New features
* kxcjk1013 - add threshold event support.
* rockchip - document DT bindings.
* isl29018 - ACPI support
* bma180 - enable use without IRQ
Cleanups
* Tree wide - drop owner field assignment if using the module_platform_driver
helper as that assigns it anyway.
* kxcjk1013 - drop a redundant assignment of the current range and fix a
a defined but not used warning.
* inv_mpu6050 - Remove an unnecessary cast form a void pointer.
* rockchip - drop and unused variable.
* at91_adc - make a local function static.
* st-sensors-core - correctly handle an error in setting in
st_sensors_set_drdy_int_pin
* isl29018 - typo fix
* bmc150 - fix incorrect scale value for 16G range (Driver new this cycle)
* bmc150 - fix issues when CONFIG_PM_RUNTIME not set (Driver new this cycle)
* ad7606 - line length tidy up.
* bmg160 - set power state only if PM_RUNTIME is defined.
* ak8975 - fix some unnecessary casting between char * and const char *
* bma180 - prefix remaining bits and bobs with bma180_ and ensure consistent.
- use a bool instead of an int for state (as its either on or off).
- expose the temperature channel
- statically allocate buffers to avoid need for update_scan_mode
callback.
- refactor to allow futher chip variants including support for part
specific config and disable code + different resolutions.
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
What: /sys/bus/iio/devices/triggerX/name = "bmg160-any-motion-devX"
|
||||
KernelVersion: 3.17
|
||||
Contact: linux-iio@vger.kernel.org
|
||||
Description:
|
||||
The BMG160 gyro kernel module provides an additional trigger,
|
||||
which sets driver in a mode, where data is pushed to the buffer
|
||||
only when there is any motion.
|
||||
@@ -0,0 +1,24 @@
|
||||
Rockchip Successive Approximation Register (SAR) A/D Converter bindings
|
||||
|
||||
Required properties:
|
||||
- compatible: Should be "rockchip,saradc"
|
||||
- reg: physical base address of the controller and length of memory mapped
|
||||
region.
|
||||
- interrupts: The interrupt number to the cpu. The interrupt specifier format
|
||||
depends on the interrupt controller.
|
||||
- clocks: Must contain an entry for each entry in clock-names.
|
||||
- clock-names: Shall be "saradc" for the converter-clock, and "apb_pclk" for
|
||||
the peripheral clock.
|
||||
- vref-supply: The regulator supply ADC reference voltage.
|
||||
- #io-channel-cells: Should be 1, see ../iio-bindings.txt
|
||||
|
||||
Example:
|
||||
saradc: saradc@2006c000 {
|
||||
compatible = "rockchip,saradc";
|
||||
reg = <0x2006c000 0x100>;
|
||||
interrupts = <GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>;
|
||||
clocks = <&cru SCLK_SARADC>, <&cru PCLK_SARADC>;
|
||||
clock-names = "saradc", "apb_pclk";
|
||||
#io-channel-cells = <1>;
|
||||
vref-supply = <&vcc18>;
|
||||
};
|
||||
@@ -6,13 +6,13 @@
|
||||
menu "Accelerometers"
|
||||
|
||||
config BMA180
|
||||
tristate "Bosch BMA180 3-Axis Accelerometer Driver"
|
||||
tristate "Bosch BMA180/BMA250 3-Axis Accelerometer Driver"
|
||||
depends on I2C
|
||||
select IIO_BUFFER
|
||||
select IIO_TRIGGERED_BUFFER
|
||||
help
|
||||
Say Y here if you want to build a driver for the Bosch BMA180
|
||||
triaxial acceleration sensor.
|
||||
Say Y here if you want to build a driver for the Bosch BMA180 or
|
||||
BMA250 triaxial acceleration sensor.
|
||||
|
||||
To compile this driver as a module, choose M here: the
|
||||
module will be called bma180.
|
||||
@@ -23,7 +23,9 @@ config BMC150_ACCEL
|
||||
select IIO_BUFFER
|
||||
select IIO_TRIGGERED_BUFFER
|
||||
help
|
||||
Say yes here to build support for the Bosch BMC150 accelerometer.
|
||||
Say yes here to build support for the following Bosch accelerometers:
|
||||
BMC150, BMI055, BMA250E, BMA222E, BMA255, BMA280.
|
||||
|
||||
Currently this only supports the device via an i2c interface.
|
||||
|
||||
This is a combo module with both accelerometer and magnetometer.
|
||||
@@ -97,7 +99,8 @@ config KXCJK1013
|
||||
select IIO_TRIGGERED_BUFFER
|
||||
help
|
||||
Say Y here if you want to build a driver for the Kionix KXCJK-1013
|
||||
triaxial acceleration sensor.
|
||||
triaxial acceleration sensor. This driver also supports KXCJ9-1008
|
||||
and KXTJ2-1009.
|
||||
|
||||
To compile this driver as a module, choose M here: the module will
|
||||
be called kxcjk-1013.
|
||||
|
||||
+333
-151
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,12 @@
|
||||
/*
|
||||
* BMC150 3-axis accelerometer driver
|
||||
* 3-axis accelerometer driver supporting following Bosch-Sensortec chips:
|
||||
* - BMC150
|
||||
* - BMI055
|
||||
* - BMA255
|
||||
* - BMA250E
|
||||
* - BMA222E
|
||||
* - BMA280
|
||||
*
|
||||
* Copyright (c) 2014, Intel Corporation.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
@@ -34,7 +41,6 @@
|
||||
#define BMC150_ACCEL_GPIO_NAME "bmc150_accel_int"
|
||||
|
||||
#define BMC150_ACCEL_REG_CHIP_ID 0x00
|
||||
#define BMC150_ACCEL_CHIP_ID_VAL 0xFA
|
||||
|
||||
#define BMC150_ACCEL_REG_INT_STATUS_2 0x0B
|
||||
#define BMC150_ACCEL_ANY_MOTION_MASK 0x07
|
||||
@@ -126,6 +132,18 @@ enum bmc150_power_modes {
|
||||
BMC150_ACCEL_SLEEP_MODE_SUSPEND = 0x04,
|
||||
};
|
||||
|
||||
struct bmc150_scale_info {
|
||||
int scale;
|
||||
u8 reg_range;
|
||||
};
|
||||
|
||||
struct bmc150_accel_chip_info {
|
||||
u8 chip_id;
|
||||
const struct iio_chan_spec *channels;
|
||||
int num_channels;
|
||||
const struct bmc150_scale_info scale_table[4];
|
||||
};
|
||||
|
||||
struct bmc150_accel_data {
|
||||
struct i2c_client *client;
|
||||
struct iio_trigger *dready_trig;
|
||||
@@ -140,6 +158,7 @@ struct bmc150_accel_data {
|
||||
bool dready_trigger_on;
|
||||
bool motion_trigger_on;
|
||||
int64_t timestamp;
|
||||
const struct bmc150_accel_chip_info *chip_info;
|
||||
};
|
||||
|
||||
static const struct {
|
||||
@@ -167,17 +186,9 @@ static const struct {
|
||||
{0x0E, 1},
|
||||
{0x0F, 1} };
|
||||
|
||||
static const struct {
|
||||
int scale;
|
||||
int range;
|
||||
} bmc150_accel_scale_table[] = { {9610, BMC150_ACCEL_DEF_RANGE_2G},
|
||||
{19122, BMC150_ACCEL_DEF_RANGE_4G},
|
||||
{38344, BMC150_ACCEL_DEF_RANGE_8G},
|
||||
{77057, BMC150_ACCEL_DEF_RANGE_16G} };
|
||||
|
||||
static const struct {
|
||||
int sleep_dur;
|
||||
int reg_value;
|
||||
u8 reg_value;
|
||||
} bmc150_accel_sleep_value_table[] = { {0, 0},
|
||||
{500, BMC150_ACCEL_SLEEP_500_MICRO},
|
||||
{1000, BMC150_ACCEL_SLEEP_1_MS},
|
||||
@@ -267,7 +278,7 @@ static int bmc150_accel_chip_init(struct bmc150_accel_data *data)
|
||||
}
|
||||
|
||||
dev_dbg(&data->client->dev, "Chip Id %x\n", ret);
|
||||
if (ret != BMC150_ACCEL_CHIP_ID_VAL) {
|
||||
if (ret != data->chip_info->chip_id) {
|
||||
dev_err(&data->client->dev, "Invalid chip %x\n", ret);
|
||||
return -ENODEV;
|
||||
}
|
||||
@@ -499,6 +510,7 @@ static int bmc150_accel_get_bw(struct bmc150_accel_data *data, int *val,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PM_RUNTIME
|
||||
static int bmc150_accel_get_startup_times(struct bmc150_accel_data *data)
|
||||
{
|
||||
int i;
|
||||
@@ -529,24 +541,30 @@ static int bmc150_accel_set_power_state(struct bmc150_accel_data *data, bool on)
|
||||
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
static int bmc150_accel_set_power_state(struct bmc150_accel_data *data, bool on)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
static int bmc150_accel_set_scale(struct bmc150_accel_data *data, int val)
|
||||
{
|
||||
int ret, i;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(bmc150_accel_scale_table); ++i) {
|
||||
if (bmc150_accel_scale_table[i].scale == val) {
|
||||
for (i = 0; i < ARRAY_SIZE(data->chip_info->scale_table); ++i) {
|
||||
if (data->chip_info->scale_table[i].scale == val) {
|
||||
ret = i2c_smbus_write_byte_data(
|
||||
data->client,
|
||||
BMC150_ACCEL_REG_PMU_RANGE,
|
||||
bmc150_accel_scale_table[i].range);
|
||||
data->client,
|
||||
BMC150_ACCEL_REG_PMU_RANGE,
|
||||
data->chip_info->scale_table[i].reg_range);
|
||||
if (ret < 0) {
|
||||
dev_err(&data->client->dev,
|
||||
"Error writing pmu_range\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
data->range = bmc150_accel_scale_table[i].range;
|
||||
data->range = data->chip_info->scale_table[i].reg_range;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -573,10 +591,12 @@ static int bmc150_accel_get_temp(struct bmc150_accel_data *data, int *val)
|
||||
return IIO_VAL_INT;
|
||||
}
|
||||
|
||||
static int bmc150_accel_get_axis(struct bmc150_accel_data *data, int axis,
|
||||
static int bmc150_accel_get_axis(struct bmc150_accel_data *data,
|
||||
struct iio_chan_spec const *chan,
|
||||
int *val)
|
||||
{
|
||||
int ret;
|
||||
int axis = chan->scan_index;
|
||||
|
||||
mutex_lock(&data->mutex);
|
||||
ret = bmc150_accel_set_power_state(data, true);
|
||||
@@ -593,7 +613,8 @@ static int bmc150_accel_get_axis(struct bmc150_accel_data *data, int axis,
|
||||
mutex_unlock(&data->mutex);
|
||||
return ret;
|
||||
}
|
||||
*val = sign_extend32(ret >> 4, 11);
|
||||
*val = sign_extend32(ret >> chan->scan_type.shift,
|
||||
chan->scan_type.realbits - 1);
|
||||
ret = bmc150_accel_set_power_state(data, false);
|
||||
mutex_unlock(&data->mutex);
|
||||
if (ret < 0)
|
||||
@@ -618,9 +639,7 @@ static int bmc150_accel_read_raw(struct iio_dev *indio_dev,
|
||||
if (iio_buffer_enabled(indio_dev))
|
||||
return -EBUSY;
|
||||
else
|
||||
return bmc150_accel_get_axis(data,
|
||||
chan->scan_index,
|
||||
val);
|
||||
return bmc150_accel_get_axis(data, chan, val);
|
||||
default:
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -639,13 +658,13 @@ static int bmc150_accel_read_raw(struct iio_dev *indio_dev,
|
||||
case IIO_ACCEL:
|
||||
{
|
||||
int i;
|
||||
const struct bmc150_scale_info *si;
|
||||
int st_size = ARRAY_SIZE(data->chip_info->scale_table);
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(bmc150_accel_scale_table);
|
||||
++i) {
|
||||
if (bmc150_accel_scale_table[i].range ==
|
||||
data->range) {
|
||||
*val2 =
|
||||
bmc150_accel_scale_table[i].scale;
|
||||
for (i = 0; i < st_size; ++i) {
|
||||
si = &data->chip_info->scale_table[i];
|
||||
if (si->reg_range == data->range) {
|
||||
*val2 = si->scale;
|
||||
return IIO_VAL_INT_PLUS_MICRO;
|
||||
}
|
||||
}
|
||||
@@ -833,7 +852,7 @@ static const struct iio_event_spec bmc150_accel_event = {
|
||||
BIT(IIO_EV_INFO_PERIOD)
|
||||
};
|
||||
|
||||
#define BMC150_ACCEL_CHANNEL(_axis) { \
|
||||
#define BMC150_ACCEL_CHANNEL(_axis, bits) { \
|
||||
.type = IIO_ACCEL, \
|
||||
.modified = 1, \
|
||||
.channel2 = IIO_MOD_##_axis, \
|
||||
@@ -843,26 +862,101 @@ static const struct iio_event_spec bmc150_accel_event = {
|
||||
.scan_index = AXIS_##_axis, \
|
||||
.scan_type = { \
|
||||
.sign = 's', \
|
||||
.realbits = 12, \
|
||||
.realbits = (bits), \
|
||||
.storagebits = 16, \
|
||||
.shift = 4, \
|
||||
.shift = 16 - (bits), \
|
||||
}, \
|
||||
.event_spec = &bmc150_accel_event, \
|
||||
.num_event_specs = 1 \
|
||||
}
|
||||
|
||||
static const struct iio_chan_spec bmc150_accel_channels[] = {
|
||||
{
|
||||
.type = IIO_TEMP,
|
||||
.info_mask_separate = BIT(IIO_CHAN_INFO_RAW) |
|
||||
BIT(IIO_CHAN_INFO_SCALE) |
|
||||
BIT(IIO_CHAN_INFO_OFFSET),
|
||||
.scan_index = -1,
|
||||
#define BMC150_ACCEL_CHANNELS(bits) { \
|
||||
{ \
|
||||
.type = IIO_TEMP, \
|
||||
.info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | \
|
||||
BIT(IIO_CHAN_INFO_SCALE) | \
|
||||
BIT(IIO_CHAN_INFO_OFFSET), \
|
||||
.scan_index = -1, \
|
||||
}, \
|
||||
BMC150_ACCEL_CHANNEL(X, bits), \
|
||||
BMC150_ACCEL_CHANNEL(Y, bits), \
|
||||
BMC150_ACCEL_CHANNEL(Z, bits), \
|
||||
IIO_CHAN_SOFT_TIMESTAMP(3), \
|
||||
}
|
||||
|
||||
static const struct iio_chan_spec bma222e_accel_channels[] =
|
||||
BMC150_ACCEL_CHANNELS(8);
|
||||
static const struct iio_chan_spec bma250e_accel_channels[] =
|
||||
BMC150_ACCEL_CHANNELS(10);
|
||||
static const struct iio_chan_spec bmc150_accel_channels[] =
|
||||
BMC150_ACCEL_CHANNELS(12);
|
||||
static const struct iio_chan_spec bma280_accel_channels[] =
|
||||
BMC150_ACCEL_CHANNELS(14);
|
||||
|
||||
enum {
|
||||
bmc150,
|
||||
bmi055,
|
||||
bma255,
|
||||
bma250e,
|
||||
bma222e,
|
||||
bma280,
|
||||
};
|
||||
|
||||
static const struct bmc150_accel_chip_info bmc150_accel_chip_info_tbl[] = {
|
||||
[bmc150] = {
|
||||
.chip_id = 0xFA,
|
||||
.channels = bmc150_accel_channels,
|
||||
.num_channels = ARRAY_SIZE(bmc150_accel_channels),
|
||||
.scale_table = { {9610, BMC150_ACCEL_DEF_RANGE_2G},
|
||||
{19122, BMC150_ACCEL_DEF_RANGE_4G},
|
||||
{38344, BMC150_ACCEL_DEF_RANGE_8G},
|
||||
{76590, BMC150_ACCEL_DEF_RANGE_16G} },
|
||||
},
|
||||
[bmi055] = {
|
||||
.chip_id = 0xFA,
|
||||
.channels = bmc150_accel_channels,
|
||||
.num_channels = ARRAY_SIZE(bmc150_accel_channels),
|
||||
.scale_table = { {9610, BMC150_ACCEL_DEF_RANGE_2G},
|
||||
{19122, BMC150_ACCEL_DEF_RANGE_4G},
|
||||
{38344, BMC150_ACCEL_DEF_RANGE_8G},
|
||||
{76590, BMC150_ACCEL_DEF_RANGE_16G} },
|
||||
},
|
||||
[bma255] = {
|
||||
.chip_id = 0xFA,
|
||||
.channels = bmc150_accel_channels,
|
||||
.num_channels = ARRAY_SIZE(bmc150_accel_channels),
|
||||
.scale_table = { {9610, BMC150_ACCEL_DEF_RANGE_2G},
|
||||
{19122, BMC150_ACCEL_DEF_RANGE_4G},
|
||||
{38344, BMC150_ACCEL_DEF_RANGE_8G},
|
||||
{76590, BMC150_ACCEL_DEF_RANGE_16G} },
|
||||
},
|
||||
[bma250e] = {
|
||||
.chip_id = 0xF9,
|
||||
.channels = bma250e_accel_channels,
|
||||
.num_channels = ARRAY_SIZE(bma250e_accel_channels),
|
||||
.scale_table = { {38344, BMC150_ACCEL_DEF_RANGE_2G},
|
||||
{76590, BMC150_ACCEL_DEF_RANGE_4G},
|
||||
{153277, BMC150_ACCEL_DEF_RANGE_8G},
|
||||
{306457, BMC150_ACCEL_DEF_RANGE_16G} },
|
||||
},
|
||||
[bma222e] = {
|
||||
.chip_id = 0xF8,
|
||||
.channels = bma222e_accel_channels,
|
||||
.num_channels = ARRAY_SIZE(bma222e_accel_channels),
|
||||
.scale_table = { {153277, BMC150_ACCEL_DEF_RANGE_2G},
|
||||
{306457, BMC150_ACCEL_DEF_RANGE_4G},
|
||||
{612915, BMC150_ACCEL_DEF_RANGE_8G},
|
||||
{1225831, BMC150_ACCEL_DEF_RANGE_16G} },
|
||||
},
|
||||
[bma280] = {
|
||||
.chip_id = 0xFB,
|
||||
.channels = bma280_accel_channels,
|
||||
.num_channels = ARRAY_SIZE(bma280_accel_channels),
|
||||
.scale_table = { {2392, BMC150_ACCEL_DEF_RANGE_2G},
|
||||
{4785, BMC150_ACCEL_DEF_RANGE_4G},
|
||||
{9581, BMC150_ACCEL_DEF_RANGE_8G},
|
||||
{19152, BMC150_ACCEL_DEF_RANGE_16G} },
|
||||
},
|
||||
BMC150_ACCEL_CHANNEL(X),
|
||||
BMC150_ACCEL_CHANNEL(Y),
|
||||
BMC150_ACCEL_CHANNEL(Z),
|
||||
IIO_CHAN_SOFT_TIMESTAMP(3),
|
||||
};
|
||||
|
||||
static const struct iio_info bmc150_accel_info = {
|
||||
@@ -1033,10 +1127,23 @@ static irqreturn_t bmc150_accel_data_rdy_trig_poll(int irq, void *private)
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
|
||||
static int bmc150_accel_acpi_gpio_probe(struct i2c_client *client,
|
||||
struct bmc150_accel_data *data)
|
||||
static const char *bmc150_accel_match_acpi_device(struct device *dev, int *data)
|
||||
{
|
||||
const struct acpi_device_id *id;
|
||||
|
||||
id = acpi_match_device(dev->driver->acpi_match_table, dev);
|
||||
|
||||
if (!id)
|
||||
return NULL;
|
||||
|
||||
*data = (int) id->driver_data;
|
||||
|
||||
return dev_name(dev);
|
||||
}
|
||||
|
||||
static int bmc150_accel_gpio_probe(struct i2c_client *client,
|
||||
struct bmc150_accel_data *data)
|
||||
{
|
||||
struct device *dev;
|
||||
struct gpio_desc *gpio;
|
||||
int ret;
|
||||
@@ -1045,17 +1152,11 @@ static int bmc150_accel_acpi_gpio_probe(struct i2c_client *client,
|
||||
return -EINVAL;
|
||||
|
||||
dev = &client->dev;
|
||||
if (!ACPI_HANDLE(dev))
|
||||
return -ENODEV;
|
||||
|
||||
id = acpi_match_device(dev->driver->acpi_match_table, dev);
|
||||
if (!id)
|
||||
return -ENODEV;
|
||||
|
||||
/* data ready gpio interrupt pin */
|
||||
gpio = devm_gpiod_get_index(dev, BMC150_ACCEL_GPIO_NAME, 0);
|
||||
if (IS_ERR(gpio)) {
|
||||
dev_err(dev, "Failed: acpi gpio get index\n");
|
||||
dev_err(dev, "Failed: gpio get index\n");
|
||||
return PTR_ERR(gpio);
|
||||
}
|
||||
|
||||
@@ -1076,6 +1177,8 @@ static int bmc150_accel_probe(struct i2c_client *client,
|
||||
struct bmc150_accel_data *data;
|
||||
struct iio_dev *indio_dev;
|
||||
int ret;
|
||||
const char *name = NULL;
|
||||
int chip_id = 0;
|
||||
|
||||
indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*data));
|
||||
if (!indio_dev)
|
||||
@@ -1085,6 +1188,16 @@ static int bmc150_accel_probe(struct i2c_client *client,
|
||||
i2c_set_clientdata(client, indio_dev);
|
||||
data->client = client;
|
||||
|
||||
if (id) {
|
||||
name = id->name;
|
||||
chip_id = id->driver_data;
|
||||
}
|
||||
|
||||
if (ACPI_HANDLE(&client->dev))
|
||||
name = bmc150_accel_match_acpi_device(&client->dev, &chip_id);
|
||||
|
||||
data->chip_info = &bmc150_accel_chip_info_tbl[chip_id];
|
||||
|
||||
ret = bmc150_accel_chip_init(data);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
@@ -1092,14 +1205,14 @@ static int bmc150_accel_probe(struct i2c_client *client,
|
||||
mutex_init(&data->mutex);
|
||||
|
||||
indio_dev->dev.parent = &client->dev;
|
||||
indio_dev->channels = bmc150_accel_channels;
|
||||
indio_dev->num_channels = ARRAY_SIZE(bmc150_accel_channels);
|
||||
indio_dev->name = BMC150_ACCEL_DRV_NAME;
|
||||
indio_dev->channels = data->chip_info->channels;
|
||||
indio_dev->num_channels = data->chip_info->num_channels;
|
||||
indio_dev->name = name;
|
||||
indio_dev->modes = INDIO_DIRECT_MODE;
|
||||
indio_dev->info = &bmc150_accel_info;
|
||||
|
||||
if (client->irq < 0)
|
||||
client->irq = bmc150_accel_acpi_gpio_probe(client, data);
|
||||
client->irq = bmc150_accel_gpio_probe(client, data);
|
||||
|
||||
if (client->irq >= 0) {
|
||||
ret = devm_request_threaded_irq(
|
||||
@@ -1277,14 +1390,24 @@ static const struct dev_pm_ops bmc150_accel_pm_ops = {
|
||||
};
|
||||
|
||||
static const struct acpi_device_id bmc150_accel_acpi_match[] = {
|
||||
{"BSBA0150", 0},
|
||||
{"BMC150A", 0},
|
||||
{"BSBA0150", bmc150},
|
||||
{"BMC150A", bmc150},
|
||||
{"BMI055A", bmi055},
|
||||
{"BMA0255", bma255},
|
||||
{"BMA250E", bma250e},
|
||||
{"BMA222E", bma222e},
|
||||
{"BMA0280", bma280},
|
||||
{ },
|
||||
};
|
||||
MODULE_DEVICE_TABLE(acpi, bmc150_accel_acpi_match);
|
||||
|
||||
static const struct i2c_device_id bmc150_accel_id[] = {
|
||||
{"bmc150_accel", 0},
|
||||
{"bmc150_accel", bmc150},
|
||||
{"bmi055_accel", bmi055},
|
||||
{"bma255", bma255},
|
||||
{"bma250e", bma250e},
|
||||
{"bma222e", bma222e},
|
||||
{"bma280", bma280},
|
||||
{}
|
||||
};
|
||||
|
||||
|
||||
@@ -419,7 +419,6 @@ static struct platform_driver hid_accel_3d_platform_driver = {
|
||||
.id_table = hid_accel_3d_ids,
|
||||
.driver = {
|
||||
.name = KBUILD_MODNAME,
|
||||
.owner = THIS_MODULE,
|
||||
},
|
||||
.probe = hid_accel_3d_probe,
|
||||
.remove = hid_accel_3d_remove,
|
||||
|
||||
+540
-73
File diff suppressed because it is too large
Load Diff
@@ -266,7 +266,7 @@ static irqreturn_t at91_adc_trigger_handler(int irq, void *p)
|
||||
}
|
||||
|
||||
/* Handler for classic adc channel eoc trigger */
|
||||
void handle_adc_eoc_trigger(int irq, struct iio_dev *idev)
|
||||
static void handle_adc_eoc_trigger(int irq, struct iio_dev *idev)
|
||||
{
|
||||
struct at91_adc_state *st = iio_priv(idev);
|
||||
|
||||
|
||||
@@ -723,7 +723,6 @@ static struct platform_driver exynos_adc_driver = {
|
||||
.remove = exynos_adc_remove,
|
||||
.driver = {
|
||||
.name = "exynos-adc",
|
||||
.owner = THIS_MODULE,
|
||||
.of_match_table = exynos_adc_match,
|
||||
.pm = &exynos_adc_pm_ops,
|
||||
},
|
||||
|
||||
@@ -244,7 +244,6 @@ static struct platform_driver lp8788_adc_driver = {
|
||||
.remove = lp8788_adc_remove,
|
||||
.driver = {
|
||||
.name = LP8788_DEV_ADC,
|
||||
.owner = THIS_MODULE,
|
||||
},
|
||||
};
|
||||
module_platform_driver(lp8788_adc_driver);
|
||||
|
||||
@@ -141,7 +141,6 @@ static int rockchip_saradc_probe(struct platform_device *pdev)
|
||||
struct resource *mem;
|
||||
int ret;
|
||||
int irq;
|
||||
u32 rate;
|
||||
|
||||
if (!np)
|
||||
return -ENODEV;
|
||||
|
||||
@@ -545,7 +545,6 @@ MODULE_DEVICE_TABLE(of, ti_adc_dt_ids);
|
||||
static struct platform_driver tiadc_driver = {
|
||||
.driver = {
|
||||
.name = "TI-am335x-adc",
|
||||
.owner = THIS_MODULE,
|
||||
.pm = TIADC_PM_OPS,
|
||||
.of_match_table = ti_adc_dt_ids,
|
||||
},
|
||||
|
||||
@@ -883,7 +883,6 @@ static struct platform_driver twl4030_madc_driver = {
|
||||
.remove = twl4030_madc_remove,
|
||||
.driver = {
|
||||
.name = "twl4030_madc",
|
||||
.owner = THIS_MODULE,
|
||||
.of_match_table = of_match_ptr(twl_madc_of_match),
|
||||
},
|
||||
};
|
||||
|
||||
@@ -994,7 +994,6 @@ static struct platform_driver twl6030_gpadc_driver = {
|
||||
.remove = twl6030_gpadc_remove,
|
||||
.driver = {
|
||||
.name = DRIVER_NAME,
|
||||
.owner = THIS_MODULE,
|
||||
.pm = &twl6030_gpadc_pm_ops,
|
||||
.of_match_table = of_twl6030_match_tbl,
|
||||
},
|
||||
|
||||
@@ -698,7 +698,6 @@ static struct platform_driver vf610_adc_driver = {
|
||||
.remove = vf610_adc_remove,
|
||||
.driver = {
|
||||
.name = DRIVER_NAME,
|
||||
.owner = THIS_MODULE,
|
||||
.of_match_table = vf610_adc_match,
|
||||
.pm = &vf610_adc_pm_ops,
|
||||
},
|
||||
|
||||
@@ -145,7 +145,6 @@ static int vprbrd_adc_probe(struct platform_device *pdev)
|
||||
static struct platform_driver vprbrd_adc_driver = {
|
||||
.driver = {
|
||||
.name = "viperboard-adc",
|
||||
.owner = THIS_MODULE,
|
||||
},
|
||||
.probe = vprbrd_adc_probe,
|
||||
};
|
||||
|
||||
@@ -306,8 +306,11 @@ int st_sensors_init_sensor(struct iio_dev *indio_dev,
|
||||
if (of_pdata)
|
||||
pdata = of_pdata;
|
||||
|
||||
if (pdata)
|
||||
if (pdata) {
|
||||
err = st_sensors_set_drdy_int_pin(indio_dev, pdata);
|
||||
if (err < 0)
|
||||
return err;
|
||||
}
|
||||
|
||||
err = st_sensors_set_enable(indio_dev, false);
|
||||
if (err < 0)
|
||||
|
||||
@@ -50,6 +50,17 @@ config ADXRS450
|
||||
This driver can also be built as a module. If so, the module
|
||||
will be called adxrs450.
|
||||
|
||||
config BMG160
|
||||
tristate "BOSCH BMG160 Gyro Sensor"
|
||||
depends on I2C
|
||||
select IIO_TRIGGERED_BUFFER if IIO_BUFFER
|
||||
help
|
||||
Say yes here to build support for Bosch BMG160 Tri-axis Gyro Sensor
|
||||
driver. This driver also supports BMI055 gyroscope.
|
||||
|
||||
This driver can also be built as a module. If so, the module
|
||||
will be called bmg160.
|
||||
|
||||
config HID_SENSOR_GYRO_3D
|
||||
depends on HID_SENSOR_HUB
|
||||
select IIO_BUFFER
|
||||
|
||||
@@ -8,6 +8,7 @@ obj-$(CONFIG_ADIS16130) += adis16130.o
|
||||
obj-$(CONFIG_ADIS16136) += adis16136.o
|
||||
obj-$(CONFIG_ADIS16260) += adis16260.o
|
||||
obj-$(CONFIG_ADXRS450) += adxrs450.o
|
||||
obj-$(CONFIG_BMG160) += bmg160.o
|
||||
|
||||
obj-$(CONFIG_HID_SENSOR_GYRO_3D) += hid-sensor-gyro-3d.o
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user