Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v7 09/15] gpio: pl061: set initcall level to module init
From: Linus Walleij @ 2013-01-22  9:45 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1358494279-16503-10-git-send-email-haojian.zhuang@linaro.org>

On Fri, Jan 18, 2013 at 8:31 AM, Haojian Zhuang
<haojian.zhuang@linaro.org> wrote:

> Replace subsys initcall by module initcall level. Since pinctrl
> driver is already launched before gpio driver. It's unnecessary
> to set gpio driver in subsys init call level.
>
> Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>

OK some consensus that this works, and moving initcalls to module_init()
should be encouraged, so applied this and thrown at linux-next for
testing. No pain no gain.

Yours,
Linus Walleij

^ permalink raw reply

* OMAP baseline test results for v3.8-rc4
From: Russell King - ARM Linux @ 2013-01-22  9:52 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <87ham95zdt.fsf@dell.be.48ers.dk>

On Tue, Jan 22, 2013 at 10:40:46AM +0100, Peter Korsgaard wrote:
> >>>>> "Jan" == Jan L?bbe <jlu@pengutronix.de> writes:
> 
>  Jan> On Tue, 2013-01-22 at 02:24 +0000, Paul Walmsley wrote:
>  >> Regarding the AM33xx test failures with appended DTBs, it would be very 
>  >> helpful if especially the TI people could try reproducing the problem.
>  >> Otherwise it's going to cause problems with merging any new AM33xx 
>  >> patches, since I won't be able to test them without additional work.  
>  >> Plus, this is something that used to work up until d01e4afd, so something 
>  >> isn't right.
> 
>  Jan> Just a guess, but there can be problems when the appended DTB
>  Jan> crosses an 1MB boundary. See this mail for details and a patch:
>  Jan> http://www.spinics.net/lists/arm-kernel/msg216898.html
> 
> True, but that doesn't seem to be the case here:
> ls -la arch/arm/boot/uImage
> -rw-r--r-- 1 peko peko 3945127 Jan 22 09:26 arch/arm/boot/uImage
> 
> E.G. far from the 1MB boundary.

Don't rely on that.  Remember, if the compressed image occupies the same
location as the decompressed kernel, the decompressor will copy the data
to a different location in RAM first - I think at RAM offset + 32K +
decompressed kernel size.

So yes, please try the patch in the link above.

^ permalink raw reply

* [PATCH V2 2/2] mmc: mmci: Move ios_handler functionality into the driver
From: Linus Walleij @ 2013-01-22  9:53 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20130122090000.GH6857@gmail.com>

On Tue, Jan 22, 2013 at 10:00 AM, Lee Jones <lee.jones@linaro.org> wrote:

>> From: Lee Jones <lee.jones@linaro.org>
>>
>> There are currently two instances of the ios_handler being used.
>> Both of which mearly toy with some regulator settings. Now there
>> is a GPIO regulator API, we can use that instead, and lessen the
>> per platform burden. By doing this, we also become more Device
>> Tree compatible.
>
> Russell,
>
> Why is this patch in your tree with Ulf as the Author?

This is because of the way Russell's patch tracker works, it sets
Author: to the name of the person using the patch tracker and
discards the From: field in the beginning of the patch which
git am will conversely respect.

If you need authorship preserved each author need to submit the
patch to the patch tracker individually, as author.

Yours,
Linus Walleij

^ permalink raw reply

* [PATCH v7 08/15] gpio: pl061: bind pinctrl by gpio request
From: Haojian Zhuang @ 2013-01-22  9:55 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <CACRpkdbgRY9CcdRAVVaVAq57hF1cTf7LMOqneNwcz+VtpFDcUg@mail.gmail.com>

On 22 January 2013 17:10, Linus Walleij <linus.walleij@linaro.org> wrote:
> On Mon, Jan 21, 2013 at 4:45 PM, Haojian Zhuang
> <haojian.zhuang@linaro.org> wrote:
>
>>> > +       pinctrl_request_gpio(gpio);
>>>
>>> Handling of error code?
>>>
>>> (Maybe I should add a __must_check on this function.)
>>>
>> My case is a little special. I don't want to check return value because some
>> gpio pins don't have pinmux registers in Hisilicon SoC.
>> So pinctrl_request_gpio() will always return error for these special pins in
>> Hisilicon SoC.
>>
>> If we must check the return value, maybe we need append a dummy pinctrl driver
>> for those special gpio pins. How do you think about it? Of course, I
>> need to evaluate
>> whether it's possible to implement.
>
> Hm. A dummy pinctrl back-end is not very elegant.
>
> It's better if the GPIO driver (gpio-pl061) keep track of the ranges that
> are connected to the pinctrl.
>
> If the ranges are encoded in the device tree (as I guess you want to do
> in this case) then the GPIO driver need to check these ranges to see if
> it uses a pinctrl backend. Magic behind-the-scenes is very hard to
> understand for people reading this code later.
>
> What about this:
>
> In gpiolib.c, function gpiochip_add_pin_range(), we save a copy of
> each range in &chip->pin_ranges.
>
> Add a function to gpiolib.c to check if a certain gpio is in the range
> of the current chip.
>
> Then use that:
>
> if (gpio_in_pinrange(gpio))
>     pinctrl_request_gpio(gpio);
>
> Yours,
> Linus Walleij

It seems better. I'll update it.

Regards
Haojian

^ permalink raw reply

* [PATCH v1 0/6] USB: Add support for multiple PHYs of same type
From: Kishon Vijay Abraham I @ 2013-01-22  9:58 UTC (permalink / raw)
  To: linux-arm-kernel

This patch series adds support for adding multiple PHY's (of same type).
The binding information has to be present in the PHY library (otg.c) in
order for it to return the appropriate PHY whenever the USB controller
request for the PHY. So added a new API usb_bind_phy() to pass the binding
information. This API should be called by platform specific initialization
code.

So the binding should be done something like
usb_bind_phy("musb-hdrc.0.auto", 0, "omap-usb2.1.auto"); specifying the USB
controller device name, index, and the PHY device name.
I have done this binding for OMAP platforms, but it should be done for
all the platforms.

After this design, the phy can be got by passing the USB controller device
pointer and the index.

Developed this patch series on
git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git xceiv
after applying "usb: musb: add driver for control module" patch series
and "ARM: dts: omap: add dt data for MUSB"

Did basic enumeration testing in omap4 panda and omap3 beagle.

Kishon Vijay Abraham I (6):
  usb: otg: Add an API to bind the USB controller and PHY
  usb: otg: utils: add facilities in phy lib to support multiple PHYs
    of same type
  ARM: OMAP: USB: Add phy binding information
  drivers: usb: musb: omap: make use of the new PHY lib APIs
  usb: otg: add device tree support to otg library
  USB: MUSB: OMAP: get PHY by phandle for dt boot

 arch/arm/mach-omap2/board-2430sdp.c          |    2 +
 arch/arm/mach-omap2/board-3430sdp.c          |    2 +
 arch/arm/mach-omap2/board-4430sdp.c          |    2 +
 arch/arm/mach-omap2/board-cm-t35.c           |    2 +
 arch/arm/mach-omap2/board-devkit8000.c       |    2 +
 arch/arm/mach-omap2/board-igep0020.c         |    2 +
 arch/arm/mach-omap2/board-ldp.c              |    2 +
 arch/arm/mach-omap2/board-omap3beagle.c      |    2 +
 arch/arm/mach-omap2/board-omap3evm.c         |    2 +
 arch/arm/mach-omap2/board-omap3logic.c       |    2 +
 arch/arm/mach-omap2/board-omap3pandora.c     |    2 +
 arch/arm/mach-omap2/board-omap3stalker.c     |    2 +
 arch/arm/mach-omap2/board-omap3touchbook.c   |    2 +
 arch/arm/mach-omap2/board-omap4panda.c       |    2 +
 arch/arm/mach-omap2/board-overo.c            |    2 +
 arch/arm/mach-omap2/board-rm680.c            |    2 +
 arch/arm/mach-omap2/board-zoom-peripherals.c |    2 +
 drivers/usb/musb/omap2430.c                  |    7 +-
 drivers/usb/otg/otg.c                        |  228 +++++++++++++++++++++++++-
 drivers/usb/otg/twl4030-usb.c                |    3 +-
 drivers/usb/phy/omap-usb2.c                  |    3 +-
 include/linux/usb/phy.h                      |   43 +++++
 22 files changed, 314 insertions(+), 4 deletions(-)

-- 
1.7.9.5

^ permalink raw reply

