/*1* Copyright (c) 20102* Ben Gray <[email protected]>.3* All rights reserved.4*5* Redistribution and use in source and binary forms, with or without6* modification, are permitted provided that the following conditions7* are met:8* 1. Redistributions of source code must retain the above copyright9* notice, this list of conditions and the following disclaimer.10* 2. Redistributions in binary form must reproduce the above copyright11* notice, this list of conditions and the following disclaimer in the12* documentation and/or other materials provided with the distribution.13* 3. All advertising materials mentioning features or use of this software14* must display the following acknowledgement:15* This product includes software developed by Ben Gray.16* 4. The name of the company nor the name of the author may be used to17* endorse or promote products derived from this software without specific18* prior written permission.19*20* THIS SOFTWARE IS PROVIDED BY BEN GRAY ``AS IS'' AND ANY EXPRESS OR21* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES22* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.23* IN NO EVENT SHALL BEN GRAY BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,24* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,25* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;26* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,27* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR28* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF29* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.30*/3132/**33* Functions to configure the PIN multiplexing on the chip.34*35* This is different from the GPIO module in that it is used to configure the36* pins between modules not just GPIO input output.37*38*/39#ifndef _TI_PINMUX_H_40#define _TI_PINMUX_H_4142struct ti_pinmux_padconf {43uint16_t reg_off;44uint16_t gpio_pin;45uint16_t gpio_mode;46const char *ballname;47const char *muxmodes[8];48};4950struct ti_pinmux_padstate {51const char *state;52uint16_t reg;53};5455struct ti_pinmux_device {56uint16_t padconf_muxmode_mask;57uint16_t padconf_sate_mask;58const struct ti_pinmux_padstate *padstate;59const struct ti_pinmux_padconf *padconf;60};6162struct ti_pinmux_softc {63device_t sc_dev;64struct resource * sc_res[4];65bus_space_tag_t sc_bst;66bus_space_handle_t sc_bsh;67};6869int ti_pinmux_padconf_set(const char *padname, const char *muxmode,70unsigned int state);71int ti_pinmux_padconf_get(const char *padname, const char **muxmode,72unsigned int *state);73int ti_pinmux_padconf_set_gpiomode(uint32_t gpio, unsigned int state);74int ti_pinmux_padconf_get_gpiomode(uint32_t gpio, unsigned int *state);7576#endif /* _TI_SCM_H_ */777879