diff mbox

[3/3] USB mxs-phy: Register phy with framework

Message ID 1361974590-21237-4-git-send-email-mkl@pengutronix.de (mailing list archive)
State New, archived
Headers show

Commit Message

Marc Kleine-Budde Feb. 27, 2013, 2:16 p.m. UTC
From: Sascha Hauer <s.hauer@pengutronix.de>

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.

Reviewed-by: Kishon Vijay Abraham I <kishon@ti.com>
Reviewed-by: Peter Chen <peter.chen@freescale.com>
Acked-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 drivers/usb/otg/mxs-phy.c |    9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Felipe Balbi Feb. 28, 2013, 8:01 a.m. UTC | #1
hi,

On Wed, Feb 27, 2013 at 03:16:30PM +0100, Marc Kleine-Budde wrote:
> From: Sascha Hauer <s.hauer@pengutronix.de>
> 
> 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.
> 
> Reviewed-by: Kishon Vijay Abraham I <kishon@ti.com>
> Reviewed-by: Peter Chen <peter.chen@freescale.com>
> Acked-by: Felipe Balbi <balbi@ti.com>
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>

any chance you can move away from {write,read}[bwl]_relaxed() so we can
build this driver on other architectures ?
Marc Kleine-Budde Feb. 28, 2013, 9:21 a.m. UTC | #2
On 02/28/2013 09:01 AM, Felipe Balbi wrote:
> hi,
> 
> On Wed, Feb 27, 2013 at 03:16:30PM +0100, Marc Kleine-Budde wrote:
>> From: Sascha Hauer <s.hauer@pengutronix.de>
>>
>> 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.
>>
>> Reviewed-by: Kishon Vijay Abraham I <kishon@ti.com>
>> Reviewed-by: Peter Chen <peter.chen@freescale.com>
>> Acked-by: Felipe Balbi <balbi@ti.com>
>> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
>> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
> 
> any chance you can move away from {write,read}[bwl]_relaxed() so we can
> build this driver on other architectures ?

The hardware is in the ARM imx2{2,8} only. Another option would be to
add an "depends on ARCH_ARM".

Marc
Alexander Shishkin Feb. 28, 2013, 9:40 a.m. UTC | #3
Marc Kleine-Budde <mkl@pengutronix.de> writes:

> On 02/28/2013 09:01 AM, Felipe Balbi wrote:
>> hi,
>> 
>> On Wed, Feb 27, 2013 at 03:16:30PM +0100, Marc Kleine-Budde wrote:
>>> From: Sascha Hauer <s.hauer@pengutronix.de>
>>>
>>> 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.
>>>
>>> Reviewed-by: Kishon Vijay Abraham I <kishon@ti.com>
>>> Reviewed-by: Peter Chen <peter.chen@freescale.com>
>>> Acked-by: Felipe Balbi <balbi@ti.com>
>>> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
>>> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
>> 
>> any chance you can move away from {write,read}[bwl]_relaxed() so we can
>> build this driver on other architectures ?
>
> The hardware is in the ARM imx2{2,8} only. Another option would be to
> add an "depends on ARCH_ARM".

Doesn't mean that we shouldn't be able to compile-test the driver.

Regards,
--
Alex
Marc Kleine-Budde Feb. 28, 2013, 10:55 a.m. UTC | #4
On 02/28/2013 10:40 AM, Alexander Shishkin wrote:
> Marc Kleine-Budde <mkl@pengutronix.de> writes:
> 
>> On 02/28/2013 09:01 AM, Felipe Balbi wrote:
>>> hi,
>>>
>>> On Wed, Feb 27, 2013 at 03:16:30PM +0100, Marc Kleine-Budde wrote:
>>>> From: Sascha Hauer <s.hauer@pengutronix.de>
>>>>
>>>> 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.
>>>>
>>>> Reviewed-by: Kishon Vijay Abraham I <kishon@ti.com>
>>>> Reviewed-by: Peter Chen <peter.chen@freescale.com>
>>>> Acked-by: Felipe Balbi <balbi@ti.com>
>>>> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
>>>> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
>>>
>>> any chance you can move away from {write,read}[bwl]_relaxed() so we can
>>> build this driver on other architectures ?
>>
>> The hardware is in the ARM imx2{2,8} only. Another option would be to
>> add an "depends on ARCH_ARM".
> 
> Doesn't mean that we shouldn't be able to compile-test the driver.

Fixed in the just posted otg-for-v3.10-v2 series.

Marc
diff mbox

Patch

diff --git a/drivers/usb/otg/mxs-phy.c b/drivers/usb/otg/mxs-phy.c
index b0d9f11..aa40325 100644
--- a/drivers/usb/otg/mxs-phy.c
+++ b/drivers/usb/otg/mxs-phy.c
@@ -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;