From: peter.chen@freescale.com (Peter Chen)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/2] arm: mach-imx: anatop: add two APIs for USB driver
Date: Wed, 14 Aug 2013 11:50:07 +0800 [thread overview]
Message-ID: <20130814035005.GA30404@shlinux1.ap.freescale.net> (raw)
In-Reply-To: <20130814034754.GD16915@S2101-09.ap.freescale.net>
On Wed, Aug 14, 2013 at 11:47:56AM +0800, Shawn Guo wrote:
> On Mon, Aug 12, 2013 at 03:26:54PM +0800, Peter Chen wrote:
> > imx_anatop_usb1_disconnect_line is used to disconnect dp/dm between
> > PHY and controller, after that, the controller always gets SE0
> > for the status of dp/dm, it is not any wakeup signal for controller.
> > It is used to avoid unknown interrupt due to dp/dm is floading
> > after the USB PHY is no powered when there is no vbus supplied.
> >
> > imx_anatop_set_stop_mode_config is used to keep internal regualtor on
> > when the system enters suspend mode, it will increase power consumption,
> > we only enable it when the user enables USB wakeup (default is off).
> >
> > Signed-off-by: Peter Chen <peter.chen@freescale.com>
> > ---
> > arch/arm/mach-imx/anatop.c | 22 ++++++++++++++++++++++
> > arch/arm/mach-imx/common.h | 2 ++
> > 2 files changed, 24 insertions(+), 0 deletions(-)
> >
> > diff --git a/arch/arm/mach-imx/anatop.c b/arch/arm/mach-imx/anatop.c
> > index 71f1a08..7f96bbc 100644
> > --- a/arch/arm/mach-imx/anatop.c
> > +++ b/arch/arm/mach-imx/anatop.c
> > @@ -26,6 +26,7 @@
> > #define ANADIG_ANA_MISC0 0x150
> > #define ANADIG_ANA_MISC2 0x170
> > #define ANADIG_USB1_CHRG_DETECT 0x1b0
> > +#define ANADIG_USB1_LOOPBACK 0x1e0
> > #define ANADIG_USB2_CHRG_DETECT 0x210
> > #define ANADIG_DIGPROG 0x260
> >
> > @@ -34,6 +35,8 @@
> > #define BM_ANADIG_ANA_MISC0_STOP_MODE_CONFIG 0x1000
> > #define BM_ANADIG_USB_CHRG_DETECT_CHK_CHRG_B 0x80000
> > #define BM_ANADIG_USB_CHRG_DETECT_EN_B 0x100000
> > +#define BM_ANADIG_USB1_LOOPBACK_UTMI_DIG_TST1 0x00000004
> > +#define BM_ANADIG_USB1_LOOPBACK_TSTI_TX_EN 0x00000020
> >
> > #define ANADIG_ANA_MISC2_REG1_STEP_OFFSET 26
> > #define ANADIG_ANA_MISC2_REG_STEP_MASK 0x3
> > @@ -142,6 +145,25 @@ u32 imx_anatop_get_digprog(void)
> > return digprog;
> > }
> >
> > +void imx_anatop_usb1_disconnect_line(bool enable)
> > +{
> > + if (enable)
> > + regmap_write(anatop, ANADIG_USB1_LOOPBACK,
> > + BM_ANADIG_USB1_LOOPBACK_UTMI_DIG_TST1 |
> > + BM_ANADIG_USB1_LOOPBACK_TSTI_TX_EN);
> > + else
> > + regmap_write(anatop, ANADIG_USB1_LOOPBACK, 0);
> > +}
> > +EXPORT_SYMBOL(imx_anatop_usb1_disconnect_line);
> > +
> > +void imx_anatop_set_stop_mode_config(bool enable)
> > +{
> > + regmap_write(anatop, ANADIG_ANA_MISC0 +
> > + (enable ? REG_SET : REG_CLR),
> > + BM_ANADIG_ANA_MISC0_STOP_MODE_CONFIG);
> > +}
> > +EXPORT_SYMBOL(imx_anatop_set_stop_mode_config);
> > +
>
> Where do you want to call these two functions from?
>
>From USB driver, the usb driver is possible built as module.
--
Best Regards,
Peter Chen
next prev parent reply other threads:[~2013-08-14 3:50 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-12 7:26 [PATCH 1/2] arm: mach-imx: Move anatop related from board file to anatop driver Peter Chen
2013-08-12 7:26 ` [PATCH 2/2] arm: mach-imx: anatop: add two APIs for USB driver Peter Chen
2013-08-14 3:47 ` Shawn Guo
2013-08-14 3:50 ` Peter Chen [this message]
2013-08-14 6:32 ` Shawn Guo
2013-08-14 4:51 ` Peter Chen
2013-08-14 3:46 ` [PATCH 1/2] arm: mach-imx: Move anatop related from board file to anatop driver Shawn Guo
2013-08-14 3:53 ` Peter Chen
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=20130814035005.GA30404@shlinux1.ap.freescale.net \
--to=peter.chen@freescale.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).