Re: [PATCH v2 7/9] usb: phy: fsl-usb: add IRQ check

2021-08-11 Thread Felipe Balbi


Sergey Shtylyov  writes:

> The driver neglects to check the result of platform_get_irq()'s call and
> blithely passes the negative error codes to request_irq() (which takes
> *unsigned* IRQ #), causing it to fail with -EINVAL, overriding an original
> error code. Stop calling request_irq() with the invalid IRQ #s.
>
> Fixes: 0807c500a1a6 ("USB: add Freescale USB OTG Transceiver driver")
> Signed-off-by: Sergey Shtylyov 

Acked-by: Felipe Balbi 

-- 
balbi


Re: [PATCH 20/20] arch: dts: Fix DWC USB3 DT nodes name

2020-10-15 Thread Felipe Balbi
Serge Semin  writes:

> On Wed, Oct 14, 2020 at 05:09:37PM +0300, Felipe Balbi wrote:
>> 
>> Hi Serge,
>> 
>> Serge Semin  writes:
>> > In accordance with the DWC USB3 bindings the corresponding node name is
>> > suppose to comply with Generic USB HCD DT schema, which requires the USB
>> 
>
>> DWC3 is not a simple HDC, though.
>
> Yeah, strictly speaking it is equipped with a lot of vendor-specific stuff,
> which are tuned by the DWC USB3 driver in the kernel. But after that the
> controller is registered as xhci-hcd device so it's serviced by the xHCI 
> driver,

in Dual-role or host-only builds, that's correct. We can also have
peripheral-only builds (both SW or HW versions) which means xhci isn't
even in the picture.

-- 
balbi


signature.asc
Description: PGP signature


Re: [PATCH 20/20] arch: dts: Fix DWC USB3 DT nodes name

2020-10-14 Thread Felipe Balbi

Hi Serge,

Serge Semin  writes:
> In accordance with the DWC USB3 bindings the corresponding node name is
> suppose to comply with Generic USB HCD DT schema, which requires the USB

DWC3 is not a simple HDC, though.

> nodes to have the name acceptable by the regexp: "^usb(@.*)?" . But a lot
> of the DWC USB3-compatible nodes defined in the ARM/ARM64 DTS files have
> name as "^dwc3@.*" or "^usb[1-3]@.*" or even "^dwusb@.*", which will cause
> the dtbs_check procedure failure. Let's fix the nodes naming to be
> compatible with the DWC USB3 DT schema to make dtbs_check happy.
>
> Note we don't change the DWC USB3-compatible nodes names of
> arch/arm64/boot/dts/apm/{apm-storm.dtsi,apm-shadowcat.dtsi} since the
> in-source comment says that the nodes name need to be preserved as
> "^dwusb@.*" for some backward compatibility.

interesting, compatibility with what? Some debugfs files, perhaps? :-)

In any case, I don't have any problems with this, so I'll let other
folks comment.

-- 
balbi


signature.asc
Description: PGP signature


Re: [trivial PATCH] treewide: Convert switch/case fallthrough; to break;

2020-09-10 Thread Felipe Balbi
Hi,

Joe Perches  writes:
>  drivers/usb/dwc3/core.c   |  2 +-
>  drivers/usb/gadget/legacy/inode.c |  2 +-
>  drivers/usb/gadget/udc/pxa25x_udc.c   |  4 ++--
>  drivers/usb/phy/phy-fsl-usb.c |  2 +-

for the drivers above:

Acked-by: Felipe Balbi 

-- 
balbi


signature.asc
Description: PGP signature


Re: [PATCH] usb: gadget: fsl: Fix unsigned expression compared with zero in fsl_udc_probe

2020-08-25 Thread Felipe Balbi
Joakim Tjernlund  writes:

> On Mon, 2020-08-24 at 16:58 +0300, Felipe Balbi wrote:
>> Joakim Tjernlund  writes:
>> 
>> > On Mon, 2020-08-24 at 10:21 +0200, Greg KH wrote:
>> > > 
>> > > On Mon, Aug 24, 2020 at 04:04:37PM +0800, Ye Bin wrote:
>> > > > Signed-off-by: Ye Bin 
>> > > 
>> > > I can't take patches without any changelog text, sorry.
>> > 
>> > Still taking patches for fsl_udc_core.c ?
>> > I figured this driver was obsolete and should be moved to one of the 
>> > Chipidea drivers.
>> 
>> Nobody sent any patches to switch over the users of this driver to
>> chipidea. I would love to delete this driver :-)
>
> Me too, I got a few local patches here as the driver is quite buggy.
> Got to little USB knowledge to switch it over though :(

this wouldn't require USB knowledge. It only requires some minor DTS
knowledge and HW for testing.

-- 
balbi


signature.asc
Description: PGP signature


Re: [PATCH] usb: gadget: fsl: Fix unsigned expression compared with zero in fsl_udc_probe

2020-08-24 Thread Felipe Balbi
Joakim Tjernlund  writes:

> On Mon, 2020-08-24 at 10:21 +0200, Greg KH wrote:
>> 
>> On Mon, Aug 24, 2020 at 04:04:37PM +0800, Ye Bin wrote:
>> > Signed-off-by: Ye Bin 
>> 
>> I can't take patches without any changelog text, sorry.
>
> Still taking patches for fsl_udc_core.c ?
> I figured this driver was obsolete and should be moved to one of the Chipidea 
> drivers.

Nobody sent any patches to switch over the users of this driver to
chipidea. I would love to delete this driver :-)

-- 
balbi


signature.asc
Description: PGP signature


Re: [patch V3 03/20] usb: gadget: Use completion interface instead of open coding it

2020-03-25 Thread Felipe Balbi
Thomas Gleixner  writes:

> From: Thomas Gleixner 
>
> ep_io() uses a completion on stack and open codes the waiting with:
>
>   wait_event_interruptible (done.wait, done.done);
> and
>   wait_event (done.wait, done.done);
>
> This waits in non-exclusive mode for complete(), but there is no reason to
> do so because the completion can only be waited for by the task itself and
> complete() wakes exactly one exlusive waiter.
>
> Replace the open coded implementation with the corresponding
> wait_for_completion*() functions.
>
> No functional change.
>
> Reported-by: Sebastian Andrzej Siewior 
> Signed-off-by: Thomas Gleixner 
> Reviewed-by: Greg Kroah-Hartman 
> Cc: Felipe Balbi 
> Cc: linux-...@vger.kernel.org

Do you want to carry it via your tree? If so:

Acked-by: Felipe Balbi 

Otherwise, let me know and I'll pick this patch.

-- 
balbi


signature.asc
Description: PGP signature


Re: [PATCH v2 03/17] compat_ioctl: use correct compat_ptr() translation in drivers

2018-09-13 Thread Felipe Balbi
Arnd Bergmann  writes:

> A handful of drivers all have a trivial wrapper around their ioctl
> handler, but don't call the compat_ptr() conversion function at the
> moment. In practice this does not matter, since none of them are used
> on the s390 architecture and for all other architectures, compat_ptr()
> does not do anything, but using the new generic_compat_ioctl_ptrarg
> helper makes it more correct in theory, and simplifies the code.
>
> Signed-off-by: Arnd Bergmann 

Acked-by: Felipe Balbi 

-- 
balbi


signature.asc
Description: PGP signature


Re: [-next PATCH 0/4] sysfs and DEVICE_ATTR_

2017-12-20 Thread Felipe Balbi

Hi,

Joe Perches <j...@perches.com> writes:
>  drivers/usb/phy/phy-tahvo.c|  2 +-

Acked-by: Felipe Balbi <felipe.ba...@linux.intel.com>

-- 
balbi


Re: [PATCH 1/2] usb: dwc2: add amcc,dwc-otg support

2016-11-16 Thread Felipe Balbi
 for this to work with the existing canyonlands.dts, I need to have
