summaryrefslogtreecommitdiffstats
path: root/drivers/usb/musb-new
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2015-06-17 15:49:26 +0200
committerHans de Goede <hdegoede@redhat.com>2015-07-25 11:22:55 +0200
commitd42faf3198262710d17548950e1ab41413e8b7f9 (patch)
treec97b569101cd05beb88aadfc1bf3dc2192e6703c /drivers/usb/musb-new
parent71cbe0d681d4288d090a404273ce6b0c1c14b617 (diff)
downloadtalos-obmc-uboot-d42faf3198262710d17548950e1ab41413e8b7f9.tar.gz
talos-obmc-uboot-d42faf3198262710d17548950e1ab41413e8b7f9.zip
sunxi: musb: Move musb config and platdata to the sunxi-musb glue
Move the musb config and platdata to the sunxi-musb glue, which is where it really belongs. This is preparation patch for adding device-model support for the sunxi-musb-host code. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Ian Campbell <ijc@hellion.org.uk>
Diffstat (limited to 'drivers/usb/musb-new')
-rw-r--r--drivers/usb/musb-new/sunxi.c35
1 files changed, 25 insertions, 10 deletions
diff --git a/drivers/usb/musb-new/sunxi.c b/drivers/usb/musb-new/sunxi.c
index cafb48039e..cbd2954c41 100644
--- a/drivers/usb/musb-new/sunxi.c
+++ b/drivers/usb/musb-new/sunxi.c
@@ -26,17 +26,9 @@
#include <asm/arch/gpio.h>
#include <asm/arch/usb_phy.h>
#include <asm-generic/gpio.h>
+#include <linux/usb/musb.h>
#include "linux-compat.h"
#include "musb_core.h"
-#ifdef CONFIG_AXP152_POWER
-#include <axp152.h>
-#endif
-#ifdef CONFIG_AXP209_POWER
-#include <axp209.h>
-#endif
-#ifdef CONFIG_AXP221_POWER
-#include <axp221.h>
-#endif
/******************************************************************************
******************************************************************************
@@ -277,8 +269,31 @@ static int sunxi_musb_init(struct musb *musb)
return 0;
}
-const struct musb_platform_ops sunxi_musb_ops = {
+static const struct musb_platform_ops sunxi_musb_ops = {
.init = sunxi_musb_init,
.enable = sunxi_musb_enable,
.disable = sunxi_musb_disable,
};
+
+static struct musb_hdrc_config musb_config = {
+ .multipoint = 1,
+ .dyn_fifo = 1,
+ .num_eps = 6,
+ .ram_bits = 11,
+};
+
+static struct musb_hdrc_platform_data musb_plat = {
+#if defined(CONFIG_MUSB_HOST)
+ .mode = MUSB_HOST,
+#else
+ .mode = MUSB_PERIPHERAL,
+#endif
+ .config = &musb_config,
+ .power = 250,
+ .platform_ops = &sunxi_musb_ops,
+};
+
+void sunxi_musb_board_init(void)
+{
+ musb_register(&musb_plat, NULL, (void *)SUNXI_USB0_BASE);
+}
OpenPOWER on IntegriCloud