summaryrefslogtreecommitdiffstats
path: root/sound/spi
diff options
context:
space:
mode:
authorRishi Gupta <gupt21@gmail.com>2020-04-14 22:18:14 +0530
committerJiri Kosina <jkosina@suse.cz>2020-04-16 22:15:31 +0200
commit328de1c519c5c0925151cae47944a1c1a0333bcd (patch)
tree644bb4f32bbda341cfb6c0cbb4bc9ce7a0d5336e /sound/spi
parentc101e9bbce4ae2947b35a660f17d617fc3827595 (diff)
downloadlinux-328de1c519c5c0925151cae47944a1c1a0333bcd.tar.gz
linux-328de1c519c5c0925151cae47944a1c1a0333bcd.tar.bz2
linux-328de1c519c5c0925151cae47944a1c1a0333bcd.zip
HID: mcp2221: add GPIO functionality support
MCP2221 has 4 pins that can be used as GPIO or configured for alternate functionality such as clock generation and IRQ detection. This patch adds support for GPIO functionality. To set direction of a pin or to toggle its state after it has been configured as GPIO, driver sends command to mcp2221 and parses response received from mcp2221. Based on this response either 0 or appropriate error code is returned to GPIO framework. To get the direction or current state of a pin, driver sends command and read response from the device. Based on the response received from device direction or value is sent to the GPIO framework. Command from driver to mcp2221 device are output report. Response received from mcp2221 is input report. Datasheet (page 45-48) contains details about how to decode the response received from device: http://ww1.microchip.com/downloads/en/DeviceDoc/20005565B.pdf Signed-off-by: Rishi Gupta <gupt21@gmail.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'sound/spi')
0 files changed, 0 insertions, 0 deletions