* [PATCH v1 1/6] usb: otg: Add an API to bind the USB controller and PHY
From: Kishon Vijay Abraham I @ 2013-01-22  9:58 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1358848694-20145-1-git-send-email-kishon@ti.com>

In order to support platforms which has multiple PHY's (of same type) and
which has multiple USB controllers, a new design is adopted wherin the binding
information (between the PHY and the USB controller) should be passed to the
PHY library from platform specific file (board file). 
So added a new API to pass the binding information.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
---
 drivers/usb/otg/otg.c   |   37 +++++++++++++++++++++++++++++++++++++
 include/linux/usb/phy.h |   22 ++++++++++++++++++++++
 2 files changed, 59 insertions(+)

diff --git a/drivers/usb/otg/otg.c b/drivers/usb/otg/otg.c
index a30c041..492ba2f 100644
--- a/drivers/usb/otg/otg.c
+++ b/drivers/usb/otg/otg.c
@@ -18,6 +18,7 @@
 #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,
@@ -201,6 +202,42 @@ void usb_remove_phy(struct usb_phy *x)
 }
 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.
+ */
+struct usb_phy_bind __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 ERR_PTR(-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 phy_bind;
+}
+EXPORT_SYMBOL_GPL(usb_bind_phy);
+
 const char *otg_state_string(enum usb_otg_state state)
 {
 	switch (state) {
diff --git a/include/linux/usb/phy.h b/include/linux/usb/phy.h
index a29ae1e..fbeab1a 100644
--- a/include/linux/usb/phy.h
+++ b/include/linux/usb/phy.h
@@ -106,6 +106,21 @@ struct usb_phy {
 			enum usb_device_speed speed);
 };
 
+/**
+ * struct usb_phy_bind - represent the binding for the phy
+ * @dev_name: the device name of the device that will bind to the phy
+ * @phy_dev_name: the device name of the phy
+ * @index: used if a single controller uses multiple phys
+ * @phy: reference to the phy
+ * @list: to maintain a linked list of the binding information
+ */
+struct usb_phy_bind {
+	const char	*dev_name;
+	const char	*phy_dev_name;
+	u8		index;
+	struct usb_phy	*phy;
+	struct list_head list;
+};
 
 /* for board-specific init logic */
 extern int usb_add_phy(struct usb_phy *, enum usb_phy_type type);
@@ -151,6 +166,8 @@ extern struct usb_phy *devm_usb_get_phy(struct device *dev,
 	enum usb_phy_type type);
 extern void usb_put_phy(struct usb_phy *);
 extern void devm_usb_put_phy(struct device *dev, struct usb_phy *x);
+extern struct usb_phy_bind *usb_bind_phy(const char *dev_name, u8 index,
+				const char *phy_dev_name);
 #else
 static inline struct usb_phy *usb_get_phy(enum usb_phy_type type)
 {
@@ -171,6 +188,11 @@ static inline void devm_usb_put_phy(struct device *dev, struct usb_phy *x)
 {
 }
 
+static inline struct usb_phy_bind *usb_bind_phy(const char *dev_name, u8 index,
+				const char *phy_dev_name)
+{
+	return NULL;
+}
 #endif
 
 static inline int
-- 
1.7.9.5

^ permalink raw reply related

* [PATCH v1 2/6] usb: otg: utils: add facilities in phy lib to support multiple PHYs of same type
From: Kishon Vijay Abraham I @ 2013-01-22  9:58 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1358848694-20145-1-git-send-email-kishon@ti.com>

In order to add support for multipe PHY's of the same type, new API's
for adding PHY and getting PHY has been added. Now the binding
information for the PHY and controller should be done in platform file
using usb_bind_phy API. And for getting a PHY, the device pointer of the
USB controller and an index should be passed. Based on the binding
information that is added in the platform file, usb_get_phy_dev will return the
appropriate PHY.
Already existing API's to add and get phy by type is not removed. These
API's are deprecated and will be removed once all the platforms start to
use the new API.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
---
 drivers/usb/otg/otg.c   |  114 ++++++++++++++++++++++++++++++++++++++++++++++-
 include/linux/usb/phy.h |   13 ++++++
 2 files changed, 126 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/otg/otg.c b/drivers/usb/otg/otg.c
index 492ba2f..1f30b22 100644
--- a/drivers/usb/otg/otg.c
+++ b/drivers/usb/otg/otg.c
@@ -36,6 +36,20 @@ static struct usb_phy *__usb_find_phy(struct list_head *list,
 	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)
+			return phy_bind->phy;
+	}
+
+	return ERR_PTR(-ENODEV);
+}
+
 static void devm_usb_phy_release(struct device *dev, void *res)
 {
 	struct usb_phy *phy = *(struct usb_phy **)res;
@@ -112,6 +126,69 @@ err0:
 EXPORT_SYMBOL(usb_get_phy);
 
 /**
+ * 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)) {
+		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()
@@ -186,6 +263,36 @@ out:
 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;
  *
@@ -194,10 +301,15 @@ EXPORT_SYMBOL(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)
+	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);
diff --git a/include/linux/usb/phy.h b/include/linux/usb/phy.h
index fbeab1a..3a9ae3e 100644
--- a/include/linux/usb/phy.h
+++ b/include/linux/usb/phy.h
@@ -124,6 +124,7 @@ struct usb_phy_bind {
 
 /* for board-specific init logic */
 extern int usb_add_phy(struct usb_phy *, enum usb_phy_type type);
+extern int usb_add_phy_dev(struct usb_phy *);
 extern void usb_remove_phy(struct usb_phy *);
 
 /* helpers for direct access thru low-level io interface */
@@ -164,6 +165,8 @@ usb_phy_shutdown(struct usb_phy *x)
 extern struct usb_phy *usb_get_phy(enum usb_phy_type type);
 extern struct usb_phy *devm_usb_get_phy(struct device *dev,
 	enum usb_phy_type type);
+extern struct usb_phy *usb_get_phy_dev(struct device *dev, u8 index);
+extern struct usb_phy *devm_usb_get_phy_dev(struct device *dev, u8 index);
 extern void usb_put_phy(struct usb_phy *);
 extern void devm_usb_put_phy(struct device *dev, struct usb_phy *x);
 extern struct usb_phy_bind *usb_bind_phy(const char *dev_name, u8 index,
@@ -180,6 +183,16 @@ static inline struct usb_phy *devm_usb_get_phy(struct device *dev,
 	return NULL;
 }
 
+static inline struct usb_phy *usb_get_phy_dev(struct device *dev, u8 index)
+{
+	return NULL;
+}
+
+static inline struct usb_phy *devm_usb_get_phy_dev(struct device *dev, u8 index)
+{
+	return NULL;
+}
+
 static inline void usb_put_phy(struct usb_phy *x)
 {
 }
-- 
1.7.9.5

^ permalink raw reply related

* [PATCH v1 3/6] ARM: OMAP: USB: Add phy binding information
From: Kishon Vijay Abraham I @ 2013-01-22  9:58 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1358848694-20145-1-git-send-email-kishon@ti.com>

This is w.r.t the changes in PHY library to support adding and getting
multiple PHYs of the same type. In the new design, the
binding information between the PHY and the USB controller should be
specified in the platform specific initialization code. So it's been
done here for OMAP platforms.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
---
 arch/arm/mach-omap2/board-2430sdp.c          |    2 ++
 arch/arm/mach-omap2/board-3430sdp.c          |    2 ++
 arch/arm/mach-omap2/board-4430sdp.c          |    2 ++
 arch/arm/mach-omap2/board-cm-t35.c           |    2 ++
 arch/arm/mach-omap2/board-devkit8000.c       |    2 ++
 arch/arm/mach-omap2/board-igep0020.c         |    2 ++
 arch/arm/mach-omap2/board-ldp.c              |    2 ++
 arch/arm/mach-omap2/board-omap3beagle.c      |    2 ++
 arch/arm/mach-omap2/board-omap3evm.c         |    2 ++
 arch/arm/mach-omap2/board-omap3logic.c       |    2 ++
 arch/arm/mach-omap2/board-omap3pandora.c     |    2 ++
 arch/arm/mach-omap2/board-omap3stalker.c     |    2 ++
 arch/arm/mach-omap2/board-omap3touchbook.c   |    2 ++
 arch/arm/mach-omap2/board-omap4panda.c       |    2 ++
 arch/arm/mach-omap2/board-overo.c            |    2 ++
 arch/arm/mach-omap2/board-rm680.c            |    2 ++
 arch/arm/mach-omap2/board-zoom-peripherals.c |    2 ++
 17 files changed, 34 insertions(+)

diff --git a/arch/arm/mach-omap2/board-2430sdp.c b/arch/arm/mach-omap2/board-2430sdp.c
index 4815ea6..1337f2c 100644
--- a/arch/arm/mach-omap2/board-2430sdp.c
+++ b/arch/arm/mach-omap2/board-2430sdp.c
@@ -27,6 +27,7 @@
 #include <linux/clk.h>
 #include <linux/io.h>
 #include <linux/gpio.h>
+#include <linux/usb/phy.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -263,6 +264,7 @@ static void __init omap_2430sdp_init(void)
 	omap_hsmmc_init(mmc);
 
 	omap_mux_init_signal("usb0hs_stp", OMAP_PULL_ENA | OMAP_PULL_UP);
+	usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb");
 	usb_musb_init(NULL);
 
 	board_smc91x_init();
diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c
index bb73afc..8a2e242 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -25,6 +25,7 @@
 #include <linux/gpio.h>
 #include <linux/mmc/host.h>
 #include <linux/platform_data/spi-omap2-mcspi.h>
+#include <linux/usb/phy.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -579,6 +580,7 @@ static void __init omap_3430sdp_init(void)
 	omap_ads7846_init(1, gpio_pendown, 310, NULL);
 	omap_serial_init();
 	omap_sdrc_init(hyb18m512160af6_sdrc_params, NULL);
+	usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb");
 	usb_musb_init(NULL);
 	board_smc91x_init();
 	board_flash_init(sdp_flash_partitions, chip_sel_3430, 0);
diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c
index 1cc6696..8e8efcc 100644
--- a/arch/arm/mach-omap2/board-4430sdp.c
+++ b/arch/arm/mach-omap2/board-4430sdp.c
@@ -28,6 +28,7 @@
 #include <linux/leds_pwm.h>
 #include <linux/platform_data/omap4-keypad.h>
 #include <linux/usb/musb.h>
+#include <linux/usb/phy.h>
 
 #include <asm/hardware/gic.h>
 #include <asm/mach-types.h>
@@ -696,6 +697,7 @@ static void __init omap_4430sdp_init(void)
 	omap4_sdp4430_wifi_init();
 	omap4_twl6030_hsmmc_init(mmc);
 
+	usb_bind_phy("musb-hdrc.0.auto", 0, "omap-usb2.1.auto");
 	usb_musb_init(&musb_board_data);
 
 	status = omap_ethernet_init();
diff --git a/arch/arm/mach-omap2/board-cm-t35.c b/arch/arm/mach-omap2/board-cm-t35.c
index b3102c2..f1172f2 100644
--- a/arch/arm/mach-omap2/board-cm-t35.c
+++ b/arch/arm/mach-omap2/board-cm-t35.c
@@ -30,6 +30,7 @@
 #include <linux/regulator/fixed.h>
 #include <linux/regulator/machine.h>
 #include <linux/mmc/host.h>
+#include <linux/usb/phy.h>
 
 #include <linux/spi/spi.h>
 #include <linux/spi/tdo24m.h>
@@ -724,6 +725,7 @@ static void __init cm_t3x_common_init(void)
 	cm_t35_init_display();
 	omap_twl4030_audio_init("cm-t3x");
 
+	usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb");
 	usb_musb_init(NULL);
 	cm_t35_init_usbh();
 	cm_t35_init_camera();
diff --git a/arch/arm/mach-omap2/board-devkit8000.c b/arch/arm/mach-omap2/board-devkit8000.c
index 12865af..77cade52 100644
--- a/arch/arm/mach-omap2/board-devkit8000.c
+++ b/arch/arm/mach-omap2/board-devkit8000.c
@@ -29,6 +29,7 @@
 #include <linux/mtd/partitions.h>
 #include <linux/mtd/nand.h>
 #include <linux/mmc/host.h>
+#include <linux/usb/phy.h>
 
 #include <linux/regulator/machine.h>
 #include <linux/i2c/twl.h>
@@ -622,6 +623,7 @@ static void __init devkit8000_init(void)
 
 	omap_ads7846_init(2, OMAP3_DEVKIT_TS_GPIO, 0, NULL);
 
+	usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb");
 	usb_musb_init(NULL);
 	usbhs_init(&usbhs_bdata);
 	board_nand_init(devkit8000_nand_partitions,
diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c
index 0f24cb8..15e5881 100644
--- a/arch/arm/mach-omap2/board-igep0020.c
+++ b/arch/arm/mach-omap2/board-igep0020.c
@@ -18,6 +18,7 @@
 #include <linux/gpio.h>
 #include <linux/interrupt.h>
 #include <linux/input.h>
+#include <linux/usb/phy.h>
 
 #include <linux/regulator/machine.h>
 #include <linux/regulator/fixed.h>
@@ -625,6 +626,7 @@ static void __init igep_init(void)
 	omap_serial_init();
 	omap_sdrc_init(m65kxxxxam_sdrc_params,
 				  m65kxxxxam_sdrc_params);
+	usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb");
 	usb_musb_init(NULL);
 
 	igep_flash_init();
diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
index 0869f4f..3b5510a 100644
--- a/arch/arm/mach-omap2/board-ldp.c
+++ b/arch/arm/mach-omap2/board-ldp.c
@@ -28,6 +28,7 @@
 #include <linux/io.h>
 #include <linux/smsc911x.h>
 #include <linux/mmc/host.h>
+#include <linux/usb/phy.h>
 #include <linux/platform_data/spi-omap2-mcspi.h>
 
 #include <asm/mach-types.h>
@@ -418,6 +419,7 @@ static void __init omap_ldp_init(void)
 	omap_ads7846_init(1, 54, 310, NULL);
 	omap_serial_init();
 	omap_sdrc_init(NULL, NULL);
+	usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb");
 	usb_musb_init(NULL);
 	board_nand_init(ldp_nand_partitions, ARRAY_SIZE(ldp_nand_partitions),
 			ZOOM_NAND_CS, 0, nand_default_timings);
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index 22c483d..4616f92 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -30,6 +30,7 @@
 #include <linux/mtd/partitions.h>
 #include <linux/mtd/nand.h>
 #include <linux/mmc/host.h>
+#include <linux/usb/phy.h>
 
 #include <linux/regulator/machine.h>
 #include <linux/i2c/twl.h>
@@ -519,6 +520,7 @@ static void __init omap3_beagle_init(void)
 	omap_sdrc_init(mt46h32m32lf6_sdrc_params,
 				  mt46h32m32lf6_sdrc_params);
 
+	usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb");
 	usb_musb_init(NULL);
 	usbhs_init(&usbhs_bdata);
 	board_nand_init(omap3beagle_nand_partitions,
diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c
index 3985f35..a198b61 100644
--- a/arch/arm/mach-omap2/board-omap3evm.c
+++ b/arch/arm/mach-omap2/board-omap3evm.c
@@ -41,6 +41,7 @@
 #include <linux/regulator/machine.h>
 #include <linux/mmc/host.h>
 #include <linux/export.h>
+#include <linux/usb/phy.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -734,6 +735,7 @@ static void __init omap3_evm_init(void)
 		omap_mux_init_gpio(135, OMAP_PIN_OUTPUT);
 		usbhs_bdata.reset_gpio_port[1] = 135;
 	}
+	usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb");
 	usb_musb_init(&musb_board_data);
 	usbhs_init(&usbhs_bdata);
 	board_nand_init(omap3evm_nand_partitions,
diff --git a/arch/arm/mach-omap2/board-omap3logic.c b/arch/arm/mach-omap2/board-omap3logic.c
index 2a065ba..9409eb8 100644
--- a/arch/arm/mach-omap2/board-omap3logic.c
+++ b/arch/arm/mach-omap2/board-omap3logic.c
@@ -29,6 +29,7 @@
 
 #include <linux/i2c/twl.h>
 #include <linux/mmc/host.h>
+#include <linux/usb/phy.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -215,6 +216,7 @@ static void __init omap3logic_init(void)
 	board_mmc_init();
 	board_smsc911x_init();
 
+	usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb");
 	usb_musb_init(NULL);
 
 	/* Ensure SDRC pins are mux'd for self-refresh */
diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c
index a53a668..1ac3e81 100644
--- a/arch/arm/mach-omap2/board-omap3pandora.c
+++ b/arch/arm/mach-omap2/board-omap3pandora.c
@@ -35,6 +35,7 @@
 #include <linux/mmc/host.h>
 #include <linux/mmc/card.h>
 #include <linux/regulator/fixed.h>
+#include <linux/usb/phy.h>
 #include <linux/platform_data/spi-omap2-mcspi.h>
 
 #include <asm/mach-types.h>
@@ -601,6 +602,7 @@ static void __init omap3pandora_init(void)
 			ARRAY_SIZE(omap3pandora_spi_board_info));
 	omap_ads7846_init(1, OMAP3_PANDORA_TS_GPIO, 0, NULL);
 	usbhs_init(&usbhs_bdata);
+	usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb");
 	usb_musb_init(NULL);
 	gpmc_nand_init(&pandora_nand_data, NULL);
 
diff --git a/arch/arm/mach-omap2/board-omap3stalker.c b/arch/arm/mach-omap2/board-omap3stalker.c
index 53a6cbc..63cb204 100644
--- a/arch/arm/mach-omap2/board-omap3stalker.c
+++ b/arch/arm/mach-omap2/board-omap3stalker.c
@@ -33,6 +33,7 @@
 #include <linux/interrupt.h>
 #include <linux/smsc911x.h>
 #include <linux/i2c/at24.h>
+#include <linux/usb/phy.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -404,6 +405,7 @@ static void __init omap3_stalker_init(void)
 
 	omap_serial_init();
 	omap_sdrc_init(mt46h32m32lf6_sdrc_params, NULL);
+	usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb");
 	usb_musb_init(NULL);
 	usbhs_init(&usbhs_bdata);
 	omap_ads7846_init(1, OMAP3_STALKER_TS_GPIO, 310, NULL);
diff --git a/arch/arm/mach-omap2/board-omap3touchbook.c b/arch/arm/mach-omap2/board-omap3touchbook.c
index 263cb9c..6b22ce3 100644
--- a/arch/arm/mach-omap2/board-omap3touchbook.c
+++ b/arch/arm/mach-omap2/board-omap3touchbook.c
@@ -28,6 +28,7 @@
 #include <linux/mtd/partitions.h>
 #include <linux/mtd/nand.h>
 #include <linux/mmc/host.h>
+#include <linux/usb/phy.h>
 
 #include <linux/platform_data/spi-omap2-mcspi.h>
 #include <linux/spi/spi.h>
@@ -365,6 +366,7 @@ static void __init omap3_touchbook_init(void)
 
 	/* Touchscreen and accelerometer */
 	omap_ads7846_init(4, OMAP3_TS_GPIO, 310, &ads7846_pdata);
+	usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb");
 	usb_musb_init(NULL);
 	usbhs_init(&usbhs_bdata);
 	board_nand_init(omap3touchbook_nand_partitions,
diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c
index 5c8e9ce..64fb190 100644
--- a/arch/arm/mach-omap2/board-omap4panda.c
+++ b/arch/arm/mach-omap2/board-omap4panda.c
@@ -30,6 +30,7 @@
 #include <linux/regulator/fixed.h>
 #include <linux/ti_wilink_st.h>
 #include <linux/usb/musb.h>
+#include <linux/usb/phy.h>
 #include <linux/wl12xx.h>
 #include <linux/platform_data/omap-abe-twl6040.h>
 
@@ -441,6 +442,7 @@ static void __init omap4_panda_init(void)
 	omap_sdrc_init(NULL, NULL);
 	omap4_twl6030_hsmmc_init(mmc);
 	omap4_ehci_init();
+	usb_bind_phy("musb-hdrc.0.auto", 0, "omap-usb2.1.auto");
 	usb_musb_init(&musb_board_data);
 	omap4_panda_display_init();
 }
diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c
index c8fde3e..7e43ff3 100644
--- a/arch/arm/mach-omap2/board-overo.c
+++ b/arch/arm/mach-omap2/board-overo.c
@@ -36,6 +36,7 @@
 #include <linux/mtd/nand.h>
 #include <linux/mtd/partitions.h>
 #include <linux/mmc/host.h>
+#include <linux/usb/phy.h>
 
 #include <linux/platform_data/mtd-nand-omap2.h>
 #include <linux/platform_data/spi-omap2-mcspi.h>
@@ -499,6 +500,7 @@ static void __init overo_init(void)
 				  mt46h32m32lf6_sdrc_params);
 	board_nand_init(overo_nand_partitions,
 			ARRAY_SIZE(overo_nand_partitions), NAND_CS, 0, NULL);
+	usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb");
 	usb_musb_init(NULL);
 	usbhs_init(&usbhs_bdata);
 	overo_spi_init();
diff --git a/arch/arm/mach-omap2/board-rm680.c b/arch/arm/mach-omap2/board-rm680.c
index 0c777b7..f8a272c 100644
--- a/arch/arm/mach-omap2/board-rm680.c
+++ b/arch/arm/mach-omap2/board-rm680.c
@@ -18,6 +18,7 @@
 #include <linux/regulator/machine.h>
 #include <linux/regulator/consumer.h>
 #include <linux/platform_data/mtd-onenand-omap2.h>
+#include <linux/usb/phy.h>
 
 #include <asm/mach/arch.h>
 #include <asm/mach-types.h>
@@ -134,6 +135,7 @@ static void __init rm680_init(void)
 	sdrc_params = nokia_get_sdram_timings();
 	omap_sdrc_init(sdrc_params, sdrc_params);
 
+	usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb");
 	usb_musb_init(NULL);
 	rm680_peripherals_init();
 }
diff --git a/arch/arm/mach-omap2/board-zoom-peripherals.c b/arch/arm/mach-omap2/board-zoom-peripherals.c
index 26e07ad..dc5498b 100644
--- a/arch/arm/mach-omap2/board-zoom-peripherals.c
+++ b/arch/arm/mach-omap2/board-zoom-peripherals.c
@@ -20,6 +20,7 @@
 #include <linux/wl12xx.h>
 #include <linux/mmc/host.h>
 #include <linux/platform_data/gpio-omap.h>
+#include <linux/usb/phy.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -298,6 +299,7 @@ void __init zoom_peripherals_init(void)
 	omap_hsmmc_init(mmc);
 	omap_i2c_init();
 	platform_device_register(&omap_vwlan_device);
+	usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb");
 	usb_musb_init(NULL);
 	enable_board_wakeup_source();
 	omap_serial_init();
-- 
1.7.9.5

^ permalink raw reply related

* [PATCH v1 4/6] drivers: usb: musb: omap: make use of the new PHY lib APIs
From: Kishon Vijay Abraham I @ 2013-01-22  9:58 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1358848694-20145-1-git-send-email-kishon@ti.com>

New PHY lib APIs like usb_add_phy_dev() and devm_usb_get_phy_dev() are
used in MUSB (OMAP), in order to make use of the binding information
provided in the board file (of OMAP platforms).
All the platforms should be modified similar to this to add and get the
PHY.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
---
 drivers/usb/musb/omap2430.c   |    2 +-
 drivers/usb/otg/twl4030-usb.c |    3 ++-
 drivers/usb/phy/omap-usb2.c   |    3 ++-
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c
index bf6cfe0..1a8cf6d 100644
--- a/drivers/usb/musb/omap2430.c
+++ b/drivers/usb/musb/omap2430.c
@@ -345,7 +345,7 @@ static int omap2430_musb_init(struct musb *musb)
 	 * up through ULPI.  TWL4030-family PMICs include one,
 	 * which needs a driver, drivers aren't always needed.
 	 */
-	musb->xceiv = devm_usb_get_phy(dev, USB_PHY_TYPE_USB2);
+	musb->xceiv = devm_usb_get_phy_dev(dev, 0);
 	if (IS_ERR_OR_NULL(musb->xceiv)) {
 		pr_err("HS USB OTG: no transceiver configured\n");
 		return -ENODEV;
diff --git a/drivers/usb/otg/twl4030-usb.c b/drivers/usb/otg/twl4030-usb.c
index 0a70193..a994715 100644
--- a/drivers/usb/otg/twl4030-usb.c
+++ b/drivers/usb/otg/twl4030-usb.c
@@ -610,6 +610,7 @@ static int twl4030_usb_probe(struct platform_device *pdev)
 	twl->phy.dev		= twl->dev;
 	twl->phy.label		= "twl4030";
 	twl->phy.otg		= otg;
+	twl->phy.type		= USB_PHY_TYPE_USB2;
 	twl->phy.set_suspend	= twl4030_set_suspend;
 
 	otg->phy		= &twl->phy;
@@ -624,7 +625,7 @@ static int twl4030_usb_probe(struct platform_device *pdev)
 		dev_err(&pdev->dev, "ldo init failed\n");
 		return err;
 	}
-	usb_add_phy(&twl->phy, USB_PHY_TYPE_USB2);
+	usb_add_phy_dev(&twl->phy);
 
 	platform_set_drvdata(pdev, twl);
 	if (device_create_file(&pdev->dev, &dev_attr_vbus))
diff --git a/drivers/usb/phy/omap-usb2.c b/drivers/usb/phy/omap-usb2.c
index 4b59b39..b5c759c 100644
--- a/drivers/usb/phy/omap-usb2.c
+++ b/drivers/usb/phy/omap-usb2.c
@@ -143,6 +143,7 @@ static int omap_usb2_probe(struct platform_device *pdev)
 	phy->phy.label		= "omap-usb2";
 	phy->phy.set_suspend	= omap_usb2_suspend;
 	phy->phy.otg		= otg;
+	phy->phy.type		= USB_PHY_TYPE_USB2;
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
 
@@ -168,7 +169,7 @@ static int omap_usb2_probe(struct platform_device *pdev)
 	}
 	clk_prepare(phy->wkupclk);
 
