Home | History | Annotate | Line # | Download | only in i2c
pcai2cmux.c revision 1.8.4.1
      1  1.8.4.1   thorpej /*	$NetBSD: pcai2cmux.c,v 1.8.4.1 2021/05/08 02:44:22 thorpej Exp $	*/
      2      1.1   thorpej 
      3      1.1   thorpej /*-
      4      1.1   thorpej  * Copyright (c) 2020 The NetBSD Foundation, Inc.
      5      1.1   thorpej  * All rights reserved.
      6      1.1   thorpej  *
      7      1.1   thorpej  * This code is derived from software contributed to The NetBSD Foundation
      8      1.1   thorpej  * by Jason R. Thorpe.
      9      1.1   thorpej  *
     10      1.1   thorpej  * Redistribution and use in source and binary forms, with or without
     11      1.1   thorpej  * modification, are permitted provided that the following conditions
     12      1.1   thorpej  * are met:
     13      1.1   thorpej  * 1. Redistributions of source code must retain the above copyright
     14      1.1   thorpej  *    notice, this list of conditions and the following disclaimer.
     15      1.1   thorpej  * 2. Redistributions in binary form must reproduce the above copyright
     16      1.1   thorpej  *    notice, this list of conditions and the following disclaimer in the
     17      1.1   thorpej  *    documentation and/or other materials provided with the distribution.
     18      1.1   thorpej  *
     19      1.1   thorpej  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     20      1.1   thorpej  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     21      1.1   thorpej  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     22      1.1   thorpej  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     23      1.1   thorpej  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     24      1.1   thorpej  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     25      1.1   thorpej  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     26      1.1   thorpej  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     27      1.1   thorpej  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     28      1.1   thorpej  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     29      1.1   thorpej  * POSSIBILITY OF SUCH DAMAGE.
     30      1.1   thorpej  */
     31      1.1   thorpej 
     32      1.1   thorpej #include <sys/cdefs.h>
     33  1.8.4.1   thorpej __KERNEL_RCSID(0, "$NetBSD: pcai2cmux.c,v 1.8.4.1 2021/05/08 02:44:22 thorpej Exp $");
     34      1.1   thorpej 
     35      1.1   thorpej /*
     36      1.1   thorpej  * Driver for NXP PCA954x / PCA984x I2C switches and multiplexers.
     37      1.1   thorpej  *
     38      1.1   thorpej  * There are two flavors of this device:
     39      1.1   thorpej  *
     40      1.1   thorpej  * - Multiplexers, which connect the upstream bus to one downstream bus
     41      1.1   thorpej  *   at a time.
     42      1.1   thorpej  *
     43      1.1   thorpej  * - Switches, which can connect the upstream bus to one or more downstream
     44      1.1   thorpej  *   busses at a time (which is useful when using an all-call address for
     45      1.1   thorpej  *   a large array of PCA9685 LED controllers, for example).
     46      1.1   thorpej  *
     47      1.1   thorpej  * Alas, the device tree bindings don't have anything specifically for
     48      1.1   thorpej  * switches, so we treat the switch variants as basic multiplexers,
     49      1.1   thorpej  * only enabling one downstream bus at a time.
     50      1.1   thorpej  *
     51      1.1   thorpej  * Note that some versions of these chips also have interrupt mux
     52      1.1   thorpej  * capability.  XXX We do not support this yet.
     53      1.1   thorpej  */
     54      1.1   thorpej 
     55      1.1   thorpej #include <sys/param.h>
     56      1.1   thorpej #include <sys/systm.h>
     57      1.1   thorpej #include <sys/device.h>
     58      1.1   thorpej 
     59      1.1   thorpej #include <dev/fdt/fdtvar.h>
     60      1.1   thorpej #include <dev/i2c/i2cmuxvar.h>
     61      1.1   thorpej 
     62      1.1   thorpej /* There are a maximum of 8 busses supported. */
     63      1.1   thorpej #define	PCAIICMUX_MAX_BUSSES	8
     64      1.1   thorpej 
     65      1.1   thorpej struct pcaiicmux_type {
     66      1.1   thorpej 	unsigned int	nchannels;	/* # of downstream channels */
     67      1.1   thorpej 	uint8_t		enable_bit;	/* if 0, chip is switch type */
     68      1.1   thorpej };
     69      1.1   thorpej 
     70      1.1   thorpej static const struct pcaiicmux_type mux2_type = {
     71      1.1   thorpej 	.nchannels = 2,
     72      1.1   thorpej 	.enable_bit = __BIT(2),
     73      1.1   thorpej };
     74      1.1   thorpej 
     75      1.1   thorpej static const struct pcaiicmux_type switch2_type = {
     76      1.1   thorpej 	.nchannels = 2,
     77      1.1   thorpej 	.enable_bit = 0,
     78      1.1   thorpej };
     79      1.1   thorpej 
     80      1.1   thorpej static const struct pcaiicmux_type mux4_type = {
     81      1.1   thorpej 	.nchannels = 4,
     82      1.1   thorpej 	.enable_bit = __BIT(2),
     83      1.1   thorpej };
     84      1.1   thorpej 
     85      1.1   thorpej static const struct pcaiicmux_type switch4_type = {
     86      1.1   thorpej 	.nchannels = 4,
     87      1.1   thorpej 	.enable_bit = 0,
     88      1.1   thorpej };
     89      1.1   thorpej 
     90      1.1   thorpej static const struct pcaiicmux_type mux8_type = {
     91      1.1   thorpej 	.nchannels = 8,
     92      1.1   thorpej 	.enable_bit = __BIT(3),
     93      1.1   thorpej };
     94      1.1   thorpej 
     95      1.1   thorpej static const struct pcaiicmux_type switch8_type = {
     96      1.1   thorpej 	.nchannels = 8,
     97      1.1   thorpej 	.enable_bit = 0,
     98      1.1   thorpej };
     99      1.1   thorpej 
    100      1.1   thorpej static const struct device_compatible_entry compat_data[] = {
    101      1.1   thorpej 	/* PCA9540 - 2 channel i2c mux */
    102      1.1   thorpej 	{ .compat = "nxp,pca9540",
    103      1.2   thorpej 	  .data = &mux2_type },
    104      1.1   thorpej 
    105      1.1   thorpej 	/* PCA9542 - 2 channel i2c mux with interrupts */
    106      1.1   thorpej 	{ .compat = "nxp,pca9542",
    107      1.2   thorpej 	  .data = &mux2_type },
    108      1.1   thorpej 
    109      1.1   thorpej 	/* PCA9543 - 2 channel i2c switch with interrupts */
    110      1.1   thorpej 	{ .compat = "nxp,pca9543",
    111      1.2   thorpej 	  .data = &switch2_type },
    112      1.1   thorpej 
    113      1.1   thorpej 	/* PCA9544 - 4 channel i2c mux with interrupts */
    114      1.1   thorpej 	{ .compat = "nxp,pca9544",
    115      1.2   thorpej 	  .data = &mux4_type },
    116      1.1   thorpej 
    117      1.1   thorpej 	/* PCA9545 - 4 channel i2c switch with interrupts */
    118      1.1   thorpej 	{ .compat = "nxp,pca9545",
    119      1.2   thorpej 	  .data = &switch4_type },
    120      1.1   thorpej 
    121      1.1   thorpej 	/* PCA9546 - 4 channel i2c switch */
    122      1.1   thorpej 	{ .compat = "nxp,pca9546",
    123      1.2   thorpej 	  .data = &switch4_type },
    124      1.1   thorpej 
    125      1.1   thorpej 	/* PCA9547 - 8 channel i2c mux */
    126      1.1   thorpej 	{ .compat = "nxp,pca9547",
    127      1.2   thorpej 	  .data = &mux8_type },
    128      1.7   thorpej 	{ .compat = "NXP0002",
    129      1.7   thorpej 	  .data = &mux8_type },
    130      1.1   thorpej 
    131      1.1   thorpej 	/* PCA9548 - 8 channel i2c switch */
    132      1.1   thorpej 	{ .compat = "nxp,pca9548",
    133      1.2   thorpej 	  .data = &switch8_type },
    134      1.1   thorpej 
    135      1.1   thorpej 	/* PCA9846 - 4 channel i2c switch */
    136      1.1   thorpej 	{ .compat = "nxp,pca9846",
    137      1.2   thorpej 	  .data = &switch4_type },
    138      1.1   thorpej 
    139      1.1   thorpej 	/* PCA9847 - 8 channel i2c mux */
    140      1.1   thorpej 	{ .compat = "nxp,pca9847",
    141      1.2   thorpej 	  .data = &mux8_type },
    142      1.1   thorpej 
    143      1.1   thorpej 	/* PCA9848 - 8 channel i2c switch */
    144      1.1   thorpej 	{ .compat = "nxp,pca9848",
    145      1.2   thorpej 	  .data = &switch8_type },
    146      1.1   thorpej 
    147      1.1   thorpej 	/* PCA9849 - 4 channel i2c mux */
    148      1.1   thorpej 	{ .compat = "nxp,pca9849",
    149      1.2   thorpej 	  .data = &mux4_type },
    150      1.1   thorpej 
    151      1.8   thorpej 	DEVICE_COMPAT_EOL
    152      1.1   thorpej };
    153      1.1   thorpej 
    154      1.1   thorpej struct pcaiicmux_softc {
    155      1.1   thorpej 	struct iicmux_softc	sc_iicmux;
    156      1.1   thorpej 
    157      1.1   thorpej 	i2c_addr_t		sc_addr;
    158      1.1   thorpej 	int			sc_cur_value;
    159      1.1   thorpej 
    160      1.1   thorpej 	const struct pcaiicmux_type *sc_type;
    161  1.8.4.1   thorpej #if defined(I2CMUX_USE_FDT)
    162      1.1   thorpej 	struct fdtbus_gpio_pin *sc_reset_gpio;
    163  1.8.4.1   thorpej #endif /* I2CMUX_USE_FDT */
    164      1.1   thorpej 
    165      1.1   thorpej 	bool			sc_idle_disconnect;
    166      1.1   thorpej 
    167      1.1   thorpej 	struct pcaiicmux_bus_info {
    168      1.1   thorpej 		uint8_t		enable_value;
    169      1.1   thorpej 	} sc_bus_info[PCAIICMUX_MAX_BUSSES];
    170      1.1   thorpej };
    171      1.1   thorpej 
    172      1.1   thorpej static int
    173      1.1   thorpej pcaiicmux_write(struct pcaiicmux_softc * const sc, uint8_t const val,
    174      1.1   thorpej     int const flags)
    175      1.1   thorpej {
    176      1.1   thorpej 	if ((int)val == sc->sc_cur_value) {
    177      1.1   thorpej 		return 0;
    178      1.1   thorpej 	}
    179      1.1   thorpej 	sc->sc_cur_value = (int)val;
    180      1.1   thorpej 
    181      1.1   thorpej 	int const error =
    182      1.1   thorpej 	    iic_smbus_send_byte(sc->sc_iicmux.sc_i2c_parent, sc->sc_addr, val,
    183      1.1   thorpej 				flags & ~I2C_F_SPEED);
    184      1.1   thorpej 	if (error) {
    185      1.1   thorpej 		sc->sc_cur_value = -1;
    186      1.1   thorpej 	}
    187      1.1   thorpej 
    188      1.1   thorpej 	return error;
    189      1.1   thorpej }
    190      1.1   thorpej 
    191      1.1   thorpej /*****************************************************************************/
    192      1.1   thorpej 
    193      1.1   thorpej static void *
    194      1.1   thorpej pcaiicmux_get_mux_info(struct iicmux_softc * const iicmux)
    195      1.1   thorpej {
    196      1.1   thorpej 	return container_of(iicmux, struct pcaiicmux_softc, sc_iicmux);
    197      1.1   thorpej }
    198      1.1   thorpej 
    199      1.1   thorpej static void *
    200      1.1   thorpej pcaiicmux_get_bus_info(struct iicmux_bus * const bus)
    201      1.1   thorpej {
    202      1.1   thorpej 	struct iicmux_softc * const iicmux = bus->mux;
    203      1.1   thorpej 	struct pcaiicmux_softc * const sc = iicmux->sc_mux_data;
    204  1.8.4.1   thorpej 	devhandle_t devhandle = bus->devhandle;
    205      1.1   thorpej 	bus_addr_t addr;
    206      1.1   thorpej 	int error;
    207      1.1   thorpej 
    208      1.1   thorpej 	if (bus->busidx >= sc->sc_type->nchannels) {
    209      1.1   thorpej 		aprint_error_dev(iicmux->sc_dev,
    210      1.1   thorpej 		    "device tree error: bus index %d out of range\n",
    211      1.1   thorpej 		    bus->busidx);
    212      1.1   thorpej 		return NULL;
    213      1.1   thorpej 	}
    214      1.1   thorpej 
    215      1.1   thorpej 	struct pcaiicmux_bus_info * const bus_info =
    216      1.1   thorpej 	    &sc->sc_bus_info[bus->busidx];
    217      1.1   thorpej 
    218  1.8.4.1   thorpej 	switch (devhandle_type(devhandle)) {
    219  1.8.4.1   thorpej #if defined(I2CMUX_USE_FDT)
    220  1.8.4.1   thorpej 	case DEVHANDLE_TYPE_OF:
    221  1.8.4.1   thorpej 		error = fdtbus_get_reg(devhandle_to_of(devhandle),
    222  1.8.4.1   thorpej 		    0, &addr, NULL);
    223      1.6  jmcneill 		if (error) {
    224      1.6  jmcneill 			aprint_error_dev(iicmux->sc_dev,
    225      1.6  jmcneill 			    "unable to get reg property for bus %d\n",
    226      1.6  jmcneill 			    bus->busidx);
    227      1.6  jmcneill 			return NULL;
    228      1.6  jmcneill 		}
    229      1.6  jmcneill 		break;
    230  1.8.4.1   thorpej #endif /* I2CMUX_USE_FDT */
    231  1.8.4.1   thorpej 
    232  1.8.4.1   thorpej #if defined(I2CMUX_USE_ACPI)
    233  1.8.4.1   thorpej 	case DEVHANDLE_TYPE_ACPI: {
    234      1.6  jmcneill 		ACPI_INTEGER val;
    235      1.6  jmcneill 		ACPI_STATUS rv;
    236  1.8.4.1   thorpej 		rv = acpi_eval_integer(devhandle_to_acpi(devhandle),
    237  1.8.4.1   thorpej 		    "_ADR", &val);
    238      1.6  jmcneill 		if (ACPI_FAILURE(rv)) {
    239      1.6  jmcneill 			aprint_error_dev(iicmux->sc_dev,
    240      1.6  jmcneill 			    "unable to evaluate _ADR for bus %d: %s\n",
    241      1.6  jmcneill 			    bus->busidx, AcpiFormatException(rv));
    242      1.6  jmcneill 			return NULL;
    243      1.6  jmcneill 		}
    244      1.6  jmcneill 		addr = (bus_addr_t)val;
    245      1.6  jmcneill 	}	break;
    246  1.8.4.1   thorpej #endif /* I2CMUX_USE_ACPI */
    247  1.8.4.1   thorpej 
    248      1.6  jmcneill 	default:
    249      1.6  jmcneill 		aprint_error_dev(iicmux->sc_dev, "unsupported handle type\n");
    250      1.1   thorpej 		return NULL;
    251      1.1   thorpej 	}
    252      1.1   thorpej 
    253      1.1   thorpej 	if (addr >= sc->sc_type->nchannels) {
    254      1.1   thorpej 		aprint_error_dev(iicmux->sc_dev,
    255      1.1   thorpej 		    "device tree error: reg property %llu out of range\n",
    256      1.1   thorpej 		    (unsigned long long)addr);
    257      1.1   thorpej 		return NULL;
    258      1.1   thorpej 	}
    259      1.1   thorpej 
    260      1.1   thorpej 	/*
    261      1.1   thorpej 	 * If it's a mux type, the enable value is the channel number
    262      1.1   thorpej 	 * (from the reg property) OR'd with the enable bit.
    263      1.1   thorpej 	 *
    264      1.1   thorpej 	 * If it's a switch type, the enable value is 1 << channel number
    265      1.1   thorpej 	 * (from the reg property).
    266      1.1   thorpej 	 */
    267      1.1   thorpej 	if (sc->sc_type->enable_bit) {
    268      1.1   thorpej 		bus_info->enable_value =
    269      1.1   thorpej 		    (uint8_t)addr | sc->sc_type->enable_bit;
    270      1.1   thorpej 	} else {
    271      1.1   thorpej 		bus_info->enable_value = 1 << addr;
    272      1.1   thorpej 	}
    273      1.1   thorpej 
    274      1.1   thorpej 	return bus_info;
    275      1.1   thorpej }
    276      1.1   thorpej 
    277      1.1   thorpej static int
    278      1.1   thorpej pcaiicmux_acquire_bus(struct iicmux_bus * const bus, int const flags)
    279      1.1   thorpej {
    280      1.1   thorpej 	struct pcaiicmux_softc * const sc = bus->mux->sc_mux_data;
    281      1.1   thorpej 	struct pcaiicmux_bus_info * const bus_info = bus->bus_data;
    282      1.1   thorpej 
    283      1.1   thorpej 	return pcaiicmux_write(sc, bus_info->enable_value, flags);
    284      1.1   thorpej }
    285      1.1   thorpej 
    286      1.1   thorpej static void
    287      1.1   thorpej pcaiicmux_release_bus(struct iicmux_bus * const bus, int const flags)
    288      1.1   thorpej {
    289      1.1   thorpej 	struct pcaiicmux_softc * const sc = bus->mux->sc_mux_data;
    290      1.1   thorpej 
    291      1.1   thorpej 	if (sc->sc_idle_disconnect) {
    292      1.1   thorpej 		(void) pcaiicmux_write(sc, 0, flags);
    293      1.1   thorpej 	}
    294      1.1   thorpej }
    295      1.1   thorpej 
    296      1.1   thorpej static const struct iicmux_config pcaiicmux_config = {
    297      1.1   thorpej 	.desc = "PCA954x",
    298      1.1   thorpej 	.get_mux_info = pcaiicmux_get_mux_info,
    299      1.1   thorpej 	.get_bus_info = pcaiicmux_get_bus_info,
    300      1.1   thorpej 	.acquire_bus = pcaiicmux_acquire_bus,
    301      1.1   thorpej 	.release_bus = pcaiicmux_release_bus,
    302      1.1   thorpej };
    303      1.1   thorpej 
    304      1.1   thorpej /*****************************************************************************/
    305      1.1   thorpej 
    306      1.1   thorpej static const struct pcaiicmux_type *
    307      1.1   thorpej pcaiicmux_type_by_compat(const struct i2c_attach_args * const ia)
    308      1.1   thorpej {
    309      1.1   thorpej 	const struct pcaiicmux_type *type = NULL;
    310      1.1   thorpej 	const struct device_compatible_entry *dce;
    311      1.1   thorpej 
    312      1.3   thorpej 	if ((dce = iic_compatible_lookup(ia, compat_data)) != NULL)
    313      1.2   thorpej 		type = dce->data;
    314      1.1   thorpej 
    315      1.1   thorpej 	return type;
    316      1.1   thorpej }
    317      1.1   thorpej 
    318      1.1   thorpej static int
    319      1.1   thorpej pcaiicmux_match(device_t parent, cfdata_t cf, void *aux)
    320      1.1   thorpej {
    321      1.1   thorpej 	struct i2c_attach_args * const ia = aux;
    322      1.1   thorpej 	int match_result;
    323      1.1   thorpej 
    324      1.1   thorpej 	if (iic_use_direct_match(ia, cf, compat_data, &match_result)) {
    325      1.1   thorpej 		return match_result;
    326      1.1   thorpej 	}
    327      1.4  jmcneill 
    328      1.1   thorpej 	/* This device is direct-config only. */
    329      1.1   thorpej 
    330      1.1   thorpej 	return 0;
    331      1.1   thorpej }
    332      1.1   thorpej 
    333      1.1   thorpej static void
    334      1.1   thorpej pcaiicmux_attach(device_t parent, device_t self, void *aux)
    335      1.1   thorpej {
    336      1.1   thorpej 	struct pcaiicmux_softc * const sc = device_private(self);
    337      1.1   thorpej 	struct i2c_attach_args * const ia = aux;
    338  1.8.4.1   thorpej 	devhandle_t devhandle = ia->ia_devhandle;
    339      1.1   thorpej 	int error;
    340      1.1   thorpej 
    341  1.8.4.1   thorpej 	device_set_handle(self, devhandle);
    342  1.8.4.1   thorpej 
    343      1.1   thorpej 	sc->sc_iicmux.sc_dev = self;
    344      1.1   thorpej 	sc->sc_iicmux.sc_config = &pcaiicmux_config;
    345      1.1   thorpej 	sc->sc_iicmux.sc_i2c_parent = ia->ia_tag;
    346      1.1   thorpej 	sc->sc_addr = ia->ia_addr;
    347      1.1   thorpej 
    348      1.1   thorpej 	sc->sc_type = pcaiicmux_type_by_compat(ia);
    349      1.1   thorpej 	KASSERT(sc->sc_type != NULL);
    350      1.1   thorpej 
    351      1.1   thorpej 	aprint_naive("\n");
    352      1.1   thorpej 	aprint_normal(": PCA954x I2C %s\n",
    353      1.1   thorpej 	    sc->sc_type->enable_bit ? "mux" : "switch");
    354      1.1   thorpej 
    355  1.8.4.1   thorpej #if defined(I2CMUX_USE_FDT)
    356  1.8.4.1   thorpej 	if (devhandle_type(devhandle) == DEVHANDLE_TYPE_OF) {
    357  1.8.4.1   thorpej 		const int phandle = devhandle_to_of(devhandle);
    358      1.6  jmcneill 		if (of_hasprop(phandle, "i2c-mux-idle-disconnect")) {
    359      1.6  jmcneill 			sc->sc_idle_disconnect = true;
    360      1.6  jmcneill 		}
    361      1.6  jmcneill 
    362      1.6  jmcneill 		/* Reset the mux if a reset GPIO is specified. */
    363      1.6  jmcneill 		sc->sc_reset_gpio = fdtbus_gpio_acquire(phandle, "reset-gpios",
    364      1.6  jmcneill 		    GPIO_PIN_OUTPUT);
    365      1.6  jmcneill 		if (sc->sc_reset_gpio) {
    366      1.6  jmcneill 			fdtbus_gpio_write(sc->sc_reset_gpio, 1);
    367      1.6  jmcneill 			delay(10);
    368      1.6  jmcneill 			fdtbus_gpio_write(sc->sc_reset_gpio, 0);
    369      1.6  jmcneill 			delay(10);
    370      1.6  jmcneill 		}
    371      1.1   thorpej 	}
    372  1.8.4.1   thorpej #endif /* I2CMUX_USE_FDT */
    373      1.1   thorpej 
    374      1.1   thorpej 	/* Force the mux into a disconnected state. */
    375      1.1   thorpej 	sc->sc_cur_value = -1;
    376      1.1   thorpej 	error = iic_acquire_bus(ia->ia_tag, 0);
    377      1.1   thorpej 	if (error) {
    378      1.1   thorpej 		aprint_error_dev(self, "failed to acquire I2C bus\n");
    379      1.1   thorpej 		return;
    380      1.1   thorpej 	}
    381      1.1   thorpej 	error = pcaiicmux_write(sc, 0, 0);
    382      1.1   thorpej 	iic_release_bus(ia->ia_tag, 0);
    383      1.1   thorpej 	if (error) {
    384      1.1   thorpej 		aprint_error_dev(self,
    385      1.1   thorpej 		    "failed to set mux to disconnected state\n");
    386      1.1   thorpej 		return;
    387      1.1   thorpej 	}
    388      1.1   thorpej 
    389      1.1   thorpej 	iicmux_attach(&sc->sc_iicmux);
    390      1.1   thorpej }
    391      1.1   thorpej 
    392      1.1   thorpej CFATTACH_DECL_NEW(pcaiicmux, sizeof(struct pcaiicmux_softc),
    393      1.1   thorpej     pcaiicmux_match, pcaiicmux_attach, NULL, NULL);
    394