Commit 298cd976 authored by Jonathan Cameron's avatar Jonathan Cameron Committed by Greg Kroah-Hartman

staging:iio:max1363 - move to channel_spec registration.

V3: move to single chan registration macro. Also introduce some
local macros to greatly reduce code length when setting up the
chan_spec arrays for all the different devices.

V2: update read_raw for two value approach.
Signed-off-by: default avatarJonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent f3736416
...@@ -152,24 +152,24 @@ enum max1363_modes { ...@@ -152,24 +152,24 @@ enum max1363_modes {
/** /**
* struct max1363_chip_info - chip specifc information * struct max1363_chip_info - chip specifc information
* @name: indentification string for chip * @name: indentification string for chip
* @num_inputs: number of physical inputs on chip
* @bits: accuracy of the adc in bits * @bits: accuracy of the adc in bits
* @int_vref_mv: the internal reference voltage * @int_vref_mv: the internal reference voltage
* @monitor_mode: whether the chip supports monitor interrupts * @monitor_mode: whether the chip supports monitor interrupts
* @mode_list: array of available scan modes * @mode_list: array of available scan modes
* @num_modes: the number of scan modes available * @num_modes: the number of scan modes available
* @default_mode: the scan mode in which the chip starts up * @default_mode: the scan mode in which the chip starts up
* @channel: channel specification
* @num_channels: number of channels
*/ */
struct max1363_chip_info { struct max1363_chip_info {
u8 num_inputs;
u8 bits; u8 bits;
u16 int_vref_mv; u16 int_vref_mv;
bool monitor_mode; bool monitor_mode;
const enum max1363_modes *mode_list; const enum max1363_modes *mode_list;
int num_modes; int num_modes;
enum max1363_modes default_mode; enum max1363_modes default_mode;
struct attribute_group *dev_attrs; struct iio_chan_spec *channels;
struct attribute_group *scan_attrs; int num_channels;
}; };
/** /**
......
This diff is collapsed.
...@@ -199,7 +199,6 @@ int max1363_register_ring_funcs_and_init(struct iio_dev *indio_dev) ...@@ -199,7 +199,6 @@ int max1363_register_ring_funcs_and_init(struct iio_dev *indio_dev)
goto error_deallocate_sw_rb; goto error_deallocate_sw_rb;
/* Ring buffer functions - here trigger setup related */ /* Ring buffer functions - here trigger setup related */
indio_dev->ring->scan_el_attrs = st->chip_info->scan_attrs;
indio_dev->ring->postenable = &iio_triggered_ring_postenable; indio_dev->ring->postenable = &iio_triggered_ring_postenable;
indio_dev->ring->preenable = &max1363_ring_preenable; indio_dev->ring->preenable = &max1363_ring_preenable;
indio_dev->ring->predisable = &iio_triggered_ring_predisable; indio_dev->ring->predisable = &iio_triggered_ring_predisable;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment