iio: adis: stylistic changes
[ Upstream commit c39010ea6ba13bdf0003bd353e1d4c663aaac0a8 ] Minor stylistic changes to address checkptach complains when called with '--strict'. Signed-off-by: Nuno Sá <nuno.sa@analog.com> Link: https://lore.kernel.org/r/20220122130905.99-3-nuno.sa@analog.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Stable-dep-of: 99c05e4283a1 ("iio: adis: add '__adis_enable_irq()' implementation") Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:

committed by
Greg Kroah-Hartman

parent
d1b73eebc7
commit
83e321a2ec
@@ -34,8 +34,8 @@
|
|||||||
* @value: The value to write to device (up to 4 bytes)
|
* @value: The value to write to device (up to 4 bytes)
|
||||||
* @size: The size of the @value (in bytes)
|
* @size: The size of the @value (in bytes)
|
||||||
*/
|
*/
|
||||||
int __adis_write_reg(struct adis *adis, unsigned int reg,
|
int __adis_write_reg(struct adis *adis, unsigned int reg, unsigned int value,
|
||||||
unsigned int value, unsigned int size)
|
unsigned int size)
|
||||||
{
|
{
|
||||||
unsigned int page = reg / ADIS_PAGE_SIZE;
|
unsigned int page = reg / ADIS_PAGE_SIZE;
|
||||||
int ret, i;
|
int ret, i;
|
||||||
@@ -118,7 +118,7 @@ int __adis_write_reg(struct adis *adis, unsigned int reg,
|
|||||||
ret = spi_sync(adis->spi, &msg);
|
ret = spi_sync(adis->spi, &msg);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
dev_err(&adis->spi->dev, "Failed to write register 0x%02X: %d\n",
|
dev_err(&adis->spi->dev, "Failed to write register 0x%02X: %d\n",
|
||||||
reg, ret);
|
reg, ret);
|
||||||
} else {
|
} else {
|
||||||
adis->current_page = page;
|
adis->current_page = page;
|
||||||
}
|
}
|
||||||
@@ -134,8 +134,8 @@ EXPORT_SYMBOL_GPL(__adis_write_reg);
|
|||||||
* @val: The value read back from the device
|
* @val: The value read back from the device
|
||||||
* @size: The size of the @val buffer
|
* @size: The size of the @val buffer
|
||||||
*/
|
*/
|
||||||
int __adis_read_reg(struct adis *adis, unsigned int reg,
|
int __adis_read_reg(struct adis *adis, unsigned int reg, unsigned int *val,
|
||||||
unsigned int *val, unsigned int size)
|
unsigned int size)
|
||||||
{
|
{
|
||||||
unsigned int page = reg / ADIS_PAGE_SIZE;
|
unsigned int page = reg / ADIS_PAGE_SIZE;
|
||||||
struct spi_message msg;
|
struct spi_message msg;
|
||||||
@@ -205,12 +205,12 @@ int __adis_read_reg(struct adis *adis, unsigned int reg,
|
|||||||
ret = spi_sync(adis->spi, &msg);
|
ret = spi_sync(adis->spi, &msg);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
dev_err(&adis->spi->dev, "Failed to read register 0x%02X: %d\n",
|
dev_err(&adis->spi->dev, "Failed to read register 0x%02X: %d\n",
|
||||||
reg, ret);
|
reg, ret);
|
||||||
return ret;
|
return ret;
|
||||||
} else {
|
|
||||||
adis->current_page = page;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
adis->current_page = page;
|
||||||
|
|
||||||
switch (size) {
|
switch (size) {
|
||||||
case 4:
|
case 4:
|
||||||
*val = get_unaligned_be32(adis->rx);
|
*val = get_unaligned_be32(adis->rx);
|
||||||
@@ -251,13 +251,13 @@ EXPORT_SYMBOL_GPL(__adis_update_bits_base);
|
|||||||
|
|
||||||
#ifdef CONFIG_DEBUG_FS
|
#ifdef CONFIG_DEBUG_FS
|
||||||
|
|
||||||
int adis_debugfs_reg_access(struct iio_dev *indio_dev,
|
int adis_debugfs_reg_access(struct iio_dev *indio_dev, unsigned int reg,
|
||||||
unsigned int reg, unsigned int writeval, unsigned int *readval)
|
unsigned int writeval, unsigned int *readval)
|
||||||
{
|
{
|
||||||
struct adis *adis = iio_device_get_drvdata(indio_dev);
|
struct adis *adis = iio_device_get_drvdata(indio_dev);
|
||||||
|
|
||||||
if (readval) {
|
if (readval) {
|
||||||
uint16_t val16;
|
u16 val16;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = adis_read_reg_16(adis, reg, &val16);
|
ret = adis_read_reg_16(adis, reg, &val16);
|
||||||
@@ -265,9 +265,9 @@ int adis_debugfs_reg_access(struct iio_dev *indio_dev,
|
|||||||
*readval = val16;
|
*readval = val16;
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
} else {
|
|
||||||
return adis_write_reg_16(adis, reg, writeval);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return adis_write_reg_16(adis, reg, writeval);
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(adis_debugfs_reg_access);
|
EXPORT_SYMBOL(adis_debugfs_reg_access);
|
||||||
|
|
||||||
@@ -283,14 +283,16 @@ EXPORT_SYMBOL(adis_debugfs_reg_access);
|
|||||||
int adis_enable_irq(struct adis *adis, bool enable)
|
int adis_enable_irq(struct adis *adis, bool enable)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
uint16_t msc;
|
u16 msc;
|
||||||
|
|
||||||
mutex_lock(&adis->state_lock);
|
mutex_lock(&adis->state_lock);
|
||||||
|
|
||||||
if (adis->data->enable_irq) {
|
if (adis->data->enable_irq) {
|
||||||
ret = adis->data->enable_irq(adis, enable);
|
ret = adis->data->enable_irq(adis, enable);
|
||||||
goto out_unlock;
|
goto out_unlock;
|
||||||
} else if (adis->data->unmasked_drdy) {
|
}
|
||||||
|
|
||||||
|
if (adis->data->unmasked_drdy) {
|
||||||
if (enable)
|
if (enable)
|
||||||
enable_irq(adis->spi->irq);
|
enable_irq(adis->spi->irq);
|
||||||
else
|
else
|
||||||
@@ -326,7 +328,7 @@ EXPORT_SYMBOL(adis_enable_irq);
|
|||||||
*/
|
*/
|
||||||
int __adis_check_status(struct adis *adis)
|
int __adis_check_status(struct adis *adis)
|
||||||
{
|
{
|
||||||
uint16_t status;
|
u16 status;
|
||||||
int ret;
|
int ret;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@@ -362,7 +364,7 @@ int __adis_reset(struct adis *adis)
|
|||||||
const struct adis_timeout *timeouts = adis->data->timeouts;
|
const struct adis_timeout *timeouts = adis->data->timeouts;
|
||||||
|
|
||||||
ret = __adis_write_reg_8(adis, adis->data->glob_cmd_reg,
|
ret = __adis_write_reg_8(adis, adis->data->glob_cmd_reg,
|
||||||
ADIS_GLOB_CMD_SW_RESET);
|
ADIS_GLOB_CMD_SW_RESET);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
dev_err(&adis->spi->dev, "Failed to reset device: %d\n", ret);
|
dev_err(&adis->spi->dev, "Failed to reset device: %d\n", ret);
|
||||||
return ret;
|
return ret;
|
||||||
@@ -418,7 +420,7 @@ int __adis_initial_startup(struct adis *adis)
|
|||||||
{
|
{
|
||||||
const struct adis_timeout *timeouts = adis->data->timeouts;
|
const struct adis_timeout *timeouts = adis->data->timeouts;
|
||||||
struct gpio_desc *gpio;
|
struct gpio_desc *gpio;
|
||||||
uint16_t prod_id;
|
u16 prod_id;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
/* check if the device has rst pin low */
|
/* check if the device has rst pin low */
|
||||||
@@ -427,7 +429,7 @@ int __adis_initial_startup(struct adis *adis)
|
|||||||
return PTR_ERR(gpio);
|
return PTR_ERR(gpio);
|
||||||
|
|
||||||
if (gpio) {
|
if (gpio) {
|
||||||
msleep(10);
|
usleep_range(10, 12);
|
||||||
/* bring device out of reset */
|
/* bring device out of reset */
|
||||||
gpiod_set_value_cansleep(gpio, 0);
|
gpiod_set_value_cansleep(gpio, 0);
|
||||||
msleep(timeouts->reset_ms);
|
msleep(timeouts->reset_ms);
|
||||||
@@ -481,7 +483,8 @@ EXPORT_SYMBOL_GPL(__adis_initial_startup);
|
|||||||
* a error bit in the channels raw value set error_mask to 0.
|
* a error bit in the channels raw value set error_mask to 0.
|
||||||
*/
|
*/
|
||||||
int adis_single_conversion(struct iio_dev *indio_dev,
|
int adis_single_conversion(struct iio_dev *indio_dev,
|
||||||
const struct iio_chan_spec *chan, unsigned int error_mask, int *val)
|
const struct iio_chan_spec *chan,
|
||||||
|
unsigned int error_mask, int *val)
|
||||||
{
|
{
|
||||||
struct adis *adis = iio_device_get_drvdata(indio_dev);
|
struct adis *adis = iio_device_get_drvdata(indio_dev);
|
||||||
unsigned int uval;
|
unsigned int uval;
|
||||||
@@ -490,7 +493,7 @@ int adis_single_conversion(struct iio_dev *indio_dev,
|
|||||||
mutex_lock(&adis->state_lock);
|
mutex_lock(&adis->state_lock);
|
||||||
|
|
||||||
ret = __adis_read_reg(adis, chan->address, &uval,
|
ret = __adis_read_reg(adis, chan->address, &uval,
|
||||||
chan->scan_type.storagebits / 8);
|
chan->scan_type.storagebits / 8);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto err_unlock;
|
goto err_unlock;
|
||||||
|
|
||||||
@@ -525,7 +528,7 @@ EXPORT_SYMBOL_GPL(adis_single_conversion);
|
|||||||
* called.
|
* called.
|
||||||
*/
|
*/
|
||||||
int adis_init(struct adis *adis, struct iio_dev *indio_dev,
|
int adis_init(struct adis *adis, struct iio_dev *indio_dev,
|
||||||
struct spi_device *spi, const struct adis_data *data)
|
struct spi_device *spi, const struct adis_data *data)
|
||||||
{
|
{
|
||||||
if (!data || !data->timeouts) {
|
if (!data || !data->timeouts) {
|
||||||
dev_err(&spi->dev, "No config data or timeouts not defined!\n");
|
dev_err(&spi->dev, "No config data or timeouts not defined!\n");
|
||||||
|
@@ -20,7 +20,7 @@
|
|||||||
#include <linux/iio/imu/adis.h>
|
#include <linux/iio/imu/adis.h>
|
||||||
|
|
||||||
static int adis_update_scan_mode_burst(struct iio_dev *indio_dev,
|
static int adis_update_scan_mode_burst(struct iio_dev *indio_dev,
|
||||||
const unsigned long *scan_mask)
|
const unsigned long *scan_mask)
|
||||||
{
|
{
|
||||||
struct adis *adis = iio_device_get_drvdata(indio_dev);
|
struct adis *adis = iio_device_get_drvdata(indio_dev);
|
||||||
unsigned int burst_length, burst_max_length;
|
unsigned int burst_length, burst_max_length;
|
||||||
@@ -63,7 +63,7 @@ static int adis_update_scan_mode_burst(struct iio_dev *indio_dev,
|
|||||||
}
|
}
|
||||||
|
|
||||||
int adis_update_scan_mode(struct iio_dev *indio_dev,
|
int adis_update_scan_mode(struct iio_dev *indio_dev,
|
||||||
const unsigned long *scan_mask)
|
const unsigned long *scan_mask)
|
||||||
{
|
{
|
||||||
struct adis *adis = iio_device_get_drvdata(indio_dev);
|
struct adis *adis = iio_device_get_drvdata(indio_dev);
|
||||||
const struct iio_chan_spec *chan;
|
const struct iio_chan_spec *chan;
|
||||||
@@ -149,7 +149,7 @@ static irqreturn_t adis_trigger_handler(int irq, void *p)
|
|||||||
}
|
}
|
||||||
|
|
||||||
iio_push_to_buffers_with_timestamp(indio_dev, adis->buffer,
|
iio_push_to_buffers_with_timestamp(indio_dev, adis->buffer,
|
||||||
pf->timestamp);
|
pf->timestamp);
|
||||||
|
|
||||||
iio_trigger_notify_done(indio_dev->trig);
|
iio_trigger_notify_done(indio_dev->trig);
|
||||||
|
|
||||||
|
@@ -15,8 +15,7 @@
|
|||||||
#include <linux/iio/trigger.h>
|
#include <linux/iio/trigger.h>
|
||||||
#include <linux/iio/imu/adis.h>
|
#include <linux/iio/imu/adis.h>
|
||||||
|
|
||||||
static int adis_data_rdy_trigger_set_state(struct iio_trigger *trig,
|
static int adis_data_rdy_trigger_set_state(struct iio_trigger *trig, bool state)
|
||||||
bool state)
|
|
||||||
{
|
{
|
||||||
struct adis *adis = iio_trigger_get_drvdata(trig);
|
struct adis *adis = iio_trigger_get_drvdata(trig);
|
||||||
|
|
||||||
|
@@ -32,6 +32,7 @@ struct adis_timeout {
|
|||||||
u16 sw_reset_ms;
|
u16 sw_reset_ms;
|
||||||
u16 self_test_ms;
|
u16 self_test_ms;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* struct adis_data - ADIS chip variant specific data
|
* struct adis_data - ADIS chip variant specific data
|
||||||
* @read_delay: SPI delay for read operations in us
|
* @read_delay: SPI delay for read operations in us
|
||||||
@@ -45,7 +46,7 @@ struct adis_timeout {
|
|||||||
* @self_test_mask: Bitmask of supported self-test operations
|
* @self_test_mask: Bitmask of supported self-test operations
|
||||||
* @self_test_reg: Register address to request self test command
|
* @self_test_reg: Register address to request self test command
|
||||||
* @self_test_no_autoclear: True if device's self-test needs clear of ctrl reg
|
* @self_test_no_autoclear: True if device's self-test needs clear of ctrl reg
|
||||||
* @status_error_msgs: Array of error messgaes
|
* @status_error_msgs: Array of error messages
|
||||||
* @status_error_mask: Bitmask of errors supported by the device
|
* @status_error_mask: Bitmask of errors supported by the device
|
||||||
* @timeouts: Chip specific delays
|
* @timeouts: Chip specific delays
|
||||||
* @enable_irq: Hook for ADIS devices that have a special IRQ enable/disable
|
* @enable_irq: Hook for ADIS devices that have a special IRQ enable/disable
|
||||||
@@ -128,12 +129,12 @@ struct adis {
|
|||||||
unsigned long irq_flag;
|
unsigned long irq_flag;
|
||||||
void *buffer;
|
void *buffer;
|
||||||
|
|
||||||
uint8_t tx[10] ____cacheline_aligned;
|
u8 tx[10] ____cacheline_aligned;
|
||||||
uint8_t rx[4];
|
u8 rx[4];
|
||||||
};
|
};
|
||||||
|
|
||||||
int adis_init(struct adis *adis, struct iio_dev *indio_dev,
|
int adis_init(struct adis *adis, struct iio_dev *indio_dev,
|
||||||
struct spi_device *spi, const struct adis_data *data);
|
struct spi_device *spi, const struct adis_data *data);
|
||||||
int __adis_reset(struct adis *adis);
|
int __adis_reset(struct adis *adis);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -154,9 +155,9 @@ static inline int adis_reset(struct adis *adis)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int __adis_write_reg(struct adis *adis, unsigned int reg,
|
int __adis_write_reg(struct adis *adis, unsigned int reg,
|
||||||
unsigned int val, unsigned int size);
|
unsigned int val, unsigned int size);
|
||||||
int __adis_read_reg(struct adis *adis, unsigned int reg,
|
int __adis_read_reg(struct adis *adis, unsigned int reg,
|
||||||
unsigned int *val, unsigned int size);
|
unsigned int *val, unsigned int size);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* __adis_write_reg_8() - Write single byte to a register (unlocked)
|
* __adis_write_reg_8() - Write single byte to a register (unlocked)
|
||||||
@@ -165,7 +166,7 @@ int __adis_read_reg(struct adis *adis, unsigned int reg,
|
|||||||
* @value: The value to write
|
* @value: The value to write
|
||||||
*/
|
*/
|
||||||
static inline int __adis_write_reg_8(struct adis *adis, unsigned int reg,
|
static inline int __adis_write_reg_8(struct adis *adis, unsigned int reg,
|
||||||
uint8_t val)
|
u8 val)
|
||||||
{
|
{
|
||||||
return __adis_write_reg(adis, reg, val, 1);
|
return __adis_write_reg(adis, reg, val, 1);
|
||||||
}
|
}
|
||||||
@@ -177,7 +178,7 @@ static inline int __adis_write_reg_8(struct adis *adis, unsigned int reg,
|
|||||||
* @value: Value to be written
|
* @value: Value to be written
|
||||||
*/
|
*/
|
||||||
static inline int __adis_write_reg_16(struct adis *adis, unsigned int reg,
|
static inline int __adis_write_reg_16(struct adis *adis, unsigned int reg,
|
||||||
uint16_t val)
|
u16 val)
|
||||||
{
|
{
|
||||||
return __adis_write_reg(adis, reg, val, 2);
|
return __adis_write_reg(adis, reg, val, 2);
|
||||||
}
|
}
|
||||||
@@ -189,7 +190,7 @@ static inline int __adis_write_reg_16(struct adis *adis, unsigned int reg,
|
|||||||
* @value: Value to be written
|
* @value: Value to be written
|
||||||
*/
|
*/
|
||||||
static inline int __adis_write_reg_32(struct adis *adis, unsigned int reg,
|
static inline int __adis_write_reg_32(struct adis *adis, unsigned int reg,
|
||||||
uint32_t val)
|
u32 val)
|
||||||
{
|
{
|
||||||
return __adis_write_reg(adis, reg, val, 4);
|
return __adis_write_reg(adis, reg, val, 4);
|
||||||
}
|
}
|
||||||
@@ -201,7 +202,7 @@ static inline int __adis_write_reg_32(struct adis *adis, unsigned int reg,
|
|||||||
* @val: The value read back from the device
|
* @val: The value read back from the device
|
||||||
*/
|
*/
|
||||||
static inline int __adis_read_reg_16(struct adis *adis, unsigned int reg,
|
static inline int __adis_read_reg_16(struct adis *adis, unsigned int reg,
|
||||||
uint16_t *val)
|
u16 *val)
|
||||||
{
|
{
|
||||||
unsigned int tmp;
|
unsigned int tmp;
|
||||||
int ret;
|
int ret;
|
||||||
@@ -220,7 +221,7 @@ static inline int __adis_read_reg_16(struct adis *adis, unsigned int reg,
|
|||||||
* @val: The value read back from the device
|
* @val: The value read back from the device
|
||||||
*/
|
*/
|
||||||
static inline int __adis_read_reg_32(struct adis *adis, unsigned int reg,
|
static inline int __adis_read_reg_32(struct adis *adis, unsigned int reg,
|
||||||
uint32_t *val)
|
u32 *val)
|
||||||
{
|
{
|
||||||
unsigned int tmp;
|
unsigned int tmp;
|
||||||
int ret;
|
int ret;
|
||||||
@@ -240,7 +241,7 @@ static inline int __adis_read_reg_32(struct adis *adis, unsigned int reg,
|
|||||||
* @size: The size of the @value (in bytes)
|
* @size: The size of the @value (in bytes)
|
||||||
*/
|
*/
|
||||||
static inline int adis_write_reg(struct adis *adis, unsigned int reg,
|
static inline int adis_write_reg(struct adis *adis, unsigned int reg,
|
||||||
unsigned int val, unsigned int size)
|
unsigned int val, unsigned int size)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
@@ -259,7 +260,7 @@ static inline int adis_write_reg(struct adis *adis, unsigned int reg,
|
|||||||
* @size: The size of the @val buffer
|
* @size: The size of the @val buffer
|
||||||
*/
|
*/
|
||||||
static int adis_read_reg(struct adis *adis, unsigned int reg,
|
static int adis_read_reg(struct adis *adis, unsigned int reg,
|
||||||
unsigned int *val, unsigned int size)
|
unsigned int *val, unsigned int size)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
@@ -277,7 +278,7 @@ static int adis_read_reg(struct adis *adis, unsigned int reg,
|
|||||||
* @value: The value to write
|
* @value: The value to write
|
||||||
*/
|
*/
|
||||||
static inline int adis_write_reg_8(struct adis *adis, unsigned int reg,
|
static inline int adis_write_reg_8(struct adis *adis, unsigned int reg,
|
||||||
uint8_t val)
|
u8 val)
|
||||||
{
|
{
|
||||||
return adis_write_reg(adis, reg, val, 1);
|
return adis_write_reg(adis, reg, val, 1);
|
||||||
}
|
}
|
||||||
@@ -289,7 +290,7 @@ static inline int adis_write_reg_8(struct adis *adis, unsigned int reg,
|
|||||||
* @value: Value to be written
|
* @value: Value to be written
|
||||||
*/
|
*/
|
||||||
static inline int adis_write_reg_16(struct adis *adis, unsigned int reg,
|
static inline int adis_write_reg_16(struct adis *adis, unsigned int reg,
|
||||||
uint16_t val)
|
u16 val)
|
||||||
{
|
{
|
||||||
return adis_write_reg(adis, reg, val, 2);
|
return adis_write_reg(adis, reg, val, 2);
|
||||||
}
|
}
|
||||||
@@ -301,7 +302,7 @@ static inline int adis_write_reg_16(struct adis *adis, unsigned int reg,
|
|||||||
* @value: Value to be written
|
* @value: Value to be written
|
||||||
*/
|
*/
|
||||||
static inline int adis_write_reg_32(struct adis *adis, unsigned int reg,
|
static inline int adis_write_reg_32(struct adis *adis, unsigned int reg,
|
||||||
uint32_t val)
|
u32 val)
|
||||||
{
|
{
|
||||||
return adis_write_reg(adis, reg, val, 4);
|
return adis_write_reg(adis, reg, val, 4);
|
||||||
}
|
}
|
||||||
@@ -313,7 +314,7 @@ static inline int adis_write_reg_32(struct adis *adis, unsigned int reg,
|
|||||||
* @val: The value read back from the device
|
* @val: The value read back from the device
|
||||||
*/
|
*/
|
||||||
static inline int adis_read_reg_16(struct adis *adis, unsigned int reg,
|
static inline int adis_read_reg_16(struct adis *adis, unsigned int reg,
|
||||||
uint16_t *val)
|
u16 *val)
|
||||||
{
|
{
|
||||||
unsigned int tmp;
|
unsigned int tmp;
|
||||||
int ret;
|
int ret;
|
||||||
@@ -332,7 +333,7 @@ static inline int adis_read_reg_16(struct adis *adis, unsigned int reg,
|
|||||||
* @val: The value read back from the device
|
* @val: The value read back from the device
|
||||||
*/
|
*/
|
||||||
static inline int adis_read_reg_32(struct adis *adis, unsigned int reg,
|
static inline int adis_read_reg_32(struct adis *adis, unsigned int reg,
|
||||||
uint32_t *val)
|
u32 *val)
|
||||||
{
|
{
|
||||||
unsigned int tmp;
|
unsigned int tmp;
|
||||||
int ret;
|
int ret;
|
||||||
@@ -431,8 +432,8 @@ static inline int adis_initial_startup(struct adis *adis)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int adis_single_conversion(struct iio_dev *indio_dev,
|
int adis_single_conversion(struct iio_dev *indio_dev,
|
||||||
const struct iio_chan_spec *chan, unsigned int error_mask,
|
const struct iio_chan_spec *chan,
|
||||||
int *val);
|
unsigned int error_mask, int *val);
|
||||||
|
|
||||||
#define ADIS_VOLTAGE_CHAN(addr, si, chan, name, info_all, bits) { \
|
#define ADIS_VOLTAGE_CHAN(addr, si, chan, name, info_all, bits) { \
|
||||||
.type = IIO_VOLTAGE, \
|
.type = IIO_VOLTAGE, \
|
||||||
@@ -481,7 +482,7 @@ int adis_single_conversion(struct iio_dev *indio_dev,
|
|||||||
.modified = 1, \
|
.modified = 1, \
|
||||||
.channel2 = IIO_MOD_ ## mod, \
|
.channel2 = IIO_MOD_ ## mod, \
|
||||||
.info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | \
|
.info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | \
|
||||||
info_sep, \
|
(info_sep), \
|
||||||
.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \
|
.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \
|
||||||
.info_mask_shared_by_all = info_all, \
|
.info_mask_shared_by_all = info_all, \
|
||||||
.address = (addr), \
|
.address = (addr), \
|
||||||
@@ -515,7 +516,7 @@ devm_adis_setup_buffer_and_trigger(struct adis *adis, struct iio_dev *indio_dev,
|
|||||||
int devm_adis_probe_trigger(struct adis *adis, struct iio_dev *indio_dev);
|
int devm_adis_probe_trigger(struct adis *adis, struct iio_dev *indio_dev);
|
||||||
|
|
||||||
int adis_update_scan_mode(struct iio_dev *indio_dev,
|
int adis_update_scan_mode(struct iio_dev *indio_dev,
|
||||||
const unsigned long *scan_mask);
|
const unsigned long *scan_mask);
|
||||||
|
|
||||||
#else /* CONFIG_IIO_BUFFER */
|
#else /* CONFIG_IIO_BUFFER */
|
||||||
|
|
||||||
@@ -539,7 +540,8 @@ static inline int devm_adis_probe_trigger(struct adis *adis,
|
|||||||
#ifdef CONFIG_DEBUG_FS
|
#ifdef CONFIG_DEBUG_FS
|
||||||
|
|
||||||
int adis_debugfs_reg_access(struct iio_dev *indio_dev,
|
int adis_debugfs_reg_access(struct iio_dev *indio_dev,
|
||||||
unsigned int reg, unsigned int writeval, unsigned int *readval);
|
unsigned int reg, unsigned int writeval,
|
||||||
|
unsigned int *readval);
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user