Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging:iio:accel:sca3000 kernel docify comments that were nearly kernel doc.

Basic tidy up of comments to bring them into a standard style.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>

+77 -29
+77 -29
drivers/staging/iio/accel/sca3000.c
··· 179 179 * @scale: scale * 10^-6 180 180 * @temp_output: some devices have temperature sensors. 181 181 * @measurement_mode_freq: normal mode sampling frequency 182 + * @measurement_mode_3db_freq: 3db cutoff frequency of the low pass filter for 183 + * the normal measurement mode. 182 184 * @option_mode_1: first optional mode. Not all models have one 183 185 * @option_mode_1_freq: option mode 1 sampling frequency 186 + * @option_mode_1_3db_freq: 3db cutoff frequency of the low pass filter for 187 + * the first option mode. 184 188 * @option_mode_2: second optional mode. Not all chips have one 185 189 * @option_mode_2_freq: option mode 2 sampling frequency 190 + * @option_mode_2_3db_freq: 3db cutoff frequency of the low pass filter for 191 + * the second option mode. 192 + * @mod_det_mult_xz: Bit wise multipliers to calculate the threshold 193 + * for motion detection in the x and z axis. 194 + * @mod_det_mult_y: Bit wise multipliers to calculate the threshold 195 + * for motion detection in the y axis. 186 196 * 187 197 * This structure is used to hold information about the functionality of a given 188 198 * sca3000 variant. ··· 303 293 } 304 294 305 295 /** 306 - * sca3000_reg_lock_on() test if the ctrl register lock is on 296 + * sca3000_reg_lock_on() - test if the ctrl register lock is on 297 + * @st: Driver specific device instance data. 307 298 * 308 299 * Lock must be held. 309 300 **/ ··· 320 309 } 321 310 322 311 /** 323 - * __sca3000_unlock_reg_lock() unlock the control registers 312 + * __sca3000_unlock_reg_lock() - unlock the control registers 313 + * @st: Driver specific device instance data. 324 314 * 325 315 * Note the device does not appear to support doing this in a single transfer. 326 316 * This should only ever be used as part of ctrl reg read. 327 317 * Lock must be held before calling this 328 - **/ 318 + */ 329 319 static int __sca3000_unlock_reg_lock(struct sca3000_state *st) 330 320 { 331 321 struct spi_transfer xfer[3] = { ··· 355 343 356 344 /** 357 345 * sca3000_write_ctrl_reg() write to a lock protect ctrl register 346 + * @st: Driver specific device instance data. 358 347 * @sel: selects which registers we wish to write to 359 348 * @val: the value to be written 360 349 * ··· 363 350 * register and use a shared write address. This function allows writing of 364 351 * these registers. 365 352 * Lock must be held. 366 - **/ 353 + */ 367 354 static int sca3000_write_ctrl_reg(struct sca3000_state *st, 368 355 u8 sel, 369 356 uint8_t val) ··· 393 380 394 381 /** 395 382 * sca3000_read_ctrl_reg() read from lock protected control register. 383 + * @st: Driver specific device instance data. 384 + * @ctrl_reg: Which ctrl register do we want to read. 396 385 * 397 386 * Lock must be held. 398 - **/ 387 + */ 399 388 static int sca3000_read_ctrl_reg(struct sca3000_state *st, 400 389 u8 ctrl_reg) 401 390 { ··· 425 410 426 411 /** 427 412 * sca3000_show_rev() - sysfs interface to read the chip revision number 428 - **/ 413 + * @indio_dev: Device instance specific generic IIO data. 414 + * Driver specific device instance data can be obtained via 415 + * via iio_priv(indio_dev) 416 + */ 429 417 static int sca3000_print_rev(struct iio_dev *indio_dev) 430 418 { 431 419 int ret; ··· 558 540 }; 559 541 560 542 /** 561 - * __sca3000_get_base_freq() obtain mode specific base frequency 543 + * __sca3000_get_base_freq() - obtain mode specific base frequency 544 + * @st: Private driver specific device instance specific state. 545 + * @info: chip type specific information. 546 + * @base_freq: Base frequency for the current measurement mode. 562 547 * 563 548 * lock must be held 564 - **/ 549 + */ 565 550 static inline int __sca3000_get_base_freq(struct sca3000_state *st, 566 551 const struct sca3000_chip_info *info, 567 552 int *base_freq) ··· 592 571 } 593 572 594 573 /** 595 - * read_raw handler for IIO_CHAN_INFO_SAMP_FREQ 574 + * sca3000_read_raw_samp_freq() - read_raw handler for IIO_CHAN_INFO_SAMP_FREQ 575 + * @st: Private driver specific device instance specific state. 576 + * @val: The frequency read back. 596 577 * 597 578 * lock must be held 598 579 **/ 599 - static int read_raw_samp_freq(struct sca3000_state *st, int *val) 580 + static int sca3000_read_raw_samp_freq(struct sca3000_state *st, int *val) 600 581 { 601 582 int ret; 602 583 ··· 626 603 } 627 604 628 605 /** 629 - * write_raw handler for IIO_CHAN_INFO_SAMP_FREQ 606 + * sca3000_write_raw_samp_freq() - write_raw handler for IIO_CHAN_INFO_SAMP_FREQ 607 + * @st: Private driver specific device instance specific state. 608 + * @val: The frequency desired. 630 609 * 631 610 * lock must be held 632 - **/ 633 - static int write_raw_samp_freq(struct sca3000_state *st, int val) 611 + */ 612 + static int sca3000_write_raw_samp_freq(struct sca3000_state *st, int val) 634 613 { 635 614 int ret, base_freq, ctrlval; 636 615 ··· 763 738 return IIO_VAL_INT_PLUS_MICRO; 764 739 case IIO_CHAN_INFO_SAMP_FREQ: 765 740 mutex_lock(&st->lock); 766 - ret = read_raw_samp_freq(st, val); 741 + ret = sca3000_read_raw_samp_freq(st, val); 767 742 mutex_unlock(&st->lock); 768 743 return ret ? ret : IIO_VAL_INT; 769 744 case IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY: ··· 788 763 if (val2) 789 764 return -EINVAL; 790 765 mutex_lock(&st->lock); 791 - ret = write_raw_samp_freq(st, val); 766 + ret = sca3000_write_raw_samp_freq(st, val); 792 767 mutex_unlock(&st->lock); 793 768 return ret; 794 769 case IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY: ··· 805 780 } 806 781 807 782 /** 808 - * sca3000_read_av_freq() sysfs function to get available frequencies 783 + * sca3000_read_av_freq() - sysfs function to get available frequencies 784 + * @dev: Device structure for this device. 785 + * @attr: Description of the attribute. 786 + * @buf: Incoming string 809 787 * 810 788 * The later modes are only relevant to the ring buffer - and depend on current 811 789 * mode. Note that data sheet gives rather wide tolerances for these so integer ··· 903 875 } 904 876 905 877 /** 906 - * sca3000_write_value() control of threshold and period 907 - **/ 878 + * sca3000_write_value() - control of threshold and period 879 + * @indio_dev: Device instance specific IIO information. 880 + * @chan: Description of the channel for which the event is being 881 + * configured. 882 + * @type: The type of event being configured, here magnitude rising 883 + * as everything else is read only. 884 + * @dir: Direction of the event (here rising) 885 + * @info: What information about the event are we configuring. 886 + * Here the threshold only. 887 + * @val: Integer part of the value being written.. 888 + * @val2: Non integer part of the value being written. Here always 0. 889 + */ 908 890 static int sca3000_write_event_value(struct iio_dev *indio_dev, 909 891 const struct iio_chan_spec *chan, 910 892 enum iio_event_type type, ··· 989 951 } 990 952 991 953 /** 992 - * sca3000_ring_int_process() ring specific interrupt handling. 993 - * 994 - * This is only split from the main interrupt handler so as to 995 - * reduce the amount of code if the ring buffer is not enabled. 996 - **/ 954 + * sca3000_ring_int_process() - ring specific interrupt handling. 955 + * @val: Value of the interrupt status register. 956 + * @indio_dev: Device instance specific IIO device structure. 957 + */ 997 958 static void sca3000_ring_int_process(u8 val, struct iio_dev *indio_dev) 998 959 { 999 960 struct sca3000_state *st = iio_priv(indio_dev); ··· 1031 994 1032 995 /** 1033 996 * sca3000_event_handler() - handling ring and non ring events 997 + * @irq: The irq being handled. 998 + * @private: struct iio_device pointer for the device. 1034 999 * 1035 1000 * Ring related interrupt handler. Depending on event, push to 1036 1001 * the ring buffer event chrdev or the event one. ··· 1040 1001 * This function is complicated by the fact that the devices can signify ring 1041 1002 * and non ring events via the same interrupt line and they can only 1042 1003 * be distinguished via a read of the relevant status register. 1043 - **/ 1004 + */ 1044 1005 static irqreturn_t sca3000_event_handler(int irq, void *private) 1045 1006 { 1046 1007 struct iio_dev *indio_dev = private; ··· 1228 1189 } 1229 1190 1230 1191 /** 1231 - * sca3000_write_event_config() simple on off control for motion detector 1192 + * sca3000_write_event_config() - simple on off control for motion detector 1193 + * @indio_dev: IIO device instance specific structure. Data specific to this 1194 + * particular driver may be accessed via iio_priv(indio_dev). 1195 + * @chan: Description of the channel whose event we are configuring. 1196 + * @type: The type of event. 1197 + * @dir: The direction of the event. 1198 + * @state: Desired state of event being configured. 1232 1199 * 1233 1200 * This is a per axis control, but enabling any will result in the 1234 1201 * motion detector unit being enabled. ··· 1318 1273 } 1319 1274 1320 1275 /** 1321 - * sca3000_hw_ring_preenable() hw ring buffer preenable function 1276 + * sca3000_hw_ring_preenable() - hw ring buffer preenable function 1277 + * @indio_dev: structure representing the IIO device. Device instance 1278 + * specific state can be accessed via iio_priv(indio_dev). 1322 1279 * 1323 1280 * Very simple enable function as the chip will allows normal reads 1324 1281 * during ring buffer operation so as long as it is indeed running 1325 1282 * before we notify the core, the precise ordering does not matter. 1326 - **/ 1283 + */ 1327 1284 static int sca3000_hw_ring_preenable(struct iio_dev *indio_dev) 1328 1285 { 1329 1286 int ret; ··· 1382 1335 }; 1383 1336 1384 1337 /** 1385 - * sca3000_clean_setup() get the device into a predictable state 1338 + * sca3000_clean_setup() - get the device into a predictable state 1339 + * @st: Device instance specific private data structure 1386 1340 * 1387 1341 * Devices use flash memory to store many of the register values 1388 1342 * and hence can come up in somewhat unpredictable states. 1389 1343 * Hence reset everything on driver load. 1390 - **/ 1344 + */ 1391 1345 static int sca3000_clean_setup(struct sca3000_state *st) 1392 1346 { 1393 1347 int ret;