/* sca3000_query_ring_int() is the hardware ring status interrupt enabled  */
static ssize_t sca3000_query_ring_int(struct device *dev, struct device_attribute *attr, char *buf)
/* sca3000_query_ring_int() is the hardware ring status interrupt enabled  */
static ssize_t sca3000_query_ring_int(struct device *dev, struct device_attribute *attr, char *buf)
{
	struct iio_event_attr *this_attr = to_iio_event_attr(attr);
	int ret, len;
	u8 *rx;
	struct iio_dev *indio_dev = dev_get_drvdata(dev);
	struct sca3000_state *st = indio_dev->dev_data;
	mutex_lock(&st->lock);
	ret = sca3000_read_data(st, SCA3000_REG_ADDR_INT_MASK, &rx, 1);
	mutex_unlock(&st->lock);
	if (ret)
		return ret;
	len = sprintf(buf, "%d\n", (rx[1] & this_attr->mask) ? 1 : 0);
	kfree(rx);
	return len;
}