diff options
| author | enami <enami@NetBSD.org> | 2000-02-22 02:35:26 +0000 |
|---|---|---|
| committer | enami <enami@NetBSD.org> | 2000-02-22 02:35:26 +0000 |
| commit | b785bb47a01d046c52f6ba02ba6cc5a404d55e4f (patch) | |
| tree | c66d2c33f86d500cea5aac3d8fd62426277db022 /sys/dev | |
| parent | 58369df4e98fc3914f0e3df1ce7eba7b819af95a (diff) | |
Establish a powerhook and make sure the card detect interrupt is enabled
after resume from suspend, as i82365.c does.
This is a workaround for newer Sony VAIO notebook.
Patch is submitted by Atsushi Onoe (onoe@sm.sony.co.jp) in PR#9463.
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/pci/pccbb.c | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/sys/dev/pci/pccbb.c b/sys/dev/pci/pccbb.c index 44b9c8e29fc..1c6ec81fc93 100644 --- a/sys/dev/pci/pccbb.c +++ b/sys/dev/pci/pccbb.c @@ -1,4 +1,4 @@ -/* $NetBSD: pccbb.c,v 1.24 2000/02/21 01:44:36 thorpej Exp $ */ +/* $NetBSD: pccbb.c,v 1.25 2000/02/22 02:35:26 enami Exp $ */ /* * Copyright (c) 1998, 1999 and 2000 @@ -167,6 +167,7 @@ STATIC int pccbb_pcmcia_card_detect __P((pcmcia_chipset_handle_t pch)); static void pccbb_pcmcia_do_io_map __P((struct pcic_handle *, int)); static void pccbb_pcmcia_wait_ready __P((struct pcic_handle *)); static void pccbb_pcmcia_do_mem_map __P((struct pcic_handle *, int)); +static void pccbb_powerhook __P((int, void *)); /* bus-space allocation and disallocation functions */ #if rbus @@ -587,6 +588,7 @@ pccbb_pci_callback(self) } printf("%s: interrupting at %s\n", sc->sc_dev.dv_xname, intrstr); + powerhook_establish(pccbb_powerhook, sc); { u_int32_t sockstat = @@ -3104,3 +3106,35 @@ pccbb_winset(align, sc, bst) } #endif /* rbus */ + +static void +pccbb_powerhook(why, arg) + int why; + void *arg; +{ + struct pccbb_softc *sc = arg; + u_int32_t reg; + bus_space_tag_t base_memt = sc->sc_base_memt; /* socket regs memory */ + bus_space_handle_t base_memh = sc->sc_base_memh; + + DPRINTF(("%s: power: why %d\n", sc->sc_dev.dv_xname, why)); + + if (why == PWR_RESUME) { + /* CSC Interrupt: Card detect interrupt on */ + reg = bus_space_read_4(base_memt, base_memh, CB_SOCKET_MASK); + /* Card detect intr is turned on. */ + reg |= CB_SOCKET_MASK_CD; + bus_space_write_4(base_memt, base_memh, CB_SOCKET_MASK, reg); + /* reset interrupt */ + reg = bus_space_read_4(base_memt, base_memh, CB_SOCKET_EVENT); + bus_space_write_4(base_memt, base_memh, CB_SOCKET_EVENT, reg); + + /* + * check for card insertion or removal during suspend period. + * XXX: the code can't cope with card swap (remove then insert). + * how can we detect such situation? + */ + if (why == PWR_RESUME) + (void)pccbbintr(sc); + } +} |