>>> the "amcc,dwc-otg" compatible string.
>> 
>> Ok, if that's the case. But still a bit confused as to what driver was
>> working with it before since the binding was not defined for dwc2.
>> 
>>>
>>> Of course, it would be great to hear from Rob Herring and/or Mark Rutland
>>> about this case.
>>>
>>> Regards,
>>> Christian
>>>
>>> [0] <https://patchwork.kernel.org/patch/8976221/>
>>> [1] 
>>> <http://lxr.free-electrons.com/source/arch/powerpc/boot/dts/canyonlands.dts#L181>
>>> [2] <http://www.spinics.net/lists/devicetree/msg124538.html>
>>>
>>>  
>>>>>
>>>>> From what I can tell based would be:
>>>>> bcm11351, bcm21664, bcm23550, exynos3250, stm32f429, rk3xxx,
>>>>> stratix10, meson-gxbb, rt3050 and some Altera FPGAs.
>>>>>
>>>>>> If that's all you need then a devicetree binding should be enough
>>>>>> right?
>>>>> Yes. The device is working fine so far.
>>>>>
>>>>> Regards,
>>>>> Christian
>>>>>
>>>>> ---
>>>>> From 70dd4be016b89655a56bc8260f04683b50f07644 Mon Sep 17 00:00:00 2001
>>>>> From: Christian Lamparter <chunk...@gmail.com>
>>>>> Date: Sun, 6 Nov 2016 00:39:24 +0100
>>>>> Subject: [PATCH] usb: dwc2: add amcc,dwc-otg support
>>>>>
>>>>> This patch adds support for the "amcc,usb-otg" device
>>>>> which is found in the PowerPC Canyonlands' dts.
>>>>>
>>>>> The device definition was added by:
>>>>> commit c89b3458d8cc ("powerpc/44x: Add USB DWC DTS entry to Canyonlands 
>>>>> board")'
>>>>> but without any driver support as the dwc2 driver wasn't
>>>>> available at that time.
>>>>>
>>>>> Note: The system can't use the generic "snps,dwc2" compatible
>>>>> because of the special ahbcfg configuration. The default
>>>>> GAHBCFG_HBSTLEN_INCR4 of snps,dwc2 can cause a system hang
>>>>> when the USB and SATA is used concurrently.
>>>>>
>>>>> Cc: Felipe Balbi <felipe.ba...@linux.intel.com>
>>>>> Cc: John Youn <johny...@synopsys.com>
>>>>> Signed-off-by: Christian Lamparter <chunk...@gmail.com>
>>>>> ---
>>>>> v1->v2:
>>>>>   - moved definitons to params.c
>>>>>   - removed dma_enable / host_dma parameter
>>>>>   - added dma_desc_fs_enable parameter
>>>>> v2->v3:
>>>>>   - removed parameters
>>>>>
>>>>> Please queue this patch until GAHBCFG_HBSTLEN_INCR16 is the default
>>>>> for ahbcfg.
>>>>> ---
>>>>>  Documentation/devicetree/bindings/usb/dwc2.txt | 1 +
>>>>>  drivers/usb/dwc2/params.c  | 1 +
>>>>>  2 files changed, 2 insertions(+)
>>>>>
>>>>> diff --git a/Documentation/devicetree/bindings/usb/dwc2.txt 
>>>>> b/Documentation/devicetree/bindings/usb/dwc2.txt
>>>>> index 10a2a4b..6ccfe85 100644
>>>>> --- a/Documentation/devicetree/bindings/usb/dwc2.txt
>>>>> +++ b/Documentation/devicetree/bindings/usb/dwc2.txt
>>>>> @@ -12,6 +12,7 @@ Required properties:
>>>>>- "lantiq,xrx200-usb": The DWC2 USB controller instance in Lantiq XRX 
>>>>> SoCs;
>>>>>- "amlogic,meson8b-usb": The DWC2 USB controller instance in Amlogic 
>>>>> Meson8b SoCs;
>>>>>- "amlogic,meson-gxbb-usb": The DWC2 USB controller instance in 
>>>>> Amlogic S905 SoCs;
>>>>> +  - "amcc,dwc-otg": The DWC2 USB controller instance in AMCC Canyonlands 
>>>>> 460EX SoCs;
>>>>>- snps,dwc2: A generic DWC2 USB controller with default parameters.
>>>>>  - reg : Should contain 1 register range (address and length)
>>>>>  - interrupts : Should contain 1 interrupt
>>>>> diff --git a/drivers/usb/dwc2/params.c b/drivers/usb/dwc2/params.c
>>>>> index 64d5c66..9506ab0 100644
>>>>> --- a/drivers/usb/dwc2/params.c
>>>>> +++ b/drivers/usb/dwc2/params.c
>>>>> @@ -239,6 +239,7 @@ const struct of_device_id dwc2_of_match_table[] = {
>>>>>   { .compatible = "samsung,s3c6400-hsotg", .data = NULL},
>>>>>   { .compatible = "amlogic,meson8b-usb", .data = _amlogic },
>>>>>   { .compatible = "amlogic,meson-gxbb-usb", .data = _amlogic },
>>>>> + { .compatible = "amcc,dwc-otg", .data = NULL },
>>>>>   {},
>>>>>  };
>>>>>  MODULE_DEVICE_TABLE(of, dwc2_of_match_table);
>>>>>
>> 
>> For dwc2 part:
>> 
>> Acked-by: John Youn <johny...@synopsys.com>
>> 
>
> Hi Felipe,
>
> Can you drop this from your testing/next?
>
> I meant for the 2nd version to be applied, without the params
> structure.
>
> I can send you a clean version to apply later today.

done

-- 
balbi


signature.asc
Description: PGP signature


[PATCH 44/82] usb: gadget: udc: fsl: remove unnecessary & operation

2016-10-31 Thread Felipe Balbi
Now that usb_endpoint_maxp() only returns the lowest
11 bits from wMaxPacketSize, we can remove the &
operation from this driver.

Cc: Li Yang <le...@freescale.com>
Cc: <linuxppc-dev@lists.ozlabs.org>
Signed-off-by: Felipe Balbi <felipe.ba...@linux.intel.com>
---
 drivers/usb/gadget/udc/fsl_udc_core.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/usb/gadget/udc/fsl_udc_core.c 
b/drivers/usb/gadget/udc/fsl_udc_core.c
index 4459644b9b55..71094e479a96 100644
--- a/drivers/usb/gadget/udc/fsl_udc_core.c
+++ b/drivers/usb/gadget/udc/fsl_udc_core.c
@@ -586,7 +586,6 @@ static int fsl_ep_enable(struct usb_ep *_ep,
case USB_ENDPOINT_XFER_ISOC:
/* Calculate transactions needed for high bandwidth iso */
mult = usb_endpoint_maxp_mult(desc);
-   max = max & 0x7ff;  /* bit 0~10 */
/* 3 transactions at most */
if (mult > 3)
goto en_done;
-- 
2.10.1



[PATCH 20/82] usb: gadget: udc: fsl: make use of new usb_endpoint_maxp_mult()

2016-10-31 Thread Felipe Balbi
We have introduced a helper to calculate multiplier
value from wMaxPacketSize. Start using it.

Cc: Li Yang <le...@freescale.com>
Cc: <linuxppc-dev@lists.ozlabs.org>
Signed-off-by: Felipe Balbi <felipe.ba...@linux.intel.com>
---
 drivers/usb/gadget/udc/fsl_udc_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/udc/fsl_udc_core.c 
b/drivers/usb/gadget/udc/fsl_udc_core.c
index aab5221d6c2e..4459644b9b55 100644
--- a/drivers/usb/gadget/udc/fsl_udc_core.c
+++ b/drivers/usb/gadget/udc/fsl_udc_core.c
@@ -585,7 +585,7 @@ static int fsl_ep_enable(struct usb_ep *_ep,
break;
case USB_ENDPOINT_XFER_ISOC:
/* Calculate transactions needed for high bandwidth iso */
-   mult = (unsigned char)(1 + ((max >> 11) & 0x03));
+   mult = usb_endpoint_maxp_mult(desc);
max = max & 0x7ff;  /* bit 0~10 */
/* 3 transactions at most */
if (mult > 3)
-- 
2.10.1



[RFC/PATCH 43/45] usb: gadget: udc: fsl: remove unnecessary & operation

2016-09-28 Thread Felipe Balbi
Now that usb_endpoint_maxp() only returns the lowest
11 bits from wMaxPacketSize, we can remove the &
operation from this driver.

Cc: Li Yang <le...@freescale.com>
Cc: <linuxppc-dev@lists.ozlabs.org>
Signed-off-by: Felipe Balbi <felipe.ba...@linux.intel.com>
---
 drivers/usb/gadget/udc/fsl_udc_core.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/usb/gadget/udc/fsl_udc_core.c 
b/drivers/usb/gadget/udc/fsl_udc_core.c
index 4459644b9b55..71094e479a96 100644
--- a/drivers/usb/gadget/udc/fsl_udc_core.c
+++ b/drivers/usb/gadget/udc/fsl_udc_core.c
@@ -586,7 +586,6 @@ static int fsl_ep_enable(struct usb_ep *_ep,
case USB_ENDPOINT_XFER_ISOC:
/* Calculate transactions needed for high bandwidth iso */
mult = usb_endpoint_maxp_mult(desc);
-   max = max & 0x7ff;  /* bit 0~10 */
/* 3 transactions at most */
if (mult > 3)
goto en_done;
-- 
2.10.0.440.g21f862b



[RFC/PATCH 20/45] usb: gadget: udc: fsl: make use of new usb_endpoint_maxp_mult()

2016-09-28 Thread Felipe Balbi
We have introduced a helper to calculate multiplier
value from wMaxPacketSize. Start using it.

Cc: Li Yang <le...@freescale.com>
Cc: <linuxppc-dev@lists.ozlabs.org>
Signed-off-by: Felipe Balbi <felipe.ba...@linux.intel.com>
---
 drivers/usb/gadget/udc/fsl_udc_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/udc/fsl_udc_core.c 
b/drivers/usb/gadget/udc/fsl_udc_core.c
index aab5221d6c2e..4459644b9b55 100644
--- a/drivers/usb/gadget/udc/fsl_udc_core.c
+++ b/drivers/usb/gadget/udc/fsl_udc_core.c
@@ -585,7 +585,7 @@ static int fsl_ep_enable(struct usb_ep *_ep,
break;
case USB_ENDPOINT_XFER_ISOC:
/* Calculate transactions needed for high bandwidth iso */
-   mult = (unsigned char)(1 + ((max >> 11) & 0x03));
+   mult = usb_endpoint_maxp_mult(desc);
max = max & 0x7ff;  /* bit 0~10 */
/* 3 transactions at most */
if (mult > 3)
-- 
2.10.0.440.g21f862b



Re: [PATCH 00/21] Delete CURRENT_TIME and CURRENT_TIME_SEC macros

2016-06-09 Thread Felipe Balbi

Hi,

Deepa Dinamani <deepa.ker...@gmail.com> writes:
>  drivers/usb/gadget/function/f_fs.c |  2 +-
>  drivers/usb/gadget/legacy/inode.c  |  2 +-

for drivers/usb/gadget:

Acked-by: Felipe Balbi <ba...@kernel.org>

-- 
balbi


signature.asc
Description: PGP signature
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH] usb: dwc2: fix regression on big-endian PowerPC/ARM systems

2016-05-12 Thread Felipe Balbi

Hi,

(Arnd, you didn't Cc dwc2's maintainer. I'm also not part of TI anymore)

Arnd Bergmann <a...@arndb.de> writes:
> On Thursday 12 May 2016 14:25:49 Felipe Balbi wrote:
>> >  {
>> >   u32 value = __raw_readl(addr);
>> >  
>> > - /* In order to preserve endianness __raw_* operation is used. 
>> > Therefore
>> > -  * a barrier is needed to ensure IO access is not re-ordered across
>> > + /* in order to preserve endianness __raw_* operation is used. 
>> > therefore
>> > +  * a barrier is needed to ensure io access is not re-ordered across
>> >* reads or writes
>> >*/
>> >   mb();
>> > @@ -81,15 +93,32 @@ static inline void dwc2_writel(u32 value, void __iomem 
>> > *addr)
>> >   __raw_writel(value, addr);
>> >  
>> >   /*
>> > -  * In order to preserve endianness __raw_* operation is used. 
>> > Therefore
>> > -  * a barrier is needed to ensure IO access is not re-ordered across
>> > +  * in order to preserve endianness __raw_* operation is used. 
>> > therefore
>> > +  * a barrier is needed to ensure io access is not re-ordered across
>> >* reads or writes
>> >*/
>> >   mb();
>> > -#ifdef DWC2_LOG_WRITES
>> > - pr_info("INFO:: wrote %08x to %p\n", value, addr);
>> > +#ifdef dwc2_log_writes
>> > + pr_info("info:: wrote %08x to %p\n", value, addr);
>> >  #endif
>> >  }
>> > +#else
>
> Oops, the accidental lowercase conversion is still in here, I'll fix it
> up once we agree on the approach.
>
>> I still think this is something that should be handled at MIPS side, no ?
>
> As I explained, there isn't really anything we can do in MIPS code
> because of the way they have to handle PCI.
>
>> How many more drivers will we have to 'fix' like this ?
>
> Endianess problems will keep coming up, and we have hundreds or thousands
> of drivers that are written with a particular design in mind that could
> be wrong as soon as someone chooses to build an SoC that does things
> differently. Once that happens, we'll fix them.
>
> Also, Christian has already posted a better version of the patch
> that fixes this driver in an architecture independent way, but we still
> need a workaround for the stable backports.

hmmm, at least dwc3 (also from SNPS) has a couple bits where we can
choose endianess for registers and DMA descriptors. John, do we have the
same for dwc2 ? Wouldn't that be a better way to solve the problem ?

-- 
balbi
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH] usb: dwc2: fix regression on big-endian PowerPC/ARM systems

2016-05-12 Thread Felipe Balbi

Hi,

Arnd Bergmann  writes:
> A patch that went into Linux-4.4 to fix big-endian mode on a Lantiq
> MIPS system unfortunately broke big-endian operation on PowerPC
> APM82181 as reported by Christian Lamparter, and likely other
> systems.
>
> It actually introduced multiple issues:
>
> - it broke big-endian ARM kernels: any machine that was working
>   correctly with a little-endian kernel is no longer using byteswaps
>   on big-endian kernels, which clearly breaks them.
> - On PowerPC the same thing must be true: if it was working before,
>   using big-endian kernels is now broken. Unlike ARM, 32-bit PowerPC
>   usually uses big-endian kernels, so they are likely all broken.
> - The barrier for dwc2_writel is on the wrong side of the __raw_writel(),
>   so the MMIO no longer synchronizes with DMA operations.
> - On architectures that require specific CPU instructions for MMIO
>   access, using the __raw_ variant may turn this into a pointer
>   dereference that does not have the same effect as the readl/writel.
>
> This patch is a simple revert for all architectures other than MIPS,
> in the hope that we can more easily backport it to fix the regression
> on PowerPC and ARM systems without breaking the Lantiq system again.
>
> We should follow this up with a more elaborate change to add runtime
> detection of endianess, to make sure it also works on all other
> combinations of architectures and implementations of the usb-dwc2
> device. That patch however will be fairly large and not appropriate
> for backports to stable kernels.
>
> Signed-off-by: Arnd Bergmann 
> Fixes: 95c8bc360944 ("usb: dwc2: Use platform endianness when accessing 
> registers")
> ---
>  drivers/usb/dwc2/core.h | 41 +++--
>  1 file changed, 35 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/usb/dwc2/core.h b/drivers/usb/dwc2/core.h
> index 3c58d633ce80..1f8ed149a40f 100644
> --- a/drivers/usb/dwc2/core.h
> +++ b/drivers/usb/dwc2/core.h
> @@ -64,12 +64,24 @@
>   DWC2_TRACE_SCHEDULER_VB(pr_fmt("%s: SCH: " fmt),\
>   dev_name(hsotg->dev), ##__VA_ARGS__)
>  
> +
> +#ifdef CONFIG_MIPS
> +/*
> + * There are some MIPS machines that can run in either big-endian
> + * or little-endian mode and that use the dwc2 register without
> + * a byteswap in both ways.
> + * Unlike other architectures, MIPS does not require a barrier
> + * before the __raw_writel() to synchronize with DMA but does
> + * require the barrier after the writel() to serialize a series
> + * of writes. This set of operations was added specifically for
> + * MIPS and should only be used there.
> + */
>  static inline u32 dwc2_readl(const void __iomem *addr)
>  {
>   u32 value = __raw_readl(addr);
>  
> - /* In order to preserve endianness __raw_* operation is used. Therefore
> -  * a barrier is needed to ensure IO access is not re-ordered across
> + /* in order to preserve endianness __raw_* operation is used. therefore
> +  * a barrier is needed to ensure io access is not re-ordered across
>* reads or writes
>*/
>   mb();
> @@ -81,15 +93,32 @@ static inline void dwc2_writel(u32 value, void __iomem 
> *addr)
>   __raw_writel(value, addr);
>  
>   /*
> -  * In order to preserve endianness __raw_* operation is used. Therefore
> -  * a barrier is needed to ensure IO access is not re-ordered across
> +  * in order to preserve endianness __raw_* operation is used. therefore
> +  * a barrier is needed to ensure io access is not re-ordered across
>* reads or writes
>*/
>   mb();
> -#ifdef DWC2_LOG_WRITES
> - pr_info("INFO:: wrote %08x to %p\n", value, addr);
> +#ifdef dwc2_log_writes
> + pr_info("info:: wrote %08x to %p\n", value, addr);
>  #endif
>  }
> +#else

I still think this is something that should be handled at MIPS side, no ?

How many more drivers will we have to 'fix' like this ?

-- 
balbi
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: usb: dwc2: regression on MyBook Live Duo / Canyonlands since 4.3.0-rc4

2016-05-09 Thread Felipe Balbi

Hi,

Arnd Bergmann  writes:
> On Monday 09 May 2016 10:23:22 Benjamin Herrenschmidt wrote:
>> On Sun, 2016-05-08 at 13:44 +0200, Christian Lamparter wrote:
>> > On Sunday, May 08, 2016 08:40:55 PM Benjamin Herrenschmidt wrote:
>> > > 
>> > > On Sun, 2016-05-08 at 00:54 +0200, Christian Lamparter via Linuxppc-dev 
>> > > wrote:
>> > > > 
>> > > > I've been looking in getting the MyBook Live Duo's USB OTG port
>> > > > to function. The SoC is a APM82181. Which has a PowerPC 464 core
>> > > > and related to the supported canyonlands architecture in
>> > > > arch/powerpc/.
>> > > > 
>> > > > Currently in -next the dwc2 module doesn't load: 
>> > > Smells like the APM implementation is little endian. You might need to
>> > > use a flag to indicate what endian to use instead and set it
>> > > appropriately based on some DT properties.
>> > I tried. As per common-properties[0], I added little-endian; but it has no
>> > effect. I looked in dwc2_driver_probe and found no way of specifying the
>> > endian of the device. It all comes down to the dwc2_readl & dwc2_writel
>> > accessors. These - sadly - have been hardwired to use __raw_readl and
>> > __raw_writel. So, it's always "native-endian". While common-properties
>> > says little-endian should be preferred.
>> 
>> Right, I meant, you should produce a patch adding a runtime test inside
>> those functions based on a device-tree property, a bit like we do for
>> some of the HCDs like OHCI, EHCI etc...
>> 
>> 
>
> The patch that caused the problem had multiple issues:
>
> - it broke big-endian ARM kernels: any machine that was working
>   correctly with a little-endian kernel is no longer using byteswaps
>   on big-endian kernels, which clearly breaks them.
> - On PowerPC the same thing must be true: if it was working before,
>   using big-endian kernels is now broken. Unlike ARM, 32-bit PowerPC
>   usually uses big-endian kernels, so they are likely all broken.
> - The barrier for dwc2_writel is on the wrong side of the __raw_writel(),
>   so the MMIO no longer synchronizes with DMA operations.
> - On architectures that require specific CPU instructions for MMIO
>   access, using the __raw_ variant may turn this into a pointer
>   dereference that does not have the same effect as the readl/writel.
>
> I think we can simply make this set of accessors architecture-dependent
> (MIPS vs. the rest of the world) to revert ARM and PowerPC back to
> the working version.

and patch all drivers similarly? Shouldn't arch/mips itself deal with it
and hide it from drivers ?

-- 
balbi


signature.asc
Description: PGP signature
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH v5 01/46] usb: gadget: encapsulate endpoint claiming mechanism

2015-08-20 Thread Felipe Balbi
Hi,

On Thu, Aug 20, 2015 at 07:16:48PM +0200, Robert Baldyga wrote:
 On 08/20/2015 06:48 PM, Felipe Balbi wrote:
 On Thu, Aug 20, 2015 at 06:28:14PM +0200, Robert Baldyga wrote:
 Hi Felipe,
 
 On 08/20/2015 05:35 PM, Felipe Balbi wrote:
 [...]
 just letting you know that this regresses all gadget drivers making them
 try to disable previously disabled endpoints and enable previously
 enabled endpoints.
 
 I have a possible fix (see below) but then it shows a problem on the
 host side when using with g_zero (see further below):
 
 commit 3b8932100aacb6cfbffe288ca93025d8b8430c00
 Author: Felipe Balbi ba...@ti.com
 Date:   Wed Aug 19 18:05:27 2015 -0500
 
  usb: gadget: fix ep-claimed lifetime
 
  In order to fix a regression introduced by commit
  cc476b42a39d (usb: gadget: encapsulate endpoint
  claiming mechanism) we have to introduce a simple
  helper to check if a particular is enabled or not.
 
  After that, we need to move ep-claimed lifetime to
  usb_ep_enable() and usb_ep_disable() since those
  are the only functions which actually enable and
  disable endpoints.
 
  A follow-up patch will come to drop all driver_data
  checks from function drivers, since those are, now,
  pointless.
 
  Fixes: cc476b42a39d (usb: gadget: encapsulate endpoint
claiming mechanism)
  Cc: Robert Baldyga r.bald...@samsung.com
  Signed-off-by: Felipe Balbi ba...@ti.com
 
 diff --git a/drivers/usb/gadget/epautoconf.c 
 b/drivers/usb/gadget/epautoconf.c
 index 978435a51038..ad45070cd76f 100644
 --- a/drivers/usb/gadget/epautoconf.c
 +++ b/drivers/usb/gadget/epautoconf.c
 @@ -126,7 +126,6 @@ found_ep:
ep-address = desc-bEndpointAddress;
ep-desc = NULL;
ep-comp_desc = NULL;
 -  ep-claimed = true;
 
 Removing this line causes autoconfig can return the same endpoint many
 times. This probably causes problems with g_zero.
 
 I will try to fix it ASAP.
 
 I was considering the same thing, but the lifetime of -claimed doesn't
 look correct to me either way. Note that once the flag is enabled, it
 won't get disabled by most gadget drivers.
 
 And it should not be. This flag is indicator, that endpoint is used by some
 function. It should be set once by usb_ep_autoconfig() and cleared by
 usb_ep_autoconfig_reset().

have you considered switching interfaces and/or alternate settings ?

 I wonder what is reason of this enable/disable regression. Maybe the problem
 is that we don't set ep-driver_data to NULL in usb_ep_autoconfig_reset()
 (so far it was done). Does this problem occur while gadget is binded to UDC
 for the first time, or at any next time? Unfortunately at this moment I
 don't have access to my hardware, so it will take a moment before I will
 setup some testing environment.

yeah, that's okay. We've got time.

-- 
balbi


signature.asc
Description: Digital signature
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH v5 01/46] usb: gadget: encapsulate endpoint claiming mechanism

2015-08-20 Thread Felipe Balbi
Hi,

On Fri, Jul 31, 2015 at 04:00:13PM +0200, Robert Baldyga wrote:
 So far it was necessary for usb functions to set ep-driver_data in
 endpoint obtained from autoconfig to non-null value, to indicate that
 endpoint is claimed by function (in autoconfig it was checked if endpoint
 has set this field to non-null value, and if it has, it was assumed that
 it is claimed). It could cause bugs because if some function doesn't
 set this field autoconfig could return the same endpoint more than one
 time.
 
 To help to avoid such bugs this patch adds claimed flag to struct usb_ep,
 and  encapsulates endpoint claiming mechanism inside usb_ep_autoconfig_ss()
 and usb_ep_autoconfig_reset(), so now usb functions don't need to perform
 any additional actions to mark endpoint obtained from autoconfig as claimed.
 
 Signed-off-by: Robert Baldyga r.bald...@samsung.com

just letting you know that this regresses all gadget drivers making them
try to disable previously disabled endpoints and enable previously
enabled endpoints.

I have a possible fix (see below) but then it shows a problem on the
host side when using with g_zero (see further below):

commit 3b8932100aacb6cfbffe288ca93025d8b8430c00
Author: Felipe Balbi ba...@ti.com
Date:   Wed Aug 19 18:05:27 2015 -0500

usb: gadget: fix ep-claimed lifetime

In order to fix a regression introduced by commit
cc476b42a39d (usb: gadget: encapsulate endpoint
claiming mechanism) we have to introduce a simple
helper to check if a particular is enabled or not.

After that, we need to move ep-claimed lifetime to
usb_ep_enable() and usb_ep_disable() since those
are the only functions which actually enable and
disable endpoints.

A follow-up patch will come to drop all driver_data
checks from function drivers, since those are, now,
pointless.

Fixes: cc476b42a39d (usb: gadget: encapsulate endpoint
claiming mechanism)
Cc: Robert Baldyga r.bald...@samsung.com
Signed-off-by: Felipe Balbi ba...@ti.com

diff --git a/drivers/usb/gadget/epautoconf.c b/drivers/usb/gadget/epautoconf.c
index 978435a51038..ad45070cd76f 100644
--- a/drivers/usb/gadget/epautoconf.c
+++ b/drivers/usb/gadget/epautoconf.c
@@ -126,7 +126,6 @@ found_ep:
ep-address = desc-bEndpointAddress;
ep-desc = NULL;
ep-comp_desc = NULL;
-   ep-claimed = true;
return ep;
 }
 EXPORT_SYMBOL_GPL(usb_ep_autoconfig_ss);
@@ -182,11 +181,6 @@ EXPORT_SYMBOL_GPL(usb_ep_autoconfig);
  */
 void usb_ep_autoconfig_reset (struct usb_gadget *gadget)
 {
-   struct usb_ep   *ep;
-
-   list_for_each_entry (ep, gadget-ep_list, ep_list) {
-   ep-claimed = false;
-   }
gadget-in_epnum = 0;
gadget-out_epnum = 0;
 }
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
index c14a69b36d27..9b3d60c1cf9f 100644
--- a/include/linux/usb/gadget.h
+++ b/include/linux/usb/gadget.h
@@ -243,6 +243,22 @@ static inline void usb_ep_set_maxpacket_limit(struct 
usb_ep *ep,
 }
 
 /**
+ * usb_ep_enabled - is endpoint enabled ?
+ * @ep: the endpoint being checked. may not be the endpoint named ep0.
+ *
+ * Whenever a function driver wants to check if a particular endpoint is
+ * enabled or not, it must check using this helper function. This will
+ * encapsulate details about how the endpoint is checked, saving the function
+ * driver from using private methods for doing so.
+ *
+ * return true if endpoint is enabled, false otherwise.
+ */
+static inline bool usb_ep_enabled(struct usb_ep *ep)
+{
+   return ep-claimed;
+}
+
+/**
  * usb_ep_enable - configure endpoint, making it usable
  * @ep:the endpoint being configured.  may not be the endpoint named ep0.
  * drivers discover endpoints through the ep_list of a usb_gadget.
@@ -264,7 +280,18 @@ static inline void usb_ep_set_maxpacket_limit(struct 
usb_ep *ep,
  */
 static inline int usb_ep_enable(struct usb_ep *ep)
 {
-   return ep-ops-enable(ep, ep-desc);
+   int ret;
+
+   if (usb_ep_enabled(ep))
+   return 0;
+
+   ret = ep-ops-enable(ep, ep-desc);
+   if (ret)
+   return ret;
+
+   ep-claimed = true;
+
+   return 0;
 }
 
 /**
@@ -281,7 +308,18 @@ static inline int usb_ep_enable(struct usb_ep *ep)
  */
 static inline int usb_ep_disable(struct usb_ep *ep)
 {
-   return ep-ops-disable(ep);
+   int ret;
+
+   if (!usb_ep_enabled(ep))
+   return 0;
+
+   ret = ep-ops-disable(ep);
+   if (ret)
+   return ret;
+
+   ep-claimed = false;
+
+   return 0;
 }
 
 /**



[   73.290345] WARNING: CPU: 0 PID: 300 at lib/kobject.c:240 
kobject_add_internal+0x25c/0x2d8()
[   73.299172] kobject_add_internal failed for ep_81 with -EEXIST, don't try to 
register things with the same name in the same directory.
[   73.311825] Modules linked in: usbtest usb_f_ss_lb g_zero libcomposite 
xhci_plat_hcd xhci_hcd usbcore joydev dwc3 udc_core usb_common m25p80

Re: [PATCH v5 01/46] usb: gadget: encapsulate endpoint claiming mechanism

2015-08-20 Thread Felipe Balbi
On Thu, Aug 20, 2015 at 06:28:14PM +0200, Robert Baldyga wrote:
 Hi Felipe,
 
 On 08/20/2015 05:35 PM, Felipe Balbi wrote:
 [...]
 just letting you know that this regresses all gadget drivers making them
 try to disable previously disabled endpoints and enable previously
 enabled endpoints.
 
 I have a possible fix (see below) but then it shows a problem on the
 host side when using with g_zero (see further below):
 
 commit 3b8932100aacb6cfbffe288ca93025d8b8430c00
 Author: Felipe Balbi ba...@ti.com
 Date:   Wed Aug 19 18:05:27 2015 -0500
 
  usb: gadget: fix ep-claimed lifetime
 
  In order to fix a regression introduced by commit
  cc476b42a39d (usb: gadget: encapsulate endpoint
  claiming mechanism) we have to introduce a simple
  helper to check if a particular is enabled or not.
 
  After that, we need to move ep-claimed lifetime to
  usb_ep_enable() and usb_ep_disable() since those
  are the only functions which actually enable and
  disable endpoints.
 
  A follow-up patch will come to drop all driver_data
  checks from function drivers, since those are, now,
  pointless.
 
  Fixes: cc476b42a39d (usb: gadget: encapsulate endpoint
  claiming mechanism)
  Cc: Robert Baldyga r.bald...@samsung.com
  Signed-off-by: Felipe Balbi ba...@ti.com
 
 diff --git a/drivers/usb/gadget/epautoconf.c 
 b/drivers/usb/gadget/epautoconf.c
 index 978435a51038..ad45070cd76f 100644
 --- a/drivers/usb/gadget/epautoconf.c
 +++ b/drivers/usb/gadget/epautoconf.c
 @@ -126,7 +126,6 @@ found_ep:
  ep-address = desc-bEndpointAddress;
  ep-desc = NULL;
  ep-comp_desc = NULL;
 -ep-claimed = true;
 
 Removing this line causes autoconfig can return the same endpoint many
 times. This probably causes problems with g_zero.
 
 I will try to fix it ASAP.

I was considering the same thing, but the lifetime of -claimed doesn't
look correct to me either way. Note that once the flag is enabled, it
won't get disabled by most gadget drivers.

-- 
balbi


signature.asc
Description: Digital signature
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH v5 00/46] usb: gadget: rework ep matching and claiming mechanism

2015-08-04 Thread Felipe Balbi
Hi,

On Fri, Jul 31, 2015 at 04:00:12PM +0200, Robert Baldyga wrote:
 Hello,
 
 This patch series reworks endpoint matching and claiming mechanism in
 epautoconf. From v2 there are couple of new patches adding 'ep_match'
 to usb_gadget_ops and removing chip-specific quirk handling from generic
 code of autoconfig.
 
 I'm not sure if this patch set isn't too long, as it has 46 patches,
 but I decided to send it as single series to avoid problems with patch
 applying order.
 
 The aim of whole patchset is to rework epautoconf code to get rid of
 things like name-based endpoint matching and UDC name-based quirks in
 generic code. These needed to do some modifications in framework like
 adding 'endpoint capabilities flags' feature or adding 'match_ep'.
 
 Following paragraphs contain brief description of what modifications are
 done by particular parts of this patch set:
 
 Patch (1) introduces new safer endpoint claiming method, basing on new
 'claimed' flag. It was discussed here [1]. I proposed this solution over
 year ago and it was accepted, but I apparently forgot to send the final
 version of my patch.
 
 Patches (2-3) add the 'capabilities flags' structure and helper macros.
 This solution is inspired by the 'feature flags' originally proposed
 by Felipe Balbi in 2013 [2], but unfortunately implementation of this
 feature has never been completed.
 
 Patches (4-36) add' capabilites flags' support to all UDC drivers present
 in the kernel tree. It's needed to be done before replacing old endpoint
 matching mechanism, otherwise UDC drivers which doesn't set 'capabilities
 flags' won't work with new matching function.
 
 Patch (37) finally replaces old endpoint matching method with the new
 one basing on capabilities flags.
 
 These changes aims to get rid of code, which guesses endpoint capabilities
 basing on it's name, and introduce new better replacement. In result
 we have better way to describe types and directions supported by each
 endpoint.
 
 For example the old name-based method didn't allow to have endpoint
 supporing two types of transfers - there were only ability to support
 one or all of endpoint types. The 'capabilities flags' feature supply
 precise, flexible and extensible mechanism of description of endpoint
 hardware limitations, which is desired for proper endpoint matching.
 
 Patch (38) removes chip-specific quirk from ep_matches() function.
 
 Patches (39-40) remove code modifying endpoint and descriptor structures
 from ep_matches() function and cleans it up to make it simpler and more
 readable.
 
 Patch (41) add 'match_ep' callback to usb_gadget_ops and make use of
 it in epautoconf. This callback allows UDC drivers to supply non-standard
 endpoint matching algorithms.
 
 Patches (42-43) move ep_matches() and find_ep() functions outside
 epautoconf and rename them to usb_gadget_ep_match_desc() and
 gadget_find_ep_by_name(). It's because they may be useful in 'match_ep'
 callbacks in UDC drivers to avoid writing repetitive code.
 
 Patches (44-46) move chip-specific enpoint matching algorithms from
 generic code of usb_ep_autoconfig_ss() function to UDC controller drivers
 using 'match_ep' callback.
 
 In the result we have epautoconf source free of chip-specific code, plus
 two new mechanisms allowing to handle non-standard hardware limitations.
 
 [1] https://lkml.org/lkml/2014/6/16/94
 [2] http://www.spinics.net/lists/linux-usb/msg99662.html

adding these to my testing/next after fixing a few build warnings and
the comment I had on dwc3 patch. Let's hope it just works :-)

-- 
balbi


signature.asc
Description: Digital signature
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH v5 40/46] usb: gadget: epautoconf: rework ep_matches() function

2015-08-04 Thread Felipe Balbi
On Fri, Jul 31, 2015 at 04:00:52PM +0200, Robert Baldyga wrote:
 Rework ep_matches() function to make it shorter and more readable.
 
 Signed-off-by: Robert Baldyga r.bald...@samsung.com

this regresses at least mass storage. How did you test it ? I'll keep
all patches up to this one, please fix the problem, rebase on
testing/next and resend the remaining patches.

cheers

-- 
balbi


signature.asc
Description: Digital signature
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH v5 07/46] usb: dwc3: gadget: add ep capabilities support

2015-08-04 Thread Felipe Balbi
On Fri, Jul 31, 2015 at 04:00:19PM +0200, Robert Baldyga wrote:
 Convert endpoint configuration to new capabilities model.
 
 Signed-off-by: Robert Baldyga r.bald...@samsung.com
 ---
  drivers/usb/dwc3/gadget.c | 13 +
  1 file changed, 13 insertions(+)
 
 diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
 index 2feed9e..bd4c3db 100644
 --- a/drivers/usb/dwc3/gadget.c
 +++ b/drivers/usb/dwc3/gadget.c
 @@ -1715,6 +1715,19 @@ static int dwc3_gadget_init_hw_endpoints(struct dwc3 
 *dwc,
   return ret;
   }
  
 + if (epnum == 0 || epnum == 1) {
 + dep-endpoint.caps.type_control = true;
 + } else {
 + dep-endpoint.caps.type_iso = true;
 + dep-endpoint.caps.type_bulk = true;
 + dep-endpoint.caps.type_int = true;
 + }
 +
 + if (direction)
 + dep-endpoint.caps.dir_in = true;
 + else
 + dep-endpoint.caps.dir_out = true;

you can avoid the branch for the direction:

dep-endpoint.caps.dir_in = !!direction;
dep-endpoint.caps.dir_out = !direction;

-- 
balbi


signature.asc
Description: Digital signature
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH v5 02/46] usb: gadget: add endpoint capabilities flags

2015-07-31 Thread Felipe Balbi
Hi,

On Fri, Jul 31, 2015 at 03:51:52PM +, David Laight wrote:
 From: Robert Baldyga
  Sent: 31 July 2015 15:00
  Introduce struct usb_ep_caps which contains information about capabilities
  of usb endpoints - supported transfer types and directions. This structure
  should be filled by UDC driver for each of its endpoints, and will be
  used in epautoconf in new ep matching mechanism which will replace ugly
  guessing of endpoint capabilities basing on its name.
  
  Signed-off-by: Robert Baldyga r.bald...@samsung.com
  ---
   include/linux/usb/gadget.h | 21 +
   1 file changed, 21 insertions(+)
  
  diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
  index 68fb5e8..a9a4959 100644
  --- a/include/linux/usb/gadget.h
  +++ b/include/linux/usb/gadget.h
  @@ -141,10 +141,29 @@ struct usb_ep_ops {
   };
 ...
  +struct usb_ep_caps {
  +   unsigned type_control:1;
  +   unsigned type_iso:1;
  +   unsigned type_bulk:1;
  +   unsigned type_int:1;
  +   unsigned dir_in:1;
  +   unsigned dir_out:1;
  +};
 
 With the way this is used (eg below from 13/46)
 
 +
 + if (i == 0) {
 + ep-ep.caps.type_control = true;
 + } else {
 + ep-ep.caps.type_iso = true;
 + ep-ep.caps.type_bulk = true;
 + ep-ep.caps.type_int = true;
 + }
 +
 + ep-ep.caps.dir_in = true;
 + ep-ep.caps.dir_out = true;
 
 I think it would be more obvious if you used a u8 and explicit bitmasks.
 The initialisation (as above) would the be explicitly assigning 'not 
 supported'
 to the other fields.
 The compiler will also generate much better code...

compiler should convert single bit flags into u32 just fine. It's all
static data anyway. Besides, single bit flags allow us to have as many
as we need without ending up with stuff like:

u32 flags;
u32 flags1;
u32 flags2;

etc. Just let the compiler do those conversions for us.

-- 
balbi


signature.asc
Description: Digital signature
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH v4 04/46] staging: emxx_udc: add ep capabilities support

2015-07-30 Thread Felipe Balbi
Hi,

On Thu, Jul 30, 2015 at 09:15:38AM +0200, Robert Baldyga wrote:
 On 07/29/2015 05:20 PM, Felipe Balbi wrote:
  On Mon, Jul 27, 2015 at 11:16:14AM +0200, Robert Baldyga wrote:
  Convert endpoint configuration to new capabilities model.
 
  Fixed typo in epc-nulk to epc-bulk.
 
  Signed-off-by: Robert Baldyga r.bald...@samsung.com
  ---
   drivers/staging/emxx_udc/emxx_udc.c | 60 
  ++---
   1 file changed, 29 insertions(+), 31 deletions(-)
 
  diff --git a/drivers/staging/emxx_udc/emxx_udc.c 
  b/drivers/staging/emxx_udc/emxx_udc.c
  index 3b7aa36..0d64bee 100644
  --- a/drivers/staging/emxx_udc/emxx_udc.c
  +++ b/drivers/staging/emxx_udc/emxx_udc.c
  @@ -3153,36 +3153,33 @@ static const struct usb_gadget_ops 
  nbu2ss_gadget_ops = {
 .ioctl  = nbu2ss_gad_ioctl,
   };
   
  -static const char g_ep0_name[] = ep0;
  -static const char g_ep1_name[] = ep1-bulk;
  -static const char g_ep2_name[] = ep2-bulk;
  -static const char g_ep3_name[] = ep3in-int;
  -static const char g_ep4_name[] = ep4-iso;
  -static const char g_ep5_name[] = ep5-iso;
  -static const char g_ep6_name[] = ep6-bulk;
  -static const char g_ep7_name[] = ep7-bulk;
  -static const char g_ep8_name[] = ep8in-int;
  -static const char g_ep9_name[] = ep9-iso;
  -static const char g_epa_name[] = epa-iso;
  -static const char g_epb_name[] = epb-bulk;
  -static const char g_epc_name[] = epc-nulk;
  -static const char g_epd_name[] = epdin-int;
  -
  -static const char *gp_ep_name[NUM_ENDPOINTS] = {
  -  g_ep0_name,
  -  g_ep1_name,
  -  g_ep2_name,
  -  g_ep3_name,
  -  g_ep4_name,
  -  g_ep5_name,
  -  g_ep6_name,
  -  g_ep7_name,
  -  g_ep8_name,
  -  g_ep9_name,
  -  g_epa_name,
  -  g_epb_name,
  -  g_epc_name,
  -  g_epd_name,
  +static const struct {
  +  const char *name;
  +  const struct usb_ep_caps caps;
  +} ep_info[NUM_ENDPOINTS] = {
  +#define EP_INFO(_name, _type, _dir) \
  +  { \
  +  .name = _name, \
  +  .caps = USB_EP_CAPS(USB_EP_CAPS_TYPE_ ## _type, \
  +  USB_EP_CAPS_DIR_ ## _dir), \
  +  }
  +
  +  EP_INFO(ep0,  CONTROL, ALL),
  +  EP_INFO(ep1-bulk, BULK,   ALL),
  +  EP_INFO(ep2-bulk, BULK,   ALL),
  +  EP_INFO(ep3in-int,INT,IN),
  +  EP_INFO(ep4-iso,  INT,ALL),
  +  EP_INFO(ep5-iso,  ISO,ALL),
  +  EP_INFO(ep6-bulk, ISO,ALL),
  +  EP_INFO(ep7-bulk, BULK,   ALL),
  +  EP_INFO(ep8in-int,INT,IN),
  +  EP_INFO(ep9-iso,  ISO,ALL),
  +  EP_INFO(epa-iso,  ISO,ALL),
  +  EP_INFO(epb-bulk, BULK,   ALL),
  +  EP_INFO(epc-bulk, BULK,   ALL),
  +  EP_INFO(epdin-int,INT,IN),
  
  IMO, this is pointless obfuscation. It just makes it a pain to grep
  source around. Why don't you have UDC drivers initialize the 1-bit flags
  directly ?
  
 
 Do you mean something like this? It just makes it a pain to scroll this
 source ;)

but it's at least easy to grep. Another option would be the following:

EP_INFO(ep0, USB_EP_CAPS(USB_EP_CAPS_TYPE_CONTROL,
USB_EP_CAPS_DIR_ALL)),

that also helps grepping.

-- 
balbi


signature.asc
Description: Digital signature
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH v4 04/46] staging: emxx_udc: add ep capabilities support

2015-07-29 Thread Felipe Balbi
On Mon, Jul 27, 2015 at 11:16:14AM +0200, Robert Baldyga wrote:
 Convert endpoint configuration to new capabilities model.
 
 Fixed typo in epc-nulk to epc-bulk.
 
 Signed-off-by: Robert Baldyga r.bald...@samsung.com
 ---
  drivers/staging/emxx_udc/emxx_udc.c | 60 
 ++---
  1 file changed, 29 insertions(+), 31 deletions(-)
 
 diff --git a/drivers/staging/emxx_udc/emxx_udc.c 
 b/drivers/staging/emxx_udc/emxx_udc.c
 index 3b7aa36..0d64bee 100644
 --- a/drivers/staging/emxx_udc/emxx_udc.c
 +++ b/drivers/staging/emxx_udc/emxx_udc.c
 @@ -3153,36 +3153,33 @@ static const struct usb_gadget_ops nbu2ss_gadget_ops 
 = {
   .ioctl  = nbu2ss_gad_ioctl,
  };
  
 -static const char g_ep0_name[] = ep0;
 -static const char g_ep1_name[] = ep1-bulk;
 -static const char g_ep2_name[] = ep2-bulk;
 -static const char g_ep3_name[] = ep3in-int;
 -static const char g_ep4_name[] = ep4-iso;
 -static const char g_ep5_name[] = ep5-iso;
 -static const char g_ep6_name[] = ep6-bulk;
 -static const char g_ep7_name[] = ep7-bulk;
 -static const char g_ep8_name[] = ep8in-int;
 -static const char g_ep9_name[] = ep9-iso;
 -static const char g_epa_name[] = epa-iso;
 -static const char g_epb_name[] = epb-bulk;
 -static const char g_epc_name[] = epc-nulk;
 -static const char g_epd_name[] = epdin-int;
 -
 -static const char *gp_ep_name[NUM_ENDPOINTS] = {
 - g_ep0_name,
 - g_ep1_name,
 - g_ep2_name,
 - g_ep3_name,
 - g_ep4_name,
 - g_ep5_name,
 - g_ep6_name,
 - g_ep7_name,
 - g_ep8_name,
 - g_ep9_name,
 - g_epa_name,
 - g_epb_name,
 - g_epc_name,
 - g_epd_name,
 +static const struct {
 + const char *name;
 + const struct usb_ep_caps caps;
 +} ep_info[NUM_ENDPOINTS] = {
 +#define EP_INFO(_name, _type, _dir) \
 + { \
 + .name = _name, \
 + .caps = USB_EP_CAPS(USB_EP_CAPS_TYPE_ ## _type, \
 + USB_EP_CAPS_DIR_ ## _dir), \
 + }
 +
 + EP_INFO(ep0,  CONTROL, ALL),
 + EP_INFO(ep1-bulk, BULK,   ALL),
 + EP_INFO(ep2-bulk, BULK,   ALL),
 + EP_INFO(ep3in-int,INT,IN),
 + EP_INFO(ep4-iso,  INT,ALL),
 + EP_INFO(ep5-iso,  ISO,ALL),
 + EP_INFO(ep6-bulk, ISO,ALL),
 + EP_INFO(ep7-bulk, BULK,   ALL),
 + EP_INFO(ep8in-int,INT,IN),
 + EP_INFO(ep9-iso,  ISO,ALL),
 + EP_INFO(epa-iso,  ISO,ALL),
 + EP_INFO(epb-bulk, BULK,   ALL),
 + EP_INFO(epc-bulk, BULK,   ALL),
 + EP_INFO(epdin-int,INT,IN),

IMO, this is pointless obfuscation. It just makes it a pain to grep
source around. Why don't you have UDC drivers initialize the 1-bit flags
directly ?

-- 
balbi


signature.asc
Description: Digital signature
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH v3 07/46] usb: dwc3: gadget: add ep capabilities support

2015-07-21 Thread Felipe Balbi
Hi,

On Wed, Jul 15, 2015 at 08:31:54AM +0200, Robert Baldyga wrote:
 Convert endpoint configuration to new capabilities model.
 
 Signed-off-by: Robert Baldyga r.bald...@samsung.com
 ---
  drivers/usb/dwc3/gadget.c | 13 +
  1 file changed, 13 insertions(+)
 
 diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
 index 333a7c0..8d1f768 100644
 --- a/drivers/usb/dwc3/gadget.c
 +++ b/drivers/usb/dwc3/gadget.c
 @@ -1713,6 +1713,19 @@ static int dwc3_gadget_init_hw_endpoints(struct dwc3 
 *dwc,
   return ret;
   }
  
 + if (epnum == 0) {
 + dep-endpoint.caps.type_control = true;

as the name says, this function deals with hw endpoints. This means ep1
is also control.

-- 
balbi


signature.asc
Description: Digital signature
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH] cleanup on stack DECLARE_COMPLETIONs

2014-12-23 Thread Felipe Balbi
On Tue, Dec 23, 2014 at 06:34:08PM +0100, Nicholas Mc Guire wrote:
 fixups for incorrect use of DECLARE_COMPLETION. see also commit
 6e9a4738 (completions: lockdep annotate on stack completions)
 The only somewhat special case being
 drivers/misc/sgi-gru/grukservices.c:quicktest2
 which had a static qualifier in the original DECLARE_COMPLETION()
 but that seems to be wrong (why should the completion persisted between
 successive calls ?) so the conversion to DECLARE_COMPLETION_ONSTACK
 was also applied and the static qualifier removed.
 
 Not sure if this is suitable in this form or if it should go out as
 5 seperate patches ? 
 
 This was only code reviewed and compile tested
 
 Signed-off-by: Nicholas Mc Guire der.h...@hofr.at

please split drivers/usb/gadget out of this patch so I can take it
through my tree.

-- 
balbi


signature.asc
Description: Digital signature
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH] [resend] net: get rid of SET_ETHTOOL_OPS

2014-05-12 Thread Felipe Balbi
On Sun, May 11, 2014 at 12:12:32AM +, Wilfried Klaebe wrote:
 net: get rid of SET_ETHTOOL_OPS
 
 Dave Miller mentioned he'd like to see SET_ETHTOOL_OPS gone.
 This does that.
 
 Mostly done via coccinelle script:
 @@
 struct ethtool_ops *ops;
 struct net_device *dev;
 @@
 -   SET_ETHTOOL_OPS(dev, ops);
 +   dev-ethtool_ops = ops;
 
 Compile tested only, but I'd seriously wonder if this broke anything.
 
 Suggested-by: Dave Miller da...@davemloft.net
 Signed-off-by: Wilfried Klaebe w-l...@lebenslange-mailadresse.de

for drivers/usb/gadget/:

Acked-by: Felipe Balbi ba...@ti.com

-- 
balbi


signature.asc
Description: Digital signature
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [RFC PATCH 0/2] usb: Reuse fsl driver code for synopsys usb controller

2014-04-21 Thread Felipe Balbi
On Sun, Apr 20, 2014 at 09:57:03PM +0530, Punnaiah Choudary Kalluri wrote:
 Zynq soc contains a dual role usb controller and this IP is from synopsys. We
 observed that there is driver available for this controller from freescale and
 decided to reuse this driver for zynq use.
 
 Here is the link for zynq soc TRM. Please refer chapter 15 for usb controller
 related information.
 http://www.xilinx.com/support/documentation/user_guides/ug585-Zynq-7000-TRM.pdf
 
 The following series of patches add initial support for zynq soc in fsl 
 gadget controller
 driver and fsl host controller driver.
 
 Based on these patches, I have the following concerns and sugesstions
 
 Since the freescale usb driver is for synopsys IP, Please consider rebranding
 this driver name and config options to reflect that it is a sysnopsys IP. So
 that other vendors who using this IP can reuse thie driver.
 
 Also the ehci-fsl.c is for powerpc based soc's, and zynq is ARM based, i have
 protected the code which is specifc to freescale with CONFIG_FSL_SOC. Please
 suggest if there is a better way of doing this?
 
 Punnaiah Choudary Kalluri (2):
   usb: gadget: fsl_udc: Add support for zynq usb device controller
   usb: ehci-fsl: Add support for zynq usb host controller
 
  drivers/usb/gadget/Kconfig|2 +-
  drivers/usb/gadget/Makefile   |1 +
  drivers/usb/gadget/fsl_mxc_udc.c  |   21 
  drivers/usb/gadget/fsl_udc_core.c |5 +++
  drivers/usb/gadget/fsl_usb2_udc.h |2 +-
  drivers/usb/host/Kconfig  |2 +-
  drivers/usb/host/ehci-fsl.c   |   63 
 -
  drivers/usb/host/fsl-mph-dr-of.c  |9 +
  8 files changed, 101 insertions(+), 4 deletions(-)

as somebody else already mentioned, chipidea is the way to go.


-- 
balbi


signature.asc
Description: Digital signature
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH 42/51] DMA-API: usb: musb: use platform_device_register_full() to avoid directly messing with dma masks

2013-09-20 Thread Felipe Balbi
Hi,

On Fri, Sep 20, 2013 at 12:14:38AM +0100, Russell King wrote:
 Use platform_device_register_full() for those drivers which can, to
 avoid messing directly with DMA masks.  This can only be done when
 the driver does not need to access the allocated musb platform device
 from within its callbacks, which may be called during the musb
 device probing.
 
 Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk

you want me to carry this one through my tree or you prefer getting my
Acked-by ? Either way works for me:

Acked-by: Felipe Balbi ba...@ti.com

there's also the third option of me setting up a branch with only this
patch and we both merge it, that'd also work.

cheers

-- 
balbi


signature.asc
Description: Digital signature
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH 37/51] DMA-API: usb: use new dma_coerce_mask_and_coherent()

2013-09-20 Thread Felipe Balbi
Hi,

On Thu, Sep 19, 2013 at 11:02:03PM +0100, Russell King wrote:
 diff --git a/drivers/usb/dwc3/dwc3-exynos.c b/drivers/usb/dwc3/dwc3-exynos.c
 index c10b324..8b20c70 100644
 --- a/drivers/usb/dwc3/dwc3-exynos.c
 +++ b/drivers/usb/dwc3/dwc3-exynos.c
 @@ -119,9 +119,7 @@ static int dwc3_exynos_probe(struct platform_device *pdev)
* Since shared usb code relies on it, set it here for now.
* Once we move to full device tree support this will vanish off.
*/
 - if (!dev-dma_mask)
 - dev-dma_mask = dev-coherent_dma_mask;
 - ret = dma_set_coherent_mask(dev, DMA_BIT_MASK(32));
 + ret = dma_coerce_mask_and_coherent(dev, DMA_BIT_MASK(32));
   if (ret)
   goto err1;
  
 diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c
 index d0759c5..6fa82d6 100644
 --- a/drivers/usb/host/ehci-omap.c
 +++ b/drivers/usb/host/ehci-omap.c
 @@ -144,9 +144,7 @@ static int ehci_hcd_omap_probe(struct platform_device 
 *pdev)
* Since shared usb code relies on it, set it here for now.
* Once we have dma capability bindings this can go away.
*/
 - if (!dev-dma_mask)
 - dev-dma_mask = dev-coherent_dma_mask;
 - ret = dma_set_coherent_mask(dev, DMA_BIT_MASK(32));
 + ret = dma_coerce_mask_and_coherent(dev, DMA_BIT_MASK(32));
   if (ret)
   return ret;

for dwc3 and ehci-omap:

Acked-by: Felipe Balbi ba...@ti.com

-- 
balbi


signature.asc
Description: Digital signature
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH 36/51] DMA-API: usb: use dma_set_coherent_mask()

2013-09-20 Thread Felipe Balbi
Hi,

On Thu, Sep 19, 2013 at 11:01:03PM +0100, Russell King wrote:
 diff --git a/drivers/usb/dwc3/dwc3-exynos.c b/drivers/usb/dwc3/dwc3-exynos.c
 index 2f2e88a..c10b324 100644
 --- a/drivers/usb/dwc3/dwc3-exynos.c
 +++ b/drivers/usb/dwc3/dwc3-exynos.c
 @@ -121,8 +121,9 @@ static int dwc3_exynos_probe(struct platform_device *pdev)
*/
   if (!dev-dma_mask)
   dev-dma_mask = dev-coherent_dma_mask;
 - if (!dev-coherent_dma_mask)
 - dev-coherent_dma_mask = DMA_BIT_MASK(32);
 + ret = dma_set_coherent_mask(dev, DMA_BIT_MASK(32));
 + if (ret)
 + goto err1;
  
   platform_set_drvdata(pdev, exynos);
  
 diff --git a/drivers/usb/gadget/lpc32xx_udc.c 
 b/drivers/usb/gadget/lpc32xx_udc.c
 index 67128be..6a2a65a 100644
 --- a/drivers/usb/gadget/lpc32xx_udc.c
 +++ b/drivers/usb/gadget/lpc32xx_udc.c
 @@ -3078,7 +3078,9 @@ static int __init lpc32xx_udc_probe(struct 
 platform_device *pdev)
udc-isp1301_i2c_client-addr);
  
   pdev-dev.dma_mask = lpc32xx_usbd_dmamask;
 - pdev-dev.coherent_dma_mask = DMA_BIT_MASK(32);
 + retval = dma_set_coherent_mask(pdev-dev, DMA_BIT_MASK(32));
 + if (retval)
 + goto resource_fail;
  
   udc-board = lpc32xx_usbddata;
  

for dwc3 and drivers/usb/gadget:

Acked-by: Felipe Balbi ba...@ti.com

pretty cool work :-)

-- 
balbi


signature.asc
Description: Digital signature
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH RESEND] i2c: move of helpers into the core

2013-08-19 Thread Felipe Balbi
On Mon, Aug 19, 2013 at 07:59:40PM +0200, Wolfram Sang wrote:
 I2C of helpers used to live in of_i2c.c but experience (from SPI) shows
 that it is much cleaner to have this in the core. This also removes a
 circular dependency between the helpers and the core, and so we can
 finally register child nodes in the core instead of doing this manually
 in each driver. So, fix the drivers and documentation, too.
 
 Signed-off-by: Wolfram Sang w...@the-dreams.de

for i2c-omap.c:

Reviewed-by: Felipe Balbi ba...@ti.com

-- 
balbi


signature.asc
Description: Digital signature
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [RFC/PATCH 29/32] usb: gadget: pxa27x_udc: let udc-core manage gadget-dev

2013-02-04 Thread Felipe Balbi
On Mon, Jan 28, 2013 at 09:18:29PM +0100, Robert Jarzmik wrote:
 Felipe Balbi ba...@ti.com writes:
 
  By simply setting a flag, we can drop some
  boilerplate code.
 
  Signed-off-by: Felipe Balbi ba...@ti.com
  ---
   drivers/usb/gadget/pxa27x_udc.c | 9 +
 Acked-by: Robert Jarzmik robert.jarz...@free.fr
 
 And I tested also your patch and it works in my environment. For next patches
 I'd like to be CCed for pxa27x_udc stuff as I'm maintaining that one since its
 beginning (and yes, I know, I didn't put that in MAINTAINERS ...).

you should add yourself to MAINTAINERS. Please send a patch to Greg when
you have time.

No need to prepare a tree, though. I just need you to give your Acked-by
and I'll queue the patches myself.

cheers

-- 
balbi


signature.asc
Description: Digital signature
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[RFC/PATCH 01/32] usb: gadget: udc-core: allow udc class register gadget device

2013-01-24 Thread Felipe Balbi
Currently all UDC drivers are calling
device_register() before calling
usb_add_gadget_udc(). In order to avoid
code duplication, we can allow udc-core.c
register that device.

However that would become a really large patch,
so to cope with the meanwhile and allow us
to write bite-sized patches, we're adding
a flag which will be set by UDC driver once
it removes the code for registering the
gadget device.

Once all are converted, the new flag will
be removed.

Signed-off-by: Felipe Balbi ba...@ti.com
---
 drivers/usb/gadget/udc-core.c | 23 +++
 include/linux/usb/gadget.h|  4 
 2 files changed, 23 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/gadget/udc-core.c b/drivers/usb/gadget/udc-core.c
index 2a9cd36..9195054 100644
--- a/drivers/usb/gadget/udc-core.c
+++ b/drivers/usb/gadget/udc-core.c
@@ -173,6 +173,14 @@ int usb_add_gadget_udc(struct device *parent, struct 
usb_gadget *gadget)
if (!udc)
goto err1;
 
+   if (gadget-register_my_device) {
+   dev_set_name(gadget-dev, gadget);
+
+   ret = device_register(gadget-dev);
+   if (ret)
+   goto err2;
+   }
+
device_initialize(udc-dev);
udc-dev.release = usb_udc_release;
udc-dev.class = udc_class;
@@ -180,7 +188,7 @@ int usb_add_gadget_udc(struct device *parent, struct 
usb_gadget *gadget)
udc-dev.parent = parent;
ret = dev_set_name(udc-dev, %s, kobject_name(parent-kobj));
if (ret)
-   goto err2;
+   goto err3;
 
udc-gadget = gadget;
 
@@ -189,18 +197,22 @@ int usb_add_gadget_udc(struct device *parent, struct 
usb_gadget *gadget)
 
ret = device_add(udc-dev);
if (ret)
-   goto err3;
+   goto err4;
 
mutex_unlock(udc_lock);
 
return 0;
-err3:
+
+err4:
list_del(udc-list);
mutex_unlock(udc_lock);
 
-err2:
+err3:
put_device(udc-dev);
 
+err2:
+   if (gadget-register_my_device)
+   put_device(gadget-dev);
 err1:
return ret;
 }
@@ -254,6 +266,9 @@ found:
 
kobject_uevent(udc-dev.kobj, KOBJ_REMOVE);
device_unregister(udc-dev);
+
+   if (gadget-register_my_device)
+   device_unregister(gadget-dev);
 }
 EXPORT_SYMBOL_GPL(usb_del_gadget_udc);
 
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
index 2e297e8..fcd9ef8 100644
--- a/include/linux/usb/gadget.h
+++ b/include/linux/usb/gadget.h
@@ -494,6 +494,9 @@ struct usb_gadget_ops {
  * only supports HNP on a different root port.
  * @b_hnp_enable: OTG device feature flag, indicating that the A-Host
  * enabled HNP support.
+ * @register_my_device: Flag telling udc-core that UDC driver didn't
+ * register the gadget device to the driver model. Temporary until
+ * all UDC drivers are fixed up properly.
  * @name: Identifies the controller hardware type.  Used in diagnostics
  * and sometimes configuration.
  * @dev: Driver model state for this abstract device.
@@ -531,6 +534,7 @@ struct usb_gadget {
unsignedb_hnp_enable:1;
unsigneda_hnp_support:1;
unsigneda_alt_hnp_support:1;
+   unsignedregister_my_device:1;
const char  *name;
struct device   dev;
unsignedout_epnum;
-- 
1.8.1.rc1.5.g7e0651a

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[RFC/PATCH 03/32] usb: musb: gadget: let udc-core manage gadget-dev

2013-01-24 Thread Felipe Balbi
By simply setting a flag, we can delete a little
boilerplate code.

Signed-off-by: Felipe Balbi ba...@ti.com
---
 drivers/usb/musb/musb_gadget.c | 10 +-
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c
index 8767874..1c4a8e8 100644
--- a/drivers/usb/musb/musb_gadget.c
+++ b/drivers/usb/musb/musb_gadget.c
@@ -1871,12 +1871,11 @@ int musb_gadget_setup(struct musb *musb)
musb-g.speed = USB_SPEED_UNKNOWN;
 
/* this gadget abstracts/virtualizes the controller */
-   dev_set_name(musb-g.dev, gadget);
musb-g.dev.parent = musb-controller;
musb-g.dev.dma_mask = musb-controller-dma_mask;
musb-g.dev.release = musb_gadget_release;
musb-g.name = musb_driver_name;
-
+   musb-g.register_my_device = true;
musb-g.is_otg = 1;
 
musb_g_init_endpoints(musb);
@@ -1884,11 +1883,6 @@ int musb_gadget_setup(struct musb *musb)
musb-is_active = 0;
musb_platform_try_idle(musb, 0);
 
-   status = device_register(musb-g.dev);
-   if (status != 0) {
-   put_device(musb-g.dev);
-   return status;
-   }
status = usb_add_gadget_udc(musb-controller, musb-g);
if (status)
goto err;
@@ -1903,8 +1897,6 @@ err:
 void musb_gadget_cleanup(struct musb *musb)
 {
usb_del_gadget_udc(musb-g);
-   if (musb-g.dev.parent)
-   device_unregister(musb-g.dev);
 }
 
 /*
-- 
1.8.1.rc1.5.g7e0651a

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[RFC/PATCH 04/32] usb: gadget: omap_udc: let udc-core manage gadget-dev

2013-01-24 Thread Felipe Balbi
By simply setting a flag, we drop some boilerplate
code.

Signed-off-by: Felipe Balbi ba...@ti.com
---
 drivers/usb/gadget/omap_udc.c | 12 
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/usb/gadget/omap_udc.c b/drivers/usb/gadget/omap_udc.c
index d0c87b1..234e82b 100644
--- a/drivers/usb/gadget/omap_udc.c
+++ b/drivers/usb/gadget/omap_udc.c
@@ -2631,10 +2631,9 @@ omap_udc_setup(struct platform_device *odev, struct 
usb_phy *xceiv)
udc-gadget.max_speed = USB_SPEED_FULL;
udc-gadget.name = driver_name;
 
-   device_initialize(udc-gadget.dev);
-   dev_set_name(udc-gadget.dev, gadget);
udc-gadget.dev.release = omap_udc_release;
udc-gadget.dev.parent = odev-dev;
+   udc-gadget.register_my_device = true;
if (use_dma)
udc-gadget.dev.dma_mask = odev-dev.dma_mask;
 
@@ -2911,14 +2910,12 @@ bad_on_1710:
}
 
create_proc_file();
-   status = device_add(udc-gadget.dev);
+   status = usb_add_gadget_udc(pdev-dev, udc-gadget);
if (status)
goto cleanup4;
 
-   status = usb_add_gadget_udc(pdev-dev, udc-gadget);
-   if (!status)
-   return status;
-   /* If fail, fall through */
+   return 0;
+
 cleanup4:
remove_proc_file();
 
@@ -2989,7 +2986,6 @@ static int omap_udc_remove(struct platform_device *pdev)
release_mem_region(pdev-resource[0].start,
pdev-resource[0].end - pdev-resource[0].start + 1);
 
-   device_unregister(udc-gadget.dev);
wait_for_completion(done);
 
return 0;
-- 
1.8.1.rc1.5.g7e0651a

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[RFC/PATCH 08/32] usb: gadget: bcm63xx_udc: let udc-core manage gadget-dev

2013-01-24 Thread Felipe Balbi
By simply setting a flag, we can drop some
boilerplate code.

Signed-off-by: Felipe Balbi ba...@ti.com
---
 drivers/usb/gadget/bcm63xx_udc.c | 7 +--
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/usb/gadget/bcm63xx_udc.c b/drivers/usb/gadget/bcm63xx_udc.c
index 47a4993..10b0475 100644
--- a/drivers/usb/gadget/bcm63xx_udc.c
+++ b/drivers/usb/gadget/bcm63xx_udc.c
@@ -2367,13 +2367,13 @@ static int bcm63xx_udc_probe(struct platform_device 
*pdev)
 
spin_lock_init(udc-lock);
INIT_WORK(udc-ep0_wq, bcm63xx_ep0_process);
-   dev_set_name(udc-gadget.dev, gadget);
 
udc-gadget.ops = bcm63xx_udc_ops;
udc-gadget.name = dev_name(dev);
udc-gadget.dev.parent = dev;
udc-gadget.dev.release = bcm63xx_udc_gadget_release;
udc-gadget.dev.dma_mask = dev-dma_mask;
+   udc-gadget.register_my_device = true;
 
if (!pd-use_fullspeed  !use_fullspeed)
udc-gadget.max_speed = USB_SPEED_HIGH;
@@ -2413,10 +2413,6 @@ static int bcm63xx_udc_probe(struct platform_device 
*pdev)
}
}
 
-   rc = device_register(udc-gadget.dev);
-   if (rc)
-   goto out_uninit;
-
bcm63xx_udc_init_debugfs(udc);
rc = usb_add_gadget_udc(dev, udc-gadget);
if (!rc)
@@ -2439,7 +2435,6 @@ static int bcm63xx_udc_remove(struct platform_device 
*pdev)
 
bcm63xx_udc_cleanup_debugfs(udc);
usb_del_gadget_udc(udc-gadget);
-   device_unregister(udc-gadget.dev);
BUG_ON(udc-driver);
 
platform_set_drvdata(pdev, NULL);
-- 
1.8.1.rc1.5.g7e0651a

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[RFC/PATCH 06/32] usb: gadget: at91_udc: let udc-core manage gadget-dev

2013-01-24 Thread Felipe Balbi
By simply setting a flag, we can remove some
boilerplate code.

Signed-off-by: Felipe Balbi ba...@ti.com
---
 drivers/usb/gadget/at91_udc.c | 13 ++---
 1 file changed, 2 insertions(+), 11 deletions(-)

diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c
index 10f45fa..177b56d 100644
--- a/drivers/usb/gadget/at91_udc.c
+++ b/drivers/usb/gadget/at91_udc.c
@@ -1726,6 +1726,7 @@ static int at91udc_probe(struct platform_device *pdev)
 
/* init software state */
udc = controller;
+   udc-gadget.register_my_device = true;
udc-gadget.dev.parent = dev;
if (pdev-dev.of_node)
at91udc_of_init(udc, pdev-dev.of_node);
@@ -1780,13 +1781,7 @@ static int at91udc_probe(struct platform_device *pdev)
DBG(clocks missing\n);
retval = -ENODEV;
/* NOTE: we know here that refcounts on these are NOPs */
-   goto fail0b;
-   }
-
-   retval = device_register(udc-gadget.dev);
-   if (retval  0) {
-   put_device(udc-gadget.dev);
-   goto fail0b;
+   goto fail1;
}
 
/* don't do anything until we have both gadget driver and VBUS */
@@ -1857,8 +1852,6 @@ fail3:
 fail2:
free_irq(udc-udp_irq, udc);
 fail1:
-   device_unregister(udc-gadget.dev);
-fail0b:
iounmap(udc-udp_baseaddr);
 fail0a:
if (cpu_is_at91rm9200())
@@ -1892,8 +1885,6 @@ static int __exit at91udc_remove(struct platform_device 
*pdev)
gpio_free(udc-board.vbus_pin);
}
free_irq(udc-udp_irq, udc);
-   device_unregister(udc-gadget.dev);
-
iounmap(udc-udp_baseaddr);
 
if (cpu_is_at91rm9200())
-- 
1.8.1.rc1.5.g7e0651a

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[RFC/PATCH 02/32] usb: dwc3: gadget: let udc-core manage gadget-dev

2013-01-24 Thread Felipe Balbi
We don't need to register that device ourselves
if we simply set gadget-register_my_device.

Signed-off-by: Felipe Balbi ba...@ti.com
---
 drivers/usb/dwc3/gadget.c | 17 ++---
 1 file changed, 2 insertions(+), 15 deletions(-)

diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index 2e43b33..7002cf6 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -2412,8 +2412,6 @@ int dwc3_gadget_init(struct dwc3 *dwc)
goto err3;
}
 
-   dev_set_name(dwc-gadget.dev, gadget);
-
dwc-gadget.ops = dwc3_gadget_ops;
dwc-gadget.max_speed   = USB_SPEED_SUPER;
dwc-gadget.speed   = USB_SPEED_UNKNOWN;
@@ -2425,6 +2423,7 @@ int dwc3_gadget_init(struct dwc3 *dwc)
dwc-gadget.dev.dma_parms   = dwc-dev-dma_parms;
dwc-gadget.dev.dma_mask= dwc-dev-dma_mask;
dwc-gadget.dev.release = dwc3_gadget_release;
+   dwc-gadget.register_my_device  = true;
dwc-gadget.name= dwc3-gadget;
 
/*
@@ -2480,24 +2479,14 @@ int dwc3_gadget_init(struct dwc3 *dwc)
dwc3_gadget_usb3_phy_suspend(dwc, false);
}
 
-   ret = device_register(dwc-gadget.dev);
-   if (ret) {
-   dev_err(dwc-dev, failed to register gadget device\n);
-   put_device(dwc-gadget.dev);
-   goto err6;
-   }
-
ret = usb_add_gadget_udc(dwc-dev, dwc-gadget);
if (ret) {
dev_err(dwc-dev, failed to register udc\n);
-   goto err7;
+   goto err6;
}
 
return 0;
 
-err7:
-   device_unregister(dwc-gadget.dev);
-
 err6:
dwc3_writel(dwc-regs, DWC3_DEVTEN, 0x00);
free_irq(irq, dwc);
@@ -2546,6 +2535,4 @@ void dwc3_gadget_exit(struct dwc3 *dwc)
 
dma_free_coherent(dwc-dev, sizeof(*dwc-ctrl_req),
dwc-ctrl_req, dwc-ctrl_req_addr);
-
-   device_unregister(dwc-gadget.dev);
 }
-- 
1.8.1.rc1.5.g7e0651a

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[RFC/PATCH 05/32] usb: gadget: amd5536udc: let udc-core manage gadget-dev

2013-01-24 Thread Felipe Balbi
By simply setting a flag, we drop some boilerplate
code.

Signed-off-by: Felipe Balbi ba...@ti.com
---
 drivers/usb/gadget/amd5536udc.c | 9 +
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/drivers/usb/gadget/amd5536udc.c b/drivers/usb/gadget/amd5536udc.c
index 3dac001..1827d4c 100644
--- a/drivers/usb/gadget/amd5536udc.c
+++ b/drivers/usb/gadget/amd5536udc.c
@@ -3080,7 +3080,6 @@ static void udc_pci_remove(struct pci_dev *pdev)
if (dev-active)
pci_disable_device(pdev);
 
-   device_unregister(dev-gadget.dev);
pci_set_drvdata(pdev, NULL);
 
udc_remove(dev);
@@ -3276,6 +3275,7 @@ static int udc_probe(struct udc *dev)
dev-gadget.dev.release = gadget_release;
dev-gadget.name = name;
dev-gadget.max_speed = USB_SPEED_HIGH;
+   dev-gadget.register_my_device = true;
 
/* init registers, interrupts, ... */
startup_registers(dev);
@@ -3301,13 +3301,6 @@ static int udc_probe(struct udc *dev)
if (retval)
goto finished;
 
-   retval = device_register(dev-gadget.dev);
-   if (retval) {
-   usb_del_gadget_udc(dev-gadget);
-   put_device(dev-gadget.dev);
-   goto finished;
-   }
-
/* timer init */
init_timer(udc_timer);
udc_timer.function = udc_timer_function;
-- 
1.8.1.rc1.5.g7e0651a

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[RFC/PATCH 00/32] usb: refactor gadget-dev registration

2013-01-24 Thread Felipe Balbi
Hi folks,

Please comment on this series as I need help testing it
on all UDC controllers so we can send it for v3.10 merge
window.

NOTE: I will queue this series for v3.10 merge window, so
make sure to test and comment.

