]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
ARM: OMAP: DSPGW: cleanup
authorHiroshi DOYU <Hiroshi.DOYU@nokia.com>
Thu, 21 Sep 2006 14:41:37 +0000 (17:41 +0300)
committerJuha Yrjola <juha.yrjola@solidboot.com>
Thu, 21 Sep 2006 15:45:42 +0000 (18:45 +0300)
- cleanup whitespaces
- fix some build errors

Signed-off-by: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
Signed-off-by: Juha Yrjola <juha.yrjola@solidboot.com>
25 files changed:
arch/arm/plat-omap/dsp/dsp.h
arch/arm/plat-omap/dsp/dsp_common.c
arch/arm/plat-omap/dsp/dsp_common.h
arch/arm/plat-omap/dsp/dsp_core.c
arch/arm/plat-omap/dsp/dsp_ctl.c
arch/arm/plat-omap/dsp/dsp_ctl_core.c
arch/arm/plat-omap/dsp/dsp_mbcmd.h
arch/arm/plat-omap/dsp/dsp_mem.c
arch/arm/plat-omap/dsp/error.c
arch/arm/plat-omap/dsp/fifo.h
arch/arm/plat-omap/dsp/hardware_dsp.h
arch/arm/plat-omap/dsp/ioctl.h
arch/arm/plat-omap/dsp/ipbuf.c
arch/arm/plat-omap/dsp/ipbuf.h
arch/arm/plat-omap/dsp/mblog.c
arch/arm/plat-omap/dsp/omap1_dsp.h
arch/arm/plat-omap/dsp/omap2_dsp.h
arch/arm/plat-omap/dsp/proclist.h
arch/arm/plat-omap/dsp/task.c
arch/arm/plat-omap/dsp/taskwatch.c
arch/arm/plat-omap/dsp/uaccess_dsp.S
arch/arm/plat-omap/dsp/uaccess_dsp.h
arch/arm/plat-omap/mailbox.c
arch/arm/plat-omap/mailbox_hw.h
include/asm-arm/arch-omap/dsp_common.h

