.. | .. |
---|
62 | 62 | #define QUAD8_REG_CHAN_OP 0x11 |
---|
63 | 63 | #define QUAD8_REG_INDEX_INPUT_LEVELS 0x16 |
---|
64 | 64 | #define QUAD8_DIFF_ENCODER_CABLE_STATUS 0x17 |
---|
65 | | -/* Borrow Toggle flip-flop */ |
---|
66 | | -#define QUAD8_FLAG_BT BIT(0) |
---|
67 | | -/* Carry Toggle flip-flop */ |
---|
68 | | -#define QUAD8_FLAG_CT BIT(1) |
---|
69 | 65 | /* Error flag */ |
---|
70 | 66 | #define QUAD8_FLAG_E BIT(4) |
---|
71 | 67 | /* Up/Down flag */ |
---|
.. | .. |
---|
104 | 100 | { |
---|
105 | 101 | struct quad8_iio *const priv = iio_priv(indio_dev); |
---|
106 | 102 | const int base_offset = priv->base + 2 * chan->channel; |
---|
107 | | - unsigned int flags; |
---|
108 | | - unsigned int borrow; |
---|
109 | | - unsigned int carry; |
---|
110 | 103 | int i; |
---|
111 | 104 | |
---|
112 | 105 | switch (mask) { |
---|
.. | .. |
---|
117 | 110 | return IIO_VAL_INT; |
---|
118 | 111 | } |
---|
119 | 112 | |
---|
120 | | - flags = inb(base_offset + 1); |
---|
121 | | - borrow = flags & QUAD8_FLAG_BT; |
---|
122 | | - carry = !!(flags & QUAD8_FLAG_CT); |
---|
123 | | - |
---|
124 | | - /* Borrow XOR Carry effectively doubles count range */ |
---|
125 | | - *val = (borrow ^ carry) << 24; |
---|
| 113 | + *val = 0; |
---|
126 | 114 | |
---|
127 | 115 | mutex_lock(&priv->lock); |
---|
128 | 116 | |
---|
.. | .. |
---|
643 | 631 | { |
---|
644 | 632 | struct quad8_iio *const priv = counter->priv; |
---|
645 | 633 | const int base_offset = priv->base + 2 * count->id; |
---|
646 | | - unsigned int flags; |
---|
647 | | - unsigned int borrow; |
---|
648 | | - unsigned int carry; |
---|
649 | 634 | int i; |
---|
650 | 635 | |
---|
651 | | - flags = inb(base_offset + 1); |
---|
652 | | - borrow = flags & QUAD8_FLAG_BT; |
---|
653 | | - carry = !!(flags & QUAD8_FLAG_CT); |
---|
654 | | - |
---|
655 | | - /* Borrow XOR Carry effectively doubles count range */ |
---|
656 | | - *val = (unsigned long)(borrow ^ carry) << 24; |
---|
| 636 | + *val = 0; |
---|
657 | 637 | |
---|
658 | 638 | mutex_lock(&priv->lock); |
---|
659 | 639 | |
---|
.. | .. |
---|
1198 | 1178 | |
---|
1199 | 1179 | mutex_unlock(&priv->lock); |
---|
1200 | 1180 | |
---|
1201 | | - /* By default 0x1FFFFFF (25 bits unsigned) is maximum count */ |
---|
1202 | | - return sprintf(buf, "33554431\n"); |
---|
| 1181 | + /* By default 0xFFFFFF (24 bits unsigned) is maximum count */ |
---|
| 1182 | + return sprintf(buf, "16777215\n"); |
---|
1203 | 1183 | } |
---|
1204 | 1184 | |
---|
1205 | 1185 | static ssize_t quad8_count_ceiling_write(struct counter_device *counter, |
---|