Home | History | Annotate | Line # | Download | only in dev
scoop.c revision 1.6
      1  1.6  nonaka /*	$NetBSD: scoop.c,v 1.6 2009/01/29 12:28:15 nonaka 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.6  nonaka __KERNEL_RCSID(0, "$NetBSD: scoop.c,v 1.6 2009/01/29 12:28:15 nonaka 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.1    ober 	} else if (!ZAURUS_ISC3000) {
    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.1    ober 
    119  1.2   peter #if 0
    120  1.2   peter static int
    121  1.1    ober scoop_gpio_pin_read(struct scoop_softc *sc, int pin)
    122  1.1    ober {
    123  1.1    ober 	uint16_t bit = (1 << pin);
    124  1.1    ober 	uint16_t rv;
    125  1.1    ober 
    126  1.1    ober 	rv = bus_space_read_2(sc->sc_iot, sc->sc_ioh, SCOOP_GPWR);
    127  1.2   peter 	return (rv & bit) ? 1 : 0;
    128  1.1    ober }
    129  1.2   peter #endif
    130  1.1    ober 
    131  1.2   peter static void
    132  1.1    ober scoop_gpio_pin_write(struct scoop_softc *sc, int pin, int level)
    133  1.1    ober {
    134  1.1    ober 	uint16_t bit = (1 << pin);
    135  1.1    ober 	uint16_t rv;
    136  1.1    ober 
    137  1.1    ober 	rv = bus_space_read_2(sc->sc_iot, sc->sc_ioh, SCOOP_GPWR);
    138  1.1    ober 	bus_space_write_2(sc->sc_iot, sc->sc_ioh, SCOOP_GPWR,
    139  1.2   peter 	    (level == GPIO_PIN_LOW) ? (rv & ~bit) : (rv | bit));
    140  1.1    ober }
    141  1.1    ober 
    142  1.2   peter static void
    143  1.1    ober scoop_gpio_pin_ctl(struct scoop_softc *sc, int pin, int flags)
    144  1.1    ober {
    145  1.1    ober 	uint16_t bit = (1 << pin);
    146  1.1    ober 	uint16_t rv;
    147  1.1    ober 
    148  1.1    ober 	rv = bus_space_read_2(sc->sc_iot, sc->sc_ioh, SCOOP_GPCR);
    149  1.1    ober 	switch (flags & (GPIO_PIN_INPUT|GPIO_PIN_OUTPUT)) {
    150  1.1    ober 	case GPIO_PIN_INPUT:
    151  1.1    ober 		rv &= ~bit;
    152  1.1    ober 		break;
    153  1.1    ober 	case GPIO_PIN_OUTPUT:
    154  1.1    ober 		rv |= bit;
    155  1.1    ober 		break;
    156  1.1    ober 	}
    157  1.1    ober 	bus_space_write_2(sc->sc_iot, sc->sc_ioh, SCOOP_GPCR, rv);
    158  1.1    ober }
    159  1.1    ober 
    160  1.1    ober /*
    161  1.1    ober  * Turn the LCD background light and contrast signal on or off.
    162  1.1    ober  */
    163  1.1    ober void
    164  1.1    ober scoop_set_backlight(int on, int cont)
    165  1.1    ober {
    166  1.5  cegger 	struct scoop_softc *sc;
    167  1.5  cegger #if 0
    168  1.5  cegger 	struct scoop_softc *sc0;
    169  1.5  cegger 
    170  1.5  cegger 	sc0 = device_lookup_private(&scoop_cd, 0);
    171  1.5  cegger #endif
    172  1.1    ober 
    173  1.5  cegger 	sc = device_lookup_private(&scoop_cd, 1);
    174  1.5  cegger 	if (sc != NULL) {
    175  1.1    ober 		/* C3000 */
    176  1.5  cegger 		scoop_gpio_pin_write(sc,
    177  1.1    ober 		    SCOOP1_BACKLIGHT_CONT, !cont);
    178  1.5  cegger 		scoop_gpio_pin_write(sc,
    179  1.1    ober 		    SCOOP1_BACKLIGHT_ON, on);
    180  1.1    ober 	}
    181  1.1    ober #if 0
    182  1.5  cegger 	else if (sc0 != NULL) {
    183  1.5  cegger 		scoop_gpio_pin_write(sc0,
    184  1.1    ober 		    SCOOP0_BACKLIGHT_CONT, cont);
    185  1.1    ober 	}
    186  1.1    ober #endif
    187  1.1    ober }
    188  1.1    ober 
    189  1.1    ober /*
    190  1.1    ober  * Turn the infrared LED on or off (must be on while transmitting).
    191  1.1    ober  */
    192  1.1    ober void
    193  1.1    ober scoop_set_irled(int on)
    194  1.1    ober {
    195  1.5  cegger 	struct scoop_softc *sc;
    196  1.2   peter 
    197  1.5  cegger 	sc = device_lookup_private(&scoop_cd, 1);
    198  1.5  cegger 	if (sc != NULL) {
    199  1.1    ober 		/* IR_ON is inverted */
    200  1.5  cegger 		scoop_gpio_pin_write(sc,
    201  1.1    ober 		    SCOOP1_IR_ON, !on);
    202  1.2   peter 	}
    203  1.1    ober }
    204  1.1    ober 
    205  1.1    ober /*
    206  1.1    ober  * Turn the green and orange LEDs on or off.  If the orange LED is on,
    207  1.1    ober  * then it is wired to indicate if A/C is connected.  The green LED has
    208  1.1    ober  * no such predefined function.
    209  1.1    ober  */
    210  1.1    ober void
    211  1.1    ober scoop_led_set(int led, int on)
    212  1.1    ober {
    213  1.5  cegger 	struct scoop_softc *sc;
    214  1.1    ober 
    215  1.5  cegger 	sc = device_lookup_private(&scoop_cd, 0);
    216  1.5  cegger 	if (sc != NULL) {
    217  1.1    ober 		if ((led & SCOOP_LED_GREEN) != 0) {
    218  1.5  cegger 			scoop_gpio_pin_write(sc,
    219  1.1    ober 			    SCOOP0_LED_GREEN, on);
    220  1.1    ober 		}
    221  1.1    ober 		if (scoop_cd.cd_ndevs > 1 && (led & SCOOP_LED_ORANGE) != 0) {
    222  1.5  cegger 			scoop_gpio_pin_write(sc,
    223  1.1    ober 			    SCOOP0_LED_ORANGE_C3000, on);
    224  1.1    ober 		}
    225  1.1    ober 	}
    226  1.1    ober }
    227  1.1    ober 
    228  1.1    ober /*
    229  1.1    ober  * Enable or disable the headphone output connection.
    230  1.1    ober  */
    231  1.1    ober void
    232  1.1    ober scoop_set_headphone(int on)
    233  1.1    ober {
    234  1.5  cegger 	struct scoop_softc *sc;
    235  1.1    ober 
    236  1.5  cegger 	sc = device_lookup_private(&scoop_cd, 0);
    237  1.5  cegger 	if (sc == NULL)
    238  1.1    ober 		return;
    239  1.1    ober 
    240  1.5  cegger 	scoop_gpio_pin_ctl(sc, SCOOP0_MUTE_L,
    241  1.1    ober 	    GPIO_PIN_OUTPUT);
    242  1.5  cegger 	scoop_gpio_pin_ctl(sc, SCOOP0_MUTE_R,
    243  1.1    ober 	    GPIO_PIN_OUTPUT);
    244  1.1    ober 
    245  1.1    ober 	if (on) {
    246  1.5  cegger 		scoop_gpio_pin_write(sc, SCOOP0_MUTE_L,
    247  1.1    ober 		    GPIO_PIN_HIGH);
    248  1.5  cegger 		scoop_gpio_pin_write(sc, SCOOP0_MUTE_R,
    249  1.1    ober 		    GPIO_PIN_HIGH);
    250  1.1    ober 	} else {
    251  1.5  cegger 		scoop_gpio_pin_write(sc, SCOOP0_MUTE_L,
    252  1.1    ober 		    GPIO_PIN_LOW);
    253  1.5  cegger 		scoop_gpio_pin_write(sc, SCOOP0_MUTE_R,
    254  1.1    ober 		    GPIO_PIN_LOW);
    255  1.1    ober 	}
    256  1.1    ober }
    257  1.1    ober 
    258  1.1    ober /*
    259  1.1    ober  * Turn on pullup resistor while not reading the remote control.
    260  1.1    ober  */
    261  1.1    ober void
    262  1.1    ober scoop_akin_pullup(int enable)
    263  1.1    ober {
    264  1.5  cegger 	struct scoop_softc *sc0;
    265  1.5  cegger 	struct scoop_softc *sc1;
    266  1.5  cegger 
    267  1.5  cegger 	sc0 = device_lookup_private(&scoop_cd, 0);
    268  1.5  cegger 	sc1 = device_lookup_private(&scoop_cd, 1);
    269  1.1    ober 
    270  1.5  cegger 	if (sc1 != NULL) {
    271  1.5  cegger 		scoop_gpio_pin_write(sc1,
    272  1.1    ober 		    SCOOP1_AKIN_PULLUP, enable);
    273  1.5  cegger 	} else if (sc0 != NULL) {
    274  1.5  cegger 		scoop_gpio_pin_write(sc0,
    275  1.1    ober 		    SCOOP0_AKIN_PULLUP, enable);
    276  1.1    ober 	}
    277  1.1    ober }
    278  1.1    ober 
    279  1.1    ober void
    280  1.1    ober scoop_battery_temp_adc(int enable)
    281  1.1    ober {
    282  1.5  cegger 	struct scoop_softc *sc;
    283  1.5  cegger 
    284  1.5  cegger 	sc = device_lookup_private(&scoop_cd, 0);
    285  1.1    ober 
    286  1.5  cegger 	if (sc != NULL) {
    287  1.5  cegger 		scoop_gpio_pin_write(sc,
    288  1.1    ober 		    SCOOP0_ADC_TEMP_ON_C3000, enable);
    289  1.1    ober 	}
    290  1.1    ober }
    291  1.1    ober 
    292  1.1    ober void
    293  1.1    ober scoop_charge_battery(int enable, int voltage_high)
    294  1.1    ober {
    295  1.5  cegger 	struct scoop_softc *sc;
    296  1.5  cegger 
    297  1.5  cegger 	sc = device_lookup_private(&scoop_cd, 0);
    298  1.1    ober 
    299  1.5  cegger 	if (sc != NULL) {
    300  1.5  cegger 		scoop_gpio_pin_write(sc,
    301  1.1    ober 		    SCOOP0_JK_B_C3000, voltage_high);
    302  1.5  cegger 		scoop_gpio_pin_write(sc,
    303  1.1    ober 		    SCOOP0_CHARGE_OFF_C3000, !enable);
    304  1.1    ober 	}
    305  1.1    ober }
    306  1.1    ober 
    307  1.1    ober void
    308  1.1    ober scoop_discharge_battery(int enable)
    309  1.1    ober {
    310  1.5  cegger 	struct scoop_softc *sc;
    311  1.1    ober 
    312  1.5  cegger 	sc = device_lookup_private(&scoop_cd, 0);
    313  1.5  cegger 
    314  1.5  cegger 	if (sc != NULL) {
    315  1.5  cegger 		scoop_gpio_pin_write(sc,
    316  1.1    ober 		    SCOOP0_JK_A_C3000, enable);
    317  1.1    ober 	}
    318  1.1    ober }
    319  1.1    ober 
    320  1.3  nonaka /*
    321  1.3  nonaka  * Enable or disable 3.3V power to the SD/MMC card slot.
    322  1.3  nonaka  */
    323  1.3  nonaka void
    324  1.3  nonaka scoop_set_sdmmc_power(int on)
    325  1.3  nonaka {
    326  1.3  nonaka 
    327  1.3  nonaka 	scoop0_set_card_power(SD_CARD, on ? SCP_CPR_SD_3V : SCP_CPR_OFF);
    328  1.3  nonaka }
    329  1.3  nonaka 
    330  1.3  nonaka /*
    331  1.3  nonaka  * The Card Power Register of the first SCOOP unit controls the power
    332  1.3  nonaka  * for the first CompactFlash slot and the SD/MMC card slot as well.
    333  1.3  nonaka  */
    334  1.2   peter void
    335  1.3  nonaka scoop0_set_card_power(enum scoop_card card, int new_cpr)
    336  1.2   peter {
    337  1.2   peter 	struct scoop_softc *sc;
    338  1.2   peter 	bus_space_tag_t iot;
    339  1.2   peter 	bus_space_handle_t ioh;
    340  1.3  nonaka 	uint16_t cpr;
    341  1.2   peter 
    342  1.5  cegger 	sc = device_lookup_private(&scoop_cd, 0);
    343  1.5  cegger 	if (sc == NULL)
    344  1.3  nonaka 		return;
    345  1.2   peter 
    346  1.3  nonaka 	iot = sc->sc_iot;
    347  1.3  nonaka 	ioh = sc->sc_ioh;
    348  1.3  nonaka 
    349  1.3  nonaka 	cpr = bus_space_read_2(iot, ioh, SCOOP_CPR);
    350  1.3  nonaka 	if (new_cpr & SCP_CPR_VOLTAGE_MSK) {
    351  1.3  nonaka 		if (card == CF_CARD)
    352  1.3  nonaka 			cpr |= SCP_CPR_5V;
    353  1.3  nonaka 		else if (card == SD_CARD)
    354  1.3  nonaka 			cpr |= SCP_CPR_SD_3V;
    355  1.3  nonaka 
    356  1.3  nonaka 		scoop_gpio_pin_write(sc, SCOOP0_CF_POWER_C3000, 1);
    357  1.3  nonaka 		if (!ISSET(cpr, SCP_CPR_5V) && !ISSET(cpr, SCP_CPR_SD_3V))
    358  1.3  nonaka 			delay(5000);
    359  1.3  nonaka 		bus_space_write_2(iot, ioh, SCOOP_CPR, cpr | new_cpr);
    360  1.3  nonaka 	} else {
    361  1.3  nonaka 		if (card == CF_CARD)
    362  1.3  nonaka 			cpr &= ~SCP_CPR_5V;
    363  1.3  nonaka 		else if (card == SD_CARD)
    364  1.3  nonaka 			cpr &= ~SCP_CPR_SD_3V;
    365  1.3  nonaka 
    366  1.3  nonaka 		if (!ISSET(cpr, SCP_CPR_5V) && !ISSET(cpr, SCP_CPR_SD_3V)) {
    367  1.3  nonaka 			bus_space_write_2(iot, ioh, SCOOP_CPR, SCP_CPR_OFF);
    368  1.3  nonaka 			delay(1000);
    369  1.3  nonaka 			scoop_gpio_pin_write(sc, SCOOP0_CF_POWER_C3000, 0);
    370  1.3  nonaka 		} else
    371  1.3  nonaka 			bus_space_write_2(iot, ioh, SCOOP_CPR, cpr | new_cpr);
    372  1.2   peter 	}
    373  1.2   peter }
    374  1.2   peter 
    375  1.1    ober void
    376  1.1    ober scoop_check_mcr(void)
    377  1.1    ober {
    378  1.5  cegger 	struct scoop_softc *sc0, *sc1, *sc;
    379  1.1    ober 	uint16_t v;
    380  1.1    ober 
    381  1.5  cegger 	sc0 = device_lookup_private(&scoop_cd, 0);
    382  1.5  cegger 	sc1 = device_lookup_private(&scoop_cd, 1);
    383  1.5  cegger 
    384  1.1    ober 	/* C3000 */
    385  1.5  cegger 	if (sc1 != NULL) {
    386  1.5  cegger 		sc = sc0;
    387  1.1    ober 		v = bus_space_read_2(sc->sc_iot, sc->sc_ioh, SCOOP_MCR);
    388  1.1    ober 		if ((v & 0x100) == 0) {
    389  1.1    ober 			bus_space_write_2(sc->sc_iot, sc->sc_ioh, SCOOP_MCR,
    390  1.1    ober 			    0x0101);
    391  1.1    ober 		}
    392  1.1    ober 
    393  1.5  cegger 		sc = sc1;
    394  1.1    ober 		v = bus_space_read_2(sc->sc_iot, sc->sc_ioh, SCOOP_MCR);
    395  1.1    ober 		if ((v & 0x100) == 0) {
    396  1.1    ober 			bus_space_write_2(sc->sc_iot, sc->sc_ioh, SCOOP_MCR,
    397  1.1    ober 			    0x0101);
    398  1.1    ober 		}
    399  1.1    ober 	}
    400  1.1    ober }
    401  1.1    ober 
    402  1.1    ober void
    403  1.1    ober scoop_suspend(void)
    404  1.1    ober {
    405  1.5  cegger 	struct scoop_softc *sc, *sc0, *sc1;
    406  1.1    ober 	uint32_t rv;
    407  1.1    ober 
    408  1.5  cegger 	sc0 = device_lookup_private(&scoop_cd, 0);
    409  1.5  cegger 	sc1 = device_lookup_private(&scoop_cd, 1);
    410  1.5  cegger 
    411  1.5  cegger 	if (sc0 != NULL) {
    412  1.5  cegger 		sc = sc0;
    413  1.1    ober 		sc->sc_gpwr = bus_space_read_2(sc->sc_iot, sc->sc_ioh,
    414  1.1    ober 		    SCOOP_GPWR);
    415  1.1    ober 		/* C3000 */
    416  1.1    ober 		bus_space_write_2(sc->sc_iot, sc->sc_ioh, SCOOP_GPWR,
    417  1.1    ober 		    sc->sc_gpwr & ~((1<<SCOOP0_MUTE_L) | (1<<SCOOP0_MUTE_R) |
    418  1.1    ober 		    (1<<SCOOP0_JK_A_C3000) | (1<<SCOOP0_ADC_TEMP_ON_C3000) |
    419  1.1    ober 		    (1<<SCOOP0_LED_GREEN)));
    420  1.1    ober 	}
    421  1.1    ober 
    422  1.1    ober 	/* C3000 */
    423  1.5  cegger 	if (sc1 != NULL) {
    424  1.5  cegger 		sc = sc1;
    425  1.1    ober 		sc->sc_gpwr = bus_space_read_2(sc->sc_iot, sc->sc_ioh,
    426  1.1    ober 		    SCOOP_GPWR);
    427  1.1    ober 		bus_space_write_2(sc->sc_iot, sc->sc_ioh, SCOOP_GPWR,
    428  1.1    ober 		    sc->sc_gpwr & ~((1<<SCOOP1_RESERVED_4) |
    429  1.1    ober 		    (1<<SCOOP1_RESERVED_5) | (1<<SCOOP1_RESERVED_6) |
    430  1.1    ober 		    (1<<SCOOP1_BACKLIGHT_CONT) | (1<<SCOOP1_BACKLIGHT_ON) |
    431  1.1    ober 		    (1<<SCOOP1_MIC_BIAS)));
    432  1.1    ober 		rv = bus_space_read_2(sc->sc_iot, sc->sc_ioh, SCOOP_GPWR);
    433  1.1    ober 		bus_space_write_2(sc->sc_iot, sc->sc_ioh, SCOOP_GPWR,
    434  1.1    ober 		    rv | ((1<<SCOOP1_IR_ON) | (1<<SCOOP1_RESERVED_3)));
    435  1.1    ober 	}
    436  1.1    ober }
    437  1.1    ober 
    438  1.1    ober void
    439  1.1    ober scoop_resume(void)
    440  1.1    ober {
    441  1.5  cegger 	struct scoop_softc *sc, *sc0, *sc1;
    442  1.5  cegger 
    443  1.5  cegger 	sc0 = device_lookup_private(&scoop_cd, 0);
    444  1.5  cegger 	sc1 = device_lookup_private(&scoop_cd, 1);
    445  1.1    ober 
    446  1.5  cegger 	if (sc0 != NULL) {
    447  1.5  cegger 		sc = sc0;
    448  1.1    ober 		bus_space_write_2(sc->sc_iot, sc->sc_ioh, SCOOP_GPWR,
    449  1.1    ober 		    sc->sc_gpwr);
    450  1.1    ober 	}
    451  1.1    ober 
    452  1.5  cegger 	if (sc1 != NULL) {
    453  1.5  cegger 		sc = sc1;
    454  1.1    ober 		bus_space_write_2(sc->sc_iot, sc->sc_ioh, SCOOP_GPWR,
    455  1.1    ober 		    sc->sc_gpwr);
    456  1.1    ober 	}
    457  1.1    ober }
    458