linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: Felipe Balbi <balbi@ti.com>
Cc: linux-usb@vger.kernel.org, linux-omap@vger.kernel.org,
	Bryan Wu <cooloney@gmail.com>
Subject: [PATCH 3/8] usb: musb: Populate new IO functions for blackfin
Date: Mon, 24 Nov 2014 11:05:01 -0800	[thread overview]
Message-ID: <1416855906-13931-4-git-send-email-tony@atomide.com> (raw)
In-Reply-To: <1416855906-13931-1-git-send-email-tony@atomide.com>

Populate new IO functions for blackfin

Cc: Bryan Wu <cooloney@gmail.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 drivers/usb/musb/blackfin.c | 43 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)

diff --git a/drivers/usb/musb/blackfin.c b/drivers/usb/musb/blackfin.c
index ac4422b..8b5ad57 100644
--- a/drivers/usb/musb/blackfin.c
+++ b/drivers/usb/musb/blackfin.c
@@ -33,6 +33,41 @@ struct bfin_glue {
 };
 #define glue_to_musb(g)		platform_get_drvdata(g->musb)
 
+static u32 bfin_fifo_offset(u8 epnum)
+{
+	return USB_OFFSET(USB_EP0_FIFO) + (epnum * 8);
+}
+
+static u8 bfin_readb(const void __iomem *addr, unsigned offset)
+{
+	return (u8)(bfin_read16(addr + offset));
+}
+
+static u16 bfin_readw(const void __iomem *addr, unsigned offset)
+{
+	return bfin_read16(addr + offset);
+}
+
+static u32 bfin_readl(const void __iomem *addr, unsigned offset)
+{
+	return (u32)(bfin_read16(addr + offset));
+}
+
+static void bfin_writeb(void __iomem *addr, unsigned offset, u8 data)
+{
+	bfin_write16(addr + offset, (u16)data);
+}
+
+static void bfin_writew(void __iomem *addr, unsigned offset, u16 data)
+{
+	bfin_write16(addr + offset, data);
+}
+
+static void binf_writel(void __iomem *addr, unsigned offset, u32 data)
+{
+	bfin_write16(addr + offset, (u16)data);
+}
+
 /*
  * Load an endpoint's FIFO
  */
@@ -433,6 +468,14 @@ static const struct musb_platform_ops bfin_ops = {
 	.init		= bfin_musb_init,
 	.exit		= bfin_musb_exit,
 
+	.readb		= bfin_readb,
+	.writeb		= bfin_writeb,
+	.readw		= bfin_readw,
+	.writew		= bfin_writew,
+	.readl		= bfin_readl,
+	.writel		= bfin_writel,
+	.read_fifo	= musb_read_fifo,
+	.write_fifo	= musb_write_fifo,
 	.enable		= bfin_musb_enable,
 	.disable	= bfin_musb_disable,
 
-- 
2.1.3


  parent reply	other threads:[~2014-11-24 19:07 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-24 19:04 [PATCH 0/8] Allow multiple MUSB glue layers to be built in Tony Lindgren
2014-11-24 19:05 ` [PATCH 2/8] usb: musb: Populate new IO functions for tusb6010 Tony Lindgren
2014-11-24 19:05 ` Tony Lindgren [this message]
     [not found] ` <1416855906-13931-1-git-send-email-tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2014-11-24 19:04   ` [PATCH 1/8] usb: musb: Add function pointers for IO access functions Tony Lindgren
2014-11-24 19:05   ` [PATCH 4/8] usb: musb: Change to use new IO access Tony Lindgren
2014-11-24 19:12     ` Felipe Balbi
2014-11-24 19:26       ` Tony Lindgren
     [not found]     ` <1416855906-13931-5-git-send-email-tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2014-11-25  9:46       ` Linus Walleij
2014-11-24 19:05   ` [PATCH 5/8] usb: musb: Change end point selection " Tony Lindgren
2014-11-24 23:38     ` Apelete Seketeli
2014-11-24 23:52       ` Tony Lindgren
2014-11-25 15:02         ` Lars-Peter Clausen
2014-11-28 13:50     ` Linus Walleij
2014-11-24 19:05   ` [PATCH 6/8] usb: musb: Pass fifo_mode in platform data Tony Lindgren
2014-11-24 23:40     ` Apelete Seketeli
2014-11-28 13:40     ` Linus Walleij
2014-11-24 19:05   ` [PATCH 7/8] usb: musb: Allow multiple glue layers to be built in Tony Lindgren
2014-11-24 19:05 ` [PATCH 8/8] usb: musb: Use IS_ENABLED for tusb6010 Tony Lindgren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1416855906-13931-4-git-send-email-tony@atomide.com \
    --to=tony@atomide.com \
    --cc=balbi@ti.com \
    --cc=cooloney@gmail.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).