* [PATCH 0/2] EXYNOS4: Add device tree support for USB/EHCI @ 2012-12-26 18:42 Dongjin Kim 2012-12-26 18:42 ` Dongjin Kim 2012-12-26 18:42 ` [PATCH 2/2] USB: ehci-s5p: Add to get interrupt from DT Dongjin Kim 0 siblings, 2 replies; 7+ messages in thread From: Dongjin Kim @ 2012-12-26 18:42 UTC (permalink / raw) To: linux-samsung-soc; +Cc: Dongjin Kim This patch set adds device tree upport for USB/EHCI device. Dongjin Kim (2): ARM: dts: Add EHCI device tree node for Exynos4 USB: ehci-s5p: Add to get interrupt from DT arch/arm/boot/dts/exynos4.dtsi | 7 +++++++ arch/arm/mach-exynos/mach-exynos4-dt.c | 9 +++++++++ drivers/usb/host/ehci-s5p.c | 8 +++++++- 3 files changed, 23 insertions(+), 1 deletion(-) -- 1.7.10.4 ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/2] ARM: dts: Add EHCI device tree node for Exynos4 2012-12-26 18:42 [PATCH 0/2] EXYNOS4: Add device tree support for USB/EHCI Dongjin Kim @ 2012-12-26 18:42 ` Dongjin Kim 2012-12-26 18:42 ` [PATCH 2/2] USB: ehci-s5p: Add to get interrupt from DT Dongjin Kim 1 sibling, 0 replies; 7+ messages in thread From: Dongjin Kim @ 2012-12-26 18:42 UTC (permalink / raw) To: linux-samsung-soc Cc: Dongjin Kim, Russell King, Kukjin Kim, Tomasz Figa, Kyungmin Park, Thomas Abraham, linux-arm-kernel, linux-kernel This patch adds EHCI device node on device tree for Exynos4 and defines its default platform data, s5p_usb_phy_init and s5p_usb_phy_exit, so that those function can be called from the driver. Signed-off-by: Dongjin Kim <tobetter@gmail.com> --- arch/arm/boot/dts/exynos4.dtsi | 7 +++++++ arch/arm/mach-exynos/mach-exynos4-dt.c | 9 +++++++++ 2 files changed, 16 insertions(+) diff --git a/arch/arm/boot/dts/exynos4.dtsi b/arch/arm/boot/dts/exynos4.dtsi index 92bca86..df1a9f0 100644 --- a/arch/arm/boot/dts/exynos4.dtsi +++ b/arch/arm/boot/dts/exynos4.dtsi @@ -140,6 +140,13 @@ status = "disabled"; }; + ehci@12580000 { + compatible = "samsung,exynos-ehci"; + reg = <0x12580000 0x100>; + interrupts = <0 70 0>; + status = "disabled"; + }; + serial@13800000 { compatible = "samsung,exynos4210-uart"; reg = <0x13800000 0x100>; diff --git a/arch/arm/mach-exynos/mach-exynos4-dt.c b/arch/arm/mach-exynos/mach-exynos4-dt.c index 92757ff..c8a23f0 100644 --- a/arch/arm/mach-exynos/mach-exynos4-dt.c +++ b/arch/arm/mach-exynos/mach-exynos4-dt.c @@ -13,6 +13,7 @@ #include <linux/of_platform.h> #include <linux/serial_core.h> +#include <linux/platform_data/usb-ehci-s5p.h> #include <asm/mach/arch.h> #include <asm/hardware/gic.h> @@ -20,9 +21,15 @@ #include <plat/cpu.h> #include <plat/regs-serial.h> +#include <plat/usb-phy.h> #include "common.h" +static struct s5p_ehci_platdata s5p_ehci_platdata = { + .phy_init = s5p_usb_phy_init, + .phy_exit = s5p_usb_phy_exit, +}; + /* * The following lookup table is used to override device names when devices * are registered from device tree. This is temporarily added to enable @@ -80,6 +87,8 @@ static const struct of_dev_auxdata exynos4_auxdata_lookup[] __initconst = { OF_DEV_AUXDATA("arm,pl330", EXYNOS4_PA_MDMA1, "dma-pl330.2", NULL), OF_DEV_AUXDATA("samsung,exynos4210-tmu", EXYNOS4_PA_TMU, "exynos-tmu", NULL), + OF_DEV_AUXDATA("samsung,exynos-ehci", EXYNOS4_PA_EHCI, + "s5p-ehci", &s5p_ehci_platdata), {}, }; -- 1.7.10.4 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 1/2] ARM: dts: Add EHCI device tree node for Exynos4 @ 2012-12-26 18:42 ` Dongjin Kim 0 siblings, 0 replies; 7+ messages in thread From: Dongjin Kim @ 2012-12-26 18:42 UTC (permalink / raw) To: linux-arm-kernel This patch adds EHCI device node on device tree for Exynos4 and defines its default platform data, s5p_usb_phy_init and s5p_usb_phy_exit, so that those function can be called from the driver. Signed-off-by: Dongjin Kim <tobetter@gmail.com> --- arch/arm/boot/dts/exynos4.dtsi | 7 +++++++ arch/arm/mach-exynos/mach-exynos4-dt.c | 9 +++++++++ 2 files changed, 16 insertions(+) diff --git a/arch/arm/boot/dts/exynos4.dtsi b/arch/arm/boot/dts/exynos4.dtsi index 92bca86..df1a9f0 100644 --- a/arch/arm/boot/dts/exynos4.dtsi +++ b/arch/arm/boot/dts/exynos4.dtsi @@ -140,6 +140,13 @@ status = "disabled"; }; + ehci at 12580000 { + compatible = "samsung,exynos-ehci"; + reg = <0x12580000 0x100>; + interrupts = <0 70 0>; + status = "disabled"; + }; + serial at 13800000 { compatible = "samsung,exynos4210-uart"; reg = <0x13800000 0x100>; diff --git a/arch/arm/mach-exynos/mach-exynos4-dt.c b/arch/arm/mach-exynos/mach-exynos4-dt.c index 92757ff..c8a23f0 100644 --- a/arch/arm/mach-exynos/mach-exynos4-dt.c +++ b/arch/arm/mach-exynos/mach-exynos4-dt.c @@ -13,6 +13,7 @@ #include <linux/of_platform.h> #include <linux/serial_core.h> +#include <linux/platform_data/usb-ehci-s5p.h> #include <asm/mach/arch.h> #include <asm/hardware/gic.h> @@ -20,9 +21,15 @@ #include <plat/cpu.h> #include <plat/regs-serial.h> +#include <plat/usb-phy.h> #include "common.h" +static struct s5p_ehci_platdata s5p_ehci_platdata = { + .phy_init = s5p_usb_phy_init, + .phy_exit = s5p_usb_phy_exit, +}; + /* * The following lookup table is used to override device names when devices * are registered from device tree. This is temporarily added to enable @@ -80,6 +87,8 @@ static const struct of_dev_auxdata exynos4_auxdata_lookup[] __initconst = { OF_DEV_AUXDATA("arm,pl330", EXYNOS4_PA_MDMA1, "dma-pl330.2", NULL), OF_DEV_AUXDATA("samsung,exynos4210-tmu", EXYNOS4_PA_TMU, "exynos-tmu", NULL), + OF_DEV_AUXDATA("samsung,exynos-ehci", EXYNOS4_PA_EHCI, + "s5p-ehci", &s5p_ehci_platdata), {}, }; -- 1.7.10.4 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/2] USB: ehci-s5p: Add to get interrupt from DT 2012-12-26 18:42 [PATCH 0/2] EXYNOS4: Add device tree support for USB/EHCI Dongjin Kim 2012-12-26 18:42 ` Dongjin Kim @ 2012-12-26 18:42 ` Dongjin Kim 2012-12-26 20:18 ` Sergei Shtylyov 1 sibling, 1 reply; 7+ messages in thread From: Dongjin Kim @ 2012-12-26 18:42 UTC (permalink / raw) To: linux-samsung-soc Cc: Dongjin Kim, Alan Stern, Greg Kroah-Hartman, linux-usb, linux-kernel This patch support to get interrupt resource from device tree as well as platform device if ehci node is defined in device tree and it's irq is described. Signed-off-by: Dongjin Kim <tobetter@gmail.com> --- drivers/usb/host/ehci-s5p.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/usb/host/ehci-s5p.c b/drivers/usb/host/ehci-s5p.c index 319dcfa..0fc5e5e 100644 --- a/drivers/usb/host/ehci-s5p.c +++ b/drivers/usb/host/ehci-s5p.c @@ -16,6 +16,7 @@ #include <linux/of.h> #include <linux/platform_device.h> #include <linux/of_gpio.h> +#include <linux/of_irq.h> #include <linux/platform_data/usb-ehci-s5p.h> #include <plat/usb-phy.h> @@ -156,7 +157,12 @@ static int s5p_ehci_probe(struct platform_device *pdev) goto fail_io; } - irq = platform_get_irq(pdev, 0); + if (pdev->dev.of_node) + irq = irq_of_parse_and_map(pdev->dev.of_node, 0); + else { + irq = platform_get_irq(pdev, 0); + } + if (!irq) { dev_err(&pdev->dev, "Failed to get IRQ\n"); err = -ENODEV; -- 1.7.10.4 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2] USB: ehci-s5p: Add to get interrupt from DT 2012-12-26 18:42 ` [PATCH 2/2] USB: ehci-s5p: Add to get interrupt from DT Dongjin Kim @ 2012-12-26 20:18 ` Sergei Shtylyov [not found] ` <50DB5B80.50801-Igf4POYTYCDQT0dZR+AlfA@public.gmane.org> 0 siblings, 1 reply; 7+ messages in thread From: Sergei Shtylyov @ 2012-12-26 20:18 UTC (permalink / raw) To: Dongjin Kim Cc: linux-samsung-soc, Alan Stern, Greg Kroah-Hartman, linux-usb, linux-kernel Hello. On 12/26/2012 09:42 PM, Dongjin Kim wrote: > This patch support to get interrupt resource from device tree as well as > platform device if ehci node is defined in device tree and it's irq is > described. > Signed-off-by: Dongjin Kim <tobetter@gmail.com> > --- > drivers/usb/host/ehci-s5p.c | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > diff --git a/drivers/usb/host/ehci-s5p.c b/drivers/usb/host/ehci-s5p.c > index 319dcfa..0fc5e5e 100644 > --- a/drivers/usb/host/ehci-s5p.c > +++ b/drivers/usb/host/ehci-s5p.c > @@ -16,6 +16,7 @@ > #include <linux/of.h> > #include <linux/platform_device.h> > #include <linux/of_gpio.h> > +#include <linux/of_irq.h> > #include <linux/platform_data/usb-ehci-s5p.h> > #include <plat/usb-phy.h> > > @@ -156,7 +157,12 @@ static int s5p_ehci_probe(struct platform_device *pdev) > goto fail_io; > } > > - irq = platform_get_irq(pdev, 0); > + if (pdev->dev.of_node) > + irq = irq_of_parse_and_map(pdev->dev.of_node, 0); platform_get_irq() should still work for device tree based platform devices. I don't see the point on the patch? > + else { > + irq = platform_get_irq(pdev, 0); > + } Hm, why {} out of the blue? Both arms of *if* are single-stratement. > + No need for empty line here. > if (!irq) { > dev_err(&pdev->dev, "Failed to get IRQ\n"); > err = -ENODEV; WBR, Sergei ^ permalink raw reply [flat|nested] 7+ messages in thread
[parent not found: <50DB5B80.50801-Igf4POYTYCDQT0dZR+AlfA@public.gmane.org>]
* Re: [PATCH 2/2] USB: ehci-s5p: Add to get interrupt from DT 2012-12-26 20:18 ` Sergei Shtylyov @ 2012-12-27 11:58 ` Dongjin Kim 0 siblings, 0 replies; 7+ messages in thread From: Dongjin Kim @ 2012-12-27 11:58 UTC (permalink / raw) To: Sergei Shtylyov Cc: linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA, Alan Stern, Greg Kroah-Hartman, linux-usb-u79uwXL29TY76Z2rM5mHXA, linux-kernel-u79uwXL29TY76Z2rM5mHXA Hi Sergei, Yes, you are right. I made this patch to read its interrupt number from dtb directly. But now platform_get_irq() returns correct irq since "OF_DEV_AUXDATA(...)" is added as my first patch. This patch is useless. Thanks and best regards, Dongjin. On Thu, Dec 27, 2012 at 5:18 AM, Sergei Shtylyov <sshtylyov-Igf4POYTYCDQT0dZR+AlfA@public.gmane.org> wrote: > > Hello. > > On 12/26/2012 09:42 PM, Dongjin Kim wrote: > > > This patch support to get interrupt resource from device tree as well as > > platform device if ehci node is defined in device tree and it's irq is > > described. > > > Signed-off-by: Dongjin Kim <tobetter-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > --- > > drivers/usb/host/ehci-s5p.c | 8 +++++++- > > 1 file changed, 7 insertions(+), 1 deletion(-) > > > diff --git a/drivers/usb/host/ehci-s5p.c b/drivers/usb/host/ehci-s5p.c > > index 319dcfa..0fc5e5e 100644 > > --- a/drivers/usb/host/ehci-s5p.c > > +++ b/drivers/usb/host/ehci-s5p.c > > @@ -16,6 +16,7 @@ > > #include <linux/of.h> > > #include <linux/platform_device.h> > > #include <linux/of_gpio.h> > > +#include <linux/of_irq.h> > > #include <linux/platform_data/usb-ehci-s5p.h> > > #include <plat/usb-phy.h> > > > > @@ -156,7 +157,12 @@ static int s5p_ehci_probe(struct platform_device > > *pdev) > > goto fail_io; > > } > > > > - irq = platform_get_irq(pdev, 0); > > + if (pdev->dev.of_node) > > + irq = irq_of_parse_and_map(pdev->dev.of_node, 0); > > platform_get_irq() should still work for device tree based platform > devices. > I don't see the point on the patch? > > > + else { > > + irq = platform_get_irq(pdev, 0); > > + } > > Hm, why {} out of the blue? Both arms of *if* are single-stratement. > > > + > > No need for empty line here. > > > if (!irq) { > > dev_err(&pdev->dev, "Failed to get IRQ\n"); > > err = -ENODEV; > > WBR, Sergei > -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2] USB: ehci-s5p: Add to get interrupt from DT @ 2012-12-27 11:58 ` Dongjin Kim 0 siblings, 0 replies; 7+ messages in thread From: Dongjin Kim @ 2012-12-27 11:58 UTC (permalink / raw) To: Sergei Shtylyov Cc: linux-samsung-soc, Alan Stern, Greg Kroah-Hartman, linux-usb, linux-kernel Hi Sergei, Yes, you are right. I made this patch to read its interrupt number from dtb directly. But now platform_get_irq() returns correct irq since "OF_DEV_AUXDATA(...)" is added as my first patch. This patch is useless. Thanks and best regards, Dongjin. On Thu, Dec 27, 2012 at 5:18 AM, Sergei Shtylyov <sshtylyov@mvista.com> wrote: > > Hello. > > On 12/26/2012 09:42 PM, Dongjin Kim wrote: > > > This patch support to get interrupt resource from device tree as well as > > platform device if ehci node is defined in device tree and it's irq is > > described. > > > Signed-off-by: Dongjin Kim <tobetter@gmail.com> > > --- > > drivers/usb/host/ehci-s5p.c | 8 +++++++- > > 1 file changed, 7 insertions(+), 1 deletion(-) > > > diff --git a/drivers/usb/host/ehci-s5p.c b/drivers/usb/host/ehci-s5p.c > > index 319dcfa..0fc5e5e 100644 > > --- a/drivers/usb/host/ehci-s5p.c > > +++ b/drivers/usb/host/ehci-s5p.c > > @@ -16,6 +16,7 @@ > > #include <linux/of.h> > > #include <linux/platform_device.h> > > #include <linux/of_gpio.h> > > +#include <linux/of_irq.h> > > #include <linux/platform_data/usb-ehci-s5p.h> > > #include <plat/usb-phy.h> > > > > @@ -156,7 +157,12 @@ static int s5p_ehci_probe(struct platform_device > > *pdev) > > goto fail_io; > > } > > > > - irq = platform_get_irq(pdev, 0); > > + if (pdev->dev.of_node) > > + irq = irq_of_parse_and_map(pdev->dev.of_node, 0); > > platform_get_irq() should still work for device tree based platform > devices. > I don't see the point on the patch? > > > + else { > > + irq = platform_get_irq(pdev, 0); > > + } > > Hm, why {} out of the blue? Both arms of *if* are single-stratement. > > > + > > No need for empty line here. > > > if (!irq) { > > dev_err(&pdev->dev, "Failed to get IRQ\n"); > > err = -ENODEV; > > WBR, Sergei > ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2012-12-27 12:06 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-26 18:42 [PATCH 0/2] EXYNOS4: Add device tree support for USB/EHCI Dongjin Kim
2012-12-26 18:42 ` [PATCH 1/2] ARM: dts: Add EHCI device tree node for Exynos4 Dongjin Kim
2012-12-26 18:42 ` Dongjin Kim
2012-12-26 18:42 ` [PATCH 2/2] USB: ehci-s5p: Add to get interrupt from DT Dongjin Kim
2012-12-26 20:18 ` Sergei Shtylyov
[not found] ` <50DB5B80.50801-Igf4POYTYCDQT0dZR+AlfA@public.gmane.org>
2012-12-27 11:58 ` Dongjin Kim
2012-12-27 11:58 ` Dongjin Kim
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.