diff --git a/arch/arm/mach-omap2/dsp.c b/arch/arm/mach-omap2/dsp.c new file mode 100644 index 0000000..ffba320 --- /dev/null +++ b/arch/arm/mach-omap2/dsp.c @@ -0,0 +1,87 @@ +/* + * arch/arm/mach-omap2/dsp.c + * + * Support DSP (C55x) for OMAP2420 using dspfs. + * + * Author: Komal Shah (komal_shah802003@yahoo.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ +#include +#include +#include +#include +#include +#include +#include + +struct dentry *dentry; + +static int omap_dsp_init(void* arg) +{ + printk(KERN_NOTICE "DSP: Initializing\n"); + + return 0; +} + +static void omap_dsp_exit(void* arg) +{ + printk(KERN_NOTICE "DSP: Exiting\n"); +} + +static ssize_t omap_dsp_dir_write(struct file *file, const char __user *buf, + size_t count, loff_t *ppos) +{ + return generic_file_write(file, buf, count, ppos); +} + +static struct file_operations omap_dsp_codecs_dir_fops = { + .open = dcache_dir_open, + .release = dcache_dir_close, + .llseek = dcache_dir_lseek, + .read = generic_read_dir, + .write = omap_dsp_dir_write, + .readdir = dcache_readdir, +}; + +static struct file_operations omap_dsp_percodec_fops = { + .read = generic_file_read, + .write = generic_file_write, +}; + +static struct tree_descr omap_dsp_percodec_files[] = { + {"frmdata_0", &omap_dsp_percodec_fops, S_IWUSR | S_IRUGO}, + {"frmdata_1", &omap_dsp_percodec_fops, S_IWUSR | S_IRUGO}, + {"" }, +}; + +static struct dsp_info omap_dsp = { + .name = "c55x", + .parent = NULL, + .init = omap_dsp_init, + .exit = omap_dsp_exit, + .fops = &omap_dsp_codecs_dir_fops, + .percodec_files = omap_dsp_percodec_files, +}; + +static int __init omap_dsp_fs_init(void) +{ + dentry = dsp_register(&omap_dsp); + + if (IS_ERR(dentry)) + return PTR_ERR(dentry); + + return 0; +} + +static void __exit omap_dsp_fs_exit(void) +{ + dsp_unregister(dentry); +} + +module_init(omap_dsp_fs_init); +module_exit(omap_dsp_fs_exit); + +MODULE_LICENSE("GPL");