From: hdegoede@redhat.com (Hans de Goede)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/3] msub: sunxi: Add pre/post root reset end platform functions
Date: Sun, 29 Mar 2015 12:50:48 +0200 [thread overview]
Message-ID: <1427626248-6257-4-git-send-email-hdegoede@redhat.com> (raw)
In-Reply-To: <1427626248-6257-1-git-send-email-hdegoede@redhat.com>
Add pre/post root reset end platform functions and make them call
sun4i_usb_phy_set_squelch_detect() to work around the sunxi usb otg phy
workaround.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
drivers/usb/musb/sunxi.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/drivers/usb/musb/sunxi.c b/drivers/usb/musb/sunxi.c
index ef91548..774312f 100644
--- a/drivers/usb/musb/sunxi.c
+++ b/drivers/usb/musb/sunxi.c
@@ -24,6 +24,7 @@
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/of.h>
+#include <linux/phy/phy-sun4i-usb.h>
#include <linux/platform_device.h>
#include <linux/soc/sunxi/sunxi_sram.h>
#include <linux/usb/musb.h>
@@ -147,6 +148,20 @@ static void sunxi_musb_set_vbus(struct musb *musb, int is_on)
schedule_work(&glue->work);
}
+void sunxi_musb_pre_root_reset_end(struct musb *musb)
+{
+ struct sunxi_glue *glue = dev_get_drvdata(musb->controller->parent);
+
+ sun4i_usb_phy_set_squelch_detect(glue->phy, false);
+}
+
+void sunxi_musb_post_root_reset_end(struct musb *musb)
+{
+ struct sunxi_glue *glue = dev_get_drvdata(musb->controller->parent);
+
+ sun4i_usb_phy_set_squelch_detect(glue->phy, true);
+}
+
static irqreturn_t sunxi_musb_interrupt(int irq, void *__hci)
{
struct musb *musb = __hci;
@@ -515,6 +530,8 @@ static const struct musb_platform_ops sunxi_musb_ops = {
.readw = sunxi_musb_readw,
.writew = sunxi_musb_writew,
.set_vbus = sunxi_musb_set_vbus,
+ .pre_root_reset_end = sunxi_musb_pre_root_reset_end,
+ .post_root_reset_end = sunxi_musb_post_root_reset_end,
};
/* Allwinner OTG supports up to 5 endpoints */
--
2.3.4
prev parent reply other threads:[~2015-03-29 10:50 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-29 10:50 [PATCH 0/3] Work around sunxi otg usb phy bug which causes lo-speed devices to not work Hans de Goede
2015-03-29 10:50 ` [PATCH 1/3] phy-sun4i-usb: Add a sunxi specific function for setting squelch-detect Hans de Goede
2015-05-08 16:06 ` Felipe Balbi
2015-05-10 10:02 ` Hans de Goede
2015-05-11 15:55 ` Felipe Balbi
2015-05-11 18:13 ` [linux-sunxi] " Hans de Goede
2015-05-13 9:22 ` Kishon Vijay Abraham I
2015-05-13 9:43 ` Hans de Goede
2015-05-26 15:38 ` Felipe Balbi
2015-05-27 12:09 ` Kishon Vijay Abraham I
2015-03-29 10:50 ` [PATCH 2/3] musb: Add pre and post root port reset end callbacks Hans de Goede
2015-03-29 10:50 ` Hans de Goede [this message]
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=1427626248-6257-4-git-send-email-hdegoede@redhat.com \
--to=hdegoede@redhat.com \
--cc=linux-arm-kernel@lists.infradead.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).