diff options
Diffstat (limited to 'include/linux/iio')
-rw-r--r-- | include/linux/iio/iio.h | 81 |
1 files changed, 2 insertions, 79 deletions
diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h index 256a90a1bea6..5b125fd554e4 100644 --- a/include/linux/iio/iio.h +++ b/include/linux/iio/iio.h | |||
@@ -490,32 +490,12 @@ struct iio_dev { | |||
490 | #endif | 490 | #endif |
491 | }; | 491 | }; |
492 | 492 | ||
493 | /** | ||
494 | * iio_find_channel_from_si() - get channel from its scan index | ||
495 | * @indio_dev: device | ||
496 | * @si: scan index to match | ||
497 | */ | ||
498 | const struct iio_chan_spec | 493 | const struct iio_chan_spec |
499 | *iio_find_channel_from_si(struct iio_dev *indio_dev, int si); | 494 | *iio_find_channel_from_si(struct iio_dev *indio_dev, int si); |
500 | |||
501 | /** | ||
502 | * iio_device_register() - register a device with the IIO subsystem | ||
503 | * @indio_dev: Device structure filled by the device driver | ||
504 | **/ | ||
505 | int iio_device_register(struct iio_dev *indio_dev); | 495 | int iio_device_register(struct iio_dev *indio_dev); |
506 | |||
507 | /** | ||
508 | * iio_device_unregister() - unregister a device from the IIO subsystem | ||
509 | * @indio_dev: Device structure representing the device. | ||
510 | **/ | ||
511 | void iio_device_unregister(struct iio_dev *indio_dev); | 496 | void iio_device_unregister(struct iio_dev *indio_dev); |
512 | 497 | int devm_iio_device_register(struct device *dev, struct iio_dev *indio_dev); | |
513 | /** | 498 | void devm_iio_device_unregister(struct device *dev, struct iio_dev *indio_dev); |
514 | * iio_push_event() - try to add event to the list for userspace reading | ||
515 | * @indio_dev: IIO device structure | ||
516 | * @ev_code: What event | ||
517 | * @timestamp: When the event occurred | ||
518 | **/ | ||
519 | int iio_push_event(struct iio_dev *indio_dev, u64 ev_code, s64 timestamp); | 499 | int iio_push_event(struct iio_dev *indio_dev, u64 ev_code, s64 timestamp); |
520 | 500 | ||
521 | extern struct bus_type iio_bus_type; | 501 | extern struct bus_type iio_bus_type; |
@@ -579,10 +559,6 @@ static inline void *iio_device_get_drvdata(struct iio_dev *indio_dev) | |||
579 | 559 | ||
580 | /* Can we make this smaller? */ | 560 | /* Can we make this smaller? */ |
581 | #define IIO_ALIGN L1_CACHE_BYTES | 561 | #define IIO_ALIGN L1_CACHE_BYTES |
582 | /** | ||
583 | * iio_device_alloc() - allocate an iio_dev from a driver | ||
584 | * @sizeof_priv: Space to allocate for private structure. | ||
585 | **/ | ||
586 | struct iio_dev *iio_device_alloc(int sizeof_priv); | 562 | struct iio_dev *iio_device_alloc(int sizeof_priv); |
587 | 563 | ||
588 | static inline void *iio_priv(const struct iio_dev *indio_dev) | 564 | static inline void *iio_priv(const struct iio_dev *indio_dev) |
@@ -596,64 +572,11 @@ static inline struct iio_dev *iio_priv_to_dev(void *priv) | |||
596 | ALIGN(sizeof(struct iio_dev), IIO_ALIGN)); | 572 | ALIGN(sizeof(struct iio_dev), IIO_ALIGN)); |
597 | } | 573 | } |
598 | 574 | ||
599 | /** | ||
600 | * iio_device_free() - free an iio_dev from a driver | ||
601 | * @indio_dev: the iio_dev associated with the device | ||
602 | **/ | ||
603 | void iio_device_free(struct iio_dev *indio_dev); | 575 | void iio_device_free(struct iio_dev *indio_dev); |
604 | |||
605 | /** | ||
606 | * devm_iio_device_alloc - Resource-managed iio_device_alloc() | ||
607 | * @dev: Device to allocate iio_dev for | ||
608 | * @sizeof_priv: Space to allocate for private structure. | ||
609 | * | ||
610 | * Managed iio_device_alloc. iio_dev allocated with this function is | ||
611 | * automatically freed on driver detach. | ||
612 | * | ||
613 | * If an iio_dev allocated with this function needs to be freed separately, | ||
614 | * devm_iio_device_free() must be used. | ||
615 | * | ||
616 | * RETURNS: | ||
617 | * Pointer to allocated iio_dev on success, NULL on failure. | ||
618 | */ | ||
619 | struct iio_dev *devm_iio_device_alloc(struct device *dev, int sizeof_priv); | 576 | struct iio_dev *devm_iio_device_alloc(struct device *dev, int sizeof_priv); |
620 | |||
621 | /** | ||
622 | * devm_iio_device_free - Resource-managed iio_device_free() | ||
623 | * @dev: Device this iio_dev belongs to | ||
624 | * @indio_dev: the iio_dev associated with the device | ||
625 | * | ||
626 | * Free iio_dev allocated with devm_iio_device_alloc(). | ||
627 | */ | ||
628 | void devm_iio_device_free(struct device *dev, struct iio_dev *indio_dev); | 577 | void devm_iio_device_free(struct device *dev, struct iio_dev *indio_dev); |
629 | |||
630 | /** | ||
631 | * devm_iio_trigger_alloc - Resource-managed iio_trigger_alloc() | ||
632 | * @dev: Device to allocate iio_trigger for | ||
633 | * @fmt: trigger name format. If it includes format | ||
634 | * specifiers, the additional arguments following | ||
635 | * format are formatted and inserted in the resulting | ||
636 | * string replacing their respective specifiers. | ||
637 | * | ||
638 | * Managed iio_trigger_alloc. iio_trigger allocated with this function is | ||
639 | * automatically freed on driver detach. | ||
640 | * | ||
641 | * If an iio_trigger allocated with this function needs to be freed separately, | ||
642 | * devm_iio_trigger_free() must be used. | ||
643 | * | ||
644 | * RETURNS: | ||
645 | * Pointer to allocated iio_trigger on success, NULL on failure. | ||
646 | */ | ||
647 | struct iio_trigger *devm_iio_trigger_alloc(struct device *dev, | 578 | struct iio_trigger *devm_iio_trigger_alloc(struct device *dev, |
648 | const char *fmt, ...); | 579 | const char *fmt, ...); |
649 | |||
650 | /** | ||
651 | * devm_iio_trigger_free - Resource-managed iio_trigger_free() | ||
652 | * @dev: Device this iio_dev belongs to | ||
653 | * @iio_trig: the iio_trigger associated with the device | ||
654 | * | ||
655 | * Free iio_trigger allocated with devm_iio_trigger_alloc(). | ||
656 | */ | ||
657 | void devm_iio_trigger_free(struct device *dev, struct iio_trigger *iio_trig); | 580 | void devm_iio_trigger_free(struct device *dev, struct iio_trigger *iio_trig); |
658 | 581 | ||
659 | /** | 582 | /** |