diff options
Diffstat (limited to 'sys/arch/zaurus/dev/zaurus_ssp.c')
-rw-r--r-- | sys/arch/zaurus/dev/zaurus_ssp.c | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/sys/arch/zaurus/dev/zaurus_ssp.c b/sys/arch/zaurus/dev/zaurus_ssp.c index 1bbaf13a9f7..b66b75a7824 100644 --- a/sys/arch/zaurus/dev/zaurus_ssp.c +++ b/sys/arch/zaurus/dev/zaurus_ssp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: zaurus_ssp.c,v 1.6 2005/04/08 21:58:49 uwe Exp $ */ +/* $OpenBSD: zaurus_ssp.c,v 1.7 2010/08/30 21:35:57 deraadt Exp $ */ /* * Copyright (c) 2005 Uwe Stuehler <uwe@bsdx.de> @@ -45,6 +45,7 @@ struct zssp_softc { int zssp_match(struct device *, void *, void *); void zssp_attach(struct device *, struct device *, void *); void zssp_init(void); +int zssp_activate(struct device *, int); void zssp_powerhook(int, void *); int zssp_read_max1111(u_int32_t); @@ -52,7 +53,8 @@ u_int32_t zssp_read_ads7846(u_int32_t); void zssp_write_lz9jg18(u_int32_t); struct cfattach zssp_ca = { - sizeof (struct zssp_softc), zssp_match, zssp_attach + sizeof (struct zssp_softc), zssp_match, zssp_attach, NULL, + zssp_activate }; struct cfdriver zssp_cd = { @@ -108,16 +110,23 @@ zssp_init(void) pxa2x0_gpio_set_function(GPIO_TG_CS_C3000, GPIO_OUT|GPIO_SET); } -void -zssp_powerhook(int why, void *arg) +int +zssp_activate(struct device *self, int act) { - int s; - - if (why == PWR_RESUME) { - s = splhigh(); + switch (act) { + case DVACT_SUSPEND: + break; + case DVACT_RESUME: zssp_init(); - splx(s); + break; } + return 0; +} + +void +zssp_powerhook(int why, void *arg) +{ + zssp_activate(arg, why); } /* |