Re: [PATCH v2 3/6] iio: imu: st_lsm6dsx: add motion events

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 16/07/2019 10.29, Lorenzo Bianconi wrote:

+#define ST_LSM6DSX_CHANNEL_ACC(chan_type, addr, mod, scan_idx)		\
+{									\
+	.type = chan_type,						\
+	.address = addr,						\
+	.modified = 1,							\
+	.channel2 = mod,						\
+	.info_mask_separate = BIT(IIO_CHAN_INFO_RAW) |			\
+			      BIT(IIO_CHAN_INFO_SCALE),			\
+	.info_mask_shared_by_all = BIT(IIO_CHAN_INFO_SAMP_FREQ),	\
+	.scan_index = scan_idx,						\
+	.scan_type = {							\
+		.sign = 's',						\
+		.realbits = 16,						\
+		.storagebits = 16,					\
+		.endianness = IIO_LE,					\
+	},								\
+	.event_spec = &st_lsm6dsx_event,				\
+	.num_event_specs = 1,						\
+}

I would prefer to extend existing macros

+
  #define ST_LSM6DSX_CHANNEL(chan_type, addr, mod, scan_idx)		\
  {									\
  	.type = chan_type,						\
@@ -297,6 +318,8 @@ struct st_lsm6dsx_hw {
  	u8 enable_mask;
  	u8 ts_sip;
  	u8 sip;
+	u8 event_threshold;
+	bool enable_event;
  	int drdy_pin;
u8 *buff;
@@ -306,6 +329,13 @@ struct st_lsm6dsx_hw {
  	const struct st_lsm6dsx_settings *settings;
  };

How would I do that when we have the `event_spec` for the accelerometer?

/Sean



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux