1239281Sgonzo/*- 2239281Sgonzo * Copyright (c) 2011 3239281Sgonzo * Ben Gray <ben.r.gray@gmail.com>. 4239281Sgonzo * All rights reserved. 5239281Sgonzo * 6239281Sgonzo * Redistribution and use in source and binary forms, with or without 7239281Sgonzo * modification, are permitted provided that the following conditions 8239281Sgonzo * are met: 9239281Sgonzo * 1. Redistributions of source code must retain the above copyright 10239281Sgonzo * notice, this list of conditions and the following disclaimer. 11239281Sgonzo * 2. Redistributions in binary form must reproduce the above copyright 12239281Sgonzo * notice, this list of conditions and the following disclaimer in the 13239281Sgonzo * documentation and/or other materials provided with the distribution. 14239281Sgonzo * 3. The name of the company nor the name of the author may be used to 15239281Sgonzo * endorse or promote products derived from this software without specific 16239281Sgonzo * prior written permission. 17239281Sgonzo * 18239281Sgonzo * THIS SOFTWARE IS PROVIDED BY BEN GRAY ``AS IS'' AND ANY EXPRESS OR 19239281Sgonzo * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20239281Sgonzo * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21239281Sgonzo * IN NO EVENT SHALL BEN GRAY BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22239281Sgonzo * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 23239281Sgonzo * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 24239281Sgonzo * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 25239281Sgonzo * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 26239281Sgonzo * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 27239281Sgonzo * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28273262Sandrew * 29273262Sandrew * $FreeBSD: releng/11.0/sys/arm/ti/omap4/omap4_scm_padconf.h 273262 2014-10-18 17:51:34Z andrew $ 30239281Sgonzo */ 31239281Sgonzo 32273262Sandrew#ifndef OMAP4_SCM_PADCONF_H 33273262Sandrew#define OMAP4_SCM_PADCONF_H 34239281Sgonzo 35239281Sgonzo#define CONTROL_PADCONF_WAKEUP_EVENT (1UL << 15) 36239281Sgonzo#define CONTROL_PADCONF_WAKEUP_ENABLE (1UL << 14) 37239281Sgonzo#define CONTROL_PADCONF_OFF_PULL_UP (1UL << 13) 38239281Sgonzo#define CONTROL_PADCONF_OFF_PULL_ENABLE (1UL << 12) 39239281Sgonzo#define CONTROL_PADCONF_OFF_OUT_HIGH (1UL << 11) 40239281Sgonzo#define CONTROL_PADCONF_OFF_OUT_ENABLE (1UL << 10) 41239281Sgonzo#define CONTROL_PADCONF_OFF_ENABLE (1UL << 9) 42239281Sgonzo#define CONTROL_PADCONF_INPUT_ENABLE (1UL << 8) 43239281Sgonzo#define CONTROL_PADCONF_PULL_UP (1UL << 4) 44239281Sgonzo#define CONTROL_PADCONF_PULL_ENABLE (1UL << 3) 45239281Sgonzo#define CONTROL_PADCONF_MUXMODE_MASK (0x7) 46239281Sgonzo 47239281Sgonzo#define CONTROL_PADCONF_SATE_MASK ( CONTROL_PADCONF_WAKEUP_EVENT \ 48239281Sgonzo | CONTROL_PADCONF_WAKEUP_ENABLE \ 49239281Sgonzo | CONTROL_PADCONF_OFF_PULL_UP \ 50239281Sgonzo | CONTROL_PADCONF_OFF_PULL_ENABLE \ 51239281Sgonzo | CONTROL_PADCONF_OFF_OUT_HIGH \ 52239281Sgonzo | CONTROL_PADCONF_OFF_OUT_ENABLE \ 53239281Sgonzo | CONTROL_PADCONF_OFF_ENABLE \ 54239281Sgonzo | CONTROL_PADCONF_INPUT_ENABLE \ 55239281Sgonzo | CONTROL_PADCONF_PULL_UP \ 56239281Sgonzo | CONTROL_PADCONF_PULL_ENABLE ) 57239281Sgonzo 58239281Sgonzo/* Active pin states */ 59239281Sgonzo#define PADCONF_PIN_OUTPUT 0 60239281Sgonzo#define PADCONF_PIN_INPUT CONTROL_PADCONF_INPUT_ENABLE 61239281Sgonzo#define PADCONF_PIN_INPUT_PULLUP ( CONTROL_PADCONF_INPUT_ENABLE \ 62239281Sgonzo | CONTROL_PADCONF_PULL_ENABLE \ 63239281Sgonzo | CONTROL_PADCONF_PULL_UP) 64239281Sgonzo#define PADCONF_PIN_INPUT_PULLDOWN ( CONTROL_PADCONF_INPUT_ENABLE \ 65239281Sgonzo | CONTROL_PADCONF_PULL_ENABLE ) 66239281Sgonzo 67239281Sgonzo/* Off mode states */ 68239281Sgonzo#define PADCONF_PIN_OFF_NONE 0 69239281Sgonzo#define PADCONF_PIN_OFF_OUTPUT_HIGH ( CONTROL_PADCONF_OFF_ENABLE \ 70239281Sgonzo | CONTROL_PADCONF_OFF_OUT_ENABLE \ 71239281Sgonzo | CONTROL_PADCONF_OFF_OUT_HIGH) 72239281Sgonzo#define PADCONF_PIN_OFF_OUTPUT_LOW ( CONTROL_PADCONF_OFF_ENABLE \ 73239281Sgonzo | CONTROL_PADCONF_OFF_OUT_ENABLE) 74239281Sgonzo#define PADCONF_PIN_OFF_INPUT_PULLUP ( CONTROL_PADCONF_OFF_ENABLE \ 75239281Sgonzo | CONTROL_PADCONF_OFF_PULL_ENABLE \ 76239281Sgonzo | CONTROL_PADCONF_OFF_PULL_UP) 77239281Sgonzo#define PADCONF_PIN_OFF_INPUT_PULLDOWN ( CONTROL_PADCONF_OFF_ENABLE \ 78239281Sgonzo | CONTROL_PADCONF_OFF_PULL_ENABLE) 79239281Sgonzo#define PADCONF_PIN_OFF_WAKEUPENABLE CONTROL_PADCONF_WAKEUP_ENABLE 80239281Sgonzo 81273262Sandrew#endif /* OMAP4_SCM_PADCONF_H */ 82