Commit a44ca244 authored by Hiroshi DOYU's avatar Hiroshi DOYU Committed by Juha Yrjola

ARM: OMAP: DSPGW: cleanup

- cleanup whitespaces
- fix some build errors
Signed-off-by: default avatarHiroshi DOYU <Hiroshi.DOYU@nokia.com>
Signed-off-by: default avatarJuha Yrjola <juha.yrjola@solidboot.com>
parent 848a8f94
...@@ -100,6 +100,7 @@ static const struct cmdinfo ...@@ -100,6 +100,7 @@ static const struct cmdinfo
cif_err = { "ERR", CMD_L_TYPE_SUBCMD, mbx_err }, cif_err = { "ERR", CMD_L_TYPE_SUBCMD, mbx_err },
cif_dbg = { "DBG", CMD_L_TYPE_NULL, mbx_dbg }; cif_dbg = { "DBG", CMD_L_TYPE_NULL, mbx_dbg };
#define MBX_CMD_MAX 0x80
const struct cmdinfo *cmdinfo[MBX_CMD_MAX] = { const struct cmdinfo *cmdinfo[MBX_CMD_MAX] = {
[MBX_CMD_DSP_WDSND] = &cif_wdsnd, [MBX_CMD_DSP_WDSND] = &cif_wdsnd,
[MBX_CMD_DSP_WDREQ] = &cif_wdreq, [MBX_CMD_DSP_WDREQ] = &cif_wdreq,
......
...@@ -47,6 +47,7 @@ ...@@ -47,6 +47,7 @@
#include "../mailbox_hw.h" #include "../mailbox_hw.h"
#include "dsp.h" #include "dsp.h"
#include "ioctl.h" #include "ioctl.h"
#include "ipbuf.h"
#ifdef CONFIG_ARCH_OMAP2 #ifdef CONFIG_ARCH_OMAP2
#define IOMAP_VAL 0x3f #define IOMAP_VAL 0x3f
...@@ -1401,8 +1402,8 @@ static void exmap_flush(void) ...@@ -1401,8 +1402,8 @@ static void exmap_flush(void)
#endif /* CONFIG_FB */ #endif /* CONFIG_FB */
#ifdef CONFIG_FB_OMAP_LCDC_EXTERNAL #ifdef CONFIG_FB_OMAP_LCDC_EXTERNAL
static int omapfb_notifier_cb(struct omapfb_notifier_block *omapfb_nb, static int omapfb_notifier_cb(struct notifier_block *omapfb_nb,
unsigned long event, struct omapfb_device *fbdev) unsigned long event, void *fbi)
{ {
/* XXX */ /* XXX */
printk("omapfb_notifier_cb(): event = %s\n", printk("omapfb_notifier_cb(): event = %s\n",
...@@ -2007,8 +2008,7 @@ static void fbupd_response(void *arg) ...@@ -2007,8 +2008,7 @@ static void fbupd_response(void *arg)
{ {
int status; int status;
status = dsp_mbsend(MBCMD(KFUNC), OMAP_DSP_MBCMD_KFUNC_FBCTL, status = mbcompose_send(KFUNC, KFUNC_FBCTL, FBCTL_UPD);
OMAP_DSP_MBCMD_FBCTL_UPD);
if (status < 0) { if (status < 0) {
/* FIXME: DSP is busy !! */ /* FIXME: DSP is busy !! */
printk(KERN_ERR printk(KERN_ERR
...@@ -2031,8 +2031,8 @@ void mbx_fbctl_upd(void) ...@@ -2031,8 +2031,8 @@ void mbx_fbctl_upd(void)
volatile unsigned short *buf = ipbuf_sys_da->d; volatile unsigned short *buf = ipbuf_sys_da->d;
/* FIXME: try count sometimes exceeds 1000. */ /* FIXME: try count sometimes exceeds 1000. */
if (sync_with_dsp(&ipbuf_sys_da->s, OMAP_DSP_TID_ANON, 5000) < 0) { if (sync_with_dsp(&ipbuf_sys_da->s, TID_ANON, 5000) < 0) {
printk(KERN_ERR "mbx: FBCTL:UPD - IPBUF sync failed!\n"); printk(KERN_ERR "mbox: FBCTL:UPD - IPBUF sync failed!\n");
return; return;
} }
win.x = buf[0]; win.x = buf[0];
...@@ -2048,7 +2048,7 @@ void mbx_fbctl_upd(void) ...@@ -2048,7 +2048,7 @@ void mbx_fbctl_upd(void)
return; return;
} }
//printk("calling omapfb_update_window_async()\n"); //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 */ #else /* CONFIG_FB_OMAP_LCDC_EXTERNAL */
......
...@@ -114,7 +114,7 @@ struct taskdev { ...@@ -114,7 +114,7 @@ struct taskdev {
long state; long state;
struct rw_semaphore state_sem; struct rw_semaphore state_sem;
wait_queue_head_t state_wait_q; wait_queue_head_t state_wait_q;
struct mutex usecount_mutex; struct mutex usecount_lock;
unsigned int usecount; unsigned int usecount;
char name[TNM_LEN]; char name[TNM_LEN];
struct file_operations fops; struct file_operations fops;
...@@ -350,16 +350,17 @@ static int devstate_write_lock_and_test(struct taskdev *dev, long devstate) ...@@ -350,16 +350,17 @@ static int devstate_write_lock_and_test(struct taskdev *dev, long devstate)
return -1; 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; int ret;
if (has_taskdev_lock(dev)) if (has_taskdev_lock(dev))
ret = mutex_lock_interruptible(mutex); ret = mutex_lock_interruptible(lock);
else { else {
if ((ret = mutex_lock_interruptible(&dev->lock)) != 0) if ((ret = mutex_lock_interruptible(&dev->lock)) != 0)
return ret; return ret;
ret = mutex_lock_interruptible(mutex); ret = mutex_lock_interruptible(lock);
mutex_unlock(&dev->lock); mutex_unlock(&dev->lock);
} }
...@@ -367,23 +368,23 @@ static int taskdev_lock_interruptible(struct taskdev *dev, struct mutex *mutex) ...@@ -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, static int taskdev_lock_and_statelock_attached(struct taskdev *dev,
struct mutex *mutex) struct mutex *lock)
{ {
int ret; int ret;
if (!devstate_read_lock_and_test(dev, TASKDEV_ST_ATTACHED)) if (!devstate_read_lock_and_test(dev, TASKDEV_ST_ATTACHED))
return -ENODEV; return -ENODEV;
if ((ret = taskdev_lock_interruptible(dev, mutex)) != 0) if ((ret = taskdev_lock_interruptible(dev, lock)) != 0)
devstate_read_unlock(dev); devstate_read_unlock(dev);
return ret; return ret;
} }
static __inline__ void taskdev_unlock_and_stateunlock(struct taskdev *dev, 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); devstate_read_unlock(dev);
} }
...@@ -1469,7 +1470,7 @@ static int dsp_task_open(struct inode *inode, struct file *file) ...@@ -1469,7 +1470,7 @@ static int dsp_task_open(struct inode *inode, struct file *file)
return -ENODEV; return -ENODEV;
restart: restart:
mutex_lock(&dev->usecount_mutex); mutex_lock(&dev->usecount_lock);
down_write(&dev->state_sem); down_write(&dev->state_sem);
/* state can be NOTASK, ATTACHED/FREEZED, KILLING, GARBAGE or INVALID here. */ /* state can be NOTASK, ATTACHED/FREEZED, KILLING, GARBAGE or INVALID here. */
...@@ -1481,15 +1482,16 @@ restart: ...@@ -1481,15 +1482,16 @@ restart:
case TASKDEV_ST_INVALID: case TASKDEV_ST_INVALID:
up_write(&dev->state_sem); up_write(&dev->state_sem);
mutex_unlock(&dev->usecount_mutex); mutex_unlock(&dev->usecount_lock);
return -ENODEV; return -ENODEV;
case TASKDEV_ST_FREEZED: case TASKDEV_ST_FREEZED:
case TASKDEV_ST_KILLING: case TASKDEV_ST_KILLING:
case TASKDEV_ST_GARBAGE: case TASKDEV_ST_GARBAGE:
case TASKDEV_ST_DELREQ:
/* on the kill process. wait until it becomes NOTASK. */ /* on the kill process. wait until it becomes NOTASK. */
up_write(&dev->state_sem); up_write(&dev->state_sem);
mutex_unlock(&dev->usecount_mutex); mutex_unlock(&dev->usecount_lock);
if (devstate_write_lock(dev, TASKDEV_ST_NOTASK) < 0) if (devstate_write_lock(dev, TASKDEV_ST_NOTASK) < 0)
return -EINTR; return -EINTR;
devstate_write_unlock(dev); devstate_write_unlock(dev);
...@@ -1505,7 +1507,7 @@ restart: ...@@ -1505,7 +1507,7 @@ restart:
TASKDEV_ST_ADDFAIL) < 0) { TASKDEV_ST_ADDFAIL) < 0) {
/* cancelled */ /* cancelled */
if (!devstate_write_lock_and_test(dev, TASKDEV_ST_ADDREQ)) { if (!devstate_write_lock_and_test(dev, TASKDEV_ST_ADDREQ)) {
mutex_unlock(&dev->usecount_mutex); mutex_unlock(&dev->usecount_lock);
/* out of control ??? */ /* out of control ??? */
return -EINTR; return -EINTR;
} }
...@@ -1533,7 +1535,7 @@ attached: ...@@ -1533,7 +1535,7 @@ attached:
proc_list_add(&dev->proc_list_lock, &dev->proc_list, current, file); proc_list_add(&dev->proc_list_lock, &dev->proc_list, current, file);
file->f_op = &dev->fops; file->f_op = &dev->fops;
up_write(&dev->state_sem); up_write(&dev->state_sem);
mutex_unlock(&dev->usecount_mutex); mutex_unlock(&dev->usecount_lock);
#ifdef DSP_PTE_FREE /* not used currently. */ #ifdef DSP_PTE_FREE /* not used currently. */
dsp_map_update(current); dsp_map_update(current);
...@@ -1544,7 +1546,7 @@ attached: ...@@ -1544,7 +1546,7 @@ attached:
change_out: change_out:
wake_up_interruptible_all(&dev->state_wait_q); wake_up_interruptible_all(&dev->state_wait_q);
up_write(&dev->state_sem); up_write(&dev->state_sem);
mutex_unlock(&dev->usecount_mutex); mutex_unlock(&dev->usecount_lock);
return ret; return ret;
} }
...@@ -1561,10 +1563,10 @@ static int dsp_task_release(struct inode *inode, struct file *file) ...@@ -1561,10 +1563,10 @@ static int dsp_task_release(struct inode *inode, struct file *file)
taskdev_unlock(dev); taskdev_unlock(dev);
proc_list_del(&dev->proc_list_lock, &dev->proc_list, current, file); 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) { if (--dev->usecount > 0) {
/* other processes are using this device. no state change. */ /* other processes are using this device. no state change. */
mutex_unlock(&dev->usecount_mutex); mutex_unlock(&dev->usecount_lock);
return 0; return 0;
} }
...@@ -1594,7 +1596,7 @@ static int dsp_task_release(struct inode *inode, struct file *file) ...@@ -1594,7 +1596,7 @@ static int dsp_task_release(struct inode *inode, struct file *file)
} }
up_write(&dev->state_sem); up_write(&dev->state_sem);
mutex_unlock(&dev->usecount_mutex); mutex_unlock(&dev->usecount_lock);
return 0; return 0;
} }
...@@ -1806,7 +1808,7 @@ static int taskdev_init(struct taskdev *dev, char *name, unsigned char minor) ...@@ -1806,7 +1808,7 @@ static int taskdev_init(struct taskdev *dev, char *name, unsigned char minor)
dev->name[TNM_LEN-1] = '\0'; dev->name[TNM_LEN-1] = '\0';
dev->state = (minor < n_task) ? TASKDEV_ST_ATTACHED : TASKDEV_ST_NOTASK; dev->state = (minor < n_task) ? TASKDEV_ST_ATTACHED : TASKDEV_ST_NOTASK;
dev->usecount = 0; dev->usecount = 0;
mutex_init(&dev->usecount_mutex); mutex_init(&dev->usecount_lock);
memcpy(&dev->fops, &dsp_task_fops, sizeof(struct file_operations)); memcpy(&dev->fops, &dsp_task_fops, sizeof(struct file_operations));
dev->dev.parent = &dsp_device.dev; dev->dev.parent = &dsp_device.dev;
...@@ -1976,10 +1978,10 @@ static int dsp_tadd(struct taskdev *dev, dsp_long_t adr) ...@@ -1976,10 +1978,10 @@ static int dsp_tadd(struct taskdev *dev, dsp_long_t adr)
ret = -EBUSY; ret = -EBUSY;
goto fail_out; 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; tid = cfg_tid;
cfg_tid = OMAP_DSP_TID_ANON; cfg_tid = TID_ANON;
cfg_cmd = 0; cfg_cmd = 0;
mutex_unlock(&cfg_lock); mutex_unlock(&cfg_lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment