Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* linux/include/asm-arm/arch-s3c2410/hardware.h |
| 2 | * |
| 3 | * (c) 2003 Simtec Electronics |
| 4 | * Ben Dooks <ben@simtec.co.uk> |
| 5 | * |
| 6 | * S3C2410 - hardware |
| 7 | * |
| 8 | * This program is free software; you can redistribute it and/or modify |
| 9 | * it under the terms of the GNU General Public License version 2 as |
| 10 | * published by the Free Software Foundation. |
| 11 | * |
| 12 | * Changelog: |
| 13 | * 21-May-2003 BJD Created file |
| 14 | * 06-Jun-2003 BJD Added CPU frequency settings |
| 15 | * 03-Sep-2003 BJD Linux v2.6 support |
| 16 | * 12-Mar-2004 BJD Fixed include protection, fixed type of clock vars |
| 17 | * 14-Sep-2004 BJD Added misccr and getpin to gpio |
| 18 | * 01-Oct-2004 BJD Added the new gpio functions |
| 19 | * 16-Oct-2004 BJD Removed the clock variables |
Lucas Correia Villa Real | 0ca5bc3 | 2006-02-01 21:24:23 +0000 | [diff] [blame^] | 20 | * 15-Jan-2006 LCVR Added s3c2400_gpio_getirq() |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 21 | */ |
| 22 | |
| 23 | #ifndef __ASM_ARCH_HARDWARE_H |
| 24 | #define __ASM_ARCH_HARDWARE_H |
| 25 | |
| 26 | #ifndef __ASSEMBLY__ |
| 27 | |
| 28 | /* external functions for GPIO support |
| 29 | * |
| 30 | * These allow various different clients to access the same GPIO |
| 31 | * registers without conflicting. If your driver only owns the entire |
| 32 | * GPIO register, then it is safe to ioremap/__raw_{read|write} to it. |
| 33 | */ |
| 34 | |
| 35 | /* s3c2410_gpio_cfgpin |
| 36 | * |
| 37 | * set the configuration of the given pin to the value passed. |
| 38 | * |
| 39 | * eg: |
| 40 | * s3c2410_gpio_cfgpin(S3C2410_GPA0, S3C2410_GPA0_ADDR0); |
| 41 | * s3c2410_gpio_cfgpin(S3C2410_GPE8, S3C2410_GPE8_SDDAT1); |
| 42 | */ |
| 43 | |
| 44 | extern void s3c2410_gpio_cfgpin(unsigned int pin, unsigned int function); |
| 45 | |
| 46 | extern unsigned int s3c2410_gpio_getcfg(unsigned int pin); |
| 47 | |
| 48 | /* s3c2410_gpio_getirq |
| 49 | * |
| 50 | * turn the given pin number into the corresponding IRQ number |
| 51 | * |
| 52 | * returns: |
| 53 | * < 0 = no interrupt for this pin |
| 54 | * >=0 = interrupt number for the pin |
| 55 | */ |
| 56 | |
| 57 | extern int s3c2410_gpio_getirq(unsigned int pin); |
| 58 | |
Lucas Correia Villa Real | 0ca5bc3 | 2006-02-01 21:24:23 +0000 | [diff] [blame^] | 59 | #ifdef CONFIG_CPU_S3C2400 |
| 60 | |
| 61 | extern int s3c2400_gpio_getirq(unsigned int pin); |
| 62 | |
| 63 | #endif /* CONFIG_CPU_S3C2400 */ |
| 64 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 65 | /* s3c2410_gpio_irqfilter |
| 66 | * |
| 67 | * set the irq filtering on the given pin |
| 68 | * |
| 69 | * on = 0 => disable filtering |
| 70 | * 1 => enable filtering |
| 71 | * |
| 72 | * config = S3C2410_EINTFLT_PCLK or S3C2410_EINTFLT_EXTCLK orred with |
| 73 | * width of filter (0 through 63) |
| 74 | * |
| 75 | * |
| 76 | */ |
| 77 | |
| 78 | extern int s3c2410_gpio_irqfilter(unsigned int pin, unsigned int on, |
| 79 | unsigned int config); |
| 80 | |
| 81 | /* s3c2410_gpio_pullup |
| 82 | * |
| 83 | * configure the pull-up control on the given pin |
| 84 | * |
| 85 | * to = 1 => disable the pull-up |
| 86 | * 0 => enable the pull-up |
| 87 | * |
| 88 | * eg; |
| 89 | * |
| 90 | * s3c2410_gpio_pullup(S3C2410_GPB0, 0); |
| 91 | * s3c2410_gpio_pullup(S3C2410_GPE8, 0); |
| 92 | */ |
| 93 | |
| 94 | extern void s3c2410_gpio_pullup(unsigned int pin, unsigned int to); |
| 95 | |
| 96 | extern void s3c2410_gpio_setpin(unsigned int pin, unsigned int to); |
| 97 | |
| 98 | extern unsigned int s3c2410_gpio_getpin(unsigned int pin); |
| 99 | |
| 100 | extern unsigned int s3c2410_modify_misccr(unsigned int clr, unsigned int chg); |
| 101 | |
Ben Dooks | 9153bd7 | 2005-10-13 16:46:35 +0100 | [diff] [blame] | 102 | #ifdef CONFIG_CPU_S3C2440 |
| 103 | |
| 104 | extern int s3c2440_set_dsc(unsigned int pin, unsigned int value); |
| 105 | |
| 106 | #endif /* CONFIG_CPU_S3C2440 */ |
| 107 | |
| 108 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 109 | #endif /* __ASSEMBLY__ */ |
| 110 | |
| 111 | #include <asm/sizes.h> |
| 112 | #include <asm/arch/map.h> |
| 113 | |
| 114 | /* machine specific hardware definitions should go after this */ |
| 115 | |
| 116 | /* currently here until moved into config (todo) */ |
| 117 | #define CONFIG_NO_MULTIWORD_IO |
| 118 | |
| 119 | #endif /* __ASM_ARCH_HARDWARE_H */ |