mirror of
https://git.FreeBSD.org/src.git
synced 2024-10-18 02:19:39 +00:00
rtsx: Add plug-and-play info
Add MODULE_PNP_INFO() to the driver to make it autoload if not linked statically into the kernel. Remove the device from amd64/i386 GENERIC. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D35074
This commit is contained in:
parent
25685b7537
commit
71883128e5
@ -364,7 +364,6 @@ device snd_via8233 # VIA VT8233x Audio
|
|||||||
device mmc # MMC/SD bus
|
device mmc # MMC/SD bus
|
||||||
device mmcsd # MMC/SD memory card
|
device mmcsd # MMC/SD memory card
|
||||||
device sdhci # Generic PCI SD Host Controller
|
device sdhci # Generic PCI SD Host Controller
|
||||||
device rtsx # Realtek SD card reader
|
|
||||||
|
|
||||||
# VirtIO support
|
# VirtIO support
|
||||||
device virtio # Generic VirtIO bus (required)
|
device virtio # Generic VirtIO bus (required)
|
||||||
|
@ -174,22 +174,20 @@ struct rtsx_softc {
|
|||||||
|
|
||||||
#define RTSX_VERSION "2.1g"
|
#define RTSX_VERSION "2.1g"
|
||||||
|
|
||||||
static const struct rtsx_device {
|
static const struct rtsx_pciids {
|
||||||
uint16_t vendor_id;
|
|
||||||
uint16_t device_id;
|
uint16_t device_id;
|
||||||
const char *desc;
|
const char *desc;
|
||||||
} rtsx_devices[] = {
|
} rtsx_ids[] = {
|
||||||
{ RTSX_REALTEK, RTSX_RTS5209, RTSX_VERSION " Realtek RTS5209 PCIe SD Card Reader"},
|
{ RTSX_RTS5209, RTSX_VERSION " Realtek RTS5209 PCIe SD Card Reader" },
|
||||||
{ RTSX_REALTEK, RTSX_RTS5227, RTSX_VERSION " Realtek RTS5227 PCIe SD Card Reader"},
|
{ RTSX_RTS5227, RTSX_VERSION " Realtek RTS5227 PCIe SD Card Reader" },
|
||||||
{ RTSX_REALTEK, RTSX_RTS5229, RTSX_VERSION " Realtek RTS5229 PCIe SD Card Reader"},
|
{ RTSX_RTS5229, RTSX_VERSION " Realtek RTS5229 PCIe SD Card Reader" },
|
||||||
{ RTSX_REALTEK, RTSX_RTS522A, RTSX_VERSION " Realtek RTS522A PCIe SD Card Reader"},
|
{ RTSX_RTS522A, RTSX_VERSION " Realtek RTS522A PCIe SD Card Reader" },
|
||||||
{ RTSX_REALTEK, RTSX_RTS525A, RTSX_VERSION " Realtek RTS525A PCIe SD Card Reader"},
|
{ RTSX_RTS525A, RTSX_VERSION " Realtek RTS525A PCIe SD Card Reader" },
|
||||||
{ RTSX_REALTEK, RTSX_RTS5249, RTSX_VERSION " Realtek RTS5249 PCIe SD Card Reader"},
|
{ RTSX_RTS5249, RTSX_VERSION " Realtek RTS5249 PCIe SD Card Reader" },
|
||||||
{ RTSX_REALTEK, RTSX_RTS5260, RTSX_VERSION " Realtek RTS5260 PCIe SD Card Reader"},
|
{ RTSX_RTS5260, RTSX_VERSION " Realtek RTS5260 PCIe SD Card Reader" },
|
||||||
{ RTSX_REALTEK, RTSX_RTL8402, RTSX_VERSION " Realtek RTL8402 PCIe SD Card Reader"},
|
{ RTSX_RTL8402, RTSX_VERSION " Realtek RTL8402 PCIe SD Card Reader" },
|
||||||
{ RTSX_REALTEK, RTSX_RTL8411, RTSX_VERSION " Realtek RTL8411 PCIe SD Card Reader"},
|
{ RTSX_RTL8411, RTSX_VERSION " Realtek RTL8411 PCIe SD Card Reader" },
|
||||||
{ RTSX_REALTEK, RTSX_RTL8411B, RTSX_VERSION " Realtek RTL8411B PCIe SD Card Reader"},
|
{ RTSX_RTL8411B, RTSX_VERSION " Realtek RTL8411B PCIe SD Card Reader" },
|
||||||
{ 0, 0, NULL}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/* See `kenv | grep smbios.system` */
|
/* See `kenv | grep smbios.system` */
|
||||||
@ -199,6 +197,7 @@ static const struct rtsx_inversion_model {
|
|||||||
char *product;
|
char *product;
|
||||||
} rtsx_inversion_models[] = {
|
} rtsx_inversion_models[] = {
|
||||||
{ "LENOVO", "ThinkPad T470p", "20J7S0PM00"},
|
{ "LENOVO", "ThinkPad T470p", "20J7S0PM00"},
|
||||||
|
{ "LENOVO", "ThinkPad X13 Gen 1", "20UF000QRT"},
|
||||||
{ NULL, NULL, NULL}
|
{ NULL, NULL, NULL}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -3571,22 +3570,19 @@ rtsx_probe(device_t dev)
|
|||||||
uint16_t vendor_id;
|
uint16_t vendor_id;
|
||||||
uint16_t device_id;
|
uint16_t device_id;
|
||||||
int i;
|
int i;
|
||||||
int result;
|
|
||||||
|
|
||||||
vendor_id = pci_get_vendor(dev);
|
vendor_id = pci_get_vendor(dev);
|
||||||
device_id = pci_get_device(dev);
|
device_id = pci_get_device(dev);
|
||||||
|
|
||||||
result = ENXIO;
|
if (vendor_id != RTSX_REALTEK)
|
||||||
for (i = 0; rtsx_devices[i].vendor_id != 0; i++) {
|
return (ENXIO);
|
||||||
if (rtsx_devices[i].vendor_id == vendor_id &&
|
for (i = 0; i < nitems(rtsx_ids); i++) {
|
||||||
rtsx_devices[i].device_id == device_id) {
|
if (rtsx_ids[i].device_id == device_id) {
|
||||||
device_set_desc(dev, rtsx_devices[i].desc);
|
device_set_desc(dev, rtsx_ids[i].desc);
|
||||||
result = BUS_PROBE_DEFAULT;
|
return (BUS_PROBE_DEFAULT);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return (ENXIO);
|
||||||
return (result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -3907,6 +3903,11 @@ static device_method_t rtsx_methods[] = {
|
|||||||
|
|
||||||
DEFINE_CLASS_0(rtsx, rtsx_driver, rtsx_methods, sizeof(struct rtsx_softc));
|
DEFINE_CLASS_0(rtsx, rtsx_driver, rtsx_methods, sizeof(struct rtsx_softc));
|
||||||
DRIVER_MODULE(rtsx, pci, rtsx_driver, NULL, NULL);
|
DRIVER_MODULE(rtsx, pci, rtsx_driver, NULL, NULL);
|
||||||
|
|
||||||
|
/* For Plug and Play */
|
||||||
|
MODULE_PNP_INFO("U16:device;D:#;T:vendor=0x10ec", pci, rtsx,
|
||||||
|
rtsx_ids, nitems(rtsx_ids));
|
||||||
|
|
||||||
#ifndef MMCCAM
|
#ifndef MMCCAM
|
||||||
MMC_DECLARE_BRIDGE(rtsx);
|
MMC_DECLARE_BRIDGE(rtsx);
|
||||||
#endif /* !MMCCAM */
|
#endif /* !MMCCAM */
|
||||||
|
@ -319,7 +319,6 @@ device snd_via8233 # VIA VT8233x Audio
|
|||||||
device mmc # MMC/SD bus
|
device mmc # MMC/SD bus
|
||||||
device mmcsd # MMC/SD memory card
|
device mmcsd # MMC/SD memory card
|
||||||
device sdhci # Generic PCI SD Host Controller
|
device sdhci # Generic PCI SD Host Controller
|
||||||
device rtsx # Realtek SD card reader
|
|
||||||
|
|
||||||
# VirtIO support
|
# VirtIO support
|
||||||
device virtio # Generic VirtIO bus (required)
|
device virtio # Generic VirtIO bus (required)
|
||||||
|
Loading…
Reference in New Issue
Block a user