Commit 1c36dfc5 authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab

[media] ivtv: fix support for big-endian systems

base_addr has type resource_size_t, which may be 64 bits on a 32-bit ppc.

Tested on my ppc board.
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent c44ff8fa
...@@ -866,10 +866,10 @@ static int ivtv_setup_pci(struct ivtv *itv, struct pci_dev *pdev, ...@@ -866,10 +866,10 @@ static int ivtv_setup_pci(struct ivtv *itv, struct pci_dev *pdev,
pci_write_config_dword(pdev, 0x40, 0xffff); pci_write_config_dword(pdev, 0x40, 0xffff);
IVTV_DEBUG_INFO("%d (rev %d) at %02x:%02x.%x, " IVTV_DEBUG_INFO("%d (rev %d) at %02x:%02x.%x, "
"irq: %d, latency: %d, memory: 0x%lx\n", "irq: %d, latency: %d, memory: 0x%llx\n",
pdev->device, pdev->revision, pdev->bus->number, pdev->device, pdev->revision, pdev->bus->number,
PCI_SLOT(pdev->devfn), PCI_FUNC(pdev->devfn), PCI_SLOT(pdev->devfn), PCI_FUNC(pdev->devfn),
pdev->irq, pci_latency, (unsigned long)itv->base_addr); pdev->irq, pci_latency, (u64)itv->base_addr);
return 0; return 0;
} }
...@@ -1007,7 +1007,7 @@ static int __devinit ivtv_probe(struct pci_dev *pdev, ...@@ -1007,7 +1007,7 @@ static int __devinit ivtv_probe(struct pci_dev *pdev,
itv->cxhdl.priv = itv; itv->cxhdl.priv = itv;
itv->cxhdl.func = ivtv_api_func; itv->cxhdl.func = ivtv_api_func;
IVTV_DEBUG_INFO("base addr: 0x%08x\n", itv->base_addr); IVTV_DEBUG_INFO("base addr: 0x%llx\n", (u64)itv->base_addr);
/* PCI Device Setup */ /* PCI Device Setup */
retval = ivtv_setup_pci(itv, pdev, pci_id); retval = ivtv_setup_pci(itv, pdev, pci_id);
...@@ -1017,8 +1017,8 @@ static int __devinit ivtv_probe(struct pci_dev *pdev, ...@@ -1017,8 +1017,8 @@ static int __devinit ivtv_probe(struct pci_dev *pdev,
goto free_mem; goto free_mem;
/* map io memory */ /* map io memory */
IVTV_DEBUG_INFO("attempting ioremap at 0x%08x len 0x%08x\n", IVTV_DEBUG_INFO("attempting ioremap at 0x%llx len 0x%08x\n",
itv->base_addr + IVTV_ENCODER_OFFSET, IVTV_ENCODER_SIZE); (u64)itv->base_addr + IVTV_ENCODER_OFFSET, IVTV_ENCODER_SIZE);
itv->enc_mem = ioremap_nocache(itv->base_addr + IVTV_ENCODER_OFFSET, itv->enc_mem = ioremap_nocache(itv->base_addr + IVTV_ENCODER_OFFSET,
IVTV_ENCODER_SIZE); IVTV_ENCODER_SIZE);
if (!itv->enc_mem) { if (!itv->enc_mem) {
...@@ -1034,8 +1034,8 @@ static int __devinit ivtv_probe(struct pci_dev *pdev, ...@@ -1034,8 +1034,8 @@ static int __devinit ivtv_probe(struct pci_dev *pdev,
} }
if (itv->has_cx23415) { if (itv->has_cx23415) {
IVTV_DEBUG_INFO("attempting ioremap at 0x%08x len 0x%08x\n", IVTV_DEBUG_INFO("attempting ioremap at 0x%llx len 0x%08x\n",
itv->base_addr + IVTV_DECODER_OFFSET, IVTV_DECODER_SIZE); (u64)itv->base_addr + IVTV_DECODER_OFFSET, IVTV_DECODER_SIZE);
itv->dec_mem = ioremap_nocache(itv->base_addr + IVTV_DECODER_OFFSET, itv->dec_mem = ioremap_nocache(itv->base_addr + IVTV_DECODER_OFFSET,
IVTV_DECODER_SIZE); IVTV_DECODER_SIZE);
if (!itv->dec_mem) { if (!itv->dec_mem) {
...@@ -1056,8 +1056,8 @@ static int __devinit ivtv_probe(struct pci_dev *pdev, ...@@ -1056,8 +1056,8 @@ static int __devinit ivtv_probe(struct pci_dev *pdev,
} }
/* map registers memory */ /* map registers memory */
IVTV_DEBUG_INFO("attempting ioremap at 0x%08x len 0x%08x\n", IVTV_DEBUG_INFO("attempting ioremap at 0x%llx len 0x%08x\n",
itv->base_addr + IVTV_REG_OFFSET, IVTV_REG_SIZE); (u64)itv->base_addr + IVTV_REG_OFFSET, IVTV_REG_SIZE);
itv->reg_mem = itv->reg_mem =
ioremap_nocache(itv->base_addr + IVTV_REG_OFFSET, IVTV_REG_SIZE); ioremap_nocache(itv->base_addr + IVTV_REG_OFFSET, IVTV_REG_SIZE);
if (!itv->reg_mem) { if (!itv->reg_mem) {
......
...@@ -622,7 +622,7 @@ struct ivtv { ...@@ -622,7 +622,7 @@ struct ivtv {
struct v4l2_subdev *sd_video; /* controlling video decoder subdev */ struct v4l2_subdev *sd_video; /* controlling video decoder subdev */
struct v4l2_subdev *sd_audio; /* controlling audio subdev */ struct v4l2_subdev *sd_audio; /* controlling audio subdev */
struct v4l2_subdev *sd_muxer; /* controlling audio muxer subdev */ struct v4l2_subdev *sd_muxer; /* controlling audio muxer subdev */
u32 base_addr; /* PCI resource base address */ resource_size_t base_addr; /* PCI resource base address */
volatile void __iomem *enc_mem; /* pointer to mapped encoder memory */ volatile void __iomem *enc_mem; /* pointer to mapped encoder memory */
volatile void __iomem *dec_mem; /* pointer to mapped decoder memory */ volatile void __iomem *dec_mem; /* pointer to mapped decoder memory */
volatile void __iomem *reg_mem; /* pointer to mapped registers */ volatile void __iomem *reg_mem; /* pointer to mapped registers */
......
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