-
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.
yaml --- r: 220290 b: refs/heads/master c: 349282d h: refs/heads/master v: v3
- Loading branch information
Michael Hennerich
authored and
Greg Kroah-Hartman
committed
Oct 12, 2010
1 parent
0a57a21
commit 3b8d027
Showing
6 changed files
with
600 additions
and
1 deletion.
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
--- | ||
refs/heads/master: 1dd8b73227be6023df0be3a478c6086848cebd2e | ||
refs/heads/master: 349282d82e929e7982ca53510437c0850ab5294a |
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,79 @@ | ||
/* | ||
* AD7476/5/7/8 (A) SPI ADC driver | ||
* | ||
* Copyright 2010 Analog Devices Inc. | ||
* | ||
* Licensed under the GPL-2 or later. | ||
*/ | ||
#ifndef IIO_ADC_AD7476_H_ | ||
#define IIO_ADC_AD7476_H_ | ||
|
||
#define RES_MASK(bits) ((1 << (bits)) - 1) | ||
|
||
/* | ||
* TODO: struct ad7476_platform_data needs to go into include/linux/iio | ||
*/ | ||
|
||
struct ad7476_platform_data { | ||
u16 vref_mv; | ||
}; | ||
|
||
struct ad7476_chip_info { | ||
u8 bits; | ||
u8 storagebits; | ||
u8 res_shift; | ||
char sign; | ||
u16 int_vref_mv; | ||
}; | ||
|
||
struct ad7476_state { | ||
struct iio_dev *indio_dev; | ||
struct spi_device *spi; | ||
const struct ad7476_chip_info *chip_info; | ||
struct regulator *reg; | ||
struct work_struct poll_work; | ||
atomic_t protect_ring; | ||
u16 int_vref_mv; | ||
struct spi_transfer xfer; | ||
struct spi_message msg; | ||
/* | ||
* DMA (thus cache coherency maintenance) requires the | ||
* transfer buffers to live in their own cache lines. | ||
*/ | ||
unsigned char data[2] ____cacheline_aligned; | ||
}; | ||
|
||
enum ad7476_supported_device_ids { | ||
ID_AD7466, | ||
ID_AD7467, | ||
ID_AD7468, | ||
ID_AD7475, | ||
ID_AD7476, | ||
ID_AD7477, | ||
ID_AD7478, | ||
ID_AD7495 | ||
}; | ||
|
||
#ifdef CONFIG_IIO_RING_BUFFER | ||
int ad7476_scan_from_ring(struct ad7476_state *st); | ||
int ad7476_register_ring_funcs_and_init(struct iio_dev *indio_dev); | ||
void ad7476_ring_cleanup(struct iio_dev *indio_dev); | ||
#else /* CONFIG_IIO_RING_BUFFER */ | ||
static inline ssize_t ad7476_scan_from_ring(struct device *dev, | ||
struct device_attribute *attr, | ||
char *buf) | ||
{ | ||
return 0; | ||
} | ||
|
||
static inline int | ||
ad7476_register_ring_funcs_and_init(struct iio_dev *indio_dev) | ||
{ | ||
return 0; | ||
} | ||
|
||
static inline void ad7476_ring_cleanup(struct iio_dev *indio_dev) | ||
{ | ||
} | ||
#endif /* CONFIG_IIO_RING_BUFFER */ | ||
#endif /* IIO_ADC_AD7476_H_ */ |
Oops, something went wrong.