summaryrefslogtreecommitdiffstats
path: root/drivers/iio/magnetometer/ak8974.c
diff options
context:
space:
mode:
authorMichał Mirosław <mirq-linux@rere.qmqm.pl>2017-08-17 15:56:11 +0200
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2017-08-20 15:17:39 +0100
commit9991f99eed49047c237e08471ce010cae02052fe (patch)
tree5db4a22e71a37382806d5ddfc1a142c364477e27 /drivers/iio/magnetometer/ak8974.c
parent408cc6eb1e3adc43a434d5d584708c2a1d2c6c32 (diff)
downloadlinux-9991f99eed49047c237e08471ce010cae02052fe.tar.bz2
iio: magnetometer: ak8974: mark INT_CLEAR as precious
Reading INT_CLEAR has side effects - disallow reading it via debugfs. Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/magnetometer/ak8974.c')
-rw-r--r--drivers/iio/magnetometer/ak8974.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/iio/magnetometer/ak8974.c b/drivers/iio/magnetometer/ak8974.c
index b1c209faf1b1..866f20b818b1 100644
--- a/drivers/iio/magnetometer/ak8974.c
+++ b/drivers/iio/magnetometer/ak8974.c
@@ -661,11 +661,17 @@ static bool ak8974_writeable_reg(struct device *dev, unsigned int reg)
}
}
+static bool ak8974_precious_reg(struct device *dev, unsigned int reg)
+{
+ return reg == AK8974_INT_CLEAR;
+}
+
static const struct regmap_config ak8974_regmap_config = {
.reg_bits = 8,
.val_bits = 8,
.max_register = 0xff,
.writeable_reg = ak8974_writeable_reg,
+ .precious_reg = ak8974_precious_reg,
};
static int ak8974_probe(struct i2c_client *i2c,