usb: chipidea: usbmisc: Add support for i.MX27/i.MX31 CPUs
PATCH v2 1/2 usb: chipidea: usbmisc: Add support for i.MX27/i.MX31 CPUs
This adds i.MX27 and i.MX31 as the next user of the usbmisc driver.
--- drivers/usb/chipidea/usbmisc_imx.c | 42 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+)
drivers/usb/chipidea/usbmisc_imx.c +42 -0
@@ -21,6 +21,10 @@#define MX25_USB_PHY_CTRL_OFFSET 0x08#define MX25_BM_EXTERNAL_VBUS_DIVIDER BIT(23) +#define MX27_H1_PM_BIT BIT(8) +#define MX27_H2_PM_BIT BIT(16) +#define MX27_OTG_PM_BIT BIT(24) +#define MX53_USB_OTG_PHY_CTRL_0_OFFSET 0x08#define MX53_USB_UH2_CTRL_OFFSET 0x14#define MX53_USB_UH3_CTRL_OFFSET 0x18
@@ -68,6 +72,36 @@ static int usbmisc_imx25_post(struct imx_usbmisc_data *data)return 0 ; } +static int usbmisc_imx27_init (struct imx_usbmisc_data *data) +{ +unsigned long flags; +u32 val; + +switch (data->index) { +case 0 : + val =MX27_OTG_PM_BIT ; +break ; +case 1 : + val =MX27_H1_PM_BIT ; +break ; +case 2 : + val =MX27_H2_PM_BIT ; +break ; +default : +return -EINVAL ; + }; + +spin_lock_irqsave (&usbmisc->lock, flags); +if (data->disable_oc) + val =readl (usbmisc->base) | val; +else + val =readl (usbmisc->base) & ~val; +writel (val, usbmisc->base); +spin_unlock_irqrestore (&usbmisc->lock, flags); + +return 0 ; +} +static int usbmisc_imx53_init (struct imx_usbmisc_data *data) {void __iomem *reg =NULL ;
@@ -128,6 +162,10 @@ static const struct usbmisc_ops imx25_usbmisc_ops = { .post = usbmisc_imx25_post, }; +static const struct usbmisc_ops imx27_usbmisc_ops = { + .init = usbmisc_imx27_init, +}; +static const struct usbmisc_ops imx53_usbmisc_ops = { .init = usbmisc_imx53_init, };
@@ -162,6 +200,10 @@ static const struct of_device_id usbmisc_imx_dt_ids[] = { .data = &imx25_usbmisc_ops, }, { + .compatible = "fsl,imx27-usbmisc", + .data = &imx27_usbmisc_ops, + }, + { .compatible = "fsl,imx53-usbmisc", .data = &imx53_usbmisc_ops, },
Signature · 1 line
1.8.3.2
PATCH v2 2/2 usb: chipidea: usbmisc: Add support for i.MX51 CPU
This adds i.MX51 as the next user of the usbmisc driver. Functionality is similar to i.MX53, so at this stage simply reuse existing i.MX53 calls.
--- drivers/usb/chipidea/usbmisc_imx.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/usb/chipidea/usbmisc_imx.c +4 -0
@@ -204,6 +204,10 @@ static const struct of_device_id usbmisc_imx_dt_ids[] = { .data = &imx27_usbmisc_ops, }, { + .compatible = "fsl,imx51-usbmisc", + .data = &imx53_usbmisc_ops, + }, + { .compatible = "fsl,imx53-usbmisc", .data = &imx53_usbmisc_ops, },
Signature · 1 line
1.8.3.2
PATCH v2 2/2 usb: chipidea: usbmisc: Add support for i.MX51 CPU
Quoted 14 lines · Alexander Shiyan
This adds i.MX51 as the next user of the usbmisc driver. Functionality is similar to i.MX53, so at this stage simply reuse existing i.MX53 calls.
Signed-off-by Alexander Shiyan <[email protected]>--- drivers/usb/chipidea/usbmisc_imx.c | 4 ++++ 1 file changed, 4 insertions(+)drivers/usb/chipidea/usbmisc_imx.c +0
-0
drivers/usb/chipidea/usbmisc_imx.c static const struct of_device_id usbmisc_imx_dt_ids[] = { · line 208
Quoted 5 lines
drivers/usb/chipidea/usbmisc_imx.c +2
-0@@ -204,6 +204,10 @@ static const struct of_device_id usbmisc_imx_dt_ids[] = { .data = &imx27_usbmisc_ops, }, { + .compatible = "fsl,imx51-usbmisc", + .data = &imx53_usbmisc_ops,
If it simply uses imx53 ops, why do we need to introduce a new compatible?
Shawn
Quoted 8 lines
drivers/usb/chipidea/usbmisc_imx.c +2
-0+ }, + { .compatible = "fsl,imx53-usbmisc", .data = &imx53_usbmisc_ops, },Signature · 1 line
1.8.3.2
Re: [PATCH v2 2/2] usb: chipidea: usbmisc: Add support for i.MX51 CPU
Hello.
Quoted 10 lines · Alexander Shiyan
Quoted 9 lines
This adds i.MX51 as the next user of the usbmisc driver. Functionality is similar to i.MX53, so at this stage simply reuse existing i.MX53 calls.
Signed-off-by Alexander Shiyan <[email protected]>--- drivers/usb/chipidea/usbmisc_imx.c | 4 ++++ 1 file changed, 4 insertions(+)
Quoted 13 lines
drivers/usb/chipidea/usbmisc_imx.c static const struct of_device_id usbmisc_imx_dt_ids[] = { · line 208
Quoted 10 lines
drivers/usb/chipidea/usbmisc_imx.c +2
-0@@ -204,6 +204,10 @@ static const struct of_device_id usbmisc_imx_dt_ids[] = { .data = &imx27_usbmisc_ops, }, { + .compatible = "fsl,imx51-usbmisc", + .data = &imx53_usbmisc_ops,If it simply uses imx53 ops, why do we need to introduce a new compatible?
This has been discussed here:
http://www.spinics.net/lists/linux-usb/msg97502.html
Additionally, "fsl,imx51-usbmisc" string already present in imx51.dtsi. Thanks.
---
PATCH v2 2/2 usb: chipidea: usbmisc: Add support for i.MX51 CPU
In reply to Alexander ShiyanQuoted 27 lines
This adds i.MX51 as the next user of the usbmisc driver. Functionality is similar to i.MX53, so at this stage simply reuse existing i.MX53 calls.
Signed-off-by Alexander Shiyan <[email protected]>--- drivers/usb/chipidea/usbmisc_imx.c | 4 ++++ 1 file changed, 4 insertions(+)drivers/usb/chipidea/usbmisc_imx.c +4
-0@@ -204,6 +204,10 @@ static const struct of_device_id usbmisc_imx_dt_ids[] = { .data = &imx27_usbmisc_ops, }, { + .compatible = "fsl,imx51-usbmisc", + .data = &imx53_usbmisc_ops, + }, + { .compatible = "fsl,imx53-usbmisc", .data = &imx53_usbmisc_ops,
Quoted 2 lines
},
--
Peter
Peter Chen
AppliedPATCH v2 2/2 usb: chipidea: usbmisc: Add support for i.MX51 CPU
In reply to Alexander ShiyanQuoted 28 lines · Alexander Shiyan
This adds i.MX51 as the next user of the usbmisc driver. Functionality is similar to i.MX53, so at this stage simply reuse existing i.MX53 calls.
Signed-off-by Alexander Shiyan <[email protected]>--- drivers/usb/chipidea/usbmisc_imx.c | 4 ++++ 1 file changed, 4 insertions(+)drivers/usb/chipidea/usbmisc_imx.c +4
-0@@ -204,6 +204,10 @@ static const struct of_device_id usbmisc_imx_dt_ids[] = { .data = &imx27_usbmisc_ops, }, { + .compatible = "fsl,imx51-usbmisc", + .data = &imx53_usbmisc_ops, + }, + { .compatible = "fsl,imx53-usbmisc", .data = &imx53_usbmisc_ops, },Signature · 1 line
1.8.3.2
Applied, thanks.
Signature · 2 lines
Best Regards, Peter Chen
PATCH v2 1/2 usb: chipidea: usbmisc: Add support for i.MX27/i.MX31 CPUs
In reply to Alexander ShiyanQuoted 88 lines
This adds i.MX27 and i.MX31 as the next user of the usbmisc driver.
Signed-off-by Alexander Shiyan <[email protected]>--- drivers/usb/chipidea/usbmisc_imx.c | 42 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+)drivers/usb/chipidea/usbmisc_imx.c +34
-0@@ -21,6 +21,10 @@#define MX25_USB_PHY_CTRL_OFFSET 0x08#define MX25_BM_EXTERNAL_VBUS_DIVIDER BIT(23) +#define MX27_H1_PM_BIT BIT(8) +#define MX27_H2_PM_BIT BIT(16) +#define MX27_OTG_PM_BIT BIT(24) +#define MX53_USB_OTG_PHY_CTRL_0_OFFSET 0x08#define MX53_USB_UH2_CTRL_OFFSET 0x14#define MX53_USB_UH3_CTRL_OFFSET 0x18@@ -68,6 +72,36 @@ static int usbmisc_imx25_post(struct imx_usbmisc_data *data)return 0 ; } +static int usbmisc_imx27_init (struct imx_usbmisc_data *data) +{ +unsigned long flags; +u32 val; + +switch (data->index) { +case 0 : + val =MX27_OTG_PM_BIT ; +break ; +case 1 : + val =MX27_H1_PM_BIT ; +break ; +case 2 : + val =MX27_H2_PM_BIT ; +break ; +default : +return -EINVAL ; + }; + +spin_lock_irqsave (&usbmisc->lock, flags); +if (data->disable_oc) + val =readl (usbmisc->base) | val; +else + val =readl (usbmisc->base) & ~val; +writel (val, usbmisc->base); +spin_unlock_irqrestore (&usbmisc->lock, flags); + +return 0 ; +} +static int usbmisc_imx53_init (struct imx_usbmisc_data *data) {drivers/usb/chipidea/usbmisc_imx.c +4
-0void __iomem *reg =NULL ;@@ -128,6 +162,10 @@ static const struct usbmisc_ops imx25_usbmisc_ops = { .post = usbmisc_imx25_post, }; +static const struct usbmisc_ops imx27_usbmisc_ops = { + .init = usbmisc_imx27_init, +}; +static const struct usbmisc_ops imx53_usbmisc_ops = { .init = usbmisc_imx53_init,};
drivers/usb/chipidea/usbmisc_imx.c +4
-0@@ -162,6 +200,10 @@ static const struct of_device_id usbmisc_imx_dt_ids[] = { .data = &imx25_usbmisc_ops, }, { + .compatible = "fsl,imx27-usbmisc", + .data = &imx27_usbmisc_ops, + }, + { .compatible = "fsl,imx53-usbmisc", .data = &imx53_usbmisc_ops,
Quoted 2 lines
},
--
Peter
PATCH v2 1/2 usb: chipidea: usbmisc: Add support for i.MX27/i.MX31 CPUs
In reply to Alexander ShiyanQuoted 71 lines · Alexander Shiyan
This adds i.MX27 and i.MX31 as the next user of the usbmisc driver.
Signed-off-by Alexander Shiyan<[email protected]>--- drivers/usb/chipidea/usbmisc_imx.c | 42 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+)drivers/usb/chipidea/usbmisc_imx.c +38
-0@@ -21,6 +21,10 @@#define MX25_USB_PHY_CTRL_OFFSET 0x08#define MX25_BM_EXTERNAL_VBUS_DIVIDER BIT(23) +#define MX27_H1_PM_BIT BIT(8) +#define MX27_H2_PM_BIT BIT(16) +#define MX27_OTG_PM_BIT BIT(24) +#define MX53_USB_OTG_PHY_CTRL_0_OFFSET 0x08#define MX53_USB_UH2_CTRL_OFFSET 0x14#define MX53_USB_UH3_CTRL_OFFSET 0x18@@ -68,6 +72,36 @@ static int usbmisc_imx25_post(struct imx_usbmisc_data *data)return 0 ; } +static int usbmisc_imx27_init (struct imx_usbmisc_data *data) +{ +unsigned long flags; +u32 val; + +switch (data->index) { +case 0 : + val =MX27_OTG_PM_BIT ; +break ; +case 1 : + val =MX27_H1_PM_BIT ; +break ; +case 2 : + val =MX27_H2_PM_BIT ; +break ; +default : +return -EINVAL ; + }; + +spin_lock_irqsave (&usbmisc->lock, flags); +if (data->disable_oc) + val =readl (usbmisc->base) | val; +else + val =readl (usbmisc->base)& ~val; +writel (val, usbmisc->base); +spin_unlock_irqrestore (&usbmisc->lock, flags); + +return 0 ; +} +static int usbmisc_imx53_init (struct imx_usbmisc_data *data) {void __iomem *reg =NULL ;@@ -128,6 +162,10 @@ static const struct usbmisc_ops imx25_usbmisc_ops = { .post = usbmisc_imx25_post, }; +static const struct usbmisc_ops imx27_usbmisc_ops = { + .init = usbmisc_imx27_init, +}; +static const struct usbmisc_ops imx53_usbmisc_ops = { .init = usbmisc_imx53_init, };
drivers/usb/chipidea/usbmisc_imx.c static const struct of_device_id usbmisc_imx_dt_ids[] = { · line 209
Quoted 10 lines
drivers/usb/chipidea/usbmisc_imx.c +4
-0@@ -162,6 +200,10 @@ static const struct of_device_id usbmisc_imx_dt_ids[] = { .data =&imx25_usbmisc_ops, }, { + .compatible = "fsl,imx27-usbmisc", + .data =&imx27_usbmisc_ops, + }, + { .compatible = "fsl,imx53-usbmisc", .data =&imx53_usbmisc_ops, },
Tested and works fine.
Regards
Chris
Peter Chen
AppliedPATCH v2 1/2 usb: chipidea: usbmisc: Add support for i.MX27/i.MX31 CPUs
In reply to Alexander ShiyanQuoted 85 lines · Alexander Shiyan
This adds i.MX27 and i.MX31 as the next user of the usbmisc driver.
Signed-off-by Alexander Shiyan <[email protected]>--- drivers/usb/chipidea/usbmisc_imx.c | 42 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+)drivers/usb/chipidea/usbmisc_imx.c +42
-0@@ -21,6 +21,10 @@#define MX25_USB_PHY_CTRL_OFFSET 0x08#define MX25_BM_EXTERNAL_VBUS_DIVIDER BIT(23) +#define MX27_H1_PM_BIT BIT(8) +#define MX27_H2_PM_BIT BIT(16) +#define MX27_OTG_PM_BIT BIT(24) +#define MX53_USB_OTG_PHY_CTRL_0_OFFSET 0x08#define MX53_USB_UH2_CTRL_OFFSET 0x14#define MX53_USB_UH3_CTRL_OFFSET 0x18@@ -68,6 +72,36 @@ static int usbmisc_imx25_post(struct imx_usbmisc_data *data)return 0 ; } +static int usbmisc_imx27_init (struct imx_usbmisc_data *data) +{ +unsigned long flags; +u32 val; + +switch (data->index) { +case 0 : + val =MX27_OTG_PM_BIT ; +break ; +case 1 : + val =MX27_H1_PM_BIT ; +break ; +case 2 : + val =MX27_H2_PM_BIT ; +break ; +default : +return -EINVAL ; + }; + +spin_lock_irqsave (&usbmisc->lock, flags); +if (data->disable_oc) + val =readl (usbmisc->base) | val; +else + val =readl (usbmisc->base) & ~val; +writel (val, usbmisc->base); +spin_unlock_irqrestore (&usbmisc->lock, flags); + +return 0 ; +} +static int usbmisc_imx53_init (struct imx_usbmisc_data *data) {void __iomem *reg =NULL ;@@ -128,6 +162,10 @@ static const struct usbmisc_ops imx25_usbmisc_ops = { .post = usbmisc_imx25_post, }; +static const struct usbmisc_ops imx27_usbmisc_ops = { + .init = usbmisc_imx27_init, +}; +static const struct usbmisc_ops imx53_usbmisc_ops = { .init = usbmisc_imx53_init, };@@ -162,6 +200,10 @@ static const struct of_device_id usbmisc_imx_dt_ids[] = { .data = &imx25_usbmisc_ops, }, { + .compatible = "fsl,imx27-usbmisc", + .data = &imx27_usbmisc_ops, + }, + { .compatible = "fsl,imx53-usbmisc", .data = &imx53_usbmisc_ops, },Signature · 1 line
1.8.3.2
Applied, thanks.
Signature · 2 lines
Best Regards, Peter Chen