cheers

Felipe Balbi (32):
  usb: gadget: udc-core: allow udc class register gadget device
  usb: dwc3: gadget: let udc-core manage gadget-dev
  usb: musb: gadget: let udc-core manage gadget-dev
  usb: gadget: omap_udc: let udc-core manage gadget-dev
  usb: gadget: amd5536udc: let udc-core manage gadget-dev
  usb: gadget: at91_udc: let udc-core manage gadget-dev
  usb: gadget: atmel_usba_udc: let udc-core manage gadget-dev
  usb: gadget: bcm63xx_udc: let udc-core manage gadget-dev
  usb: gadget: dummy_hcd: let udc-core manage gadget-dev
  usb: gadget: fsl_qe_udc: let udc-core manage gadget-dev
  usb: gadget: fsl_udc_core: let udc-core manage gadget-dev
  usb: gadget: fusb300_udc: let udc-core manage gadget-dev
  usb: gadget: goku_udc: let udc-core manage gadget-dev
  usb: gadget: imx_udc: let udc-core manage gadget-dev
  usb: gadget: lpc32xx_udc: let udc-core manage gadget-dev
  usb: gadget: m66592-udc: let udc-core manage gadget-dev
  usb: gadget: mv_u3d_core: let udc-core manage gadget-dev
  usb: gadget: mv_u3d_core: fix a compile warning
  usb: gadget: mv_udc_core: let udc-core manage gadget-dev
  usb: gadget: net2272: let udc-core manage gadget-dev
  usb: gadget: net2280: let udc-core manage gadget-dev
  usb: gadget: pch_udc: let udc-core manage gadget-dev
  usb: gadget: r8a66597-udc: let udc-core manage gadget-dev
  usb: gadget: s3c-hsotg: let udc-core manage gadget-dev
  usb: gadget: s3c-hsudc: let udc-core manage gadget-dev
  usb: gadget: s3c2410_udc: let udc-core manage gadget-dev
  usb: renesas_usbhs: gadget: let udc-core manage gadget-dev
  usb: gadget: pxa25x_udc: let udc-core manage gadget-dev
  usb: gadget: pxa27x_udc: let udc-core manage gadget-dev
  usb: chipidea: register debugging syfs on our device
  usb: chipidea: let udc-core manage gadget-dev
  usb: gadget: drop now unnecessary flag

 drivers/usb/chipidea/udc.c | 18 --
 drivers/usb/dwc3/gadget.c  | 16 +---
 drivers/usb/gadget/amd5536udc.c|  8 
 drivers/usb/gadget/at91_udc.c  | 12 +---
 drivers/usb/gadget/atmel_usba_udc.c| 12 
 drivers/usb/gadget/bcm63xx_udc.c   |  6 --
 drivers/usb/gadget/dummy_hcd.c |  9 -
 drivers/usb/gadget/fsl_qe_udc.c| 14 +-
 drivers/usb/gadget/fsl_udc_core.c  |  8 +---
 drivers/usb/gadget/fusb300_udc.c   | 13 -
 drivers/usb/gadget/goku_udc.c  |  9 -
 drivers/usb/gadget/goku_udc.h  |  3 +--
 drivers/usb/gadget/imx_udc.c   | 12 
 drivers/usb/gadget/lpc32xx_udc.c   | 10 --
 drivers/usb/gadget/m66592-udc.c| 12 
 drivers/usb/gadget/mv_u3d_core.c   | 11 +--
 drivers/usb/gadget/mv_udc_core.c   | 11 +--
 drivers/usb/gadget/net2272.c   |  9 +
 drivers/usb/gadget/net2280.c   |  4 
 drivers/usb/gadget/omap_udc.c  | 11 +++
 drivers/usb/gadget/pch_udc.c   |  9 -
 drivers/usb/gadget/pxa25x_udc.c|  9 -
 drivers/usb/gadget/pxa27x_udc.c|  8 
 drivers/usb/gadget/r8a66597-udc.c  | 11 +--
 drivers/usb/gadget/s3c-hsotg.c | 13 -
 drivers/usb/gadget/s3c-hsudc.c | 10 --
 drivers/usb/gadget/s3c2410_udc.c   |  9 -
 drivers/usb/gadget/udc-core.c  | 20 
 drivers/usb/musb/musb_gadget.c |  9 -
 drivers/usb/renesas_usbhs/mod_gadget.c | 10 +-
 30 files changed, 33 insertions(+), 283 deletions(-)

-- 
1.8.1.rc1.5.g7e0651a

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[RFC/PATCH 09/32] usb: gadget: dummy_hcd: let udc-core manage gadget-dev

2013-01-24 Thread Felipe Balbi
By simply setting a flag, we can drop some
boilerplate code.

Signed-off-by: Felipe Balbi ba...@ti.com
---
 drivers/usb/gadget/dummy_hcd.c | 10 +-
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/drivers/usb/gadget/dummy_hcd.c b/drivers/usb/gadget/dummy_hcd.c
index 95d584d..8155d4a 100644
--- a/drivers/usb/gadget/dummy_hcd.c
+++ b/drivers/usb/gadget/dummy_hcd.c
@@ -982,16 +982,10 @@ static int dummy_udc_probe(struct platform_device *pdev)
dum-gadget.name = gadget_name;
dum-gadget.ops = dummy_ops;
dum-gadget.max_speed = USB_SPEED_SUPER;
+   dum-gadget.register_my_device = true;
 
-   dev_set_name(dum-gadget.dev, gadget);
dum-gadget.dev.parent = pdev-dev;
dum-gadget.dev.release = dummy_gadget_release;
-   rc = device_register(dum-gadget.dev);
-   if (rc  0) {
-   put_device(dum-gadget.dev);
-   return rc;
-   }
-
init_dummy_udc_hw(dum);
 
rc = usb_add_gadget_udc(pdev-dev, dum-gadget);
@@ -1007,7 +1001,6 @@ static int dummy_udc_probe(struct platform_device *pdev)
 err_dev:
usb_del_gadget_udc(dum-gadget);
 err_udc:
-   device_unregister(dum-gadget.dev);
return rc;
 }
 
@@ -1018,7 +1011,6 @@ static int dummy_udc_remove(struct platform_device *pdev)
usb_del_gadget_udc(dum-gadget);
platform_set_drvdata(pdev, NULL);
device_remove_file(dum-gadget.dev, dev_attr_function);
-   device_unregister(dum-gadget.dev);
return 0;
 }
 
-- 
1.8.1.rc1.5.g7e0651a

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[RFC/PATCH 11/32] usb: gadget: fsl_udc_core: let udc-core manage gadget-dev

2013-01-24 Thread Felipe Balbi
By simply setting a flag, we can drop some
boilerplate code.

Signed-off-by: Felipe Balbi ba...@ti.com
---
 drivers/usb/gadget/fsl_udc_core.c | 9 ++---
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/usb/gadget/fsl_udc_core.c 
b/drivers/usb/gadget/fsl_udc_core.c
index 49642d4..b78b734 100644
--- a/drivers/usb/gadget/fsl_udc_core.c
+++ b/drivers/usb/gadget/fsl_udc_core.c
@@ -2526,9 +2526,7 @@ static int __init fsl_udc_probe(struct platform_device 
*pdev)
udc_controller-gadget.dev.release = fsl_udc_release;
udc_controller-gadget.dev.parent = pdev-dev;
udc_controller-gadget.dev.of_node = pdev-dev.of_node;
-   ret = device_register(udc_controller-gadget.dev);
-   if (ret  0)
-   goto err_free_irq;
+   udc_controller-gadget.register_my_device = true;
 
if (!IS_ERR_OR_NULL(udc_controller-transceiver))
udc_controller-gadget.is_otg = 1;
@@ -2561,7 +2559,7 @@ static int __init fsl_udc_probe(struct platform_device 
*pdev)
DTD_ALIGNMENT, UDC_DMA_BOUNDARY);
if (udc_controller-td_pool == NULL) {
ret = -ENOMEM;
-   goto err_unregister;
+   goto err_free_irq;
}
 
ret = usb_add_gadget_udc(pdev-dev, udc_controller-gadget);
@@ -2573,8 +2571,6 @@ static int __init fsl_udc_probe(struct platform_device 
*pdev)
 
 err_del_udc:
dma_pool_destroy(udc_controller-td_pool);
-err_unregister:
-   device_unregister(udc_controller-gadget.dev);
 err_free_irq:
free_irq(udc_controller-irq, udc_controller);
 err_iounmap:
@@ -2624,7 +2620,6 @@ static int __exit fsl_udc_remove(struct platform_device 
*pdev)
if (pdata-operating_mode == FSL_USB2_DR_DEVICE)
release_mem_region(res-start, resource_size(res));
 
-   device_unregister(udc_controller-gadget.dev);
/* free udc --wait for the release() finished */
wait_for_completion(done);
 
-- 
1.8.1.rc1.5.g7e0651a

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[RFC/PATCH 07/32] usb: gadget: atmel_usba_udc: let udc-core manage gadget-dev

2013-01-24 Thread Felipe Balbi
By simply setting a flag, we can drop some
boilerplate code.

Signed-off-by: Felipe Balbi ba...@ti.com
---
 drivers/usb/gadget/atmel_usba_udc.c | 13 +
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/drivers/usb/gadget/atmel_usba_udc.c 
b/drivers/usb/gadget/atmel_usba_udc.c
index a7aed84..f0f9423 100644
--- a/drivers/usb/gadget/atmel_usba_udc.c
+++ b/drivers/usb/gadget/atmel_usba_udc.c
@@ -1900,9 +1900,9 @@ static int __init usba_udc_probe(struct platform_device 
*pdev)
dev_info(pdev-dev, FIFO at 0x%08lx mapped at %p\n,
 (unsigned long)fifo-start, udc-fifo);
 
-   device_initialize(udc-gadget.dev);
udc-gadget.dev.parent = pdev-dev;
udc-gadget.dev.dma_mask = pdev-dev.dma_mask;
+   udc-gadget.register_my_device = true;
 
platform_set_drvdata(pdev, udc);
 
@@ -1962,12 +1962,6 @@ static int __init usba_udc_probe(struct platform_device 
*pdev)
}
udc-irq = irq;
 
-   ret = device_add(udc-gadget.dev);
-   if (ret) {
-   dev_dbg(pdev-dev, Could not add gadget: %d\n, ret);
-   goto err_device_add;
-   }
-
if (gpio_is_valid(pdata-vbus_pin)) {
if (!gpio_request(pdata-vbus_pin, atmel_usba_udc)) {
udc-vbus_pin = pdata-vbus_pin;
@@ -2007,9 +2001,6 @@ err_add_udc:
gpio_free(udc-vbus_pin);
}
 
-   device_unregister(udc-gadget.dev);
-
-err_device_add:
free_irq(irq, udc);
 err_request_irq:
kfree(usba_ep);
@@ -2053,8 +2044,6 @@ static int __exit usba_udc_remove(struct platform_device 
*pdev)
clk_put(udc-hclk);
clk_put(udc-pclk);
 
-   device_unregister(udc-gadget.dev);
-
return 0;
 }
 
-- 
1.8.1.rc1.5.g7e0651a

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[RFC/PATCH 10/32] usb: gadget: fsl_qe_udc: let udc-core manage gadget-dev

2013-01-24 Thread Felipe Balbi
By simply setting a flag, we can drop some
boilerplate code.

Signed-off-by: Felipe Balbi ba...@ti.com
---
 drivers/usb/gadget/fsl_qe_udc.c | 15 ++-
 1 file changed, 2 insertions(+), 13 deletions(-)

diff --git a/drivers/usb/gadget/fsl_qe_udc.c b/drivers/usb/gadget/fsl_qe_udc.c
index ec50f18..08c8432 100644
--- a/drivers/usb/gadget/fsl_qe_udc.c
+++ b/drivers/usb/gadget/fsl_qe_udc.c
@@ -2523,13 +2523,9 @@ static int qe_udc_probe(struct platform_device *ofdev)
 
/* name: Identifies the controller hardware type. */
udc-gadget.name = driver_name;
-
-   device_initialize(udc-gadget.dev);
-
-   dev_set_name(udc-gadget.dev, gadget);
-
udc-gadget.dev.release = qe_udc_release;
udc-gadget.dev.parent = ofdev-dev;
+   udc-gadget.register_my_device = true;
 
/* initialize qe_ep struct */
for (i = 0; i  USB_MAX_ENDPOINTS ; i++) {
@@ -2592,13 +2588,9 @@ static int qe_udc_probe(struct platform_device *ofdev)
goto err5;
}
 
-   ret = device_add(udc-gadget.dev);
-   if (ret)
-   goto err6;
-
ret = usb_add_gadget_udc(ofdev-dev, udc-gadget);
if (ret)
-   goto err7;
+   goto err6;
 
dev_set_drvdata(ofdev-dev, udc);
dev_info(udc-dev,
@@ -2606,8 +2598,6 @@ static int qe_udc_probe(struct platform_device *ofdev)
(udc-soc_type == PORT_QE) ? QE : CPM);
return 0;
 
-err7:
-   device_unregister(udc-gadget.dev);
 err6:
free_irq(udc-usb_irq, udc);
 err5:
@@ -2702,7 +2692,6 @@ static int qe_udc_remove(struct platform_device *ofdev)
 
iounmap(udc-usb_regs);
 
-   device_unregister(udc-gadget.dev);
/* wait for release() of gadget.dev to free udc */
wait_for_completion(done);
 
-- 
1.8.1.rc1.5.g7e0651a

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[RFC/PATCH 12/32] usb: gadget: fusb300_udc: let udc-core manage gadget-dev

2013-01-24 Thread Felipe Balbi
By simply setting a flag, we can drop some
boilerplate code.

Signed-off-by: Felipe Balbi ba...@ti.com
---
 drivers/usb/gadget/fusb300_udc.c | 14 +-
 1 file changed, 1 insertion(+), 13 deletions(-)

diff --git a/drivers/usb/gadget/fusb300_udc.c b/drivers/usb/gadget/fusb300_udc.c
index 8c2372f..798a25b 100644
--- a/drivers/usb/gadget/fusb300_udc.c
+++ b/drivers/usb/gadget/fusb300_udc.c
@@ -1422,15 +1422,12 @@ static int __init fusb300_probe(struct platform_device 
*pdev)
 
fusb300-gadget.ops = fusb300_gadget_ops;
 
-   device_initialize(fusb300-gadget.dev);
-
-   dev_set_name(fusb300-gadget.dev, gadget);
-
fusb300-gadget.max_speed = USB_SPEED_HIGH;
fusb300-gadget.dev.parent = pdev-dev;
fusb300-gadget.dev.dma_mask = pdev-dev.dma_mask;
fusb300-gadget.dev.release = pdev-dev.release;
fusb300-gadget.name = udc_name;
+   fusb300-gadget.register_my_device = true;
fusb300-reg = reg;
 
ret = request_irq(ires-start, fusb300_irq, IRQF_SHARED,
@@ -1478,19 +1475,10 @@ static int __init fusb300_probe(struct platform_device 
*pdev)
if (ret)
goto err_add_udc;
 
-   ret = device_add(fusb300-gadget.dev);
-   if (ret) {
-   pr_err(device_add error (%d)\n, ret);
-   goto err_add_device;
-   }
-
dev_info(pdev-dev, version %s\n, DRIVER_VERSION);
 
return 0;
 
-err_add_device:
-   usb_del_gadget_udc(fusb300-gadget);
-
 err_add_udc:
fusb300_free_request(fusb300-ep[0]-ep, fusb300-ep0_req);
 
-- 
1.8.1.rc1.5.g7e0651a

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[RFC/PATCH 14/32] usb: gadget: imx_udc: let udc-core manage gadget-dev

2013-01-24 Thread Felipe Balbi
By simply setting a flag, we can drop some
boilerplate code.

Signed-off-by: Felipe Balbi ba...@ti.com
---
 drivers/usb/gadget/imx_udc.c | 13 +
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/drivers/usb/gadget/imx_udc.c b/drivers/usb/gadget/imx_udc.c
index a0eb857..c8b5da3 100644
--- a/drivers/usb/gadget/imx_udc.c
+++ b/drivers/usb/gadget/imx_udc.c
@@ -1341,20 +1341,12 @@ static int imx_udc_start(struct usb_gadget *gadget,
imx_usb-driver = driver;
imx_usb-gadget.dev.driver = driver-driver;
 
-   retval = device_add(imx_usb-gadget.dev);
-   if (retval)
-   goto fail;
-
D_INI(imx_usb-dev, %s registered gadget driver '%s'\n,
__func__, driver-driver.name);
 
imx_udc_enable(imx_usb);
 
return 0;
-fail:
-   imx_usb-driver = NULL;
-   imx_usb-gadget.dev.driver = NULL;
-   return retval;
 }
 
 static int imx_udc_stop(struct usb_gadget *gadget,
@@ -1370,8 +1362,6 @@ static int imx_udc_stop(struct usb_gadget *gadget,
imx_usb-gadget.dev.driver = NULL;
imx_usb-driver = NULL;
 
-   device_del(imx_usb-gadget.dev);
-
D_INI(imx_usb-dev, %s unregistered gadget driver '%s'\n,
__func__, driver-driver.name);
 
@@ -1472,8 +1462,7 @@ static int __init imx_udc_probe(struct platform_device 
*pdev)
imx_usb-clk = clk;
imx_usb-dev = pdev-dev;
 
-   device_initialize(imx_usb-gadget.dev);
-
+   imx_usb-gadget.register_my_device = true;
imx_usb-gadget.dev.parent = pdev-dev;
imx_usb-gadget.dev.dma_mask = pdev-dev.dma_mask;
 
-- 
1.8.1.rc1.5.g7e0651a

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[RFC/PATCH 15/32] usb: gadget: lpc32xx_udc: let udc-core manage gadget-dev

2013-01-24 Thread Felipe Balbi
By simply setting a flag, we can drop some
boilerplate code.

Signed-off-by: Felipe Balbi ba...@ti.com
---
 drivers/usb/gadget/lpc32xx_udc.c | 11 +--
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/drivers/usb/gadget/lpc32xx_udc.c b/drivers/usb/gadget/lpc32xx_udc.c
index dd1c9b1..077e021 100644
--- a/drivers/usb/gadget/lpc32xx_udc.c
+++ b/drivers/usb/gadget/lpc32xx_udc.c
@@ -3090,6 +3090,7 @@ static int __init lpc32xx_udc_probe(struct 
platform_device *pdev)
 
/* init software state */
udc-gadget.dev.parent = dev;
+   udc-gadget.register_my_device = true;
udc-pdev = pdev;
udc-dev = pdev-dev;
udc-enabled = 0;
@@ -3248,12 +3249,6 @@ static int __init lpc32xx_udc_probe(struct 
platform_device *pdev)
udc_disable(udc);
udc_reinit(udc);
 
-   retval = device_register(udc-gadget.dev);
-   if (retval  0) {
-   dev_err(udc-dev, Device registration failure\n);
-   goto dev_register_fail;
-   }
-
/* Request IRQs - low and high priority USB device IRQs are routed to
 * the same handler, while the DMA interrupt is routed elsewhere */
retval = request_irq(udc-udp_irq[IRQ_USB_LP], lpc32xx_usb_lp_irq,
@@ -3320,8 +3315,6 @@ irq_dev_fail:
 irq_hp_fail:
free_irq(udc-udp_irq[IRQ_USB_LP], udc);
 irq_lp_fail:
-   device_unregister(udc-gadget.dev);
-dev_register_fail:
dma_pool_destroy(udc-dd_cache);
 dma_alloc_fail:
dma_free_coherent(pdev-dev, UDCA_BUFF_SIZE,
@@ -3376,8 +3369,6 @@ static int lpc32xx_udc_remove(struct platform_device 
*pdev)
free_irq(udc-udp_irq[IRQ_USB_HP], udc);
free_irq(udc-udp_irq[IRQ_USB_LP], udc);
 
-   device_unregister(udc-gadget.dev);
-
clk_disable(udc-usb_otg_clk);
clk_put(udc-usb_otg_clk);
clk_disable(udc-usb_slv_clk);
-- 
1.8.1.rc1.5.g7e0651a

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[RFC/PATCH 13/32] usb: gadget: goku_udc: let udc-core manage gadget-dev

2013-01-24 Thread Felipe Balbi
By simply setting a flag, we can drop some
boilerplate code.

Signed-off-by: Felipe Balbi ba...@ti.com
---
 drivers/usb/gadget/goku_udc.c | 10 +-
 drivers/usb/gadget/goku_udc.h |  3 +--
 2 files changed, 2 insertions(+), 11 deletions(-)

diff --git a/drivers/usb/gadget/goku_udc.c b/drivers/usb/gadget/goku_udc.c
index 85742d4..b4ea2cf 100644
--- a/drivers/usb/gadget/goku_udc.c
+++ b/drivers/usb/gadget/goku_udc.c
@@ -1716,8 +1716,6 @@ static void goku_remove(struct pci_dev *pdev)
pci_resource_len (pdev, 0));
if (dev-enabled)
pci_disable_device(pdev);
-   if (dev-registered)
-   device_unregister(dev-gadget.dev);
 
pci_set_drvdata(pdev, NULL);
dev-regs = NULL;
@@ -1756,11 +1754,11 @@ static int goku_probe(struct pci_dev *pdev, const 
struct pci_device_id *id)
dev-gadget.max_speed = USB_SPEED_FULL;
 
/* the gadget abstracts/virtualizes the controller */
-   dev_set_name(dev-gadget.dev, gadget);
dev-gadget.dev.parent = pdev-dev;
dev-gadget.dev.dma_mask = pdev-dev.dma_mask;
dev-gadget.dev.release = gadget_release;
dev-gadget.name = driver_name;
+   dev-gadget.register_my_device = true;
 
/* now all the pci goodies ... */
retval = pci_enable_device(pdev);
@@ -1810,12 +1808,6 @@ static int goku_probe(struct pci_dev *pdev, const struct 
pci_device_id *id)
create_proc_read_entry(proc_node_name, 0, NULL, udc_proc_read, dev);
 #endif
 
-   retval = device_register(dev-gadget.dev);
-   if (retval) {
-   put_device(dev-gadget.dev);
-   goto err;
-   }
-   dev-registered = 1;
retval = usb_add_gadget_udc(pdev-dev, dev-gadget);
if (retval)
goto err;
diff --git a/drivers/usb/gadget/goku_udc.h b/drivers/usb/gadget/goku_udc.h
index b4470d2..86d2ada 100644
--- a/drivers/usb/gadget/goku_udc.h
+++ b/drivers/usb/gadget/goku_udc.h
@@ -250,8 +250,7 @@ struct goku_udc {
got_region:1,
req_config:1,
configured:1,
-   enabled:1,
-   registered:1;
+   enabled:1;
 
/* pci state used to access those endpoints */
struct pci_dev  *pdev;
-- 
1.8.1.rc1.5.g7e0651a

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[RFC/PATCH 18/32] usb: gadget: mv_u3d_core: fix a compile warning

2013-01-24 Thread Felipe Balbi
Fix the following compile warning:

mv_u3d_core.c:1766:12: warning: 'mv_u3d_remove' \
defined but not used [-Wunused-function]

Signed-off-by: Felipe Balbi ba...@ti.com
---
 drivers/usb/gadget/mv_u3d_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/mv_u3d_core.c b/drivers/usb/gadget/mv_u3d_core.c
index 565addc..734ade1 100644
--- a/drivers/usb/gadget/mv_u3d_core.c
+++ b/drivers/usb/gadget/mv_u3d_core.c
@@ -2072,7 +2072,7 @@ static void mv_u3d_shutdown(struct platform_device *dev)
 
 static struct platform_driver mv_u3d_driver = {
.probe  = mv_u3d_probe,
-   .remove = __exit_p(mv_u3d_remove),
+   .remove = mv_u3d_remove,
.shutdown   = mv_u3d_shutdown,
.driver = {
.owner  = THIS_MODULE,
-- 
1.8.1.rc1.5.g7e0651a

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[RFC/PATCH 16/32] usb: gadget: m66592-udc: let udc-core manage gadget-dev

2013-01-24 Thread Felipe Balbi
By simply setting a flag, we can drop some
boilerplate code.

Signed-off-by: Felipe Balbi ba...@ti.com
---
 drivers/usb/gadget/m66592-udc.c | 13 +
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/drivers/usb/gadget/m66592-udc.c b/drivers/usb/gadget/m66592-udc.c
index 0a35db1..c5d1b39 100644
--- a/drivers/usb/gadget/m66592-udc.c
+++ b/drivers/usb/gadget/m66592-udc.c
@@ -1538,7 +1538,6 @@ static int __exit m66592_remove(struct platform_device 
*pdev)
struct m66592   *m66592 = dev_get_drvdata(pdev-dev);
 
usb_del_gadget_udc(m66592-gadget);
-   device_del(m66592-gadget.dev);
 
del_timer_sync(m66592-timer);
iounmap(m66592-reg);
@@ -1608,13 +1607,12 @@ static int __init m66592_probe(struct platform_device 
*pdev)
dev_set_drvdata(pdev-dev, m66592);
 
m66592-gadget.ops = m66592_gadget_ops;
-   device_initialize(m66592-gadget.dev);
-   dev_set_name(m66592-gadget.dev, gadget);
m66592-gadget.max_speed = USB_SPEED_HIGH;
m66592-gadget.dev.parent = pdev-dev;
m66592-gadget.dev.dma_mask = pdev-dev.dma_mask;
m66592-gadget.dev.release = pdev-dev.release;
m66592-gadget.name = udc_name;
+   m66592-gadget.register_my_device = true;
 
init_timer(m66592-timer);
m66592-timer.function = m66592_timer;
@@ -1674,12 +1672,6 @@ static int __init m66592_probe(struct platform_device 
*pdev)
 
init_controller(m66592);
 
-   ret = device_add(m66592-gadget.dev);
-   if (ret) {
-   pr_err(device_add error (%d)\n, ret);
-   goto err_device_add;
-   }
-
ret = usb_add_gadget_udc(pdev-dev, m66592-gadget);
if (ret)
goto err_add_udc;
@@ -1688,9 +1680,6 @@ static int __init m66592_probe(struct platform_device 
*pdev)
return 0;
 
 err_add_udc:
-   device_del(m66592-gadget.dev);
-
-err_device_add:
m66592_free_request(m66592-ep[0].ep, m66592-ep0_req);
 
 clean_up3:
-- 
1.8.1.rc1.5.g7e0651a

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[RFC/PATCH 17/32] usb: gadget: mv_u3d_core: let udc-core manage gadget-dev

2013-01-24 Thread Felipe Balbi
By simply setting a flag, we can drop some
boilerplate code.

Signed-off-by: Felipe Balbi ba...@ti.com
---
 drivers/usb/gadget/mv_u3d_core.c | 10 +-
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/drivers/usb/gadget/mv_u3d_core.c b/drivers/usb/gadget/mv_u3d_core.c
index b5cea27..565addc 100644
--- a/drivers/usb/gadget/mv_u3d_core.c
+++ b/drivers/usb/gadget/mv_u3d_core.c
@@ -1792,8 +1792,6 @@ static int mv_u3d_remove(struct platform_device *dev)
 
clk_put(u3d-clk);
 
-   device_unregister(u3d-gadget.dev);
-
platform_set_drvdata(dev, NULL);
 
kfree(u3d);
@@ -1957,15 +1955,11 @@ static int mv_u3d_probe(struct platform_device *dev)
u3d-gadget.speed = USB_SPEED_UNKNOWN;  /* speed */
 
/* the gadget abstracts/virtualizes the controller */
-   dev_set_name(u3d-gadget.dev, gadget);
u3d-gadget.dev.parent = dev-dev;
u3d-gadget.dev.dma_mask = dev-dev.dma_mask;
u3d-gadget.dev.release = mv_u3d_gadget_release;
u3d-gadget.name = driver_name; /* gadget name */
-
-   retval = device_register(u3d-gadget.dev);
-   if (retval)
-   goto err_register_gadget_device;
+   u3d-gadget.register_my_device = true;
 
mv_u3d_eps_init(u3d);
 
@@ -1991,8 +1985,6 @@ static int mv_u3d_probe(struct platform_device *dev)
return 0;
 
 err_unregister:
-   device_unregister(u3d-gadget.dev);
-err_register_gadget_device:
free_irq(u3d-irq, dev-dev);
 err_request_irq:
 err_get_irq:
-- 
1.8.1.rc1.5.g7e0651a

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[RFC/PATCH 19/32] usb: gadget: mv_udc_core: let udc-core manage gadget-dev

2013-01-24 Thread Felipe Balbi
By simply setting a flag, we can drop some
boilerplate code.

Signed-off-by: Felipe Balbi ba...@ti.com
---
 drivers/usb/gadget/mv_udc_core.c | 12 ++--
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/drivers/usb/gadget/mv_udc_core.c b/drivers/usb/gadget/mv_udc_core.c
index 67d72f9..60741af 100644
--- a/drivers/usb/gadget/mv_udc_core.c
+++ b/drivers/usb/gadget/mv_udc_core.c
@@ -2138,8 +2138,6 @@ static int mv_udc_remove(struct platform_device *pdev)
 
mv_udc_disable(udc);
 
-   device_unregister(udc-gadget.dev);
-
/* free dev, wait for the release() finished */
wait_for_completion(udc-done);
 
@@ -2311,15 +2309,11 @@ static int mv_udc_probe(struct platform_device *pdev)
udc-gadget.max_speed = USB_SPEED_HIGH; /* support dual speed */
 
/* the gadget abstracts/virtualizes the controller */
-   dev_set_name(udc-gadget.dev, gadget);
udc-gadget.dev.parent = pdev-dev;
udc-gadget.dev.dma_mask = pdev-dev.dma_mask;
udc-gadget.dev.release = gadget_release;
udc-gadget.name = driver_name; /* gadget name */
-
-   retval = device_register(udc-gadget.dev);
-   if (retval)
-   goto err_destroy_dma;
+   udc-gadget.register_my_device = true;
 
eps_init(udc);
 
@@ -2342,7 +2336,7 @@ static int mv_udc_probe(struct platform_device *pdev)
if (!udc-qwork) {
dev_err(pdev-dev, cannot create workqueue\n);
retval = -ENOMEM;
-   goto err_unregister;
+   goto err_destroy_dma;
}
 
INIT_WORK(udc-vbus_work, mv_udc_vbus_work);
@@ -2370,8 +2364,6 @@ static int mv_udc_probe(struct platform_device *pdev)
 
 err_create_workqueue:
destroy_workqueue(udc-qwork);
-err_unregister:
-   device_unregister(udc-gadget.dev);
 err_destroy_dma:
dma_pool_destroy(udc-dtd_pool);
 err_free_dma:
-- 
1.8.1.rc1.5.g7e0651a

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[RFC/PATCH 21/32] usb: gadget: net2280: let udc-core manage gadget-dev

2013-01-24 Thread Felipe Balbi
By simply setting a flag, we can drop some
boilerplate code.

Signed-off-by: Felipe Balbi ba...@ti.com
---
 drivers/usb/gadget/net2280.c | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/usb/gadget/net2280.c b/drivers/usb/gadget/net2280.c
index 708c0b5..630f715 100644
--- a/drivers/usb/gadget/net2280.c
+++ b/drivers/usb/gadget/net2280.c
@@ -2667,7 +2667,6 @@ static void net2280_remove (struct pci_dev *pdev)
pci_resource_len (pdev, 0));
if (dev-enabled)
pci_disable_device (pdev);
-   device_unregister (dev-gadget.dev);
device_remove_file (pdev-dev, dev_attr_registers);
pci_set_drvdata (pdev, NULL);
 
@@ -2699,11 +2698,11 @@ static int net2280_probe (struct pci_dev *pdev, const 
struct pci_device_id *id)
dev-gadget.max_speed = USB_SPEED_HIGH;
 
/* the gadget abstracts/virtualizes the controller */
-   dev_set_name(dev-gadget.dev, gadget);
dev-gadget.dev.parent = pdev-dev;
dev-gadget.dev.dma_mask = pdev-dev.dma_mask;
dev-gadget.dev.release = gadget_release;
dev-gadget.name = driver_name;
+   dev-gadget.register_my_device = true;
 
/* now all the pci goodies ... */
if (pci_enable_device (pdev)  0) {
@@ -2811,8 +2810,6 @@ static int net2280_probe (struct pci_dev *pdev, const 
struct pci_device_id *id)
use_dma
? (use_dma_chaining ? chaining : enabled)
: disabled);
-   retval = device_register (dev-gadget.dev);
-   if (retval) goto done;
retval = device_create_file (pdev-dev, dev_attr_registers);
if (retval) goto done;
 
-- 
1.8.1.rc1.5.g7e0651a

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[RFC/PATCH 22/32] usb: gadget: pch_udc: let udc-core manage gadget-dev

2013-01-24 Thread Felipe Balbi
By simply setting a flag, we can drop some
boilerplate code.

Signed-off-by: Felipe Balbi ba...@ti.com
---
 drivers/usb/gadget/pch_udc.c | 10 +-
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/drivers/usb/gadget/pch_udc.c b/drivers/usb/gadget/pch_udc.c
index a787a8e..7032145 100644
--- a/drivers/usb/gadget/pch_udc.c
+++ b/drivers/usb/gadget/pch_udc.c
@@ -358,7 +358,6 @@ struct pch_udc_dev {
prot_stall:1,
irq_registered:1,
mem_region:1,
-   registered:1,
suspended:1,
connected:1,
vbus_session:1,
@@ -3078,8 +3077,6 @@ static void pch_udc_remove(struct pci_dev *pdev)
   pci_resource_len(pdev, PCH_UDC_PCI_BAR));
if (dev-active)
pci_disable_device(pdev);
-   if (dev-registered)
-   device_unregister(dev-gadget.dev);
kfree(dev);
pci_set_drvdata(pdev, NULL);
 }
@@ -3196,17 +3193,12 @@ static int pch_udc_probe(struct pci_dev *pdev,
if (retval)
goto finished;
 
-   dev_set_name(dev-gadget.dev, gadget);
dev-gadget.dev.parent = pdev-dev;
dev-gadget.dev.dma_mask = pdev-dev.dma_mask;
dev-gadget.dev.release = gadget_release;
dev-gadget.name = KBUILD_MODNAME;
dev-gadget.max_speed = USB_SPEED_HIGH;
-
-   retval = device_register(dev-gadget.dev);
-   if (retval)
-   goto finished;
-   dev-registered = 1;
+   dev-gadget.register_my_device = true;
 
/* Put the device in disconnected state till a driver is bound */
pch_udc_set_disconnect(dev);
-- 
1.8.1.rc1.5.g7e0651a

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[RFC/PATCH 23/32] usb: gadget: r8a66597-udc: let udc-core manage gadget-dev

2013-01-24 Thread Felipe Balbi
By simply setting a flag, we can drop some
boilerplate code.

Signed-off-by: Felipe Balbi ba...@ti.com
---
 drivers/usb/gadget/r8a66597-udc.c | 12 ++--
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/drivers/usb/gadget/r8a66597-udc.c 
b/drivers/usb/gadget/r8a66597-udc.c
index 5a80751..40ef4bd 100644
--- a/drivers/usb/gadget/r8a66597-udc.c
+++ b/drivers/usb/gadget/r8a66597-udc.c
@@ -1837,7 +1837,6 @@ static int __exit r8a66597_remove(struct platform_device 
*pdev)
clk_put(r8a66597-clk);
}
 
-   device_unregister(r8a66597-gadget.dev);
kfree(r8a66597);
return 0;
 }
@@ -1915,17 +1914,12 @@ static int __init r8a66597_probe(struct platform_device 
*pdev)
r8a66597-irq_sense_low = irq_trigger == IRQF_TRIGGER_LOW;
 
r8a66597-gadget.ops = r8a66597_gadget_ops;
-   dev_set_name(r8a66597-gadget.dev, gadget);
r8a66597-gadget.max_speed = USB_SPEED_HIGH;
r8a66597-gadget.dev.parent = pdev-dev;
r8a66597-gadget.dev.dma_mask = pdev-dev.dma_mask;
r8a66597-gadget.dev.release = pdev-dev.release;
r8a66597-gadget.name = udc_name;
-   ret = device_register(r8a66597-gadget.dev);
-   if (ret  0) {
-   dev_err(pdev-dev, device_register failed\n);
-   goto clean_up;
-   }
+   r8a66597-gadget.register_my_device = true;
 
init_timer(r8a66597-timer);
r8a66597-timer.function = r8a66597_timer;
@@ -1939,7 +1933,7 @@ static int __init r8a66597_probe(struct platform_device 
*pdev)
dev_err(pdev-dev, cannot get clock \%s\\n,
clk_name);
ret = PTR_ERR(r8a66597-clk);
-   goto clean_up_dev;
+   goto clean_up;
}
clk_enable(r8a66597-clk);
}
@@ -2007,8 +2001,6 @@ clean_up2:
clk_disable(r8a66597-clk);
clk_put(r8a66597-clk);
}
-clean_up_dev:
-   device_unregister(r8a66597-gadget.dev);
 clean_up:
if (r8a66597) {
if (r8a66597-sudmac_reg)
-- 
1.8.1.rc1.5.g7e0651a

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[RFC/PATCH 20/32] usb: gadget: net2272: let udc-core manage gadget-dev

2013-01-24 Thread Felipe Balbi
By simply setting a flag, we can drop some
boilerplate code.

Signed-off-by: Felipe Balbi ba...@ti.com
---
 drivers/usb/gadget/net2272.c | 10 ++
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/usb/gadget/net2272.c b/drivers/usb/gadget/net2272.c
index d226058..635248f 100644
--- a/drivers/usb/gadget/net2272.c
+++ b/drivers/usb/gadget/net2272.c
@@ -2209,7 +2209,6 @@ net2272_remove(struct net2272 *dev)
free_irq(dev-irq, dev);
iounmap(dev-base_addr);
 
-   device_unregister(dev-gadget.dev);
device_remove_file(dev-dev, dev_attr_registers);
 
dev_info(dev-dev, unbind\n);
@@ -2236,11 +2235,11 @@ static struct net2272 *net2272_probe_init(struct device 
*dev, unsigned int irq)
ret-gadget.max_speed = USB_SPEED_HIGH;
 
/* the gadget abstracts/virtualizes the controller */
-   dev_set_name(ret-gadget.dev, gadget);
ret-gadget.dev.parent = dev;
ret-gadget.dev.dma_mask = dev-dma_mask;
ret-gadget.dev.release = net2272_gadget_release;
ret-gadget.name = driver_name;
+   ret-gadget.register_my_device = true;
 
return ret;
 }
@@ -2275,12 +2274,9 @@ net2272_probe_fin(struct net2272 *dev, unsigned int 
irqflags)
dma_mode_string());
dev_info(dev-dev, version: %s\n, driver_vers);
 
-   ret = device_register(dev-gadget.dev);
-   if (ret)
-   goto err_irq;
ret = device_create_file(dev-dev, dev_attr_registers);
if (ret)
-   goto err_dev_reg;
+   goto err_irq;
 
ret = usb_add_gadget_udc(dev-dev, dev-gadget);
if (ret)
@@ -2290,8 +2286,6 @@ net2272_probe_fin(struct net2272 *dev, unsigned int 
irqflags)
 
 err_add_udc:
device_remove_file(dev-dev, dev_attr_registers);
- err_dev_reg:
-   device_unregister(dev-gadget.dev);
  err_irq:
free_irq(dev-irq, dev);
  err:
-- 
1.8.1.rc1.5.g7e0651a

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[RFC/PATCH 26/32] usb: gadget: s3c2410_udc: let udc-core manage gadget-dev

2013-01-24 Thread Felipe Balbi
By simply setting a flag, we can drop some
boilerplate code.

Signed-off-by: Felipe Balbi ba...@ti.com
---
 drivers/usb/gadget/s3c2410_udc.c | 10 +-
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/drivers/usb/gadget/s3c2410_udc.c b/drivers/usb/gadget/s3c2410_udc.c
index fc07b43..302e137 100644
--- a/drivers/usb/gadget/s3c2410_udc.c
+++ b/drivers/usb/gadget/s3c2410_udc.c
@@ -1677,13 +1677,6 @@ static int s3c2410_udc_start(struct usb_gadget *g,
udc-driver = driver;
udc-gadget.dev.driver = driver-driver;
 
-   /* Bind the driver */
-   retval = device_add(udc-gadget.dev);
-   if (retval) {
-   dev_err(udc-gadget.dev, Error in device_add() : %d\n, 
retval);
-   goto register_error;
-   }
-
/* Enable udc */
s3c2410_udc_enable(udc);
 
@@ -1700,7 +1693,6 @@ static int s3c2410_udc_stop(struct usb_gadget *g,
 {
struct s3c2410_udc *udc = to_s3c2410(g);
 
-   device_del(udc-gadget.dev);
udc-driver = NULL;
 
/* Disable udc */
@@ -1838,9 +1830,9 @@ static int s3c2410_udc_probe(struct platform_device *pdev)
goto err_mem;
}
 
-   device_initialize(udc-gadget.dev);
udc-gadget.dev.parent = pdev-dev;
udc-gadget.dev.dma_mask = pdev-dev.dma_mask;
+   udc-gadget.register_my_device = true;
 
the_controller = udc;
platform_set_drvdata(pdev, udc);
-- 
1.8.1.rc1.5.g7e0651a

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[RFC/PATCH 25/32] usb: gadget: s3c-hsudc: let udc-core manage gadget-dev

2013-01-24 Thread Felipe Balbi
By simply setting a flag, we can drop some
boilerplate code.

Signed-off-by: Felipe Balbi ba...@ti.com
---
 drivers/usb/gadget/s3c-hsudc.c | 11 +--
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/drivers/usb/gadget/s3c-hsudc.c b/drivers/usb/gadget/s3c-hsudc.c
index 4a3d620..dee6810 100644
--- a/drivers/usb/gadget/s3c-hsudc.c
+++ b/drivers/usb/gadget/s3c-hsudc.c
@@ -1304,18 +1304,16 @@ static int s3c_hsudc_probe(struct platform_device *pdev)
 
spin_lock_init(hsudc-lock);
 
-   dev_set_name(hsudc-gadget.dev, gadget);
-
hsudc-gadget.max_speed = USB_SPEED_HIGH;
hsudc-gadget.ops = s3c_hsudc_gadget_ops;
hsudc-gadget.name = dev_name(dev);
hsudc-gadget.dev.parent = dev;
hsudc-gadget.dev.dma_mask = dev-dma_mask;
hsudc-gadget.ep0 = hsudc-ep[0].ep;
-
hsudc-gadget.is_otg = 0;
hsudc-gadget.is_a_peripheral = 0;
hsudc-gadget.speed = USB_SPEED_UNKNOWN;
+   hsudc-gadget.register_my_device = true;
 
s3c_hsudc_setup_ep(hsudc);
 
@@ -1346,12 +1344,6 @@ static int s3c_hsudc_probe(struct platform_device *pdev)
disable_irq(hsudc-irq);
local_irq_enable();
 
-   ret = device_register(hsudc-gadget.dev);
-   if (ret) {
-   put_device(hsudc-gadget.dev);
-   goto err_add_device;
-   }
-
ret = usb_add_gadget_udc(pdev-dev, hsudc-gadget);
if (ret)
goto err_add_udc;
@@ -1360,7 +1352,6 @@ static int s3c_hsudc_probe(struct platform_device *pdev)
 
return 0;
 err_add_udc:
-   device_unregister(hsudc-gadget.dev);
 err_add_device:
clk_disable(hsudc-uclk);
 err_res:
-- 
1.8.1.rc1.5.g7e0651a

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[RFC/PATCH 24/32] usb: gadget: s3c-hsotg: let udc-core manage gadget-dev

2013-01-24 Thread Felipe Balbi
By simply setting a flag, we can drop some
boilerplate code.

Signed-off-by: Felipe Balbi ba...@ti.com
---
 drivers/usb/gadget/s3c-hsotg.c | 14 +-
 1 file changed, 1 insertion(+), 13 deletions(-)

diff --git a/drivers/usb/gadget/s3c-hsotg.c b/drivers/usb/gadget/s3c-hsotg.c
index 833d85b..bd8292d 100644
--- a/drivers/usb/gadget/s3c-hsotg.c
+++ b/drivers/usb/gadget/s3c-hsotg.c
@@ -3552,17 +3552,13 @@ static int s3c_hsotg_probe(struct platform_device *pdev)
 
dev_info(dev, regs %p, irq %d\n, hsotg-regs, hsotg-irq);
 
-   device_initialize(hsotg-gadget.dev);
-
-   dev_set_name(hsotg-gadget.dev, gadget);
-
hsotg-gadget.max_speed = USB_SPEED_HIGH;
hsotg-gadget.ops = s3c_hsotg_gadget_ops;
hsotg-gadget.name = dev_name(dev);
-
hsotg-gadget.dev.parent = dev;
hsotg-gadget.dev.dma_mask = dev-dma_mask;
hsotg-gadget.dev.release = s3c_hsotg_release;
+   hsotg-gadget.register_my_device = true;
 
/* reset the system */
 
@@ -3643,12 +3639,6 @@ static int s3c_hsotg_probe(struct platform_device *pdev)
 
s3c_hsotg_phy_disable(hsotg);
 
-   ret = device_add(hsotg-gadget.dev);
-   if (ret) {
-   put_device(hsotg-gadget.dev);
-   goto err_ep_mem;
-   }
-
ret = usb_add_gadget_udc(pdev-dev, hsotg-gadget);
if (ret)
goto err_ep_mem;
@@ -3687,10 +3677,8 @@ static int s3c_hsotg_remove(struct platform_device *pdev)
}
 
s3c_hsotg_phy_disable(hsotg);
-
clk_disable_unprepare(hsotg-clk);
 
-   device_unregister(hsotg-gadget.dev);
return 0;
 }
 
-- 
1.8.1.rc1.5.g7e0651a

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[RFC/PATCH 29/32] usb: gadget: pxa27x_udc: let udc-core manage gadget-dev

2013-01-24 Thread Felipe Balbi
By simply setting a flag, we can drop some
boilerplate code.

Signed-off-by: Felipe Balbi ba...@ti.com
---
 drivers/usb/gadget/pxa27x_udc.c | 9 +
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/drivers/usb/gadget/pxa27x_udc.c b/drivers/usb/gadget/pxa27x_udc.c
index f7d2579..23a3eed 100644
--- a/drivers/usb/gadget/pxa27x_udc.c
+++ b/drivers/usb/gadget/pxa27x_udc.c
@@ -1814,11 +1814,6 @@ static int pxa27x_udc_start(struct usb_gadget *g,
udc-gadget.dev.driver = driver-driver;
dplus_pullup(udc, 1);
 
-   retval = device_add(udc-gadget.dev);
-   if (retval) {
-   dev_err(udc-dev, device_add error %d\n, retval);
-   goto fail;
-   }
if (!IS_ERR_OR_NULL(udc-transceiver)) {
retval = otg_set_peripheral(udc-transceiver-otg,
udc-gadget);
@@ -1876,8 +1871,6 @@ static int pxa27x_udc_stop(struct usb_gadget *g,
 
udc-driver = NULL;
 
-   device_del(udc-gadget.dev);
-
if (!IS_ERR_OR_NULL(udc-transceiver))
return otg_set_peripheral(udc-transceiver-otg, NULL);
return 0;
@@ -2462,9 +2455,9 @@ static int __init pxa_udc_probe(struct platform_device 
*pdev)
goto err_map;
}
 
-   device_initialize(udc-gadget.dev);
udc-gadget.dev.parent = pdev-dev;
udc-gadget.dev.dma_mask = NULL;
+   udc-gadget.register_my_device = true;
udc-vbus_sensed = 0;
 
the_controller = udc;
-- 
1.8.1.rc1.5.g7e0651a

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[RFC/PATCH 27/32] usb: renesas_usbhs: gadget: let udc-core manage gadget-dev

2013-01-24 Thread Felipe Balbi
By simply setting a flag, we can drop some
boilerplate code.

Signed-off-by: Felipe Balbi ba...@ti.com
---
 drivers/usb/renesas_usbhs/mod_gadget.c | 11 ++-
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/drivers/usb/renesas_usbhs/mod_gadget.c 
b/drivers/usb/renesas_usbhs/mod_gadget.c
index dd41f61..b42d81d 100644
--- a/drivers/usb/renesas_usbhs/mod_gadget.c
+++ b/drivers/usb/renesas_usbhs/mod_gadget.c
@@ -981,15 +981,12 @@ int usbhs_mod_gadget_probe(struct usbhs_priv *priv)
/*
 * init gadget
 */
-   dev_set_name(gpriv-gadget.dev, gadget);
gpriv-gadget.dev.parent= dev;
gpriv-gadget.dev.release   = usbhs_mod_gadget_release;
gpriv-gadget.name  = renesas_usbhs_udc;
gpriv-gadget.ops   = usbhsg_gadget_ops;
gpriv-gadget.max_speed = USB_SPEED_HIGH;
-   ret = device_register(gpriv-gadget.dev);
-   if (ret  0)
-   goto err_add_udc;
+   gpriv-gadget.register_my_device = true;
 
INIT_LIST_HEAD(gpriv-gadget.ep_list);
 
@@ -1018,15 +1015,13 @@ int usbhs_mod_gadget_probe(struct usbhs_priv *priv)
 
ret = usb_add_gadget_udc(dev, gpriv-gadget);
if (ret)
-   goto err_register;
+   goto err_add_udc;
 
 
dev_info(dev, gadget probed\n);
 
return 0;
 
-err_register:
-   device_unregister(gpriv-gadget.dev);
 err_add_udc:
kfree(gpriv-uep);
 
@@ -1042,8 +1037,6 @@ void usbhs_mod_gadget_remove(struct usbhs_priv *priv)
 
usb_del_gadget_udc(gpriv-gadget);
 
-   device_unregister(gpriv-gadget.dev);
-
kfree(gpriv-uep);
kfree(gpriv);
 }
-- 
1.8.1.rc1.5.g7e0651a

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[RFC/PATCH 30/32] usb: chipidea: register debugging syfs on our device

2013-01-24 Thread Felipe Balbi
Don't register anything non-generic under
the gadget's device as we don't really *own*
it.

Signed-off-by: Felipe Balbi ba...@ti.com
---
 drivers/usb/chipidea/udc.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c
index 2f45bba..f64fbea 100644
--- a/drivers/usb/chipidea/udc.c
+++ b/drivers/usb/chipidea/udc.c
@@ -1767,7 +1767,7 @@ static int udc_start(struct ci13xxx *ci)
goto put_transceiver;
}
 
-   retval = dbg_create_files(ci-gadget.dev);
+   retval = dbg_create_files(ci-dev);
if (retval)
goto unreg_device;
 
@@ -1796,7 +1796,7 @@ remove_trans:
 
dev_err(dev, error = %i\n, retval);
 remove_dbg:
-   dbg_remove_files(ci-gadget.dev);
+   dbg_remove_files(ci-dev);
 unreg_device:
device_unregister(ci-gadget.dev);
 put_transceiver:
@@ -1836,7 +1836,7 @@ static void udc_stop(struct ci13xxx *ci)
if (ci-global_phy)
usb_put_phy(ci-transceiver);
}
-   dbg_remove_files(ci-gadget.dev);
+   dbg_remove_files(ci-dev);
device_unregister(ci-gadget.dev);
/* my kobject is dynamic, I swear! */
memset(ci-gadget, 0, sizeof(ci-gadget));
-- 
1.8.1.rc1.5.g7e0651a

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[RFC/PATCH 31/32] usb: chipidea: let udc-core manage gadget-dev

2013-01-24 Thread Felipe Balbi
By simply setting a flag, we can drop some
boilerplate code.

Signed-off-by: Felipe Balbi ba...@ti.com
---
 drivers/usb/chipidea/udc.c | 13 ++---
 1 file changed, 2 insertions(+), 11 deletions(-)

diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c
index f64fbea..e95e8bb 100644
--- a/drivers/usb/chipidea/udc.c
+++ b/drivers/usb/chipidea/udc.c
@@ -1717,11 +1717,11 @@ static int udc_start(struct ci13xxx *ci)
 
INIT_LIST_HEAD(ci-gadget.ep_list);
 
-   dev_set_name(ci-gadget.dev, gadget);
ci-gadget.dev.dma_mask = dev-dma_mask;
ci-gadget.dev.coherent_dma_mask = dev-coherent_dma_mask;
ci-gadget.dev.parent   = dev;
ci-gadget.dev.release  = udc_release;
+   ci-gadget.register_my_device = true;
 
/* alloc resources */
ci-qh_pool = dma_pool_create(ci13xxx_qh, dev,
@@ -1761,15 +1761,9 @@ static int udc_start(struct ci13xxx *ci)
hw_enable_vbus_intr(ci);
}
 
-   retval = device_register(ci-gadget.dev);
-   if (retval) {
-   put_device(ci-gadget.dev);
-   goto put_transceiver;
-   }
-
retval = dbg_create_files(ci-dev);
if (retval)
-   goto unreg_device;
+   goto put_transceiver;
 
if (!IS_ERR_OR_NULL(ci-transceiver)) {
retval = otg_set_peripheral(ci-transceiver-otg,
@@ -1797,8 +1791,6 @@ remove_trans:
dev_err(dev, error = %i\n, retval);
 remove_dbg:
dbg_remove_files(ci-dev);
-unreg_device:
-   device_unregister(ci-gadget.dev);
 put_transceiver:
if (!IS_ERR_OR_NULL(ci-transceiver)  ci-global_phy)
usb_put_phy(ci-transceiver);
@@ -1837,7 +1829,6 @@ static void udc_stop(struct ci13xxx *ci)
usb_put_phy(ci-transceiver);
}
dbg_remove_files(ci-dev);
-   device_unregister(ci-gadget.dev);
/* my kobject is dynamic, I swear! */
memset(ci-gadget, 0, sizeof(ci-gadget));
 }
-- 
1.8.1.rc1.5.g7e0651a

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[RFC/PATCH 28/32] usb: gadget: pxa25x_udc: let udc-core manage gadget-dev

2013-01-24 Thread Felipe Balbi
By simply setting a flag, we can drop some
boilerplate code.

