Skip to content

Commit

Permalink
[media] video/omap24xxcam: use __iomem annotations
Browse files Browse the repository at this point in the history
MMIO registers are __iomem tokens in virtual address space,
not integers.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Arnd Bergmann authored and Mauro Carvalho Chehab committed May 15, 2012
1 parent 5cbd28d commit d0f8dfc
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 19 deletions.
20 changes: 10 additions & 10 deletions drivers/media/video/omap24xxcam-dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
*/

/* Ack all interrupt on CSR and IRQSTATUS_L0 */
static void omap24xxcam_dmahw_ack_all(unsigned long base)
static void omap24xxcam_dmahw_ack_all(void __iomem *base)
{
u32 csr;
int i;
Expand All @@ -52,7 +52,7 @@ static void omap24xxcam_dmahw_ack_all(unsigned long base)
}

/* Ack dmach on CSR and IRQSTATUS_L0 */
static u32 omap24xxcam_dmahw_ack_ch(unsigned long base, int dmach)
static u32 omap24xxcam_dmahw_ack_ch(void __iomem *base, int dmach)
{
u32 csr;

Expand All @@ -65,12 +65,12 @@ static u32 omap24xxcam_dmahw_ack_ch(unsigned long base, int dmach)
return csr;
}

static int omap24xxcam_dmahw_running(unsigned long base, int dmach)
static int omap24xxcam_dmahw_running(void __iomem *base, int dmach)
{
return omap24xxcam_reg_in(base, CAMDMA_CCR(dmach)) & CAMDMA_CCR_ENABLE;
}

static void omap24xxcam_dmahw_transfer_setup(unsigned long base, int dmach,
static void omap24xxcam_dmahw_transfer_setup(void __iomem *base, int dmach,
dma_addr_t start, u32 len)
{
omap24xxcam_reg_out(base, CAMDMA_CCR(dmach),
Expand Down Expand Up @@ -112,7 +112,7 @@ static void omap24xxcam_dmahw_transfer_setup(unsigned long base, int dmach,
| CAMDMA_CICR_DROP_IE);
}

static void omap24xxcam_dmahw_transfer_start(unsigned long base, int dmach)
static void omap24xxcam_dmahw_transfer_start(void __iomem *base, int dmach)
{
omap24xxcam_reg_out(base, CAMDMA_CCR(dmach),
CAMDMA_CCR_SEL_SRC_DST_SYNC
Expand All @@ -124,7 +124,7 @@ static void omap24xxcam_dmahw_transfer_start(unsigned long base, int dmach)
| CAMDMA_CCR_SYNCHRO_CAMERA);
}

static void omap24xxcam_dmahw_transfer_chain(unsigned long base, int dmach,
static void omap24xxcam_dmahw_transfer_chain(void __iomem *base, int dmach,
int free_dmach)
{
int prev_dmach, ch;
Expand Down Expand Up @@ -160,7 +160,7 @@ static void omap24xxcam_dmahw_transfer_chain(unsigned long base, int dmach,
* controller may not be idle after this routine completes, because
* the completion routines might start new transfers.
*/
static void omap24xxcam_dmahw_abort_ch(unsigned long base, int dmach)
static void omap24xxcam_dmahw_abort_ch(void __iomem *base, int dmach)
{
/* mask all interrupts from this channel */
omap24xxcam_reg_out(base, CAMDMA_CICR(dmach), 0);
Expand All @@ -171,7 +171,7 @@ static void omap24xxcam_dmahw_abort_ch(unsigned long base, int dmach)
omap24xxcam_reg_merge(base, CAMDMA_CCR(dmach), 0, CAMDMA_CCR_ENABLE);
}

static void omap24xxcam_dmahw_init(unsigned long base)
static void omap24xxcam_dmahw_init(void __iomem *base)
{
omap24xxcam_reg_out(base, CAMDMA_OCP_SYSCONFIG,
CAMDMA_OCP_SYSCONFIG_MIDLEMODE_FSTANDBY
Expand Down Expand Up @@ -362,7 +362,7 @@ void omap24xxcam_dma_hwinit(struct omap24xxcam_dma *dma)
}

static void omap24xxcam_dma_init(struct omap24xxcam_dma *dma,
unsigned long base)
void __iomem *base)
{
int ch;

Expand Down Expand Up @@ -577,7 +577,7 @@ void omap24xxcam_sgdma_sync(struct omap24xxcam_sgdma *sgdma)
}

void omap24xxcam_sgdma_init(struct omap24xxcam_sgdma *sgdma,
unsigned long base,
void __iomem *base,
void (*reset_callback)(unsigned long data),
unsigned long reset_callback_data)
{
Expand Down
3 changes: 1 addition & 2 deletions drivers/media/video/omap24xxcam.c
Original file line number Diff line number Diff line change
Expand Up @@ -1776,8 +1776,7 @@ static int __devinit omap24xxcam_probe(struct platform_device *pdev)
cam->mmio_size = resource_size(mem);

/* map the region */
cam->mmio_base = (unsigned long)
ioremap_nocache(cam->mmio_base_phys, cam->mmio_size);
cam->mmio_base = ioremap_nocache(cam->mmio_base_phys, cam->mmio_size);
if (!cam->mmio_base) {
dev_err(cam->dev, "cannot map camera register I/O region\n");
goto err;
Expand Down
14 changes: 7 additions & 7 deletions drivers/media/video/omap24xxcam.h
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ struct sgdma_state {
struct omap24xxcam_dma {
spinlock_t lock; /* Lock for the whole structure. */

unsigned long base; /* base address for dma controller */
void __iomem *base; /* base address for dma controller */

/* While dma_stop!=0, an attempt to start a new DMA transfer will
* fail.
Expand Down Expand Up @@ -491,7 +491,7 @@ struct omap24xxcam_device {

/*** hardware resources ***/
unsigned int irq;
unsigned long mmio_base;
void __iomem *mmio_base;
unsigned long mmio_base_phys;
unsigned long mmio_size;

Expand Down Expand Up @@ -544,22 +544,22 @@ struct omap24xxcam_fh {
*
*/

static inline u32 omap24xxcam_reg_in(unsigned long base, u32 offset)
static inline u32 omap24xxcam_reg_in(u32 __iomem *base, u32 offset)
{
return readl(base + offset);
}

static inline u32 omap24xxcam_reg_out(unsigned long base, u32 offset,
static inline u32 omap24xxcam_reg_out(u32 __iomem *base, u32 offset,
u32 val)
{
writel(val, base + offset);
return val;
}

static inline u32 omap24xxcam_reg_merge(unsigned long base, u32 offset,
static inline u32 omap24xxcam_reg_merge(u32 __iomem *base, u32 offset,
u32 val, u32 mask)
{
u32 addr = base + offset;
u32 __iomem *addr = base + offset;
u32 new_val = (readl(addr) & ~mask) | (val & mask);

writel(new_val, addr);
Expand All @@ -585,7 +585,7 @@ int omap24xxcam_sgdma_queue(struct omap24xxcam_sgdma *sgdma,
int len, sgdma_callback_t callback, void *arg);
void omap24xxcam_sgdma_sync(struct omap24xxcam_sgdma *sgdma);
void omap24xxcam_sgdma_init(struct omap24xxcam_sgdma *sgdma,
unsigned long base,
void __iomem *base,
void (*reset_callback)(unsigned long data),
unsigned long reset_callback_data);
void omap24xxcam_sgdma_exit(struct omap24xxcam_sgdma *sgdma);
Expand Down

0 comments on commit d0f8dfc

Please sign in to comment.