<!-- Single-sourced snippet. Included by workshop-definition.rst,
sdk-definition.rst, and sdkcraft-definition.rst.
Do not add a top-level label; the including page provides the anchor. -->

# Custom device interface

<!-- @artefact custom-device interface -->

The custom device interface exposes host devices
that belong to a Linux kernel subsystem.

A custom device plug is described by these attributes:

<!-- @artefact custom-device interface attributes -->

| Key                    | Value   | Description                                                                                                             |
|------------------------|---------|-------------------------------------------------------------------------------------------------------------------------|
| `subsystem` (optional) | string  | The Linux kernel subsystem of the host devices to expose,<br/>for example `input`, `tty`, or `usb`.                     |
| `vendorid` (optional)  | string  | Restrict the exposed devices to those with this vendor ID,<br/>quoted so it is read as a string, for example `"0403"`.  |
| `productid` (optional) | string  | Restrict the exposed devices to those with this product ID,<br/>quoted so it is read as a string, for example `"6001"`. |

At least one of `subsystem`, `vendorid`, or `productid`
must be set.
Setting `productid` also requires `vendorid`,
since a product ID is only meaningful within a vendor’s namespace.

Plug owner: any regular SDK; not the system SDK.

Slot: the system SDK provides a single `system:custom-device` slot.
Other SDKs cannot declare custom device slots.