Signed-off-by: Felipe Balbi ba...@ti.com
---
 drivers/usb/gadget/pxa25x_udc.c | 10 +-
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/drivers/usb/gadget/pxa25x_udc.c b/drivers/usb/gadget/pxa25x_udc.c
index fa9c344..9deffd3 100644
--- a/drivers/usb/gadget/pxa25x_udc.c
+++ b/drivers/usb/gadget/pxa25x_udc.c
@@ -1266,13 +1266,6 @@ static int pxa25x_udc_start(struct usb_gadget *g,
dev-gadget.dev.driver = driver-driver;
dev-pullup = 1;
 
-   retval = device_add (dev-gadget.dev);
-   if (retval) {
-   dev-driver = NULL;
-   dev-gadget.dev.driver = NULL;
-   return retval;
-   }
-
/* ... then enable host detection and ep0; and we're ready
 * for set_configuration as well as eventual disconnect.
 */
@@ -1331,7 +1324,6 @@ static int pxa25x_udc_stop(struct usb_gadget*g,
dev-gadget.dev.driver = NULL;
dev-driver = NULL;
 
-   device_del (dev-gadget.dev);
dump_state(dev);
 
return 0;
@@ -2140,9 +2132,9 @@ static int __init pxa25x_udc_probe(struct platform_device 
*pdev)
dev-timer.function = udc_watchdog;
dev-timer.data = (unsigned long) dev;
 
-   device_initialize(dev-gadget.dev);
dev-gadget.dev.parent = pdev-dev;
dev-gadget.dev.dma_mask = pdev-dev.dma_mask;
+   dev-gadget.register_my_device = true;
 
the_controller = dev;
platform_set_drvdata(pdev, dev);
-- 
1.8.1.rc1.5.g7e0651a

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[RFC/PATCH 32/32] usb: gadget: drop now unnecessary flag

2013-01-24 Thread Felipe Balbi
We don't need the -register_my_device flag
anymore because all UDC drivers have been
properly converted.

Let's remove every history of it.

Signed-off-by: Felipe Balbi ba...@ti.com
---
 drivers/usb/chipidea/udc.c | 1 -
 drivers/usb/dwc3/gadget.c  | 1 -
 drivers/usb/gadget/amd5536udc.c| 1 -
 drivers/usb/gadget/at91_udc.c  | 1 -
 drivers/usb/gadget/atmel_usba_udc.c| 1 -
 drivers/usb/gadget/bcm63xx_udc.c   | 1 -
 drivers/usb/gadget/dummy_hcd.c | 1 -
 drivers/usb/gadget/fsl_qe_udc.c| 1 -
 drivers/usb/gadget/fsl_udc_core.c  | 1 -
 drivers/usb/gadget/fusb300_udc.c   | 1 -
 drivers/usb/gadget/goku_udc.c  | 1 -
 drivers/usb/gadget/imx_udc.c   | 1 -
 drivers/usb/gadget/lpc32xx_udc.c   | 1 -
 drivers/usb/gadget/m66592-udc.c| 1 -
 drivers/usb/gadget/mv_u3d_core.c   | 1 -
 drivers/usb/gadget/mv_udc_core.c   | 1 -
 drivers/usb/gadget/net2272.c   | 1 -
 drivers/usb/gadget/net2280.c   | 1 -
 drivers/usb/gadget/omap_udc.c  | 1 -
 drivers/usb/gadget/pch_udc.c   | 1 -
 drivers/usb/gadget/pxa25x_udc.c| 1 -
 drivers/usb/gadget/pxa27x_udc.c| 1 -
 drivers/usb/gadget/r8a66597-udc.c  | 1 -
 drivers/usb/gadget/s3c-hsotg.c | 1 -
 drivers/usb/gadget/s3c-hsudc.c | 1 -
 drivers/usb/gadget/s3c2410_udc.c   | 1 -
 drivers/usb/gadget/udc-core.c  | 3 ---
 drivers/usb/musb/musb_gadget.c | 1 -
 drivers/usb/renesas_usbhs/mod_gadget.c | 1 -
 include/linux/usb/gadget.h | 4 
 30 files changed, 35 deletions(-)

diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c
index e95e8bb..1b65ac8 100644
--- a/drivers/usb/chipidea/udc.c
+++ b/drivers/usb/chipidea/udc.c
@@ -1721,7 +1721,6 @@ static int udc_start(struct ci13xxx *ci)
ci-gadget.dev.coherent_dma_mask = dev-coherent_dma_mask;
ci-gadget.dev.parent   = dev;
ci-gadget.dev.release  = udc_release;
-   ci-gadget.register_my_device = true;
 
/* alloc resources */
ci-qh_pool = dma_pool_create(ci13xxx_qh, dev,
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index 7002cf6..067ba6ad 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -2423,7 +2423,6 @@ int dwc3_gadget_init(struct dwc3 *dwc)
dwc-gadget.dev.dma_parms   = dwc-dev-dma_parms;
dwc-gadget.dev.dma_mask= dwc-dev-dma_mask;
dwc-gadget.dev.release = dwc3_gadget_release;
-   dwc-gadget.register_my_device  = true;
dwc-gadget.name= dwc3-gadget;
 
/*
diff --git a/drivers/usb/gadget/amd5536udc.c b/drivers/usb/gadget/amd5536udc.c
index 1827d4c..35ab5d3 100644
--- a/drivers/usb/gadget/amd5536udc.c
+++ b/drivers/usb/gadget/amd5536udc.c
@@ -3275,7 +3275,6 @@ static int udc_probe(struct udc *dev)
dev-gadget.dev.release = gadget_release;
dev-gadget.name = name;
dev-gadget.max_speed = USB_SPEED_HIGH;
-   dev-gadget.register_my_device = true;
 
/* init registers, interrupts, ... */
startup_registers(dev);
diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c
index 177b56d..dc3682c 100644
--- a/drivers/usb/gadget/at91_udc.c
+++ b/drivers/usb/gadget/at91_udc.c
@@ -1726,7 +1726,6 @@ static int at91udc_probe(struct platform_device *pdev)
 
/* init software state */
udc = controller;
-   udc-gadget.register_my_device = true;
udc-gadget.dev.parent = dev;
if (pdev-dev.of_node)
at91udc_of_init(udc, pdev-dev.of_node);
diff --git a/drivers/usb/gadget/atmel_usba_udc.c 
b/drivers/usb/gadget/atmel_usba_udc.c
index f0f9423..b197b75 100644
--- a/drivers/usb/gadget/atmel_usba_udc.c
+++ b/drivers/usb/gadget/atmel_usba_udc.c
@@ -1902,7 +1902,6 @@ static int __init usba_udc_probe(struct platform_device 
*pdev)
 
udc-gadget.dev.parent = pdev-dev;
udc-gadget.dev.dma_mask = pdev-dev.dma_mask;
-   udc-gadget.register_my_device = true;
 
platform_set_drvdata(pdev, udc);
 
diff --git a/drivers/usb/gadget/bcm63xx_udc.c b/drivers/usb/gadget/bcm63xx_udc.c
index 10b0475..96a585ee 100644
--- a/drivers/usb/gadget/bcm63xx_udc.c
+++ b/drivers/usb/gadget/bcm63xx_udc.c
@@ -2373,7 +2373,6 @@ static int bcm63xx_udc_probe(struct platform_device *pdev)
udc-gadget.dev.parent = dev;
udc-gadget.dev.release = bcm63xx_udc_gadget_release;
udc-gadget.dev.dma_mask = dev-dma_mask;
-   udc-gadget.register_my_device = true;
 
if (!pd-use_fullspeed  !use_fullspeed)
udc-gadget.max_speed = USB_SPEED_HIGH;
diff --git a/drivers/usb/gadget/dummy_hcd.c b/drivers/usb/gadget/dummy_hcd.c
index 8155d4a..7fe600f 100644
--- a/drivers/usb/gadget/dummy_hcd.c
+++ b/drivers/usb/gadget/dummy_hcd.c
@@ -982,7 +982,6 @@ static int dummy_udc_probe(struct platform_device *pdev)
dum-gadget.name = gadget_name;
dum-gadget.ops = dummy_ops

Re: [RFC/PATCH 32/32] usb: gadget: drop now unnecessary flag

2013-01-24 Thread Felipe Balbi
On Thu, Jan 24, 2013 at 07:52:52PM +0100, Tomasz Figa wrote:
 Hi Felipe,
 
 On Thursday 24 of January 2013 17:46:10 Felipe Balbi wrote:
  We don't need the -register_my_device flag
  anymore because all UDC drivers have been
  properly converted.
  
  Let's remove every history of it.
  
  Signed-off-by: Felipe Balbi ba...@ti.com
  ---
   drivers/usb/chipidea/udc.c | 1 -
   drivers/usb/dwc3/gadget.c  | 1 -
   drivers/usb/gadget/amd5536udc.c| 1 -
   drivers/usb/gadget/at91_udc.c  | 1 -
   drivers/usb/gadget/atmel_usba_udc.c| 1 -
   drivers/usb/gadget/bcm63xx_udc.c   | 1 -
   drivers/usb/gadget/dummy_hcd.c | 1 -
   drivers/usb/gadget/fsl_qe_udc.c| 1 -
   drivers/usb/gadget/fsl_udc_core.c  | 1 -
   drivers/usb/gadget/fusb300_udc.c   | 1 -
   drivers/usb/gadget/goku_udc.c  | 1 -
   drivers/usb/gadget/imx_udc.c   | 1 -
   drivers/usb/gadget/lpc32xx_udc.c   | 1 -
   drivers/usb/gadget/m66592-udc.c| 1 -
   drivers/usb/gadget/mv_u3d_core.c   | 1 -
   drivers/usb/gadget/mv_udc_core.c   | 1 -
   drivers/usb/gadget/net2272.c   | 1 -
   drivers/usb/gadget/net2280.c   | 1 -
   drivers/usb/gadget/omap_udc.c  | 1 -
   drivers/usb/gadget/pch_udc.c   | 1 -
   drivers/usb/gadget/pxa25x_udc.c| 1 -
   drivers/usb/gadget/pxa27x_udc.c| 1 -
   drivers/usb/gadget/r8a66597-udc.c  | 1 -
   drivers/usb/gadget/s3c-hsotg.c | 1 -
   drivers/usb/gadget/s3c-hsudc.c | 1 -
   drivers/usb/gadget/s3c2410_udc.c   | 1 -
   drivers/usb/gadget/udc-core.c  | 3 ---
   drivers/usb/musb/musb_gadget.c | 1 -
   drivers/usb/renesas_usbhs/mod_gadget.c | 1 -
   include/linux/usb/gadget.h | 4 
   30 files changed, 35 deletions(-)
  
 [snip]
  diff --git a/drivers/usb/gadget/udc-core.c
  b/drivers/usb/gadget/udc-core.c index 9195054..4ee0efc 100644
  --- a/drivers/usb/gadget/udc-core.c
  +++ b/drivers/usb/gadget/udc-core.c
  @@ -173,7 +173,6 @@ int usb_add_gadget_udc(struct device *parent, struct
  usb_gadget *gadget) if (!udc)
  goto err1;
  
  -   if (gadget-register_my_device) {
  dev_set_name(gadget-dev, gadget);
  
  ret = device_register(gadget-dev);
  @@ -211,7 +210,6 @@ err3:
  put_device(udc-dev);
  
   err2:
  -   if (gadget-register_my_device)
  put_device(gadget-dev);
   err1:
  return ret;
  @@ -267,7 +265,6 @@ found:
  kobject_uevent(udc-dev.kobj, KOBJ_REMOVE);
  device_unregister(udc-dev);
  
  -   if (gadget-register_my_device)
  device_unregister(gadget-dev);
 
 Correct me if I am wrong, but doesn't this patch leave us with incorrect 
 indentation?

right, I fixed it up on my branch, see [1]. That was me trusting my poor
sed skills and not verifying the result ;-)

[1] 
http://git.kernel.org/?p=linux/kernel/git/balbi/usb.git;a=commitdiff;h=d0bdf2970dd68677c65671be9bd56759593cfaf1

-- 
balbi


signature.asc
Description: Digital signature
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [RFC PATCH 1/6] usb: otg: Add an API to bind the USB controller and PHY

2013-01-18 Thread Felipe Balbi
On Thu, Jan 17, 2013 at 04:44:52PM +0530, kishon wrote:
 @@ -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
 
 
 Controllers like ehci-omap which don't need OTG functionality would
 benefit from this API. Can we make these PHY APIs not dependent on OTG /
 OTG_UTILS?
 
 Actually much of whatever is in otg.c can be used by controllers
 which don't have OTG functionality (except otg_state_string). I
 vaguely remember, there was a patch that renamed otg.c to phy.c etc..
 I'm not sure what happened to that.

right, that has to be done eventually ;-)

-- 
balbi


signature.asc
Description: Digital signature
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [RFC PATCH 0/6] USB: Add multiple PHYs of same type

2013-01-18 Thread Felipe Balbi
On Wed, Jan 16, 2013 at 08:30:56PM +0530, Kishon Vijay Abraham I wrote:
 New platforms are being added which has multiple PHY's (of same type) and
 which has multiple USB controllers. 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 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.
 
 Did basic enumeration testing in omap4 panda, omap4 sdp and omap3 beagle.

please resend without RFC so I can apply.

-- 
balbi


signature.asc
Description: Digital signature
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH v5 1/3] usb: fsl-mxc-udc: replace cpu_is_xxx() with platform_device_id

2013-01-17 Thread Felipe Balbi
On Wed, Jan 16, 2013 at 09:48:25AM +0800, Peter Chen wrote:
 On Tue, Jan 15, 2013 at 10:03:46PM +0800, Shawn Guo wrote:
  On Tue, Jan 15, 2013 at 10:29:33AM +0800, Peter Chen wrote:
   As mach/hardware.h is deleted, we need to use platform_device_id to
   differentiate SoCs. Besides, one cpu_is_mx35 is useless as it has
   already used pdata to differentiate runtime
   
   Meanwhile we update the platform code accordingly.
   
   Signed-off-by: Peter Chen peter.c...@freescale.com
   ---
arch/arm/mach-imx/devices/devices-common.h|1 +
arch/arm/mach-imx/devices/platform-fsl-usb2-udc.c |   15 ---
drivers/usb/gadget/fsl_mxc_udc.c  |   24 +---
drivers/usb/gadget/fsl_udc_core.c |   42 
   +
4 files changed, 45 insertions(+), 37 deletions(-)
  
  Since we are splitting the original patch anyway, it's a bit strange
  to me that you are mixing arch/arm/mach-imx and drivers/usb/gadget
  in this patch.  I'm fine with it, since I assume all the patches to
  go via USB tree anyway.
  
   
   diff --git a/arch/arm/mach-imx/devices/devices-common.h 
   b/arch/arm/mach-imx/devices/devices-common.h
   index 6277baf..9bd5777 100644
   --- a/arch/arm/mach-imx/devices/devices-common.h
   +++ b/arch/arm/mach-imx/devices/devices-common.h
   @@ -63,6 +63,7 @@ struct platform_device *__init imx_add_flexcan(

#include linux/fsl_devices.h
struct imx_fsl_usb2_udc_data {
   + const char *devid;
 resource_size_t iobase;
 resource_size_t irq;
};
   diff --git a/arch/arm/mach-imx/devices/platform-fsl-usb2-udc.c 
   b/arch/arm/mach-imx/devices/platform-fsl-usb2-udc.c
   index 37e4439..fb527c7 100644
   --- a/arch/arm/mach-imx/devices/platform-fsl-usb2-udc.c
   +++ b/arch/arm/mach-imx/devices/platform-fsl-usb2-udc.c
   @@ -11,35 +11,36 @@
#include ../hardware.h
#include devices-common.h

   -#define imx_fsl_usb2_udc_data_entry_single(soc)  
   \
   +#define imx_fsl_usb2_udc_data_entry_single(soc, _devid)  
   \
 {   \
   + .devid = _devid,\
 .iobase = soc ## _USB_OTG_BASE_ADDR,\
 .irq = soc ## _INT_USB_OTG, \
 }

#ifdef CONFIG_SOC_IMX25
const struct imx_fsl_usb2_udc_data imx25_fsl_usb2_udc_data __initconst =
   - imx_fsl_usb2_udc_data_entry_single(MX25);
   + imx_fsl_usb2_udc_data_entry_single(MX25, imx-udc-mx25);
#endif /* ifdef CONFIG_SOC_IMX25 */

#ifdef CONFIG_SOC_IMX27
const struct imx_fsl_usb2_udc_data imx27_fsl_usb2_udc_data __initconst =
   - imx_fsl_usb2_udc_data_entry_single(MX27);
   + imx_fsl_usb2_udc_data_entry_single(MX27, imx-udc-mx27);
#endif /* ifdef CONFIG_SOC_IMX27 */

#ifdef CONFIG_SOC_IMX31
const struct imx_fsl_usb2_udc_data imx31_fsl_usb2_udc_data __initconst =
   - imx_fsl_usb2_udc_data_entry_single(MX31);
   + imx_fsl_usb2_udc_data_entry_single(MX31, imx-udc-mx31);
#endif /* ifdef CONFIG_SOC_IMX31 */

#ifdef CONFIG_SOC_IMX35
const struct imx_fsl_usb2_udc_data imx35_fsl_usb2_udc_data __initconst =
   - imx_fsl_usb2_udc_data_entry_single(MX35);
   + imx_fsl_usb2_udc_data_entry_single(MX35, imx-udc-mx35);
#endif /* ifdef CONFIG_SOC_IMX35 */

#ifdef CONFIG_SOC_IMX51
const struct imx_fsl_usb2_udc_data imx51_fsl_usb2_udc_data __initconst =
   - imx_fsl_usb2_udc_data_entry_single(MX51);
   + imx_fsl_usb2_udc_data_entry_single(MX51, imx-udc-mx51);
#endif

struct platform_device *__init imx_add_fsl_usb2_udc(
   @@ -57,7 +58,7 @@ struct platform_device *__init imx_add_fsl_usb2_udc(
 .flags = IORESOURCE_IRQ,
 },
 };
   - return imx_add_platform_device_dmamask(fsl-usb2-udc, -1,
   + return imx_add_platform_device_dmamask(data-devid, -1,
 res, ARRAY_SIZE(res),
 pdata, sizeof(*pdata), DMA_BIT_MASK(32));
}
  
  snip
  
   +static const struct platform_device_id fsl_udc_devtype[] = {
   + {
   + .name = imx-udc-mx25,
   + }, {
   + .name = imx-udc-mx27,
   + }, {
   + .name = imx-udc-mx31,
   + }, {
   + .name = imx-udc-mx35,
   + }, {
   + .name = imx-udc-mx51,
   + }
   +};
  
  From what I understand balbi's comment, he dislikes this full list of
  device id.  Instead, he prefers to something like below.
  
  static const struct platform_device_id fsl_udc_devtype[] = {
  {
  .name = imx-udc-mx27,
  }, {
  .name = imx-udc-mx51,
  }
  };
  
  It basically tells that we are handling two type of devices here, one
  is imx-udc-mx27 type and the other is imx-udc-mx51 type, with mx25/31/35
  completely compatible with mx27 type.  We choose mx27 instead of mx25
  to define the type because mx27 Si came out earlier than mx25.  That
  said, we 

Re: [PATCH v5 1/3] usb: fsl-mxc-udc: replace cpu_is_xxx() with platform_device_id

2013-01-17 Thread Felipe Balbi
Hi,

On Thu, Jan 17, 2013 at 05:28:30PM +0800, Peter Chen wrote:

trimming

From what I understand balbi's comment, he dislikes this full list of
device id.  Instead, he prefers to something like below.

static const struct platform_device_id fsl_udc_devtype[] = {
{
.name = imx-udc-mx27,
}, {
.name = imx-udc-mx51,
}
};

It basically tells that we are handling two type of devices here, one
is imx-udc-mx27 type and the other is imx-udc-mx51 type, with mx25/31/35
completely compatible with mx27 type.  We choose mx27 instead of mx25
to define the type because mx27 Si came out earlier than mx25.  That
said, we generally choose the earlies SoC name to define a particular
version of IP block, since hardware version is mostly unavailable or
unreliable.

But that also means in platform code which create the platform_device,
you will need to use name imx-udc-mx27 for even mx25/31/35.

imx_fsl_usb2_udc_data_entry_single(MX25, imx-udc-mx27);
imx_fsl_usb2_udc_data_entry_single(MX31, imx-udc-mx27);
imx_fsl_usb2_udc_data_entry_single(MX35, imx-udc-mx27);

Considering this is a piece of code we will not use for any new
hardware, I'm fine with either way.

So, balbi, it's all your call to accept the series as it is or ask for
another iteration.
  
  right :-)
  
   Thanks Shawn. Let's see Felipe's comment, nevertheless, I will send v6 
   patch
   due to a compile error at mx25
  
  Shawn is right.
 
 In fact, this driver is just the temp solution, we will use chipidea
 in future, so just take all i.mx usb as two kinds of ip are ok.
 
 Do you want me to change like Shawn said, or current version is ok?

yes, please resend with changes.

-- 
balbi


signature.asc
Description: Digital signature
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH v6 3/3] ARM: i.MX clock: Change the connection-id for fsl-usb2-udc

2013-01-17 Thread Felipe Balbi
On Thu, Jan 17, 2013 at 06:03:17PM +0800, Peter Chen wrote:
 As we use platform_device_id for fsl-usb2-udc driver, it needs to
 change clk connection-id, or the related devm_clk_get will be failed.
 
 Signed-off-by: Peter Chen peter.c...@freescale.com

do I get Acked-by for this one ?

-- 
balbi


signature.asc
Description: Digital signature
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH v2 1/1] usb: fsl-mxc-udc: fix build error due to mach/hardware.h

2013-01-14 Thread Felipe Balbi
Hi,

On Mon, Jan 14, 2013 at 04:17:35PM +0800, Peter Chen wrote:
 On Mon, Jan 14, 2013 at 09:48:58AM +0200, Felipe Balbi wrote:
  Hi,
  
  On Mon, Jan 14, 2013 at 03:18:17PM +0800, Peter Chen wrote:
   It changes the driver to use platform_device_id rather than cpu_is_xxx
   to determine the SoC type, and updates the platform code accordingly.
   
   Compile ok at imx_v6_v7_defconfig with CONFIG_USB_FSL_USB2 enable.
   Tested at mx51 bbg board, it works ok after enable phy clock
   (Need another patch to fix this problem)
   
   Signed-off-by: Peter Chen peter.c...@freescale.com
  
  not good for -rc. You have to break this down as you're solving at least
  three different problems with this patch.
 
 Felipe, all my changes are for this problem, these are fix build error and
 let it work.
 
  arch/arm/mach-imx/clk-imx25.c |6 +-
  arch/arm/mach-imx/clk-imx27.c |6 +-
  arch/arm/mach-imx/clk-imx31.c |6 +-
  arch/arm/mach-imx/clk-imx35.c |6 +-
  arch/arm/mach-imx/clk-imx51-imx53.c   |6 +-
 
  As we change the connection-id, we need to change clock file or
  the devm_clk_get will be failed.

right right, that's ok.

  arch/arm/mach-imx/devices/devices-common.h|1 +
  arch/arm/mach-imx/devices/platform-fsl-usb2-udc.c |   15 +++---
 
  We need to differentiate SoCs, so I use platform_device_id to
  instead of cpu_ix_xxx(), this is for machine file change

fair enough.

  drivers/usb/gadget/fsl_mxc_udc.c  |   23 +
  drivers/usb/gadget/fsl_udc_core.c |   52 +---
  drivers/usb/gadget/fsl_usb2_udc.h |   13 --
  include/linux/fsl_devices.h   |8 +++
 
  Need to get platform_device_id at driver, and replace the cpu_is_xxx to
  platform_device_id. Meanwhile, needs a solution for replace
  MX35_IO_ADDRESS.

ok, here we go:

You just listed to me three different fixes and each fix should be on a
separate patch. Meaning that you should have one single patch to convert
MX35_IO_ADDRESS() into ioremap(), another patch should be removing
cpu_is_xxx() and the third one fixing connection-id.

As you might remember, we want patches to be self-contained logical
units and your patch contains 3 of such logical units.

  Besides there are parts which are not related to the build break.
 
 I can split this patch to two patches, one is driver part, the other is
 machine part. It can also fix build break, but it needs two
 patches to let the udc work.

you will need as many patches as necessary, but they need to the broken
correclty, the way you suggested above is wrong.

-- 
balbi


signature.asc
Description: Digital signature
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH v2 1/1] usb: fsl-mxc-udc: fix build error due to mach/hardware.h

2013-01-14 Thread Felipe Balbi
On Mon, Jan 14, 2013 at 05:13:44PM +0800, Peter Chen wrote:
 On Mon, Jan 14, 2013 at 10:50:27AM +0200, Felipe Balbi wrote:
  Hi,
  
  On Mon, Jan 14, 2013 at 04:17:35PM +0800, Peter Chen wrote:
   On Mon, Jan 14, 2013 at 09:48:58AM +0200, Felipe Balbi wrote:
Hi,

On Mon, Jan 14, 2013 at 03:18:17PM +0800, Peter Chen wrote:
 It changes the driver to use platform_device_id rather than cpu_is_xxx
 to determine the SoC type, and updates the platform code accordingly.
 
 Compile ok at imx_v6_v7_defconfig with CONFIG_USB_FSL_USB2 enable.
 Tested at mx51 bbg board, it works ok after enable phy clock
 (Need another patch to fix this problem)
 
 Signed-off-by: Peter Chen peter.c...@freescale.com

not good for -rc. You have to break this down as you're solving at least
three different problems with this patch.
   
   Felipe, all my changes are for this problem, these are fix build error and
   let it work.
   
arch/arm/mach-imx/clk-imx25.c |6 +-
arch/arm/mach-imx/clk-imx27.c |6 +-
arch/arm/mach-imx/clk-imx31.c |6 +-
arch/arm/mach-imx/clk-imx35.c |6 +-
arch/arm/mach-imx/clk-imx51-imx53.c   |6 +-
   
As we change the connection-id, we need to change clock file or
the devm_clk_get will be failed.
  
  right right, that's ok.
  
arch/arm/mach-imx/devices/devices-common.h|1 +
arch/arm/mach-imx/devices/platform-fsl-usb2-udc.c |   15 +++---
   
We need to differentiate SoCs, so I use platform_device_id to
instead of cpu_ix_xxx(), this is for machine file change
  
  fair enough.
  
drivers/usb/gadget/fsl_mxc_udc.c  |   23 +
drivers/usb/gadget/fsl_udc_core.c |   52 
   +---
drivers/usb/gadget/fsl_usb2_udc.h |   13 --
include/linux/fsl_devices.h   |8 +++
   
Need to get platform_device_id at driver, and replace the cpu_is_xxx to
platform_device_id. Meanwhile, needs a solution for replace
MX35_IO_ADDRESS.
  
  ok, here we go:
  
  You just listed to me three different fixes and each fix should be on a
  separate patch. Meaning that you should have one single patch to convert
  MX35_IO_ADDRESS() into ioremap(), another patch should be removing
  cpu_is_xxx() and the third one fixing connection-id.
  
  As you might remember, we want patches to be self-contained logical
  units and your patch contains 3 of such logical units.
  
 
 OK, three patches. Thanks.
 
 The reason I thought two patches is this build break contains two problems,
 (MX35_IO_ADDRESS  cpu_is_xxx()).
 I would like fix it together, in that case, the git bisect will only
 show one build error at most.

right, still those are two different problems, so they should be fixed
in two separate patches, I'm sorry.

-- 
balbi


signature.asc
Description: Digital signature
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH v3 1/3] usb: fsl-mxc-udc: replace cpu_is_xxx() with platform_device_id

2013-01-14 Thread Felipe Balbi
Hi,