-	usb_add_phy(&phy->phy, USB_PHY_TYPE_USB2);
+	usb_add_phy_dev(&phy->phy);
 
 	platform_set_drvdata(pdev, phy);
 
-- 
1.7.9.5

^ permalink raw reply related

* [PATCH v1 5/6] usb: otg: add device tree support to otg library
From: Kishon Vijay Abraham I @ 2013-01-22  9:58 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1358848694-20145-1-git-send-email-kishon@ti.com>

Added an API devm_usb_get_phy_by_phandle(), to get usb phy by passing a
device node phandle value. This function will return a pointer to
the phy on success, -EPROBE_DEFER if there is a device_node for the phandle,
but the phy has not been added, or a ERR_PTR() otherwise.

Cc: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
---
 drivers/usb/otg/otg.c   |   77 +++++++++++++++++++++++++++++++++++++++++++++++
 include/linux/usb/phy.h |    8 +++++
 2 files changed, 85 insertions(+)

diff --git a/drivers/usb/otg/otg.c b/drivers/usb/otg/otg.c
index 1f30b22..67daf8c 100644
--- a/drivers/usb/otg/otg.c
+++ b/drivers/usb/otg/otg.c
@@ -13,7 +13,9 @@
 #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>
 
@@ -50,6 +52,20 @@ static struct usb_phy *__usb_find_phy_dev(struct device *dev,
 	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;
@@ -125,6 +141,67 @@ err0:
 }
 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 = NULL, **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");
