summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKen Adams <kadams@nvidia.com>2011-09-21 19:12:01 -0400
committerRohan Somvanshi <rsomvanshi@nvidia.com>2011-09-28 04:52:05 -0700
commit519205479d3bdebb4889ba36f12d7c11afa45d31 (patch)
tree30b8ce85091b7f4d11e8837825ebf46709ed2251
parent9513b1e6b2868b0a0b95430452f99e6dc62cf355 (diff)
video: tegra: host: fix checkpatch.pl issues
The only warnings left are one for "./nvhost_cdma.c: 609: WARNING: consider using a completion" and all "over 80 char line" warnings. Change-Id: I5aa113dac1deb60570c326976baba96386b041ec Reviewed-on: http://git-master/r/53842 Reviewed-by: Ken Adams <kadams@nvidia.com> Tested-by: Ken Adams <kadams@nvidia.com> Reviewed-by: Scott Williams <scwilliams@nvidia.com> Reviewed-by: Jeff Smith <jsmith@nvidia.com> Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>
-rw-r--r--drivers/video/tegra/host/chip_support.h5
-rw-r--r--drivers/video/tegra/host/debug.c2
-rw-r--r--drivers/video/tegra/host/debug.h2
-rw-r--r--drivers/video/tegra/host/dev.c13
-rw-r--r--drivers/video/tegra/host/nvhost_acm.c20
-rw-r--r--drivers/video/tegra/host/nvhost_channel.c4
-rw-r--r--drivers/video/tegra/host/nvhost_cpuaccess.c4
-rw-r--r--drivers/video/tegra/host/nvhost_intr.c32
-rw-r--r--drivers/video/tegra/host/nvhost_intr.h4
-rw-r--r--drivers/video/tegra/host/nvhost_syncpt.h6
-rw-r--r--drivers/video/tegra/host/t20/cdma_t20.c2
-rw-r--r--drivers/video/tegra/host/t20/channel_t20.c5
-rw-r--r--drivers/video/tegra/host/t20/debug_t20.c4
-rw-r--r--drivers/video/tegra/host/t20/intr_t20.c18
14 files changed, 60 insertions, 61 deletions
diff --git a/drivers/video/tegra/host/chip_support.h b/drivers/video/tegra/host/chip_support.h
index c0f44d1a2f26..cdd26fa8147f 100644
--- a/drivers/video/tegra/host/chip_support.h
+++ b/drivers/video/tegra/host/chip_support.h
@@ -131,13 +131,14 @@ struct nvhost_chip_support {
struct {
void (*init_host_sync)(struct nvhost_intr *);
void (*set_host_clocks_per_usec)(
- struct nvhost_intr *, u32 clocks);
+ struct nvhost_intr *, u32 clocks);
void (*set_syncpt_threshold)(
- struct nvhost_intr *, u32 id, u32 thresh);
+ struct nvhost_intr *, u32 id, u32 thresh);
void (*enable_syncpt_intr)(struct nvhost_intr *, u32 id);
void (*disable_all_syncpt_intrs)(struct nvhost_intr *);
int (*request_host_general_irq)(struct nvhost_intr *);
void (*free_host_general_irq)(struct nvhost_intr *);
+ int (*request_syncpt_irq)(struct nvhost_intr_syncpt *syncpt);
} intr;
struct {
diff --git a/drivers/video/tegra/host/debug.c b/drivers/video/tegra/host/debug.c
index 8892a0072480..3ec8cce9b2c4 100644
--- a/drivers/video/tegra/host/debug.c
+++ b/drivers/video/tegra/host/debug.c
@@ -20,7 +20,7 @@
#include <linux/debugfs.h>
#include <linux/seq_file.h>
-#include <asm/io.h>
+#include <linux/io.h>
#include "dev.h"
#include "debug.h"
diff --git a/drivers/video/tegra/host/debug.h b/drivers/video/tegra/host/debug.h
index d3adcc60cf04..9a3f703b41ce 100644
--- a/drivers/video/tegra/host/debug.h
+++ b/drivers/video/tegra/host/debug.h
@@ -38,7 +38,7 @@ static inline void write_to_seqfile(void *ctx, const char* str, size_t len)
static inline void write_to_printk(void *ctx, const char* str, size_t len)
{
- printk("%s", str);
+ printk(KERN_INFO "%s", str);
}
void nvhost_debug_output(struct output *o, const char* fmt, ...);
diff --git a/drivers/video/tegra/host/dev.c b/drivers/video/tegra/host/dev.c
index 0a511cb82aa5..0eaf9446b713 100644
--- a/drivers/video/tegra/host/dev.c
+++ b/drivers/video/tegra/host/dev.c
@@ -35,7 +35,7 @@
#define CREATE_TRACE_POINTS
#include <trace/events/nvhost.h>
-#include <asm/io.h>
+#include <linux/io.h>
#include <linux/nvhost.h>
#include <linux/nvhost_ioctl.h>
@@ -144,7 +144,7 @@ static void add_gather(struct nvhost_channel_userctx *ctx,
u32 mem_id, u32 words, u32 offset)
{
struct nvmap_pinarray_elem *pin;
- u32* cur_gather = ctx->cur_gather;
+ u32 *cur_gather = ctx->cur_gather;
pin = &ctx->pinarray[ctx->pinarray_size++];
pin->patch_mem = (u32)nvmap_ref_to_handle(ctx->gather_mem);
pin->patch_offset = ((cur_gather + 1) - ctx->gathers) * sizeof(u32);
@@ -275,7 +275,7 @@ static ssize_t nvhost_channelwrite(struct file *filp, const char __user *buf,
return err;
}
- return (count - remaining);
+ return count - remaining;
}
static int nvhost_ioctl_channel_flush(
@@ -481,7 +481,7 @@ static long nvhost_channelctl(struct file *filp,
return err;
}
-static struct file_operations nvhost_channelops = {
+static const struct file_operations nvhost_channelops = {
.owner = THIS_MODULE,
.release = nvhost_channelrelease,
.open = nvhost_channelopen,
@@ -587,8 +587,7 @@ static int nvhost_ioctl_ctrl_module_mutex(
err = nvhost_mutex_try_lock(&ctx->dev->cpuaccess, args->id);
if (!err)
ctx->mod_locks[args->id] = 1;
- }
- else if (!args->lock && ctx->mod_locks[args->id]) {
+ } else if (!args->lock && ctx->mod_locks[args->id]) {
if (args->id == 0)
nvhost_module_idle(&ctx->dev->mod);
else
@@ -688,7 +687,7 @@ static long nvhost_ctrlctl(struct file *filp,
return err;
}
-static struct file_operations nvhost_ctrlops = {
+static const struct file_operations nvhost_ctrlops = {
.owner = THIS_MODULE,
.release = nvhost_ctrlrelease,
.open = nvhost_ctrlopen,
diff --git a/drivers/video/tegra/host/nvhost_acm.c b/drivers/video/tegra/host/nvhost_acm.c
index 19ebb8fbb47c..d665a35ae905 100644
--- a/drivers/video/tegra/host/nvhost_acm.c
+++ b/drivers/video/tegra/host/nvhost_acm.c
@@ -570,20 +570,20 @@ void nvhost_module_remove_client(struct nvhost_module *mod, void *priv)
}
#else
int nvhost_module_get_rate(struct nvhost_module *mod, unsigned long *rate,
- int index)
+ int index)
{
- return 0;
+ return 0;
}
int nvhost_module_set_rate(struct nvhost_module *mod, void *priv,
- unsigned long rate, int index)
+ unsigned long rate, int index)
{
- return 0;
+ return 0;
}
int nvhost_module_add_client(struct nvhost_module *mod, void *priv)
{
- return 0;
+ return 0;
}
void nvhost_module_remove_client(struct nvhost_module *mod, void *priv)
@@ -681,19 +681,19 @@ static void debug_not_idle(struct nvhost_master *dev)
for (i = 0; i < dev->nb_channels; i++) {
struct nvhost_module *m = &dev->channels[i].mod;
if (m->name)
- printk("tegra_grhost: %s: refcnt %d\n",
+ printk(KERN_INFO "tegra_grhost: %s: refcnt %d\n",
m->name, atomic_read(&m->refcount));
}
for (i = 0; i < dev->nb_mlocks; i++) {
int c = atomic_read(&dev->cpuaccess.lock_counts[i]);
if (c) {
- printk("tegra_grhost: lock id %d: refcnt %d\n", i, c);
+ printk(KERN_INFO "tegra_grhost: lock id %d: refcnt %d\n", i, c);
lock_released = false;
}
}
if (lock_released)
- printk("tegra_grhost: all locks released\n");
+ printk(KERN_INFO "tegra_grhost: all locks released\n");
}
void nvhost_module_suspend(struct nvhost_module *mod, bool system_suspend)
@@ -715,13 +715,13 @@ void nvhost_module_suspend(struct nvhost_module *mod, bool system_suspend)
nvhost_debug_dump(dev);
if (system_suspend)
- printk("tegra_grhost: entered idle\n");
+ printk(KERN_INFO "tegra_grhost: entered idle\n");
flush_delayed_work(&mod->powerdown);
cancel_work_sync(&scale3d.work);
if (system_suspend)
- printk("tegra_grhost: flushed delayed work\n");
+ printk(KERN_INFO "tegra_grhost: flushed delayed work\n");
BUG_ON(mod->powered);
}
diff --git a/drivers/video/tegra/host/nvhost_channel.c b/drivers/video/tegra/host/nvhost_channel.c
index d533ef3cd737..e58b27c0c653 100644
--- a/drivers/video/tegra/host/nvhost_channel.c
+++ b/drivers/video/tegra/host/nvhost_channel.c
@@ -43,9 +43,9 @@ struct nvhost_channel *nvhost_getchannel(struct nvhost_channel *ch)
} else if (ch->desc->exclusive) {
err = -EBUSY;
}
- if (!err) {
+ if (!err)
ch->refcount++;
- }
+
mutex_unlock(&ch->reflock);
/* Keep alive modules that needs to be when a channel is open */
diff --git a/drivers/video/tegra/host/nvhost_cpuaccess.c b/drivers/video/tegra/host/nvhost_cpuaccess.c
index dd585fbe8814..d6043c0a1162 100644
--- a/drivers/video/tegra/host/nvhost_cpuaccess.c
+++ b/drivers/video/tegra/host/nvhost_cpuaccess.c
@@ -90,7 +90,7 @@ void nvhost_read_module_regs(struct nvhost_cpuaccess *ctx, u32 module,
{
struct nvhost_master *dev = cpuaccess_to_dev(ctx);
void __iomem *p = ctx->regs[module] + offset;
- u32* out = (u32*)values;
+ u32 *out = (u32 *)values;
BUG_ON(size & 3);
size >>= 2;
nvhost_module_busy(&dev->mod);
@@ -107,7 +107,7 @@ void nvhost_write_module_regs(struct nvhost_cpuaccess *ctx, u32 module,
{
struct nvhost_master *dev = cpuaccess_to_dev(ctx);
void __iomem *p = ctx->regs[module] + offset;
- const u32* in = (const u32*)values;
+ const u32 *in = (const u32 *)values;
BUG_ON(size & 3);
size >>= 2;
nvhost_module_busy(&dev->mod);
diff --git a/drivers/video/tegra/host/nvhost_intr.c b/drivers/video/tegra/host/nvhost_intr.c
index 30ef7d2b8bc6..4e9ebe7d0c23 100644
--- a/drivers/video/tegra/host/nvhost_intr.c
+++ b/drivers/video/tegra/host/nvhost_intr.c
@@ -43,8 +43,7 @@ struct nvhost_waitlist {
int count;
};
-enum waitlist_state
-{
+enum waitlist_state {
WLS_PENDING,
WLS_REMOVED,
WLS_CANCELLED,
@@ -226,7 +225,7 @@ static int process_wait_list(struct nvhost_intr *intr,
* Sync point threshold interrupt service thread function
* Handles sync point threshold triggers, in thread context
*/
-static irqreturn_t syncpt_thresh_fn(int irq, void *dev_id)
+irqreturn_t nvhost_syncpt_thresh_fn(int irq, void *dev_id)
{
struct nvhost_intr_syncpt *syncpt = dev_id;
unsigned int id = syncpt->id;
@@ -240,26 +239,6 @@ static irqreturn_t syncpt_thresh_fn(int irq, void *dev_id)
}
/**
- * lazily request a syncpt's irq
- */
-static int request_syncpt_irq(struct nvhost_intr_syncpt *syncpt)
-{
- int err;
- extern irqreturn_t t20_intr_syncpt_thresh_isr(int irq, void *dev_id);
- if (syncpt->irq_requested)
- return 0;
-
- err = request_threaded_irq(syncpt->irq,
- t20_intr_syncpt_thresh_isr, syncpt_thresh_fn,
- 0, syncpt->thresh_irq_name, syncpt);
- if (err)
- return err;
-
- syncpt->irq_requested = 1;
- return 0;
-}
-
-/**
* free a syncpt's irq. syncpt interrupt should be disabled first.
*/
static void free_syncpt_irq(struct nvhost_intr_syncpt *syncpt)
@@ -312,7 +291,8 @@ int nvhost_intr_add_action(struct nvhost_intr *intr, u32 id, u32 thresh,
spin_unlock(&syncpt->lock);
mutex_lock(&intr->mutex);
- err = request_syncpt_irq(syncpt);
+ BUG_ON(!(intr_op(intr).request_syncpt_irq));
+ err = intr_op(intr).request_syncpt_irq(syncpt);
mutex_unlock(&intr->mutex);
if (err) {
@@ -431,8 +411,8 @@ void nvhost_intr_stop(struct nvhost_intr *intr)
}
}
- if(!list_empty(&syncpt->wait_head)) { // output diagnostics
- printk("%s id=%d\n",__func__,id);
+ if (!list_empty(&syncpt->wait_head)) { /* output diagnostics */
+ printk(KERN_DEBUG "%s id=%d\n", __func__, id);
BUG_ON(1);
}
diff --git a/drivers/video/tegra/host/nvhost_intr.h b/drivers/video/tegra/host/nvhost_intr.h
index 150fd6c5694c..b9a32da009d1 100644
--- a/drivers/video/tegra/host/nvhost_intr.h
+++ b/drivers/video/tegra/host/nvhost_intr.h
@@ -25,6 +25,7 @@
#include <linux/kthread.h>
#include <linux/semaphore.h>
+#include <linux/interrupt.h>
struct nvhost_channel;
@@ -76,7 +77,7 @@ struct nvhost_intr {
};
#define intr_to_dev(x) container_of(x, struct nvhost_master, intr)
#define intr_op(intr) (intr_to_dev(intr)->op.intr)
-#define intr_syncpt_to_intr(is) is->intr
+#define intr_syncpt_to_intr(is) (is->intr)
/**
* Schedule an action to be taken when a sync point reaches the given threshold.
@@ -105,4 +106,5 @@ void nvhost_intr_deinit(struct nvhost_intr *intr);
void nvhost_intr_start(struct nvhost_intr *intr, u32 hz);
void nvhost_intr_stop(struct nvhost_intr *intr);
+irqreturn_t nvhost_syncpt_thresh_fn(int irq, void *dev_id);
#endif
diff --git a/drivers/video/tegra/host/nvhost_syncpt.h b/drivers/video/tegra/host/nvhost_syncpt.h
index c8f8b4bb1262..d3191ba10bd7 100644
--- a/drivers/video/tegra/host/nvhost_syncpt.h
+++ b/drivers/video/tegra/host/nvhost_syncpt.h
@@ -27,7 +27,7 @@
#include <linux/sched.h>
#include <linux/nvhost.h>
#include <mach/nvmap.h>
-#include <asm/atomic.h>
+#include <linux/atomic.h>
struct nvhost_syncpt;
struct nvhost_waitchk;
@@ -49,7 +49,7 @@ int nvhost_syncpt_init(struct nvhost_syncpt *);
#define client_managed(id) (BIT(id) & sp->client_managed)
#define syncpt_to_dev(sp) container_of(sp, struct nvhost_master, syncpt)
#define syncpt_op(sp) (syncpt_to_dev(sp)->op.syncpt)
-#define SYNCPT_CHECK_PERIOD 2*HZ
+#define SYNCPT_CHECK_PERIOD (2*HZ)
static inline bool nvhost_syncpt_check_max(struct nvhost_syncpt *sp, u32 id, u32 real)
{
u32 max;
@@ -135,7 +135,7 @@ int nvhost_syncpt_wait_timeout(struct nvhost_syncpt *sp, u32 id, u32 thresh,
static inline int nvhost_syncpt_wait(struct nvhost_syncpt *sp, u32 id, u32 thresh)
{
return nvhost_syncpt_wait_timeout(sp, id, thresh,
- MAX_SCHEDULE_TIMEOUT, NULL);
+ MAX_SCHEDULE_TIMEOUT, NULL);
}
/*
diff --git a/drivers/video/tegra/host/t20/cdma_t20.c b/drivers/video/tegra/host/t20/cdma_t20.c
index 772a7d043e51..130cf08e8c6c 100644
--- a/drivers/video/tegra/host/t20/cdma_t20.c
+++ b/drivers/video/tegra/host/t20/cdma_t20.c
@@ -127,7 +127,7 @@ static void t20_push_buffer_push_to(struct push_buffer *pb,
struct nvmap_handle *handle, u32 op1, u32 op2)
{
u32 cur = pb->cur;
- u32 *p = (u32*)((u32)pb->mapped + cur);
+ u32 *p = (u32 *)((u32)pb->mapped + cur);
BUG_ON(cur == pb->fence);
*(p++) = op1;
*(p++) = op2;
diff --git a/drivers/video/tegra/host/t20/channel_t20.c b/drivers/video/tegra/host/t20/channel_t20.c
index 7a3e4895e3b1..d1c0b1f72066 100644
--- a/drivers/video/tegra/host/t20/channel_t20.c
+++ b/drivers/video/tegra/host/t20/channel_t20.c
@@ -105,7 +105,7 @@ const struct nvhost_channeldesc nvhost_t20_channelmap[] = {
.name = "dsi",
.syncpts = BIT(NVSYNCPT_DSI),
.modulemutexes = BIT(NVMODMUTEX_DSI),
-}};
+} };
static inline void __iomem *t20_channel_aperture(void __iomem *p, int ndx)
{
@@ -273,8 +273,7 @@ static int t20_channel_submit(struct nvhost_channel *channel,
nvhost_class_host_incr_syncpt_base(
NVWAITBASE_3D,
user_syncpt_incrs));
- }
- else {
+ } else {
/* push user gathers */
int i = 0;
for ( ; i < gather_end-gather; i += 2) {
diff --git a/drivers/video/tegra/host/t20/debug_t20.c b/drivers/video/tegra/host/t20/debug_t20.c
index d3329bf2ed9e..fb101230cd8b 100644
--- a/drivers/video/tegra/host/t20/debug_t20.c
+++ b/drivers/video/tegra/host/t20/debug_t20.c
@@ -21,7 +21,7 @@
#include <linux/seq_file.h>
#include <linux/mm.h>
-#include <asm/io.h>
+#include <linux/io.h>
#include "../dev.h"
#include "../debug.h"
@@ -84,7 +84,7 @@ static int show_channel_command(struct output *o, u32 addr, u32 val, int *count)
nvhost_debug_output(o, "GATHER(offset=%03x, insert=%d, type=%d, count=%04x, addr=[",
val >> 16 & 0xfff, val >> 15 & 0x1, val >> 14 & 0x1,
val & 0x3fff);
- *count = val & 0x3fff; // TODO: insert
+ *count = val & 0x3fff; /* TODO: insert */
return NVHOST_DBG_STATE_GATHER;
case 0xe:
diff --git a/drivers/video/tegra/host/t20/intr_t20.c b/drivers/video/tegra/host/t20/intr_t20.c
index 94bdae4bf392..7df3c1e959e9 100644
--- a/drivers/video/tegra/host/t20/intr_t20.c
+++ b/drivers/video/tegra/host/t20/intr_t20.c
@@ -183,6 +183,22 @@ static void t20_intr_free_host_general_irq(struct nvhost_intr *intr)
}
}
+static int t20_request_syncpt_irq(struct nvhost_intr_syncpt *syncpt)
+{
+ int err;
+ if (syncpt->irq_requested)
+ return 0;
+
+ err = request_threaded_irq(syncpt->irq,
+ t20_intr_syncpt_thresh_isr, nvhost_syncpt_thresh_fn,
+ 0, syncpt->thresh_irq_name, syncpt);
+ if (err)
+ return err;
+
+ syncpt->irq_requested = 1;
+ return 0;
+}
+
int nvhost_init_t20_intr_support(struct nvhost_master *host)
{
host->op.intr.init_host_sync = t20_intr_init_host_sync;
@@ -196,6 +212,8 @@ int nvhost_init_t20_intr_support(struct nvhost_master *host)
t20_intr_request_host_general_irq;
host->op.intr.free_host_general_irq =
t20_intr_free_host_general_irq;
+ host->op.intr.request_syncpt_irq =
+ t20_request_syncpt_irq;
return 0;
}