summaryrefslogtreecommitdiffstats
path: root/drivers/iio/health/afe440x.h
diff options
context:
space:
mode:
authorAndrew F. Davis <afd@ti.com>2016-05-01 22:36:54 +0200
committerJonathan Cameron <jic23@kernel.org>2016-05-04 12:02:39 +0200
commit81f517270da632c0ddf4c511a086d5aa7e5606ee (patch)
treedbaa0dacecd8ea30a2e37c9a15d68f67bc19f2d5 /drivers/iio/health/afe440x.h
parentiio: health/afe440x: Remove unneeded initializers (diff)
downloadlinux-81f517270da632c0ddf4c511a086d5aa7e5606ee.tar.xz
linux-81f517270da632c0ddf4c511a086d5aa7e5606ee.zip
iio: health/afe440x: Always use separate gain values
Locking the two gain stages to the same setting adds no value for us, so initialize them as unlocked and remove the sysfs for unlocking them. This also allows us to greatly simplify showing and setting the gain registers. Signed-off-by: Andrew F. Davis <afd@ti.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio/health/afe440x.h')
-rw-r--r--drivers/iio/health/afe440x.h15
1 files changed, 3 insertions, 12 deletions
diff --git a/drivers/iio/health/afe440x.h b/drivers/iio/health/afe440x.h
index c671ab78a23a..544bbabd6321 100644
--- a/drivers/iio/health/afe440x.h
+++ b/drivers/iio/health/afe440x.h
@@ -71,8 +71,7 @@
#define AFE440X_CONTROL1_TIMEREN BIT(8)
/* TIAGAIN register fields */
-#define AFE440X_TIAGAIN_ENSEPGAIN_MASK BIT(15)
-#define AFE440X_TIAGAIN_ENSEPGAIN_SHIFT 15
+#define AFE440X_TIAGAIN_ENSEPGAIN BIT(15)
/* CONTROL2 register fields */
#define AFE440X_CONTROL2_PDN_AFE BIT(0)
@@ -133,12 +132,6 @@ struct afe440x_reg_info {
.output = true, \
}
-enum afe440x_reg_type {
- SIMPLE,
- RESISTANCE,
- CAPACITANCE,
-};
-
struct afe440x_val_table {
int integer;
int fract;
@@ -167,7 +160,6 @@ struct afe440x_attr {
unsigned int reg;
unsigned int shift;
unsigned int mask;
- enum afe440x_reg_type type;
const struct afe440x_val_table *val_table;
unsigned int table_size;
};
@@ -175,7 +167,7 @@ struct afe440x_attr {
#define to_afe440x_attr(_dev_attr) \
container_of(_dev_attr, struct afe440x_attr, dev_attr)
-#define AFE440X_ATTR(_name, _reg, _field, _type, _table, _size) \
+#define AFE440X_ATTR(_name, _reg, _field, _table) \
struct afe440x_attr afe440x_attr_##_name = { \
.dev_attr = __ATTR(_name, (S_IRUGO | S_IWUSR), \
afe440x_show_register, \
@@ -183,9 +175,8 @@ struct afe440x_attr {
.reg = _reg, \
.shift = _field ## _SHIFT, \
.mask = _field ## _MASK, \
- .type = _type, \
.val_table = _table, \
- .table_size = _size, \
+ .table_size = ARRAY_SIZE(_table), \
}
#endif /* _AFE440X_H */