+		return ERR_PTR(-ENOMEM);
+	}
+
+	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 err0;
+	}
+
+	*ptr = phy;
+	devres_add(dev, ptr);
+
+	get_device(phy->dev);
+
+err0:
+	spin_unlock_irqrestore(&phy_lock, flags);
+
+	return phy;
+}
+EXPORT_SYMBOL(devm_usb_get_phy_by_phandle);
+
 /**
  * usb_get_phy_dev - find the USB PHY
  * @dev - device that requests this phy
diff --git a/include/linux/usb/phy.h b/include/linux/usb/phy.h
index 3a9ae3e..c7f5a98 100644
--- a/include/linux/usb/phy.h
+++ b/include/linux/usb/phy.h
@@ -167,6 +167,8 @@ extern struct usb_phy *devm_usb_get_phy(struct device *dev,
 	enum usb_phy_type type);
 extern struct usb_phy *usb_get_phy_dev(struct device *dev, u8 index);
 extern struct usb_phy *devm_usb_get_phy_dev(struct device *dev, u8 index);
+extern struct usb_phy *devm_usb_get_phy_by_phandle(struct device *dev,
+	const char *phandle, u8 index);
 extern void usb_put_phy(struct usb_phy *);
 extern void devm_usb_put_phy(struct device *dev, struct usb_phy *x);
 extern struct usb_phy_bind *usb_bind_phy(const char *dev_name, u8 index,
@@ -193,6 +195,12 @@ static inline struct usb_phy *devm_usb_get_phy_dev(struct device *dev, u8 index)
 	return NULL;
 }
 
+static inline struct usb_phy *devm_usb_get_phy_by_phandle(struct device *dev,
+	const char *phandle, u8 index)
+{
+	return NULL;
+}
+
 static inline void usb_put_phy(struct usb_phy *x)
 {
 }
-- 
1.7.9.5

^ permalink raw reply related

* [PATCH v1 6/6] USB: MUSB: OMAP: get PHY by phandle for dt boot
From: Kishon Vijay Abraham I @ 2013-01-22  9:58 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1358848694-20145-1-git-send-email-kishon@ti.com>

The OMAP glue has been modified to get PHY by phandle for dt boot.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
---
 drivers/usb/musb/omap2430.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c
index 1a8cf6d..e43faeb 100644
--- a/drivers/usb/musb/omap2430.c
+++ b/drivers/usb/musb/omap2430.c
@@ -345,7 +345,12 @@ static int omap2430_musb_init(struct musb *musb)
 	 * up through ULPI.  TWL4030-family PMICs include one,
 	 * which needs a driver, drivers aren't always needed.
 	 */
