2019-06-04 08:11:33 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
2009-08-18 17:06:19 +00:00
|
|
|
|
|
|
|
/* The industrial I/O core, trigger consumer handling functions
|
|
|
|
*
|
|
|
|
* Copyright (c) 2008 Jonathan Cameron
|
|
|
|
*/
|
|
|
|
|
2009-08-18 17:06:26 +00:00
|
|
|
#ifdef CONFIG_IIO_TRIGGER
|
|
|
|
/**
|
2009-10-05 02:34:02 +00:00
|
|
|
* iio_device_register_trigger_consumer() - set up an iio_dev to use triggers
|
2011-10-06 16:14:35 +00:00
|
|
|
* @indio_dev: iio_dev associated with the device that will consume the trigger
|
2021-02-15 10:40:28 +00:00
|
|
|
*
|
|
|
|
* Return 0 if successful, negative otherwise
|
2009-08-18 17:06:26 +00:00
|
|
|
**/
|
2021-02-15 10:40:28 +00:00
|
|
|
int iio_device_register_trigger_consumer(struct iio_dev *indio_dev);
|
2009-10-05 02:34:02 +00:00
|
|
|
|
2009-08-18 17:06:26 +00:00
|
|
|
/**
|
2009-10-05 02:34:02 +00:00
|
|
|
* iio_device_unregister_trigger_consumer() - reverse the registration process
|
2011-10-06 16:14:35 +00:00
|
|
|
* @indio_dev: iio_dev associated with the device that consumed the trigger
|
2009-08-18 17:06:26 +00:00
|
|
|
**/
|
2011-10-06 16:14:35 +00:00
|
|
|
void iio_device_unregister_trigger_consumer(struct iio_dev *indio_dev);
|
2009-08-18 17:06:26 +00:00
|
|
|
|
2020-05-25 11:38:53 +00:00
|
|
|
|
|
|
|
int iio_trigger_attach_poll_func(struct iio_trigger *trig,
|
|
|
|
struct iio_poll_func *pf);
|
|
|
|
int iio_trigger_detach_poll_func(struct iio_trigger *trig,
|
|
|
|
struct iio_poll_func *pf);
|
|
|
|
|
2009-08-18 17:06:26 +00:00
|
|
|
#else
|
|
|
|
|
2009-08-18 17:06:19 +00:00
|
|
|
/**
|
2009-10-05 02:34:02 +00:00
|
|
|
* iio_device_register_trigger_consumer() - set up an iio_dev to use triggers
|
2011-10-06 16:14:35 +00:00
|
|
|
* @indio_dev: iio_dev associated with the device that will consume the trigger
|
2009-08-18 17:06:19 +00:00
|
|
|
**/
|
2020-07-20 13:51:33 +00:00
|
|
|
static inline int iio_device_register_trigger_consumer(struct iio_dev *indio_dev)
|
2009-08-18 17:06:19 +00:00
|
|
|
{
|
|
|
|
return 0;
|
2013-07-07 20:24:00 +00:00
|
|
|
}
|
2009-10-05 02:34:02 +00:00
|
|
|
|
2009-08-18 17:06:19 +00:00
|
|
|
/**
|
|
|
|
* iio_device_unregister_trigger_consumer() - reverse the registration process
|
2011-10-06 16:14:35 +00:00
|
|
|
* @indio_dev: iio_dev associated with the device that consumed the trigger
|
2009-08-18 17:06:19 +00:00
|
|
|
**/
|
2020-07-20 13:51:33 +00:00
|
|
|
static inline void iio_device_unregister_trigger_consumer(struct iio_dev *indio_dev)
|
2009-08-18 17:06:19 +00:00
|
|
|
{
|
2013-07-07 20:24:00 +00:00
|
|
|
}
|
2009-08-18 17:06:26 +00:00
|
|
|
|
2020-05-25 11:38:53 +00:00
|
|
|
static inline int iio_trigger_attach_poll_func(struct iio_trigger *trig,
|
|
|
|
struct iio_poll_func *pf)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
static inline int iio_trigger_detach_poll_func(struct iio_trigger *trig,
|
|
|
|
struct iio_poll_func *pf)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2009-08-18 17:06:26 +00:00
|
|
|
#endif /* CONFIG_TRIGGER_CONSUMER */
|