index 8ec81a99339bc7e72a4f6c067ffaf43c4f3e3ae3..f21749841f75b2235741b31581c3a3f9b3a02461 100644 (file)
@@ -6,8 +6,8 @@
  * Contact: Toshihiro Kobayashi <toshihiro.kobayashi@nokia.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. 
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -98,10 +98,10 @@ struct mem_sync_struct {
 
 /* struct mbcmd and union mbcmd_hw must be compatible */
 struct mbcmd {
-       u32 data:16;
-       u32 cmd_l:8;
-       u32 cmd_h:7;
-       u32 seq:1;
+       u32 data:16;
+       u32 cmd_l:8;
+       u32 cmd_h:7;
+       u32 seq:1;
 };
 
 #define MBCMD_INIT(h, l, d) { \
@@ -111,9 +111,9 @@ struct mbcmd {
        }
 
 struct mb_exarg {
-       u8 tid;
+       u8 tid;
        int argc;
-       u16 *argv;
+       u16 *argv;
 };
 
 extern struct mbx *mbx_dsp;
index 4c35df808855ea5d346ae3a939b15153d60a13a2..2691601892a40d26ec9c0a1040ec098283744a4a 100644 (file)
@@ -6,8 +6,8 @@
  * Contact: Toshihiro Kobayashi <toshihiro.kobayashi@nokia.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. 
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
index 54fd2283b43bd6e1cb8faacb5a464534eedb5d6d..a39f2ce02d4b4bde4da236e318d9b8590788fff0 100644 (file)
@@ -6,8 +6,8 @@
  * Contact: Toshihiro Kobayashi <toshihiro.kobayashi@nokia.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. 
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
index 39765890e135d5ab7f052008f08d5eaff51fe248..7a1176959abbc2681c1576dce64cbbdae0128058 100644 (file)
@@ -6,8 +6,8 @@
  * Contact: Toshihiro Kobayashi <toshihiro.kobayashi@nokia.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. 
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -100,6 +100,7 @@ static const struct cmdinfo
        cif_err      = { "ERR",      CMD_L_TYPE_SUBCMD, mbx_err     },
        cif_dbg      = { "DBG",      CMD_L_TYPE_NULL,   mbx_dbg     };
 
+#define MBX_CMD_MAX    0x80
 const struct cmdinfo *cmdinfo[MBX_CMD_MAX] = {
        [MBX_CMD_DSP_WDSND]    = &cif_wdsnd,
        [MBX_CMD_DSP_WDREQ]    = &cif_wdreq,
index 4323150b1d847b45b70670052ffa84311984c68a..82140af392287d163481d2ea84aa683d13d70794 100644 (file)
@@ -6,8 +6,8 @@
  * Contact: Toshihiro Kobayashi <toshihiro.kobayashi@nokia.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. 
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -128,7 +128,7 @@ static int misc_mbcmd_response(struct mbcmd *mb, int argc, int match_cmd_l_flag)
            (misc_mb_wait.cmd_h != mb->cmd_h) ||
            (match_cmd_l_flag && (misc_mb_wait.cmd_l != mb->cmd_l))) {
                const struct cmdinfo *ci = cmdinfo[mb->cmd_h];
-               char cmdstr[32];
+               char cmdstr[32];
 
                if (ci->cmd_l_type == CMD_L_TYPE_SUBCMD)
                        sprintf(cmdstr, "%s:%s", ci->name, subcmd_name(mb));
@@ -173,7 +173,7 @@ static int misc_mbcmd_response(struct mbcmd *mb, int argc, int match_cmd_l_flag)
 static int dsp_regread(enum dsp_space_e space, u16 adr, u16 *val)
 {
        u8 cmd_l = (space == SPACE_MEM) ? REGRW_MEMR : REGRW_IOR;
-       int ret; 
+       int ret;
 
        ret = misc_mbcompose_send_and_wait(REGRW, cmd_l, adr, val);
        if ((ret < 0) && (ret != -EINTR))
@@ -356,7 +356,7 @@ again:
                        goto again;
                }
                break;
-       
+
        /*
         * suspend / resume
         * DSP is not reset within this code, but done in omap_pm_suspend.
@@ -392,7 +392,7 @@ again:
                }
 
                break;
-       
+
        case CFGSTAT_RESUME:
                if (cfgstat != CFGSTAT_SUSPEND) {
                        printk(KERN_WARNING
@@ -403,7 +403,7 @@ again:
                }
                st_req = CFGSTAT_READY;
                break;
-       
+
        default:
                BUG();
 
@@ -725,7 +725,7 @@ void mbx_dspcfg(struct mbcmd *mb)
                        return;
 #ifdef OLD_BINARY_SUPPORT
                else if ((mbx_revision == MBREV_3_0) ||
-                        (mbx_revision == MBREV_3_2)) {
+                        (mbx_revision == MBREV_3_2)) {
                        printk(KERN_WARNING
                               "mbx: ***** old DSP binary *****\n"
                               "  Please update your DSP application.\n");
index 1d0168d51653341c948efb1a97544df842a26cb8..bfb6f8b20b0e2c3ce6ddfd4a6a052125fc9f94bc 100644 (file)
@@ -6,8 +6,8 @@
  * Contact: Toshihiro Kobayashi <toshihiro.kobayashi@nokia.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. 
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -109,7 +109,7 @@ void dsp_ctl_core_exit(void)
        for (i = 0; i < ARRAY_SIZE(dev_list); i++) {
                class_device_destroy(dsp_ctl_class,
                                     MKDEV(OMAP_DSP_CTL_MAJOR,
-                                          dev_list[i].minor));
+                                          dev_list[i].minor));
        }
        class_destroy(dsp_ctl_class);
 
index 50cf7789c6688f535e18644531ac099e58fa8b6d..22b1548c63727f1ed55bdcfc7ca0c9254568dc55 100644 (file)
@@ -6,8 +6,8 @@
  * Contact: Toshihiro Kobayashi <toshihiro.kobayashi@nokia.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. 
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
index 49f633c538a413cf65eafbe06352ae0beb2d7cae..6d3635ccebe5fc54d144bfdf0156062b721edfee 100644 (file)
@@ -9,8 +9,8 @@
  * by Paul Mundt <paul.mundt@nokia.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. 
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -47,6 +47,7 @@
 #include "../mailbox_hw.h"
 #include "dsp.h"
 #include "ioctl.h"
+#include "ipbuf.h"
 
 #ifdef CONFIG_ARCH_OMAP2
 #define IOMAP_VAL      0x3f
@@ -592,7 +593,7 @@ static int exmap_set_armmmu(unsigned long virt, unsigned long phys,
 }
 
        /* XXX: T.Kobayashi
-        * A process can have old mappings. if we want to clear a pmd, 
+        * A process can have old mappings. if we want to clear a pmd,
         * we need to do it for all proceeses that use the old mapping.
         */
 #if 0
@@ -787,7 +788,7 @@ int dsp_address_validate(void *p, size_t len, char *fmt, ...)
 }
 
 /*
- * exmap_use(), unuse(): 
+ * exmap_use(), unuse():
  * when the mapped area is exported to user space with mmap,
  * the usecount is incremented.
  * while the usecount > 0, that area can't be released.
@@ -1401,8 +1402,8 @@ static void exmap_flush(void)
 #endif /* CONFIG_FB */
 
 #ifdef CONFIG_FB_OMAP_LCDC_EXTERNAL
-static int omapfb_notifier_cb(struct omapfb_notifier_block *omapfb_nb,
-                              unsigned long event, struct omapfb_device *fbdev)
+static int omapfb_notifier_cb(struct notifier_block *omapfb_nb,
+                             unsigned long event, void *fbi)
 {
        /* XXX */
        printk("omapfb_notifier_cb(): event = %s\n",
@@ -2007,8 +2008,7 @@ static void fbupd_response(void *arg)
 {
        int status;
 
-       status = dsp_mbsend(MBCMD(KFUNC), OMAP_DSP_MBCMD_KFUNC_FBCTL,
-                           OMAP_DSP_MBCMD_FBCTL_UPD);
+       status = mbcompose_send(KFUNC, KFUNC_FBCTL, FBCTL_UPD);
        if (status < 0) {
                /* FIXME: DSP is busy !! */
                printk(KERN_ERR
@@ -2031,8 +2031,8 @@ void mbx_fbctl_upd(void)
        volatile unsigned short *buf = ipbuf_sys_da->d;
 
        /* FIXME: try count sometimes exceeds 1000. */
-       if (sync_with_dsp(&ipbuf_sys_da->s, OMAP_DSP_TID_ANON, 5000) < 0) {
-               printk(KERN_ERR "mbx: FBCTL:UPD - IPBUF sync failed!\n");
+       if (sync_with_dsp(&ipbuf_sys_da->s, TID_ANON, 5000) < 0) {
+               printk(KERN_ERR "mbox: FBCTL:UPD - IPBUF sync failed!\n");
                return;
        }
        win.x = buf[0];
@@ -2048,7 +2048,7 @@ void mbx_fbctl_upd(void)
                return;
        }
        //printk("calling omapfb_update_window_async()\n");
-       omapfb_update_window_async(&win, fbupd_cb, NULL);
+       omapfb_update_window_async(registered_fb[1], &win, fbupd_cb, NULL);
 }
 
 #else /* CONFIG_FB_OMAP_LCDC_EXTERNAL */
index 0213218d96e12b2cda60bdc727b705300b9db225..9ed00aeda4a432471ac761963c7f6e0c67356fd1 100644 (file)
@@ -6,8 +6,8 @@
  * Contact: Toshihiro Kobayashi <toshihiro.kobayashi@nokia.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. 
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
index 7fb7c1c9535a3065e94bc7634904026096f57313..3a79867eac1516e9221060d1f8f8237c96970992 100644 (file)
@@ -6,8 +6,8 @@
  * Contact: Toshihiro Kobayashi <toshihiro.kobayashi@nokia.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. 
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
index 11efd3016904ef26821a19caa7f075c94ae17914..a15d9afa737c8c58c3b6d3418bcae701faa535e3 100644 (file)
@@ -6,8 +6,8 @@
  * Contact: Toshihiro Kobayashi <toshihiro.kobayashi@nokia.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. 
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
index f31dbd1aab84a6f065ba1564cab6812ba96e2b16..27e8358238e3df78987a82e6f7997e8ed7446d77 100644 (file)
@@ -6,8 +6,8 @@
  * Contact: Toshihiro Kobayashi <toshihiro.kobayashi@nokia.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. 
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
index b2c870982b6c88f41e2b456dbf44629ecddf5d0d..3262a14417228bf14e80f6057399228d82404d87 100644 (file)
@@ -6,8 +6,8 @@
  * Contact: Toshihiro Kobayashi <toshihiro.kobayashi@nokia.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. 
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -157,7 +157,7 @@ int ipbuf_sys_config(void *p, enum arm_dsp_dir_e dir)
                ipbuf_sys_da = p;
        else
                ipbuf_sys_ad = p;
-       
+
        return 0;
 }
 
index 9a6e3db103cd034ae6b34befc7db1ef8c9a17189..0e8a55d06885c836432c7fbde9c7ee5196c820b1 100644 (file)
@@ -6,8 +6,8 @@
  * Contact: Toshihiro Kobayashi <toshihiro.kobayashi@nokia.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. 
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -61,18 +61,18 @@ struct ipbuf_head {
 extern struct ipbcfg ipbcfg;
 extern struct ipbuf_sys *ipbuf_sys_da, *ipbuf_sys_ad;
 
-#define ipb_bsycnt_inc(ipbcfg) \
-       do { \
-               disable_mbx_irq(mbx_dsp); \
-               (ipbcfg)->bsycnt++; \
-               enable_mbx_irq(mbx_dsp); \
+#define ipb_bsycnt_inc(ipbcfg)                 \
+       do {                                    \
+               disable_mbx_irq(mbx_dsp);       \
+               (ipbcfg)->bsycnt++;             \
+               enable_mbx_irq(mbx_dsp);        \
        } while(0)
 
-#define ipb_bsycnt_dec(ipbcfg) \
-       do { \
-               disable_mbx_irq(mbx_dsp); \
-               (ipbcfg)->bsycnt--; \
-               enable_mbx_irq(mbx_dsp); \
+#define ipb_bsycnt_dec(ipbcfg)                 \
+       do {                                    \
+               disable_mbx_irq(mbx_dsp);       \
+               (ipbcfg)->bsycnt--;             \
+               enable_mbx_irq(mbx_dsp);        \
        } while(0)
 
 #define dsp_mem_enable_ipbuf() dsp_mem_enable(ipbcfg.base)
@@ -84,23 +84,23 @@ struct ipblink {
        u16 tail;
 };
 
-#define IPBLINK_INIT { \
-               .lock = SPIN_LOCK_UNLOCKED, \
-               .top  = BID_NULL, \
-               .tail = BID_NULL, \
+#define IPBLINK_INIT   {                       \
+               .lock = SPIN_LOCK_UNLOCKED,     \
+               .top  = BID_NULL,               \
+               .tail = BID_NULL,               \
        }
 
-#define INIT_IPBLINK(link) \
-       do { \
-               spin_lock_init(&(link)->lock); \
-               (link)->top  = BID_NULL; \
-               (link)->tail = BID_NULL; \
+#define INIT_IPBLINK(link)                     \
+       do {                                    \
+               spin_lock_init(&(link)->lock);  \
+               (link)->top  = BID_NULL;        \
+               (link)->tail = BID_NULL;        \
        } while(0)
 
-#define RESET_IPBLINK(link) \
-       do { \
-               (link)->top  = BID_NULL; \
-               (link)->tail = BID_NULL; \
+#define RESET_IPBLINK(link)                    \
+       do {                                    \
+               (link)->top  = BID_NULL;        \
+               (link)->tail = BID_NULL;        \
        } while(0)
 
 #define ipblink_empty(link)    ((link)->top == BID_NULL)
index 4a4152dc9290d63818f5f3c8ebae420f9d4c7f5e..560b8fc56b6217ed622eacdc34459e8b01a6358e 100644 (file)
@@ -6,8 +6,8 @@
  * Contact: Toshihiro Kobayashi <toshihiro.kobayashi@nokia.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. 
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
index 06a66faa48d683b55ab87d1f58ab9dc6816606c8..8dfe4d6ec39d9316d2a5c13b1f8331b9584e15d7 100644 (file)
@@ -6,8 +6,8 @@
  * Contact: Toshihiro Kobayashi <toshihiro.kobayashi@nokia.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. 
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
index 3adf2b96fa0da37c80dc9b92c6b5b9724391567e..28a98ad55005e5e116a48af62d04213806225af0 100644 (file)
@@ -6,8 +6,8 @@
  * Contact: Toshihiro Kobayashi <toshihiro.kobayashi@nokia.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. 
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
index bf16b7c3f49fc0550a4850089a43f5fccf15f722..cc5c3e0c0eb8a9d893e932a1e2255ad2f530edd6 100644 (file)
@@ -6,8 +6,8 @@
  * Contact: Toshihiro Kobayashi <toshihiro.kobayashi@nokia.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. 
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
index b6c7dfc98929282b0bfab8ad00ecdcf45b70add1..71f8ae8dc69b163e1f469a888bf77a41be4f7085 100644 (file)
@@ -6,8 +6,8 @@
  * Contact: Toshihiro Kobayashi <toshihiro.kobayashi@nokia.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. 
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -114,7 +114,7 @@ struct taskdev {
        long state;
        struct rw_semaphore state_sem;
        wait_queue_head_t state_wait_q;
-       struct mutex usecount_mutex;
+       struct mutex usecount_lock;
        unsigned int usecount;
        char name[TNM_LEN];
        struct file_operations fops;
@@ -315,7 +315,7 @@ static int devstate_write_lock_timeout(struct taskdev *dev, long devstate,
        down_write(&dev->state_sem);
        if (dev->state & devstate)
                return 0;
-       
+
        add_wait_queue(&dev->state_wait_q, &wait);
        do {
                set_current_state(TASK_INTERRUPTIBLE);
@@ -344,22 +344,23 @@ static int devstate_write_lock_and_test(struct taskdev *dev, long devstate)
        down_write(&dev->state_sem);
        if (dev->state & devstate)      /* success */
                return 1;
-       
+
        /* failure */
        up_write(&dev->state_sem);
        return -1;
 }
 
-static int taskdev_lock_interruptible(struct taskdev *dev, struct mutex *mutex)
+static int taskdev_lock_interruptible(struct taskdev *dev,
+                                     struct mutex *lock)
 {
        int ret;
 
        if (has_taskdev_lock(dev))
-               ret = mutex_lock_interruptible(mutex);
+               ret = mutex_lock_interruptible(lock);
        else {
                if ((ret = mutex_lock_interruptible(&dev->lock)) != 0)
                        return ret;
-               ret = mutex_lock_interruptible(mutex);
+               ret = mutex_lock_interruptible(lock);
                mutex_unlock(&dev->lock);
        }
 
@@ -367,23 +368,23 @@ static int taskdev_lock_interruptible(struct taskdev *dev, struct mutex *mutex)
 }
 
 static int taskdev_lock_and_statelock_attached(struct taskdev *dev,
-                                              struct mutex *mutex)
+                                              struct mutex *lock)
 {
        int ret;
 
        if (!devstate_read_lock_and_test(dev, TASKDEV_ST_ATTACHED))
                return -ENODEV;
 
-       if ((ret = taskdev_lock_interruptible(dev, mutex)) != 0)
+       if ((ret = taskdev_lock_interruptible(dev, lock)) != 0)
                devstate_read_unlock(dev);
 
        return ret;
 }
 
 static __inline__ void taskdev_unlock_and_stateunlock(struct taskdev *dev,
-                                                     struct mutex *mutex)
+                                                     struct mutex *lock)
 {
-       mutex_unlock(mutex);
+       mutex_unlock(lock);
        devstate_read_unlock(dev);
 }
 
@@ -430,7 +431,7 @@ static int taskdev_set_fifosz(struct taskdev *dev, unsigned long sz)
        }
        if ((sz == 0) || (sz & 1)) {
                printk(KERN_ERR "omapdsp: illegal buffer size! (%ld)\n"
-                               "it must be even and non-zero value.\n", sz);
+                               "it must be even and non-zero value.\n", sz);
                return -EINVAL;
        }
 
@@ -528,7 +529,7 @@ static int dsp_task_config(struct dsptask *task, u8 tid)
                ret = -EINVAL;
                goto fail_out;
        }
-       
+
        /* mmap buffer configuration check */
        if ((task->map_length > 0) &&
            ((!is_aligned((unsigned long)task->map_base, PAGE_SIZE)) ||
@@ -1324,7 +1325,7 @@ static int dsp_task_ioctl(struct inode *inode, struct file *file,
                ret = taskdev_unlock(dev);
                break;
 
-       case TASK_IOCTL_BFLSH:  
+       case TASK_IOCTL_BFLSH:
                if (taskdev_lock_and_statelock_attached(dev, &dev->read_mutex))
                        return -ENODEV;
                ret = taskdev_flush_buf(dev);
@@ -1469,7 +1470,7 @@ static int dsp_task_open(struct inode *inode, struct file *file)
                return -ENODEV;
 
 restart:
-       mutex_lock(&dev->usecount_mutex);
+       mutex_lock(&dev->usecount_lock);
        down_write(&dev->state_sem);
 
        /* state can be NOTASK, ATTACHED/FREEZED, KILLING, GARBAGE or INVALID here. */
@@ -1481,15 +1482,16 @@ restart:
 
                case TASKDEV_ST_INVALID:
                        up_write(&dev->state_sem);
-                       mutex_unlock(&dev->usecount_mutex);
+                       mutex_unlock(&dev->usecount_lock);
                        return -ENODEV;
 
                case TASKDEV_ST_FREEZED:
                case TASKDEV_ST_KILLING:
                case TASKDEV_ST_GARBAGE:
+               case TASKDEV_ST_DELREQ:
                        /* on the kill process. wait until it becomes NOTASK. */
                        up_write(&dev->state_sem);
-                       mutex_unlock(&dev->usecount_mutex);
+                       mutex_unlock(&dev->usecount_lock);
                        if (devstate_write_lock(dev, TASKDEV_ST_NOTASK) < 0)
                                return -EINTR;
                        devstate_write_unlock(dev);
@@ -1505,7 +1507,7 @@ restart:
                                     TASKDEV_ST_ADDFAIL) < 0) {
                /* cancelled */
                if (!devstate_write_lock_and_test(dev, TASKDEV_ST_ADDREQ)) {
-                       mutex_unlock(&dev->usecount_mutex);
+                       mutex_unlock(&dev->usecount_lock);
                        /* out of control ??? */
                        return -EINTR;
                }
@@ -1533,7 +1535,7 @@ attached:
        proc_list_add(&dev->proc_list_lock, &dev->proc_list, current, file);
        file->f_op = &dev->fops;
        up_write(&dev->state_sem);
-       mutex_unlock(&dev->usecount_mutex);
+       mutex_unlock(&dev->usecount_lock);
 
 #ifdef DSP_PTE_FREE    /* not used currently. */
        dsp_map_update(current);
@@ -1544,7 +1546,7 @@ attached:
 change_out:
        wake_up_interruptible_all(&dev->state_wait_q);
        up_write(&dev->state_sem);
-       mutex_unlock(&dev->usecount_mutex);
+       mutex_unlock(&dev->usecount_lock);
        return ret;
 }
 
@@ -1561,10 +1563,10 @@ static int dsp_task_release(struct inode *inode, struct file *file)
                taskdev_unlock(dev);
 
        proc_list_del(&dev->proc_list_lock, &dev->proc_list, current, file);
-       mutex_lock(&dev->usecount_mutex);
+       mutex_lock(&dev->usecount_lock);
        if (--dev->usecount > 0) {
                /* other processes are using this device. no state change. */
-               mutex_unlock(&dev->usecount_mutex);
+               mutex_unlock(&dev->usecount_lock);
                return 0;
        }
 
@@ -1594,7 +1596,7 @@ static int dsp_task_release(struct inode *inode, struct file *file)
        }
 
        up_write(&dev->state_sem);
-       mutex_unlock(&dev->usecount_mutex);
+       mutex_unlock(&dev->usecount_lock);
        return 0;
 }
 
@@ -1806,7 +1808,7 @@ static int taskdev_init(struct taskdev *dev, char *name, unsigned char minor)
        dev->name[TNM_LEN-1] = '\0';
        dev->state = (minor < n_task) ? TASKDEV_ST_ATTACHED : TASKDEV_ST_NOTASK;
        dev->usecount = 0;
-       mutex_init(&dev->usecount_mutex);
+       mutex_init(&dev->usecount_lock);
        memcpy(&dev->fops, &dsp_task_fops, sizeof(struct file_operations));
 
        dev->dev.parent = &dsp_device.dev;
@@ -1876,7 +1878,7 @@ static int taskdev_attach_task(struct taskdev *dev, struct dsptask *task)
                /* rcvbyp_bk */   dsp_task_write_bk;
        dev->wsz = rcvtyp_acv(ttyp) ? 0 :               /* active */
                   rcvtyp_wd(ttyp)  ? 2 :               /* passive word */
-                                     ipbcfg.lsz*2;     /* passive block */
+                                     ipbcfg.lsz*2;     /* passive block */
 
        if (task->map_length)
                dev->fops.mmap = dsp_task_mmap;
@@ -1965,9 +1967,9 @@ static int dsp_tadd(struct taskdev *dev, dsp_long_t adr)
                ret = -EINTR;
                goto fail_out;
        }
-       cfg_tid = TID_ANON;
-       cfg_cmd = MBX_CMD_DSP_TADD;
-       arg.tid  = TID_ANON;
+       cfg_tid = TID_ANON;
+       cfg_cmd = MBX_CMD_DSP_TADD;
+       arg.tid  = TID_ANON;
        arg.argc = 2;
        arg.argv = argv;
 
@@ -1976,10 +1978,10 @@ static int dsp_tadd(struct taskdev *dev, dsp_long_t adr)
                ret = -EBUSY;
                goto fail_out;
        }
-       dsp_mbcmd_send_and_wait_exarg(&mb, &arg, &cfg_wait_q);
+       mbcompose_send_and_wait_exarg(TADD, 0, 0, &arg, &cfg_wait_q);
 
        tid = cfg_tid;
-       cfg_tid = OMAP_DSP_TID_ANON;
+       cfg_tid = TID_ANON;
        cfg_cmd = 0;
        mutex_unlock(&cfg_lock);
 
index f2bccc9ea3da0223145e767b43029c308e8eafeb..cfec6b3e5e54c4aa8da24ff8e8da02024c877bcc 100644 (file)
@@ -6,8 +6,8 @@
  * Contact: Toshihiro Kobayashi <toshihiro.kobayashi@nokia.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. 
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
index 6ffd68b2c42d29510115e8527e92e2b1bb4ae6a0..bcf4a5474996f30b1a8b0394879312b300b2dbd7 100644 (file)
@@ -6,8 +6,8 @@
  * Contact: Toshihiro Kobayashi <toshihiro.kobayashi@nokia.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. 
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
index 686faf2e9b7dd785cfb13822b1c5224774fb88b0..a2ac7b62446f8676682023beb70ee3d9919e5e6d 100644 (file)
@@ -6,8 +6,8 @@
  * Contact: Toshihiro Kobayashi <toshihiro.kobayashi@nokia.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. 
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
index 6a37582141e4b8f8fe0cf1f693866e066ad2dfa0..b32346ab280ebbf87b313b2451b07f6e6c266c67 100644 (file)
@@ -6,8 +6,8 @@
  * Contact: Toshihiro Kobayashi <toshihiro.kobayashi@nokia.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. 
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -238,7 +238,7 @@ static __inline__ int mbsync_irq_save(struct mbx *mbx, unsigned long *flags,
 #elif defined(CONFIG_ARCH_OMAP2)
 static __inline__ int mbsync_irq_save(struct mbx *mbx, unsigned long *flags)
 {
-       long current_state; 
+       long current_state;
        DECLARE_WAITQUEUE(wait, current);
 
        do {
@@ -247,7 +247,7 @@ static __inline__ int mbsync_irq_save(struct mbx *mbx, unsigned long *flags)
                        return 0;
 
                /*
-                * mailbox is busy. 
+                * mailbox is busy.
                 */
                local_irq_restore(*flags);
                enable_notfull_irq(mbx);
index 9b10433dbd09333b9c8946c64806aad41fb8817e..e77012c8dd9580a43027f04b147ffdc8ebf1b7f8 100644 (file)
@@ -6,8 +6,8 @@
  * Contact: Toshihiro Kobayashi <toshihiro.kobayashi@nokia.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. 
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
index 2a851ebe675aad17b6562a9f3a9cd23d2ecbde30..c244d0a0411eed788a681ccf3d226326f1c6a06a 100644 (file)
@@ -6,8 +6,8 @@
  * Contact: Toshihiro Kobayashi <toshihiro.kobayashi@nokia.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. 
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of