otg-for-v3.10-v2: separate phy code and add DT helper
Subsystems (2)
cover otg-for-v3.10-v2: separate phy code and add DT helper
Hello,
this series depends on the bugfix patch "USB otg: use try_module_get in all usb_get_phy functions and add missing module_put" (a.k.a tags/otg-for-v3.9-v1) posted earlier and is inteded for v3.10. It separates the phy from the otg code and adds DT helper functions. In mxs-phy the {read,write}l_relaxed() functions are replaced by the non _relaxed version to improve compile time coverage. Further mxs-phy makes now use of the new usb_add_phy_dev() function to register it's phy.
regards,
Marc
---
changes since v1:
- fix compile time breakage on non DT platforms (tnx, Alexander)
- convert mxs-phy to non _relaxed {read,write}l_relaxed() functions (as requested by Alexander)
---
The following changes since commit 6bef020b4aebd7886281fb7fb37c788d5a365eea:
USB otg: use try_module_get in all usb_get_phy functions and add missing module_put (2013-02-27 12:53:15 +0100)
are available in the git repository at:
git://git.pengutronix.de/git/mkl/linux.git tags/otg-for-v3.10-v2
for you to fetch changes up to f5678b135967ea98256ee5df9a360b5769861d23:
USB mxs-phy: Register phy with framework (2013-02-28 11:36:45 +0100)
----------------------------------------------------------------
USB otg, phy: separate phy and add DT helper
Move phy related code into separate file and add device tree helper functions.
----------------------------------------------------------------
Marc Kleine-Budde (1):
USB mxs-phy: use readl(), writel() instead of the _relaxed() versions
Michael Grzeschik (1):
USB: add devicetree helpers for determining dr_mode and phy_type
Sascha Hauer (2):
USB: move bulk of otg/otg.c to phy/phy.c
USB mxs-phy: Register phy with framework
drivers/usb/otg/mxs-phy.c | 41 +++-- drivers/usb/otg/otg.c | 427 ------------------------------------------- drivers/usb/phy/Makefile | 2 + drivers/usb/phy/of.c | 47 +++++ drivers/usb/phy/phy.c | 438 +++++++++++++++++++++++++++++++++++++++++++++ drivers/usb/usb-common.c | 37 ++++ include/linux/usb/of.h | 28 +++ include/linux/usb/otg.h | 8 + include/linux/usb/phy.h | 9 + 9 files changed, 594 insertions(+), 443 deletions(-) create mode 100644 drivers/usb/phy/of.c create mode 100644 drivers/usb/phy/phy.c create mode 100644 include/linux/usb/of.h
PATCH 1/4 USB: move bulk of otg/otg.c to phy/phy.c
From: Sascha Hauer <[email protected]>
Most of otg/otg.c is not otg specific, but phy specific, so move it to the phy directory.
--- drivers/usb/otg/otg.c | 427 -------------------------------------------- drivers/usb/phy/Makefile | 1 + drivers/usb/phy/phy.c | 438 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 439 insertions(+), 427 deletions(-) create mode 100644 drivers/usb/phy/phy.c
drivers/usb/otg/otg.c +0 -427
@@ -8,436 +8,9 @@* the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ - -#include <linux/kernel.h> #include <linux/export.h> -#include <linux/err.h> -#include <linux/device.h> -#include <linux/module.h> -#include <linux/slab.h> -#include <linux/of.h> -#include <linux/usb/otg.h> -static LIST_HEAD (phy_list); -static LIST_HEAD (phy_bind_list); -static DEFINE_SPINLOCK (phy_lock); - -static struct usb_phy *__usb_find_phy (struct list_head *list, -enum usb_phy_type type) -{ -struct usb_phy *phy =NULL ; - -list_for_each_entry (phy, list, head) { -if (phy->type != type) -continue ; - -return phy; - } - -return ERR_PTR (-ENODEV ); -} - -static struct usb_phy *__usb_find_phy_dev (struct device *dev, -struct list_head *list,u8 index) -{ -struct usb_phy_bind *phy_bind =NULL ; - -list_for_each_entry (phy_bind, list, list) { -if (!(strcmp (phy_bind->dev_name,dev_name (dev))) && - phy_bind->index == index) { -if (phy_bind->phy) -return phy_bind->phy; -else -return ERR_PTR (-EPROBE_DEFER ); - } - } - -return ERR_PTR (-ENODEV ); -} - -static struct usb_phy *__of_usb_find_phy (struct device_node *node) -{ -struct usb_phy *phy; - -list_for_each_entry (phy, &phy_list, head) { -if (node != phy->dev->of_node) -continue ; - -return phy; - } - -return ERR_PTR (-ENODEV ); -} - -static void devm_usb_phy_release (struct device *dev,void *res) -{ -struct usb_phy *phy = *(struct usb_phy **)res; - -usb_put_phy (phy); -} - -static int devm_usb_phy_match (struct device *dev,void *res,void *match_data) -{ -return res == match_data; -} - -/** -* devm_usb_get_phy - find the USB PHY -* @dev - device that requests this phy -* @type - the type of the phy the controller requires -* -* Gets the phy using usb_get_phy(), and associates a device with it using -* devres. On driver detach, release function is invoked on the devres data, -* then, devres data is freed. -* -* For use by USB host and peripheral drivers. -*/ -struct usb_phy *devm_usb_get_phy (struct device *dev,enum usb_phy_type type) -{ -struct usb_phy **ptr, *phy; - - ptr =devres_alloc (devm_usb_phy_release,sizeof (*ptr),GFP_KERNEL ); -if (!ptr) -return NULL ; - - phy =usb_get_phy (type); -if (!IS_ERR (phy)) { - *ptr = phy; -devres_add (dev, ptr); - }else -devres_free (ptr); - -return phy; -} -EXPORT_SYMBOL (devm_usb_get_phy); - -/** -* usb_get_phy - find the USB PHY -* @type - the type of the phy the controller requires -* -* Returns the phy driver, after getting a refcount to it; or -* -ENODEV if there is no such phy. The caller is responsible for -* calling usb_put_phy() to release that count. -* -* For use by USB host and peripheral drivers. -*/ -struct usb_phy *usb_get_phy (enum usb_phy_type type) -{ -struct usb_phy *phy =NULL ; -unsigned long flags; - -spin_lock_irqsave (&phy_lock, flags); - - phy =__usb_find_phy (&phy_list, type); -if (IS_ERR (phy) || !try_module_get (phy->dev->driver->owner)) { -pr_err ("unable to find transceiver of type %s\n" , -usb_phy_type_string (type)); - goto err0; - } - -get_device (phy->dev); - -err0: -spin_unlock_irqrestore (&phy_lock, flags); - -return phy; -} -EXPORT_SYMBOL (usb_get_phy); - -/** -* devm_usb_get_phy_by_phandle - find the USB PHY by phandle -* @dev - device that requests this phy -* @phandle - name of the property holding the phy phandle value -* @index - the index of the phy -* -* Returns the phy driver associated with the given phandle value, -* after getting a refcount to it, -ENODEV if there is no such phy or -* -EPROBE_DEFER if there is a phandle to the phy, but the device is -* not yet loaded. While at that, it also associates the device with -* the phy using devres. On driver detach, release function is invoked -* on the devres data, then, devres data is freed. -* -* For use by USB host and peripheral drivers. -*/ -struct usb_phy *devm_usb_get_phy_by_phandle (struct device *dev, -const char *phandle,u8 index) -{ -struct usb_phy *phy =ERR_PTR (-ENOMEM ), **ptr; -unsigned long flags; -struct device_node *node; - -if (!dev->of_node) { -dev_dbg (dev,"device does not have a device node entry\n" ); -return ERR_PTR (-EINVAL ); - } - - node =of_parse_phandle (dev->of_node, phandle, index); -if (!node) { -dev_dbg (dev,"failed to get %s phandle in %s node\n" , phandle, - dev->of_node->full_name); -return ERR_PTR (-ENODEV ); - } - - ptr =devres_alloc (devm_usb_phy_release,sizeof (*ptr),GFP_KERNEL ); -if (!ptr) { -dev_dbg (dev,"failed to allocate memory for devres\n" ); - goto err0; - } - -spin_lock_irqsave (&phy_lock, flags); - - phy =__of_usb_find_phy (node); -if (IS_ERR (phy) || !try_module_get (phy->dev->driver->owner)) { - phy =ERR_PTR (-EPROBE_DEFER ); -devres_free (ptr); - goto err1; - } - - *ptr = phy; -devres_add (dev, ptr); - -get_device (phy->dev); - -err1: -spin_unlock_irqrestore (&phy_lock, flags); - -err0: -of_node_put (node); - -return phy; -} -EXPORT_SYMBOL (devm_usb_get_phy_by_phandle); - -/** -* usb_get_phy_dev - find the USB PHY -* @dev - device that requests this phy -* @index - the index of the phy -* -* Returns the phy driver, after getting a refcount to it; or -* -ENODEV if there is no such phy. The caller is responsible for -* calling usb_put_phy() to release that count. -* -* For use by USB host and peripheral drivers. -*/ -struct usb_phy *usb_get_phy_dev (struct device *dev,u8 index) -{ -struct usb_phy *phy =NULL ; -unsigned long flags; - -spin_lock_irqsave (&phy_lock, flags); - - phy =__usb_find_phy_dev (dev, &phy_bind_list, index); -if (IS_ERR (phy) || !try_module_get (phy->dev->driver->owner)) { -pr_err ("unable to find transceiver\n" ); - goto err0; - } - -get_device (phy->dev); - -err0: -spin_unlock_irqrestore (&phy_lock, flags); - -return phy; -} -EXPORT_SYMBOL (usb_get_phy_dev); - -/** -* devm_usb_get_phy_dev - find the USB PHY using device ptr and index -* @dev - device that requests this phy -* @index - the index of the phy -* -* Gets the phy using usb_get_phy_dev(), and associates a device with it using -* devres. On driver detach, release function is invoked on the devres data, -* then, devres data is freed. -* -* For use by USB host and peripheral drivers. -*/ -struct usb_phy *devm_usb_get_phy_dev (struct device *dev,u8 index) -{ -struct usb_phy **ptr, *phy; - - ptr =devres_alloc (devm_usb_phy_release,sizeof (*ptr),GFP_KERNEL ); -if (!ptr) -return NULL ; - - phy =usb_get_phy_dev (dev, index); -if (!IS_ERR (phy)) { - *ptr = phy; -devres_add (dev, ptr); - }else -devres_free (ptr); - -return phy; -} -EXPORT_SYMBOL (devm_usb_get_phy_dev); - -/** -* devm_usb_put_phy - release the USB PHY -* @dev - device that wants to release this phy -* @phy - the phy returned by devm_usb_get_phy() -* -* destroys the devres associated with this phy and invokes usb_put_phy -* to release the phy. -* -* For use by USB host and peripheral drivers. -*/ -void devm_usb_put_phy (struct device *dev,struct usb_phy *phy) -{ -int r; - - r =devres_destroy (dev, devm_usb_phy_release, devm_usb_phy_match, phy); -dev_WARN_ONCE (dev, r,"couldn't find PHY resource\n" ); -} -EXPORT_SYMBOL (devm_usb_put_phy); - -/** -* usb_put_phy - release the USB PHY -* @x: the phy returned by usb_get_phy() -* -* Releases a refcount the caller received from usb_get_phy(). -* -* For use by USB host and peripheral drivers. -*/ -void usb_put_phy (struct usb_phy *x) -{ -if (x) { -struct module *owner = x->dev->driver->owner; - -put_device (x->dev); -module_put (owner); - } -} -EXPORT_SYMBOL (usb_put_phy); - -/** -* usb_add_phy - declare the USB PHY -* @x: the USB phy to be used; or NULL -* @type - the type of this PHY -* -* This call is exclusively for use by phy drivers, which -* coordinate the activities of drivers for host and peripheral -* controllers, and in some cases for VBUS current regulation. -*/ -int usb_add_phy (struct usb_phy *x,enum usb_phy_type type) -{ -int ret =0 ; -unsigned long flags; -struct usb_phy *phy; - -if (x->type !=USB_PHY_TYPE_UNDEFINED ) { -dev_err (x->dev,"not accepting initialized PHY %s\n" , x->label); -return -EINVAL ; - } - -spin_lock_irqsave (&phy_lock, flags); - -list_for_each_entry (phy, &phy_list, head) { -if (phy->type == type) { - ret = -EBUSY ; -dev_err (x->dev,"transceiver type %s already exists\n" , -usb_phy_type_string (type)); - goto out; - } - } - - x->type = type; -list_add_tail (&x->head, &phy_list); - -out: -spin_unlock_irqrestore (&phy_lock, flags); -return ret; -} -EXPORT_SYMBOL (usb_add_phy); - -/** -* usb_add_phy_dev - declare the USB PHY -* @x: the USB phy to be used; or NULL -* -* This call is exclusively for use by phy drivers, which -* coordinate the activities of drivers for host and peripheral -* controllers, and in some cases for VBUS current regulation. -*/ -int usb_add_phy_dev (struct usb_phy *x) -{ -struct usb_phy_bind *phy_bind; -unsigned long flags; - -if (!x->dev) { -dev_err (x->dev,"no device provided for PHY\n" ); -return -EINVAL ; - } - -spin_lock_irqsave (&phy_lock, flags); -list_for_each_entry (phy_bind, &phy_bind_list, list) -if (!(strcmp (phy_bind->phy_dev_name,dev_name (x->dev)))) - phy_bind->phy = x; - -list_add_tail (&x->head, &phy_list); - -spin_unlock_irqrestore (&phy_lock, flags); -return 0 ; -} -EXPORT_SYMBOL (usb_add_phy_dev); - -/** -* usb_remove_phy - remove the OTG PHY -* @x: the USB OTG PHY to be removed; -* -* This reverts the effects of usb_add_phy -*/ -void usb_remove_phy (struct usb_phy *x) -{ -unsigned long flags; -struct usb_phy_bind *phy_bind; - -spin_lock_irqsave (&phy_lock, flags); -if (x) { -list_for_each_entry (phy_bind, &phy_bind_list, list) -if (phy_bind->phy == x) - phy_bind->phy =NULL ; -list_del (&x->head); - } -spin_unlock_irqrestore (&phy_lock, flags); -} -EXPORT_SYMBOL (usb_remove_phy); - -/** -* usb_bind_phy - bind the phy and the controller that uses the phy -* @dev_name: the device name of the device that will bind to the phy -* @index: index to specify the port number -* @phy_dev_name: the device name of the phy -* -* Fills the phy_bind structure with the dev_name and phy_dev_name. This will -* be used when the phy driver registers the phy and when the controller -* requests this phy. -* -* To be used by platform specific initialization code. -*/ -int __init usb_bind_phy (const char *dev_name,u8 index, -const char *phy_dev_name) -{ -struct usb_phy_bind *phy_bind; -unsigned long flags; - - phy_bind =kzalloc (sizeof (*phy_bind),GFP_KERNEL ); -if (!phy_bind) { -pr_err ("phy_bind(): No memory for phy_bind" ); -return -ENOMEM ; - } - - phy_bind->dev_name = dev_name; - phy_bind->phy_dev_name = phy_dev_name; - phy_bind->index = index; - -spin_lock_irqsave (&phy_lock, flags); -list_add_tail (&phy_bind->list, &phy_bind_list); -spin_unlock_irqrestore (&phy_lock, flags); - -return 0 ; -} -EXPORT_SYMBOL_GPL (usb_bind_phy); -const char *otg_state_string (enum usb_otg_state state) {switch (state) {
drivers/usb/phy/Makefile +1 -0
@@ -4,6 +4,7 @@ ccflags-$(CONFIG_USB_DEBUG) := -DDEBUG +obj-$(CONFIG_USB_OTG_UTILS) += phy.o obj-$(CONFIG_OMAP_USB2) += omap-usb2.o obj-$(CONFIG_OMAP_USB3) += omap-usb3.o obj-$(CONFIG_OMAP_CONTROL_USB) += omap-control-usb.o
drivers/usb/phy/phy.c new file +438 -0
438 lines not on this page · raw message
Signature · 1 line
1.7.10.4
PATCH 2/4 USB: add devicetree helpers for determining dr_mode and phy_type
In reply to Marc Kleine-BuddeFrom: Michael Grzeschik <[email protected]>
This adds two little devicetree helper functions for determining the dr_mode (host, peripheral, otg, dual-role) and phy_type (utmi, ulpi,...) from the devicetree.
--- drivers/usb/phy/Makefile | 1 + drivers/usb/phy/of.c | 47 ++++++++++++++++++++++++++++++++++++++++++++++ drivers/usb/usb-common.c | 37 ++++++++++++++++++++++++++++++++++++ include/linux/usb/of.h | 28 +++++++++++++++++++++++++++ include/linux/usb/otg.h | 8 ++++++++ include/linux/usb/phy.h | 9 +++++++++ 6 files changed, 130 insertions(+) create mode 100644 drivers/usb/phy/of.c create mode 100644 include/linux/usb/of.h
drivers/usb/phy/Makefile +1 -0
@@ -5,6 +5,7 @@ ccflags-$(CONFIG_USB_DEBUG) := -DDEBUG obj-$(CONFIG_USB_OTG_UTILS) += phy.o +obj-$(CONFIG_OF) += of.o obj-$(CONFIG_OMAP_USB2) += omap-usb2.o obj-$(CONFIG_OMAP_USB3) += omap-usb3.o obj-$(CONFIG_OMAP_CONTROL_USB) += omap-control-usb.o
drivers/usb/phy/of.c new file +47 -0
47 lines not on this page · raw message
drivers/usb/usb-common.c +37 -0
@@ -14,6 +14,9 @@#include <linux/kernel.h> #include <linux/module.h> #include <linux/usb/ch9.h> +#include <linux/of.h> +#include <linux/usb/of.h> +#include <linux/usb/otg.h> const char *usb_speed_string (enum usb_device_speed speed) {
@@ -32,4 +35,38 @@ const char *usb_speed_string(enum usb_device_speed speed) }EXPORT_SYMBOL_GPL (usb_speed_string); +#ifdef CONFIG_OF +static const char *usb_dr_modes[] = { + [USB_DR_MODE_UNKNOWN ] ="" , + [USB_DR_MODE_HOST ] ="host" , + [USB_DR_MODE_PERIPHERAL ] ="peripheral" , + [USB_DR_MODE_OTG ] ="otg" , + [USB_DR_MODE_DUAL_ROLE ] ="dual-role" , +}; + +/** +* of_usb_get_dr_mode - Get dual role mode for given device_node +* @np: Pointer to the given device_node +* +* The function gets phy interface string from property 'dr_mode', +* and returns the correspondig enum usb_dr_mode +*/ +enum usb_dr_mode of_usb_get_dr_mode (struct device_node *np) +{ +const char *dr_mode; +int err, i; + + err =of_property_read_string (np,"dr_mode" , &dr_mode); +if (err <0 ) +return USB_DR_MODE_UNKNOWN ; + +for (i =0 ; i <ARRAY_SIZE (usb_dr_modes); i++) +if (!strcmp (dr_mode, usb_dr_modes[i])) +return i; + +return USB_DR_MODE_UNKNOWN ; +} +EXPORT_SYMBOL_GPL (of_usb_get_dr_mode); +#endif +MODULE_LICENSE ("GPL" );
include/linux/usb/of.h new file +28 -0
@@ -0,0 +1,28 @@ +/* +* OF helpers for usb devices. +* +* This file is released under the GPLv2 +*/ + +#ifndef __LINUX_USB_OF_H +#define __LINUX_USB_OF_H + +#include <linux/usb/phy.h> +#include <linux/usb/otg.h> + +#ifdef CONFIG_OF +enum usb_phy_interface of_usb_get_phy_mode (struct device_node *np); +enum usb_dr_mode of_usb_get_dr_mode (struct device_node *np); +#else +static inline enum usb_phy_interface of_usb_get_phy_mode (struct device_node *np) +{ +return USBPHY_INTERFACE_MODE_UNKNOWN ; +} + +static inline enum usb_dr_mode of_usb_get_dr_mode (struct device_node *np) +{ +return USB_DR_MODE_UNKNOWN ; +} +#endif + +#endif /* __LINUX_USB_OF_H */
include/linux/usb/otg.h +8 -0
@@ -99,4 +99,12 @@ otg_start_srp(struct usb_otg *otg)/* for OTG controller drivers (and maybe other stuff) */ extern int usb_bus_start_enum (struct usb_bus *bus,unsigned port_num); +enum usb_dr_mode { +USB_DR_MODE_UNKNOWN , +USB_DR_MODE_HOST , +USB_DR_MODE_PERIPHERAL , +USB_DR_MODE_OTG , +USB_DR_MODE_DUAL_ROLE , +}; +#endif /* __LINUX_USB_OTG_H */
include/linux/usb/phy.h +9 -0
@@ -12,6 +12,15 @@#include <linux/notifier.h> #include <linux/usb.h> +enum usb_phy_interface { +USBPHY_INTERFACE_MODE_UNKNOWN , +USBPHY_INTERFACE_MODE_UTMI , +USBPHY_INTERFACE_MODE_UTMIW , +USBPHY_INTERFACE_MODE_ULPI , +USBPHY_INTERFACE_MODE_SERIAL , +USBPHY_INTERFACE_MODE_HSIC , +}; +enum usb_phy_events {USB_EVENT_NONE ,/* no events or cable disconnected */ USB_EVENT_VBUS ,/* vbus valid event */
Signature · 1 line
1.7.10.4
PATCH 3/4 USB mxs-phy: use readl(), writel() instead of the _relaxed() versions
In reply to Marc Kleine-BuddeThis patch converts the mxs-phy driver from readl_relaxed(), writel_relaxed() to the plain readl(), writel() functions, which are available on all platforms. This is done to enable compile time testing on non ARM platforms.
--- drivers/usb/otg/mxs-phy.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-)
drivers/usb/otg/mxs-phy.c +16 -16
@@ -48,12 +48,12 @@ static void mxs_phy_hw_init(struct mxs_phy *mxs_phy)stmp_reset_block (base +HW_USBPHY_CTRL );/* Power up the PHY */ -writel_relaxed (0 , base +HW_USBPHY_PWD ); +writel (0 , base +HW_USBPHY_PWD );/* enable FS/LS device */ -writel_relaxed (BM_USBPHY_CTRL_ENUTMILEVEL2 | -BM_USBPHY_CTRL_ENUTMILEVEL3 , - base +HW_USBPHY_CTRL_SET ); +writel (BM_USBPHY_CTRL_ENUTMILEVEL2 | +BM_USBPHY_CTRL_ENUTMILEVEL3 , + base +HW_USBPHY_CTRL_SET ); }static int mxs_phy_init (struct usb_phy *phy)
@@ -70,8 +70,8 @@ static void mxs_phy_shutdown(struct usb_phy *phy) {struct mxs_phy *mxs_phy =to_mxs_phy (phy); -writel_relaxed (BM_USBPHY_CTRL_CLKGATE , - phy->io_priv +HW_USBPHY_CTRL_SET ); +writel (BM_USBPHY_CTRL_CLKGATE , + phy->io_priv +HW_USBPHY_CTRL_SET );clk_disable_unprepare (mxs_phy->clk); }
@@ -81,15 +81,15 @@ static int mxs_phy_suspend(struct usb_phy *x, int suspend)struct mxs_phy *mxs_phy =to_mxs_phy (x);if (suspend) { -writel_relaxed (0xffffffff , x->io_priv +HW_USBPHY_PWD ); -writel_relaxed (BM_USBPHY_CTRL_CLKGATE , - x->io_priv +HW_USBPHY_CTRL_SET ); +writel (0xffffffff , x->io_priv +HW_USBPHY_PWD ); +writel (BM_USBPHY_CTRL_CLKGATE , + x->io_priv +HW_USBPHY_CTRL_SET );clk_disable_unprepare (mxs_phy->clk); }else {clk_prepare_enable (mxs_phy->clk); -writel_relaxed (BM_USBPHY_CTRL_CLKGATE , - x->io_priv +HW_USBPHY_CTRL_CLR ); -writel_relaxed (0 , x->io_priv +HW_USBPHY_PWD ); +writel (BM_USBPHY_CTRL_CLKGATE , + x->io_priv +HW_USBPHY_CTRL_CLR ); +writel (0 , x->io_priv +HW_USBPHY_PWD ); }return 0 ;
@@ -102,8 +102,8 @@ static int mxs_phy_on_connect(struct usb_phy *phy, (speed == USB_SPEED_HIGH) ? "high" : "non-high");if (speed ==USB_SPEED_HIGH ) -writel_relaxed (BM_USBPHY_CTRL_ENHOSTDISCONDETECT , - phy->io_priv +HW_USBPHY_CTRL_SET ); +writel (BM_USBPHY_CTRL_ENHOSTDISCONDETECT , + phy->io_priv +HW_USBPHY_CTRL_SET );return 0 ; }
@@ -115,8 +115,8 @@ static int mxs_phy_on_disconnect(struct usb_phy *phy, (speed == USB_SPEED_HIGH) ? "high" : "non-high");if (speed ==USB_SPEED_HIGH ) -writel_relaxed (BM_USBPHY_CTRL_ENHOSTDISCONDETECT , - phy->io_priv +HW_USBPHY_CTRL_CLR ); +writel (BM_USBPHY_CTRL_ENHOSTDISCONDETECT , + phy->io_priv +HW_USBPHY_CTRL_CLR );return 0 ; }
Signature · 1 line
1.7.10.4
PATCH 3/4 USB mxs-phy: use readl(), writel() instead of the _relaxed() versions
Quoted 5 lines · Marc Kleine-Budde
This patch converts the mxs-phy driver from
readl_relaxed(),writel_relaxed()to the plainreadl(),writel()functions, which are available on all platforms. This is done to enable compile time testing on non ARM platforms.Reported-by Alexander Shishkin <[email protected]>
I think it was Felipe who reported this actually.
Regards,
--
Alex
PATCH 3/4 USB mxs-phy: use readl(), writel() instead of the _relaxed() versions
Quoted 9 lines · Alexander Shishkin
Quoted 5 lines · Marc Kleine-Budde
This patch converts the mxs-phy driver from
readl_relaxed(),writel_relaxed()to the plainreadl(),writel()functions, which are available on all platforms. This is done to enable compile time testing on non ARM platforms.Reported-by Alexander Shishkin <[email protected]>I think it was Felipe who reported this actually.
Fixed. I'm about to repost this series with crediting Felipe as reporter.
Which tree would you like to be this series based on? It depends on the "USB otg: use try_module_get in all usb_get_phy functions and add missing module_put" patch which is part of your usb/fixes branch, but not in usb/next yet.
Marc
Signature · 12 lines
Pengutronix e.K. | Marc Kleine-Budde | Industrial Linux Solutions | Phone: +49-231-2826-924 | Vertretung West/Dortmund | Fax: +49-5121-206917-5555 | Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de | -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 263 bytes Desc: OpenPGP digital signature URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130308/94a68d9d/attachment-0001.sig>
PATCH 3/4 USB mxs-phy: use readl(), writel() instead of the _relaxed() versions
Hi,
Quoted 9 lines · Marc Kleine-Budde
Quoted 8 lines · Alexander Shishkin
Quoted 5 lines · Marc Kleine-Budde
This patch converts the mxs-phy driver from
readl_relaxed(),writel_relaxed()to the plainreadl(),writel()functions, which are available on all platforms. This is done to enable compile time testing on non ARM platforms.Reported-by Alexander Shishkin <[email protected]>
Quoted 8 lines
Quoted 1 line
I think it was Felipe who reported this actually.
Fixed. I'm about to repost this series with crediting Felipe as reporter.
Which tree would you like to be this series based on? It depends on the "USB otg: use
try_module_getin allusb_get_phyfunctions and add missingmodule_put" patch which is part of your usb/fixes branch, but not in usb/next yet.
look at my testing branch. I have them all already. You didn't get an email yet because I'm waiting for -rc2 to be tagged.
I have fixed the Reported-by tag, no issues there.
Anyway, as soon as v3.9-rc2 is tagged, I will rebase testing on top of that and move all patches to 'next', then everything will be stable from that point on.
If you want to have changes to any of the patches, now is the time, after I move patches to 'next' the tree becomes immutable.
cheers
Signature · 8 lines
balbi -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130308/a67b5949/attachment-0001.sig>
PATCH 3/4 USB mxs-phy: use readl(), writel() instead of the _relaxed() versions
Quoted 16 lines · Felipe Balbi
Hi,
Quoted 13 lines · Marc Kleine-Budde
Quoted 9 lines · Alexander Shishkin
Quoted 5 lines · Marc Kleine-Budde
This patch converts the mxs-phy driver from
readl_relaxed(),writel_relaxed()to the plainreadl(),writel()functions, which are available on all platforms. This is done to enable compile time testing on non ARM platforms.Reported-by Alexander Shishkin <[email protected]>I think it was Felipe who reported this actually.
Fixed. I'm about to repost this series with crediting Felipe as reporter.
Quoted 7 lines
Quoted 4 lines
Which tree would you like to be this series based on? It depends on the "USB otg: use
try_module_getin allusb_get_phyfunctions and add missingmodule_put" patch which is part of your usb/fixes branch, but not in usb/next yet.look at my testing branch. I have them all already. You didn't get an email yet because I'm waiting for -rc2 to be tagged.
Thanks.
Quoted 8 lines
I have fixed the Reported-by tag, no issues there.
Anyway, as soon as v3.9-rc2 is tagged, I will rebase testing on top of that and move all patches to 'next', then everything will be stable from that point on.
If you want to have changes to any of the patches, now is the time, after I move patches to 'next' the tree becomes immutable.
Nope, I just wanted to keep track of the patches.
Marc
Signature · 12 lines
Pengutronix e.K. | Marc Kleine-Budde | Industrial Linux Solutions | Phone: +49-231-2826-924 | Vertretung West/Dortmund | Fax: +49-5121-206917-5555 | Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de | -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 263 bytes Desc: OpenPGP digital signature URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130308/f1700416/attachment.sig>
PATCH 3/4 USB mxs-phy: use readl(), writel() instead of the _relaxed() versions
Quoted 29 lines · Marc Kleine-Budde
Quoted 16 lines · Felipe Balbi
Hi,
Quoted 13 lines · Marc Kleine-Budde
Quoted 9 lines · Alexander Shishkin
Quoted 5 lines · Marc Kleine-Budde
This patch converts the mxs-phy driver from
readl_relaxed(),writel_relaxed()to the plainreadl(),writel()functions, which are available on all platforms. This is done to enable compile time testing on non ARM platforms.Reported-by Alexander Shishkin <[email protected]>I think it was Felipe who reported this actually.
Fixed. I'm about to repost this series with crediting Felipe as reporter.
Quoted 7 lines
Quoted 4 lines
Which tree would you like to be this series based on? It depends on the "USB otg: use
try_module_getin allusb_get_phyfunctions and add missingmodule_put" patch which is part of your usb/fixes branch, but not in usb/next yet.look at my testing branch. I have them all already. You didn't get an email yet because I'm waiting for -rc2 to be tagged.
Thanks.
Quoted 2 lines
I have fixed the Reported-by tag, no issues there.
Quoted 8 lines
Quoted 6 lines
Anyway, as soon as v3.9-rc2 is tagged, I will rebase testing on top of that and move all patches to 'next', then everything will be stable from that point on.
If you want to have changes to any of the patches, now is the time, after I move patches to 'next' the tree becomes immutable.
Nope, I just wanted to keep track of the patches.
alright, sorry for the time it's taking to have 'next' ready, but I need to make sure things are, at a minimum, compiling correctly. Plus, I have dependencies on commits which I have sent to Greg as fixes. They should be merged upstream any time now ;-)
Signature · 8 lines
balbi -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130308/a9d25190/attachment.sig>
PATCH 4/4 USB mxs-phy: Register phy with framework
In reply to Marc Kleine-BuddeFrom: Sascha Hauer <[email protected]>
We now have usb_add_phy_dev(), so use it to register with the framework to be able to find the phy from the USB driver.
--- drivers/usb/otg/mxs-phy.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/usb/otg/mxs-phy.c +9 -0
@@ -127,6 +127,7 @@ static int mxs_phy_probe(struct platform_device *pdev)void __iomem *base;struct clk *clk;struct mxs_phy *mxs_phy; +int ret; res =platform_get_resource (pdev,IORESOURCE_MEM ,0 );if (!res) {
@@ -166,11 +167,19 @@ static int mxs_phy_probe(struct platform_device *pdev)platform_set_drvdata (pdev, &mxs_phy->phy); + ret =usb_add_phy_dev (&mxs_phy->phy); +if (ret) +return ret; +return 0 ; }static int mxs_phy_remove (struct platform_device *pdev) { +struct mxs_phy *mxs_phy =platform_get_drvdata (pdev); + +usb_remove_phy (&mxs_phy->phy); +platform_set_drvdata (pdev,NULL );return 0 ;
Signature · 1 line
1.7.10.4