-	musb->xceiv = devm_usb_get_phy_dev(dev, 0);
+	if (dev->parent->of_node)
+		musb->xceiv = devm_usb_get_phy_by_phandle(dev->parent,
+		    "usb_phy", 0);
+	else
+		musb->xceiv = devm_usb_get_phy_dev(dev, 0);
+
 	if (IS_ERR_OR_NULL(musb->xceiv)) {
 		pr_err("HS USB OTG: no transceiver configured\n");
 		return -ENODEV;
-- 
1.7.9.5

^ permalink raw reply related

* [PATCH V2 2/2] mmc: mmci: Move ios_handler functionality into the driver
From: Russell King - ARM Linux @ 2013-01-22 10:06 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <CACRpkdatTagYaMqvpe-a8zj_kO3Twjn1r4SqPty8DosNmcxJcQ@mail.gmail.com>

On Tue, Jan 22, 2013 at 10:53:42AM +0100, Linus Walleij wrote:
> On Tue, Jan 22, 2013 at 10:00 AM, Lee Jones <lee.jones@linaro.org> wrote:
> 
> >> From: Lee Jones <lee.jones@linaro.org>
> >>
> >> There are currently two instances of the ios_handler being used.
> >> Both of which mearly toy with some regulator settings. Now there
> >> is a GPIO regulator API, we can use that instead, and lessen the
> >> per platform burden. By doing this, we also become more Device
> >> Tree compatible.
> >
> > Russell,
> >
> > Why is this patch in your tree with Ulf as the Author?
> 
> This is because of the way Russell's patch tracker works, it sets
> Author: to the name of the person using the patch tracker and
> discards the From: field in the beginning of the patch which
> git am will conversely respect.

Actually, the reverse.  It does now respect the From: line, but the
From: line will be ignored for all notifications about the patch
because the patch system was never built to parse the actual comments
when sending out the email notifications.

^ permalink raw reply

* [GIT PULL] ARM: OMAP: Audio support via omap-twl4030 and pwm support
From: Peter Ujfalusi @ 2013-01-22 10:07 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Tony,

The content of this pull:

update for audio support via omap-twl4030 and pwm updates in board level:
http://www.spinics.net/lists/linux-omap/msg85085.html

and zoom-peripherals update to not request the TWL GPIO7:
http://www.spinics.net/lists/linux-omap/msg85187.html

All is on top of mainline v3.8-rc4 tag.

Regards,
P?ter

---
The following changes since commit 7d1f9aeff1ee4a20b1aeb377dd0f579fe9647619:

  Linux 3.8-rc4 (2013-01-17 19:25:45 -0800)

are available in the git repository at:

  git://gitorious.org/omap-audio/linux-audio.git peter/for-tony

for you to fetch changes up to e4f4e8bfa47431b91fbb21dd9b86d9bc2c15cbd7:

  ARM: board-zoom: Do not request LCD panel enable GPIO from twl4030 (2013-01-22 10:35:16 +0100)

----------------------------------------------------------------
Peter Ujfalusi (9):
      ARM: OMAP: 3430sdp: Enable extmute functionality for audio
      ARM: OMAP: zoom: Zoom2 does not have extmute functionality
      ARM: OMAP2+: twl-common: Add default twl4030 audio configuration
      ARM: OMAP2+: twl-common: Allow boards to customize the twl4030 audio setup
      ARM: OMAP: zoom: Audio support via the common omap-twl4030 machine driver
      ARM: OMAP: sdp3430: Audio support via the common omap-twl4030 machine driver
      ARM: OMAP: board-4430sdp: Proper support for TWL6030 PWM LED/Backlight
      ARM: OMAP: omap3beagle: Use the pwm_leds driver to control the PMU_STAT led
      ARM: board-zoom: Do not request LCD panel enable GPIO from twl4030

 arch/arm/mach-omap2/board-3430sdp.c          | 20 ++++++++++++++++++++
 arch/arm/mach-omap2/board-4430sdp.c          | 30 +++++++++++++++++++++++++++++-
 arch/arm/mach-omap2/board-cm-t35.c           |  2 +-
 arch/arm/mach-omap2/board-devkit8000.c       |  2 +-
 arch/arm/mach-omap2/board-igep0020.c         |  2 +-
 arch/arm/mach-omap2/board-omap3beagle.c      | 41 ++++++++++++++++++++++++++++++++---------
 arch/arm/mach-omap2/board-omap3evm.c         |  2 +-
 arch/arm/mach-omap2/board-overo.c            |  2 +-
 arch/arm/mach-omap2/board-zoom-peripherals.c | 39 +++++++++++++++++++++------------------
 arch/arm/mach-omap2/twl-common.c             | 17 +++++++++++------
 arch/arm/mach-omap2/twl-common.h             |  3 ++-
 11 files changed, 120 insertions(+), 40 deletions(-)

^ permalink raw reply

* [PATCH v7 08/15] gpio: pl061: bind pinctrl by gpio request
From: Linus Walleij @ 2013-01-22 10:10 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <CAD6h2NQM6=wZ5k7p9yhF3oWGQGBcsn+gt3J0+JVxx7wKYaKEJg@mail.gmail.com>

On Tue, Jan 22, 2013 at 10:55 AM, Haojian Zhuang
<haojian.zhuang@linaro.org> wrote:

>> Add a function to gpiolib.c to check if a certain gpio is in the range
>> of the current chip.
>>
>> Then use that:
>>
>> if (gpio_in_pinrange(gpio))
>>     pinctrl_request_gpio(gpio);
>>
>> Yours,
>> Linus Walleij
>
> It seems better. I'll update it.

Hm the function above will need to pass the chip as parameter as
well, so a bit simplified.

Maybe it's better to add a function like gpio_check_pinctrl_backend(chip, gpio);
that does the above two statements?

Yours,
Linus Walleij

^ permalink raw reply

* [PATCH V2 2/2] mmc: mmci: Move ios_handler functionality into the driver
From: Linus Walleij @ 2013-01-22 10:11 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20130122100607.GH23505@n2100.arm.linux.org.uk>

On Tue, Jan 22, 2013 at 11:06 AM, Russell King - ARM Linux
<linux@arm.linux.org.uk> wrote:

> Actually, the reverse.  It does now respect the From: line, but the
> From: line will be ignored for all notifications about the patch
> because the patch system was never built to parse the actual comments
> when sending out the email notifications.

Yay! Thanks Russell.

Yours,
Linus Walleij

^ permalink raw reply

* [PATCH 0/5] ARM: dts: OMAP3+: PWM support for TWL and selected boards
From: Peter Ujfalusi @ 2013-01-22 10:11 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1358519794-13214-1-git-send-email-peter.ujfalusi@ti.com>

Hi Benoit,

I have prepared for you a branch from where you can pull this set on top of
mainline v3.8-rc4:

Regards,
P?ter

---
The following changes since commit 7d1f9aeff1ee4a20b1aeb377dd0f579fe9647619:

  Linux 3.8-rc4 (2013-01-17 19:25:45 -0800)

are available in the git repository at:

  git://gitorious.org/omap-audio/linux-audio.git peter/for-benoit

for you to fetch changes up to b6230ae20bc018d042d703d0667ba9e7ac027ccb:

  ARM: dts: omap4-sdp: Add support for pwm-backlight (2013-01-22 11:08:37 +0100)

----------------------------------------------------------------
Peter Ujfalusi (5):
      ARM: dts: twl4030: Add PWM support
      ARM: dts: twl6030: Add PWM support
      ARM: dts: omap3-beagle-xm: Use pwm-leds for pmu_stat LED
      ARM: dts: omap4-sdp: Add support for pwm-leds (keypad and charging LED)
      ARM: dts: omap4-sdp: Add support for pwm-backlight

 arch/arm/boot/dts/omap3-beagle-xm.dts | 14 ++++++++++----
 arch/arm/boot/dts/omap4-sdp.dts       | 26 ++++++++++++++++++++++++++
 arch/arm/boot/dts/twl4030.dtsi        | 10 ++++++++++
 arch/arm/boot/dts/twl6030.dtsi        | 12 ++++++++++++
 4 files changed, 58 insertions(+), 4 deletions(-)

On 01/18/2013 03:36 PM, Peter Ujfalusi wrote:
> Hi,
> 
> Add the needed DT sections for twl4030 and twl6030 for the PWM childs.
> Update the omap4-sdp to have working backlight and keypad/charging LED support.
> Use the pwm-leds driver on BeagleBoard for the pmu_stat LED instead of the hacky
> twl403-gpio mapped PWM.
> 
> Regards,
> Peter
> ---
> Peter Ujfalusi (5):
>   ARM: dts: twl4030: Add PWM support
>   ARM: dts: twl6030: Add PWM support
>   ARM: dts: omap3-beagle-xm: Use pwm-leds for pmu_stat LED
>   ARM: dts: omap4-sdp: Add support for pwm-leds (keypad and charging LED)
>   ARM: dts: omap4-sdp: Add support for pwm-backlight
> 
>  arch/arm/boot/dts/omap3-beagle-xm.dts | 14 ++++++++++----
>  arch/arm/boot/dts/omap4-sdp.dts       | 26 ++++++++++++++++++++++++++
>  arch/arm/boot/dts/twl4030.dtsi        | 10 ++++++++++
>  arch/arm/boot/dts/twl6030.dtsi        | 12 ++++++++++++
>  4 files changed, 58 insertions(+), 4 deletions(-)
> 

^ permalink raw reply

* [PATCH v7 09/15] gpio: pl061: set initcall level to module init
From: Pawel Moll @ 2013-01-22 10:13 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <CACRpkdY4MHLjs1Lnj+8Ts6oZOjG14pDssCQ09PX-a_5nGRs1sg@mail.gmail.com>

On Tue, 2013-01-22 at 09:42 +0000, Linus Walleij wrote:
> AFAICT gpio_request() will return -EPROBE_DEFER if the GPIO
> cannot be located.

If it does, I withdraw all my objections.

Cheers!

Pawe?

^ permalink raw reply

* One of these things (CONFIG_HZ) is not like the others..
From: Santosh Shilimkar @ 2013-01-22 10:14 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <201301220931.24570.arnd@arndb.de>

On Tuesday 22 January 2013 03:01 PM, Arnd Bergmann wrote:
> On Tuesday 22 January 2013, Santosh Shilimkar wrote:
>> On Tuesday 22 January 2013 04:53 AM, Tony Lindgren wrote:
>>> * Russell King - ARM Linux <linux@arm.linux.org.uk> [130121 13:07]:
>>>>
>>>> As for Samsung and the rest I can't comment.  The original reason OMAP
>>>> used this though was because the 32768Hz counter can't produce 100Hz
>>>> without a .1% error - too much error under pre-clocksource
>>>> implementations for timekeeping.  Whether that's changed with the
>>>> clocksource/clockevent support needs to be checked.
>>>
>>> Yes that's why HZ was originally set to 128. That value (or some multiple)
>>> still makes sense when the 32 KiHZ clock source is being used. Of course
>>> we should rely on the local timer when running for the SoCs that have
>>> them.
>>>
>> This is right. It was only because of the drift associated when clocked
>> with 32KHz. Even on SOCs where local timers are available for power
>> management reasons we need to switch to 32KHz clocked device in
>> low power states. Hence the HZ value should be multiple of 32 on
>> OMAP.
>
> I need some help understanding what the two of you are saying, because
> it sounds to me that you imply we cannot have a multiplatform kernel
> that includes OMAP and another platform that needs (or wants) a different
> HZ value.
>
Sorry for not being clear enough. On OMAP, 32KHz is the only clock which
is always running(even during low power states) and hence the clock
source and clock event have been clocked using 32KHz clock. As mentioned
by RMK, with 32768 Hz clock and HZ = 100, there will be always an
error of 0.1 %. This accuracy also impacts the timer tick interval.
This was the reason, OMAP has been using the HZ = 128.

There is a hardware feature to implement 1 ms correction on the timer
to overcome such an issue but it was not supported on OMAP2 devices.
OMAP3/4/5 does support it. Though one attempt [1] was made to support
it in kernel. This will ofcourse will address the tick interval
corrections.

> However, I also thought that when using a proper clocksource driver,
> the HZ setting has absolutely no impact on the drift of the wall clock,
> because those two are decoupled.
>
I am not too sure about this. I was under impression that tick (clock
event) ticking accuracy does impact the kernel time keeping as well.

> Even when using the HZ based clocksource (for whatever reason you
> would want to do that), I thought there should be no drift as long
> as the CLOCK_TICK_RATE (in older kernels) or the register_refined_jiffies()
> (in older kernels) setting matches the hardware timer frequency.
>
> What am I missing?
>
The issue is with hardware timer frequency itself since with HZ = 100 or
200, the timer tick will not be accurate. Hope this gives bit more info.

Regards,
Santosh
[1] https://patchwork.kernel.org/patch/107364/

^ permalink raw reply

* OMAP baseline test results for v3.8-rc4
From: Mark Jackson @ 2013-01-22 10:15 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <alpine.DEB.2.00.1301220213390.25789@utopia.booyaka.com>

On 22/01/13 02:24, Paul Walmsley wrote:
> 
> Hi guys,
> 
> Regarding the AM33xx test failures with appended DTBs, it would be very 
> helpful if especially the TI people could try reproducing the problem.

My non-working setup (I'm using a recent U-Boot) is as follows ...

[Note that the DTB patch mentioned elsewhere in this thread seems to be *already* applied to -next]

$ git describe
next-20130121
$ make -j 8 ARCH=arm CROSS_COMPILE=arm-linux- omap2plus_defconfig
$ make -j 8 ARCH=arm CROSS_COMPILE=arm-linux- menuconfig
CONFIG_ARM_APPENDED_DTB=y
CONFIG_ARM_ATAG_DTB_COMPAT=y
CONFIG_EARLY_PRINTK=y
$ make -j 8 ARCH=arm CROSS_COMPILE=arm-linux-
$ cat arch/arm/boot/zImage arch/arm/boot/dtb/am335x-bone.dtb > arch/arm/boot/zImage-dtb.am335x-bone
$ scripts/mkuboot.sh -A arm -O linux -C none -T kernel -a 0?80008000 -e 0?80008000 -n ?Linux? -d
arch/arm/boot/zImage-dtb.am335x-bone arch/arm/boot/uImage-dtb.am335x-bone
$ cp arch/arm/boot/uImage-dtb.am335x-bone /tftpboot/nanobone/uImage-dtb

And when I boot:-

U-Boot SPL 2013.01 (Jan 16 2013 - 15:20:58)
OMAP SD/MMC: 0
reading u-boot.img
reading u-boot.img


U-Boot 2013.01 (Jan 16 2013 - 15:20:58)

I2C:   ready
DRAM:  256 MiB
WARNING: Caches not enabled
NAND:  No NAND device found!!!
0 MiB
MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
*** Warning - readenv() failed, using default environment

musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, bulk combine, bulk split, HB-ISO Rx, HB-ISO Tx, SoftConn)
musb-hdrc: MHDRC RTL version 2.0
musb-hdrc: setup fifo_mode 4
musb-hdrc: 28/31 max ep, 16384/16384 memory
USB Peripheral mode controller at 47401000 using PIO, IRQ 0
musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, bulk combine, bulk split, HB-ISO Rx, HB-ISO Tx, SoftConn)
musb-hdrc: MHDRC RTL version 2.0
musb-hdrc: setup fifo_mode 4
musb-hdrc: 28/31 max ep, 16384/16384 memory
USB Host mode controller at 47401800 using PIO, IRQ 0
Net:   cpsw, usb_ether
Hit any key to stop autoboot:  0
mmc0 is current device
SD/MMC found on device 0
reading uEnv.txt
167 bytes read in 3 ms (53.7 KiB/s)
Loaded environment from uEnv.txt
Importing environment from mmc ...
Running uenvcmd ...
cpsw Waiting for PHY auto negotiation to complete. done
link up on port 0, speed 100, full duplex
BOOTP broadcast 1
BOOTP broadcast 2
*** Unhandled DHCP Option in OFFER/ACK: 44
*** Unhandled DHCP Option in OFFER/ACK: 46
*** Unhandled DHCP Option in OFFER/ACK: 44
*** Unhandled DHCP Option in OFFER/ACK: 46
DHCP client bound to address 10.0.0.112
Using cpsw device
TFTP from server 10.0.0.100; our IP address is 10.0.0.112
Filename '/nanobone/uImage-dtb'.
Load address: 0x80000000
Loading: #################################################################
         #################################################################
         #################################################################
         #################################################################
         ###########
         627.9 KiB/s
