Home | History | Annotate | Line # | Download | only in dev
scoop.c revision 1.7.10.1
      1  1.7.10.1  cherry /*	$NetBSD: scoop.c,v 1.7.10.1 2011/06/23 14:19:51 cherry Exp $	*/
      2       1.1    ober /*	$OpenBSD: zaurus_scoop.c,v 1.12 2005/11/17 05:26:31 uwe Exp $	*/
      3       1.1    ober 
      4       1.1    ober /*
      5       1.1    ober  * Copyright (c) 2005 Uwe Stuehler <uwe (at) bsdx.de>
      6       1.1    ober  *
      7       1.1    ober  * Permission to use, copy, modify, and distribute this software for any
      8       1.1    ober  * purpose with or without fee is hereby granted, provided that the above
      9       1.1    ober  * copyright notice and this permission notice appear in all copies.
     10       1.1    ober  *
     11       1.1    ober  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
     12       1.1    ober  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
     13       1.1    ober  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
     14       1.1    ober  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
     15       1.1    ober  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
     16       1.1    ober  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
     17       1.1    ober  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
     18       1.1    ober  */
     19       1.1    ober 
     20       1.1    ober #include <sys/cdefs.h>
     21  1.7.10.1  cherry __KERNEL_RCSID(0, "$NetBSD: scoop.c,v 1.7.10.1 2011/06/23 14:19:51 cherry Exp $");
     22       1.1    ober 
     23       1.1    ober #include <sys/param.h>
     24       1.1    ober #include <sys/systm.h>
     25       1.1    ober #include <sys/device.h>
     26       1.1    ober #include <sys/conf.h>
     27       1.1    ober #include <sys/gpio.h>
     28       1.1    ober 
     29       1.1    ober #include <machine/bus.h>
     30       1.1    ober 
     31       1.1    ober #include <arm/xscale/pxa2x0var.h>
     32       1.1    ober 
     33       1.1    ober #include <zaurus/zaurus/zaurus_reg.h>
     34       1.1    ober #include <zaurus/zaurus/zaurus_var.h>
     35       1.1    ober 
     36       1.1    ober #include <zaurus/dev/scoopreg.h>
     37       1.1    ober #include <zaurus/dev/scoopvar.h>
     38       1.1    ober 
     39       1.1    ober #include "ioconf.h"
     40       1.1    ober 
     41       1.1    ober struct scoop_softc {
     42       1.6  nonaka 	device_t		sc_dev;
     43       1.2   peter 
     44       1.2   peter 	bus_space_tag_t		sc_iot;
     45       1.2   peter 	bus_space_handle_t	sc_ioh;
     46       1.2   peter 
     47       1.2   peter 	uint16_t		sc_gpwr;	/* GPIO state before suspend */
     48       1.1    ober };
     49       1.1    ober 
     50       1.6  nonaka static int	scoopmatch(device_t, cfdata_t, void *);
     51       1.6  nonaka static void	scoopattach(device_t, device_t, void *);
     52       1.1    ober 
     53       1.6  nonaka CFATTACH_DECL_NEW(scoop, sizeof(struct scoop_softc),
     54       1.6  nonaka     scoopmatch, scoopattach, NULL, NULL);
     55       1.1    ober 
     56       1.2   peter #if 0
     57       1.6  nonaka static int	scoop_gpio_pin_read(struct scoop_softc *, int);
     58       1.2   peter #endif
     59       1.6  nonaka static void	scoop_gpio_pin_write(struct scoop_softc *, int, int);
     60       1.6  nonaka static void	scoop_gpio_pin_ctl(struct scoop_softc *, int, int);
     61       1.1    ober 
     62       1.3  nonaka enum scoop_card {
     63       1.3  nonaka 	SD_CARD,
     64       1.3  nonaka 	CF_CARD		/* socket 0 (external) */
     65       1.3  nonaka };
     66       1.3  nonaka 
     67       1.3  nonaka static void	scoop0_set_card_power(enum scoop_card card, int new_cpr);
     68       1.3  nonaka 
     69       1.1    ober static int
     70       1.6  nonaka scoopmatch(device_t parent, cfdata_t cf, void *aux)
     71       1.1    ober {
     72       1.1    ober 
     73       1.1    ober 	/*
     74       1.1    ober 	 * Only C3000-like models are known to have two SCOOPs.
     75       1.1    ober 	 */
     76       1.1    ober         if (ZAURUS_ISC3000)
     77       1.1    ober 		return (cf->cf_unit < 2);
     78       1.1    ober 	return (cf->cf_unit == 0);
     79       1.1    ober }
     80       1.1    ober 
     81       1.1    ober static void
     82       1.6  nonaka scoopattach(device_t parent, device_t self, void *aux)
     83       1.1    ober {
     84       1.6  nonaka 	struct scoop_softc *sc = device_private(self);
     85       1.1    ober 	struct pxaip_attach_args *pxa = (struct pxaip_attach_args *)aux;
     86       1.1    ober 	bus_addr_t addr;
     87       1.1    ober 	bus_size_t size;
     88       1.1    ober 
     89       1.6  nonaka 	sc->sc_dev = self;
     90       1.1    ober 	sc->sc_iot = pxa->pxa_iot;
     91       1.1    ober 
     92       1.6  nonaka 	aprint_normal(": PCMCIA/GPIO controller\n");
     93       1.6  nonaka 	aprint_naive("\n");
     94       1.6  nonaka 
     95       1.1    ober 	if (pxa->pxa_addr != -1)
     96       1.1    ober 		addr = pxa->pxa_addr;
     97       1.6  nonaka 	else if (sc->sc_dev->dv_unit == 0)
     98       1.1    ober 		addr = C3000_SCOOP0_BASE;
     99       1.1    ober 	else
    100       1.1    ober 		addr = C3000_SCOOP1_BASE;
    101       1.1    ober 
    102       1.1    ober 	size = pxa->pxa_size < SCOOP_SIZE ? SCOOP_SIZE : pxa->pxa_size;
    103       1.1    ober 
    104       1.1    ober 	if (bus_space_map(sc->sc_iot, addr, size, 0, &sc->sc_ioh) != 0) {
    105       1.6  nonaka 		aprint_error_dev(sc->sc_dev, "couldn't map registers\n");
    106       1.1    ober 		return;
    107       1.1    ober 	}
    108       1.1    ober 
    109       1.6  nonaka 	if (ZAURUS_ISC3000 && sc->sc_dev->dv_unit == 1) {
    110       1.1    ober 		scoop_gpio_pin_ctl(sc, SCOOP1_AKIN_PULLUP, GPIO_PIN_OUTPUT);
    111       1.1    ober 		scoop_gpio_pin_write(sc, SCOOP1_AKIN_PULLUP, GPIO_PIN_LOW);
    112  1.7.10.1  cherry 	} else if (ZAURUS_ISC860) {
    113       1.1    ober 		scoop_gpio_pin_ctl(sc, SCOOP0_AKIN_PULLUP, GPIO_PIN_OUTPUT);
    114       1.1    ober 		scoop_gpio_pin_write(sc, SCOOP0_AKIN_PULLUP, GPIO_PIN_LOW);
    115       1.1    ober 	}
    116       1.1    ober }
    117       1.1    ober 
    118       1.2   peter #if 0
    119       1.2   peter static int
    120       1.1    ober scoop_gpio_pin_read(struct scoop_softc *sc, int pin)
    121       1.1    ober {
    122       1.1    ober 	uint16_t bit = (1 << pin);
    123       1.1    ober 	uint16_t rv;
    124       1.1    ober 
    125       1.1    ober 	rv = bus_space_read_2(sc->sc_iot, sc->sc_ioh, SCOOP_GPWR);
    126       1.2   peter 	return (rv & bit) ? 1 : 0;
    127       1.1    ober }
    128       1.2   peter #endif
    129       1.1    ober 
    130       1.2   peter static void
    131       1.1    ober scoop_gpio_pin_write(struct scoop_softc *sc, int pin, int level)
    132       1.1    ober {
    133       1.1    ober 	uint16_t bit = (1 << pin);
    134       1.1    ober 	uint16_t rv;
    135       1.1    ober 
    136       1.1    ober 	rv = bus_space_read_2(sc->sc_iot, sc->sc_ioh, SCOOP_GPWR);
    137       1.1    ober 	bus_space_write_2(sc->sc_iot, sc->sc_ioh, SCOOP_GPWR,
    138       1.2   peter 	    (level == GPIO_PIN_LOW) ? (rv & ~bit) : (rv | bit));
    139       1.1    ober }
    140       1.1    ober 
    141       1.2   peter static void
    142       1.1    ober scoop_gpio_pin_ctl(struct scoop_softc *sc, int pin, int flags)
    143       1.1    ober {
    144       1.1    ober 	uint16_t bit = (1 << pin);
    145       1.1    ober 	uint16_t rv;
    146       1.1    ober 
    147       1.1    ober 	rv = bus_space_read_2(sc->sc_iot, sc->sc_ioh, SCOOP_GPCR);
    148       1.1    ober 	switch (flags & (GPIO_PIN_INPUT|GPIO_PIN_OUTPUT)) {
    149       1.1    ober 	case GPIO_PIN_INPUT:
    150       1.1    ober 		rv &= ~bit;
    151       1.1    ober 		break;
    152       1.1    ober 	case GPIO_PIN_OUTPUT:
    153       1.1    ober 		rv |= bit;
    154       1.1    ober 		break;
    155       1.1    ober 	}
    156       1.1    ober 	bus_space_write_2(sc->sc_iot, sc->sc_ioh, SCOOP_GPCR, rv);
    157       1.1    ober }
    158       1.1    ober 
    159       1.1    ober /*
    160       1.1    ober  * Turn the LCD background light and contrast signal on or off.
    161       1.1    ober  */
    162       1.1    ober void
    163       1.1    ober scoop_set_backlight(int on, int cont)
    164       1.1    ober {
    165       1.5  cegger 	struct scoop_softc *sc;
    166       1.5  cegger #if 0
    167       1.5  cegger 	struct scoop_softc *sc0;
    168       1.5  cegger 
    169       1.5  cegger 	sc0 = device_lookup_private(&scoop_cd, 0);
    170       1.5  cegger #endif
    171       1.1    ober 
    172       1.5  cegger 	sc = device_lookup_private(&scoop_cd, 1);
    173       1.5  cegger 	if (sc != NULL) {
    174       1.1    ober 		/* C3000 */
    175  1.7.10.1  cherry 		scoop_gpio_pin_write(sc, SCOOP1_BACKLIGHT_CONT, !cont);
    176  1.7.10.1  cherry 		scoop_gpio_pin_write(sc, SCOOP1_BACKLIGHT_ON, on);
    177       1.1    ober 	}
    178       1.1    ober #if 0
    179       1.5  cegger 	else if (sc0 != NULL) {
    180       1.5  cegger 		scoop_gpio_pin_write(sc0,
    181       1.1    ober 		    SCOOP0_BACKLIGHT_CONT, cont);
    182       1.1    ober 	}
    183       1.1    ober #endif
    184       1.1    ober }
    185       1.1    ober 
    186       1.1    ober /*
    187       1.1    ober  * Turn the infrared LED on or off (must be on while transmitting).
    188       1.1    ober  */
    189       1.1    ober void
    190       1.1    ober scoop_set_irled(int on)
    191       1.1    ober {
    192       1.5  cegger 	struct scoop_softc *sc;
    193       1.2   peter 
    194       1.5  cegger 	sc = device_lookup_private(&scoop_cd, 1);
    195       1.5  cegger 	if (sc != NULL) {
    196       1.1    ober 		/* IR_ON is inverted */
    197  1.7.10.1  cherry 		scoop_gpio_pin_write(sc, SCOOP1_IR_ON, !on);
    198       1.2   peter 	}
    199       1.1    ober }
    200       1.1    ober 
    201       1.1    ober /*
    202       1.1    ober  * Turn the green and orange LEDs on or off.  If the orange LED is on,
    203       1.1    ober  * then it is wired to indicate if A/C is connected.  The green LED has
    204       1.1    ober  * no such predefined function.
    205       1.1    ober  */
    206       1.1    ober void
    207       1.1    ober scoop_led_set(int led, int on)
    208       1.1    ober {
    209       1.5  cegger 	struct scoop_softc *sc;
    210       1.1    ober 
    211       1.5  cegger 	sc = device_lookup_private(&scoop_cd, 0);
    212       1.5  cegger 	if (sc != NULL) {
    213       1.1    ober 		if ((led & SCOOP_LED_GREEN) != 0) {
    214  1.7.10.1  cherry 			scoop_gpio_pin_write(sc, SCOOP0_LED_GREEN, on);
    215       1.1    ober 		}
    216       1.1    ober 		if (scoop_cd.cd_ndevs > 1 && (led & SCOOP_LED_ORANGE) != 0) {
    217  1.7.10.1  cherry 			scoop_gpio_pin_write(sc, SCOOP0_LED_ORANGE_C3000, on);
    218       1.1    ober 		}
    219       1.1    ober 	}
    220       1.1    ober }
    221       1.1    ober 
    222       1.1    ober /*
    223       1.1    ober  * Enable or disable the headphone output connection.
    224       1.1    ober  */
    225       1.1    ober void
    226       1.1    ober scoop_set_headphone(int on)
    227       1.1    ober {
    228       1.5  cegger 	struct scoop_softc *sc;
    229       1.1    ober 
    230       1.5  cegger 	sc = device_lookup_private(&scoop_cd, 0);
    231       1.5  cegger 	if (sc == NULL)
    232       1.1    ober 		return;
    233       1.1    ober 
    234  1.7.10.1  cherry 	scoop_gpio_pin_ctl(sc, SCOOP0_MUTE_L, GPIO_PIN_OUTPUT);
    235  1.7.10.1  cherry 	scoop_gpio_pin_ctl(sc, SCOOP0_MUTE_R, GPIO_PIN_OUTPUT);
    236       1.1    ober 
    237       1.1    ober 	if (on) {
    238  1.7.10.1  cherry 		scoop_gpio_pin_write(sc, SCOOP0_MUTE_L, GPIO_PIN_HIGH);
    239  1.7.10.1  cherry 		scoop_gpio_pin_write(sc, SCOOP0_MUTE_R, GPIO_PIN_HIGH);
    240       1.1    ober 	} else {
    241  1.7.10.1  cherry 		scoop_gpio_pin_write(sc, SCOOP0_MUTE_L, GPIO_PIN_LOW);
    242  1.7.10.1  cherry 		scoop_gpio_pin_write(sc, SCOOP0_MUTE_R, GPIO_PIN_LOW);
    243       1.1    ober 	}
    244       1.1    ober }
    245       1.1    ober 
    246       1.1    ober /*
    247       1.7  nonaka  * Enable or disable the mic bias
    248       1.7  nonaka  */
    249       1.7  nonaka void
    250       1.7  nonaka scoop_set_mic_bias(int onoff)
    251       1.7  nonaka {
    252       1.7  nonaka 	struct scoop_softc *sc1;
    253       1.7  nonaka 
    254       1.7  nonaka 	sc1 = device_lookup_private(&scoop_cd, 1);
    255       1.7  nonaka 	if (sc1 != NULL)
    256       1.7  nonaka 		scoop_gpio_pin_write(sc1, SCOOP1_MIC_BIAS, onoff);
    257       1.7  nonaka }
    258       1.7  nonaka 
    259       1.7  nonaka /*
    260       1.1    ober  * Turn on pullup resistor while not reading the remote control.
    261       1.1    ober  */
    262       1.1    ober void
    263       1.1    ober scoop_akin_pullup(int enable)
    264       1.1    ober {
    265       1.5  cegger 	struct scoop_softc *sc0;
    266       1.5  cegger 	struct scoop_softc *sc1;
    267       1.5  cegger 
    268       1.5  cegger 	sc0 = device_lookup_private(&scoop_cd, 0);
    269       1.5  cegger 	sc1 = device_lookup_private(&scoop_cd, 1);
    270       1.1    ober 
    271       1.5  cegger 	if (sc1 != NULL) {
    272  1.7.10.1  cherry 		scoop_gpio_pin_write(sc1, SCOOP1_AKIN_PULLUP, enable);
    273       1.5  cegger 	} else if (sc0 != NULL) {
    274  1.7.10.1  cherry 		scoop_gpio_pin_write(sc0, SCOOP0_AKIN_PULLUP, enable);
    275       1.1    ober 	}
    276       1.1    ober }
    277       1.1    ober 
    278       1.1    ober void
    279       1.1    ober scoop_battery_temp_adc(int enable)
    280       1.1    ober {
    281       1.5  cegger 	struct scoop_softc *sc;
    282       1.5  cegger 
    283       1.5  cegger 	sc = device_lookup_private(&scoop_cd, 0);
    284       1.1    ober 
    285       1.5  cegger 	if (sc != NULL) {
    286  1.7.10.1  cherry 		scoop_gpio_pin_write(sc, SCOOP0_ADC_TEMP_ON_C3000, enable);
    287       1.1    ober 	}
    288       1.1    ober }
    289       1.1    ober 
    290       1.1    ober void
    291       1.1    ober scoop_charge_battery(int enable, int voltage_high)
    292       1.1    ober {
    293       1.5  cegger 	struct scoop_softc *sc;
    294       1.5  cegger 
    295       1.5  cegger 	sc = device_lookup_private(&scoop_cd, 0);
    296       1.1    ober 
    297       1.5  cegger 	if (sc != NULL) {
    298  1.7.10.1  cherry 		scoop_gpio_pin_write(sc, SCOOP0_JK_B_C3000, voltage_high);
    299  1.7.10.1  cherry 		scoop_gpio_pin_write(sc, SCOOP0_CHARGE_OFF_C3000, !enable);
    300       1.1    ober 	}
    301       1.1    ober }
    302       1.1    ober 
    303       1.1    ober void
    304       1.1    ober scoop_discharge_battery(int enable)
    305       1.1    ober {
    306       1.5  cegger 	struct scoop_softc *sc;
    307       1.1    ober 
    308       1.5  cegger 	sc = device_lookup_private(&scoop_cd, 0);
    309       1.5  cegger 
    310       1.5  cegger 	if (sc != NULL) {
    311  1.7.10.1  cherry 		scoop_gpio_pin_write(sc, SCOOP0_JK_A_C3000, enable);
    312       1.1    ober 	}
    313       1.1    ober }
    314       1.1    ober 
    315       1.3  nonaka /*
    316       1.3  nonaka  * Enable or disable 3.3V power to the SD/MMC card slot.
    317       1.3  nonaka  */
    318       1.3  nonaka void
    319       1.3  nonaka scoop_set_sdmmc_power(int on)
    320       1.3  nonaka {
    321       1.3  nonaka 
    322       1.3  nonaka 	scoop0_set_card_power(SD_CARD, on ? SCP_CPR_SD_3V : SCP_CPR_OFF);
    323       1.3  nonaka }
    324       1.3  nonaka 
    325       1.3  nonaka /*
    326       1.3  nonaka  * The Card Power Register of the first SCOOP unit controls the power
    327       1.3  nonaka  * for the first CompactFlash slot and the SD/MMC card slot as well.
    328       1.3  nonaka  */
    329       1.2   peter void
    330       1.3  nonaka scoop0_set_card_power(enum scoop_card card, int new_cpr)
    331       1.2   peter {
    332       1.2   peter 	struct scoop_softc *sc;
    333       1.2   peter 	bus_space_tag_t iot;
    334       1.2   peter 	bus_space_handle_t ioh;
    335       1.3  nonaka 	uint16_t cpr;
    336       1.2   peter 
    337       1.5  cegger 	sc = device_lookup_private(&scoop_cd, 0);
    338       1.5  cegger 	if (sc == NULL)
    339       1.3  nonaka 		return;
    340       1.2   peter 
    341       1.3  nonaka 	iot = sc->sc_iot;
    342       1.3  nonaka 	ioh = sc->sc_ioh;
    343       1.3  nonaka 
    344       1.3  nonaka 	cpr = bus_space_read_2(iot, ioh, SCOOP_CPR);
    345       1.3  nonaka 	if (new_cpr & SCP_CPR_VOLTAGE_MSK) {
    346       1.3  nonaka 		if (card == CF_CARD)
    347       1.3  nonaka 			cpr |= SCP_CPR_5V;
    348       1.3  nonaka 		else if (card == SD_CARD)
    349       1.3  nonaka 			cpr |= SCP_CPR_SD_3V;
    350       1.3  nonaka 
    351       1.3  nonaka 		scoop_gpio_pin_write(sc, SCOOP0_CF_POWER_C3000, 1);
    352       1.3  nonaka 		if (!ISSET(cpr, SCP_CPR_5V) && !ISSET(cpr, SCP_CPR_SD_3V))
    353       1.3  nonaka 			delay(5000);
    354       1.3  nonaka 		bus_space_write_2(iot, ioh, SCOOP_CPR, cpr | new_cpr);
    355       1.3  nonaka 	} else {
    356       1.3  nonaka 		if (card == CF_CARD)
    357       1.3  nonaka 			cpr &= ~SCP_CPR_5V;
    358       1.3  nonaka 		else if (card == SD_CARD)
    359       1.3  nonaka 			cpr &= ~SCP_CPR_SD_3V;
    360       1.3  nonaka 
    361       1.3  nonaka 		if (!ISSET(cpr, SCP_CPR_5V) && !ISSET(cpr, SCP_CPR_SD_3V)) {
    362       1.3  nonaka 			bus_space_write_2(iot, ioh, SCOOP_CPR, SCP_CPR_OFF);
    363       1.3  nonaka 			delay(1000);
    364       1.3  nonaka 			scoop_gpio_pin_write(sc, SCOOP0_CF_POWER_C3000, 0);
    365       1.3  nonaka 		} else
    366       1.3  nonaka 			bus_space_write_2(iot, ioh, SCOOP_CPR, cpr | new_cpr);
    367       1.2   peter 	}
    368       1.2   peter }
    369       1.2   peter 
    370       1.1    ober void
    371       1.1    ober scoop_check_mcr(void)
    372       1.1    ober {
    373       1.5  cegger 	struct scoop_softc *sc0, *sc1, *sc;
    374       1.1    ober 	uint16_t v;
    375       1.1    ober 
    376       1.5  cegger 	sc0 = device_lookup_private(&scoop_cd, 0);
    377       1.5  cegger 	sc1 = device_lookup_private(&scoop_cd, 1);
    378       1.5  cegger 
    379       1.1    ober 	/* C3000 */
    380       1.5  cegger 	if (sc1 != NULL) {
    381       1.5  cegger 		sc = sc0;
    382       1.1    ober 		v = bus_space_read_2(sc->sc_iot, sc->sc_ioh, SCOOP_MCR);
    383       1.1    ober 		if ((v & 0x100) == 0) {
    384       1.1    ober 			bus_space_write_2(sc->sc_iot, sc->sc_ioh, SCOOP_MCR,
    385       1.1    ober 			    0x0101);
    386       1.1    ober 		}
    387       1.1    ober 
    388       1.5  cegger 		sc = sc1;
    389       1.1    ober 		v = bus_space_read_2(sc->sc_iot, sc->sc_ioh, SCOOP_MCR);
    390       1.1    ober 		if ((v & 0x100) == 0) {
    391       1.1    ober 			bus_space_write_2(sc->sc_iot, sc->sc_ioh, SCOOP_MCR,
    392       1.1    ober 			    0x0101);
    393       1.1    ober 		}
    394       1.1    ober 	}
    395       1.1    ober }
    396       1.1    ober 
    397       1.1    ober void
    398       1.1    ober scoop_suspend(void)
    399       1.1    ober {
    400       1.5  cegger 	struct scoop_softc *sc, *sc0, *sc1;
    401       1.1    ober 	uint32_t rv;
    402       1.1    ober 
    403       1.5  cegger 	sc0 = device_lookup_private(&scoop_cd, 0);
    404       1.5  cegger 	sc1 = device_lookup_private(&scoop_cd, 1);
    405       1.5  cegger 
    406       1.5  cegger 	if (sc0 != NULL) {
    407       1.5  cegger 		sc = sc0;
    408       1.1    ober 		sc->sc_gpwr = bus_space_read_2(sc->sc_iot, sc->sc_ioh,
    409       1.1    ober 		    SCOOP_GPWR);
    410       1.1    ober 		/* C3000 */
    411       1.1    ober 		bus_space_write_2(sc->sc_iot, sc->sc_ioh, SCOOP_GPWR,
    412       1.1    ober 		    sc->sc_gpwr & ~((1<<SCOOP0_MUTE_L) | (1<<SCOOP0_MUTE_R) |
    413       1.1    ober 		    (1<<SCOOP0_JK_A_C3000) | (1<<SCOOP0_ADC_TEMP_ON_C3000) |
    414       1.1    ober 		    (1<<SCOOP0_LED_GREEN)));
    415       1.1    ober 	}
    416       1.1    ober 
    417       1.1    ober 	/* C3000 */
    418       1.5  cegger 	if (sc1 != NULL) {
    419       1.5  cegger 		sc = sc1;
    420       1.1    ober 		sc->sc_gpwr = bus_space_read_2(sc->sc_iot, sc->sc_ioh,
    421       1.1    ober 		    SCOOP_GPWR);
    422       1.1    ober 		bus_space_write_2(sc->sc_iot, sc->sc_ioh, SCOOP_GPWR,
    423       1.1    ober 		    sc->sc_gpwr & ~((1<<SCOOP1_RESERVED_4) |
    424       1.1    ober 		    (1<<SCOOP1_RESERVED_5) | (1<<SCOOP1_RESERVED_6) |
    425       1.1    ober 		    (1<<SCOOP1_BACKLIGHT_CONT) | (1<<SCOOP1_BACKLIGHT_ON) |
    426       1.1    ober 		    (1<<SCOOP1_MIC_BIAS)));
    427       1.1    ober 		rv = bus_space_read_2(sc->sc_iot, sc->sc_ioh, SCOOP_GPWR);
    428       1.1    ober 		bus_space_write_2(sc->sc_iot, sc->sc_ioh, SCOOP_GPWR,
    429       1.1    ober 		    rv | ((1<<SCOOP1_IR_ON) | (1<<SCOOP1_RESERVED_3)));
    430       1.1    ober 	}
    431       1.1    ober }
    432       1.1    ober 
    433       1.1    ober void
    434       1.1    ober scoop_resume(void)
    435       1.1    ober {
    436       1.5  cegger 	struct scoop_softc *sc, *sc0, *sc1;
    437       1.5  cegger 
    438       1.5  cegger 	sc0 = device_lookup_private(&scoop_cd, 0);
    439       1.5  cegger 	sc1 = device_lookup_private(&scoop_cd, 1);
    440       1.1    ober 
    441       1.5  cegger 	if (sc0 != NULL) {
    442       1.5  cegger 		sc = sc0;
    443       1.1    ober 		bus_space_write_2(sc->sc_iot, sc->sc_ioh, SCOOP_GPWR,
    444       1.1    ober 		    sc->sc_gpwr);
    445       1.1    ober 	}
    446       1.1    ober 
    447       1.5  cegger 	if (sc1 != NULL) {
    448       1.5  cegger 		sc = sc1;
    449       1.1    ober 		bus_space_write_2(sc->sc_iot, sc->sc_ioh, SCOOP_GPWR,
    450       1.1    ober 		    sc->sc_gpwr);
    451       1.1    ober 	}
    452       1.1    ober }
    453