* [RFC][PATCH 2/5] ARM: SAMSUNG: Changing the build condition of OTG platform device for samsung.
2011-06-21 7:03 [RFC][PATCH 0/5] USB: DWC OTG: Add dwc_otg driver for S5P6440 samsung SoC p.paneri at samsung.com
@ 2011-06-21 7:03 ` p.paneri at samsung.com
2011-06-21 9:16 ` Felipe Balbi
2011-06-21 11:47 ` Sergei Shtylyov
0 siblings, 2 replies; 7+ messages in thread
From: p.paneri at samsung.com @ 2011-06-21 7:03 UTC (permalink / raw)
To: linux-arm-kernel
From: Praveen Paneri <p.paneri@samsung.com>
Adding dwc driver name in existing platform device
to probe DWC OTG driver.
Introduced otg_set_platdata function to pass platform data
Added selectable config option to add DWC OTG driver for different
machines.
Signed-off-by: Praveen Paneri <p.paneri@samsung.com>
---
arch/arm/plat-samsung/Kconfig | 6 ++++++
arch/arm/plat-samsung/Makefile | 1 +
arch/arm/plat-samsung/dev-usb-hsotg.c | 20 ++++++++++++++++++++
3 files changed, 27 insertions(+), 0 deletions(-)
diff --git a/arch/arm/plat-samsung/Kconfig b/arch/arm/plat-samsung/Kconfig
index 4d79519..58ed8b1 100644
--- a/arch/arm/plat-samsung/Kconfig
+++ b/arch/arm/plat-samsung/Kconfig
@@ -227,6 +227,12 @@ config S3C_DEV_USB_HSOTG
help
Compile in platform device definition for USB high-speed OtG
+config S3C_DEV_DWC_OTG
+ bool
+ help
+ Compile in platform device definition for DWC OTG. This
+ will make it selectable for different machines.
+
config S3C_DEV_WDT
bool
default y if ARCH_S3C2410
diff --git a/arch/arm/plat-samsung/Makefile b/arch/arm/plat-samsung/Makefile
index 53eb15b..785ca79 100644
--- a/arch/arm/plat-samsung/Makefile
+++ b/arch/arm/plat-samsung/Makefile
@@ -49,6 +49,7 @@ obj-$(CONFIG_S3C_DEV_FB) += dev-fb.o
obj-y += dev-uart.o
obj-$(CONFIG_S3C_DEV_USB_HOST) += dev-usb.o
obj-$(CONFIG_S3C_DEV_USB_HSOTG) += dev-usb-hsotg.o
+obj-$(CONFIG_S3C_DEV_DWC_OTG) += dev-usb-hsotg.o
obj-$(CONFIG_S3C_DEV_WDT) += dev-wdt.o
obj-$(CONFIG_S3C_DEV_NAND) += dev-nand.o
obj-$(CONFIG_S3C_DEV_ONENAND) += dev-onenand.o
diff --git a/arch/arm/plat-samsung/dev-usb-hsotg.c b/arch/arm/plat-samsung/dev-usb-hsotg.c
index 33a844a..7e6228b 100644
--- a/arch/arm/plat-samsung/dev-usb-hsotg.c
+++ b/arch/arm/plat-samsung/dev-usb-hsotg.c
@@ -20,6 +20,8 @@
#include <mach/map.h>
#include <plat/devs.h>
+#include <plat/otg.h>
+#include <plat/usb-phy.h>
static struct resource s3c_usb_hsotg_resources[] = {
[0] = {
@@ -37,7 +39,12 @@ static struct resource s3c_usb_hsotg_resources[] = {
static u64 s3c_hsotg_dmamask = DMA_BIT_MASK(32);
struct platform_device s3c_device_usb_hsotg = {
+#ifdef CONFIG_S3C_DEV_USB_HSOTG
.name = "s3c-hsotg",
+#endif
+#ifdef CONFIG_S3C_DEV_DWC_OTG
+ .name = "dwc_otg",
+#endif
.id = -1,
.num_resources = ARRAY_SIZE(s3c_usb_hsotg_resources),
.resource = s3c_usb_hsotg_resources,
@@ -46,3 +53,16 @@ struct platform_device s3c_device_usb_hsotg = {
.coherent_dma_mask = DMA_BIT_MASK(32),
},
};
+
+void __init s5p_otg_set_platdata(struct s5p_otg_platdata *pd)
+{
+ struct s5p_otg_platdata *npd;
+
+ npd = s3c_set_platdata(pd, sizeof(struct s5p_otg_platdata),
+ &s3c_device_usb_hsotg);
+
+ if (!npd->phy_init)
+ npd->phy_init = s5p_usb_phy_init;
+ if (!npd->phy_exit)
+ npd->phy_exit = s5p_usb_phy_exit;
+}
--
1.7.0.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [RFC][PATCH 2/5] ARM: SAMSUNG: Changing the build condition of OTG platform device for samsung.
2011-06-21 7:03 ` [RFC][PATCH 2/5] ARM: SAMSUNG: Changing the build condition of OTG platform device for samsung p.paneri at samsung.com
@ 2011-06-21 9:16 ` Felipe Balbi
2011-06-21 11:47 ` Sergei Shtylyov
1 sibling, 0 replies; 7+ messages in thread
From: Felipe Balbi @ 2011-06-21 9:16 UTC (permalink / raw)
To: linux-arm-kernel
Hi,
On Tue, Jun 21, 2011 at 12:33:44PM +0530, p.paneri at samsung.com wrote:
> From: Praveen Paneri <p.paneri@samsung.com>
>
> Adding dwc driver name in existing platform device
> to probe DWC OTG driver.
> Introduced otg_set_platdata function to pass platform data
> Added selectable config option to add DWC OTG driver for different
> machines.
>
> Signed-off-by: Praveen Paneri <p.paneri@samsung.com>
> ---
> arch/arm/plat-samsung/Kconfig | 6 ++++++
> arch/arm/plat-samsung/Makefile | 1 +
> arch/arm/plat-samsung/dev-usb-hsotg.c | 20 ++++++++++++++++++++
> 3 files changed, 27 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/plat-samsung/Kconfig b/arch/arm/plat-samsung/Kconfig
> index 4d79519..58ed8b1 100644
> --- a/arch/arm/plat-samsung/Kconfig
> +++ b/arch/arm/plat-samsung/Kconfig
> @@ -227,6 +227,12 @@ config S3C_DEV_USB_HSOTG
> help
> Compile in platform device definition for USB high-speed OtG
>
> +config S3C_DEV_DWC_OTG
> + bool
> + help
> + Compile in platform device definition for DWC OTG. This
> + will make it selectable for different machines.
> +
> config S3C_DEV_WDT
> bool
> default y if ARCH_S3C2410
> diff --git a/arch/arm/plat-samsung/Makefile b/arch/arm/plat-samsung/Makefile
> index 53eb15b..785ca79 100644
> --- a/arch/arm/plat-samsung/Makefile
> +++ b/arch/arm/plat-samsung/Makefile
> @@ -49,6 +49,7 @@ obj-$(CONFIG_S3C_DEV_FB) += dev-fb.o
> obj-y += dev-uart.o
> obj-$(CONFIG_S3C_DEV_USB_HOST) += dev-usb.o
> obj-$(CONFIG_S3C_DEV_USB_HSOTG) += dev-usb-hsotg.o
> +obj-$(CONFIG_S3C_DEV_DWC_OTG) += dev-usb-hsotg.o
> obj-$(CONFIG_S3C_DEV_WDT) += dev-wdt.o
> obj-$(CONFIG_S3C_DEV_NAND) += dev-nand.o
> obj-$(CONFIG_S3C_DEV_ONENAND) += dev-onenand.o
> diff --git a/arch/arm/plat-samsung/dev-usb-hsotg.c b/arch/arm/plat-samsung/dev-usb-hsotg.c
> index 33a844a..7e6228b 100644
> --- a/arch/arm/plat-samsung/dev-usb-hsotg.c
> +++ b/arch/arm/plat-samsung/dev-usb-hsotg.c
> @@ -20,6 +20,8 @@
> #include <mach/map.h>
>
> #include <plat/devs.h>
> +#include <plat/otg.h>
> +#include <plat/usb-phy.h>
>
> static struct resource s3c_usb_hsotg_resources[] = {
> [0] = {
> @@ -37,7 +39,12 @@ static struct resource s3c_usb_hsotg_resources[] = {
> static u64 s3c_hsotg_dmamask = DMA_BIT_MASK(32);
>
> struct platform_device s3c_device_usb_hsotg = {
> +#ifdef CONFIG_S3C_DEV_USB_HSOTG
> .name = "s3c-hsotg",
> +#endif
> +#ifdef CONFIG_S3C_DEV_DWC_OTG
> + .name = "dwc_otg",
> +#endif
no, don't do that. See we're going through a big re-factor on the gadget
framework to allow multiple UDC drivers to be compiled as modules. The
idea is to be able to have distro-like kernels for embedded too.
Take a look at my gadget branch [1] and see how the gadget controllers
are modified to start allowing that.
I also have patch to the Kconfig allowing all controllers to be enabled
as modules, I just need some more time to figure out one warning on the
renenesas controller.
IOW, it's best to add both platform devices. Or move to device tree.
--
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20110621/a7ebcf4b/attachment.sig>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [RFC][PATCH 2/5] ARM: SAMSUNG: Changing the build condition of OTG platform device for samsung.
2011-06-21 7:03 ` [RFC][PATCH 2/5] ARM: SAMSUNG: Changing the build condition of OTG platform device for samsung p.paneri at samsung.com
2011-06-21 9:16 ` Felipe Balbi
@ 2011-06-21 11:47 ` Sergei Shtylyov
2011-06-21 11:49 ` Felipe Balbi
1 sibling, 1 reply; 7+ messages in thread
From: Sergei Shtylyov @ 2011-06-21 11:47 UTC (permalink / raw)
To: linux-arm-kernel
Hello.
On 21-06-2011 11:03, p.paneri at samsung.com wrote:
> From: Praveen Paneri<p.paneri@samsung.com>
> Adding dwc driver name in existing platform device
> to probe DWC OTG driver.
> Introduced otg_set_platdata function to pass platform data
> Added selectable config option to add DWC OTG driver for different
> machines.
> Signed-off-by: Praveen Paneri<p.paneri@samsung.com>
[...]
> diff --git a/arch/arm/plat-samsung/dev-usb-hsotg.c b/arch/arm/plat-samsung/dev-usb-hsotg.c
> index 33a844a..7e6228b 100644
> --- a/arch/arm/plat-samsung/dev-usb-hsotg.c
> +++ b/arch/arm/plat-samsung/dev-usb-hsotg.c
[...]
> @@ -37,7 +39,12 @@ static struct resource s3c_usb_hsotg_resources[] = {
> static u64 s3c_hsotg_dmamask = DMA_BIT_MASK(32);
>
> struct platform_device s3c_device_usb_hsotg = {
> +#ifdef CONFIG_S3C_DEV_USB_HSOTG
> .name = "s3c-hsotg",
> +#endif
> +#ifdef CONFIG_S3C_DEV_DWC_OTG
> + .name = "dwc_otg",
> +#endif
I'd done it as:
+#if defined(CONFIG_S3C_DEV_USB_HSOTG)
.name = "s3c-hsotg",
+#elif defined(CONFIG_S3C_DEV_DWC_OTG)
+ .name = "dwc_otg",
+#endif
WBR, Sergei
^ permalink raw reply [flat|nested] 7+ messages in thread
* [RFC][PATCH 2/5] ARM: SAMSUNG: Changing the build condition of OTG platform device for samsung.
2011-06-21 11:47 ` Sergei Shtylyov
@ 2011-06-21 11:49 ` Felipe Balbi
2011-06-21 12:00 ` Sergei Shtylyov
0 siblings, 1 reply; 7+ messages in thread
From: Felipe Balbi @ 2011-06-21 11:49 UTC (permalink / raw)
To: linux-arm-kernel
Hi,
On Tue, Jun 21, 2011 at 03:47:04PM +0400, Sergei Shtylyov wrote:
> Hello.
>
> On 21-06-2011 11:03, p.paneri at samsung.com wrote:
>
> >From: Praveen Paneri<p.paneri@samsung.com>
>
> >Adding dwc driver name in existing platform device
> >to probe DWC OTG driver.
> >Introduced otg_set_platdata function to pass platform data
> >Added selectable config option to add DWC OTG driver for different
> >machines.
>
> >Signed-off-by: Praveen Paneri<p.paneri@samsung.com>
> [...]
>
> >diff --git a/arch/arm/plat-samsung/dev-usb-hsotg.c b/arch/arm/plat-samsung/dev-usb-hsotg.c
> >index 33a844a..7e6228b 100644
> >--- a/arch/arm/plat-samsung/dev-usb-hsotg.c
> >+++ b/arch/arm/plat-samsung/dev-usb-hsotg.c
> [...]
> >@@ -37,7 +39,12 @@ static struct resource s3c_usb_hsotg_resources[] = {
> > static u64 s3c_hsotg_dmamask = DMA_BIT_MASK(32);
> >
> > struct platform_device s3c_device_usb_hsotg = {
> >+#ifdef CONFIG_S3C_DEV_USB_HSOTG
> > .name = "s3c-hsotg",
> >+#endif
> >+#ifdef CONFIG_S3C_DEV_DWC_OTG
> >+ .name = "dwc_otg",
> >+#endif
>
> I'd done it as:
>
> +#if defined(CONFIG_S3C_DEV_USB_HSOTG)
> .name = "s3c-hsotg",
> +#elif defined(CONFIG_S3C_DEV_DWC_OTG)
> + .name = "dwc_otg",
> +#endif
no... don't do that. How many times do I have to repeat ? No ifdefs!! we
want both drivers to be able to be compiled as modules, so add both
platform devices.
--
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20110621/fdefed2c/attachment.sig>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [RFC][PATCH 2/5] ARM: SAMSUNG: Changing the build condition of OTG platform device for samsung.
[not found] <0LN4003LQZBUSGU0@mailout4.samsung.com>
@ 2011-06-21 11:50 ` Praveen Paneri
2011-06-21 11:51 ` Felipe Balbi
0 siblings, 1 reply; 7+ messages in thread
From: Praveen Paneri @ 2011-06-21 11:50 UTC (permalink / raw)
To: linux-arm-kernel
Hi,
On Tue, Jun 21, 2011 at 4:17 PM, PRAVEEN PANERI <p.paneri@samsung.com> wrote:
>
> Hi,
>
> On Tue, Jun 21, 2011 at 12:33:44PM +0530, p.paneri at samsung.com wrote:
> > From: Praveen Paneri
> >
> > Adding dwc driver name in existing platform device
> > to probe DWC OTG driver.
> > Introduced otg_set_platdata function to pass platform data
> > Added selectable config option to add DWC OTG driver for different
> > machines.
> >
> > Signed-off-by: Praveen Paneri
> > ---
> >??arch/arm/plat-samsung/Kconfig???????? |????6 ++++++
> >??arch/arm/plat-samsung/Makefile????????|????1 +
> >??arch/arm/plat-samsung/dev-usb-hsotg.c |?? 20 ++++++++++++++++++++
> >??3 files changed, 27 insertions(+), 0 deletions(-)
> >
> > diff --git a/arch/arm/plat-samsung/Kconfig b/arch/arm/plat-samsung/Kconfig
> > index 4d79519..58ed8b1 100644
> > --- a/arch/arm/plat-samsung/Kconfig
> > +++ b/arch/arm/plat-samsung/Kconfig
> > @@ -227,6 +227,12 @@ config S3C_DEV_USB_HSOTG
> >?? help
> >?? ??Compile in platform device definition for USB high-speed OtG
> >
> > +config S3C_DEV_DWC_OTG
> > + bool
> > + help
> > + ??Compile in platform device definition for DWC OTG. This
> > + ??will make it selectable for different machines.
> > +
> >??config S3C_DEV_WDT
> >?? bool
> >?? default y if ARCH_S3C2410
> > diff --git a/arch/arm/plat-samsung/Makefile b/arch/arm/plat-samsung/Makefile
> > index 53eb15b..785ca79 100644
> > --- a/arch/arm/plat-samsung/Makefile
> > +++ b/arch/arm/plat-samsung/Makefile
> > @@ -49,6 +49,7 @@ obj-$(CONFIG_S3C_DEV_FB) += dev-fb.o
> >??obj-y += dev-uart.o
> >??obj-$(CONFIG_S3C_DEV_USB_HOST) += dev-usb.o
> >??obj-$(CONFIG_S3C_DEV_USB_HSOTG) += dev-usb-hsotg.o
> > +obj-$(CONFIG_S3C_DEV_DWC_OTG) += dev-usb-hsotg.o
> >??obj-$(CONFIG_S3C_DEV_WDT) += dev-wdt.o
> >??obj-$(CONFIG_S3C_DEV_NAND) += dev-nand.o
> >??obj-$(CONFIG_S3C_DEV_ONENAND) += dev-onenand.o
> > diff --git a/arch/arm/plat-samsung/dev-usb-hsotg.c b/arch/arm/plat-samsung/dev-usb-hsotg.c
> > index 33a844a..7e6228b 100644
> > --- a/arch/arm/plat-samsung/dev-usb-hsotg.c
> > +++ b/arch/arm/plat-samsung/dev-usb-hsotg.c
> > @@ -20,6 +20,8 @@
> >??#include
> >
> >??#include
> > +#include
> > +#include
> >
> >??static struct resource s3c_usb_hsotg_resources[] = {
> >?? [0] = {
> > @@ -37,7 +39,12 @@ static struct resource s3c_usb_hsotg_resources[] = {
> >??static u64 s3c_hsotg_dmamask = DMA_BIT_MASK(32);
> >
> >??struct platform_device s3c_device_usb_hsotg = {
> > +#ifdef CONFIG_S3C_DEV_USB_HSOTG
> >?? .name = "s3c-hsotg",
> > +#endif
> > +#ifdef CONFIG_S3C_DEV_DWC_OTG
> > + .name = "dwc_otg",
> > +#endif
>
> no, don't do that. See we're going through a big re-factor on the gadget
> framework to allow multiple UDC drivers to be compiled as modules. The
> idea is to be able to have distro-like kernels for embedded too.
It can be build as a module but need to make necessary modifications in
platform code. Will modify according to the gadget framework.
Thanks for the comment.
paneri
>
> Take a look at my gadget branch [1] and see how the gadget controllers
> are modified to start allowing that.
>
> I also have patch to the Kconfig allowing all controllers to be enabled
> as modules, I just need some more time to figure out one warning on the
> renenesas controller.
>
> IOW, it's best to add both platform devices. Or move to device tree.
>
> --
> balbi
>
>
>
>
>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [RFC][PATCH 2/5] ARM: SAMSUNG: Changing the build condition of OTG platform device for samsung.
2011-06-21 11:50 ` [RFC][PATCH 2/5] ARM: SAMSUNG: Changing the build condition of OTG platform device for samsung Praveen Paneri
@ 2011-06-21 11:51 ` Felipe Balbi
0 siblings, 0 replies; 7+ messages in thread
From: Felipe Balbi @ 2011-06-21 11:51 UTC (permalink / raw)
To: linux-arm-kernel
Hi,
On Tue, Jun 21, 2011 at 05:20:25PM +0530, Praveen Paneri wrote:
> > > @@ -37,7 +39,12 @@ static struct resource s3c_usb_hsotg_resources[] = {
> > >??static u64 s3c_hsotg_dmamask = DMA_BIT_MASK(32);
> > >
> > >??struct platform_device s3c_device_usb_hsotg = {
> > > +#ifdef CONFIG_S3C_DEV_USB_HSOTG
> > >?? .name = "s3c-hsotg",
> > > +#endif
> > > +#ifdef CONFIG_S3C_DEV_DWC_OTG
> > > + .name = "dwc_otg",
> > > +#endif
> >
> > no, don't do that. See we're going through a big re-factor on the gadget
> > framework to allow multiple UDC drivers to be compiled as modules. The
> > idea is to be able to have distro-like kernels for embedded too.
> It can be build as a module but need to make necessary modifications in
> platform code. Will modify according to the gadget framework.
can't you do runtime detection of which platform you're running on ?
Then you add one or the other platform_device. But ifdeferry won't help
you in the long run.
--
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20110621/a1b1e70c/attachment.sig>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [RFC][PATCH 2/5] ARM: SAMSUNG: Changing the build condition of OTG platform device for samsung.
2011-06-21 11:49 ` Felipe Balbi
@ 2011-06-21 12:00 ` Sergei Shtylyov
0 siblings, 0 replies; 7+ messages in thread
From: Sergei Shtylyov @ 2011-06-21 12:00 UTC (permalink / raw)
To: linux-arm-kernel
Hello.
On 21-06-2011 15:49, Felipe Balbi wrote:
>>> From: Praveen Paneri<p.paneri@samsung.com>
>>> Adding dwc driver name in existing platform device
>>> to probe DWC OTG driver.
>>> Introduced otg_set_platdata function to pass platform data
>>> Added selectable config option to add DWC OTG driver for different
>>> machines.
>>> Signed-off-by: Praveen Paneri<p.paneri@samsung.com>
>> [...]
>>> diff --git a/arch/arm/plat-samsung/dev-usb-hsotg.c b/arch/arm/plat-samsung/dev-usb-hsotg.c
>>> index 33a844a..7e6228b 100644
>>> --- a/arch/arm/plat-samsung/dev-usb-hsotg.c
>>> +++ b/arch/arm/plat-samsung/dev-usb-hsotg.c
>> [...]
>>> @@ -37,7 +39,12 @@ static struct resource s3c_usb_hsotg_resources[] = {
>>> static u64 s3c_hsotg_dmamask = DMA_BIT_MASK(32);
>>>
>>> struct platform_device s3c_device_usb_hsotg = {
>>> +#ifdef CONFIG_S3C_DEV_USB_HSOTG
>>> .name = "s3c-hsotg",
>>> +#endif
>>> +#ifdef CONFIG_S3C_DEV_DWC_OTG
>>> + .name = "dwc_otg",
>>> +#endif
>> I'd done it as:
>> +#if defined(CONFIG_S3C_DEV_USB_HSOTG)
>> .name = "s3c-hsotg",
>> +#elif defined(CONFIG_S3C_DEV_DWC_OTG)
>> + .name = "dwc_otg",
>> +#endif
> no... don't do that. How many times do I have to repeat ? No ifdefs!! we
> want both drivers to be able to be compiled as modules, so add both
> platform devices.
Sorry, hadn't seen your mail when replying.
WBR, Sergei
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2011-06-21 12:00 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <0LN4003LQZBUSGU0@mailout4.samsung.com>
2011-06-21 11:50 ` [RFC][PATCH 2/5] ARM: SAMSUNG: Changing the build condition of OTG platform device for samsung Praveen Paneri
2011-06-21 11:51 ` Felipe Balbi
2011-06-21 7:03 [RFC][PATCH 0/5] USB: DWC OTG: Add dwc_otg driver for S5P6440 samsung SoC p.paneri at samsung.com
2011-06-21 7:03 ` [RFC][PATCH 2/5] ARM: SAMSUNG: Changing the build condition of OTG platform device for samsung p.paneri at samsung.com
2011-06-21 9:16 ` Felipe Balbi
2011-06-21 11:47 ` Sergei Shtylyov
2011-06-21 11:49 ` Felipe Balbi
2011-06-21 12:00 ` Sergei Shtylyov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).