[PATCH 2/2] iio: st_magn_core.c: activate always_on attribute

From: Massimo Toscanelli
Date: Mon Feb 07 2022 - 04:15:25 EST


Activate always_on sysfs attribute to add the always_on feature in
st magnetometers.

Signed-off-by: Massimo Toscanelli <massimo.toscanelli@xxxxxxxxxxxxxxxxxxxx>
---
drivers/iio/magnetometer/st_magn_core.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/iio/magnetometer/st_magn_core.c b/drivers/iio/magnetometer/st_magn_core.c
index 0806a1e65ce4..2ab4c286d262 100644
--- a/drivers/iio/magnetometer/st_magn_core.c
+++ b/drivers/iio/magnetometer/st_magn_core.c
@@ -563,9 +563,11 @@ static int st_magn_write_raw(struct iio_dev *indio_dev,
static ST_SENSORS_DEV_ATTR_SAMP_FREQ_AVAIL();
static ST_SENSORS_DEV_ATTR_SCALE_AVAIL(in_magn_scale_available);

+static ST_SENSORS_DEV_ATTR_ALWAYS_ON();
static struct attribute *st_magn_attributes[] = {
&iio_dev_attr_sampling_frequency_available.dev_attr.attr,
&iio_dev_attr_in_magn_scale_available.dev_attr.attr,
+ &iio_dev_attr_always_on.dev_attr.attr,
NULL,
};

--
2.25.1