Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -152,24 +152,24 @@ enum max1363_modes {
/**
 * struct max1363_chip_info - chip specifc information
 * @name:		indentification string for chip
 * @num_inputs:		number of physical inputs on chip
 * @bits:		accuracy of the adc in bits
 * @int_vref_mv:	the internal reference voltage
 * @monitor_mode:	whether the chip supports monitor interrupts
 * @mode_list:		array of available scan modes
 * @num_modes:		the number of scan modes available
 * @default_mode:	the scan mode in which the chip starts up
 * @channel:		channel specification
 * @num_channels:	number of channels
 */
struct max1363_chip_info {
	u8				num_inputs;
	u8				bits;
	u16				int_vref_mv;
	bool				monitor_mode;
	const enum max1363_modes	*mode_list;
	int				num_modes;
	enum max1363_modes		default_mode;
	struct attribute_group		*dev_attrs;
	struct attribute_group		*scan_attrs;
	struct iio_chan_spec *channels;
	int num_channels;
};

/**
+329 −814

File changed.

Preview size limit exceeded, changes collapsed.

+0 −1
Original line number Diff line number Diff line
@@ -199,7 +199,6 @@ int max1363_register_ring_funcs_and_init(struct iio_dev *indio_dev)
		goto error_deallocate_sw_rb;

	/* 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->preenable = &max1363_ring_preenable;
	indio_dev->ring->predisable = &iio_triggered_ring_predisable;