Skip to content

Commit 740329d

Browse files
Johannes RoithJiri Kosina
authored andcommitted
HID: mcp2200: added driver for GPIOs of MCP2200
Added a gpiochip compatible driver to control the 8 GPIOs of the MCP2200 by using the HID interface. Using GPIOs with alternative functions (GP0<->SSPND, GP1<->USBCFG, GP6<->RXLED, GP7<->TXLED) will reset the functions, if set (unset by default). The driver was tested while also using the UART of the chip. Setting and reading the GPIOs has no effect on the UART communication. However, a reset is triggered after the CONFIGURE command. If the GPIO Direction is constantly changed, this will affect the communication at low baud rates. This is a hardware problem of the MCP2200 and is not caused by the driver. Signed-off-by: Johannes Roith <[email protected]> Reviewed-by: Rahul Rameshbabu <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent 4ea4ed2 commit 740329d

File tree

4 files changed

+403
-0
lines changed

4 files changed

+403
-0
lines changed

drivers/hid/Kconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1296,6 +1296,15 @@ config HID_ALPS
12961296
Say Y here if you have a Alps touchpads over i2c-hid or usbhid
12971297
and want support for its special functionalities.
12981298

1299+
config HID_MCP2200
1300+
tristate "Microchip MCP2200 HID USB-to-GPIO bridge"
1301+
depends on USB_HID && GPIOLIB
1302+
help
1303+
Provides GPIO functionality over USB-HID through MCP2200 device.
1304+
1305+
To compile this driver as a module, choose M here: the module
1306+
will be called hid-mcp2200.ko.
1307+
12991308
config HID_MCP2221
13001309
tristate "Microchip MCP2221 HID USB-to-I2C/SMbus host support"
13011310
depends on USB_HID && I2C

drivers/hid/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ obj-$(CONFIG_HID_LOGITECH_HIDPP) += hid-logitech-hidpp.o
7979
obj-$(CONFIG_HID_MACALLY) += hid-macally.o
8080
obj-$(CONFIG_HID_MAGICMOUSE) += hid-magicmouse.o
8181
obj-$(CONFIG_HID_MALTRON) += hid-maltron.o
82+
obj-$(CONFIG_HID_MCP2200) += hid-mcp2200.o
8283
obj-$(CONFIG_HID_MCP2221) += hid-mcp2221.o
8384
obj-$(CONFIG_HID_MAYFLASH) += hid-mf.o
8485
obj-$(CONFIG_HID_MEGAWORLD_FF) += hid-megaworld.o

drivers/hid/hid-ids.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -917,6 +917,7 @@
917917
#define USB_DEVICE_ID_PICK16F1454 0x0042
918918
#define USB_DEVICE_ID_PICK16F1454_V2 0xf2f7
919919
#define USB_DEVICE_ID_LUXAFOR 0xf372
920+
#define USB_DEVICE_ID_MCP2200 0x00df
920921
#define USB_DEVICE_ID_MCP2221 0x00dd
921922

922923
#define USB_VENDOR_ID_MICROSOFT 0x045e

0 commit comments

Comments
 (0)