-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ARM] 4432/5: davinci: pin mux support
Support pin multiplexing configurations driver for TI DaVinci SoC Signed-off-by: Vladimir Barinov <vbarinov@ru.mvista.com> Acked-by: Kevin Hilman <khilman@mvista.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
- Loading branch information
Vladimir Barinov
authored and
Russell King
committed
Jul 12, 2007
1 parent
3d9edf0
commit 83f5322
Showing
4 changed files
with
154 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* DaVinci pin multiplexing configurations | ||
* | ||
* Author: Vladimir Barinov, MontaVista Software, Inc. <source@mvista.com> | ||
* | ||
* 2007 (c) MontaVista Software, Inc. This file is licensed under | ||
* the terms of the GNU General Public License version 2. This program | ||
* is licensed "as is" without any warranty of any kind, whether express | ||
* or implied. | ||
*/ | ||
#include <linux/io.h> | ||
#include <linux/spinlock.h> | ||
|
||
#include <asm/hardware.h> | ||
|
||
#include <asm/arch/mux.h> | ||
|
||
/* System control register offsets */ | ||
#define PINMUX0 0x00 | ||
#define PINMUX1 0x04 | ||
|
||
static DEFINE_SPINLOCK(mux_lock); | ||
|
||
void davinci_mux_peripheral(unsigned int mux, unsigned int enable) | ||
{ | ||
u32 pinmux, muxreg = PINMUX0; | ||
|
||
if (mux >= DAVINCI_MUX_LEVEL2) { | ||
muxreg = PINMUX1; | ||
mux -= DAVINCI_MUX_LEVEL2; | ||
} | ||
|
||
spin_lock(&mux_lock); | ||
pinmux = davinci_readl(DAVINCI_SYSTEM_MODULE_BASE + muxreg); | ||
if (enable) | ||
pinmux |= (1 << mux); | ||
else | ||
pinmux &= ~(1 << mux); | ||
davinci_writel(pinmux, DAVINCI_SYSTEM_MODULE_BASE + muxreg); | ||
spin_unlock(&mux_lock); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* | ||
* DaVinci pin multiplexing defines | ||
* | ||
* Author: Vladimir Barinov, MontaVista Software, Inc. <source@mvista.com> | ||
* | ||
* 2007 (c) MontaVista Software, Inc. This file is licensed under | ||
* the terms of the GNU General Public License version 2. This program | ||
* is licensed "as is" without any warranty of any kind, whether express | ||
* or implied. | ||
*/ | ||
#ifndef __ASM_ARCH_MUX_H | ||
#define __ASM_ARCH_MUX_H | ||
|
||
#define DAVINCI_MUX_AEAW0 0 | ||
#define DAVINCI_MUX_AEAW1 1 | ||
#define DAVINCI_MUX_AEAW2 2 | ||
#define DAVINCI_MUX_AEAW3 3 | ||
#define DAVINCI_MUX_AEAW4 4 | ||
#define DAVINCI_MUX_AECS4 10 | ||
#define DAVINCI_MUX_AECS5 11 | ||
#define DAVINCI_MUX_VLYNQWD0 12 | ||
#define DAVINCI_MUX_VLYNQWD1 13 | ||
#define DAVINCI_MUX_VLSCREN 14 | ||
#define DAVINCI_MUX_VLYNQEN 15 | ||
#define DAVINCI_MUX_HDIREN 16 | ||
#define DAVINCI_MUX_ATAEN 17 | ||
#define DAVINCI_MUX_RGB666 22 | ||
#define DAVINCI_MUX_RGB888 23 | ||
#define DAVINCI_MUX_LOEEN 24 | ||
#define DAVINCI_MUX_LFLDEN 25 | ||
#define DAVINCI_MUX_CWEN 26 | ||
#define DAVINCI_MUX_CFLDEN 27 | ||
#define DAVINCI_MUX_HPIEN 29 | ||
#define DAVINCI_MUX_1394EN 30 | ||
#define DAVINCI_MUX_EMACEN 31 | ||
|
||
#define DAVINCI_MUX_LEVEL2 32 | ||
#define DAVINCI_MUX_UART0 (DAVINCI_MUX_LEVEL2 + 0) | ||
#define DAVINCI_MUX_UART1 (DAVINCI_MUX_LEVEL2 + 1) | ||
#define DAVINCI_MUX_UART2 (DAVINCI_MUX_LEVEL2 + 2) | ||
#define DAVINCI_MUX_U2FLO (DAVINCI_MUX_LEVEL2 + 3) | ||
#define DAVINCI_MUX_PWM0 (DAVINCI_MUX_LEVEL2 + 4) | ||
#define DAVINCI_MUX_PWM1 (DAVINCI_MUX_LEVEL2 + 5) | ||
#define DAVINCI_MUX_PWM2 (DAVINCI_MUX_LEVEL2 + 6) | ||
#define DAVINCI_MUX_I2C (DAVINCI_MUX_LEVEL2 + 7) | ||
#define DAVINCI_MUX_SPI (DAVINCI_MUX_LEVEL2 + 8) | ||
#define DAVINCI_MUX_MSTK (DAVINCI_MUX_LEVEL2 + 9) | ||
#define DAVINCI_MUX_ASP (DAVINCI_MUX_LEVEL2 + 10) | ||
#define DAVINCI_MUX_CLK0 (DAVINCI_MUX_LEVEL2 + 16) | ||
#define DAVINCI_MUX_CLK1 (DAVINCI_MUX_LEVEL2 + 17) | ||
#define DAVINCI_MUX_TIMIN (DAVINCI_MUX_LEVEL2 + 18) | ||
|
||
extern void davinci_mux_peripheral(unsigned int mux, unsigned int enable); | ||
|
||
#endif /* __ASM_ARCH_MUX_H */ |