done
Bytes transferred = 3963919 (3c7c0f hex)
## Booting kernel from Legacy Image at 80000000 ...
   Image Name:   Linux
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    3963855 Bytes = 3.8 MiB
   Load Address: 80008000
   Entry Point:  80008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK

Starting kernel ...

^ permalink raw reply

* [PATCH] ARM: dts: specify all the per-cpu interrupts of arch timer for exynos5440
From: Mark Rutland @ 2013-01-22 10:15 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1358818887-16870-1-git-send-email-kgene.kim@samsung.com>

On Tue, Jan 22, 2013 at 01:41:27AM +0000, Kukjin Kim wrote:
> From: Thomas Abraham <thomas.ab@samsung.com>
> 
> Need to be changed requirements in the 'cpus' node for exynos5440
> to specify all the per-cpu interrupts of arch timer.

The node(s) for the arch timer should not be in the cpus/cpu at N nodes.
Instead, there should be one node (in the root of the tree).

If this works currently it's only because the driver picks up one of the nodes,
and luckily it's the same as the others. This is not guaranteed to work in
future, and will likely break.

> 
> Signed-off-by: Thomas Abraham <thomas.ab@samsung.com>
> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
> ---
>  arch/arm/boot/dts/exynos5440.dtsi |   20 ++++++++++++++++----
>  1 file changed, 16 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/exynos5440.dtsi b/arch/arm/boot/dts/exynos5440.dtsi
> index 5406689..c5bd8ed 100644
> --- a/arch/arm/boot/dts/exynos5440.dtsi
> +++ b/arch/arm/boot/dts/exynos5440.dtsi
> @@ -28,7 +28,10 @@
>  			compatible = "arm,cortex-a15";
>  			timer {
>  				compatible = "arm,armv7-timer";
> -				interrupts = <1 13 0xf08>;
> +				interrupts = <1 13 0xf08>,
> +					     <1 14 0xf08>,
> +					     <1 11 0xf08>,
> +					     <1 10 0xf08>;

Also, this interrupts list is updated differently to all the other nodes. Typo?

>  				clock-frequency = <1000000>;
>  			};
>  		};
> @@ -36,7 +39,10 @@
>  			compatible = "arm,cortex-a15";
>  			timer {
>  				compatible = "arm,armv7-timer";
> -				interrupts = <1 14 0xf08>;
> +				interrupts = <1 13 0xf08>;
> +					     <1 14 0xf08>,
> +					     <1 11 0xf08>,
> +					     <1 10 0xf08>;
>  				clock-frequency = <1000000>;
>  			};
>  		};
> @@ -44,7 +50,10 @@
>  			compatible = "arm,cortex-a15";
>  			timer {
>  				compatible = "arm,armv7-timer";
> -				interrupts = <1 14 0xf08>;
> +				interrupts = <1 13 0xf08>;
> +					     <1 14 0xf08>,
> +					     <1 11 0xf08>,
> +					     <1 10 0xf08>;
>  				clock-frequency = <1000000>;
>  			};
>  		};
> @@ -52,7 +61,10 @@
>  			compatible = "arm,cortex-a15";
>  			timer {
>  				compatible = "arm,armv7-timer";
> -				interrupts = <1 14 0xf08>;
> +				interrupts = <1 13 0xf08>;
> +					     <1 14 0xf08>,
> +					     <1 11 0xf08>,
> +					     <1 10 0xf08>;
>  				clock-frequency = <1000000>;
>  			};
>  		};
> -- 
> 1.7.10.4
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> 

