Commit 211f9e74 authored by Johannes Roith's avatar Johannes Roith Committed by Wentao Guan
Browse files

HID: mcp2200: added driver for GPIOs of MCP2200

stable inclusion
from stable-v6.6.57
commit b289b83409a6edd262840a6bac4d990e1ef87971
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/IB2M97

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=b289b83409a6edd262840a6bac4d990e1ef87971



--------------------------------

[ Upstream commit 740329d7120f8608ead64b0f3417c02ca1d6b32f ]

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: default avatarJohannes Roith <johannes@gnu-linux.rocks>
Reviewed-by: default avatarRahul Rameshbabu <sergeantsagara@protonmail.com>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
(cherry picked from commit b289b83409a6edd262840a6bac4d990e1ef87971)
Signed-off-by: default avatarWentao Guan <guanwentao@uniontech.com>
parent 252f84b8
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -5769,6 +5769,7 @@ CONFIG_HID_ZYDACRON=m
CONFIG_HID_SENSOR_HUB=m
# CONFIG_HID_SENSOR_CUSTOM_SENSOR is not set
# CONFIG_HID_ALPS is not set
# CONFIG_HID_MCP2200 is not set
# CONFIG_HID_MCP2221 is not set
# end of Special HID drivers

+1 −0
Original line number Diff line number Diff line
@@ -5228,6 +5228,7 @@ CONFIG_HID_ZEROPLUS=m
CONFIG_HID_ZYDACRON=m
# CONFIG_HID_SENSOR_HUB is not set
CONFIG_HID_ALPS=m
# CONFIG_HID_MCP2200 is not set
# CONFIG_HID_MCP2221 is not set
# end of Special HID drivers

+1 −0
Original line number Diff line number Diff line
@@ -5243,6 +5243,7 @@ CONFIG_HID_ZYDACRON=m
CONFIG_HID_SENSOR_HUB=m
# CONFIG_HID_SENSOR_CUSTOM_SENSOR is not set
# CONFIG_HID_ALPS is not set
# CONFIG_HID_MCP2200 is not set
# CONFIG_HID_MCP2221 is not set
# end of Special HID drivers

+1 −0
Original line number Diff line number Diff line
@@ -6472,6 +6472,7 @@ CONFIG_HID_ZYDACRON=m
CONFIG_HID_SENSOR_HUB=y
CONFIG_HID_SENSOR_CUSTOM_SENSOR=m
CONFIG_HID_ALPS=m
# CONFIG_HID_MCP2200 is not set
# CONFIG_HID_MCP2221 is not set
# end of Special HID drivers

+9 −0
Original line number Diff line number Diff line
@@ -1300,6 +1300,15 @@ config HID_ALPS
	Say Y here if you have a Alps touchpads over i2c-hid or usbhid
	and want support for its special functionalities.

config HID_MCP2200
	tristate "Microchip MCP2200 HID USB-to-GPIO bridge"
	depends on USB_HID && GPIOLIB
	help
	  Provides GPIO functionality over USB-HID through MCP2200 device.

	  To compile this driver as a module, choose M here: the module
	  will be called hid-mcp2200.ko.

config HID_MCP2221
	tristate "Microchip MCP2221 HID USB-to-I2C/SMbus host support"
	depends on USB_HID && I2C
Loading