Source
215
215
word_mask = mask[word_index] & (port_mask << word_offset);
216
216
if (!word_mask) {
217
217
/* no get bits in this port so skip to next one */
218
218
continue;
219
219
}
220
220
221
221
/* read bits from current gpio port */
222
222
port_state = inb(dio48egpio->base + ports[i]);
223
223
224
224
/* store acquired bits at respective bits array offset */
225
-
bits[word_index] |= port_state << word_offset;
225
+
bits[word_index] |= (port_state << word_offset) & word_mask;
226
226
}
227
227
228
228
return 0;
229
229
}
230
230
231
231
static void dio48e_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
232
232
{
233
233
struct dio48e_gpio *const dio48egpio = gpiochip_get_data(chip);
234
234
const unsigned port = offset / 8;
235
235
const unsigned mask = BIT(offset % 8);