Please fix this up to only have one timer node, in the root of the tree.

Thanks,
Mark.

^ permalink raw reply

* [PATCH V2 2/2] mmc: mmci: Move ios_handler functionality into the driver
From: Lee Jones @ 2013-01-22 10:20 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20130122100607.GH23505@n2100.arm.linux.org.uk>

On Tue, 22 Jan 2013, Russell King - ARM Linux wrote:

> On Tue, Jan 22, 2013 at 10:53:42AM +0100, Linus Walleij wrote:
> > On Tue, Jan 22, 2013 at 10:00 AM, Lee Jones <lee.jones@linaro.org> wrote:
> > 
> > >> From: Lee Jones <lee.jones@linaro.org>
> > >>
> > >> There are currently two instances of the ios_handler being used.
> > >> Both of which mearly toy with some regulator settings. Now there
> > >> is a GPIO regulator API, we can use that instead, and lessen the
> > >> per platform burden. By doing this, we also become more Device
> > >> Tree compatible.
> > >
> > > Russell,
> > >
> > > Why is this patch in your tree with Ulf as the Author?
> > 
> > This is because of the way Russell's patch tracker works, it sets
> > Author: to the name of the person using the patch tracker and
> > discards the From: field in the beginning of the patch which
> > git am will conversely respect.
> 
> Actually, the reverse.  It does now respect the From: line, but the
> From: line will be ignored for all notifications about the patch
> because the patch system was never built to parse the actual comments
> when sending out the email notifications.

So what do I have to do to reaffirm myself as the author?

-- 
Lee Jones
Linaro ST-Ericsson Landing Team Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply

* [PATCH v7 09/15] gpio: pl061: set initcall level to module init
From: Pawel Moll @ 2013-01-22 10:21 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <CAD6h2NQ68PpT2z5WkCOdkznhe+ZFOhaZ9=Zpgsy9_Da_2eha=g@mail.gmail.com>

On Mon, 2013-01-21 at 23:33 +0000, Haojian Zhuang wrote:
> The sequence of module probe is pinctrl --> gpio --> mmc. So the dependance
> of mmc on gpio isn't broken.

I don't think you can guarantee the "gpio --> mmc" sequence if both
drivers use module_init (the order could be completely random, generally
it depends on what Kbuild is doing), but if gpio_request() behaves as
Linus said, the sequence in the problematic scenario would be "pinctrl
--> mmc --> EPROBE_DEFER --> gpio --> mmc" which is fine (subject to
mmci driver fix, but it's a separate issue).

Pawe?

^ permalink raw reply

* [PATCH 0/5] ARM: dts: OMAP3+: PWM support for TWL and selected boards
From: Benoit Cousson @ 2013-01-22 10:23 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <50FE65E2.9020301@ti.com>

Hi Peter,

On 01/22/2013 11:11 AM, Peter Ujfalusi wrote:
> Hi Benoit,
> 
> I have prepared for you a branch from where you can pull this set on top of
> mainline v3.8-rc4:

Cool thanks,
I'll merged it in my branch.

Thanks,
Benoit

> 
> Regards,
> P?ter
> 
> ---
> The following changes since commit 7d1f9aeff1ee4a20b1aeb377dd0f579fe9647619:
> 
>   Linux 3.8-rc4 (2013-01-17 19:25:45 -0800)
> 
> are available in the git repository at:
> 
>   git://gitorious.org/omap-audio/linux-audio.git peter/for-benoit
> 
> for you to fetch changes up to b6230ae20bc018d042d703d0667ba9e7ac027ccb:
> 
>   ARM: dts: omap4-sdp: Add support for pwm-backlight (2013-01-22 11:08:37 +0100)
> 
> ----------------------------------------------------------------
> Peter Ujfalusi (5):
>       ARM: dts: twl4030: Add PWM support
>       ARM: dts: twl6030: Add PWM support
>       ARM: dts: omap3-beagle-xm: Use pwm-leds for pmu_stat LED
>       ARM: dts: omap4-sdp: Add support for pwm-leds (keypad and charging LED)
>       ARM: dts: omap4-sdp: Add support for pwm-backlight
> 
>  arch/arm/boot/dts/omap3-beagle-xm.dts | 14 ++++++++++----
>  arch/arm/boot/dts/omap4-sdp.dts       | 26 ++++++++++++++++++++++++++
>  arch/arm/boot/dts/twl4030.dtsi        | 10 ++++++++++
>  arch/arm/boot/dts/twl6030.dtsi        | 12 ++++++++++++
>  4 files changed, 58 insertions(+), 4 deletions(-)
> 
> On 01/18/2013 03:36 PM, Peter Ujfalusi wrote:
>> Hi,
>>
>> Add the needed DT sections for twl4030 and twl6030 for the PWM childs.
>> Update the omap4-sdp to have working backlight and keypad/charging LED support.
>> Use the pwm-leds driver on BeagleBoard for the pmu_stat LED instead of the hacky
>> twl403-gpio mapped PWM.
>>
>> Regards,
>> Peter
>> ---
>> Peter Ujfalusi (5):
>>   ARM: dts: twl4030: Add PWM support
>>   ARM: dts: twl6030: Add PWM support
>>   ARM: dts: omap3-beagle-xm: Use pwm-leds for pmu_stat LED
>>   ARM: dts: omap4-sdp: Add support for pwm-leds (keypad and charging LED)
>>   ARM: dts: omap4-sdp: Add support for pwm-backlight
>>
>>  arch/arm/boot/dts/omap3-beagle-xm.dts | 14 ++++++++++----
>>  arch/arm/boot/dts/omap4-sdp.dts       | 26 ++++++++++++++++++++++++++
>>  arch/arm/boot/dts/twl4030.dtsi        | 10 ++++++++++
>>  arch/arm/boot/dts/twl6030.dtsi        | 12 ++++++++++++
>>  4 files changed, 58 insertions(+), 4 deletions(-)
>>
> 
> 

^ permalink raw reply

* [PATCH] Dove: activate GPIO interrupts in DT
From: Jean-Francois Moine @ 2013-01-22 10:28 UTC (permalink / raw)
  To: linux-arm-kernel

In a DT, the interrupts of an interrupt-controller are not usable when
#interrupt-cells is missing.

This patch activates the interrupts of the GPIOs 0 and 1 for the Marvell
Dove SoC.

Signed-off-by: Jean-Fran?ois Moine <moinejf@free.fr>

diff --git a/arch/arm/boot/dts/dove.dtsi b/arch/arm/boot/dts/dove.dtsi
index 42eac1f..287fb12 100644
--- a/arch/arm/boot/dts/dove.dtsi
+++ b/arch/arm/boot/dts/dove.dtsi
@@ -93,6 +93,7 @@
 			reg = <0xd0400 0x20>;
 			ngpios = <32>;
 			interrupt-controller;
+			#interrupt-cells = <1>;
 			interrupts = <12>, <13>, <14>, <60>;
 		};
 
@@ -103,6 +104,7 @@
 			reg = <0xd0420 0x20>;
 			ngpios = <32>;
 			interrupt-controller;
+			#interrupt-cells = <1>;
 			interrupts = <61>;
 		};
 
-- 
Ken ar c'henta?	|	      ** Breizh ha Linux atav! **
Jef		|		http://moinejf.free.fr/

^ permalink raw reply related

* [PATCH v1 5/6] usb: otg: add device tree support to otg library
From: Mark Rutland @ 2013-01-22 10:36 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1358848694-20145-6-git-send-email-kishon@ti.com>

> +struct usb_phy *devm_usb_get_phy_by_phandle(struct device *dev,
> +	const char *phandle, u8 index)
> +{
> +	struct usb_phy	*phy = NULL, **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);
> +	}

At any point past this, node's refcount is incremented (done automatically by
of_parse_phandle => of_find_node_by_phandle).

> +
> +	ptr = devres_alloc(devm_usb_phy_release, sizeof(*ptr), GFP_KERNEL);
> +	if (!ptr) {
> +		dev_dbg(dev, "failed to allocate memory for devres\n");
> +		return ERR_PTR(-ENOMEM);
> +	}
> +
> +	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 err0;
> +	}
> +
> +	*ptr = phy;
> +	devres_add(dev, ptr);
> +
> +	get_device(phy->dev);
> +
> +err0:
> +	spin_unlock_irqrestore(&phy_lock, flags);
> +
> +	return phy;
> +}

This means that on all of the exit paths, node's refcount is left incremented
incorrectly. You'll need an of_node_put(node) on each exit path.

Thanks,
Mark.

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox