From: balbi@ti.com (Felipe Balbi)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v9 11/12] usb: phy-mxs: Add system suspend/resume API
Date: Tue, 18 Feb 2014 10:50:32 -0600 [thread overview]
Message-ID: <20140218165032.GN9878@saruman.home> (raw)
In-Reply-To: <1388111921-17326-12-git-send-email-peter.chen@freescale.com>
On Fri, Dec 27, 2013 at 10:38:40AM +0800, Peter Chen wrote:
> We need this to keep PHY's power on or off during the system
> suspend mode. If we need to enable USB wakeup, then we
> must keep PHY's power being on during the system suspend mode.
> Otherwise, we need to keep PHY's power being off to save power.
>
> Signed-off-by: Peter Chen <peter.chen@freescale.com>
> ---
> drivers/usb/phy/phy-mxs-usb.c | 61 +++++++++++++++++++++++++++++++++++++++++
> 1 files changed, 61 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/usb/phy/phy-mxs-usb.c b/drivers/usb/phy/phy-mxs-usb.c
> index 96aac05..53b8dad 100644
> --- a/drivers/usb/phy/phy-mxs-usb.c
> +++ b/drivers/usb/phy/phy-mxs-usb.c
> @@ -57,6 +57,10 @@
> #define BM_USBPHY_DEBUG_CLKGATE BIT(30)
>
> /* Anatop Registers */
> +#define ANADIG_ANA_MISC0 0x150
> +#define ANADIG_ANA_MISC0_SET 0x154
> +#define ANADIG_ANA_MISC0_CLR 0x158
> +
> #define ANADIG_USB1_VBUS_DET_STAT 0x1c0
> #define ANADIG_USB2_VBUS_DET_STAT 0x220
>
> @@ -65,6 +69,9 @@
> #define ANADIG_USB2_LOOPBACK_SET 0x244
> #define ANADIG_USB2_LOOPBACK_CLR 0x248
>
> +#define BM_ANADIG_ANA_MISC0_STOP_MODE_CONFIG BIT(12)
> +#define BM_ANADIG_ANA_MISC0_STOP_MODE_CONFIG_SL BIT(11)
> +
> #define BM_ANADIG_USB1_VBUS_DET_STAT_VBUS_VALID BIT(3)
> #define BM_ANADIG_USB2_VBUS_DET_STAT_VBUS_VALID BIT(3)
>
> @@ -134,6 +141,16 @@ struct mxs_phy {
> int port_id;
> };
>
> +static inline bool is_imx6q_phy(struct mxs_phy *mxs_phy)
> +{
> + return mxs_phy->data == &imx6q_phy_data;
> +}
> +
> +static inline bool is_imx6sl_phy(struct mxs_phy *mxs_phy)
> +{
> + return mxs_phy->data == &imx6sl_phy_data;
> +}
> +
> static int mxs_phy_hw_init(struct mxs_phy *mxs_phy)
> {
> int ret;
> @@ -382,6 +399,8 @@ static int mxs_phy_probe(struct platform_device *pdev)
>
> platform_set_drvdata(pdev, mxs_phy);
>
> + device_set_wakeup_capable(&pdev->dev, true);
> +
> ret = usb_add_phy_dev(&mxs_phy->phy);
> if (ret)
> return ret;
> @@ -398,6 +417,47 @@ static int mxs_phy_remove(struct platform_device *pdev)
> return 0;
> }
>
> +#ifdef CONFIG_PM_SLEEP
please use CONFIG_PM instead.
--
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20140218/c6fa3615/attachment.sig>
next prev parent reply other threads:[~2014-02-18 16:50 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-27 2:38 [PATCH v9 00/12] Add power management support for mxs phy Peter Chen
2013-12-27 2:38 ` [PATCH v9 01/12] usb: doc: phy-mxs: Add more compatible strings Peter Chen
2014-02-18 16:49 ` Felipe Balbi
2014-02-19 1:12 ` Shawn Guo
2014-02-19 1:24 ` Felipe Balbi
2014-02-19 0:44 ` Peter Chen
2014-02-19 1:50 ` Shawn Guo
2013-12-27 2:38 ` [PATCH v9 02/12] usb: phy-mxs: Add platform judgement code Peter Chen
2013-12-27 2:38 ` [PATCH v9 03/12] usb: phy-mxs: Add auto clock and power setting Peter Chen
2013-12-27 2:38 ` [PATCH v9 04/12] usb: doc: phy-mxs: update binding for adding anatop phandle Peter Chen
2013-12-27 2:38 ` [PATCH v9 05/12] usb: phy-mxs: Add anatop regmap Peter Chen
2013-12-27 2:38 ` [PATCH v9 06/12] usb: phy-mxs: change description of usb device speed Peter Chen
2013-12-27 2:38 ` [PATCH v9 07/12] usb: phy-mxs: Enable IC fixes for related SoCs Peter Chen
2013-12-27 2:38 ` [PATCH v9 08/12] usb: phy-mxs: add controller id Peter Chen
2013-12-27 2:38 ` [PATCH v9 09/12] usb: phy: Add set_wakeup API Peter Chen
2013-12-27 2:38 ` [PATCH v9 10/12] usb: phy-mxs: Add implementation of set_wakeup Peter Chen
2013-12-27 2:38 ` [PATCH v9 11/12] usb: phy-mxs: Add system suspend/resume API Peter Chen
2014-02-18 16:50 ` Felipe Balbi [this message]
2014-02-19 0:54 ` Peter Chen
2013-12-27 2:38 ` [PATCH v9 12/12] usb: phy-mxs: Add sync time after controller clear phcd Peter Chen
2014-01-20 6:48 ` [PATCH v9 00/12] Add power management support for mxs phy Peter Chen
2014-02-07 5:48 ` 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=20140218165032.GN9878@saruman.home \
--to=balbi@ti.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).