Skip to content
Commit 567b8e9f authored by Lars Povlsen's avatar Lars Povlsen Committed by Jiri Kosina
Browse files

HID: mcp2221: Fix GPIO output handling



The mcp2221 driver GPIO output handling has has several issues.

* A wrong value is used for the GPIO direction.

* Wrong offsets are calculated for some GPIO set value/set direction
  operations, when offset is larger than 0.

This has been fixed by introducing proper manifest constants for the
direction encoding, and using 'offsetof' when calculating GPIO
register offsets.

The updated driver has been tested with the Sparx5 pcb134/pcb135
board, which has the mcp2221 device with several (output) GPIO's.

Fixes: 328de1c5 ("HID: mcp2221: add GPIO functionality support")
Reviewed-by: default avatarRishi Gupta <gupt21@gmail.com>
Signed-off-by: default avatarLars Povlsen <lars.povlsen@microchip.com>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent 34a9fa20
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment