Re: [PATCH 4/8] iio: mma8452: Add support for transient event debouncing

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

 



On 23/07/14 20:20, Peter Meerwald wrote:
+static ssize_t mma8452_set_transient_period(struct device *dev,
+						struct device_attribute *attr,
+						const char *buf,
+						size_t len)
+{
+	struct iio_dev *indio_dev = dev_to_iio_dev(dev);
+	struct mma8452_data *data = iio_priv(indio_dev);
+	int i, f, us, steps, ret;
+
+	ret = iio_str_to_fixpoint(buf, USEC_PER_SEC / 10, &i, &f);
+	if (ret)
+		return ret;
+
+	us = i * USEC_PER_SEC + f;
+	steps = us / mma8452_transient_time_step_us[
+				mma8452_get_odr_index(data)];
+
+	if (steps < 0 || steps > 0xFF)
perhaps do the check for negative i earlier; use lowercase hex-values

Ok done for V2
--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[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