]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
pci: sandbox: swap_case: Declare dynamic driver matching
authorBin Meng <bmeng.cn@gmail.com>
Fri, 3 Aug 2018 08:14:46 +0000 (01:14 -0700)
committerSimon Glass <sjg@chromium.org>
Wed, 8 Aug 2018 11:49:31 +0000 (12:49 +0100)
This adds a U_BOOT_PCI_DEVICE() declaration to the swap_case driver.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
arch/sandbox/include/asm/test.h
drivers/misc/swap_case.c

index 08863bf3a9dff3c08e5ac385dee6ef050adad5fa..57aeca840236f194d03c2116e46d51d307ddc6f1 100644 (file)
 #define SANDBOX_PCI_CLASS_CODE         PCI_CLASS_CODE_COMM
 #define SANDBOX_PCI_CLASS_SUB_CODE     PCI_CLASS_SUB_CODE_COMM_SERIAL
 
+/* Useful for PCI_VDEVICE() macro */
+#define PCI_VENDOR_ID_SANDBOX          SANDBOX_PCI_VENDOR_ID
+#define SWAP_CASE_DRV_DATA             0x55aa
+
 #define SANDBOX_CLK_RATE               32768
 
 /* System controller driver data */
index 80ccb9f38345538ac1c56f1fad335b6a4953fd35..790bb0c4bdcb69536af31e20ea7408eebf05f561 100644 (file)
@@ -285,3 +285,10 @@ U_BOOT_DRIVER(sandbox_swap_case_emul) = {
        .priv_auto_alloc_size = sizeof(struct swap_case_priv),
        .platdata_auto_alloc_size = sizeof(struct swap_case_platdata),
 };
+
+static struct pci_device_id sandbox_swap_case_supported[] = {
+       { PCI_VDEVICE(SANDBOX, SANDBOX_PCI_DEVICE_ID), SWAP_CASE_DRV_DATA },
+       {},
+};
+
+U_BOOT_PCI_DEVICE(sandbox_swap_case_emul, sandbox_swap_case_supported);