summaryrefslogtreecommitdiffstats
path: root/openwrt/package/linux/kernel-source/arch/mips/brcm-boards/bcm947xx/gpio.c
diff options
context:
space:
mode:
authornbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2005-05-28 09:17:29 +0000
committernbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2005-05-28 09:17:29 +0000
commit50af40000ac37ef921ebd46f6d641959503ee919 (patch)
tree823ff43388135467a5c7a60589acf62d173cedc4 /openwrt/package/linux/kernel-source/arch/mips/brcm-boards/bcm947xx/gpio.c
parent16530342e5f63527dc2e0c78dcaef4f4b68ceb48 (diff)
move package/linux into target/linux, use wbx' new kernel code. support building images with more than one kernel, split kernel module parts off of packages that use their own kernel modules (fuse, shfs, openswan). some cleanup in the image building process in target/. image builder is disabled for now, needs some fixing.
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@1085 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'openwrt/package/linux/kernel-source/arch/mips/brcm-boards/bcm947xx/gpio.c')
-rw-r--r--openwrt/package/linux/kernel-source/arch/mips/brcm-boards/bcm947xx/gpio.c158
1 files changed, 0 insertions, 158 deletions
diff --git a/openwrt/package/linux/kernel-source/arch/mips/brcm-boards/bcm947xx/gpio.c b/openwrt/package/linux/kernel-source/arch/mips/brcm-boards/bcm947xx/gpio.c
deleted file mode 100644
index d20b76333..000000000
--- a/openwrt/package/linux/kernel-source/arch/mips/brcm-boards/bcm947xx/gpio.c
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * GPIO char driver
- *
- * Copyright 2004, Broadcom Corporation
- * All Rights Reserved.
- *
- * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
- * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
- * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
- * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
- *
- * $Id$
- */
-
-#include <linux/module.h>
-#include <linux/init.h>
-#include <linux/fs.h>
-#include <linux/miscdevice.h>
-#include <asm/uaccess.h>
-
-#include <typedefs.h>
-#include <bcmutils.h>
-#include <sbutils.h>
-#include <bcmdevs.h>
-
-static void *gpio_sbh;
-static int gpio_major;
-static devfs_handle_t gpio_dir;
-static struct {
- char *name;
- devfs_handle_t handle;
-} gpio_file[] = {
- { "in", NULL },
- { "out", NULL },
- { "outen", NULL },
- { "control", NULL }
-};
-
-static int
-gpio_open(struct inode *inode, struct file * file)
-{
- if (MINOR(inode->i_rdev) > ARRAYSIZE(gpio_file))
- return -ENODEV;
-
- MOD_INC_USE_COUNT;
- return 0;
-}
-
-static int
-gpio_release(struct inode *inode, struct file * file)
-{
- MOD_DEC_USE_COUNT;
- return 0;
-}
-
-static ssize_t
-gpio_read(struct file *file, char *buf, size_t count, loff_t *ppos)
-{
- u32 val;
-
- switch (MINOR(file->f_dentry->d_inode->i_rdev)) {
- case 0:
- val = sb_gpioin(gpio_sbh);
- break;
- case 1:
- val = sb_gpioout(gpio_sbh, 0, 0);
- break;
- case 2:
- val = sb_gpioouten(gpio_sbh, 0, 0);
- break;
- case 3:
- val = sb_gpiocontrol(gpio_sbh, 0, 0);
- break;
- default:
- return -ENODEV;
- }
-
- if (put_user(val, (u32 *) buf))
- return -EFAULT;
-
- return sizeof(val);
-}
-
-static ssize_t
-gpio_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
-{
- u32 val;
-
- if (get_user(val, (u32 *) buf))
- return -EFAULT;
-
- switch (MINOR(file->f_dentry->d_inode->i_rdev)) {
- case 0:
- return -EACCES;
- case 1:
- sb_gpioout(gpio_sbh, ~0, val);
- break;
- case 2:
- sb_gpioouten(gpio_sbh, ~0, val);
- break;
- case 3:
- sb_gpiocontrol(gpio_sbh, ~0, val);
- break;
- default:
- return -ENODEV;
- }
-
- return sizeof(val);
-}
-
-static struct file_operations gpio_fops = {
- owner: THIS_MODULE,
- open: gpio_open,
- release: gpio_release,
- read: gpio_read,
- write: gpio_write,
-};
-
-static int __init
-gpio_init(void)
-{
- int i;
-
- if (!(gpio_sbh = sb_kattach()))
- return -ENODEV;
-
- sb_gpiosetcore(gpio_sbh);
-
- if ((gpio_major = devfs_register_chrdev(0, "gpio", &gpio_fops)) < 0)
- return gpio_major;
-
- gpio_dir = devfs_mk_dir(NULL, "gpio", NULL);
-
- for (i = 0; i < ARRAYSIZE(gpio_file); i++) {
- gpio_file[i].handle = devfs_register(gpio_dir,
- gpio_file[i].name,
- DEVFS_FL_DEFAULT, gpio_major, i,
- S_IFCHR | S_IRUGO | S_IWUGO,
- &gpio_fops, NULL);
- }
-
- return 0;
-}
-
-static void __exit
-gpio_exit(void)
-{
- int i;
-
- for (i = 0; i < ARRAYSIZE(gpio_file); i++)
- devfs_unregister(gpio_file[i].handle);
- devfs_unregister(gpio_dir);
- devfs_unregister_chrdev(gpio_major, "gpio");
- sb_detach(gpio_sbh);
-}
-
-module_init(gpio_init);
-module_exit(gpio_exit);