···179179 * @scale: scale * 10^-6180180 * @temp_output: some devices have temperature sensors.181181 * @measurement_mode_freq: normal mode sampling frequency182182+ * @measurement_mode_3db_freq: 3db cutoff frequency of the low pass filter for183183+ * the normal measurement mode.182184 * @option_mode_1: first optional mode. Not all models have one183185 * @option_mode_1_freq: option mode 1 sampling frequency186186+ * @option_mode_1_3db_freq: 3db cutoff frequency of the low pass filter for187187+ * the first option mode.184188 * @option_mode_2: second optional mode. Not all chips have one185189 * @option_mode_2_freq: option mode 2 sampling frequency190190+ * @option_mode_2_3db_freq: 3db cutoff frequency of the low pass filter for191191+ * the second option mode.192192+ * @mod_det_mult_xz: Bit wise multipliers to calculate the threshold193193+ * for motion detection in the x and z axis.194194+ * @mod_det_mult_y: Bit wise multipliers to calculate the threshold195195+ * for motion detection in the y axis.186196 *187197 * This structure is used to hold information about the functionality of a given188198 * sca3000 variant.···303293}304294305295/**306306- * sca3000_reg_lock_on() test if the ctrl register lock is on296296+ * sca3000_reg_lock_on() - test if the ctrl register lock is on297297+ * @st: Driver specific device instance data.307298 *308299 * Lock must be held.309300 **/···320309}321310322311/**323323- * __sca3000_unlock_reg_lock() unlock the control registers312312+ * __sca3000_unlock_reg_lock() - unlock the control registers313313+ * @st: Driver specific device instance data.324314 *325315 * Note the device does not appear to support doing this in a single transfer.326316 * This should only ever be used as part of ctrl reg read.327317 * Lock must be held before calling this328328- **/318318+ */329319static int __sca3000_unlock_reg_lock(struct sca3000_state *st)330320{331321 struct spi_transfer xfer[3] = {···355343356344/**357345 * sca3000_write_ctrl_reg() write to a lock protect ctrl register346346+ * @st: Driver specific device instance data.358347 * @sel: selects which registers we wish to write to359348 * @val: the value to be written360349 *···363350 * register and use a shared write address. This function allows writing of364351 * these registers.365352 * Lock must be held.366366- **/353353+ */367354static int sca3000_write_ctrl_reg(struct sca3000_state *st,368355 u8 sel,369356 uint8_t val)···393380394381/**395382 * sca3000_read_ctrl_reg() read from lock protected control register.383383+ * @st: Driver specific device instance data.384384+ * @ctrl_reg: Which ctrl register do we want to read.396385 *397386 * Lock must be held.398398- **/387387+ */399388static int sca3000_read_ctrl_reg(struct sca3000_state *st,400389 u8 ctrl_reg)401390{···425410426411/**427412 * sca3000_show_rev() - sysfs interface to read the chip revision number428428- **/413413+ * @indio_dev: Device instance specific generic IIO data.414414+ * Driver specific device instance data can be obtained via415415+ * via iio_priv(indio_dev)416416+ */429417static int sca3000_print_rev(struct iio_dev *indio_dev)430418{431419 int ret;···558540};559541560542/**561561- * __sca3000_get_base_freq() obtain mode specific base frequency543543+ * __sca3000_get_base_freq() - obtain mode specific base frequency544544+ * @st: Private driver specific device instance specific state.545545+ * @info: chip type specific information.546546+ * @base_freq: Base frequency for the current measurement mode.562547 *563548 * lock must be held564564- **/549549+ */565550static inline int __sca3000_get_base_freq(struct sca3000_state *st,566551 const struct sca3000_chip_info *info,567552 int *base_freq)···592571}593572594573/**595595- * read_raw handler for IIO_CHAN_INFO_SAMP_FREQ574574+ * sca3000_read_raw_samp_freq() - read_raw handler for IIO_CHAN_INFO_SAMP_FREQ575575+ * @st: Private driver specific device instance specific state.576576+ * @val: The frequency read back.596577 *597578 * lock must be held598579 **/599599-static int read_raw_samp_freq(struct sca3000_state *st, int *val)580580+static int sca3000_read_raw_samp_freq(struct sca3000_state *st, int *val)600581{601582 int ret;602583···626603}627604628605/**629629- * write_raw handler for IIO_CHAN_INFO_SAMP_FREQ606606+ * sca3000_write_raw_samp_freq() - write_raw handler for IIO_CHAN_INFO_SAMP_FREQ607607+ * @st: Private driver specific device instance specific state.608608+ * @val: The frequency desired.630609 *631610 * lock must be held632632- **/633633-static int write_raw_samp_freq(struct sca3000_state *st, int val)611611+ */612612+static int sca3000_write_raw_samp_freq(struct sca3000_state *st, int val)634613{635614 int ret, base_freq, ctrlval;636615···763738 return IIO_VAL_INT_PLUS_MICRO;764739 case IIO_CHAN_INFO_SAMP_FREQ:765740 mutex_lock(&st->lock);766766- ret = read_raw_samp_freq(st, val);741741+ ret = sca3000_read_raw_samp_freq(st, val);767742 mutex_unlock(&st->lock);768743 return ret ? ret : IIO_VAL_INT;769744 case IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY:···788763 if (val2)789764 return -EINVAL;790765 mutex_lock(&st->lock);791791- ret = write_raw_samp_freq(st, val);766766+ ret = sca3000_write_raw_samp_freq(st, val);792767 mutex_unlock(&st->lock);793768 return ret;794769 case IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY:···805780}806781807782/**808808- * sca3000_read_av_freq() sysfs function to get available frequencies783783+ * sca3000_read_av_freq() - sysfs function to get available frequencies784784+ * @dev: Device structure for this device.785785+ * @attr: Description of the attribute.786786+ * @buf: Incoming string809787 *810788 * The later modes are only relevant to the ring buffer - and depend on current811789 * mode. Note that data sheet gives rather wide tolerances for these so integer···903875}904876905877/**906906- * sca3000_write_value() control of threshold and period907907- **/878878+ * sca3000_write_value() - control of threshold and period879879+ * @indio_dev: Device instance specific IIO information.880880+ * @chan: Description of the channel for which the event is being881881+ * configured.882882+ * @type: The type of event being configured, here magnitude rising883883+ * as everything else is read only.884884+ * @dir: Direction of the event (here rising)885885+ * @info: What information about the event are we configuring.886886+ * Here the threshold only.887887+ * @val: Integer part of the value being written..888888+ * @val2: Non integer part of the value being written. Here always 0.889889+ */908890static int sca3000_write_event_value(struct iio_dev *indio_dev,909891 const struct iio_chan_spec *chan,910892 enum iio_event_type type,···989951}990952991953/**992992- * sca3000_ring_int_process() ring specific interrupt handling.993993- *994994- * This is only split from the main interrupt handler so as to995995- * reduce the amount of code if the ring buffer is not enabled.996996- **/954954+ * sca3000_ring_int_process() - ring specific interrupt handling.955955+ * @val: Value of the interrupt status register.956956+ * @indio_dev: Device instance specific IIO device structure.957957+ */997958static void sca3000_ring_int_process(u8 val, struct iio_dev *indio_dev)998959{999960 struct sca3000_state *st = iio_priv(indio_dev);···10319941032995/**1033996 * sca3000_event_handler() - handling ring and non ring events997997+ * @irq: The irq being handled.998998+ * @private: struct iio_device pointer for the device.1034999 *10351000 * Ring related interrupt handler. Depending on event, push to10361001 * the ring buffer event chrdev or the event one.···10401001 * This function is complicated by the fact that the devices can signify ring10411002 * and non ring events via the same interrupt line and they can only10421003 * be distinguished via a read of the relevant status register.10431043- **/10041004+ */10441005static irqreturn_t sca3000_event_handler(int irq, void *private)10451006{10461007 struct iio_dev *indio_dev = private;···12281189}1229119012301191/**12311231- * sca3000_write_event_config() simple on off control for motion detector11921192+ * sca3000_write_event_config() - simple on off control for motion detector11931193+ * @indio_dev: IIO device instance specific structure. Data specific to this11941194+ * particular driver may be accessed via iio_priv(indio_dev).11951195+ * @chan: Description of the channel whose event we are configuring.11961196+ * @type: The type of event.11971197+ * @dir: The direction of the event.11981198+ * @state: Desired state of event being configured.12321199 *12331200 * This is a per axis control, but enabling any will result in the12341201 * motion detector unit being enabled.···13181273}1319127413201275/**13211321- * sca3000_hw_ring_preenable() hw ring buffer preenable function12761276+ * sca3000_hw_ring_preenable() - hw ring buffer preenable function12771277+ * @indio_dev: structure representing the IIO device. Device instance12781278+ * specific state can be accessed via iio_priv(indio_dev).13221279 *13231280 * Very simple enable function as the chip will allows normal reads13241281 * during ring buffer operation so as long as it is indeed running13251282 * before we notify the core, the precise ordering does not matter.13261326- **/12831283+ */13271284static int sca3000_hw_ring_preenable(struct iio_dev *indio_dev)13281285{13291286 int ret;···13821335};1383133613841337/**13851385- * sca3000_clean_setup() get the device into a predictable state13381338+ * sca3000_clean_setup() - get the device into a predictable state13391339+ * @st: Device instance specific private data structure13861340 *13871341 * Devices use flash memory to store many of the register values13881342 * and hence can come up in somewhat unpredictable states.13891343 * Hence reset everything on driver load.13901390- **/13441344+ */13911345static int sca3000_clean_setup(struct sca3000_state *st)13921346{13931347 int ret;