History log of /linux-master/drivers/usb/phy/phy-ab8500-usb.c
Revision Date Author Comments
# fe70f2c8 19-Mar-2023 Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

usb: phy: ab8500: Convert to platform remove callback returning void

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20230319092428.283054-2-u.kleine-koenig@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 897b8138 08-Sep-2020 Randy Dunlap <rdunlap@infradead.org>

usb: phy: phy-ab8500-usb: fix spello of "function"

Fix typo/spello of "function".

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Felipe Balbi <balbi@kernel.org>
Cc: linux-usb@vger.kernel.org
Cc: Jiri Kosina <trivial@kernel.org>
Signed-off-by: Felipe Balbi <balbi@kernel.org>


# f5f875b5 08-Sep-2020 Randy Dunlap <rdunlap@infradead.org>

usb: phy: phy-ab8500-usb: fix spello of "function"

Fix typo/spello of "function".

Cc: Felipe Balbi <balbi@kernel.org>
Cc: Jiri Kosina <trivial@kernel.org>
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Link: https://lore.kernel.org/r/1be7e71f-6b79-290a-f38e-b51ccaf85e8e@infradead.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 4e71e079 07-Jul-2020 Gustavo A. R. Silva <gustavoars@kernel.org>

usb: phy: Use fallthrough pseudo-keyword

Replace the existing /* fall through */ comments and its variants with
the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary
fall-through markings when it is the case.

[1] https://www.kernel.org/doc/html/latest/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through

Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Link: https://lore.kernel.org/r/20200707200040.GA4525@embeddedor
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# c4a68b4d 18-Dec-2019 Stephan Gerhold <stephan@gerhold.net>

usb: phy: ab8500-usb: Keep PHY turned on in UART mode

AB8505 supports an "UART carkit mode" which makes UART accessible
through the USB connector. Upon detection of the UART cable,
this mode has to be manually enabled by:

1. Turning on the PHY in peripheral mode
2. Reconfiguring PHY/pins to route UART signals to USB pins

At the moment, we do not handle the UART link statuses at all,
which means that UART stops working as soon as phy-ab8500-usb is loaded
(since we disable the PHY after initialization).

Keeping UART working if the cable is inserted before turning on the device
is quite simple: In this case, early boot firmware has already set up
the necessary PHY/pin configuration. The presence of the UART cable
is reported by a special value in the USB link status register.

We can check for that value in ab8505_usb_link_status_update()
and set the PHY back to peripheral mode to restore UART.
(Note: This will result in some minor garbage since we still
temporarily disable the PHY during initialization...)

Fully implementing this feature is more complicated:
For some reason, AB8505 does not update UART link status after bootup.
Regular USB cables work fine, but the link status register does not change
its state if an UART cable is inserted/removed.

It seems likely that the hardware is not actually capable of detecting
UART cables autonomously. In addition to the USB link status register,
implementations in the vendor kernel also manually measure
the ID resistance to detect additional cable types. For UART cables,
the USB link status register might simply reflect the PHY configuration
instead of the actual link status.

Implementing that functionality requires significant additions,
so for now just implement the simple case. This allows using UART
when inserting the cable before turning on the device.

Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20191218203450.71037-1-stephan@gerhold.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# b33f3706 30-Jul-2019 Stephen Boyd <swboyd@chromium.org>

usb: Remove dev_err() usage after platform_get_irq()

We don't need dev_err() messages when platform_get_irq() fails now that
platform_get_irq() prints an error message itself when something goes
wrong. Let's remove these prints with a simple semantic patch.

// <smpl>
@@
expression ret;
struct platform_device *E;
@@

ret =
(
platform_get_irq(E, ...)
|
platform_get_irq_byname(E, ...)
);

if ( \( ret < 0 \| ret <= 0 \) )
{
(
-if (ret != -EPROBE_DEFER)
-{ ...
-dev_err(...);
-... }
|
...
-dev_err(...);
)
...
}
// </smpl>

While we're here, remove braces on if statements that only have one
statement (manually).

Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Link: https://lore.kernel.org/r/20190730181557.90391-47-swboyd@chromium.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# dcf8f7ec 28-Jul-2019 Gustavo A. R. Silva <gustavo@embeddedor.com>

usb: phy: ab8500-usb: Mark expected switch fall-throughs

Mark switch cases where we are expecting to fall through.

This patch fixes the following warnings:

