Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 338011
b: refs/heads/master
c: 78026a6
h: refs/heads/master
i:
  338009: 16de0c9
  338007: 5cb2283
v: v3
  • Loading branch information
Lars-Peter Clausen authored and Jonathan Cameron committed Nov 20, 2012
1 parent 1401aa8 commit 167ca89
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 709ab36e9559ff5c7df6e6f2d9e3c4a4410f8d49
refs/heads/master: 78026a6fde8f7b0ca77c059da11f476d69dfde3b
23 changes: 23 additions & 0 deletions trunk/drivers/iio/imu/adis.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,29 @@ int adis_read_reg_16(struct adis *adis, unsigned int reg, uint16_t *val)
}
EXPORT_SYMBOL_GPL(adis_read_reg_16);

#ifdef CONFIG_DEBUG_FS

int adis_debugfs_reg_access(struct iio_dev *indio_dev,
unsigned int reg, unsigned int writeval, unsigned int *readval)
{
struct adis *adis = iio_device_get_drvdata(indio_dev);

if (readval) {
uint16_t val16;
int ret;

ret = adis_read_reg_16(adis, reg, &val16);
*readval = val16;

return ret;
} else {
return adis_write_reg_16(adis, reg, writeval);
}
}
EXPORT_SYMBOL(adis_debugfs_reg_access);

#endif

/**
* adis_enable_irq() - Enable or disable data ready IRQ
* @adis: The adis device
Expand Down
11 changes: 11 additions & 0 deletions trunk/include/linux/iio/imu/adis.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,4 +183,15 @@ static inline void adis_remove_trigger(struct adis *adis)

#endif /* CONFIG_IIO_BUFFER */

#ifdef CONFIG_DEBUG_FS

int adis_debugfs_reg_access(struct iio_dev *indio_dev,
unsigned int reg, unsigned int writeval, unsigned int *readval);

#else

#define adis_debugfs_reg_access NULL

#endif

#endif

0 comments on commit 167ca89

Please sign in to comment.