-/* $OpenBSD: rtsx.c,v 1.9 2014/05/18 10:52:16 stsp Exp $ */
+/* $OpenBSD: rtsx.c,v 1.10 2014/08/19 17:55:03 phessler Exp $ */
/*
* Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org>
/* Partial power. */
RTSX_SET(sc, RTSX_CARD_PWR_CTL, RTSX_SD_PARTIAL_PWR_ON);
- if (sc->flags & RTSX_F_5229)
- RTSX_SET(sc, RTSX_PWR_GATE_CTRL, RTSX_LDO3318_VCC1);
- else
+ if (sc->flags & RTSX_F_5209)
RTSX_SET(sc, RTSX_PWR_GATE_CTRL, RTSX_LDO3318_SUSPEND);
+ else
+ RTSX_SET(sc, RTSX_PWR_GATE_CTRL, RTSX_LDO3318_VCC1);
delay(200);
-/* $OpenBSD: rtsxvar.h,v 1.2 2013/11/06 13:51:02 stsp Exp $ */
+/* $OpenBSD: rtsxvar.h,v 1.3 2014/08/19 17:55:03 phessler Exp $ */
/*
* Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org>
#define RTSX_F_CARD_PRESENT 0x01
#define RTSX_F_SDIO_SUPPORT 0x02
#define RTSX_F_5209 0x04
-#define RTSX_F_5229 0x08
-#define RTSX_F_5229_TYPE_C 0x10
+#define RTSX_F_5227 0x08
+#define RTSX_F_5229 0x10
+#define RTSX_F_5229_TYPE_C 0x20
#endif
-/* $OpenBSD: rtsx_pci.c,v 1.6 2014/05/18 10:52:17 stsp Exp $ */
+/* $OpenBSD: rtsx_pci.c,v 1.7 2014/08/19 17:55:03 phessler Exp $ */
/*
* Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org>
pci_set_powerstate(pa->pa_pc, pa->pa_tag, PCI_PMCSR_STATE_D0);
- if (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_REALTEK_RTS5209)
- flags = RTSX_F_5209;
- else
- flags = RTSX_F_5229;
+ switch (PCI_PRODUCT(pa->pa_id)) {
+ case PCI_PRODUCT_REALTEK_RTS5209:
+ flags = RTSX_F_5209;
+ break;
+ case PCI_PRODUCT_REALTEK_RTS5227:
+ flags = RTSX_F_5227;
+ break;
+ case PCI_PRODUCT_REALTEK_RTS5229:
+ flags = RTSX_F_5229;
+ break;
+ default:
+ flags = 0;
+ break;
+ }
if (rtsx_attach(&sc->sc, iot, ioh, size, pa->pa_dmat, flags) != 0)
printf("%s: can't initialize chip\n", sc->sc.sc_dev.dv_xname);