drivers/usb/phy/phy-ab8500-usb.c: In function 'ab8500_usb_link_status_update':
drivers/usb/phy/phy-ab8500-usb.c:424:9: warning: this statement may fall through [-Wimplicit-fallthrough=]
event = UX500_MUSB_RIDB;
~~~~~~^~~~~~~~~~~~~~~~~
drivers/usb/phy/phy-ab8500-usb.c:425:2: note: here
case USB_LINK_NOT_CONFIGURED_8500:
^~~~
drivers/usb/phy/phy-ab8500-usb.c:440:9: warning: this statement may fall through [-Wimplicit-fallthrough=]
event = UX500_MUSB_RIDC;
~~~~~~^~~~~~~~~~~~~~~~~
drivers/usb/phy/phy-ab8500-usb.c:441:2: note: here
case USB_LINK_STD_HOST_NC_8500:
^~~~
drivers/usb/phy/phy-ab8500-usb.c:459:9: warning: this statement may fall through [-Wimplicit-fallthrough=]
event = UX500_MUSB_RIDA;
~~~~~~^~~~~~~~~~~~~~~~~
drivers/usb/phy/phy-ab8500-usb.c:460:2: note: here
case USB_LINK_HM_IDGND_8500:
^~~~
drivers/usb/phy/phy-ab8500-usb.c: In function 'ab8505_usb_link_status_update':
drivers/usb/phy/phy-ab8500-usb.c:332:9: warning: this statement may fall through [-Wimplicit-fallthrough=]
event = UX500_MUSB_RIDB;
~~~~~~^~~~~~~~~~~~~~~~~
drivers/usb/phy/phy-ab8500-usb.c:333:2: note: here
case USB_LINK_NOT_CONFIGURED_8505:
^~~~
drivers/usb/phy/phy-ab8500-usb.c:352:9: warning: this statement may fall through [-Wimplicit-fallthrough=]
event = UX500_MUSB_RIDC;
~~~~~~^~~~~~~~~~~~~~~~~
drivers/usb/phy/phy-ab8500-usb.c:353:2: note: here
case USB_LINK_STD_HOST_NC_8505:
^~~~
drivers/usb/phy/phy-ab8500-usb.c:370:9: warning: this statement may fall through [-Wimplicit-fallthrough=]
event = UX500_MUSB_RIDA;
~~~~~~^~~~~~~~~~~~~~~~~
drivers/usb/phy/phy-ab8500-usb.c:371:2: note: here
case USB_LINK_HM_IDGND_8505:
^~~~

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20190729000631.GA24165@embeddedor
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# b8d9ee24 18-Oct-2018 Dan Carpenter <dan.carpenter@oracle.com>

usb: phy: ab8500: silence some uninitialized variable warnings

Smatch complains that "reg" can be uninitialized if the
abx500_get_register_interruptible() call fails. It's an interruptable
function, so we should check if the user presses CTRL-C.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 3864e945 22-Mar-2018 Linus Walleij <linus.walleij@linaro.org>

usb: phy: ab8500: Drop AB8540/9540 support

The AB8540 was an evolved version of the AB8500, but it was never
mass produced or put into products, only reference designs exist.
The upstream support was never completed and it is unlikely that
this will happen so drop the support for now to simplify
maintenance of the AB8500.

Cc: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 2f710c1b 22-Mar-2018 Linus Walleij <linus.walleij@linaro.org>

usb: phy: ab8500: Drop AB8540/9540 support

The AB8540 was an evolved version of the AB8500, but it was never
mass produced or put into products, only reference designs exist.
The upstream support was never completed and it is unlikely that
this will happen so drop the support for now to simplify
maintenance of the AB8500.

Cc: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>


# 6eb5ac2e 11-Feb-2018 Stefan Agner <stefan@agner.ch>

usb: phy: ab8500: use correct enum type

The local variable event is of type enum usb_phy_events. Use
the same enum value USB_EVENT_NONE instead of UX500_MUSB_NONE.

This avoids a warning when building with clang:
drivers/usb/phy/phy-ab8500-usb.c:906:30: warning: implicit conversion from
enumeration type 'enum ux500_musb_vbus_id_status' to different enumeration
type 'enum usb_phy_events' [-Wenum-conversion]
enum usb_phy_events event = UX500_MUSB_NONE;
~~~~~ ^~~~~~~~~~~~~~~

Signed-off-by: Stefan Agner <stefan@agner.ch>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>


# fb3967b9 06-Nov-2017 Greg Kroah-Hartman <gregkh@linuxfoundation.org>