On Mon, Jan 14, 2013 at 06:12:39PM +0800, Peter Chen wrote:
 @@ -2756,22 +2753,41 @@ static int fsl_udc_otg_resume(struct device *dev)
  
   return fsl_udc_resume(NULL);
  }
 -
  /*-
   Register entry point for the peripheral controller driver
  --*/
 -
 +static const struct platform_device_id fsl_udc_devtype[] = {
 + {
 + .name = imx-udc-mx25,
 + .driver_data = IMX25_UDC,
 + }, {
 + .name = imx-udc-mx27,
 + .driver_data = IMX27_UDC,
 + }, {
 + .name = imx-udc-mx31,
 + .driver_data = IMX31_UDC,
 + }, {
 + .name = imx-udc-mx35,
 + .driver_data = IMX35_UDC,
 + }, {
 + .name = imx-udc-mx51,
 + .driver_data = IMX51_UDC,
 + }
 +};

I wonder if your driver-data is actually needed since you can use string
comparisson to achieve the exact same outcome.

-- 
balbi


signature.asc
Description: Digital signature
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH v3 2/3] usb: fsl_mxc_udc: replace MX35_IO_ADDRESS to ioremap

2013-01-14 Thread Felipe Balbi
On Mon, Jan 14, 2013 at 06:12:40PM +0800, Peter Chen wrote:
 As mach/hardware.h is deleted, we can't visit platform code at driver.
 It has no phy driver to combine with this controller, so it has to use
 ioremap to map phy address as a workaround.
 
 Signed-off-by: Peter Chen peter.c...@freescale.com
 ---
  drivers/usb/gadget/fsl_mxc_udc.c |   12 +++-
  1 files changed, 7 insertions(+), 5 deletions(-)
 
 diff --git a/drivers/usb/gadget/fsl_mxc_udc.c 
 b/drivers/usb/gadget/fsl_mxc_udc.c
 index 6df45f7..0e858e6 100644
 --- a/drivers/usb/gadget/fsl_mxc_udc.c
 +++ b/drivers/usb/gadget/fsl_mxc_udc.c
 @@ -23,7 +23,8 @@ static struct clk *mxc_per_clk;
  static struct clk *mxc_ipg_clk;
  
  /* workaround ENGcm09152 for i.MX35 */
 -#define USBPHYCTRL_OTGBASE_OFFSET0x608
 +#define MX35_USBPHYCTRL_OFFSET   0x600
 +#define USBPHYCTRL_OTGBASE_OFFSET0x8
  #define USBPHYCTRL_EVDO  (1  23)
  
  int fsl_udc_clk_init(enum fsl_udc_type devtype, struct platform_device *pdev)
 @@ -83,15 +84,16 @@ void fsl_udc_clk_finalize(enum fsl_udc_type devtype,
   struct fsl_usb2_platform_data *pdata = pdev-dev.platform_data;
   if (devtype == IMX35_UDC) {
   unsigned int v;
 + void __iomem *phy_regs = ioremap((unsigned long)pdata-regs +
 + MX35_USBPHYCTRL_OFFSET, 512);

as I said before, this should be passed via struct resource, not pdata.

-- 
balbi


signature.asc
Description: Digital signature
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH v3 1/3] usb: fsl-mxc-udc: replace cpu_is_xxx() with platform_device_id

2013-01-14 Thread Felipe Balbi
On Mon, Jan 14, 2013 at 11:18:53AM +0100, Marc Kleine-Budde wrote:
 On 01/14/2013 11:16 AM, Felipe Balbi wrote:
  Hi,
  
  On Mon, Jan 14, 2013 at 06:12:39PM +0800, Peter Chen wrote:
  @@ -2756,22 +2753,41 @@ static int fsl_udc_otg_resume(struct device *dev)
   
 return fsl_udc_resume(NULL);
   }
  -
   
  /*-
 Register entry point for the peripheral controller driver
   
  --*/
  -
  +static const struct platform_device_id fsl_udc_devtype[] = {
  +  {
  +  .name = imx-udc-mx25,
  +  .driver_data = IMX25_UDC,
  +  }, {
  +  .name = imx-udc-mx27,
  +  .driver_data = IMX27_UDC,
  +  }, {
  +  .name = imx-udc-mx31,
  +  .driver_data = IMX31_UDC,
  +  }, {
  +  .name = imx-udc-mx35,
  +  .driver_data = IMX35_UDC,
  +  }, {
  +  .name = imx-udc-mx51,
  +  .driver_data = IMX51_UDC,
  +  }
  +};
  
  I wonder if your driver-data is actually needed since you can use string
  comparisson to achieve the exact same outcome.
 
 Why use a string compare, if the kernel infrastructure already does this
 for you?

what do you mean ? What kernel infrastructure is doing waht for me ?

-- 
balbi


signature.asc
Description: Digital signature
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH v3 1/3] usb: fsl-mxc-udc: replace cpu_is_xxx() with platform_device_id

2013-01-14 Thread Felipe Balbi
On Mon, Jan 14, 2013 at 11:34:05AM +0100, Marc Kleine-Budde wrote:
 On 01/14/2013 11:24 AM, Felipe Balbi wrote:
  On Mon, Jan 14, 2013 at 11:18:53AM +0100, Marc Kleine-Budde wrote:
  On 01/14/2013 11:16 AM, Felipe Balbi wrote:
  Hi,
 
  On Mon, Jan 14, 2013 at 06:12:39PM +0800, Peter Chen wrote:
  @@ -2756,22 +2753,41 @@ static int fsl_udc_otg_resume(struct device *dev)
   
   return fsl_udc_resume(NULL);
   }
  -
   
  /*-
   Register entry point for the peripheral controller driver
   
  --*/
  -
  +static const struct platform_device_id fsl_udc_devtype[] = {
  +{
  +.name = imx-udc-mx25,
  +.driver_data = IMX25_UDC,
  +}, {
  +.name = imx-udc-mx27,
  +.driver_data = IMX27_UDC,
  +}, {
  +.name = imx-udc-mx31,
  +.driver_data = IMX31_UDC,
  +}, {
  +.name = imx-udc-mx35,
  +.driver_data = IMX35_UDC,
  +}, {
  +.name = imx-udc-mx51,
  +.driver_data = IMX51_UDC,
  +}
  +};
 
  I wonder if your driver-data is actually needed since you can use string
  comparisson to achieve the exact same outcome.
 
  Why use a string compare, if the kernel infrastructure already does this
  for you?
  
  what do you mean ? What kernel infrastructure is doing waht for me ?
 
 The kernel infrastructure is doing the string compare for you to match
 the device against the driver (via platform_device_id-name). You get
 the a pointer to the driver_data for free. So you don't need any string
 compare in the driver later.

but current driver data is just duplicating name with an integer, it's
pretty useless driver data.

-- 
balbi


signature.asc
Description: Digital signature
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH v3 1/3] usb: fsl-mxc-udc: replace cpu_is_xxx() with platform_device_id

2013-01-14 Thread Felipe Balbi
Hi,

On Mon, Jan 14, 2013 at 11:50:41AM +0100, Marc Kleine-Budde wrote:
 On 01/14/2013 11:39 AM, Felipe Balbi wrote:
  On Mon, Jan 14, 2013 at 11:34:05AM +0100, Marc Kleine-Budde wrote:
  On 01/14/2013 11:24 AM, Felipe Balbi wrote:
  On Mon, Jan 14, 2013 at 11:18:53AM +0100, Marc Kleine-Budde wrote:
  On 01/14/2013 11:16 AM, Felipe Balbi wrote:
  Hi,
 
  On Mon, Jan 14, 2013 at 06:12:39PM +0800, Peter Chen wrote:
  @@ -2756,22 +2753,41 @@ static int fsl_udc_otg_resume(struct device 
  *dev)
   
 return fsl_udc_resume(NULL);
   }
  -
   
  /*-
 Register entry point for the peripheral controller driver
   
  --*/
  -
  +static const struct platform_device_id fsl_udc_devtype[] = {
  +  {
  +  .name = imx-udc-mx25,
  +  .driver_data = IMX25_UDC,
  +  }, {
  +  .name = imx-udc-mx27,
  +  .driver_data = IMX27_UDC,
  +  }, {
  +  .name = imx-udc-mx31,
  +  .driver_data = IMX31_UDC,
  +  }, {
  +  .name = imx-udc-mx35,
  +  .driver_data = IMX35_UDC,
  +  }, {
  +  .name = imx-udc-mx51,
  +  .driver_data = IMX51_UDC,
  +  }
  +};
 
  I wonder if your driver-data is actually needed since you can use string
  comparisson to achieve the exact same outcome.
 
  Why use a string compare, if the kernel infrastructure already does this
  for you?
 
  what do you mean ? What kernel infrastructure is doing waht for me ?
 
  The kernel infrastructure is doing the string compare for you to match
  the device against the driver (via platform_device_id-name). You get
  the a pointer to the driver_data for free. So you don't need any string
  compare in the driver later.
  
  but current driver data is just duplicating name with an integer, it's
  pretty useless driver data.
 
 I don't think so - another argument:
 Less code. As struct platform_device_id is a static array the space is
 allocated anyway. So it doesn't make any difference if driver_data is
 NULL or not. Later you just need to make an integer comparison instead
 of a call to a strcmp(), if you have a switch/case and IMX*_UDC is an
 enum, the compiler will warn you if you've missed an IMX variant.

fair enough, but then don't create a different enum value for each imx
instance if they're mostly the same. Differentiate only what's actually
different.

-- 
balbi


signature.asc
Description: Digital signature
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH v3 1/3] usb: fsl-mxc-udc: replace cpu_is_xxx() with platform_device_id

2013-01-14 Thread Felipe Balbi
On Mon, Jan 14, 2013 at 12:03:04PM +0100, Marc Kleine-Budde wrote:
 On 01/14/2013 11:53 AM, Felipe Balbi wrote:
  Hi,
  
  On Mon, Jan 14, 2013 at 11:50:41AM +0100, Marc Kleine-Budde wrote:
  On 01/14/2013 11:39 AM, Felipe Balbi wrote:
  On Mon, Jan 14, 2013 at 11:34:05AM +0100, Marc Kleine-Budde wrote:
  On 01/14/2013 11:24 AM, Felipe Balbi wrote:
  On Mon, Jan 14, 2013 at 11:18:53AM +0100, Marc Kleine-Budde wrote:
  On 01/14/2013 11:16 AM, Felipe Balbi wrote:
  Hi,
 
  On Mon, Jan 14, 2013 at 06:12:39PM +0800, Peter Chen wrote:
  @@ -2756,22 +2753,41 @@ static int fsl_udc_otg_resume(struct device 
  *dev)
   
   return fsl_udc_resume(NULL);
   }
  -
   
  /*-
   Register entry point for the peripheral controller driver
   
  --*/
  -
  +static const struct platform_device_id fsl_udc_devtype[] = {
  +{
  +.name = imx-udc-mx25,
  +.driver_data = IMX25_UDC,
  +}, {
  +.name = imx-udc-mx27,
  +.driver_data = IMX27_UDC,
  +}, {
  +.name = imx-udc-mx31,
  +.driver_data = IMX31_UDC,
  +}, {
  +.name = imx-udc-mx35,
  +.driver_data = IMX35_UDC,
  +}, {
  +.name = imx-udc-mx51,
  +.driver_data = IMX51_UDC,
  +}
  +};
 
  I wonder if your driver-data is actually needed since you can use 
  string
  comparisson to achieve the exact same outcome.
 
  Why use a string compare, if the kernel infrastructure already does 
  this
  for you?
 
  what do you mean ? What kernel infrastructure is doing waht for me ?
 
  The kernel infrastructure is doing the string compare for you to match
  the device against the driver (via platform_device_id-name). You get
  the a pointer to the driver_data for free. So you don't need any string
  compare in the driver later.
 
  but current driver data is just duplicating name with an integer, it's
  pretty useless driver data.
 
  I don't think so - another argument:
  Less code. As struct platform_device_id is a static array the space is
  allocated anyway. So it doesn't make any difference if driver_data is
  NULL or not. Later you just need to make an integer comparison instead
  of a call to a strcmp(), if you have a switch/case and IMX*_UDC is an
  enum, the compiler will warn you if you've missed an IMX variant.
  
  fair enough, but then don't create a different enum value for each imx
  instance if they're mostly the same. Differentiate only what's actually
  different.
 
 Usually there isn't any Changelog between IP cores used in the different
 fsl processors (at least available outside of fsl), that makes it quite
 difficult to say if something found on one imx is really the same as on
 the other one. And they (usually) don't provide any versioning
 information in a register or the documentation.
 
 just my 2¢

$SUBJECT is trying to differentiate a single feature (or maybe two) to
replace cpu_is_xxx(), then expose that on driver_data without creating
one enum value for each release from fsl.

-- 
balbi


signature.asc
Description: Digital signature
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH v3 1/3] usb: fsl-mxc-udc: replace cpu_is_xxx() with platform_device_id

2013-01-14 Thread Felipe Balbi
Hi,

On Mon, Jan 14, 2013 at 08:56:33PM +0800, Peter Chen wrote:

snip

   Usually there isn't any Changelog between IP cores used in the different
   fsl processors (at least available outside of fsl), that makes it quite
   difficult to say if something found on one imx is really the same as on
   the other one. And they (usually) don't provide any versioning
   information in a register or the documentation.
   
   just my 2¢
  
  $SUBJECT is trying to differentiate a single feature (or maybe two) to
  replace cpu_is_xxx(), then expose that on driver_data without creating
  one enum value for each release from fsl.
 
 Felipe, every one or two SoCs may have their special operations for
 integrate PHY interface, clk operation, or workaround for IC
 limitation.

the particular PHY and clk used should be hidden by phy layer and clk
API respectively. Workarounds, fair enough, we need to handle them; but
ideally those should be based on runtime revision detection, not some
hackery using driver_data.

 Maybe, it will add more future or SoCs (maybe not for this driver) in
 the future, using enum is easier than string comparison for expanding
 something.

a) I never told you to *not* use enum. I said that creating DEVICE_A,
DEVICE_B, DEVICE_C, DEVICE_D and DEVICE_E values when DEVICE_B,
DEVICE_C and DEVICE_E behave exactly the same is unnecessary.

b) you can't be expecting to add future SoCs support to fsl udc, I have
already said and will repeat for the last time: move to chipidea ASAP.

New SoCs cannot be added to fsl udc, you *must* use chipidea for
anything new and move the legacy to chipidea eventually. I will wait for
a full year for you to do that, but after that I will have to start
deleting drivers for the sake of avoid duplication of effort.

cheers

-- 
balbi


signature.asc
Description: Digital signature
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH v3 1/3] usb: fsl-mxc-udc: replace cpu_is_xxx() with platform_device_id

2013-01-14 Thread Felipe Balbi
On Mon, Jan 14, 2013 at 06:54:22PM +0100, Marc Kleine-Budde wrote:
 On 01/14/2013 06:40 PM, Felipe Balbi wrote:
  Hi,
  
  On Mon, Jan 14, 2013 at 08:56:33PM +0800, Peter Chen wrote:
  
  snip
  
  Usually there isn't any Changelog between IP cores used in the different
  fsl processors (at least available outside of fsl), that makes it quite
  difficult to say if something found on one imx is really the same as on
  the other one. And they (usually) don't provide any versioning
  information in a register or the documentation.
 
  just my 2¢
 
  $SUBJECT is trying to differentiate a single feature (or maybe two) to
  replace cpu_is_xxx(), then expose that on driver_data without creating
  one enum value for each release from fsl.
 
  Felipe, every one or two SoCs may have their special operations for
  integrate PHY interface, clk operation, or workaround for IC
  limitation.
  
  the particular PHY and clk used should be hidden by phy layer and clk
  API respectively. Workarounds, fair enough, we need to handle them; but
  ideally those should be based on runtime revision detection, not some
  hackery using driver_data.
 
 If this is actually possible, I'd love to do this. But IP vendor don't
 include a version register in their cores. :(

then fair enough, driver_data or platform_data is the way to go, still
my point (a) below is valid.

-- 
balbi


signature.asc
Description: Digital signature
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH v2 1/1] usb: fsl-mxc-udc: fix build error due to mach/hardware.h

2013-01-13 Thread Felipe Balbi
Hi,

On Mon, Jan 14, 2013 at 03:18:17PM +0800, Peter Chen wrote:
 It changes the driver to use platform_device_id rather than cpu_is_xxx
 to determine the SoC type, and updates the platform code accordingly.
 
 Compile ok at imx_v6_v7_defconfig with CONFIG_USB_FSL_USB2 enable.
 Tested at mx51 bbg board, it works ok after enable phy clock
 (Need another patch to fix this problem)
 
 Signed-off-by: Peter Chen peter.c...@freescale.com

not good for -rc. You have to break this down as you're solving at least
three different problems with this patch.

Besides there are parts which are not related to the build break.

-- 
balbi


signature.asc
Description: Digital signature
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH 1/1] usb: fsl-mxc-udc: fix build error due to mach/hardware.h

2013-01-13 Thread Felipe Balbi
On Mon, Jan 14, 2013 at 09:12:43AM +0800, Shawn Guo wrote:
 Balbi,
 
 On Fri, Jan 11, 2013 at 02:50:59PM +0200, Felipe Balbi wrote:
  As I said before, this patch is too big for -rc and is unnecessary
  considering patch I wrote above. Note that there is no problems in
  checking if ULPI PHY clk is 60MHz on all arches and, for the workaround,
  you already have a runtime check.
  
 Ok, I did not have these facts on my mind.  If these are true, the
 cpu_is_xxx() shouldn't be necessary there from the beginning, and we
 can simply remove them then.
 
  Shawn, it can be broken down into smaller pieces because you can *FIX
  THE COMPILE BREAKAGE* with a very small patch as above (only issue now
  is usage of MX32_IO_ADDRESS()).
  
 The MX35_IO_ADDRESS() also seems unnecessary, since as Peter's patch
 suggested that pdata-regs can be used instead.

pdata-regs is a hack. The 'canonical' way to pass addresses to drivers
is via struct resource.

-- 
balbi


signature.asc
Description: Digital signature
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [BUILD BREAK] usb: gadget: fsl_mxc_udc can't compile on current v3.8-rc3

2013-01-11 Thread Felipe Balbi
On Fri, Jan 11, 2013 at 03:23:59AM +, Chen Peter-B29397 wrote:
  
   
Some recent patch has caused fsl_mxc_udc.c driver to fail compilation
because it can't find mach/hardware.h anymore.
   
I would like this to be fixed still during this -rc cycle.
  
   Me too, who's sending a patch?  :)
  
  Hi Peter,
  
  Who is currently working on the i.mx USB?
  
 
 I am working on it, but there are two versions, this one and chipidea's.
 
 Anyway, I will send a patch to fix this problem.

if you're already using chipidea, then send me a patch removing this
driver and focus your effort on chipidea.

-- 
balbi


signature.asc
Description: Digital signature
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [BUILD BREAK] usb: gadget: fsl_mxc_udc can't compile on current v3.8-rc3

2013-01-11 Thread Felipe Balbi
Hi,

On Fri, Jan 11, 2013 at 09:24:16AM +, Li Yang-R58472 wrote:
 
 
  -Original Message-
  From: Felipe Balbi [mailto:ba...@ti.com]
  Sent: Friday, January 11, 2013 4:41 PM
  To: Chen Peter-B29397
  Cc: ba...@ti.com; ker...@pengutronix.de; Li Yang-R58472; Greg KH; linux-
  u...@vger.kernel.org; linuxppc-dev@lists.ozlabs.org
  Subject: Re: [BUILD BREAK] usb: gadget: fsl_mxc_udc can't compile on
  current v3.8-rc3
  
  Hi,
  
  On Fri, Jan 11, 2013 at 08:35:29AM +, Chen Peter-B29397 wrote:
 I am working on it, but there are two versions, this one and
  chipidea's.

 Anyway, I will send a patch to fix this problem.
   
if you're already using chipidea, then send me a patch removing this
driver and focus your effort on chipidea.
   
   Added Sascha
  
   Now, not all of FSL i.mx USB can move to use chipidea due to some
   platform and USB PHY problem.
  
  then we need to target fixing those problems and moving to chipidea
  completely at some point. There's no reason to duplicate efforts if we
  already have a re-usable driver in tree, right ?
  
  Let's fix this build break and focus on making sure all i.MX platforms
  can use chipidea so we can drop fsl udc on next merge window. That would
  be a great patchset to see.
 
 I do agree that we need move to use the chipidea driver and eventually
 remove the fsl udc driver, but there were many users of the current
 driver such as PowerPC and Coldfire platforms besides the i.MX
 platforms.  The support for them with chipidea driver could also be
 broken for now.  I would suggest to have a transitional period that
 both drivers are kept while new development be based on the new
 driver.

right, right. That can be done as long as 'transitional period' isn't 20
years. At least make a plan to remove fsl udc, if it doesn't happen in
the next 4 merge windows, I will remove it myself to force people to
reuse other drivers. There is no reason to keep both drivers around.

 Added Ramneek.  What do you think of the current status for chipidea
 driver on PowerPC platforms?

that would be great to know, indeed.

-- 
balbi


signature.asc
Description: Digital signature
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH 1/1] usb: fsl-mxc-udc: fix build error due to mach/hardware.h

2013-01-11 Thread Felipe Balbi
Hi,

On Fri, Jan 11, 2013 at 05:56:28PM +0800, Peter Chen wrote:
 It changes the driver to use platform_device_id rather than cpu_is_xxx
 to determine the SoC type, and updates the platform code accordingly.
 
 Compile ok at imx_v6_v7_defconfig with CONFIG_USB_FSL_USB2 enable.
 Tested at mx51 bbg board, it works ok after enable phy clock
 (Need another patch to fix this problem)
 
 Signed-off-by: Peter Chen peter.c...@freescale.com

this is too big for -rc, can you break it down into smaller pieces ?

-- 
balbi


signature.asc
Description: Digital signature
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH 1/1] usb: fsl-mxc-udc: fix build error due to mach/hardware.h

2013-01-11 Thread Felipe Balbi
Hi,

On Fri, Jan 11, 2013 at 05:56:28PM +0800, Peter Chen wrote:
 It changes the driver to use platform_device_id rather than cpu_is_xxx
 to determine the SoC type, and updates the platform code accordingly.
 
 Compile ok at imx_v6_v7_defconfig with CONFIG_USB_FSL_USB2 enable.
 Tested at mx51 bbg board, it works ok after enable phy clock
 (Need another patch to fix this problem)
 
 Signed-off-by: Peter Chen peter.c...@freescale.com
 ---
  arch/arm/mach-imx/clk-imx25.c |6 +-
  arch/arm/mach-imx/clk-imx27.c |6 +-
  arch/arm/mach-imx/clk-imx31.c |6 +-
  arch/arm/mach-imx/clk-imx35.c |6 +-
  arch/arm/mach-imx/clk-imx51-imx53.c   |6 +-
  arch/arm/mach-imx/devices/devices-common.h|1 +
  arch/arm/mach-imx/devices/platform-fsl-usb2-udc.c |   15 +++---
  drivers/usb/gadget/fsl_mxc_udc.c  |   17 +++
  drivers/usb/gadget/fsl_udc_core.c |   52 +---
  drivers/usb/gadget/fsl_usb2_udc.h |   13 --
  include/linux/fsl_devices.h   |8 +++
  11 files changed, 82 insertions(+), 54 deletions(-)
 
 diff --git a/arch/arm/mach-imx/clk-imx25.c b/arch/arm/mach-imx/clk-imx25.c
 index b197aa7..67e353d 100644
 --- a/arch/arm/mach-imx/clk-imx25.c
 +++ b/arch/arm/mach-imx/clk-imx25.c
 @@ -254,9 +254,9 @@ int __init mx25_clocks_init(void)
   clk_register_clkdev(clk[ipg], ipg, mxc-ehci.2);
   clk_register_clkdev(clk[usbotg_ahb], ahb, mxc-ehci.2);
   clk_register_clkdev(clk[usb_div], per, mxc-ehci.2);
 - clk_register_clkdev(clk[ipg], ipg, fsl-usb2-udc);
 - clk_register_clkdev(clk[usbotg_ahb], ahb, fsl-usb2-udc);
 - clk_register_clkdev(clk[usb_div], per, fsl-usb2-udc);
 + clk_register_clkdev(clk[ipg], ipg, imx-udc-mx25);
 + clk_register_clkdev(clk[usbotg_ahb], ahb, imx-udc-mx25);
 + clk_register_clkdev(clk[usb_div], per, imx-udc-mx25);
   clk_register_clkdev(clk[nfc_ipg_per], NULL, imx25-nand.0);
   /* i.mx25 has the i.mx35 type cspi */
   clk_register_clkdev(clk[cspi1_ipg], NULL, imx35-cspi.0);
 diff --git a/arch/arm/mach-imx/clk-imx27.c b/arch/arm/mach-imx/clk-imx27.c
 index 4c1d1e4..1ffe3b5 100644
 --- a/arch/arm/mach-imx/clk-imx27.c
 +++ b/arch/arm/mach-imx/clk-imx27.c
 @@ -236,9 +236,9 @@ int __init mx27_clocks_init(unsigned long fref)
   clk_register_clkdev(clk[lcdc_ahb_gate], ahb, imx21-fb.0);
   clk_register_clkdev(clk[csi_ahb_gate], ahb, imx27-camera.0);
   clk_register_clkdev(clk[per4_gate], per, imx27-camera.0);
 - clk_register_clkdev(clk[usb_div], per, fsl-usb2-udc);
 - clk_register_clkdev(clk[usb_ipg_gate], ipg, fsl-usb2-udc);
 - clk_register_clkdev(clk[usb_ahb_gate], ahb, fsl-usb2-udc);
 + clk_register_clkdev(clk[usb_div], per, imx-udc-mx27);
 + clk_register_clkdev(clk[usb_ipg_gate], ipg, imx-udc-mx27);
 + clk_register_clkdev(clk[usb_ahb_gate], ahb, imx-udc-mx27);
   clk_register_clkdev(clk[usb_div], per, mxc-ehci.0);
   clk_register_clkdev(clk[usb_ipg_gate], ipg, mxc-ehci.0);
   clk_register_clkdev(clk[usb_ahb_gate], ahb, mxc-ehci.0);
 diff --git a/arch/arm/mach-imx/clk-imx31.c b/arch/arm/mach-imx/clk-imx31.c
 index 8be64e0..ef66eaf 100644
 --- a/arch/arm/mach-imx/clk-imx31.c
 +++ b/arch/arm/mach-imx/clk-imx31.c
 @@ -139,9 +139,9 @@ int __init mx31_clocks_init(unsigned long fref)
   clk_register_clkdev(clk[usb_div_post], per, mxc-ehci.2);
   clk_register_clkdev(clk[usb_gate], ahb, mxc-ehci.2);
   clk_register_clkdev(clk[ipg], ipg, mxc-ehci.2);
 - clk_register_clkdev(clk[usb_div_post], per, fsl-usb2-udc);
 - clk_register_clkdev(clk[usb_gate], ahb, fsl-usb2-udc);
 - clk_register_clkdev(clk[ipg], ipg, fsl-usb2-udc);
 + clk_register_clkdev(clk[usb_div_post], per, imx-udc-mx31);
 + clk_register_clkdev(clk[usb_gate], ahb, imx-udc-mx31);
 + clk_register_clkdev(clk[ipg], ipg, imx-udc-mx31);
   clk_register_clkdev(clk[csi_gate], NULL, mx3-camera.0);
   /* i.mx31 has the i.mx21 type uart */
   clk_register_clkdev(clk[uart1_gate], per, imx21-uart.0);
 diff --git a/arch/arm/mach-imx/clk-imx35.c b/arch/arm/mach-imx/clk-imx35.c
 index 66f3d65..69fe9c8 100644
 --- a/arch/arm/mach-imx/clk-imx35.c
 +++ b/arch/arm/mach-imx/clk-imx35.c
 @@ -251,9 +251,9 @@ int __init mx35_clocks_init()
   clk_register_clkdev(clk[usb_div], per, mxc-ehci.2);
   clk_register_clkdev(clk[ipg], ipg, mxc-ehci.2);
   clk_register_clkdev(clk[usbotg_gate], ahb, mxc-ehci.2);
 - clk_register_clkdev(clk[usb_div], per, fsl-usb2-udc);
 - clk_register_clkdev(clk[ipg], ipg, fsl-usb2-udc);
 - clk_register_clkdev(clk[usbotg_gate], ahb, fsl-usb2-udc);
 + clk_register_clkdev(clk[usb_div], per, imx-udc-mx35);
 + clk_register_clkdev(clk[ipg], ipg, imx-udc-mx35);
 + clk_register_clkdev(clk[usbotg_gate], ahb, imx-udc-mx35);
   clk_register_clkdev(clk[wdog_gate], NULL, imx2-wdt.0);
   

