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

Commit 17a2cbc2 authored by Irina Tirdea's avatar Irina Tirdea Committed by Jonathan Cameron
Browse files

iio: core: Remove IIO_EV_TYPE_INSTANCE



By introducing IIO_EV_TYPE_CHANGE, IIO_EV_TYPE_INSTANCE becomes redundant.
The effect of IIO_EV_TYPE_INSTANCE can be obtained by using IIO_EV_TYPE_CHANGE
with IIO_EV_INFO_VALUE set to 1.

Remove all instances of IIO_EV_TYPE_INSTANCE and replace them with
IIO_EV_TYPE_CHANGE where needed.

Signed-off-by: default avatarIrina Tirdea <irina.tirdea@intel.com>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent 27be8423
Loading
Loading
Loading
Loading
+0 −1
Original line number Original line Diff line number Diff line
@@ -197,7 +197,6 @@ static const char * const iio_ev_type_text[] = {
	[IIO_EV_TYPE_ROC] = "roc",
	[IIO_EV_TYPE_ROC] = "roc",
	[IIO_EV_TYPE_THRESH_ADAPTIVE] = "thresh_adaptive",
	[IIO_EV_TYPE_THRESH_ADAPTIVE] = "thresh_adaptive",
	[IIO_EV_TYPE_MAG_ADAPTIVE] = "mag_adaptive",
	[IIO_EV_TYPE_MAG_ADAPTIVE] = "mag_adaptive",
	[IIO_EV_TYPE_INSTANCE] = "instance",
	[IIO_EV_TYPE_CHANGE] = "change",
	[IIO_EV_TYPE_CHANGE] = "change",
};
};


+0 −2
Original line number Original line Diff line number Diff line
@@ -59,7 +59,6 @@ static const char * const iio_ev_type_text[] = {
	[IIO_EV_TYPE_ROC] = "roc",
	[IIO_EV_TYPE_ROC] = "roc",
	[IIO_EV_TYPE_THRESH_ADAPTIVE] = "thresh_adaptive",
	[IIO_EV_TYPE_THRESH_ADAPTIVE] = "thresh_adaptive",
	[IIO_EV_TYPE_MAG_ADAPTIVE] = "mag_adaptive",
	[IIO_EV_TYPE_MAG_ADAPTIVE] = "mag_adaptive",
	[IIO_EV_TYPE_INSTANCE] = "instance",
	[IIO_EV_TYPE_CHANGE] = "change",
	[IIO_EV_TYPE_CHANGE] = "change",
};
};


@@ -179,7 +178,6 @@ static bool event_is_known(struct iio_event_data *event)
	case IIO_EV_TYPE_ROC:
	case IIO_EV_TYPE_ROC:
	case IIO_EV_TYPE_THRESH_ADAPTIVE:
	case IIO_EV_TYPE_THRESH_ADAPTIVE:
	case IIO_EV_TYPE_MAG_ADAPTIVE:
	case IIO_EV_TYPE_MAG_ADAPTIVE:
	case IIO_EV_TYPE_INSTANCE:
	case IIO_EV_TYPE_CHANGE:
	case IIO_EV_TYPE_CHANGE:
		break;
		break;
	default:
	default:
+1 −1
Original line number Original line Diff line number Diff line
@@ -73,7 +73,7 @@ static const struct iio_event_spec iio_dummy_event = {
 * simple step detect event - triggered when a step is detected
 * simple step detect event - triggered when a step is detected
 */
 */
static const struct iio_event_spec step_detect_event = {
static const struct iio_event_spec step_detect_event = {
	.type = IIO_EV_TYPE_INSTANCE,
	.type = IIO_EV_TYPE_CHANGE,
	.dir = IIO_EV_DIR_NONE,
	.dir = IIO_EV_DIR_NONE,
	.mask_separate = BIT(IIO_EV_INFO_ENABLE),
	.mask_separate = BIT(IIO_EV_INFO_ENABLE),
};
};
+2 −2
Original line number Original line Diff line number Diff line
@@ -86,7 +86,7 @@ int iio_simple_dummy_write_event_config(struct iio_dev *indio_dev,
		}
		}
	case IIO_STEPS:
	case IIO_STEPS:
		switch (type) {
		switch (type) {
		case IIO_EV_TYPE_INSTANCE:
		case IIO_EV_TYPE_CHANGE:
			st->event_en = state;
			st->event_en = state;
			break;
			break;
		default:
		default:
@@ -201,7 +201,7 @@ static irqreturn_t iio_simple_dummy_event_handler(int irq, void *private)
		iio_push_event(indio_dev,
		iio_push_event(indio_dev,
			       IIO_EVENT_CODE(IIO_STEPS, 0, IIO_NO_MOD,
			       IIO_EVENT_CODE(IIO_STEPS, 0, IIO_NO_MOD,
					      IIO_EV_DIR_NONE,
					      IIO_EV_DIR_NONE,
					      IIO_EV_TYPE_INSTANCE, 0, 0, 0),
					      IIO_EV_TYPE_CHANGE, 0, 0, 0),
			       iio_get_time_ns());
			       iio_get_time_ns());
		break;
		break;
	default:
	default:
+0 −1
Original line number Original line Diff line number Diff line
@@ -78,7 +78,6 @@ enum iio_event_type {
	IIO_EV_TYPE_ROC,
	IIO_EV_TYPE_ROC,
	IIO_EV_TYPE_THRESH_ADAPTIVE,
	IIO_EV_TYPE_THRESH_ADAPTIVE,
	IIO_EV_TYPE_MAG_ADAPTIVE,
	IIO_EV_TYPE_MAG_ADAPTIVE,
	IIO_EV_TYPE_INSTANCE,
	IIO_EV_TYPE_CHANGE,
	IIO_EV_TYPE_CHANGE,
};
};