USB: phy: Remove redundant license text

Now that the SPDX tag is in all USB files, that identifies the license
in a specific and legally-defined manner. So the extra GPL text wording
can be removed as it is no longer needed at all.

This is done on a quest to remove the 700+ different ways that files in
the kernel describe the GPL license text. And there's unneeded stuff
like the address (sometimes incorrect) for the FSF which is never
needed.

No copyright headers or other non-license-description text was removed.

Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Jonathan Hunter <jonathanh@nvidia.com>
Acked-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 5fd54ace 03-Nov-2017 Greg Kroah-Hartman <gregkh@linuxfoundation.org>

USB: add SPDX identifiers to all remaining files in drivers/usb/

It's good to have SPDX identifiers in all files to make it easier to
audit the kernel tree for correct licenses.

Update the drivers/usb/ and include/linux/usb* files with the correct
SPDX license identifier based on the license text in the file itself.
The SPDX identifier is a legally binding shorthand, which can be used
instead of the full boiler plate text.

This work is based on a script and data from Thomas Gleixner, Philippe
Ombredanne, and Kate Stewart.

Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Kate Stewart <kstewart@linuxfoundation.org>
Cc: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Acked-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# df2c0cc1 25-Jan-2017 Arnd Bergmann <arnd@arndb.de>

usb: phy: ab8500: remove unused ab8500_eyediagram_workaroud()

The only caller of this function is gone, so now we get a warning:

drivers/usb/phy/phy-ab8500-usb.c:1026:17: error: 'ab8500_eyediagram_workaroud' defined but not used [-Werror=unused-function]

It is possible that we should in fact still call the function from
somewhere else, but I don't see from where.

Fixes: 635f997a499b ("usb: phy: ab8500: Remove the set_power callback")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>


# 788c8abb 18-Jan-2017 Baolin Wang <baolin.wang@linaro.org>

usb: phy: ab8500: Remove the set_power callback

There are no users will use the vbus_draw variable set by set_power()
callback to set the vbus current. Thus we can remove it.

Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>


# 7eee236c 27-Aug-2016 Colin Ian King <colin.king@canonical.com>

usb: phy: ab8500-usb: fix spelling mistake "regester" -> "register"

Trivial fix to spelling mistakes in dev_err messages.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>


# 2b129789 22-May-2015 Fabio Estevam <fabio.estevam@freescale.com>

usb: phy: ab8500-usb: Pass the IRQF_ONESHOT flag

Since commit 1c6c69525b40 ("genirq: Reject bogus threaded irq requests")
threaded IRQs without a primary handler need to be requested with
IRQF_ONESHOT, otherwise the request will fail.

So pass the IRQF_ONESHOT flag in this case.

The semantic patch that makes this change is available
in scripts/coccinelle/misc/irqf_oneshot.cocci.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>


# 1cb39e25 01-May-2015 Krzysztof Kozlowski <krzk@kernel.org>

usb: phy-ab8500-usb: Constify platform_device_id

The platform_device_id is not modified by the driver and core uses it as
const.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski.k@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 25e97ab5 01-May-2015 Krzysztof Kozlowski <krzk@kernel.org>

usb: phy-ab8500-usb: Constify platform_device_id

The platform_device_id is not modified by the driver and core uses it as
const.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski.k@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>


# 2b08977b 08-Mar-2015 Mickael Maison <mickael.maison@gmail.com>

usb: phy: ab8500: fixed comment typo

Fixed a comment typo in drivers/usb/phy/phy-ab8500-usb.c

Signed-off-by: Mickael Maison <mickael.maison@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>


# 1d61a694 11-Feb-2015 Bjorn Andersson <bjorn.andersson@sonymobile.com>

usb: phy: ab8500-usb: Rename regulator_set_optimum_mode

The function regulator_set_optimum_mode() is changing name to
regulator_set_load(), so update the code accordingly.

Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
Acked-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# b20f3f9e 24-Nov-2014 Kiran Raparthy <kiran.kumar@linaro.org>

usb: phy: Handle per-PHY event for connnect and disconnect events

When usb is connected and enumerated in device mode or when
usb is disconnected, call usb_phy_set_event() from phy drivers
to handle per-PHY event.

[ toddpoynor@google.com : Original patch in Android ]

Cc: Felipe Balbi <balbi@ti.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-kernel@vger.kernel.org
Cc: linux-usb@vger.kernel.org
Cc: Android Kernel Team <kernel-team@android.com>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: Arve Hjønnevåg <arve@android.com>
Cc: Benoit Goby <benoit@android.com>
Cc: Todd Poynor <toddpoynor@google.com>
Signed-off-by: Kiran Raparthy <kiran.kumar@linaro.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>


# 79018420 09-Oct-2014 Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

usb: phy: remove file names from heading comments

File names in the heading comments fell out of favor long ago, and these weren't
even changed when the drivers were moved from drivers/usb/otg/, so remove them
at last...

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>


# 19c1eac2 30-Oct-2014 Antoine Tenart <atenart@kernel.org>

usb: rename phy to usb_phy in OTG

This patch prepares the introduction of the generic PHY support in the
USB OTG common functions. The USB PHY member of the OTG structure is
renamed to 'usb_phy' and modifications are done in all drivers accessing
it. Renaming this pointer will allow to keep the compatibility for USB
PHY drivers.

Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>


# e47d9254 30-Oct-2014 Antoine Tenart <atenart@kernel.org>

usb: move the OTG state from the USB PHY to the OTG structure

Before using the PHY framework instead of the USB PHY one, we need to
move the OTG state into another place, since it won't be available when
USB PHY isn't used. This patch moves the OTG state into the OTG
structure, and makes all the needed modifications in the drivers
using the OTG state.

[ balbi@ti.com : fix build regressions with phy-tahvo.c, musb_dsps.c,
phy-isp1301-omap, and chipidea's debug.c ]

Acked-by: Kishon Vijay Abraham I <kishon@ti.com>
Acked-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>


# a25f10c2 20-Oct-2014 Wolfram Sang <wsa@kernel.org>

usb: phy: drop owner assignment from platform_drivers

A platform_driver does not need to set an owner, it will be populated by the
driver core.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>


# 31e32227 10-Dec-2013 Neil Zhang <zhangwm@marvell.com>

usb: phy: initialize the notifier when add a new phy

We need to initialize the notifer before use it.

So lets initialize it when add a new phy device to
reduce the code redundancy.

Signed-off-by: Neil Zhang <zhangwm@marvell.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>


# f85bff5d 15-May-2013 Fabio Baltieri <fabio.baltieri@linaro.org>

usb: phy: ab8500-usb: add ab9540 support

Add support for the ab9540 variant of the ab8500 family.

Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Maxime Coquelin <maxime.coquelin@st.com>
Cc: Avinash Kumar <avinash.kumar@stericsson.com>
Cc: Thirupathi Chippakurthy <thirupathi.chippakurthy@stericsson.com>
Signed-off-by: Fabio Baltieri <fabio.baltieri@linaro.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>


# 0c380c0e 15-May-2013 Fabio Baltieri <fabio.baltieri@linaro.org>

usb: phy: ab8500-usb: add ab8540 support

Add support for the ab8540 variant of the ab8500 family.

Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Maxime Coquelin <maxime.coquelin@st.com>
Cc: Avinash Kumar <avinash.kumar@stericsson.com>
Signed-off-by: Fabio Baltieri <fabio.baltieri@linaro.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>


# bd4c9f02 15-May-2013 Fabio Baltieri <fabio.baltieri@linaro.org>

usb: phy: ab8500-usb: add flag bits to control driver features

Introduce a "flags" field in "struct ab8500_usb" to allow controlling
driver features and quirks depending on ab8500 chip variant and
revision.

Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Maxime Coquelin <maxime.coquelin@st.com>
Signed-off-by: Fabio Baltieri <fabio.baltieri@linaro.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>


# 16604a3c 15-May-2013 Fabio Baltieri <fabio.baltieri@linaro.org>

usb: phy: ab8500-usb: move phy tuning values on separate functions

Move each chip's PHY tuning value set code to a separate function to
improve code readability.

Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Maxime Coquelin <maxime.coquelin@st.com>
Signed-off-by: Fabio Baltieri <fabio.baltieri@linaro.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>


# b3affc39 15-May-2013 Fabio Baltieri <fabio.baltieri@linaro.org>

usb: phy: ab8500-usb: add platform_device_id table

Add an initial platform_device_id table to the ab8500-usb driver to
allow probing additional variants of the ab8500 family chips.

Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Maxime Coquelin <maxime.coquelin@st.com>
Signed-off-by: Fabio Baltieri <fabio.baltieri@linaro.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>


# a96afc6b 15-May-2013 Fabio Baltieri <fabio.baltieri@linaro.org>

usb: phy: ab8500-usb: fix phy tuning value select logic

The driver supports both ab8500 and ab8505, but the actual phy tuning
values logic sets ab8500 values:

if (!is_ab8500_2p0_or_earlier(ab->ab8500))

which is supposed to set values for ab8500, but incorrectly results true
for ab8505 too.

Fix this by adding an additional is_ab8500(ab->ab8500) check.

Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Maxime Coquelin <maxime.coquelin@st.com>
Signed-off-by: Fabio Baltieri <fabio.baltieri@linaro.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>


# fb21f37a 15-May-2013 Sakethram Bommisetti <sakethram.bommisetti@stericsson.com>

usb: phy: ab8500-usb: restart phy during probe

Add an ab8500_usb_restart_phy() function called during probe to ensure
that the AB8500 USB phy is initialized properly even when a cable is
connected at probe time.

Without this fix subsequent host reconnections are not detected
properly.

Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Maxime Coquelin <maxime.coquelin@st.com>
Signed-off-by: Sakethram Bommisetti <sakethram.bommisetti@stericsson.com>
Signed-off-by: Fabio Baltieri <fabio.baltieri@linaro.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>


# d0ed0645 15-May-2013 Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com>

usb: phy: ab8500-usb: add transceiver clock control

Add common clock support code for the ab8500-usb phy driver.

Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Maxime Coquelin <maxime.coquelin@st.com>
Signed-off-by: Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com>
Signed-off-by: Fabio Baltieri <fabio.baltieri@linaro.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>


# 3147dad6 15-May-2013 Fabio Baltieri <fabio.baltieri@linaro.org>

usb: musb: various cosmetic fixes on ux500 files

Various non functional coding style fixes on ux500_dma.c and
phy-ab8500-usb.c drivers.

Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Maxime Coquelin <maxime.coquelin@st.com>
Signed-off-by: Fabio Baltieri <fabio.baltieri@linaro.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>


# c8a0b5c6 06-May-2013 Sachin Kamat <sachin.kamat@linaro.org>

usb: phy: ab8500-usb: Remove redundant platform_set_drvdata()

Commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) removes the need to set driver data field to
NULL.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>


