diff options
author | Matt Porter <mporter@linaro.org> | 2014-02-03 10:29:09 -0500 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2014-02-18 11:52:52 -0500 |
commit | 1a7ed5bec407478b9ce5e3267708110277851614 (patch) | |
tree | 697172938ca0e39ff209ccfe4638e986e5c0546e | |
parent | 1af54b7a40ca9bbd549e626be01870caa3f0299d (diff) |
usb: gadget: s3c-hsotg: fix build on x86 and other architectures
The readsl and writesl I/O accessors are only defined on some
architectures. The driver currently depends on CONFIG_ARM because
the build breaks on x86, in particular. Switch to use of ioread32_rep
and iowrite32_rep to fix build on all architectures and remove the
CONFIG_ARM dependency.
Also update printk formatting to handle a long long dma_addr_t to avoid
warnings on !32-bit architectures.
Signed-off-by: Matt Porter <mporter@linaro.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
-rw-r--r-- | drivers/usb/gadget/Kconfig | 1 | ||||
-rw-r--r-- | drivers/usb/gadget/s3c-hsotg.c | 12 |
2 files changed, 6 insertions, 7 deletions
diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig index 42f017afd366..3557c7e5040d 100644 --- a/drivers/usb/gadget/Kconfig +++ b/drivers/usb/gadget/Kconfig | |||
@@ -301,7 +301,6 @@ config USB_PXA27X | |||
301 | gadget drivers to also be dynamically linked. | 301 | gadget drivers to also be dynamically linked. |
302 | 302 | ||
303 | config USB_S3C_HSOTG | 303 | config USB_S3C_HSOTG |
304 | depends on ARM | ||
305 | tristate "Designware/S3C HS/OtG USB Device controller" | 304 | tristate "Designware/S3C HS/OtG USB Device controller" |
306 | help | 305 | help |
307 | The Designware USB2.0 high-speed gadget controller | 306 | The Designware USB2.0 high-speed gadget controller |
diff --git a/drivers/usb/gadget/s3c-hsotg.c b/drivers/usb/gadget/s3c-hsotg.c index 1172eaeddd85..0449b768ac08 100644 --- a/drivers/usb/gadget/s3c-hsotg.c +++ b/drivers/usb/gadget/s3c-hsotg.c | |||
@@ -617,7 +617,7 @@ static int s3c_hsotg_write_fifo(struct s3c_hsotg *hsotg, | |||
617 | to_write = DIV_ROUND_UP(to_write, 4); | 617 | to_write = DIV_ROUND_UP(to_write, 4); |
618 | data = hs_req->req.buf + buf_pos; | 618 | data = hs_req->req.buf + buf_pos; |
619 | 619 | ||
620 | writesl(hsotg->regs + EPFIFO(hs_ep->index), data, to_write); | 620 | iowrite32_rep(hsotg->regs + EPFIFO(hs_ep->index), data, to_write); |
621 | 621 | ||
622 | return (to_write >= can_write) ? -ENOSPC : 0; | 622 | return (to_write >= can_write) ? -ENOSPC : 0; |
623 | } | 623 | } |
@@ -720,8 +720,8 @@ static void s3c_hsotg_start_req(struct s3c_hsotg *hsotg, | |||
720 | ureq->length, ureq->actual); | 720 | ureq->length, ureq->actual); |
721 | if (0) | 721 | if (0) |
722 | dev_dbg(hsotg->dev, | 722 | dev_dbg(hsotg->dev, |
723 | "REQ buf %p len %d dma 0x%08x noi=%d zp=%d snok=%d\n", | 723 | "REQ buf %p len %d dma 0x%08llx noi=%d zp=%d snok=%d\n", |
724 | ureq->buf, length, ureq->dma, | 724 | ureq->buf, length, (unsigned long long)ureq->dma, |
725 | ureq->no_interrupt, ureq->zero, ureq->short_not_ok); | 725 | ureq->no_interrupt, ureq->zero, ureq->short_not_ok); |
726 | 726 | ||
727 | maxreq = get_ep_limit(hs_ep); | 727 | maxreq = get_ep_limit(hs_ep); |
@@ -789,8 +789,8 @@ static void s3c_hsotg_start_req(struct s3c_hsotg *hsotg, | |||
789 | dma_reg = dir_in ? DIEPDMA(index) : DOEPDMA(index); | 789 | dma_reg = dir_in ? DIEPDMA(index) : DOEPDMA(index); |
790 | writel(ureq->dma, hsotg->regs + dma_reg); | 790 | writel(ureq->dma, hsotg->regs + dma_reg); |
791 | 791 | ||
792 | dev_dbg(hsotg->dev, "%s: 0x%08x => 0x%08x\n", | 792 | dev_dbg(hsotg->dev, "%s: 0x%08llx => 0x%08x\n", |
793 | __func__, ureq->dma, dma_reg); | 793 | __func__, (unsigned long long)ureq->dma, dma_reg); |
794 | } | 794 | } |
795 | 795 | ||
796 | ctrl |= DxEPCTL_EPEna; /* ensure ep enabled */ | 796 | ctrl |= DxEPCTL_EPEna; /* ensure ep enabled */ |
@@ -1488,7 +1488,7 @@ static void s3c_hsotg_rx_data(struct s3c_hsotg *hsotg, int ep_idx, int size) | |||
1488 | * note, we might over-write the buffer end by 3 bytes depending on | 1488 | * note, we might over-write the buffer end by 3 bytes depending on |
1489 | * alignment of the data. | 1489 | * alignment of the data. |
1490 | */ | 1490 | */ |
1491 | readsl(fifo, hs_req->req.buf + read_ptr, to_read); | 1491 | ioread32_rep(fifo, hs_req->req.buf + read_ptr, to_read); |
1492 | } | 1492 | } |
1493 | 1493 | ||
1494 | /** | 1494 | /** |