Skip to content

Commit

Permalink
HID: mcp2221: Set ACPI companion
Browse files Browse the repository at this point in the history
In scenarios where an I2C device tree is defined in ACPI and exists off
the MCP2221 I2C bus, the devices could not be instantiated.
Mark the USB port that the MCP2221 is connected to as its ACPI companion
so that the USB device can be bound to the ACPI tree when enumerated.
With this change the downstream I2C tree devices can be instantiated on
ACPI systems.

Signed-off-by: Hamish Martin <hamish.martin@alliedtelesis.co.nz>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
  • Loading branch information
Hamish Martin authored and Jiri Kosina committed Nov 21, 2023
1 parent 4ea4ed2 commit d978615
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/hid/hid-mcp2221.c
Original file line number Diff line number Diff line change
Expand Up @@ -1154,6 +1154,7 @@ static int mcp2221_probe(struct hid_device *hdev,
mcp->adapter.algo = &mcp_i2c_algo;
mcp->adapter.retries = 1;
mcp->adapter.dev.parent = &hdev->dev;
ACPI_COMPANION_SET(&mcp->adapter.dev, ACPI_COMPANION(hdev->dev.parent));
snprintf(mcp->adapter.name, sizeof(mcp->adapter.name),
"MCP2221 usb-i2c bridge");

Expand Down

0 comments on commit d978615

Please sign in to comment.