# 88b1c78d 03-Apr-2013 Fabio Baltieri <fabio.baltieri@linaro.org>

usb: phy: ab8500-usb: check regulator_enable return value

Since regulator_enable() is going to be marked as __must_check in the
next merge window, always check regulator_enable() return value and
print a warning if it fails.

Cc: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Fabio Baltieri <fabio.baltieri@linaro.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>


# 58823373 03-Apr-2013 Sakethram Bommisetti <sakethram.bommisetti@stericsson.com>

usb: phy: ab8500-usb: call phy_dis_work only when necessary

Modify ab8500_usb_set_peripheral() and ab8500_usb_set_host() code to
schedule phy_dis_work only when necessary in order to prevent regulator
count mismatch during reboot/shutdown.

Signed-off-by: Sakethram Bommisetti <sakethram.bommisetti@stericsson.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Fabio Baltieri <fabio.baltieri@linaro.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>


# 8db12231 03-Apr-2013 Sakethram Bommisetti <sakethram.bommisetti@stericsson.com>

usb: phy: ab8500-usb: drop link status delayed work

ab8500_usb_delayed_work was implemented as a workaroud for the internal
only and now unsupported v1.0 version of AB850. This patch removes the
delayed work and just leave a link status update call at probe time.

Signed-off-by: Sakethram Bommisetti <sakethram.bommisetti@stericsson.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Fabio Baltieri <fabio.baltieri@linaro.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>


# 899f0f56 03-Apr-2013 Patrice Chotard <patrice.chotard@st.com>

usb: phy: ab8500-usb: adopt pinctrl support

Amend the ab8500-usb driver to optionally take a pin control handle and
set the state of the pins to "default" on ab8500_usb_phy_enable and to
"sleep" on ab8500_usb_phy_disable.

The pinctrl handle is released on ab8500_usb_phy_disable because USB
pins are shared with ab8505_micro_usb_iddet driver.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Fabio Baltieri <fabio.baltieri@linaro.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>


# 77f4396e 03-Apr-2013 Fabio Baltieri <fabio.baltieri@linaro.org>

usb: phy: ab8500-usb: fix last notifier arguments

Fix last ab->phy.notifier call to use vbus_draw as notifier argument, as
that's used in ab8500_charger to control charging current.

Also drop a related TODO comment, and the additional
ux500_musb_set_vbus(musb, 0), as with this patch it was causing an
erratic behaviour of gadget ep0 state machine.

Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Fabio Baltieri <fabio.baltieri@linaro.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>


# f5ef7b42 03-Apr-2013 Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com>

usb: phy: ab8500-usb: fix unbalanced clock and regulator disable warnings

To prevent clock and regulator frameworks from complaining, only disable
the host or peripheral phy if they were enabled.

Reported-by: Sakethram Bommisetti <sakethram.bommisetti@stericsson.com>
Signed-off-by: Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Fabio Baltieri <fabio.baltieri@linaro.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>


# 54dfbb08 03-Apr-2013 Fabio Baltieri <fabio.baltieri@linaro.org>

usb: phy: ab8500-usb: enable/disable regulator on phy events

Add ab8500_usb_regulator_{enable,disable} functions to control USB phy
regulators on corresponding ab8500_usb_phy_{enable,disable} events.

This contains some workaround and optimization for specific AB8500
versions.

Signed-off-by: Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com>
Signed-off-by: Sakethram Bommisetti <sakethram.bommisetti@stericsson.com>
Signed-off-by: Praveena Nadahally <praveen.nadahally@stericsson.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Fabio Baltieri <fabio.baltieri@linaro.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>


# c0ea7064 03-Apr-2013 Fabio Baltieri <fabio.baltieri@linaro.org>

usb: phy: ab8500-usb: split ab8500_usb_phy_ctrl

Split ab8500_usb_phy_ctrl into separate enable/disable functions to make
the code more linear and readable.

Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Fabio Baltieri <fabio.baltieri@linaro.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>


# e65b36c0 03-Apr-2013 Fabio Baltieri <fabio.baltieri@linaro.org>

usb: phy: ab8500-usb: add regulator support

Add initial regulator support to ab8500-usb by introducing necessary
devm_regulator_get().

Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Fabio Baltieri <fabio.baltieri@linaro.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>


# c2a0ab6b 03-Apr-2013 Sakethram Bommisetti <sakethram.bommisetti@stericsson.com>

usb: phy: ab8500-usb: fix eye diagram for ab8500 v2.0

AB8500 v2.0 has eye diagram issues when drawing more than 100mA from
VBUS. Force charging current to 100mA in case of standard host.

Signed-off-by: Sakethram Bommisetti <sakethram.bommisetti@stericsson.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Fabio Baltieri <fabio.baltieri@linaro.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>


# 7124631a 03-Apr-2013 Sakethram Bommisetti <sakethram.bommisetti@stericsson.com>

usb: phy: ab8500-usb: set phy tuning values

Set phy tuning values proposed by the hardware teams for AB8500 and
AB8505 to improve USB eye diagram performances.

Signed-off-by: Sakethram Bommisetti <sakethram.bommisetti@stericsson.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Fabio Baltieri <fabio.baltieri@linaro.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>


# 81ef6724 03-Apr-2013 Fabio Baltieri <fabio.baltieri@linaro.org>

usb: phy: ab8500-usb: convert to devm_kzalloc

Convert local data allocation to devm_kzalloc and drop unnecessary fail
path code.

Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Fabio Baltieri <fabio.baltieri@linaro.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>


# af6882be 07-Mar-2013 Fabio Baltieri <fabio.baltieri@linaro.org>

usb: phy: ab8500-usb: update irq handling code

Update irq handling code to notify all possible link status changes of
AB8500 and AB8505 to the ux500-musb glue driver. The additional event
codes will be used for pm-runtime implementation, and are defined in a
separate ux500-specific header.

This also modify the irq registration code to use devm_* helpers and
drop all non necessary fail path code.

Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Fabio Baltieri <fabio.baltieri@linaro.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>


# 73f226cb 07-Mar-2013 Fabio Baltieri <fabio.baltieri@linaro.org>

usb: otg: ab8500-usb: drop support for ab8500 pre v2.0

AB8500 versions preceding 2.0 were only used internally by ST-Ericsson
and are not supported anymore. This patch drops all v1.0 and v1.1
support code.

Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Fabio Baltieri <fabio.baltieri@linaro.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>


# 94ae9843 07-Mar-2013 Felipe Balbi <balbi@ti.com>

usb: phy: rename all phy drivers to phy-$name-usb.c

this will make sure that we have sensible names
for all phy drivers. Current situation was already
quite bad with too generic names being used.

Signed-off-by: Felipe Balbi <balbi@ti.com>