[BUILD BREAK] usb: gadget: fsl_mxc_udc can't compile on current v3.8-rc3

2013-01-10 Thread Felipe Balbi
Hi,

Some recent patch has caused fsl_mxc_udc.c driver to fail compilation
because it can't find mach/hardware.h anymore.

I would like this to be fixed still during this -rc cycle.

Thank you

-- 
balbi


signature.asc
Description: Digital signature
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH 119/493] usb: remove use of __devexit_p

2012-11-19 Thread Felipe Balbi
Hi,

On Mon, Nov 19, 2012 at 01:21:08PM -0500, Bill Pemberton wrote:
 CONFIG_HOTPLUG is going away as an option so __devexit_p is no longer
 needed.
 
 Signed-off-by: Bill Pemberton wf...@virginia.edu
 Cc: Peter Korsgaard jac...@sunsite.dk 
 Cc: Alexander Shishkin alexander.shish...@linux.intel.com 
 Cc: Felipe Balbi ba...@ti.com 
 Cc: Li Yang le...@freescale.com 
 Cc: Alan Stern st...@rowland.harvard.edu 
 Cc: Wan ZongShun mcuos@gmail.com 
 Cc: Ben Dooks ben-li...@fluff.org 
 Cc: Kukjin Kim kgene@samsung.com 
 Cc: linux-...@vger.kernel.org 
 Cc: linux-o...@vger.kernel.org 
 Cc: linuxppc-dev@lists.ozlabs.org 
 Cc: linux-arm-ker...@lists.infradead.org 
 Cc: linux-samsung-...@vger.kernel.org 
 ---
  drivers/usb/c67x00/c67x00-drv.c  | 2 +-
  drivers/usb/chipidea/ci13xxx_imx.c   | 2 +-
  drivers/usb/chipidea/ci13xxx_msm.c   | 2 +-
  drivers/usb/chipidea/ci13xxx_pci.c   | 2 +-
  drivers/usb/chipidea/core.c  | 2 +-
  drivers/usb/chipidea/usbmisc_imx6q.c | 2 +-
  drivers/usb/dwc3/core.c  | 2 +-
  drivers/usb/dwc3/dwc3-exynos.c   | 2 +-
  drivers/usb/dwc3/dwc3-omap.c | 2 +-
  drivers/usb/dwc3/dwc3-pci.c  | 2 +-
  drivers/usb/gadget/bcm63xx_udc.c | 2 +-
  drivers/usb/gadget/fsl_qe_udc.c  | 2 +-
  drivers/usb/gadget/hid.c | 2 +-
  drivers/usb/gadget/lpc32xx_udc.c | 2 +-
  drivers/usb/gadget/net2272.c | 4 ++--
  drivers/usb/gadget/omap_udc.c| 2 +-
  drivers/usb/gadget/s3c-hsotg.c   | 2 +-
  drivers/usb/host/bcma-hcd.c  | 2 +-
  drivers/usb/host/ehci-atmel.c| 2 +-
  drivers/usb/host/ehci-msm.c  | 2 +-
  drivers/usb/host/ehci-platform.c | 2 +-
  drivers/usb/host/ehci-s5p.c  | 2 +-
  drivers/usb/host/ehci-w90x900.c  | 2 +-
  drivers/usb/host/fhci-hcd.c  | 2 +-
  drivers/usb/host/fsl-mph-dr-of.c | 2 +-
  drivers/usb/host/isp1362-hcd.c   | 2 +-
  drivers/usb/host/isp1760-if.c| 2 +-
  drivers/usb/host/ohci-at91.c | 2 +-
  drivers/usb/host/ohci-exynos.c   | 2 +-
  drivers/usb/host/ohci-jz4740.c   | 2 +-
  drivers/usb/host/ohci-omap3.c| 2 +-
  drivers/usb/host/ohci-platform.c | 2 +-
  drivers/usb/host/ohci-s3c2410.c  | 2 +-
  drivers/usb/host/ohci-tmio.c | 2 +-
  drivers/usb/host/r8a66597-hcd.c  | 2 +-
  drivers/usb/host/sl811-hcd.c | 2 +-
  drivers/usb/host/ssb-hcd.c   | 2 +-
  drivers/usb/host/u132-hcd.c  | 2 +-
  drivers/usb/musb/am35x.c | 2 +-
  drivers/usb/musb/da8xx.c | 2 +-
  drivers/usb/musb/davinci.c   | 2 +-
  drivers/usb/musb/musb_core.c | 2 +-
  drivers/usb/musb/musb_dsps.c | 2 +-
  drivers/usb/musb/omap2430.c  | 2 +-
  drivers/usb/musb/tusb6010.c  | 2 +-
  drivers/usb/musb/ux500.c | 2 +-
  drivers/usb/otg/ab8500-usb.c | 2 +-
  drivers/usb/otg/fsl_otg.c| 2 +-
  drivers/usb/otg/msm_otg.c| 2 +-
  drivers/usb/otg/mxs-phy.c| 2 +-
  drivers/usb/otg/nop-usb-xceiv.c  | 2 +-
  drivers/usb/phy/mv_u3d_phy.c | 2 +-
  drivers/usb/phy/omap-usb2.c  | 2 +-
  drivers/usb/phy/rcar-phy.c   | 2 +-
  drivers/usb/renesas_usbhs/common.c   | 2 +-
  55 files changed, 56 insertions(+), 56 deletions(-)

For drivers/usb/gadget, drivers/usb/dwc3/, drivers/usb/musb/,
drivers/usb/otg/, drivers/usb/phy, and drivers/usb/renesas_usbhs:

Acked-by: Felipe Balbi ba...@ti.com

-- 
balbi


signature.asc
Description: Digital signature
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH 159/493] usb: remove use of __devinit

2012-11-19 Thread Felipe Balbi
Hi,

On Mon, Nov 19, 2012 at 01:21:48PM -0500, Bill Pemberton wrote:
 CONFIG_HOTPLUG is going away as an option so __devinit is no longer
 needed.
 
 Signed-off-by: Bill Pemberton wf...@virginia.edu
 Cc: Peter Korsgaard jac...@sunsite.dk 
 Cc: Alexander Shishkin alexander.shish...@linux.intel.com 
 Cc: Felipe Balbi ba...@ti.com 
 Cc: Li Yang le...@freescale.com 
 Cc: Alan Stern st...@rowland.harvard.edu 
 Cc: Geoff Levand ge...@infradead.org 
 Cc: Wan ZongShun mcuos@gmail.com 
 Cc: Olav Kongas o...@artecdesign.ee 
 Cc: Lennert Buytenhek ker...@wantstofly.org 
 Cc: Ben Dooks ben-li...@fluff.org 
 Cc: Kukjin Kim kgene@samsung.com 
 Cc: linux-...@vger.kernel.org 
 Cc: linux-o...@vger.kernel.org 
 Cc: linuxppc-dev@lists.ozlabs.org 
 Cc: cbe-oss-...@lists.ozlabs.org 
 Cc: linux-arm-ker...@lists.infradead.org 
 Cc: linux-samsung-...@vger.kernel.org 
 ---
  drivers/usb/c67x00/c67x00-drv.c  |  2 +-
  drivers/usb/chipidea/ci13xxx_imx.c   |  2 +-
  drivers/usb/chipidea/ci13xxx_msm.c   |  2 +-
  drivers/usb/chipidea/ci13xxx_pci.c   |  2 +-
  drivers/usb/chipidea/core.c  |  2 +-
  drivers/usb/chipidea/usbmisc_imx6q.c |  2 +-
  drivers/usb/dwc3/core.c  | 11 +--
  drivers/usb/dwc3/debugfs.c   |  2 +-
  drivers/usb/dwc3/dwc3-exynos.c   |  4 ++--
  drivers/usb/dwc3/dwc3-omap.c |  4 ++--
  drivers/usb/dwc3/dwc3-pci.c  |  4 ++--
  drivers/usb/dwc3/gadget.c|  4 ++--
  drivers/usb/gadget/at91_udc.c|  4 ++--
  drivers/usb/gadget/bcm63xx_udc.c |  2 +-
  drivers/usb/gadget/f_uac2.c  |  2 +-
  drivers/usb/gadget/fsl_qe_udc.c  |  8 
  drivers/usb/gadget/mv_udc_core.c |  2 +-
  drivers/usb/gadget/net2272.c | 13 ++---
  drivers/usb/gadget/omap_udc.c|  6 +++---
  drivers/usb/gadget/s3c-hsotg.c   |  6 +++---
  drivers/usb/gadget/s3c-hsudc.c   |  2 +-
  drivers/usb/host/bcma-hcd.c  |  9 -
  drivers/usb/host/ehci-atmel.c|  2 +-
  drivers/usb/host/ehci-grlib.c|  2 +-
  drivers/usb/host/ehci-orion.c|  4 ++--
  drivers/usb/host/ehci-platform.c |  2 +-
  drivers/usb/host/ehci-ppc-of.c   |  4 ++--
  drivers/usb/host/ehci-ps3.c  |  2 +-
  drivers/usb/host/ehci-s5p.c  |  2 +-
  drivers/usb/host/ehci-w90x900.c  |  4 ++--
  drivers/usb/host/ehci-xilinx-of.c|  2 +-
  drivers/usb/host/fhci-hcd.c  |  2 +-
  drivers/usb/host/fsl-mph-dr-of.c |  8 
  drivers/usb/host/imx21-hcd.c |  2 +-
  drivers/usb/host/isp116x-hcd.c   |  2 +-
  drivers/usb/host/isp1362-hcd.c   |  2 +-
  drivers/usb/host/isp1760-if.c|  4 ++--
  drivers/usb/host/ohci-at91.c | 12 ++--
  drivers/usb/host/ohci-ep93xx.c   |  2 +-
  drivers/usb/host/ohci-exynos.c   |  2 +-
  drivers/usb/host/ohci-jz4740.c   |  2 +-
  drivers/usb/host/ohci-nxp.c  |  4 ++--
  drivers/usb/host/ohci-octeon.c   |  2 +-
  drivers/usb/host/ohci-omap3.c|  2 +-
  drivers/usb/host/ohci-pci.c  |  2 +-
  drivers/usb/host/ohci-platform.c |  2 +-
  drivers/usb/host/ohci-ppc-of.c   |  4 ++--
  drivers/usb/host/ohci-ps3.c  |  4 ++--
  drivers/usb/host/ohci-pxa27x.c   |  6 +++---
  drivers/usb/host/ohci-s3c2410.c  |  2 +-
  drivers/usb/host/ohci-sa.c   |  2 +-
  drivers/usb/host/ohci-spear.c|  2 +-
  drivers/usb/host/ohci-tmio.c |  2 +-
  drivers/usb/host/pci-quirks.c| 14 +++---
  drivers/usb/host/r8a66597-hcd.c  |  2 +-
  drivers/usb/host/sl811-hcd.c |  2 +-
  drivers/usb/host/ssb-hcd.c   | 11 +--
  drivers/usb/host/u132-hcd.c  |  2 +-
  drivers/usb/host/uhci-grlib.c|  2 +-
  drivers/usb/host/uhci-platform.c |  2 +-
  drivers/usb/musb/am35x.c |  2 +-
  drivers/usb/musb/blackfin.c  |  2 +-
  drivers/usb/musb/cppi_dma.c  |  3 +--
  drivers/usb/musb/da8xx.c |  2 +-
  drivers/usb/musb/davinci.c   |  2 +-
  drivers/usb/musb/musb_core.c | 15 +++
  drivers/usb/musb/musb_debugfs.c  |  2 +-
  drivers/usb/musb/musb_dma.h  |  3 +--
  drivers/usb/musb/musb_dsps.c |  4 ++--
  drivers/usb/musb/musb_gadget.c   |  6 +++---
  drivers/usb/musb/musbhsdma.c |  3 +--
  drivers/usb/musb/omap2430.c  |  2 +-
  drivers/usb/musb/tusb6010.c  |  2 +-
  drivers/usb/musb/tusb6010_omap.c |  3 +--
  drivers/usb/musb/ux500.c |  2 +-
  drivers/usb/musb/ux500_dma.c |  3 +--
  drivers/usb/otg/ab8500-usb.c |  2 +-
  drivers/usb/otg/fsl_otg.c|  2 +-
  drivers/usb/otg/isp1301_omap.c   |  2 +-
  drivers/usb/otg/nop-usb-xceiv.c  |  2 +-
  drivers/usb/otg/twl4030-usb.c|  2 +-
  drivers/usb/otg/twl6030-usb.c|  2 +-
  drivers/usb/phy/mv_u3d_phy.c |  2 +-
  drivers/usb/phy/omap-usb2.c  |  2 +-
  drivers/usb/phy/rcar-phy.c   |  2 +-
  85

Re: [PATCH 371/493] usb: remove use of __devinitconst

2012-11-19 Thread Felipe Balbi
Hi,

On Mon, Nov 19, 2012 at 01:25:20PM -0500, Bill Pemberton wrote:
 CONFIG_HOTPLUG is going away as an option so __devinitconst is no
 longer needed.
 
 Signed-off-by: Bill Pemberton wf...@virginia.edu
 Cc: Li Yang le...@freescale.com 
 Cc: Felipe Balbi ba...@ti.com 
 Cc: linux-...@vger.kernel.org 
 Cc: linuxppc-dev@lists.ozlabs.org 
 ---
  drivers/usb/gadget/fsl_qe_udc.c | 2 +-
  drivers/usb/host/bcma-hcd.c | 2 +-
  drivers/usb/host/pci-quirks.c   | 2 +-
  drivers/usb/host/ssb-hcd.c  | 2 +-
  drivers/usb/musb/musb_dsps.c| 6 +++---
  5 files changed, 7 insertions(+), 7 deletions(-)

For drivers/usb/gadget, drivers/usb/musb/:

Acked-by: Felipe Balbi ba...@ti.com

-- 
balbi


signature.asc
Description: Digital signature
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH 431/493] usb: remove use of __devexit

2012-11-19 Thread Felipe Balbi
Hi,

On Mon, Nov 19, 2012 at 01:26:20PM -0500, Bill Pemberton wrote:
 CONFIG_HOTPLUG is going away as an option so __devexit is no
 longer needed.
 
 Signed-off-by: Bill Pemberton wf...@virginia.edu
 Cc: Peter Korsgaard jac...@sunsite.dk 
 Cc: Alexander Shishkin alexander.shish...@linux.intel.com 
 Cc: Felipe Balbi ba...@ti.com 
 Cc: Li Yang le...@freescale.com 
 Cc: Alan Stern st...@rowland.harvard.edu 
 Cc: Wan ZongShun mcuos@gmail.com 
 Cc: Ben Dooks ben-li...@fluff.org 
 Cc: Kukjin Kim kgene@samsung.com 
 Cc: linux-...@vger.kernel.org 
 Cc: linux-o...@vger.kernel.org 
 Cc: linuxppc-dev@lists.ozlabs.org 
 Cc: linux-arm-ker...@lists.infradead.org 
 Cc: linux-samsung-...@vger.kernel.org 
 ---
  drivers/usb/c67x00/c67x00-drv.c  |  2 +-
  drivers/usb/chipidea/ci13xxx_imx.c   |  2 +-
  drivers/usb/chipidea/ci13xxx_msm.c   |  2 +-
  drivers/usb/chipidea/ci13xxx_pci.c   |  2 +-
  drivers/usb/chipidea/core.c  |  2 +-
  drivers/usb/chipidea/usbmisc_imx6q.c |  2 +-
  drivers/usb/dwc3/core.c  |  2 +-
  drivers/usb/dwc3/debugfs.c   |  2 +-
  drivers/usb/dwc3/dwc3-exynos.c   |  2 +-
  drivers/usb/dwc3/dwc3-omap.c |  2 +-
  drivers/usb/dwc3/dwc3-pci.c  |  2 +-
  drivers/usb/gadget/bcm63xx_udc.c |  2 +-
  drivers/usb/gadget/fsl_qe_udc.c  |  2 +-
  drivers/usb/gadget/hid.c |  2 +-
  drivers/usb/gadget/lpc32xx_udc.c |  2 +-
  drivers/usb/gadget/mv_u3d_core.c |  2 +-
  drivers/usb/gadget/mv_udc_core.c |  2 +-
  drivers/usb/gadget/net2272.c | 10 +-
  drivers/usb/gadget/omap_udc.c|  2 +-
  drivers/usb/gadget/s3c-hsotg.c   |  4 ++--
  drivers/usb/host/bcma-hcd.c  |  2 +-
  drivers/usb/host/ehci-atmel.c|  2 +-
  drivers/usb/host/ehci-msm.c  |  2 +-
  drivers/usb/host/ehci-platform.c |  2 +-
  drivers/usb/host/ehci-s5p.c  |  2 +-
  drivers/usb/host/ehci-w90x900.c  |  2 +-
  drivers/usb/host/fhci-hcd.c  |  4 ++--
  drivers/usb/host/fsl-mph-dr-of.c |  4 ++--
  drivers/usb/host/isp1362-hcd.c   |  2 +-
  drivers/usb/host/isp1760-if.c|  2 +-
  drivers/usb/host/ohci-at91.c |  6 +++---
  drivers/usb/host/ohci-exynos.c   |  2 +-
  drivers/usb/host/ohci-jz4740.c   |  2 +-
  drivers/usb/host/ohci-omap3.c|  2 +-
  drivers/usb/host/ohci-platform.c |  2 +-
  drivers/usb/host/ohci-s3c2410.c  |  2 +-
  drivers/usb/host/ohci-tmio.c |  2 +-
  drivers/usb/host/r8a66597-hcd.c  |  2 +-
  drivers/usb/host/sl811-hcd.c |  2 +-
  drivers/usb/host/ssb-hcd.c   |  4 ++--
  drivers/usb/host/u132-hcd.c  |  2 +-
  drivers/usb/musb/am35x.c |  2 +-
  drivers/usb/musb/blackfin.c  |  2 +-
  drivers/usb/musb/da8xx.c |  2 +-
  drivers/usb/musb/davinci.c   |  2 +-
  drivers/usb/musb/musb_core.c |  2 +-
  drivers/usb/musb/musb_dsps.c |  2 +-
  drivers/usb/musb/omap2430.c  |  2 +-
  drivers/usb/musb/tusb6010.c  |  2 +-
  drivers/usb/musb/ux500.c |  2 +-
  drivers/usb/otg/ab8500-usb.c |  2 +-
  drivers/usb/otg/fsl_otg.c|  2 +-
  drivers/usb/otg/msm_otg.c|  2 +-
  drivers/usb/otg/mxs-phy.c|  2 +-
  drivers/usb/otg/nop-usb-xceiv.c  |  2 +-
  drivers/usb/phy/omap-usb2.c  |  2 +-
  drivers/usb/phy/rcar-phy.c   |  2 +-
  drivers/usb/renesas_usbhs/common.c   |  2 +-

For drivers/usb/gadget, drivers/usb/dwc3/, drivers/usb/musb/,
drivers/usb/otg/, drivers/usb/phy, and drivers/usb/renesas_usbhs:

Acked-by: Felipe Balbi ba...@ti.com

-- 
balbi


signature.asc
Description: Digital signature
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH 2/3] usb: gadget: fsl_qe_udc: do not use tasklet_disable before tasklet_kill

2012-10-31 Thread Felipe Balbi
On Wed, Oct 31, 2012 at 04:06:00PM +0800, Xiaotian Feng wrote:
 If tasklet_disable() is called before related tasklet handled,
 tasklet_kill will never be finished. tasklet_kill is enough.

how did you test this ? Why changing FSL driver instead of switching
over to chipidea which is supposed to be shared by every licensee of the
chipidea core ?

 Signed-off-by: Xiaotian Feng dannyf...@tencent.com
 Cc: Li Yang le...@freescale.com
 Cc: Felipe Balbi ba...@ti.com
 Cc: Greg Kroah-Hartman gre...@linuxfoundation.org
 Cc: linux-...@vger.kernel.org
 Cc: linuxppc-dev@lists.ozlabs.org
 ---
  drivers/usb/gadget/fsl_qe_udc.c |4 +---
  1 file changed, 1 insertion(+), 3 deletions(-)
 
 diff --git a/drivers/usb/gadget/fsl_qe_udc.c b/drivers/usb/gadget/fsl_qe_udc.c
 index b09452d..4ad3b82 100644
 --- a/drivers/usb/gadget/fsl_qe_udc.c
 +++ b/drivers/usb/gadget/fsl_qe_udc.c
 @@ -2661,7 +2661,7 @@ static int __devexit qe_udc_remove(struct 
 platform_device *ofdev)
   usb_del_gadget_udc(udc-gadget);
  
   udc-done = done;
 - tasklet_disable(udc-rx_tasklet);
 + tasklet_kill(udc-rx_tasklet);
  
   if (udc-nullmap) {
   dma_unmap_single(udc-gadget.dev.parent,
 @@ -2698,8 +2698,6 @@ static int __devexit qe_udc_remove(struct 
 platform_device *ofdev)
   free_irq(udc-usb_irq, udc);
   irq_dispose_mapping(udc-usb_irq);
  
 - tasklet_kill(udc-rx_tasklet);
 -
   iounmap(udc-usb_regs);
  
   device_unregister(udc-gadget.dev);
 -- 
 1.7.9.5
 

-- 
balbi


signature.asc
Description: Digital signature
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH 2/3] usb: gadget: fsl_qe_udc: do not use tasklet_disable before tasklet_kill

2012-10-31 Thread Felipe Balbi
Hi,

On Wed, Oct 31, 2012 at 10:35:37PM +0800, Li Yang wrote:
 On Wed, Oct 31, 2012 at 9:26 PM, Felipe Balbi ba...@ti.com wrote:
  On Wed, Oct 31, 2012 at 04:06:00PM +0800, Xiaotian Feng wrote:
  If tasklet_disable() is called before related tasklet handled,
  tasklet_kill will never be finished. tasklet_kill is enough.
 
  how did you test this ? Why changing FSL driver instead of switching
  over to chipidea which is supposed to be shared by every licensee of the
  chipidea core ?
 
 The QE UDC is an private controller that is not compatible with the
 Chipidea core.

thanks for the clarification, but you still haven't answered how you
tested this ;-)

-- 
balbi


signature.asc
Description: Digital signature
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH 1/1] usb: gadget: Don't attempt to dequeue requests for a disabled USB endpoint on Freescale hardware

2012-10-26 Thread Felipe Balbi
Hi,

On Thu, Oct 25, 2012 at 02:36:24AM +0200, Laurent Pinchart wrote:
 Hi Felipe,
 
 On Monday 22 October 2012 13:56:01 Felipe Balbi wrote:
  On Mon, Oct 22, 2012 at 12:47:21PM +0200, Laurent Pinchart wrote:
   On Monday 22 October 2012 03:33:19 Li Yang-R58472 wrote:
On Saturday, October 20, 2012 1:37 AM Felipe Balbi wrote:
 On Fri, Oct 19, 2012 at 06:19:26PM +0100, Simon Haggett wrote:
  Some gadget drivers may attempt to dequeue requests for an endpoint
  that has already been disabled. For example, in the UVC gadget
  driver, uvc_function_set_alt() will call usb_ep_disable() when alt
  setting 0 is selected. When the userspace application subsequently
  issues the VIDIOC_STREAMOFF ioctl, uvc_video_enable() invokes
  usb_ep_dequeue() to ensure that all requests have been cancelled.
 
 bug is on uvc gadget, then. Laurent ?
   
   We've discussed this topic a couple of months before. I believe that's not
   a bug.
   
   http://68.183.106.108/lists/linux-usb/msg68869.html
  
  fair enough :-)
  
  That's a different case, however. At the link above we're discussing
  dequeueing a request which is already being dequeued. $SUBJECT is trying
  to fix dequeueing of a request for an endpoint which isn't even enabled.
 
 You've got a point there :-) That's a different case indeed, I'm open to (at 
 least evaluating) a fix in the UVC gadget driver if you think that's better.

I _do_ think that's better. If the endpoint isn't even enabled, why are
you trying to dequeue a request ? :-)

cheers

-- 
balbi


signature.asc
Description: Digital signature
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH 1/1] usb: gadget: Don't attempt to dequeue requests for a disabled USB endpoint on Freescale hardware

2012-10-22 Thread Felipe Balbi
On Mon, Oct 22, 2012 at 03:33:19AM +, Li Yang-R58472 wrote:
 
 
  -Original Message-
  From: Felipe Balbi [mailto:ba...@ti.com]
  Sent: Saturday, October 20, 2012 1:37 AM
  To: Simon Haggett
  Cc: Li Yang-R58472; Felipe Balbi; Greg Kroah-Hartman; linux-
  u...@vger.kernel.org; linuxppc-dev@lists.ozlabs.org; linux-
  ker...@vger.kernel.org; Laurent Pinchart
  Subject: Re: [PATCH 1/1] usb: gadget: Don't attempt to dequeue requests
  for a disabled USB endpoint on Freescale hardware
  
  Hi,
  
  On Fri, Oct 19, 2012 at 06:19:26PM +0100, Simon Haggett wrote:
   Some gadget drivers may attempt to dequeue requests for an endpoint
   that has already been disabled. For example, in the UVC gadget driver,
   uvc_function_set_alt() will call usb_ep_disable() when alt setting 0
   is selected. When the userspace application subsequently issues the
   VIDIOC_STREAMOFF ioctl, uvc_video_enable() invokes usb_ep_dequeue() to
  ensure that all requests have been cancelled.
  
  bug is on uvc gadget, then. Laurent ?
  
  Also, fsl should be removed from the tree, I'm trying to persuade iMX
  folks to use drivers/usb/chipidea instead.
 
 Besides the iMX usage, the driver is also being used by many Freescale
 PowerPC/Coldfire SoCs.  I agree that it's ideal to move to a common
 driver.  But it is a large task to make the chipidea driver works for
 all the hardware that fsl_udc had supported and been tested on.

I understand that, but we just can't keep so many duplicated drivers in
mainline. chipidea udc had at least 3 different implementations. Now
it's the time to combine all of those and stick to a single driver.

Just make a plan to slowly move towards chipidea in the upcoming few
merge windows. I can continue to take in bugfixes for fsl_udc, but only
if I see that you guys are working towards merging with chipidea driver.

-- 
balbi


signature.asc
Description: Digital signature
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

  1   2   >