/* lis2de12_trigger_set - link external trigger to event data ready  */
int lis2de12_trigger_set(const struct device *dev, const struct sensor_trigger *trig, sensor_trigger_handler_t handler)
/* lis2de12_trigger_set - link external trigger to event data ready  */
int lis2de12_trigger_set(const struct device *dev, const struct sensor_trigger *trig, sensor_trigger_handler_t handler)
{
	const struct lis2de12_config *cfg = dev->config;
	struct lis2de12_data *lis2de12 = dev->data;
	if (!cfg->trig_enabled) {
		LOG_ERR("trigger_set op not supported");
		return -ENOTSUP;
	}
	switch (trig->chan) {
	case SENSOR_CHAN_ACCEL_XYZ:
		lis2de12->handler_drdy_acc = handler;
		lis2de12->trig_drdy_acc = trig;
		if (handler) {
			return lis2de12_enable_xl_int(dev, LIS2DE12_EN_BIT);
		}
		return lis2de12_enable_xl_int(dev, LIS2DE12_DIS_BIT);
	default:
		return -ENOTSUP;
	}
}