diff options
author | blogic <blogic@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2008-06-07 16:04:31 +0000 |
---|---|---|
committer | blogic <blogic@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2008-06-07 16:04:31 +0000 |
commit | c164e9d4b74927f374544ee61d4315780974b486 (patch) | |
tree | a3fe62b2ed00258db4c9a03427a08dea6f4d8e2f /target/linux/ifxmips/files/drivers/char/ifxmips_gpio.c | |
parent | 6181dacb72fb84caf7e34a3c84a162ece4b7a7f6 (diff) |
fixes ifxmips pci support and adds GENERIC_GPIO
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@11396 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/ifxmips/files/drivers/char/ifxmips_gpio.c')
-rw-r--r-- | target/linux/ifxmips/files/drivers/char/ifxmips_gpio.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/target/linux/ifxmips/files/drivers/char/ifxmips_gpio.c b/target/linux/ifxmips/files/drivers/char/ifxmips_gpio.c index 880252335..c1eefa5a9 100644 --- a/target/linux/ifxmips/files/drivers/char/ifxmips_gpio.c +++ b/target/linux/ifxmips/files/drivers/char/ifxmips_gpio.c @@ -95,7 +95,7 @@ int ifxmips_port_set_open_drain (unsigned int port, unsigned int pin) { IFXMIPS_GPIO_SANITY; - writel(readl(IFXMIPS_GPIO_P0_OD + (port * 0xC)) | (1 << pin), IFXMIPS_GPIO_P0_OD + (port * 0xC)); + ifxmips_w32(ifxmips_r32(IFXMIPS_GPIO_P0_OD + (port * 0xC)) | (1 << pin), IFXMIPS_GPIO_P0_OD + (port * 0xC)); return 0; } @@ -105,7 +105,7 @@ int ifxmips_port_clear_open_drain (unsigned int port, unsigned int pin) { IFXMIPS_GPIO_SANITY; - writel(readl(IFXMIPS_GPIO_P0_OD + (port * 0xC)) & ~(1 << pin), IFXMIPS_GPIO_P0_OD + (port * 0xC)); + ifxmips_w32(ifxmips_r32(IFXMIPS_GPIO_P0_OD + (port * 0xC)) & ~(1 << pin), IFXMIPS_GPIO_P0_OD + (port * 0xC)); return 0; } @@ -115,7 +115,7 @@ int ifxmips_port_set_pudsel (unsigned int port, unsigned int pin) { IFXMIPS_GPIO_SANITY; - writel(readl(IFXMIPS_GPIO_P0_PUDSEL + (port * 0xC)) | (1 << pin), IFXMIPS_GPIO_P0_PUDSEL + (port * 0xC)); + ifxmips_w32(ifxmips_r32(IFXMIPS_GPIO_P0_PUDSEL + (port * 0xC)) | (1 << pin), IFXMIPS_GPIO_P0_PUDSEL + (port * 0xC)); return 0; } @@ -125,7 +125,7 @@ int ifxmips_port_clear_pudsel (unsigned int port, unsigned int pin) { IFXMIPS_GPIO_SANITY; - writel(readl(IFXMIPS_GPIO_P0_PUDSEL + (port * 0xC)) & ~(1 << pin), IFXMIPS_GPIO_P0_PUDSEL + (port * 0xC)); + ifxmips_w32(ifxmips_r32(IFXMIPS_GPIO_P0_PUDSEL + (port * 0xC)) & ~(1 << pin), IFXMIPS_GPIO_P0_PUDSEL + (port * 0xC)); return 0; } @@ -135,7 +135,7 @@ int ifxmips_port_set_puden (unsigned int port, unsigned int pin) { IFXMIPS_GPIO_SANITY; - writel(readl(IFXMIPS_GPIO_P0_PUDEN + (port * 0xC)) | (1 << pin), IFXMIPS_GPIO_P0_PUDEN + (port * 0xC)); + ifxmips_w32(ifxmips_r32(IFXMIPS_GPIO_P0_PUDEN + (port * 0xC)) | (1 << pin), IFXMIPS_GPIO_P0_PUDEN + (port * 0xC)); return 0; } @@ -145,7 +145,7 @@ int ifxmips_port_clear_puden (unsigned int port, unsigned int pin) { IFXMIPS_GPIO_SANITY; - writel(readl(IFXMIPS_GPIO_P0_PUDEN + (port * 0xC)) & ~(1 << pin), IFXMIPS_GPIO_P0_PUDEN + (port * 0xC)); + ifxmips_w32(ifxmips_r32(IFXMIPS_GPIO_P0_PUDEN + (port * 0xC)) & ~(1 << pin), IFXMIPS_GPIO_P0_PUDEN + (port * 0xC)); return 0; } @@ -155,7 +155,7 @@ int ifxmips_port_set_stoff (unsigned int port, unsigned int pin) { IFXMIPS_GPIO_SANITY; - writel(readl(IFXMIPS_GPIO_P0_STOFF + (port * 0xC)) | (1 << pin), IFXMIPS_GPIO_P0_STOFF + (port * 0xC)); + ifxmips_w32(ifxmips_r32(IFXMIPS_GPIO_P0_STOFF + (port * 0xC)) | (1 << pin), IFXMIPS_GPIO_P0_STOFF + (port * 0xC)); return 0; } @@ -165,7 +165,7 @@ int ifxmips_port_clear_stoff (unsigned int port, unsigned int pin) { IFXMIPS_GPIO_SANITY; - writel(readl(IFXMIPS_GPIO_P0_STOFF + (port * 0xC)) & ~(1 << pin), IFXMIPS_GPIO_P0_STOFF + (port * 0xC)); + ifxmips_w32(ifxmips_r32(IFXMIPS_GPIO_P0_STOFF + (port * 0xC)) & ~(1 << pin), IFXMIPS_GPIO_P0_STOFF + (port * 0xC)); return 0; } @@ -175,7 +175,7 @@ int ifxmips_port_set_dir_out (unsigned int port, unsigned int pin) { IFXMIPS_GPIO_SANITY; - writel(readl(IFXMIPS_GPIO_P0_DIR + (port * 0xC)) | (1 << pin), IFXMIPS_GPIO_P0_DIR + (port * 0xC)); + ifxmips_w32(ifxmips_r32(IFXMIPS_GPIO_P0_DIR + (port * 0xC)) | (1 << pin), IFXMIPS_GPIO_P0_DIR + (port * 0xC)); return 0; } @@ -185,7 +185,7 @@ int ifxmips_port_set_dir_in (unsigned int port, unsigned int pin) { IFXMIPS_GPIO_SANITY; - writel(readl(IFXMIPS_GPIO_P0_DIR + (port * 0xC)) & ~(1 << pin), IFXMIPS_GPIO_P0_DIR + (port * 0xC)); + ifxmips_w32(ifxmips_r32(IFXMIPS_GPIO_P0_DIR + (port * 0xC)) & ~(1 << pin), IFXMIPS_GPIO_P0_DIR + (port * 0xC)); return 0; } @@ -195,7 +195,7 @@ int ifxmips_port_set_output (unsigned int port, unsigned int pin) { IFXMIPS_GPIO_SANITY; - writel(readl(IFXMIPS_GPIO_P0_OUT + (port * 0xC)) | (1 << pin), IFXMIPS_GPIO_P0_OUT + (port * 0xC)); + ifxmips_w32(ifxmips_r32(IFXMIPS_GPIO_P0_OUT + (port * 0xC)) | (1 << pin), IFXMIPS_GPIO_P0_OUT + (port * 0xC)); return 0; } @@ -205,7 +205,7 @@ int ifxmips_port_clear_output (unsigned int port, unsigned int pin) { IFXMIPS_GPIO_SANITY; - writel(readl(IFXMIPS_GPIO_P0_OUT + (port * 0xC)) & ~(1 << pin), IFXMIPS_GPIO_P0_OUT + (port * 0xC)); + ifxmips_w32(ifxmips_r32(IFXMIPS_GPIO_P0_OUT + (port * 0xC)) & ~(1 << pin), IFXMIPS_GPIO_P0_OUT + (port * 0xC)); return 0; } @@ -216,7 +216,7 @@ ifxmips_port_get_input (unsigned int port, unsigned int pin) { IFXMIPS_GPIO_SANITY; - if (readl(IFXMIPS_GPIO_P0_IN + (port * 0xC)) & (1 << pin)) + if (ifxmips_r32(IFXMIPS_GPIO_P0_IN + (port * 0xC)) & (1 << pin)) return 0; else return 1; @@ -227,7 +227,7 @@ int ifxmips_port_set_altsel0 (unsigned int port, unsigned int pin) { IFXMIPS_GPIO_SANITY; - writel(readl(IFXMIPS_GPIO_P0_ALTSEL0 + (port * 0xC)) | (1 << pin), IFXMIPS_GPIO_P0_ALTSEL0 + (port * 0xC)); + ifxmips_w32(ifxmips_r32(IFXMIPS_GPIO_P0_ALTSEL0 + (port * 0xC)) | (1 << pin), IFXMIPS_GPIO_P0_ALTSEL0 + (port * 0xC)); return 0; } @@ -237,7 +237,7 @@ int ifxmips_port_clear_altsel0 (unsigned int port, unsigned int pin) { IFXMIPS_GPIO_SANITY; - writel(readl(IFXMIPS_GPIO_P0_ALTSEL0 + (port * 0xC)) & ~(1 << pin), IFXMIPS_GPIO_P0_ALTSEL0 + (port * 0xC)); + ifxmips_w32(ifxmips_r32(IFXMIPS_GPIO_P0_ALTSEL0 + (port * 0xC)) & ~(1 << pin), IFXMIPS_GPIO_P0_ALTSEL0 + (port * 0xC)); return 0; } @@ -247,7 +247,7 @@ int ifxmips_port_set_altsel1 (unsigned int port, unsigned int pin) { IFXMIPS_GPIO_SANITY; - writel(readl(IFXMIPS_GPIO_P0_ALTSEL1 + (port * 0xC)) | (1 << pin), IFXMIPS_GPIO_P0_ALTSEL1 + (port * 0xC)); + ifxmips_w32(ifxmips_r32(IFXMIPS_GPIO_P0_ALTSEL1 + (port * 0xC)) | (1 << pin), IFXMIPS_GPIO_P0_ALTSEL1 + (port * 0xC)); return 0; } @@ -257,7 +257,7 @@ int ifxmips_port_clear_altsel1 (unsigned int port, unsigned int pin) { IFXMIPS_GPIO_SANITY; - writel(readl(IFXMIPS_GPIO_P0_ALTSEL1 + (port * 0xC)) & ~(1 << pin), IFXMIPS_GPIO_P0_ALTSEL1 + (port * 0xC)); + ifxmips_w32(ifxmips_r32(IFXMIPS_GPIO_P0_ALTSEL1 + (port * 0xC)) & ~(1 << pin), IFXMIPS_GPIO_P0_ALTSEL1 + (port * 0xC)); return 0; } @@ -347,7 +347,7 @@ long ifxmips_port_read_procmem_helper(char* tag, u32* in_reg, char *buf) unsigned int len, t; len = sprintf(buf, "\n%s: ", tag); - reg = readl(in_reg); + reg = ifxmips_r32(in_reg); bit = 0x80000000; for (t = 0; t < 32; t++) { if ((reg & bit) > 0) |