diff options
Diffstat (limited to 'drivers/iio/dac/ad5686.h')
-rw-r--r-- | drivers/iio/dac/ad5686.h | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/iio/dac/ad5686.h b/drivers/iio/dac/ad5686.h index 70a779939ddb..b7ade3a6b9b6 100644 --- a/drivers/iio/dac/ad5686.h +++ b/drivers/iio/dac/ad5686.h @@ -13,6 +13,8 @@ #include <linux/mutex.h> #include <linux/kernel.h> +#include <linux/iio/iio.h> + #define AD5310_CMD(x) ((x) << 12) #define AD5683_DATA(x) ((x) << 4) @@ -52,12 +54,15 @@ enum ad5686_supported_device_ids { ID_AD5310R, ID_AD5311R, + ID_AD5338R, ID_AD5671R, ID_AD5672R, + ID_AD5673R, ID_AD5674R, ID_AD5675R, ID_AD5676, ID_AD5676R, + ID_AD5677R, ID_AD5679R, ID_AD5681R, ID_AD5682R, @@ -104,7 +109,7 @@ typedef int (*ad5686_read_func)(struct ad5686_state *st, u8 addr); struct ad5686_chip_info { u16 int_vref_mv; unsigned int num_channels; - struct iio_chan_spec *channels; + const struct iio_chan_spec *channels; enum ad5686_regmap_type regmap_type; }; @@ -117,6 +122,7 @@ struct ad5686_chip_info { * @pwr_down_mask: power down mask * @pwr_down_mode: current power down mode * @use_internal_vref: set to true if the internal reference voltage is used + * @lock lock to protect the data buffer during regmap ops * @data: spi transfer buffers */ @@ -130,9 +136,10 @@ struct ad5686_state { ad5686_write_func write; ad5686_read_func read; bool use_internal_vref; + struct mutex lock; /* - * DMA (thus cache coherency maintenance) requires the + * DMA (thus cache coherency maintenance) may require the * transfer buffers to live in their own cache lines. */ @@ -140,7 +147,7 @@ struct ad5686_state { __be32 d32; __be16 d16; u8 d8[4]; - } data[3] ____cacheline_aligned; + } data[3] __aligned(IIO_DMA_MINALIGN); }; @@ -149,7 +156,7 @@ int ad5686_probe(struct device *dev, const char *name, ad5686_write_func write, ad5686_read_func read); -int ad5686_remove(struct device *dev); +void ad5686_remove(struct device *dev); #endif /* __DRIVERS_IIO_DAC_AD5686_H__ */ |