Re: [PATCH 3/3] ARM: dts: Fix frequency scaling on Gumstix Pepper.

2015-07-14 Thread Tony Lindgren
* Ash Charles ashchar...@gmail.com [150609 08:47]:
 This works well for me--cpufreq seems much happier.
 
 Tested-by: Ash Charles ashchar...@gmail.com
 
 On Thu, Jun 4, 2015 at 11:08 AM, Arun Bharadwaj a...@gumstix.com wrote:
  The device tree for Gumstix Pepper has DCDC2 and
  DCDC3 correctly labelled but the upper limit values
  are wrong. The confusion is due to the hardware
  quirk where the DCDC2 and DCDC3 wires are flipped
  in Pepper.
 
  Signed-off-by: Arun Bharadwaj a...@gumstix.com

Applying into omap-for-v4.2/fixes thanks.

Tony
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/3] ARM: dts: Correct audio input route set mic bias

2015-07-14 Thread Tony Lindgren
* Arun Bharadwaj a...@gumstix.com [150604 11:10]:
 From: Adam YH Lee adam.yh@gmail.com
 
 Audio-in was incorrectly routed to Line In. It should be Mic3L as per
 schematic.
 
 Using mic-bias voltage at 2.0v (0x1) does not work for some reason. There
 is no voltage seen on micbias (R127). Mic-bias voltage of 2.5v (0x2) works.
 I see voltage of 2.475v across GND and micbias.
 
 With these changes, I can record audio with a pair of proliferate TRRS 
 earbuds.
 
 Signed-off-by: Ash Charles ashchar...@gmail.com

Can you please repost this with after checking From
and Signed-off-by?

Regards,

Tony

 ---
  arch/arm/boot/dts/am335x-pepper.dts | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
 
 diff --git a/arch/arm/boot/dts/am335x-pepper.dts 
 b/arch/arm/boot/dts/am335x-pepper.dts
 index 0d35ab6..473d8ee 100644
 --- a/arch/arm/boot/dts/am335x-pepper.dts
 +++ b/arch/arm/boot/dts/am335x-pepper.dts
 @@ -74,6 +74,7 @@
   audio_codec: tlv320aic3106@1b {
   compatible = ti,tlv320aic3106;
   reg = 0x1b;
 + ai3x-micbias-vg = 0x2;
   };
  
   accel: lis331dlh@1d {
 @@ -153,7 +154,7 @@
   ti,audio-routing =
   Headphone Jack,   HPLOUT,
   Headphone Jack,   HPROUT,
 - LINE1L,   Line In;
 + MIC3L,Mic3L Switch;
  };
  
  mcasp0 {
 -- 
 2.1.4
 
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: linux 4.2-rc1 broken Nokia N900

2015-07-14 Thread Tony Lindgren
* Pali Rohár pali.ro...@gmail.com [150714 00:16]:
 On Monday 13 July 2015 17:36:07 Michael Welling wrote:
  On Tue, Jul 14, 2015 at 12:02:44AM +0200, Pali Rohár wrote:
   I think nothing special. I just call:
   
   export ARCH=arm
   export CROSS_COMPILE=arm-linux-gnueabi-
   make rx51_defconfig
   rm -f arch/arm/boot/zImage
   make -j12 zImage modules omap3-n900.dtb CONFIG_DEBUG_SECTION_MISMATCH=y
   cat arch/arm/boot/zImage arch/arm/boot/dts/omap3-n900.dtb  
   arch/arm/boot/zImage.new
   mv arch/arm/boot/zImage.new arch/arm/boot/zImage
  
  
  Where are you getting rx51_defconfig from?
  
  This does not appear to be in the kernel source any longer.
  
  Can you try the above with omap2plus_defconfig?
   
 
 It is in my linux-n900 repository: https://github.com/pali/linux-n900
 Repository contains more n900 specific patches but SPI code is unpatched
 
 https://github.com/pali/linux-n900/blob/HEAD/arch/arm/configs/rx51_defconfig
 
 Later in week I can try to compile also with omap2plus_defconfig...
 But in my opinion kernel should not crash with different configuration.

After doing git bisect on it, looks like the breaking commit is
ddcad7e9068e (spi: omap2-mcspi: Fix native cs with new set_cs).

That alone does not seem to revert, have not debugged further.

Regards,

Tony
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] arm: dts: dra7: arch timer sits in always-on power domain

2015-07-14 Thread Tony Lindgren
* Tony Lindgren t...@atomide.com [150713 21:52]:
 * Nishanth Menon n...@ti.com [150713 13:56]:
  On Mon, Jul 13, 2015 at 3:41 PM, Felipe Balbi ba...@ti.com wrote:
   According to DRA7x TRM section 4.3.5 Realtime Counter (Master Counter),
   the realtime counter sits in the Wakeup Always-On Power domain.
   Furthermore, the counter will automatically switch the 32K clock source
   when MPU goes into standby and automatically switch back to SYS_CLK or
   ABE_LP when MPU goes out of standby.
 
 That's good to hear. Is that the case also for 5432?

Adding into omap-for-v4.2/fixes, if 5432 supports it too it
can be patched separately.

Regards,

Tony
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/5] omap3: overo: Update LCD panel names

2015-07-14 Thread Tony Lindgren
* Ash Charles ashchar...@gmail.com [150612 13:39]:
 From: Adam YH Lee adam.yh@gmail.com
 
 For Gumstix Overo COMs, the u-boot bootloader typically passes an
 argument specifying the default display via the omapdss.def_disp
 parameter.  When a default display is specified, DSS2 tries to match
 this name with either the device tree label (e.g. label=dvi) or,
 failing this, the device tree alias (e.g. label=display0). Update the
 panel names for the 'lcd43' and 'lcd35' displays in the device tree
 such that they match the names passed by u-boot.

Applying this one into omap-for-v4.2/fixes thanks.

Tony
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2] ARM: dts: configure regulators for Gumstix Pepper

2015-07-14 Thread Tony Lindgren
* Adam YH Lee adam.yh@gmail.com [150709 15:40]:
 Boot process is halting in midway because some of the necessary voltage
 regulators are deemed unused and subsequently powered off, leading to
 a completely unresponsive system.
 
 Most of the device nodes had correct voltage regulator attachments.
 Yet these nodes had to set stricter enforcement on them through
 'regulator-boot-on' and 'regulator-always-on' to function correctly.
 
 The consumers of the regulators this commit affect are the followings:
 
   DCDC1: vdd_1v8 system supply, USB-PHY, and ADC
   DCDC2: Core domain
   DCDC3: MPU core domain
LDO1: RTC
LDO2: 3v3 IO domain
LDO3: USB-PHY; not a boot-time requirement
LDO4: LCD [16:23]
 
 All but LDO3 need to be always-on for the system to be functional.
 
 Additionally regulator-name properties have been added for the kernel to
 display the name from the schematic. This will improve diagnostics.

Thanks for updating the description, applying this into
omap-for-v4.2/fixes.

Tony
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] ARM: OMAP2+: Add HAVE_ARM_SCU for AM43XX

2015-07-14 Thread Tony Lindgren
* Dave Gerlach d-gerl...@ti.com [150710 14:08]:
 CONFIG_HAVE_ARM_SCU only gets selected if CONFIG_SMP is selected in an OMAP
 system, however AM43XX needs this option regardless of CONFIG_SMP and also
 for an AM43XX only build as it is important for controlling power in the SoC.
 Without this we cannot suspend the CPU for SoC suspend or cpuidle. The
 ARM Cortex A9 needs SCU CPU Power Status bits to be set to off mode in order
 for the PRCM to transition the MPU to low power modes.
 
 Signed-off-by: Dave Gerlach d-gerl...@ti.com
 ---
  arch/arm/mach-omap2/Kconfig | 1 +
  1 file changed, 1 insertion(+)
 
 diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
 index ecc04ff..4a023e8 100644
 --- a/arch/arm/mach-omap2/Kconfig
 +++ b/arch/arm/mach-omap2/Kconfig
 @@ -60,6 +60,7 @@ config SOC_AM43XX
   select ARM_GIC
   select MACH_OMAP_GENERIC
   select MIGHT_HAVE_CACHE_L2X0
 + select HAVE_ARM_SCU
  
  config SOC_DRA7XX
   bool TI DRA7XX

Applying into omap-for-v4.2/fixes thanks.

Tony
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: linux 4.2-rc1 broken Nokia N900

2015-07-14 Thread Pali Rohár
On Monday 13 July 2015 17:36:07 Michael Welling wrote:
 On Tue, Jul 14, 2015 at 12:02:44AM +0200, Pali Rohár wrote:
  I think nothing special. I just call:
  
  export ARCH=arm
  export CROSS_COMPILE=arm-linux-gnueabi-
  make rx51_defconfig
  rm -f arch/arm/boot/zImage
  make -j12 zImage modules omap3-n900.dtb CONFIG_DEBUG_SECTION_MISMATCH=y
  cat arch/arm/boot/zImage arch/arm/boot/dts/omap3-n900.dtb  
  arch/arm/boot/zImage.new
  mv arch/arm/boot/zImage.new arch/arm/boot/zImage
 
 
 Where are you getting rx51_defconfig from?
 
 This does not appear to be in the kernel source any longer.
 
 Can you try the above with omap2plus_defconfig?
  

It is in my linux-n900 repository: https://github.com/pali/linux-n900
Repository contains more n900 specific patches but SPI code is unpatched

https://github.com/pali/linux-n900/blob/HEAD/arch/arm/configs/rx51_defconfig

Later in week I can try to compile also with omap2plus_defconfig...
But in my opinion kernel should not crash with different configuration.

-- 
Pali Rohár
pali.ro...@gmail.com
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 26/48] usb: gadget: pch_ud: add ep capabilities support

2015-07-14 Thread Robert Baldyga
Convert endpoint configuration to new capabilities model.

Signed-off-by: Robert Baldyga r.bald...@samsung.com
---
 drivers/usb/gadget/udc/pch_udc.c | 14 --
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/gadget/udc/pch_udc.c b/drivers/usb/gadget/udc/pch_udc.c
index 613547f..cc8fb3c 100644
--- a/drivers/usb/gadget/udc/pch_udc.c
+++ b/drivers/usb/gadget/udc/pch_udc.c
@@ -2895,11 +2895,21 @@ static void pch_udc_pcd_reinit(struct pch_udc_dev *dev)
ep-in = ~i  1;
ep-ep.name = ep_string[i];
ep-ep.ops = pch_udc_ep_ops;
-   if (ep-in)
+   if (ep-in) {
ep-offset_addr = ep-num * UDC_EP_REG_SHIFT;
-   else
+   ep-ep.caps.dir_in = true;
+   } else {
ep-offset_addr = (UDC_EPINT_OUT_SHIFT + ep-num) *
  UDC_EP_REG_SHIFT;
+   ep-ep.caps.dir_out = true;
+   }
+   if (i == UDC_EP0IN_IDX || i == UDC_EP0OUT_IDX) {
+   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;
+   }
/* need to set ep-ep.maxpacket and set Default Configuration?*/
usb_ep_set_maxpacket_limit(ep-ep, UDC_BULK_MAX_PKT_SIZE);
list_add_tail(ep-ep.ep_list, dev-gadget.ep_list);
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 21/48] usb: gadget: mv_u3d_core: add ep capabilities support

2015-07-14 Thread Robert Baldyga
Convert endpoint configuration to new capabilities model.

Signed-off-by: Robert Baldyga r.bald...@samsung.com
---
 drivers/usb/gadget/udc/mv_u3d_core.c | 9 +
 1 file changed, 9 insertions(+)

diff --git a/drivers/usb/gadget/udc/mv_u3d_core.c 
b/drivers/usb/gadget/udc/mv_u3d_core.c
index ea35a24..4c48969 100644
--- a/drivers/usb/gadget/udc/mv_u3d_core.c
+++ b/drivers/usb/gadget/udc/mv_u3d_core.c
@@ -1324,6 +1324,9 @@ static int mv_u3d_eps_init(struct mv_u3d *u3d)
ep-ep.ops = mv_u3d_ep_ops;
ep-wedge = 0;
usb_ep_set_maxpacket_limit(ep-ep, MV_U3D_EP0_MAX_PKT_SIZE);
+   ep-ep.caps.type_control = true;
+   ep-ep.caps.dir_in = true;
+   ep-ep.caps.dir_out = true;
ep-ep_num = 0;
ep-ep.desc = mv_u3d_ep0_desc;
INIT_LIST_HEAD(ep-queue);
@@ -1339,14 +1342,20 @@ static int mv_u3d_eps_init(struct mv_u3d *u3d)
if (i  1) {
snprintf(name, sizeof(name), ep%din, i  1);
ep-direction = MV_U3D_EP_DIR_IN;
+   ep-ep.caps.dir_in = true;
} else {
snprintf(name, sizeof(name), ep%dout, i  1);
ep-direction = MV_U3D_EP_DIR_OUT;
+   ep-ep.caps.dir_out = true;
}
ep-u3d = u3d;
strncpy(ep-name, name, sizeof(ep-name));
ep-ep.name = ep-name;
 
+   ep-ep.caps.type_iso = true;
+   ep-ep.caps.type_bulk = true;
+   ep-ep.caps.type_int = true;
+
ep-ep.ops = mv_u3d_ep_ops;
usb_ep_set_maxpacket_limit(ep-ep, (unsigned short) ~0);
ep-ep_num = i / 2;
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 22/48] usb: gadget: mv_udc_core: add ep capabilities support

2015-07-14 Thread Robert Baldyga
Convert endpoint configuration to new capabilities model.

Signed-off-by: Robert Baldyga r.bald...@samsung.com
---
 drivers/usb/gadget/udc/mv_udc_core.c | 9 +
 1 file changed, 9 insertions(+)

diff --git a/drivers/usb/gadget/udc/mv_udc_core.c 
b/drivers/usb/gadget/udc/mv_udc_core.c
index d32160d..306a7ff 100644
--- a/drivers/usb/gadget/udc/mv_udc_core.c
+++ b/drivers/usb/gadget/udc/mv_udc_core.c
@@ -1257,6 +1257,9 @@ static int eps_init(struct mv_udc *udc)
ep-wedge = 0;
ep-stopped = 0;
usb_ep_set_maxpacket_limit(ep-ep, EP0_MAX_PKT_SIZE);
+   ep-ep.caps.type_control = true;
+   ep-ep.caps.dir_in = true;
+   ep-ep.caps.dir_out = true;
ep-ep_num = 0;
ep-ep.desc = mv_ep0_desc;
INIT_LIST_HEAD(ep-queue);
@@ -1269,14 +1272,20 @@ static int eps_init(struct mv_udc *udc)
if (i % 2) {
snprintf(name, sizeof(name), ep%din, i / 2);
ep-direction = EP_DIR_IN;
+   ep-ep.caps.dir_in = true;
} else {
snprintf(name, sizeof(name), ep%dout, i / 2);
ep-direction = EP_DIR_OUT;
+   ep-ep.caps.dir_out = true;
}
ep-udc = udc;
strncpy(ep-name, name, sizeof(ep-name));
ep-ep.name = ep-name;
 
+   ep-ep.caps.type_iso = true;
+   ep-ep.caps.type_bulk = true;
+   ep-ep.caps.type_int = true;
+
ep-ep.ops = mv_ep_ops;
ep-stopped = 0;
usb_ep_set_maxpacket_limit(ep-ep, (unsigned short) ~0);
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 24/48] usb: gadget: net2280: add ep capabilities support

2015-07-14 Thread Robert Baldyga
Convert endpoint configuration to new capabilities model.

Signed-off-by: Robert Baldyga r.bald...@samsung.com
---
 drivers/usb/gadget/udc/net2280.c | 50 ++--
 1 file changed, 38 insertions(+), 12 deletions(-)

diff --git a/drivers/usb/gadget/udc/net2280.c b/drivers/usb/gadget/udc/net2280.c
index 2bee912..0295cf7 100644
--- a/drivers/usb/gadget/udc/net2280.c
+++ b/drivers/usb/gadget/udc/net2280.c
@@ -74,19 +74,41 @@ static const char driver_desc[] = DRIVER_DESC;
 
 static const u32 ep_bit[9] = { 0, 17, 2, 19, 4, 1, 18, 3, 20 };
 static const char ep0name[] = ep0;
-static const char *const ep_name[] = {
-   ep0name,
-   ep-a, ep-b, ep-c, ep-d,
-   ep-e, ep-f, ep-g, ep-h,
-};
 
-/* Endpoint names for usb3380 advance mode */
-static const char *const ep_name_adv[] = {
-   ep0name,
-   ep1in, ep2out, ep3in, ep4out,
-   ep1out, ep2in, ep3out, ep4in,
+#define EP_INFO(_name, _type, _dir) \
+   { \
+   .name = _name, \
+   .caps = USB_EP_CAPS(USB_EP_CAPS_TYPE_ ## _type, \
+   USB_EP_CAPS_DIR_ ## _dir), \
+   }
+
+static const struct {
+   const char *name;
+   const struct usb_ep_caps caps;
+} ep_info_dft[] = { /* Default endpoint configuration */
+   EP_INFO(ep0name, CONTROL, ALL),
+   EP_INFO(ep-a, ALL,ALL),
+   EP_INFO(ep-b, ALL,ALL),
+   EP_INFO(ep-c, ALL,ALL),
+   EP_INFO(ep-d, ALL,ALL),
+   EP_INFO(ep-e, ALL,ALL),
+   EP_INFO(ep-f, ALL,ALL),
+   EP_INFO(ep-g, ALL,ALL),
+   EP_INFO(ep-h, ALL,ALL),
+}, ep_info_adv[] = { /* Endpoints for usb3380 advance mode */
+   EP_INFO(ep0name, CONTROL, ALL),
+   EP_INFO(ep1in,ALL,IN),
+   EP_INFO(ep2out,   ALL,OUT),
+   EP_INFO(ep3in,ALL,IN),
+   EP_INFO(ep4out,   ALL,OUT),
+   EP_INFO(ep1out,   ALL,OUT),
+   EP_INFO(ep2in,ALL,IN),
+   EP_INFO(ep3out,   ALL,OUT),
+   EP_INFO(ep4in,ALL,IN),
 };
 
+#undef EP_INFO
+
 /* mode 0 == ep-{a,b,c,d} 1K fifo each
  * mode 1 == ep-{a,b} 2K fifo each, ep-{c,d} unavailable
  * mode 2 == ep-a 2K fifo, ep-{b,c} 1K each, ep-d unavailable
@@ -2055,7 +2077,8 @@ static void usb_reinit_228x(struct net2280 *dev)
for (tmp = 0; tmp  7; tmp++) {
struct net2280_ep   *ep = dev-ep[tmp];
 
-   ep-ep.name = ep_name[tmp];
+   ep-ep.name = ep_info_dft[tmp].name;
+   ep-ep.caps = ep_info_dft[tmp].caps;
ep-dev = dev;
ep-num = tmp;
 
@@ -2095,7 +2118,10 @@ static void usb_reinit_338x(struct net2280 *dev)
for (i = 0; i  dev-n_ep; i++) {
struct net2280_ep *ep = dev-ep[i];
 
-   ep-ep.name = dev-enhanced_mode ? ep_name_adv[i] : ep_name[i];
+   ep-ep.name = dev-enhanced_mode ? ep_info_adv[i].name :
+  ep_info_dft[i].name;
+   ep-ep.caps = dev-enhanced_mode ? ep_info_adv[i].caps :
+  ep_info_dft[i].caps;
ep-dev = dev;
ep-num = i;
 
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 28/48] usb: gadget: pxa27x_udc: add ep capabilities support

2015-07-14 Thread Robert Baldyga
Convert endpoint configuration to new capabilities model.

Signed-off-by: Robert Baldyga r.bald...@samsung.com
---
 drivers/usb/gadget/udc/pxa27x_udc.h | 33 ++---
 1 file changed, 18 insertions(+), 15 deletions(-)

diff --git a/drivers/usb/gadget/udc/pxa27x_udc.h 
b/drivers/usb/gadget/udc/pxa27x_udc.h
index 11e1423..ded058c 100644
--- a/drivers/usb/gadget/udc/pxa27x_udc.h
+++ b/drivers/usb/gadget/udc/pxa27x_udc.h
@@ -234,25 +234,28 @@
 /*
  * Endpoint definition helpers
  */
-#define USB_EP_DEF(addr, bname, dir, type, maxpkt) \
-{ .usb_ep = { .name = bname, .ops = pxa_ep_ops, .maxpacket = maxpkt, }, \
+#define USB_EP_DEF(addr, bname, dir, type, maxpkt, ctype, cdir) \
+{ .usb_ep = {  .name = bname, .ops = pxa_ep_ops, .maxpacket = maxpkt, \
+   .caps = USB_EP_CAPS(USB_EP_CAPS_TYPE_ ## ctype, \
+   USB_EP_CAPS_DIR_ ## cdir), }, \
   .desc = {.bEndpointAddress = addr | (dir ? USB_DIR_IN : 0), \
-   .bmAttributes = type, \
+   .bmAttributes = USB_ENDPOINT_XFER_ ## type, \
.wMaxPacketSize = maxpkt, }, \
   .dev = memory \
 }
-#define USB_EP_BULK(addr, bname, dir) \
-  USB_EP_DEF(addr, bname, dir, USB_ENDPOINT_XFER_BULK, BULK_FIFO_SIZE)
-#define USB_EP_ISO(addr, bname, dir) \
-  USB_EP_DEF(addr, bname, dir, USB_ENDPOINT_XFER_ISOC, ISO_FIFO_SIZE)
-#define USB_EP_INT(addr, bname, dir) \
-  USB_EP_DEF(addr, bname, dir, USB_ENDPOINT_XFER_INT, INT_FIFO_SIZE)
-#define USB_EP_IN_BULK(n)  USB_EP_BULK(n, ep #n in-bulk, 1)
-#define USB_EP_OUT_BULK(n) USB_EP_BULK(n, ep #n out-bulk, 0)
-#define USB_EP_IN_ISO(n)   USB_EP_ISO(n,  ep #n in-iso, 1)
-#define USB_EP_OUT_ISO(n)  USB_EP_ISO(n,  ep #n out-iso, 0)
-#define USB_EP_IN_INT(n)   USB_EP_INT(n,  ep #n in-int, 1)
-#define USB_EP_CTRLUSB_EP_DEF(0,  ep0, 0, 0, EP0_FIFO_SIZE)
+#define USB_EP_BULK(addr, bname, dir, cdir) \
+   USB_EP_DEF(addr, bname, dir, BULK, BULK_FIFO_SIZE, BULK, cdir)
+#define USB_EP_ISO(addr, bname, dir, cdir) \
+   USB_EP_DEF(addr, bname, dir, ISOC, ISO_FIFO_SIZE, ISO, cdir)
+#define USB_EP_INT(addr, bname, dir, cdir) \
+   USB_EP_DEF(addr, bname, dir, INT, INT_FIFO_SIZE, INT, cdir)
+#define USB_EP_IN_BULK(n)  USB_EP_BULK(n, ep #n in-bulk, 1, IN)
+#define USB_EP_OUT_BULK(n) USB_EP_BULK(n, ep #n out-bulk, 0, OUT)
+#define USB_EP_IN_ISO(n)   USB_EP_ISO(n,  ep #n in-iso, 1, IN)
+#define USB_EP_OUT_ISO(n)  USB_EP_ISO(n,  ep #n out-iso, 0, OUT)
+#define USB_EP_IN_INT(n)   USB_EP_INT(n,  ep #n in-int, 1, IN)
+#define USB_EP_CTRLUSB_EP_DEF(0,  ep0, 0, CONTROL, \
+  EP0_FIFO_SIZE, CONTROL, ALL)
 
 #define PXA_EP_DEF(_idx, _addr, dir, _type, maxpkt, _config, iface, altset) \
 { \
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 29/48] usb: gadget: r8a66597-udc: add ep capabilities support

2015-07-14 Thread Robert Baldyga
Convert endpoint configuration to new capabilities model.

Signed-off-by: Robert Baldyga r.bald...@samsung.com
---
 drivers/usb/gadget/udc/r8a66597-udc.c | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/drivers/usb/gadget/udc/r8a66597-udc.c 
b/drivers/usb/gadget/udc/r8a66597-udc.c
index 0293f71..baa0609 100644
--- a/drivers/usb/gadget/udc/r8a66597-udc.c
+++ b/drivers/usb/gadget/udc/r8a66597-udc.c
@@ -1935,6 +1935,16 @@ static int r8a66597_probe(struct platform_device *pdev)
ep-ep.name = r8a66597_ep_name[i];
ep-ep.ops = r8a66597_ep_ops;
usb_ep_set_maxpacket_limit(ep-ep, 512);
+
+   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;
}
usb_ep_set_maxpacket_limit(r8a66597-ep[0].ep, 64);
r8a66597-ep[0].pipenum = 0;
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 18/48] usb: gadget: gr_udc: add ep capabilities support

2015-07-14 Thread Robert Baldyga
Convert endpoint configuration to new capabilities model.

Signed-off-by: Robert Baldyga r.bald...@samsung.com
---
 drivers/usb/gadget/udc/gr_udc.c | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/drivers/usb/gadget/udc/gr_udc.c b/drivers/usb/gadget/udc/gr_udc.c
index c886887..8aa2593 100644
--- a/drivers/usb/gadget/udc/gr_udc.c
+++ b/drivers/usb/gadget/udc/gr_udc.c
@@ -2018,12 +2018,23 @@ static int gr_ep_init(struct gr_udc *dev, int num, int 
is_in, u32 maxplimit)
 
usb_ep_set_maxpacket_limit(ep-ep, MAX_CTRL_PL_SIZE);
ep-bytes_per_buffer = MAX_CTRL_PL_SIZE;
+
+   ep-ep.caps.type_control = true;
} else {
usb_ep_set_maxpacket_limit(ep-ep, (u16)maxplimit);
list_add_tail(ep-ep.ep_list, dev-gadget.ep_list);
+
+   ep-ep.caps.type_iso = true;
+   ep-ep.caps.type_bulk = true;
+   ep-ep.caps.type_int = true;
}
list_add_tail(ep-ep_list, dev-ep_list);
 
+   if (is_in)
+   ep-ep.caps.dir_in = true;
+   else
+   ep-ep.caps.dir_out = true;
+
ep-tailbuf = dma_alloc_coherent(dev-dev, ep-ep.maxpacket_limit,
 ep-tailbuf_paddr, GFP_ATOMIC);
if (!ep-tailbuf)
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [GIT PULL] clk: ti: clock driver code migration to drivers

2015-07-14 Thread Tony Lindgren
* Tero Kristo t-kri...@ti.com [150714 01:56]:
 
 This pull request contains the TI clock driver set to move the clock
 implementations under clock driver. Some small portions of the clock driver
 code still remain under mach-omap2 after this, it should be decided whether
 this code is now obsolete and should be deleted or should someone try to fix
 it.

Hmm care to clarify what is obsolete or broken after this series?

And I take it's not obsolete or broken because of this series? :)

Also, I just gave this branch a quick boot test and it seems to
behave for me.

Regards,

Tony
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 20/48] usb: gadget: m66592-udc: add ep capabilities support

2015-07-14 Thread Robert Baldyga
Convert endpoint configuration to new capabilities model.

Signed-off-by: Robert Baldyga r.bald...@samsung.com
---
 drivers/usb/gadget/udc/m66592-udc.c | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/drivers/usb/gadget/udc/m66592-udc.c 
b/drivers/usb/gadget/udc/m66592-udc.c
index 309706f..e404553 100644
--- a/drivers/usb/gadget/udc/m66592-udc.c
+++ b/drivers/usb/gadget/udc/m66592-udc.c
@@ -1644,6 +1644,17 @@ static int m66592_probe(struct platform_device *pdev)
ep-ep.name = m66592_ep_name[i];
ep-ep.ops = m66592_ep_ops;
usb_ep_set_maxpacket_limit(ep-ep, 512);
+
+   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;
}
usb_ep_set_maxpacket_limit(m66592-ep[0].ep, 64);
m66592-ep[0].pipenum = 0;
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 01/48] usb: gadget: encapsulate endpoint claiming mechanism

2015-07-14 Thread Robert Baldyga
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 becouse 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 doesn't need to perform
any additional actions to mark endpoint obtained from autoconfig as claimed.

Signed-off-by: Robert Baldyga r.bald...@samsung.com
---
 drivers/usb/gadget/epautoconf.c | 11 ++-
 include/linux/usb/gadget.h  |  1 +
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/usb/gadget/epautoconf.c b/drivers/usb/gadget/epautoconf.c
index 919cdfd..8e00ca7 100644
--- a/drivers/usb/gadget/epautoconf.c
+++ b/drivers/usb/gadget/epautoconf.c
@@ -53,7 +53,7 @@ ep_matches (
int num_req_streams = 0;
 
/* endpoint already claimed? */
-   if (NULL != ep-driver_data)
+   if (ep-claimed)
return 0;
 
/* only support ep0 for portable CONTROL traffic */
@@ -240,7 +240,7 @@ find_ep (struct usb_gadget *gadget, const char *name)
  * updated with the assigned number of streams if it is
  * different from the original value. To prevent the endpoint
  * from being returned by a later autoconfig call, claim it by
- * assigning ep-driver_data to some non-null value.
+ * assigning ep-claimed to true.
  *
  * On failure, this returns a null endpoint descriptor.
  */
@@ -323,6 +323,7 @@ struct usb_ep *usb_ep_autoconfig_ss(
 found_ep:
ep-desc = NULL;
ep-comp_desc = NULL;
+   ep-claimed = true;
return ep;
 }
 EXPORT_SYMBOL_GPL(usb_ep_autoconfig_ss);
@@ -354,7 +355,7 @@ EXPORT_SYMBOL_GPL(usb_ep_autoconfig_ss);
  * descriptor bEndpointAddress.  For bulk endpoints, the wMaxPacket value
  * is initialized as if the endpoint were used at full speed.  To prevent
  * the endpoint from being returned by a later autoconfig call, claim it
- * by assigning ep-driver_data to some non-null value.
+ * by assigning ep-claimed to true.
  *
  * On failure, this returns a null endpoint descriptor.
  */
@@ -373,7 +374,7 @@ EXPORT_SYMBOL_GPL(usb_ep_autoconfig);
  *
  * Use this for devices where one configuration may need to assign
  * endpoint resources very differently from the next one.  It clears
- * state such as ep-driver_data and the record of assigned endpoints
+ * state such as ep-claimed and the record of assigned endpoints
  * used by usb_ep_autoconfig().
  */
 void usb_ep_autoconfig_reset (struct usb_gadget *gadget)
@@ -381,7 +382,7 @@ void usb_ep_autoconfig_reset (struct usb_gadget *gadget)
struct usb_ep   *ep;
 
list_for_each_entry (ep, gadget-ep_list, ep_list) {
-   ep-driver_data = NULL;
+   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 4f3dfb7..fcb0a4e 100644
--- a/include/linux/usb/gadget.h
+++ b/include/linux/usb/gadget.h
@@ -173,6 +173,7 @@ struct usb_ep {
const char  *name;
const struct usb_ep_ops *ops;
struct list_headep_list;
+   boolclaimed;
unsignedmaxpacket:16;
unsignedmaxpacket_limit:16;
unsignedmax_streams:16;
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 03/48] usb: gadget: add endpoint capabilities helper macros

2015-07-14 Thread Robert Baldyga
Add macros useful while initializing array of endpoint capabilities
structures. These macros makes structure initialization more compact
to decrease number of code lines and increase readability of code.

Signed-off-by: Robert Baldyga r.bald...@samsung.com
---
 include/linux/usb/gadget.h | 20 
 1 file changed, 20 insertions(+)

diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
index 6f3e0fb..e6cbc25 100644
--- a/include/linux/usb/gadget.h
+++ b/include/linux/usb/gadget.h
@@ -158,6 +158,26 @@ struct usb_ep_caps {
unsigned dir_out:1;
 };
 
+#define USB_EP_CAPS_TYPE_CONTROL 0x01
+#define USB_EP_CAPS_TYPE_ISO 0x02
+#define USB_EP_CAPS_TYPE_BULK0x04
+#define USB_EP_CAPS_TYPE_INT 0x08
+#define USB_EP_CAPS_TYPE_ALL \
+   (USB_EP_CAPS_TYPE_ISO | USB_EP_CAPS_TYPE_BULK | USB_EP_CAPS_TYPE_INT)
+#define USB_EP_CAPS_DIR_IN   0x01
+#define USB_EP_CAPS_DIR_OUT  0x02
+#define USB_EP_CAPS_DIR_ALL  (USB_EP_CAPS_DIR_IN | USB_EP_CAPS_DIR_OUT)
+
+#define USB_EP_CAPS(_type, _dir) \
+   { \
+   .type_control = !!(_type  USB_EP_CAPS_TYPE_CONTROL), \
+   .type_iso = !!(_type  USB_EP_CAPS_TYPE_ISO), \
+   .type_bulk = !!(_type  USB_EP_CAPS_TYPE_BULK), \
+   .type_int = !!(_type  USB_EP_CAPS_TYPE_INT), \
+   .dir_in = !!(_dir  USB_EP_CAPS_DIR_IN), \
+   .dir_out = !!(_dir  USB_EP_CAPS_DIR_OUT), \
+   }
+
 /**
  * struct usb_ep - device side representation of USB endpoint
  * @name:identifier for the endpoint, such as ep-a or ep9in-bulk
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 02/48] usb: gadget: add endpoint capabilities flags

2015-07-14 Thread Robert Baldyga
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 fcb0a4e..6f3e0fb 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 - endpoint capabilities description
+ * @type_control:Endpoint supports control type (reserved for ep0).
+ * @type_iso:Endpoint supports isochronous transfers.
+ * @type_bulk:Endpoint supports bulk transfers.
+ * @type_int:Endpoint supports interrupt transfers.
+ * @dir_in:Endpoint supports IN direction.
+ * @dir_out:Endpoint supports OUT direction.
+ */
+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;
+};
+
+/**
  * struct usb_ep - device side representation of USB endpoint
  * @name:identifier for the endpoint, such as ep-a or ep9in-bulk
  * @ops: Function pointers used to access hardware-specific operations.
  * @ep_list:the gadget's ep_list holds all of its endpoints
+ * @caps:The structure describing types and directions supported by endoint.
  * @maxpacket:The maximum packet size used on this endpoint.  The initial
  * value can sometimes be reduced (hardware allowing), according to
  *  the endpoint descriptor used to configure the endpoint.
@@ -167,12 +186,14 @@ struct usb_ep_ops {
  * gadget-ep_list.  the control endpoint (gadget-ep0) is not in that list,
  * and is accessed only in response to a driver setup() callback.
  */
+
 struct usb_ep {
void*driver_data;
 
const char  *name;
const struct usb_ep_ops *ops;
struct list_headep_list;
+   struct usb_ep_caps  caps;
boolclaimed;
unsignedmaxpacket:16;
unsignedmaxpacket_limit:16;
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v3 5/6] ARM: OMAP4+: PRM: Add AM437x specific data

2015-07-14 Thread Keerthy
The register offsets for some of the PRM Registers are different
hence populating the differing fields.

Tested IO wake up using gpio based SW4 on 1.5A GP evm.

Signed-off-by: Keerthy j-keer...@ti.com
---
 arch/arm/mach-omap2/prm44xx.c | 12 +++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-omap2/prm44xx.c b/arch/arm/mach-omap2/prm44xx.c
index f82d89a..afbbcca 100644
--- a/arch/arm/mach-omap2/prm44xx.c
+++ b/arch/arm/mach-omap2/prm44xx.c
@@ -18,13 +18,14 @@
 #include linux/err.h
 #include linux/io.h
 #include linux/of_irq.h
-
+#include linux/of.h
 
 #include soc.h
 #include iomap.h
 #include common.h
 #include vp.h
 #include prm44xx.h
+#include prcm43xx.h
 #include prm-regbits-44xx.h
 #include prcm44xx.h
 #include prminst44xx.h
@@ -720,6 +721,15 @@ int __init omap44xx_prm_init(const struct 
omap_prcm_init_data *data)
 
omap4_prminst_set_prm_dev_inst(data-device_inst_offset);
 
+   /* Add AM437X specific differences */
+   if (of_device_is_compatible(data-np, ti,am4-prcm)) {
+   omap4_prcm_irq_setup.nr_irqs = 1;
+   omap4_prcm_irq_setup.nr_regs = 1;
+   omap4_prcm_irq_setup.pm_ctrl = AM43XX_PRM_IO_PMCTRL_OFFSET;
+   omap4_prcm_irq_setup.ack = AM43XX_PRM_IRQSTATUS_MPU_OFFSET;
+   omap4_prcm_irq_setup.mask = AM43XX_PRM_IRQENABLE_MPU_OFFSET;
+   }
+
return prm_register(omap44xx_prm_ll_data);
 }
 
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v3 3/6] ARM: dts: AM4372: Add PRCM IRQ entry

2015-07-14 Thread Keerthy
Add PRCM IRQ entry.

Signed-off-by: Keerthy j-keer...@ti.com
---
 arch/arm/boot/dts/am4372.dtsi | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/boot/dts/am4372.dtsi b/arch/arm/boot/dts/am4372.dtsi
index ade28c79..359a3b6 100644
--- a/arch/arm/boot/dts/am4372.dtsi
+++ b/arch/arm/boot/dts/am4372.dtsi
@@ -86,6 +86,7 @@
prcm: prcm@1f {
compatible = ti,am4-prcm;
reg = 0x1f 0x11000;
+   interrupts = GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH;
 
prcm_clocks: clocks {
#address-cells = 1;
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/5] omap3: dts: Add DTS for Gumstix TobiDuo expansion board

2015-07-14 Thread Tony Lindgren
* Ash Charles ashchar...@gmail.com [150612 13:39]:
 The Gumstix Tobi-Duo expansion board [1] can be used with either
 OMAP3 Overo or Overo Storm COMs.  It provides two NICs using LAN9221
 chips.
 It is necessary to duplicate the interface information for the
 second SMSC9221 chip as discussed [2].
 
 [1] https://store.gumstix.com/index.php/products/241/
 [2] http://www.spinics.net/lists/linux-omap/msg115282.html

Applying patches 2 - 5 into omap-for-v4.3/dt thanks.

Tony
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/3] i2c: omap: switch to dev_get_drvdata()

2015-07-14 Thread Wolfram Sang
On Mon, Jul 13, 2015 at 03:38:02PM -0500, Felipe Balbi wrote:
 there's no need to fetch the platform_device
 in order to dereference it back to the dev
 pointer to access drvdata, we can use
 dev_get_drvdata() instead.
 
 Signed-off-by: Felipe Balbi ba...@ti.com

All patches applied to for-next, thanks!

Please send new series as a seperate thread, don't reply to the old one!
You could have collected the tags from last version IMO, it was just a
rebase, no code change.



signature.asc
Description: Digital signature


Re: [PATCH] pinctrl: dra: dt-bindings: Add virtual mode configuration option

2015-07-14 Thread Tony Lindgren
* Nishanth Menon n...@ti.com [150622 08:24]:
 In addition to the regular mux configuration such as mux mode 1,
 2 etc, certain pins of DRA7 require to have virtual mode also
 programmed. This allows for predefined delay characteristics to
 be used by the SoC to meet timing characterstics needed for the
 interface.
 
 Provide easy to use macro to do the same.
 
 It is important to note that the official TI guidelines recommend
 to do as minimal pin reconfiguration beyond the bootloader given
 the design of the hardware involved which can result in substantial
 glitches which may impair functionality of certain peripherals.

Applying into omap-for-v4.3/dt thanks.

Tony
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] i2c: omap: fix bus recovery setup

2015-07-14 Thread Wolfram Sang
On Wed, Jul 08, 2015 at 04:35:27PM +0200, Jan Luebbe wrote:
 At least on the AM335x, enabling OMAP_I2C_SYSTEST_ST_EN is not enough to

Felipe: it seems you did not need this; is this AM335x specific?

 allow direct access to the SCL and SDA pins. In addition to ST_EN, we
 need to set the TMODE to 0b11 (Loop back  SDA/SCL IO mode select).
 Also, as the reset values of SCL_O and SDA_O are 0 (which means drive
 low level), we need to set them to 1 (which means high-impedance) to
 avoid unwanted changes on the pins.
 
 As a precaution, reset all these bits to their default values after
 recovery is complete.
 
 Signed-off-by: Jan Luebbe j...@pengutronix.de
 ---
  drivers/i2c/busses/i2c-omap.c | 11 +++
  1 file changed, 11 insertions(+)
 
 diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
 index d1c22e3fdd14..fc9bf7f30e35 100644
 --- a/drivers/i2c/busses/i2c-omap.c
 +++ b/drivers/i2c/busses/i2c-omap.c
 @@ -1247,7 +1247,14 @@ static void omap_i2c_prepare_recovery(struct 
 i2c_adapter *adap)
   u32 reg;
  
   reg = omap_i2c_read_reg(dev, OMAP_I2C_SYSTEST_REG);
 + /* enable test mode */
   reg |= OMAP_I2C_SYSTEST_ST_EN;
 + /* select SDA/SCL IO mode */
 + reg |= 3  OMAP_I2C_SYSTEST_TMODE_SHIFT;
 + /* set SCL to high-impedance state (reset value is 0) */
 + reg |= OMAP_I2C_SYSTEST_SCL_O;
 + /* set SDA to high-impedance state (reset value is 0) */
 + reg |= OMAP_I2C_SYSTEST_SDA_O;
   omap_i2c_write_reg(dev, OMAP_I2C_SYSTEST_REG, reg);
  }
  
 @@ -1257,7 +1264,11 @@ static void omap_i2c_unprepare_recovery(struct 
 i2c_adapter *adap)
   u32 reg;
  
   reg = omap_i2c_read_reg(dev, OMAP_I2C_SYSTEST_REG);
 + /* restore reset values */
   reg = ~OMAP_I2C_SYSTEST_ST_EN;
 + reg = ~OMAP_I2C_SYSTEST_TMODE_MASK;
 + reg = ~OMAP_I2C_SYSTEST_SCL_O;
 + reg = ~OMAP_I2C_SYSTEST_SDA_O;
   omap_i2c_write_reg(dev, OMAP_I2C_SYSTEST_REG, reg);
  }
  
 -- 
 2.1.4
 


signature.asc
Description: Digital signature


Re: [PATCH v2 47/48] usb: musb: gadget: add musb_match_ep() function

2015-07-14 Thread Sergei Shtylyov

Hello.

On 7/14/2015 12:39 PM, Robert Baldyga wrote:


Add 'match_ep' callback to utilize chip-specific knowledge in endpoint matching
process. Functions does the same that was done by chip-specific code inside
of epautoconf. Now this code can be removed from there to separate generic code
from platform specific logic.



Signed-off-by: Robert Baldyga r.bald...@samsung.com


[...]

diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c
index 043248a..5f1eb35 100644
--- a/drivers/usb/musb/musb_gadget.c
+++ b/drivers/usb/musb/musb_gadget.c
@@ -1684,6 +1684,49 @@ static int musb_gadget_pullup(struct usb_gadget *gadget, 
int is_on)
return 0;
  }

+#ifdef CONFIG_BLACKFIN
+static struct usb_ep *musb_find_ep(struct usb_gadget *g,
+   const char *name)
+{
+   struct usb_ep *ep;
+
+   list_for_each_entry(ep, g-ep_list, ep_list) {
+   if (0 == strcmp(ep-name, name))


   Please make the immediate value the 2nd operand of ==.


+   return ep;
+   }
+
+   return NULL;
+}
+
+static struct usb_ep *match_match_ep(struct usb_gadget *g,
+   struct usb_endpoint_descriptor *desc,
+   struct usb_ss_ep_comp_descriptor *ep_comp)
+{
+   struct usb_ep *ep = NULL;
+   u8 type = usb_endpoint_type(desc);
+
+   if ((USB_ENDPOINT_XFER_BULK == type) ||
+   (USB_ENDPOINT_XFER_ISOC == type)) {


   Likewise.


+   if (USB_DIR_IN  desc-bEndpointAddress)


   The same about .


+   ep = musb_find_ep(g, ep5in);
+   else
+   ep = musb_find_ep(g, ep6out);
+   } else if (USB_ENDPOINT_XFER_INT == type) {


   Likewise.


+   if (USB_DIR_IN  desc-bEndpointAddress)
+   ep = musb_find_ep(g, ep1in);
+   else
+   ep = musb_find_ep(g, ep2out);
+   }


   This string of *if* statements is asking to be *switch* instead.

[...]

WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GIT PULL] clk: ti: clock driver code migration to drivers

2015-07-14 Thread Tero Kristo

The following changes since commit bc0195aad0daa2ad5b0d76cce22b167bc3435590:

  Linux 4.2-rc2 (2015-07-12 15:10:30 -0700)

are available in the git repository at:

  g...@github.com:t-kristo/linux-pm.git for-4.3/ti-clk-move

for you to fetch changes up to 792ee6c3ecf813a4e702bdaceee249c722ab89f5:

  clk: ti: move low-level access and init code under clock driver 
(2015-07-14 09:26:34 +0300)



Hi Mike, Stephen,

This pull request contains the TI clock driver set to move the clock 
implementations under clock driver. Some small portions of the clock 
driver code still remain under mach-omap2 after this, it should be 
decided whether this code is now obsolete and should be deleted or 
should someone try to fix it.


-Tero


Tero Kristo (27):
  ARM: OMAP2+: clock: export driver API to setup/get clock features
  clk: ti: move generic OMAP DPLL implementation under drivers/clk
  clk: ti: move OMAP4+ DPLL implementation under drivers/clk
  clk: ti: move interface clock implementation under drivers/clk
  ARM: OMAP3: dpll3-m2: get rid of obsolete clksel access
  ARM: OMAP2+: clk: remove obsolete clksel support code
  ARM: OMAP2+: clock: remove clock_common_data.c file
  ARM: OMAP36xx: remove clock36xx.c/.h files
  clk: ti: autoidle: move generic autoidle handling code to clock 
driver

  clk: ti: move omap2_clk_enable_init_clocks under clock driver
  ARM: OMAP2+: clock: remove support for legacy mpurate command 
line param
  ARM: OMAP2+: clock: add support for clkdm ops to the low level 
clk ops

  ARM: OMAP2+: clock: add support for specific CM ops to ti_clk_ll_ops
  clk: ti: dpll: move omap3 DPLL functionality to clock driver
  ARM: OMAP3: clock: remove clock3xxx.c file
  ARM: OMAP2+: clock: remove clkdm_control static boolean from code
  clk: ti: dflt: move support for default gate clock to clock driver
  clk: ti: omap2430: move clock support code under clock driver
  clk: ti: clkdm: move clkdm gate clock support code to clock driver
  clk: ti: omap34xx: move omap34xx clock type support code to clock 
driver

  ARM: OMAP4: clock: remove clock44xx.h header
  clk: ti: am3517: move remaining am3517 clock support code to 
clock driver

  clk: ti: move some public definitions to private header
  ARM: OMAP2+: clock: remove dead definitions from the clock header 
file
  clk: ti: remove exported ll_ops struct, instead add an API for 
registration

  ARM: OMAP2+: clock: remove legacy omap2_clk_readl/writel APIs
  clk: ti: move low-level access and init code under clock driver

 arch/arm/mach-omap2/Makefile   |   22 +-
 arch/arm/mach-omap2/clkt34xx_dpll3m2.c |7 +-
 arch/arm/mach-omap2/clkt_clksel.c  |  466 --
 arch/arm/mach-omap2/clkt_iclk.c|   68 --
 arch/arm/mach-omap2/clock.c|  675 
+---

 arch/arm/mach-omap2/clock.h|  205 +-
 arch/arm/mach-omap2/clock2430.c|   57 --
 arch/arm/mach-omap2/clock2xxx.c|   57 --
 arch/arm/mach-omap2/clock34xx.c|  138 
 arch/arm/mach-omap2/clock34xx.h|   18 -
 arch/arm/mach-omap2/clock3517.c|  118 
 arch/arm/mach-omap2/clock3517.h|   14 -
 arch/arm/mach-omap2/clock36xx.c|   69 --
 arch/arm/mach-omap2/clock36xx.h|   13 -
 arch/arm/mach-omap2/clock3xxx.c|  135 
 arch/arm/mach-omap2/clock44xx.h|   20 -
 arch/arm/mach-omap2/clock_common_data.c|  115 
 arch/arm/mach-omap2/io.c   |3 +-
 drivers/clk/ti/Makefile|   17 +-
 drivers/clk/ti/apll.c  |2 +
 drivers/clk/ti/autoidle.c  |  121 +++-
 drivers/clk/ti/clk-2xxx.c  |2 +
 drivers/clk/ti/clk-33xx.c  |2 +
 drivers/clk/ti/clk-3xxx.c  |  244 +++
 drivers/clk/ti/clk-43xx.c  |2 +
 drivers/clk/ti/clk-44xx.c  |2 +
 drivers/clk/ti/clk-54xx.c  |2 +
 drivers/clk/ti/clk-7xx.c   |3 +-
 drivers/clk/ti/clk-816x.c  |2 +
 drivers/clk/ti/clk.c   |  145 -
 drivers/clk/ti/clkt_dflt.c |  316 +
 .../arm/mach-omap2 = drivers/clk/ti}/clkt_dpll.c  |   27 +-
 drivers/clk/ti/clkt_iclk.c |  101 +++
 drivers/clk/ti/clock.h |  113 
 drivers/clk/ti/clockdomain.c   |   78 +++
 {arch/arm/mach-omap2 = 

[PATCH v2 17/48] usb: gadget: goku_udc: add ep capabilities support

2015-07-14 Thread Robert Baldyga
Convert endpoint configuration to new capabilities model.

Signed-off-by: Robert Baldyga r.bald...@samsung.com
---
 drivers/usb/gadget/udc/goku_udc.c | 8 
 1 file changed, 8 insertions(+)

diff --git a/drivers/usb/gadget/udc/goku_udc.c 
b/drivers/usb/gadget/udc/goku_udc.c
index 9e8d842..46b8d14 100644
--- a/drivers/usb/gadget/udc/goku_udc.c
+++ b/drivers/usb/gadget/udc/goku_udc.c
@@ -1257,6 +1257,14 @@ static void udc_reinit (struct goku_udc *dev)
INIT_LIST_HEAD (ep-queue);
 
ep_reset(NULL, ep);
+
+   if (i == 0)
+   ep-ep.caps.type_control = true;
+   else
+   ep-ep.caps.type_bulk = true;
+
+   ep-ep.caps.dir_in = true;
+   ep-ep.caps.dir_out = true;
}
 
dev-ep[0].reg_mode = NULL;
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 19/48] usb: gadget: lpc32xx_udc: add ep capabilities support

2015-07-14 Thread Robert Baldyga
Convert endpoint configuration to new capabilities model.

Signed-off-by: Robert Baldyga r.bald...@samsung.com
---
 drivers/usb/gadget/udc/lpc32xx_udc.c | 32 
 1 file changed, 32 insertions(+)

diff --git a/drivers/usb/gadget/udc/lpc32xx_udc.c 
b/drivers/usb/gadget/udc/lpc32xx_udc.c
index 3b6a785..00b5006 100644
--- a/drivers/usb/gadget/udc/lpc32xx_udc.c
+++ b/drivers/usb/gadget/udc/lpc32xx_udc.c
@@ -2575,6 +2575,8 @@ static const struct lpc32xx_udc controller_template = {
.ep = {
.name   = ep0,
.ops= lpc32xx_ep_ops,
+   .caps   = USB_EP_CAPS(USB_EP_CAPS_TYPE_CONTROL,
+   USB_EP_CAPS_DIR_ALL),
},
.maxpacket  = 64,
.hwep_num_base  = 0,
@@ -2586,6 +2588,8 @@ static const struct lpc32xx_udc controller_template = {
.ep = {
.name   = ep1-int,
.ops= lpc32xx_ep_ops,
+   .caps   = USB_EP_CAPS(USB_EP_CAPS_TYPE_INT,
+   USB_EP_CAPS_DIR_ALL),
},
.maxpacket  = 64,
.hwep_num_base  = 2,
@@ -2597,6 +2601,8 @@ static const struct lpc32xx_udc controller_template = {
.ep = {
.name   = ep2-bulk,
.ops= lpc32xx_ep_ops,
+   .caps   = USB_EP_CAPS(USB_EP_CAPS_TYPE_BULK,
+   USB_EP_CAPS_DIR_ALL),
},
.maxpacket  = 64,
.hwep_num_base  = 4,
@@ -2608,6 +2614,8 @@ static const struct lpc32xx_udc controller_template = {
.ep = {
.name   = ep3-iso,
.ops= lpc32xx_ep_ops,
+   .caps   = USB_EP_CAPS(USB_EP_CAPS_TYPE_ISO,
+   USB_EP_CAPS_DIR_ALL),
},
.maxpacket  = 1023,
.hwep_num_base  = 6,
@@ -2619,6 +2627,8 @@ static const struct lpc32xx_udc controller_template = {
.ep = {
.name   = ep4-int,
.ops= lpc32xx_ep_ops,
+   .caps   = USB_EP_CAPS(USB_EP_CAPS_TYPE_INT,
+   USB_EP_CAPS_DIR_ALL),
},
.maxpacket  = 64,
.hwep_num_base  = 8,
@@ -2630,6 +2640,8 @@ static const struct lpc32xx_udc controller_template = {
.ep = {
.name   = ep5-bulk,
.ops= lpc32xx_ep_ops,
+   .caps   = USB_EP_CAPS(USB_EP_CAPS_TYPE_BULK,
+   USB_EP_CAPS_DIR_ALL),
},
.maxpacket  = 64,
.hwep_num_base  = 10,
@@ -2641,6 +2653,8 @@ static const struct lpc32xx_udc controller_template = {
.ep = {
.name   = ep6-iso,
.ops= lpc32xx_ep_ops,
+   .caps   = USB_EP_CAPS(USB_EP_CAPS_TYPE_ISO,
+   USB_EP_CAPS_DIR_ALL),
},
.maxpacket  = 1023,
.hwep_num_base  = 12,
@@ -2652,6 +2666,8 @@ static const struct lpc32xx_udc controller_template = {
.ep = {
.name   = ep7-int,
.ops= lpc32xx_ep_ops,
+   .caps   = USB_EP_CAPS(USB_EP_CAPS_TYPE_INT,
+   USB_EP_CAPS_DIR_ALL),
},
.maxpacket  = 64,
.hwep_num_base  = 14,
@@ -2663,6 +2679,8 @@ static const struct lpc32xx_udc controller_template = {
.ep = {
.name   = ep8-bulk,
.ops= lpc32xx_ep_ops,
+   .caps   = USB_EP_CAPS(USB_EP_CAPS_TYPE_BULK,
+   USB_EP_CAPS_DIR_ALL),
},
.maxpacket  = 64,
.hwep_num_base  = 16,
@@ -2674,6 +2692,8 @@ static const struct lpc32xx_udc controller_template = {
.ep = {
.name   = ep9-iso,
.ops= lpc32xx_ep_ops,
+   .caps   = USB_EP_CAPS(USB_EP_CAPS_TYPE_ISO,
+   USB_EP_CAPS_DIR_ALL),
},
.maxpacket  = 1023,
.hwep_num_base  = 18,
@@ -2685,6 +2705,8 @@ static const struct lpc32xx_udc controller_template = {
.ep = {
.name   = ep10-int,
.ops= lpc32xx_ep_ops,
+   .caps   = USB_EP_CAPS(USB_EP_CAPS_TYPE_INT,
+   USB_EP_CAPS_DIR_ALL),
},
   

[PATCH v3 4/6] ARM: OMAP: PRM: Remove hardcoding of IRQENABLE_MPU_2 and IRQSTATUS_MPU_2 register offsets

2015-07-14 Thread Keerthy
The register offsets of IRQENABLE_MPU_2 and IRQSTATUS_MPU_2 are hardcoded.
This makes it difficult to reuse the code for SoCs like AM437x that have
a single instance of IRQENABLE_MPU and IRQSTATUS_MPU registers.
Hence handling the case using offset of 4 to accommodate single set of IRQ*
registers generically.

Signed-off-by: Keerthy j-keer...@ti.com
---
 arch/arm/mach-omap2/prm44xx.c | 36 ++--
 1 file changed, 18 insertions(+), 18 deletions(-)

diff --git a/arch/arm/mach-omap2/prm44xx.c b/arch/arm/mach-omap2/prm44xx.c
index 8149e5a..f82d89a 100644
--- a/arch/arm/mach-omap2/prm44xx.c
+++ b/arch/arm/mach-omap2/prm44xx.c
@@ -217,11 +217,11 @@ static inline u32 _read_pending_irq_reg(u16 irqen_offs, 
u16 irqst_offs)
  */
 static void omap44xx_prm_read_pending_irqs(unsigned long *events)
 {
-   events[0] = _read_pending_irq_reg(OMAP4_PRM_IRQENABLE_MPU_OFFSET,
- OMAP4_PRM_IRQSTATUS_MPU_OFFSET);
+   int i;
 
-   events[1] = _read_pending_irq_reg(OMAP4_PRM_IRQENABLE_MPU_2_OFFSET,
- OMAP4_PRM_IRQSTATUS_MPU_2_OFFSET);
+   for (i = 0; i  omap4_prcm_irq_setup.nr_regs; i++)
+   events[i] = _read_pending_irq_reg(omap4_prcm_irq_setup.mask +
+   i * 4, omap4_prcm_irq_setup.ack + i * 4);
 }
 
 /**
@@ -251,17 +251,15 @@ static void omap44xx_prm_ocp_barrier(void)
  */
 static void omap44xx_prm_save_and_clear_irqen(u32 *saved_mask)
 {
-   saved_mask[0] =
-   omap4_prm_read_inst_reg(OMAP4430_PRM_OCP_SOCKET_INST,
-   OMAP4_PRM_IRQENABLE_MPU_OFFSET);
-   saved_mask[1] =
-   omap4_prm_read_inst_reg(OMAP4430_PRM_OCP_SOCKET_INST,
-   OMAP4_PRM_IRQENABLE_MPU_2_OFFSET);
+   int i;
 
-   omap4_prm_write_inst_reg(0, OMAP4430_PRM_OCP_SOCKET_INST,
-OMAP4_PRM_IRQENABLE_MPU_OFFSET);
-   omap4_prm_write_inst_reg(0, OMAP4430_PRM_OCP_SOCKET_INST,
-OMAP4_PRM_IRQENABLE_MPU_2_OFFSET);
+   for (i = 0; i  omap4_prcm_irq_setup.nr_regs; i++) {
+   saved_mask[i] =
+   omap4_prm_read_inst_reg(OMAP4430_PRM_OCP_SOCKET_INST,
+   omap4_prcm_irq_setup.mask + i * 4);
+   omap4_prm_write_inst_reg(0, OMAP4430_PRM_OCP_SOCKET_INST,
+omap4_prcm_irq_setup.mask + i * 4);
+   }
 
/* OCP barrier */
omap4_prm_read_inst_reg(OMAP4430_PRM_OCP_SOCKET_INST,
@@ -280,10 +278,12 @@ static void omap44xx_prm_save_and_clear_irqen(u32 
*saved_mask)
  */
 static void omap44xx_prm_restore_irqen(u32 *saved_mask)
 {
-   omap4_prm_write_inst_reg(saved_mask[0], OMAP4430_PRM_OCP_SOCKET_INST,
-OMAP4_PRM_IRQENABLE_MPU_OFFSET);
-   omap4_prm_write_inst_reg(saved_mask[1], OMAP4430_PRM_OCP_SOCKET_INST,
-OMAP4_PRM_IRQENABLE_MPU_2_OFFSET);
+   int i;
+
+   for (i = 0; i  omap4_prcm_irq_setup.nr_regs; i++)
+   omap4_prm_write_inst_reg(saved_mask[i],
+   OMAP4430_PRM_OCP_SOCKET_INST,
+   omap4_prcm_irq_setup.mask + i * 4);
 }
 
 /**
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v3 6/6] ARM: PRM: AM437x: Enable IO wakeup feature

2015-07-14 Thread Keerthy
Enable IO wakeup feature.

Signed-off-by: Keerthy j-keer...@ti.com
---
 arch/arm/mach-omap2/prm_common.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/mach-omap2/prm_common.c b/arch/arm/mach-omap2/prm_common.c
index 7add799..1730fc4 100644
--- a/arch/arm/mach-omap2/prm_common.c
+++ b/arch/arm/mach-omap2/prm_common.c
@@ -696,6 +696,7 @@ static struct omap_prcm_init_data am4_prm_data __initdata = 
{
.index = TI_CLKM_PRM,
.init = omap44xx_prm_init,
.device_inst_offset = AM43XX_PRM_DEVICE_INST,
+   .flags = PRM_HAS_IO_WAKEUP,
 };
 #endif
 
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/1] ARM: dts: DRA72: switch to cpsw slave0 for ethernet

2015-07-14 Thread Tony Lindgren
* Mugunthan V N mugunthan...@ti.com [150622 02:05]:
 From: Vignesh R vigne...@ti.com
 
 On DRA72 EVM, cpsw slave1 is muxed with VIN2A, hence switch to cpsw
 slave0 for ethernet. Add gpio hog entry to pcf_gpio_21 in order to
 select cpsw slave0.
 
 Signed-off-by: Vignesh R vigne...@ti.com
 Signed-off-by: Mugunthan V N mugunthan...@ti.com

Applying into omap-for-v4.3/dt thanks.

Tony
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 00/48] usb: gadget: rework ep matching and claiming mechanism

2015-07-14 Thread Robert Baldyga
Hello,

This patch series reworks endpoint matching and claiming mechanism in
epautoconf. From v2 there are 11 additional 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 48 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:

The 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 apparently I forgot to send the
final version of 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 autoconfig.

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 endpoint types. The 'capabilities flags' feature supply
precise, flexible and extendible 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.

Patches (41-42) 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 (43-44) add usb_gadget_ep_match_desc() function which makes the
same thing as ep_matches(), but is located in udc-core where it's
available for UDC drivers, which can use it as helper function in
'match_ep' callback to avoid writing lots of repetitive code. Patch (44)
replaces all calls of ep_matches() with usb_gadget_ep_match_desc() and
removes the ep_matches() as a dead code.

Patches (45-47) move chip-specific enpoint matching algorithms from
generic code of usb_ep_autoconfig_ss() function to UDC controller drivers
using 'match_ep' callback.

Patch (48) makes final cleanup after whole operation.

[1] https://lkml.org/lkml/2014/6/16/94
[2] http://www.spinics.net/lists/linux-usb/msg99662.html

Best regards,
Robert Baldyga

Changelog:

v2:
- remove PXA quirk from ep_matches() function without behaviour change
  using ep capabilities flags
- separate ep and desc configuration code from ep_match() function
- add 'ep_match' to usb_gadget_ops and move chip-specific endpoint
  matching algorithms from generic code to UDC controller drivers

v1: https://lkml.org/lkml/2015/7/8/436

Robert Baldyga (48):
  usb: gadget: encapsulate endpoint claiming mechanism
  usb: gadget: add endpoint capabilities flags
  usb: gadget: add endpoint capabilities helper macros
  staging: emxx_udc: add ep capabilities support
  usb: chipidea: udc: add ep capabilities support
  usb: dwc2: gadget: add ep capabilities support
  usb: dwc3: gadget: add ep capabilities support
  usb: gadget: amd5536udc: add ep capabilities support
  usb: gadget: at91_udc: add ep capabilities support
  usb: gadget: bcm63xx_udc: add ep capabilities support
  usb: gadget: bdc: add ep capabilities support
  usb: gadget: dummy-hcd: add ep capabilities support
  usb: gadget: fotg210-udc: add ep capabilities support
  usb: gadget: fsl_qe_udc: add ep capabilities support
  usb: gadget: fsl_udc_core: add ep capabilities support
  usb: gadget: fusb300_udc: add ep capabilities support
  usb: gadget: goku_udc: add ep capabilities support
  usb: gadget: gr_udc: add ep capabilities support
  usb: gadget: lpc32xx_udc: add ep capabilities support
  usb: gadget: m66592-udc: add ep capabilities support
  usb: gadget: mv_u3d_core: add ep capabilities support
  usb: gadget: mv_udc_core: add ep capabilities support
  usb: gadget: net2272: add ep capabilities support
  usb: gadget: net2280: add ep 

[PATCH v2 23/48] usb: gadget: net2272: add ep capabilities support

2015-07-14 Thread Robert Baldyga
Convert endpoint configuration to new capabilities model.

Signed-off-by: Robert Baldyga r.bald...@samsung.com
---
 drivers/usb/gadget/udc/net2272.c | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/drivers/usb/gadget/udc/net2272.c b/drivers/usb/gadget/udc/net2272.c
index 195baf3..34ec1ec 100644
--- a/drivers/usb/gadget/udc/net2272.c
+++ b/drivers/usb/gadget/udc/net2272.c
@@ -1404,6 +1404,17 @@ net2272_usb_reinit(struct net2272 *dev)
else
ep-fifo_size = 64;
net2272_ep_reset(ep);
+
+   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;
}
usb_ep_set_maxpacket_limit(dev-ep[0].ep, 64);
 
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 27/48] usb: gadget: pxa25x_udc: add ep capabilities support

2015-07-14 Thread Robert Baldyga
Convert endpoint configuration to new capabilities model.

Signed-off-by: Robert Baldyga r.bald...@samsung.com
---
 drivers/usb/gadget/udc/pxa25x_udc.c | 32 
 1 file changed, 32 insertions(+)

diff --git a/drivers/usb/gadget/udc/pxa25x_udc.c 
b/drivers/usb/gadget/udc/pxa25x_udc.c
index f6cbe66..1301e29 100644
--- a/drivers/usb/gadget/udc/pxa25x_udc.c
+++ b/drivers/usb/gadget/udc/pxa25x_udc.c
@@ -1821,6 +1821,8 @@ static struct pxa25x_udc memory = {
.name   = ep0name,
.ops= pxa25x_ep_ops,
.maxpacket  = EP0_FIFO_SIZE,
+   .caps   = USB_EP_CAPS(USB_EP_CAPS_TYPE_CONTROL,
+   USB_EP_CAPS_DIR_ALL),
},
.dev= memory,
.reg_udccs  = UDCCS0,
@@ -1833,6 +1835,8 @@ static struct pxa25x_udc memory = {
.name   = ep1in-bulk,
.ops= pxa25x_ep_ops,
.maxpacket  = BULK_FIFO_SIZE,
+   .caps   = USB_EP_CAPS(USB_EP_CAPS_TYPE_BULK,
+   USB_EP_CAPS_DIR_IN),
},
.dev= memory,
.fifo_size  = BULK_FIFO_SIZE,
@@ -1846,6 +1850,8 @@ static struct pxa25x_udc memory = {
.name   = ep2out-bulk,
.ops= pxa25x_ep_ops,
.maxpacket  = BULK_FIFO_SIZE,
+   .caps   = USB_EP_CAPS(USB_EP_CAPS_TYPE_BULK,
+   USB_EP_CAPS_DIR_OUT),
},
.dev= memory,
.fifo_size  = BULK_FIFO_SIZE,
@@ -1861,6 +1867,8 @@ static struct pxa25x_udc memory = {
.name   = ep3in-iso,
.ops= pxa25x_ep_ops,
.maxpacket  = ISO_FIFO_SIZE,
+   .caps   = USB_EP_CAPS(USB_EP_CAPS_TYPE_ISO,
+   USB_EP_CAPS_DIR_IN),
},
.dev= memory,
.fifo_size  = ISO_FIFO_SIZE,
@@ -1874,6 +1882,8 @@ static struct pxa25x_udc memory = {
.name   = ep4out-iso,
.ops= pxa25x_ep_ops,
.maxpacket  = ISO_FIFO_SIZE,
+   .caps   = USB_EP_CAPS(USB_EP_CAPS_TYPE_ISO,
+   USB_EP_CAPS_DIR_OUT),
},
.dev= memory,
.fifo_size  = ISO_FIFO_SIZE,
@@ -1888,6 +1898,8 @@ static struct pxa25x_udc memory = {
.name   = ep5in-int,
.ops= pxa25x_ep_ops,
.maxpacket  = INT_FIFO_SIZE,
+   .caps   = USB_EP_CAPS(USB_EP_CAPS_TYPE_INT,
+   USB_EP_CAPS_DIR_IN),
},
.dev= memory,
.fifo_size  = INT_FIFO_SIZE,
@@ -1903,6 +1915,8 @@ static struct pxa25x_udc memory = {
.name   = ep6in-bulk,
.ops= pxa25x_ep_ops,
.maxpacket  = BULK_FIFO_SIZE,
+   .caps   = USB_EP_CAPS(USB_EP_CAPS_TYPE_BULK,
+   USB_EP_CAPS_DIR_IN),
},
.dev= memory,
.fifo_size  = BULK_FIFO_SIZE,
@@ -1916,6 +1930,8 @@ static struct pxa25x_udc memory = {
.name   = ep7out-bulk,
.ops= pxa25x_ep_ops,
.maxpacket  = BULK_FIFO_SIZE,
+   .caps   = USB_EP_CAPS(USB_EP_CAPS_TYPE_BULK,
+   USB_EP_CAPS_DIR_OUT),
},
.dev= memory,
.fifo_size  = BULK_FIFO_SIZE,
@@ -1930,6 +1946,8 @@ static struct pxa25x_udc memory = {
.name   = ep8in-iso,
.ops= pxa25x_ep_ops,
.maxpacket  = ISO_FIFO_SIZE,
+   .caps   = USB_EP_CAPS(USB_EP_CAPS_TYPE_ISO,
+   USB_EP_CAPS_DIR_IN),
},
.dev= memory,
.fifo_size  = ISO_FIFO_SIZE,
@@ -1943,6 +1961,8 @@ static struct pxa25x_udc memory = {
.name   = ep9out-iso,
.ops= pxa25x_ep_ops,
.maxpacket  = ISO_FIFO_SIZE,
+   

Re: [PATCH 0/3] ARM: OMAP2+: hwmod: RTC: Add lock and unlock hooks

2015-07-14 Thread Lokesh Vutla
Hi,
On Wednesday 10 June 2015 02:56 PM, Lokesh Vutla wrote:
 Some IP blocks like RTC, needs an additional unlocking mechanism for
 writing to its registers. This patch adds optional lock and unlock
 function pointers to the IP block's hwmod data which gets executed
 before and after writing into IP sysconfig register.
 And also hook lock and unlock functions to AMx3xx, DRA7 RTC hwmod data,
 so that sysconfig registers are updated properly.
ping on this series.

Thanks and regards,
Lokesh
 
 Tested on:
 DRA7-evm: http://pastebin.ubuntu.com/1169/
 DRA72-evm: http://pastebin.ubuntu.com/11688901/
 BeagleBoard-x15: http://pastebin.ubuntu.com/11688907/
 BeagleBoneBlack: http://pastebin.ubuntu.com/11688923/ 
 AM437x-gp-evm: http://pastebin.ubuntu.com/11689157/ (Used an out of tree 
 patch to enable RTC)
 
 Lokesh Vutla (3):
   ARM: OMAP2+: hwmod: add support for lock and unlock hooks
   ARM: DRA: hwmod: RTC: Add lock and unlock functions
   ARM: AMx3xx: RTC: Add lock and unlock functions
 
  arch/arm/mach-omap2/omap_hwmod.c   | 13 ++
  arch/arm/mach-omap2/omap_hwmod.h   |  6 +++
  .../mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c |  2 +
  arch/arm/mach-omap2/omap_hwmod_7xx_data.c  |  2 +
  arch/arm/mach-omap2/omap_hwmod_reset.c | 47 
 ++
  5 files changed, 70 insertions(+)
 

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 46/48] usb: gadget: goku_udc: add goku_match_ep() function

2015-07-14 Thread Robert Baldyga
Add 'match_ep' callback to utilize chip-specific knowledge in endpoint matching
process. Functions does the same that was done by chip-specific code inside
of epautoconf. Now this code can be removed from there to separate generic code
from platform specific logic.

Signed-off-by: Robert Baldyga r.bald...@samsung.com
---
 drivers/usb/gadget/epautoconf.c   | 20 ++--
 drivers/usb/gadget/udc/goku_udc.c | 25 +
 2 files changed, 27 insertions(+), 18 deletions(-)

diff --git a/drivers/usb/gadget/epautoconf.c b/drivers/usb/gadget/epautoconf.c
index 3ac92b4..038b21d 100644
--- a/drivers/usb/gadget/epautoconf.c
+++ b/drivers/usb/gadget/epautoconf.c
@@ -98,24 +98,8 @@ struct usb_ep *usb_ep_autoconfig_ss(
/* First, apply chip-specific best usage knowledge.
 * This might make a good usb_gadget_ops hook ...
 */
-   if (gadget_is_goku (gadget)) {
-   if (USB_ENDPOINT_XFER_INT == type) {
-   /* single buffering is enough */
-   ep = find_ep(gadget, ep3-bulk);
-   if (ep  usb_gadget_ep_match_desc(gadget,
-   ep, desc, ep_comp))
-   goto found_ep;
-   } else if (USB_ENDPOINT_XFER_BULK == type
-(USB_DIR_IN  desc-bEndpointAddress)) {
-   /* DMA may be available */
-   ep = find_ep(gadget, ep2-bulk);
-   if (ep  usb_gadget_ep_match_desc(gadget,
-   ep, desc, ep_comp))
-   goto found_ep;
-   }
-
 #ifdef CONFIG_BLACKFIN
-   } else if (gadget_is_musbhdrc(gadget)) {
+   if (gadget_is_musbhdrc(gadget)) {
if ((USB_ENDPOINT_XFER_BULK == type) ||
(USB_ENDPOINT_XFER_ISOC == type)) {
if (USB_DIR_IN  desc-bEndpointAddress)
@@ -131,8 +115,8 @@ struct usb_ep *usb_ep_autoconfig_ss(
ep = NULL;
if (ep  usb_gadget_ep_match_desc(gadget, ep, desc, ep_comp))
goto found_ep;
-#endif
}
+#endif
 
/* Second, look at endpoints until an unclaimed one looks usable */
list_for_each_entry (ep, gadget-ep_list, ep_list) {
diff --git a/drivers/usb/gadget/udc/goku_udc.c 
b/drivers/usb/gadget/udc/goku_udc.c
index 46b8d14..d25b3a3 100644
--- a/drivers/usb/gadget/udc/goku_udc.c
+++ b/drivers/usb/gadget/udc/goku_udc.c
@@ -990,6 +990,30 @@ static int goku_get_frame(struct usb_gadget *_gadget)
return -EOPNOTSUPP;
 }
 
+static struct usb_ep *goku_match_ep(struct usb_gadget *g,
+   struct usb_endpoint_descriptor *desc,
+   struct usb_ss_ep_comp_descriptor *ep_comp)
+{
+   struct goku_udc *dev = to_goku_udc(g);
+   struct usb_ep *ep;
+   u8 type = usb_endpoint_type(desc);
+
+   if (USB_ENDPOINT_XFER_INT == type) {
+   /* single buffering is enough */
+   ep = dev-ep[3].ep;
+   if (ep  usb_gadget_ep_match_desc(g, ep, desc, ep_comp))
+   return ep;
+   } else if (USB_ENDPOINT_XFER_BULK == type
+usb_endpoint_dir_in(desc)) {
+   /* DMA may be available */
+   ep = dev-ep[2].ep;
+   if (ep  usb_gadget_ep_match_desc(g, ep, desc, ep_comp))
+   return ep;
+   }
+
+   return NULL;
+}
+
 static int goku_udc_start(struct usb_gadget *g,
struct usb_gadget_driver *driver);
 static int goku_udc_stop(struct usb_gadget *g);
@@ -998,6 +1022,7 @@ static const struct usb_gadget_ops goku_ops = {
.get_frame  = goku_get_frame,
.udc_start  = goku_udc_start,
.udc_stop   = goku_udc_stop,
+   .match_ep   = goku_match_ep,
// no remote wakeup
// not selfpowered
 };
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 42/48] usb: gadget: epautoconf: use 'ep_match' gadget callback

2015-07-14 Thread Robert Baldyga
If gadget has set 'ep_match' callback we prefer to call it first to allow
UDC driver to find the best matching endpoint basing on chip-specific best
usage knowledge.

Signed-off-by: Robert Baldyga r.bald...@samsung.com
---
 drivers/usb/gadget/epautoconf.c | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/drivers/usb/gadget/epautoconf.c b/drivers/usb/gadget/epautoconf.c
index ee0d4e6..92a1a4c 100644
--- a/drivers/usb/gadget/epautoconf.c
+++ b/drivers/usb/gadget/epautoconf.c
@@ -165,6 +165,12 @@ struct usb_ep *usb_ep_autoconfig_ss(
 
type = desc-bmAttributes  USB_ENDPOINT_XFERTYPE_MASK;
 
+   if (gadget-ops-match_ep) {
+   ep = gadget-ops-match_ep(gadget, desc, ep_comp);
+   if (ep)
+   goto found_ep;
+   }
+
/* First, apply chip-specific best usage knowledge.
 * This might make a good usb_gadget_ops hook ...
 */
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 45/48] usb: gadget: net2280: add net2280_match_ep() function

2015-07-14 Thread Robert Baldyga
Add 'match_ep' callback to utilize chip-specific knowledge in endpoint matching
process. Functions does the same that was done by chip-specific code inside
of epautoconf. Now this code can be removed from there to separate generic code
from platform specific logic.

Signed-off-by: Robert Baldyga r.bald...@samsung.com
---
 drivers/usb/gadget/epautoconf.c  | 23 +
 drivers/usb/gadget/udc/net2280.c | 44 
 2 files changed, 45 insertions(+), 22 deletions(-)

diff --git a/drivers/usb/gadget/epautoconf.c b/drivers/usb/gadget/epautoconf.c
index 7c43b7c..3ac92b4 100644
--- a/drivers/usb/gadget/epautoconf.c
+++ b/drivers/usb/gadget/epautoconf.c
@@ -98,28 +98,7 @@ struct usb_ep *usb_ep_autoconfig_ss(
/* First, apply chip-specific best usage knowledge.
 * This might make a good usb_gadget_ops hook ...
 */
-   if (gadget_is_net2280(gadget)) {
-   char name[8];
-
-   if (type == USB_ENDPOINT_XFER_INT) {
-   /* ep-e, ep-f are PIO with only 64 byte fifos */
-   ep = find_ep(gadget, ep-e);
-   if (ep  usb_gadget_ep_match_desc(gadget,
-   ep, desc, ep_comp))
-   goto found_ep;
-   ep = find_ep(gadget, ep-f);
-   if (ep  usb_gadget_ep_match_desc(gadget,
-   ep, desc, ep_comp))
-   goto found_ep;
-   }
-
-   /* USB3380: use same address for usb and hardware endpoints */
-   snprintf(name, sizeof(name), ep%d%s, usb_endpoint_num(desc),
-   usb_endpoint_dir_in(desc) ? in : out);
-   ep = find_ep(gadget, name);
-   if (ep  usb_gadget_ep_match_desc(gadget, ep, desc, ep_comp))
-   goto found_ep;
-   } else if (gadget_is_goku (gadget)) {
+   if (gadget_is_goku (gadget)) {
if (USB_ENDPOINT_XFER_INT == type) {
/* single buffering is enough */
ep = find_ep(gadget, ep3-bulk);
diff --git a/drivers/usb/gadget/udc/net2280.c b/drivers/usb/gadget/udc/net2280.c
index 0295cf7..4933321 100644
--- a/drivers/usb/gadget/udc/net2280.c
+++ b/drivers/usb/gadget/udc/net2280.c
@@ -1533,6 +1533,49 @@ static int net2280_pullup(struct usb_gadget *_gadget, 
int is_on)
return 0;
 }
 
+static struct usb_ep *net2280_find_ep(struct usb_gadget *_gadget,
+   const char *name)
+{
+   struct usb_ep *ep;
+
+   list_for_each_entry(ep, _gadget-ep_list, ep_list) {
+   if (0 == strcmp(ep-name, name))
+   return ep;
+   }
+
+   return NULL;
+}
+
+static struct usb_ep *net2280_match_ep(struct usb_gadget *_gadget,
+   struct usb_endpoint_descriptor *desc,
+   struct usb_ss_ep_comp_descriptor *ep_comp)
+{
+   char name[8];
+   struct usb_ep *ep;
+   u8 type;
+
+   type = usb_endpoint_type(desc);
+
+   if (type == USB_ENDPOINT_XFER_INT) {
+   /* ep-e, ep-f are PIO with only 64 byte fifos */
+   ep = net2280_find_ep(_gadget, ep-e);
+   if (ep  usb_gadget_ep_match_desc(_gadget, ep, desc, ep_comp))
+   return ep;
+   ep = net2280_find_ep(_gadget, ep-f);
+   if (ep  usb_gadget_ep_match_desc(_gadget, ep, desc, ep_comp))
+   return ep;
+   }
+
+   /* USB3380: use same address for usb and hardware endpoints */
+   snprintf(name, sizeof(name), ep%d%s, usb_endpoint_num(desc),
+   usb_endpoint_dir_in(desc) ? in : out);
+   ep = net2280_find_ep(_gadget, name);
+   if (ep  usb_gadget_ep_match_desc(_gadget, ep, desc, ep_comp))
+   return ep;
+
+   return NULL;
+}
+
 static int net2280_start(struct usb_gadget *_gadget,
struct usb_gadget_driver *driver);
 static int net2280_stop(struct usb_gadget *_gadget);
@@ -1544,6 +1587,7 @@ static const struct usb_gadget_ops net2280_ops = {
.pullup = net2280_pullup,
.udc_start  = net2280_start,
.udc_stop   = net2280_stop,
+   .match_ep   = net2280_match_ep,
 };
 
 /*-*/
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 47/48] usb: musb: gadget: add musb_match_ep() function

2015-07-14 Thread Robert Baldyga
Add 'match_ep' callback to utilize chip-specific knowledge in endpoint matching
process. Functions does the same that was done by chip-specific code inside
of epautoconf. Now this code can be removed from there to separate generic code
from platform specific logic.

Signed-off-by: Robert Baldyga r.bald...@samsung.com
---
 drivers/usb/gadget/epautoconf.c | 23 -
 drivers/usb/musb/musb_gadget.c  | 44 +
 2 files changed, 44 insertions(+), 23 deletions(-)

diff --git a/drivers/usb/gadget/epautoconf.c b/drivers/usb/gadget/epautoconf.c
index 038b21d..e9a8682 100644
--- a/drivers/usb/gadget/epautoconf.c
+++ b/drivers/usb/gadget/epautoconf.c
@@ -95,29 +95,6 @@ struct usb_ep *usb_ep_autoconfig_ss(
goto found_ep;
}
 
-   /* First, apply chip-specific best usage knowledge.
-* This might make a good usb_gadget_ops hook ...
-*/
-#ifdef CONFIG_BLACKFIN
-   if (gadget_is_musbhdrc(gadget)) {
-   if ((USB_ENDPOINT_XFER_BULK == type) ||
-   (USB_ENDPOINT_XFER_ISOC == type)) {
-   if (USB_DIR_IN  desc-bEndpointAddress)
-   ep = find_ep (gadget, ep5in);
-   else
-   ep = find_ep (gadget, ep6out);
-   } else if (USB_ENDPOINT_XFER_INT == type) {
-   if (USB_DIR_IN  desc-bEndpointAddress)
-   ep = find_ep(gadget, ep1in);
-   else
-   ep = find_ep(gadget, ep2out);
-   } else
-   ep = NULL;
-   if (ep  usb_gadget_ep_match_desc(gadget, ep, desc, ep_comp))
-   goto found_ep;
-   }
-#endif
-
/* Second, look at endpoints until an unclaimed one looks usable */
list_for_each_entry (ep, gadget-ep_list, ep_list) {
if (usb_gadget_ep_match_desc(gadget, ep, desc, ep_comp))
diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c
index 043248a..5f1eb35 100644
--- a/drivers/usb/musb/musb_gadget.c
+++ b/drivers/usb/musb/musb_gadget.c
@@ -1684,6 +1684,49 @@ static int musb_gadget_pullup(struct usb_gadget *gadget, 
int is_on)
return 0;
 }
 
+#ifdef CONFIG_BLACKFIN
+static struct usb_ep *musb_find_ep(struct usb_gadget *g,
+   const char *name)
+{
+   struct usb_ep *ep;
+
+   list_for_each_entry(ep, g-ep_list, ep_list) {
+   if (0 == strcmp(ep-name, name))
+   return ep;
+   }
+
+   return NULL;
+}
+
+static struct usb_ep *match_match_ep(struct usb_gadget *g,
+   struct usb_endpoint_descriptor *desc,
+   struct usb_ss_ep_comp_descriptor *ep_comp)
+{
+   struct usb_ep *ep = NULL;
+   u8 type = usb_endpoint_type(desc);
+
+   if ((USB_ENDPOINT_XFER_BULK == type) ||
+   (USB_ENDPOINT_XFER_ISOC == type)) {
+   if (USB_DIR_IN  desc-bEndpointAddress)
+   ep = musb_find_ep(g, ep5in);
+   else
+   ep = musb_find_ep(g, ep6out);
+   } else if (USB_ENDPOINT_XFER_INT == type) {
+   if (USB_DIR_IN  desc-bEndpointAddress)
+   ep = musb_find_ep(g, ep1in);
+   else
+   ep = musb_find_ep(g, ep2out);
+   }
+
+   if (ep  usb_gadget_ep_match_desc(g, ep, desc, ep_comp))
+   return ep;
+
+   return NULL;
+}
+#else
+#define musb_match_ep NULL
+#endif
+
 static int musb_gadget_start(struct usb_gadget *g,
struct usb_gadget_driver *driver);
 static int musb_gadget_stop(struct usb_gadget *g);
@@ -1697,6 +1740,7 @@ static const struct usb_gadget_ops musb_gadget_operations 
= {
.pullup = musb_gadget_pullup,
.udc_start  = musb_gadget_start,
.udc_stop   = musb_gadget_stop,
+   .match_ep   = musb_match_ep,
 };
 
 /* --- */
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 40/48] usb: gadget: epautoconf: rework ep_matches() function

2015-07-14 Thread Robert Baldyga
Rework ep_matches() function to make it shorter and better readable.

Signed-off-by: Robert Baldyga r.bald...@samsung.com
---
 drivers/usb/gadget/epautoconf.c | 87 +
 1 file changed, 35 insertions(+), 52 deletions(-)

diff --git a/drivers/usb/gadget/epautoconf.c b/drivers/usb/gadget/epautoconf.c
index d00b443..ee0d4e6 100644
--- a/drivers/usb/gadget/epautoconf.c
+++ b/drivers/usb/gadget/epautoconf.c
@@ -30,16 +30,29 @@ ep_matches (
struct usb_ss_ep_comp_descriptor *ep_comp
 )
 {
-   u8  type;
-   u16 max;
-
-   int num_req_streams = 0;
+   u8  type;
+   u16 max;
+   int num_req_streams = 0;
 
/* endpoint already claimed? */
if (ep-claimed)
return 0;
 
type = usb_endpoint_type(desc);
+   max = 0x7ff  usb_endpoint_maxp(desc);
+
+   if (usb_endpoint_dir_in(desc)  !ep-caps.dir_in)
+   return 0;
+   else if (!ep-caps.dir_out)
+   return 0;
+
+   if (max  ep-maxpacket_limit)
+   return 0;
+
+   /* high bandwidth works only at high speed */
+   if (!gadget_is_dualspeed(gadget)  usb_endpoint_maxp(desc)  (311))
+   return 0;
+
switch (type) {
case USB_ENDPOINT_XFER_CONTROL:
/* only support ep0 for portable CONTROL traffic */
@@ -47,66 +60,36 @@ ep_matches (
case USB_ENDPOINT_XFER_ISOC:
if (!ep-caps.type_iso)
return 0;
+   /* ISO:  limit 1023 bytes full speed,
+* 1024 high/super speed
+*/
+   if (!gadget_is_dualspeed(gadget)  max  1023)
+   return 0;
break;
case USB_ENDPOINT_XFER_BULK:
if (!ep-caps.type_bulk)
return 0;
+   if (ep_comp  gadget_is_superspeed(gadget)) {
+   /* Get the number of required streams from the
+* EP companion descriptor and see if the EP
+* matches it
+*/
+   num_req_streams = ep_comp-bmAttributes  0x1f;
+   if (num_req_streams  ep-max_streams)
+   return 0;
+   }
break;
case USB_ENDPOINT_XFER_INT:
-   /* bulk endpoints handle interrupt transfers,
+   /* Bulk endpoints handle interrupt transfers,
 * except the toggle-quirky iso-synch kind
 */
if (!ep-caps.type_int  !ep-caps.type_bulk)
return 0;
-   break;
-   }
-
-   if (usb_endpoint_dir_in(desc)) {
-   if (!ep-caps.dir_in)
-   return 0;
-   } else {
-   if (!ep-caps.dir_out)
-   return 0;
-   }
-
-   /*
-* Get the number of required streams from the EP companion
-* descriptor and see if the EP matches it
-*/
-   if (usb_endpoint_xfer_bulk(desc)) {
-   if (ep_comp  gadget-max_speed = USB_SPEED_SUPER) {
-   num_req_streams = ep_comp-bmAttributes  0x1f;
-   if (num_req_streams  ep-max_streams)
-   return 0;
-   }
-
-   }
-
-   /* endpoint maxpacket size is an input parameter, except for bulk
-* where it's an output parameter representing the full speed limit.
-* the usb spec fixes high speed bulk maxpacket at 512 bytes.
-*/
-   max = 0x7ff  usb_endpoint_maxp(desc);
-   switch (type) {
-   case USB_ENDPOINT_XFER_INT:
-   /* INT:  limit 64 bytes full speed, 1024 high/super speed */
+   /* INT:  limit 64 bytes full speed,
+* 1024 high/super speed
+*/
if (!gadget_is_dualspeed(gadget)  max  64)
return 0;
-   /* FALLTHROUGH */
-
-   case USB_ENDPOINT_XFER_ISOC:
-   /* ISO:  limit 1023 bytes full speed, 1024 high/super speed */
-   if (ep-maxpacket_limit  max)
-   return 0;
-   if (!gadget_is_dualspeed(gadget)  max  1023)
-   return 0;
-
-   /* BOTH:  high bandwidth works only at high speed */
-   if ((desc-wMaxPacketSize  cpu_to_le16(311))) {
-   if (!gadget_is_dualspeed(gadget))
-   return 0;
-   /* configure your hardware with enough buffering!! */
-   }
break;
}
 
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 44/48] usb: gadget: epautoconf: remove ep_matches() function

2015-07-14 Thread Robert Baldyga
As now we have usb_gadget_ep_match_desc() function which does exactly the same
thing as ep_matches(), we can remove the second one and replace all of its calls
with usb_gadget_ep_match_desc() calls.

Signed-off-by: Robert Baldyga r.bald...@samsung.com
---
 drivers/usb/gadget/epautoconf.c | 95 +
 1 file changed, 11 insertions(+), 84 deletions(-)

diff --git a/drivers/usb/gadget/epautoconf.c b/drivers/usb/gadget/epautoconf.c
index 92a1a4c..7c43b7c 100644
--- a/drivers/usb/gadget/epautoconf.c
+++ b/drivers/usb/gadget/epautoconf.c
@@ -22,82 +22,6 @@
 
 #include gadget_chips.h
 
-static int
-ep_matches (
-   struct usb_gadget   *gadget,
-   struct usb_ep   *ep,
-   struct usb_endpoint_descriptor  *desc,
-   struct usb_ss_ep_comp_descriptor *ep_comp
-)
-{
-   u8  type;
-   u16 max;
-   int num_req_streams = 0;
-
-   /* endpoint already claimed? */
-   if (ep-claimed)
-   return 0;
-
-   type = usb_endpoint_type(desc);
-   max = 0x7ff  usb_endpoint_maxp(desc);
-
-   if (usb_endpoint_dir_in(desc)  !ep-caps.dir_in)
-   return 0;
-   else if (!ep-caps.dir_out)
-   return 0;
-
-   if (max  ep-maxpacket_limit)
-   return 0;
-
-   /* high bandwidth works only at high speed */
-   if (!gadget_is_dualspeed(gadget)  usb_endpoint_maxp(desc)  (311))
-   return 0;
-
-   switch (type) {
-   case USB_ENDPOINT_XFER_CONTROL:
-   /* only support ep0 for portable CONTROL traffic */
-   return 0;
-   case USB_ENDPOINT_XFER_ISOC:
-   if (!ep-caps.type_iso)
-   return 0;
-   /* ISO:  limit 1023 bytes full speed,
-* 1024 high/super speed
-*/
-   if (!gadget_is_dualspeed(gadget)  max  1023)
-   return 0;
-   break;
-   case USB_ENDPOINT_XFER_BULK:
-   if (!ep-caps.type_bulk)
-   return 0;
-   if (ep_comp  gadget_is_superspeed(gadget)) {
-   /* Get the number of required streams from the
-* EP companion descriptor and see if the EP
-* matches it
-*/
-   num_req_streams = ep_comp-bmAttributes  0x1f;
-   if (num_req_streams  ep-max_streams)
-   return 0;
-   }
-   break;
-   case USB_ENDPOINT_XFER_INT:
-   /* Bulk endpoints handle interrupt transfers,
-* except the toggle-quirky iso-synch kind
-*/
-   if (!ep-caps.type_int  !ep-caps.type_bulk)
-   return 0;
-   /* INT:  limit 64 bytes full speed,
-* 1024 high/super speed
-*/
-   if (!gadget_is_dualspeed(gadget)  max  64)
-   return 0;
-   break;
-   }
-
-   /* MATCH!! */
-
-   return 1;
-}
-
 static struct usb_ep *
 find_ep (struct usb_gadget *gadget, const char *name)
 {
@@ -180,10 +104,12 @@ struct usb_ep *usb_ep_autoconfig_ss(
if (type == USB_ENDPOINT_XFER_INT) {
/* ep-e, ep-f are PIO with only 64 byte fifos */
ep = find_ep(gadget, ep-e);
-   if (ep  ep_matches(gadget, ep, desc, ep_comp))
+   if (ep  usb_gadget_ep_match_desc(gadget,
+   ep, desc, ep_comp))
goto found_ep;
ep = find_ep(gadget, ep-f);
-   if (ep  ep_matches(gadget, ep, desc, ep_comp))
+   if (ep  usb_gadget_ep_match_desc(gadget,
+   ep, desc, ep_comp))
goto found_ep;
}
 
@@ -191,20 +117,21 @@ struct usb_ep *usb_ep_autoconfig_ss(
snprintf(name, sizeof(name), ep%d%s, usb_endpoint_num(desc),
usb_endpoint_dir_in(desc) ? in : out);
ep = find_ep(gadget, name);
-   if (ep  ep_matches(gadget, ep, desc, ep_comp))
+   if (ep  usb_gadget_ep_match_desc(gadget, ep, desc, ep_comp))
goto found_ep;
} else if (gadget_is_goku (gadget)) {
if (USB_ENDPOINT_XFER_INT == type) {
/* single buffering is enough */
ep = find_ep(gadget, ep3-bulk);
-   if (ep  ep_matches(gadget, ep, desc, ep_comp))
+   if (ep  usb_gadget_ep_match_desc(gadget,
+   ep, desc, ep_comp))
goto found_ep;
} else if (USB_ENDPOINT_XFER_BULK == type

Re: [PATCH v4 0/3] ARM: OMAP2+: wkup_m3_rproc support patches

2015-07-14 Thread Tony Lindgren
* Dave Gerlach d-gerl...@ti.com [150713 10:37]:
 Hi,
 
 Now that wkup_m3_rproc driver [1] has been merged the support code
 contained in this series can be merged. This is v4 which is just a
 rebase of v3 [2] code on v4.2-rc2, no other changes.

Thanks applying into omap-for-v4.3/dt.

Tony
 
 [1] http://www.spinics.net/lists/linux-omap/msg118768.html
 [2] http://www.spinics.net/lists/linux-omap/msg117614.html
 
 Dave Gerlach (1):
   ARM: OMAP2+: Use pdata-quirks for wkup_m3 reset management
 
 Suman Anna (2):
   ARM: dts: AM33xx: Update and move wkup_m3 node to l4 node
   ARM: dts: AM4372: Add the wkupm3 rproc node
 
  arch/arm/boot/dts/am33xx.dtsi  | 17 +
  arch/arm/boot/dts/am4372.dtsi  |  9 +
  arch/arm/mach-omap2/pdata-quirks.c | 15 +++
  3 files changed, 33 insertions(+), 8 deletions(-)
 
 -- 
 2.4.5
 
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v3 0/6] ARM: AM437x: Add IO wake up support

2015-07-14 Thread Keerthy
The patch series adds IO wake up support for AM437x series
making use of the existing OMAP4 support. Adds the AM437x
specifics.

The series is boot tested on OMAP4 panda, DAR7 evm and AM437x evms.

Changes in v3:

Fixed a bug. Assigned nr_regs = 1 for am437x

Changes in v2:

Removed inefficient way of using arrays for irq ack and masks. 

Keerthy (6):
  ARM: OMAP4: PRM: Remove hardcoding of PRM_IO_PMCTRL_OFFSET register
  ARM: AM43xx: Add the PRM IRQ register offsets
  ARM: dts: AM4372: Add PRCM IRQ entry
  ARM: OMAP: PRM: Remove hardcoding of IRQENABLE_MPU_2 and
IRQSTATUS_MPU_2 register offsets
  ARM: OMAP4+: PRM: Add AM437x specific data
  ARM: PRM: AM437x: Enable IO wakeup feature

 arch/arm/boot/dts/am4372.dtsi |  1 +
 arch/arm/mach-omap2/prcm-common.h |  1 +
 arch/arm/mach-omap2/prcm43xx.h|  5 
 arch/arm/mach-omap2/prm44xx.c | 59 +++
 arch/arm/mach-omap2/prm_common.c  |  1 +
 5 files changed, 43 insertions(+), 24 deletions(-)

-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [GIT PULL] clk: ti: clock driver code migration to drivers

2015-07-14 Thread Tero Kristo

On 07/14/2015 12:54 PM, Tony Lindgren wrote:

* Tero Kristo t-kri...@ti.com [150714 01:56]:


This pull request contains the TI clock driver set to move the clock
implementations under clock driver. Some small portions of the clock driver
code still remain under mach-omap2 after this, it should be decided whether
this code is now obsolete and should be deleted or should someone try to fix
it.


Hmm care to clarify what is obsolete or broken after this series?


Not after this series, was broken/obsolete already before.

A couple of omap2/omap3 specific clock files still remain under 
mach-omap2, they are DVFS related. OMAP3 core dvfs support is currently 
completely unused (this could probably be removed, or shall we 
re-introduce the painful core dvfs at some point again?), and parts of 
the omap2 core dpll handling code should probably be re-written; or at 
least verified that it actually works properly. I can't test OMAP2 DVFS 
myself so don't dare to fiddle with it I could probably try to get 
some sort of DVFS test case to work on the board farm OMAP2 board I have 
access to though, I can investigate this.



And I take it's not obsolete or broken because of this series? :)


No, this series does not touch the above mentioned pieces of code, so 
this definitely should not break anything. :)


-Tero



Also, I just gave this branch a quick boot test and it seems to
behave for me.

Regards,

Tony



--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 45/48] usb: gadget: net2280: add net2280_match_ep() function

2015-07-14 Thread Sergei Shtylyov

Hello.

On 7/14/2015 12:39 PM, Robert Baldyga wrote:


Add 'match_ep' callback to utilize chip-specific knowledge in endpoint matching
process. Functions does the same that was done by chip-specific code inside
of epautoconf. Now this code can be removed from there to separate generic code
from platform specific logic.



Signed-off-by: Robert Baldyga r.bald...@samsung.com


[...]

diff --git a/drivers/usb/gadget/udc/net2280.c b/drivers/usb/gadget/udc/net2280.c
index 0295cf7..4933321 100644
--- a/drivers/usb/gadget/udc/net2280.c
+++ b/drivers/usb/gadget/udc/net2280.c
@@ -1533,6 +1533,49 @@ static int net2280_pullup(struct usb_gadget *_gadget, 
int is_on)
return 0;
  }

+static struct usb_ep *net2280_find_ep(struct usb_gadget *_gadget,
+   const char *name)


   Shouldn't this be a generic function as before?


+{
+   struct usb_ep *ep;
+
+   list_for_each_entry(ep, _gadget-ep_list, ep_list) {
+   if (0 == strcmp(ep-name, name))


   Please make 0 the 2nd operand to ==.


+   return ep;
+   }
+
+   return NULL;
+}

[...]

WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 25/48] usb: gadget: omap_udc: add ep capabilities support

2015-07-14 Thread Robert Baldyga
Convert endpoint configuration to new capabilities model.

Signed-off-by: Robert Baldyga r.bald...@samsung.com
---
 drivers/usb/gadget/udc/omap_udc.c | 22 ++
 1 file changed, 22 insertions(+)

diff --git a/drivers/usb/gadget/udc/omap_udc.c 
b/drivers/usb/gadget/udc/omap_udc.c
index e2fcdb8..9b7d394 100644
--- a/drivers/usb/gadget/udc/omap_udc.c
+++ b/drivers/usb/gadget/udc/omap_udc.c
@@ -2579,6 +2579,28 @@ omap_ep_setup(char *name, u8 addr, u8 type,
ep-double_buf = dbuf;
ep-udc = udc;
 
+   switch (type) {
+   case USB_ENDPOINT_XFER_CONTROL:
+   ep-ep.caps.type_control = true;
+   ep-ep.caps.dir_in = true;
+   ep-ep.caps.dir_out = true;
+   break;
+   case USB_ENDPOINT_XFER_ISOC:
+   ep-ep.caps.type_iso = true;
+   break;
+   case USB_ENDPOINT_XFER_BULK:
+   ep-ep.caps.type_bulk = true;
+   break;
+   case USB_ENDPOINT_XFER_INT:
+   ep-ep.caps.type_int = true;
+   break;
+   };
+
+   if (addr  USB_DIR_IN)
+   ep-ep.caps.dir_in = true;
+   else
+   ep-ep.caps.dir_out = true;
+
ep-ep.name = ep-name;
ep-ep.ops = omap_ep_ops;
ep-maxpacket = maxp;
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 32/48] usb: gadget: udc-xilinx: add ep capabilities support

2015-07-14 Thread Robert Baldyga
Convert endpoint configuration to new capabilities model.

Signed-off-by: Robert Baldyga r.bald...@samsung.com
---
 drivers/usb/gadget/udc/udc-xilinx.c | 9 +
 1 file changed, 9 insertions(+)

diff --git a/drivers/usb/gadget/udc/udc-xilinx.c 
b/drivers/usb/gadget/udc/udc-xilinx.c
index 1f24274..1cbb0ac 100644
--- a/drivers/usb/gadget/udc/udc-xilinx.c
+++ b/drivers/usb/gadget/udc/udc-xilinx.c
@@ -1317,12 +1317,21 @@ static void xudc_eps_init(struct xusb_udc *udc)
snprintf(ep-name, EPNAME_SIZE, ep%d, ep_number);
ep-ep_usb.name = ep-name;
ep-ep_usb.ops = xusb_ep_ops;
+
+   ep-ep_usb.caps.type_iso = true;
+   ep-ep_usb.caps.type_bulk = true;
+   ep-ep_usb.caps.type_int = true;
} else {
ep-ep_usb.name = ep0name;
usb_ep_set_maxpacket_limit(ep-ep_usb, EP0_MAX_PACKET);
ep-ep_usb.ops = xusb_ep0_ops;
+
+   ep-ep_usb.caps.type_control = true;
}
 
+   ep-ep_usb.caps.dir_in = true;
+   ep-ep_usb.caps.dir_out = true;
+
ep-udc = udc;
ep-epnumber = ep_number;
ep-desc = NULL;
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 31/48] usb: gadget: s3c2410_udc: add ep capabilities support

2015-07-14 Thread Robert Baldyga
Convert endpoint configuration to new capabilities model.

Signed-off-by: Robert Baldyga r.bald...@samsung.com
---
 drivers/usb/gadget/udc/s3c2410_udc.c | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/drivers/usb/gadget/udc/s3c2410_udc.c 
b/drivers/usb/gadget/udc/s3c2410_udc.c
index 5d9aa81..eb3571e 100644
--- a/drivers/usb/gadget/udc/s3c2410_udc.c
+++ b/drivers/usb/gadget/udc/s3c2410_udc.c
@@ -1691,6 +1691,8 @@ static struct s3c2410_udc memory = {
.name   = ep0name,
.ops= s3c2410_ep_ops,
.maxpacket  = EP0_FIFO_SIZE,
+   .caps   = USB_EP_CAPS(USB_EP_CAPS_TYPE_CONTROL,
+   USB_EP_CAPS_DIR_ALL),
},
.dev= memory,
},
@@ -1702,6 +1704,8 @@ static struct s3c2410_udc memory = {
.name   = ep1-bulk,
.ops= s3c2410_ep_ops,
.maxpacket  = EP_FIFO_SIZE,
+   .caps   = USB_EP_CAPS(USB_EP_CAPS_TYPE_BULK,
+   USB_EP_CAPS_DIR_ALL),
},
.dev= memory,
.fifo_size  = EP_FIFO_SIZE,
@@ -1714,6 +1718,8 @@ static struct s3c2410_udc memory = {
.name   = ep2-bulk,
.ops= s3c2410_ep_ops,
.maxpacket  = EP_FIFO_SIZE,
+   .caps   = USB_EP_CAPS(USB_EP_CAPS_TYPE_BULK,
+   USB_EP_CAPS_DIR_ALL),
},
.dev= memory,
.fifo_size  = EP_FIFO_SIZE,
@@ -1726,6 +1732,8 @@ static struct s3c2410_udc memory = {
.name   = ep3-bulk,
.ops= s3c2410_ep_ops,
.maxpacket  = EP_FIFO_SIZE,
+   .caps   = USB_EP_CAPS(USB_EP_CAPS_TYPE_BULK,
+   USB_EP_CAPS_DIR_ALL),
},
.dev= memory,
.fifo_size  = EP_FIFO_SIZE,
@@ -1738,6 +1746,8 @@ static struct s3c2410_udc memory = {
.name   = ep4-bulk,
.ops= s3c2410_ep_ops,
.maxpacket  = EP_FIFO_SIZE,
+   .caps   = USB_EP_CAPS(USB_EP_CAPS_TYPE_BULK,
+   USB_EP_CAPS_DIR_ALL),
},
.dev= memory,
.fifo_size  = EP_FIFO_SIZE,
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 33/48] usb: isp1760: udc: add ep capabilities support

2015-07-14 Thread Robert Baldyga
Convert endpoint configuration to new capabilities model.

Signed-off-by: Robert Baldyga r.bald...@samsung.com
---
 drivers/usb/isp1760/isp1760-udc.c | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/drivers/usb/isp1760/isp1760-udc.c 
b/drivers/usb/isp1760/isp1760-udc.c
index 3699962..1c3d0fd 100644
--- a/drivers/usb/isp1760/isp1760-udc.c
+++ b/drivers/usb/isp1760/isp1760-udc.c
@@ -1383,13 +1383,24 @@ static void isp1760_udc_init_eps(struct isp1760_udc 
*udc)
 */
if (ep_num == 0) {
usb_ep_set_maxpacket_limit(ep-ep, 64);
+   ep-ep.caps.type_control = true;
+   ep-ep.caps.dir_in = true;
+   ep-ep.caps.dir_out = true;
ep-maxpacket = 64;
udc-gadget.ep0 = ep-ep;
} else {
usb_ep_set_maxpacket_limit(ep-ep, 512);
+   ep-ep.caps.type_iso = true;
+   ep-ep.caps.type_bulk = true;
+   ep-ep.caps.type_int = true;
ep-maxpacket = 0;
list_add_tail(ep-ep.ep_list, udc-gadget.ep_list);
}
+
+   if (is_in)
+   ep-ep.caps.dir_in = true;
+   else
+   ep-ep.caps.dir_out = true;
}
 }
 
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 12/48] usb: gadget: dummy-hcd: add ep capabilities support

2015-07-14 Thread Robert Baldyga
Convert endpoint configuration to new capabilities model.

Signed-off-by: Robert Baldyga r.bald...@samsung.com
---
 drivers/usb/gadget/udc/dummy_hcd.c | 65 +-
 1 file changed, 50 insertions(+), 15 deletions(-)

diff --git a/drivers/usb/gadget/udc/dummy_hcd.c 
b/drivers/usb/gadget/udc/dummy_hcd.c
index 181112c..69fd29a 100644
--- a/drivers/usb/gadget/udc/dummy_hcd.c
+++ b/drivers/usb/gadget/udc/dummy_hcd.c
@@ -127,23 +127,57 @@ static inline struct dummy_request 
*usb_request_to_dummy_request
 
 static const char ep0name[] = ep0;
 
-static const char *const ep_name[] = {
-   ep0name,/* everyone has ep0 */
+static const struct {
+   const char *name;
+   const struct usb_ep_caps caps;
+} ep_info[] = {
+#define EP_INFO(_name, _type, _dir) \
+   { \
+   .name = _name, \
+   .caps = USB_EP_CAPS(USB_EP_CAPS_TYPE_ ## _type, \
+   USB_EP_CAPS_DIR_ ## _dir), \
+   }
 
+   /* everyone has ep0 */
+   EP_INFO(ep0name,CONTROL, ALL),
/* act like a pxa250: fifteen fixed function endpoints */
-   ep1in-bulk, ep2out-bulk, ep3in-iso, ep4out-iso, ep5in-int,
-   ep6in-bulk, ep7out-bulk, ep8in-iso, ep9out-iso, ep10in-int,
-   ep11in-bulk, ep12out-bulk, ep13in-iso, ep14out-iso,
-   ep15in-int,
-
+   EP_INFO(ep1in-bulk,   BULK,   IN),
+   EP_INFO(ep2out-bulk,  BULK,   OUT),
+   EP_INFO(ep3in-iso,ISO,IN),
+   EP_INFO(ep4out-iso,   ISO,OUT),
+   EP_INFO(ep5in-int,INT,IN),
+   EP_INFO(ep6in-bulk,   BULK,   IN),
+   EP_INFO(ep7out-bulk,  BULK,   OUT),
+   EP_INFO(ep8in-iso,ISO,IN),
+   EP_INFO(ep9out-iso,   ISO,OUT),
+   EP_INFO(ep10in-int,   INT,IN),
+   EP_INFO(ep11in-bulk,  BULK,   IN),
+   EP_INFO(ep12out-bulk, BULK,   OUT),
+   EP_INFO(ep13in-iso,   ISO,IN),
+   EP_INFO(ep14out-iso,  ISO,OUT),
+   EP_INFO(ep15in-int,   INT,IN),
/* or like sa1100: two fixed function endpoints */
-   ep1out-bulk, ep2in-bulk,
-
+   EP_INFO(ep1out-bulk,  BULK,   OUT),
+   EP_INFO(ep2in-bulk,   BULK,   IN),
/* and now some generic EPs so we have enough in multi config */
-   ep3out, ep4in, ep5out, ep6out, ep7in, ep8out, ep9in,
-   ep10out, ep11out, ep12in, ep13out, ep14in, ep15out,
+   EP_INFO(ep3out,   ALL,OUT),
+   EP_INFO(ep4in,ALL,IN),
+   EP_INFO(ep5out,   ALL,OUT),
+   EP_INFO(ep6out,   ALL,OUT),
+   EP_INFO(ep7in,ALL,IN),
+   EP_INFO(ep8out,   ALL,OUT),
+   EP_INFO(ep9in,ALL,IN),
+   EP_INFO(ep10out,  ALL,OUT),
+   EP_INFO(ep11out,  ALL,OUT),
+   EP_INFO(ep12in,   ALL,IN),
+   EP_INFO(ep13out,  ALL,OUT),
+   EP_INFO(ep14in,   ALL,IN),
+   EP_INFO(ep15out,  ALL,OUT),
+
+#undef EP_INFO
 };
-#define DUMMY_ENDPOINTSARRAY_SIZE(ep_name)
+
+#define DUMMY_ENDPOINTSARRAY_SIZE(ep_info)
 
 /*-*/
 
@@ -938,9 +972,10 @@ static void init_dummy_udc_hw(struct dummy *dum)
for (i = 0; i  DUMMY_ENDPOINTS; i++) {
struct dummy_ep *ep = dum-ep[i];
 
-   if (!ep_name[i])
+   if (!ep_info[i].name)
break;
-   ep-ep.name = ep_name[i];
+   ep-ep.name = ep_info[i].name;
+   ep-ep.caps = ep_info[i].caps;
ep-ep.ops = dummy_ep_ops;
list_add_tail(ep-ep.ep_list, dum-gadget.ep_list);
ep-halted = ep-wedged = ep-already_seen =
@@ -1684,7 +1719,7 @@ static void dummy_timer(unsigned long _dum_hcd)
}
 
for (i = 0; i  DUMMY_ENDPOINTS; i++) {
-   if (!ep_name[i])
+   if (!ep_info[i].name)
break;
dum-ep[i].already_seen = 0;
}
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 13/48] usb: gadget: fotg210-udc: add ep capabilities support

2015-07-14 Thread Robert Baldyga
Convert endpoint configuration to new capabilities model.

Signed-off-by: Robert Baldyga r.bald...@samsung.com
---
 drivers/usb/gadget/udc/fotg210-udc.c | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/drivers/usb/gadget/udc/fotg210-udc.c 
b/drivers/usb/gadget/udc/fotg210-udc.c
index e547ea7..960c70c 100644
--- a/drivers/usb/gadget/udc/fotg210-udc.c
+++ b/drivers/usb/gadget/udc/fotg210-udc.c
@@ -1153,6 +1153,17 @@ static int fotg210_udc_probe(struct platform_device 
*pdev)
ep-ep.name = fotg210_ep_name[i];
ep-ep.ops = fotg210_ep_ops;
usb_ep_set_maxpacket_limit(ep-ep, (unsigned short) ~0);
+
+   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;
}
usb_ep_set_maxpacket_limit(fotg210-ep[0]-ep, 0x40);
fotg210-gadget.ep0 = fotg210-ep[0]-ep;
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 10/48] usb: gadget: bcm63xx_udc: add ep capabilities support

2015-07-14 Thread Robert Baldyga
Convert endpoint configuration to new capabilities model.

Signed-off-by: Robert Baldyga r.bald...@samsung.com
---
 drivers/usb/gadget/udc/bcm63xx_udc.c | 25 +
 1 file changed, 21 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/gadget/udc/bcm63xx_udc.c 
b/drivers/usb/gadget/udc/bcm63xx_udc.c
index 9db968b..c5e0894 100644
--- a/drivers/usb/gadget/udc/bcm63xx_udc.c
+++ b/drivers/usb/gadget/udc/bcm63xx_udc.c
@@ -44,9 +44,25 @@
 #define DRV_MODULE_NAMEbcm63xx_udc
 
 static const char bcm63xx_ep0name[] = ep0;
-static const char *const bcm63xx_ep_name[] = {
-   bcm63xx_ep0name,
-   ep1in-bulk, ep2out-bulk, ep3in-int, ep4out-int,
+
+static const struct {
+   const char *name;
+   const struct usb_ep_caps caps;
+} bcm63xx_ep_info[] = {
+#define EP_INFO(_name, _type, _dir) \
+   { \
+   .name = _name, \
+   .caps = USB_EP_CAPS(USB_EP_CAPS_TYPE_ ## _type, \
+   USB_EP_CAPS_DIR_ ## _dir), \
+   }
+
+   EP_INFO(bcm63xx_ep0name, CONTROL, ALL),
+   EP_INFO(ep1in-bulk,   BULK,   IN),
+   EP_INFO(ep2out-bulk,  BULK,   OUT),
+   EP_INFO(ep3in-int,INT,IN),
+   EP_INFO(ep4out-int,   INT,OUT),
+
+#undef EP_INFO
 };
 
 static bool use_fullspeed;
@@ -943,7 +959,8 @@ static int bcm63xx_init_udc_hw(struct bcm63xx_udc *udc)
for (i = 0; i  BCM63XX_NUM_EP; i++) {
struct bcm63xx_ep *bep = udc-bep[i];
 
-   bep-ep.name = bcm63xx_ep_name[i];
+   bep-ep.name = bcm63xx_ep_info[i].name;
+   bep-ep.caps = bcm63xx_ep_info[i].caps;
bep-ep_num = i;
bep-ep.ops = bcm63xx_udc_ep_ops;
list_add_tail(bep-ep.ep_list, udc-gadget.ep_list);
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 14/48] usb: gadget: fsl_qe_udc: add ep capabilities support

2015-07-14 Thread Robert Baldyga
Convert endpoint configuration to new capabilities model.

Signed-off-by: Robert Baldyga r.bald...@samsung.com
---
 drivers/usb/gadget/udc/fsl_qe_udc.c | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/drivers/usb/gadget/udc/fsl_qe_udc.c 
b/drivers/usb/gadget/udc/fsl_qe_udc.c
index e0822f1..5fb6f8b 100644
--- a/drivers/usb/gadget/udc/fsl_qe_udc.c
+++ b/drivers/usb/gadget/udc/fsl_qe_udc.c
@@ -2417,6 +2417,17 @@ static int qe_ep_config(struct qe_udc *udc, unsigned 
char pipe_num)
strcpy(ep-name, ep_name[pipe_num]);
ep-ep.name = ep_name[pipe_num];
 
+   if (pipe_num == 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;
+
ep-ep.ops = qe_ep_ops;
ep-stopped = 1;
usb_ep_set_maxpacket_limit(ep-ep, (unsigned short) ~0);
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 16/48] usb: gadget: fusb300_udc: add ep capabilities support

2015-07-14 Thread Robert Baldyga
Convert endpoint configuration to new capabilities model.

Signed-off-by: Robert Baldyga r.bald...@samsung.com
---
 drivers/usb/gadget/udc/fusb300_udc.c | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/drivers/usb/gadget/udc/fusb300_udc.c 
b/drivers/usb/gadget/udc/fusb300_udc.c
index 3970f45..948845c 100644
--- a/drivers/usb/gadget/udc/fusb300_udc.c
+++ b/drivers/usb/gadget/udc/fusb300_udc.c
@@ -1450,6 +1450,17 @@ static int fusb300_probe(struct platform_device *pdev)
ep-ep.name = fusb300_ep_name[i];
ep-ep.ops = fusb300_ep_ops;
usb_ep_set_maxpacket_limit(ep-ep, HS_BULK_MAX_PACKET_SIZE);
+
+   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;
}
usb_ep_set_maxpacket_limit(fusb300-ep[0]-ep, HS_CTL_MAX_PACKET_SIZE);
fusb300-ep[0]-epnum = 0;
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 15/48] usb: gadget: fsl_udc_core: add ep capabilities support

2015-07-14 Thread Robert Baldyga
Convert endpoint configuration to new capabilities model.

Signed-off-by: Robert Baldyga r.bald...@samsung.com
---
 drivers/usb/gadget/udc/fsl_udc_core.c | 13 +
 1 file changed, 13 insertions(+)

diff --git a/drivers/usb/gadget/udc/fsl_udc_core.c 
b/drivers/usb/gadget/udc/fsl_udc_core.c
index c60022b..aab5221 100644
--- a/drivers/usb/gadget/udc/fsl_udc_core.c
+++ b/drivers/usb/gadget/udc/fsl_udc_core.c
@@ -2313,6 +2313,19 @@ static int struct_ep_setup(struct fsl_udc *udc, unsigned 
char index,
ep-ep.ops = fsl_ep_ops;
ep-stopped = 0;
 
+   if (index == 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;
+   }
+
+   if (index  1)
+   ep-ep.caps.dir_in = true;
+   else
+   ep-ep.caps.dir_out = true;
+
/* for ep0: maxP defined in desc
 * for other eps, maxP is set by epautoconfig() called by gadget layer
 */
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v3 1/6] ARM: OMAP4: PRM: Remove hardcoding of PRM_IO_PMCTRL_OFFSET register

2015-07-14 Thread Keerthy
PRM_IO_PMCTRL_OFFSET need not be same for all SOCs hence
remove hardcoding and use the value provided by the omap_prcm_irq_setup
structure.

Signed-off-by: Keerthy j-keer...@ti.com
---
 arch/arm/mach-omap2/prcm-common.h |  1 +
 arch/arm/mach-omap2/prm44xx.c | 11 ++-
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/arch/arm/mach-omap2/prcm-common.h 
b/arch/arm/mach-omap2/prcm-common.h
index 6ae0b3a..2e60406 100644
--- a/arch/arm/mach-omap2/prcm-common.h
+++ b/arch/arm/mach-omap2/prcm-common.h
@@ -494,6 +494,7 @@ struct omap_prcm_irq {
 struct omap_prcm_irq_setup {
u16 ack;
u16 mask;
+   u16 pm_ctrl;
u8 nr_regs;
u8 nr_irqs;
const struct omap_prcm_irq *irqs;
diff --git a/arch/arm/mach-omap2/prm44xx.c b/arch/arm/mach-omap2/prm44xx.c
index 4541700..8149e5a 100644
--- a/arch/arm/mach-omap2/prm44xx.c
+++ b/arch/arm/mach-omap2/prm44xx.c
@@ -45,6 +45,7 @@ static const struct omap_prcm_irq omap4_prcm_irqs[] = {
 static struct omap_prcm_irq_setup omap4_prcm_irq_setup = {
.ack= OMAP4_PRM_IRQSTATUS_MPU_OFFSET,
.mask   = OMAP4_PRM_IRQENABLE_MPU_OFFSET,
+   .pm_ctrl= OMAP4_PRM_IO_PMCTRL_OFFSET,
.nr_regs= 2,
.irqs   = omap4_prcm_irqs,
.nr_irqs= ARRAY_SIZE(omap4_prcm_irqs),
@@ -306,10 +307,10 @@ static void omap44xx_prm_reconfigure_io_chain(void)
omap4_prm_rmw_inst_reg_bits(OMAP4430_WUCLK_CTRL_MASK,
OMAP4430_WUCLK_CTRL_MASK,
inst,
-   OMAP4_PRM_IO_PMCTRL_OFFSET);
+   omap4_prcm_irq_setup.pm_ctrl);
omap_test_timeout(
(((omap4_prm_read_inst_reg(inst,
-  OMAP4_PRM_IO_PMCTRL_OFFSET) 
+  omap4_prcm_irq_setup.pm_ctrl) 
   OMAP4430_WUCLK_STATUS_MASK) 
  OMAP4430_WUCLK_STATUS_SHIFT) == 1),
MAX_IOPAD_LATCH_TIME, i);
@@ -319,10 +320,10 @@ static void omap44xx_prm_reconfigure_io_chain(void)
/* Trigger WUCLKIN disable */
omap4_prm_rmw_inst_reg_bits(OMAP4430_WUCLK_CTRL_MASK, 0x0,
inst,
-   OMAP4_PRM_IO_PMCTRL_OFFSET);
+   omap4_prcm_irq_setup.pm_ctrl);
omap_test_timeout(
(((omap4_prm_read_inst_reg(inst,
-  OMAP4_PRM_IO_PMCTRL_OFFSET) 
+  omap4_prcm_irq_setup.pm_ctrl) 
   OMAP4430_WUCLK_STATUS_MASK) 
  OMAP4430_WUCLK_STATUS_SHIFT) == 0),
MAX_IOPAD_LATCH_TIME, i);
@@ -350,7 +351,7 @@ static void __init omap44xx_prm_enable_io_wakeup(void)
omap4_prm_rmw_inst_reg_bits(OMAP4430_GLOBAL_WUEN_MASK,
OMAP4430_GLOBAL_WUEN_MASK,
inst,
-   OMAP4_PRM_IO_PMCTRL_OFFSET);
+   omap4_prcm_irq_setup.pm_ctrl);
 }
 
 /**
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v3 2/6] ARM: AM43xx: Add the PRM IRQ register offsets

2015-07-14 Thread Keerthy
Add the PRM IRQ register offsets.

Signed-off-by: Keerthy j-keer...@ti.com
---
 arch/arm/mach-omap2/prcm43xx.h | 5 +
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/mach-omap2/prcm43xx.h b/arch/arm/mach-omap2/prcm43xx.h
index 7eebc27..d716d2e 100644
--- a/arch/arm/mach-omap2/prcm43xx.h
+++ b/arch/arm/mach-omap2/prcm43xx.h
@@ -25,6 +25,10 @@
 #define AM43XX_PRM_WKUP_INST   0x2000
 #define AM43XX_PRM_DEVICE_INST 0x4000
 
+/* PRM_IRQ offsets */
+#define AM43XX_PRM_IRQSTATUS_MPU_OFFSET0x0004
+#define AM43XX_PRM_IRQENABLE_MPU_OFFSET0x0008
+
 /* RM RSTCTRL offsets */
 #define AM43XX_RM_PER_RSTCTRL_OFFSET   0x0010
 #define AM43XX_RM_GFX_RSTCTRL_OFFSET   0x0010
@@ -146,6 +150,7 @@
 #define AM43XX_CM_PER_HDQ1W_CLKCTRL_OFFSET 0x04a0
 #define AM43XX_CM_PER_VPFE0_CLKCTRL_OFFSET 0x0068
 #define AM43XX_CM_PER_VPFE1_CLKCTRL_OFFSET 0x0070
+#define AM43XX_PRM_IO_PMCTRL_OFFSET0x0024
 #define AM43XX_CM_PER_EMIF_CLKCTRL_OFFSET  0x0720
 
 #endif
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v5 8/8] ARM: DTS: dra7x: Integrate sDMA crossbar

2015-07-14 Thread Tony Lindgren
* Tony Lindgren t...@atomide.com [150409 12:17]:
 * Peter Ujfalusi peter.ujfal...@ti.com [150409 12:07]:
  On 04/09/2015 10:01 PM, Tony Lindgren wrote:
   * Peter Ujfalusi peter.ujfal...@ti.com [150409 11:55]:
   On 04/09/2015 06:18 PM, Tony Lindgren wrote:
   * Peter Ujfalusi peter.ujfal...@ti.com [150409 02:37]:
   The sDMA requests are routed through the DMA crossbar and without the
   crossbar only peripherals using DMA request 0-127 can be used.
  
   I assume this can be merged separately from the driver
   changes?
  
   Unfortunately not. We need to have the drivers in place for the DTS 
   changes to
   work.
   
   Right but just merging the driver changes presumably won't
   break things?
  
  No, they will not break anything. We just do not have control over the DMA
  crossbar (in a same way as we don't have control right now).
 
 OK good to hear.

Looks like the related DMA changes are now merged, so applying this
into omap-for-v4.3/dt thanks.

Tony
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 11/48] usb: gadget: bdc: add ep capabilities support

2015-07-14 Thread Robert Baldyga
Convert endpoint configuration to new capabilities model.

Signed-off-by: Robert Baldyga r.bald...@samsung.com
---
 drivers/usb/gadget/udc/bdc/bdc_ep.c | 9 +
 1 file changed, 9 insertions(+)

diff --git a/drivers/usb/gadget/udc/bdc/bdc_ep.c 
b/drivers/usb/gadget/udc/bdc/bdc_ep.c
index b04980c..f9a8f57 100644
--- a/drivers/usb/gadget/udc/bdc/bdc_ep.c
+++ b/drivers/usb/gadget/udc/bdc/bdc_ep.c
@@ -1952,12 +1952,18 @@ static int init_ep(struct bdc *bdc, u32 epnum, u32 dir)
ep-bdc = bdc;
ep-dir = dir;
 
+   if (dir)
+   ep-usb_ep.caps.dir_in = true;
+   else
+   ep-usb_ep.caps.dir_out = true;
+
/* ep-ep_num is the index inside bdc_ep */
if (epnum == 1) {
ep-ep_num = 1;
bdc-bdc_ep_array[ep-ep_num] = ep;
snprintf(ep-name, sizeof(ep-name), ep%d, epnum - 1);
usb_ep_set_maxpacket_limit(ep-usb_ep, EP0_MAX_PKT_SIZE);
+   ep-usb_ep.caps.type_control = true;
ep-comp_desc = NULL;
bdc-gadget.ep0 = ep-usb_ep;
} else {
@@ -1971,6 +1977,9 @@ static int init_ep(struct bdc *bdc, u32 epnum, u32 dir)
 dir  1 ? in : out);
 
usb_ep_set_maxpacket_limit(ep-usb_ep, 1024);
+   ep-usb_ep.caps.type_iso = true;
+   ep-usb_ep.caps.type_bulk = true;
+   ep-usb_ep.caps.type_int = true;
ep-usb_ep.max_streams = 0;
list_add_tail(ep-usb_ep.ep_list, bdc-gadget.ep_list);
}
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 34/48] usb: musb: gadget: add ep capabilities support

2015-07-14 Thread Robert Baldyga
Convert endpoint configuration to new capabilities model.

Signed-off-by: Robert Baldyga r.bald...@samsung.com
---
 drivers/usb/musb/musb_gadget.c | 12 
 1 file changed, 12 insertions(+)

diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c
index 625d482f..043248a 100644
--- a/drivers/usb/musb/musb_gadget.c
+++ b/drivers/usb/musb/musb_gadget.c
@@ -1729,6 +1729,7 @@ init_peripheral_ep(struct musb *musb, struct musb_ep *ep, 
u8 epnum, int is_in)
INIT_LIST_HEAD(ep-end_point.ep_list);
if (!epnum) {
usb_ep_set_maxpacket_limit(ep-end_point, 64);
+   ep-end_point.caps.type_control = true;
ep-end_point.ops = musb_g_ep0_ops;
musb-g.ep0 = ep-end_point;
} else {
@@ -1736,9 +1737,20 @@ init_peripheral_ep(struct musb *musb, struct musb_ep 
*ep, u8 epnum, int is_in)
usb_ep_set_maxpacket_limit(ep-end_point, 
hw_ep-max_packet_sz_tx);
else
usb_ep_set_maxpacket_limit(ep-end_point, 
hw_ep-max_packet_sz_rx);
+   ep-end_point.caps.type_iso = true;
+   ep-end_point.caps.type_bulk = true;
+   ep-end_point.caps.type_int = true;
ep-end_point.ops = musb_ep_ops;
list_add_tail(ep-end_point.ep_list, musb-g.ep_list);
}
+
+   if (!epnum || hw_ep-is_shared_fifo) {
+   ep-end_point.caps.dir_in = true;
+   ep-end_point.caps.dir_out = true;
+   } else if (is_in)
+   ep-end_point.caps.dir_in = true;
+   else
+   ep-end_point.caps.dir_out = true;
 }
 
 /*
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 30/48] usb: gadget: s3c-hsudc: add ep capabilities support

2015-07-14 Thread Robert Baldyga
Convert endpoint configuration to new capabilities model.

Signed-off-by: Robert Baldyga r.bald...@samsung.com
---
 drivers/usb/gadget/udc/s3c-hsudc.c | 15 +++
 1 file changed, 15 insertions(+)

diff --git a/drivers/usb/gadget/udc/s3c-hsudc.c 
b/drivers/usb/gadget/udc/s3c-hsudc.c
index 85a712a..e9def42 100644
--- a/drivers/usb/gadget/udc/s3c-hsudc.c
+++ b/drivers/usb/gadget/udc/s3c-hsudc.c
@@ -1005,6 +1005,21 @@ static void s3c_hsudc_initep(struct s3c_hsudc *hsudc,
hsep-stopped = 0;
hsep-wedge = 0;
 
+   if (epnum == 0) {
+   hsep-ep.caps.type_control = true;
+   hsep-ep.caps.dir_in = true;
+   hsep-ep.caps.dir_out = true;
+   } else {
+   hsep-ep.caps.type_iso = true;
+   hsep-ep.caps.type_bulk = true;
+   hsep-ep.caps.type_int = true;
+   }
+
+   if (epnum  1)
+   hsep-ep.caps.dir_in = true;
+   else
+   hsep-ep.caps.dir_out = true;
+
set_index(hsudc, epnum);
writel(hsep-ep.maxpacket, hsudc-regs + S3C_MPR);
 }
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 37/48] usb: gadget: epautoconf: add endpoint capabilities flags verification

2015-07-14 Thread Robert Baldyga
Introduce endpoint matching mechanism basing on endpoint capabilities
flags. We check if endpoint supports transfer type and direction requested
in ep descriptor. Since we have this new endpoint matching mechanism
there is no need to have old code guessing endpoint capabilities basing
on its name, so we are getting rid of it. Remove also the obsolete comment.

Signed-off-by: Robert Baldyga r.bald...@samsung.com
---
 drivers/usb/gadget/epautoconf.c | 96 +
 1 file changed, 30 insertions(+), 66 deletions(-)

diff --git a/drivers/usb/gadget/epautoconf.c b/drivers/usb/gadget/epautoconf.c
index 8e00ca7..af4b10a 100644
--- a/drivers/usb/gadget/epautoconf.c
+++ b/drivers/usb/gadget/epautoconf.c
@@ -22,22 +22,6 @@
 
 #include gadget_chips.h
 
-/*
- * This should work with endpoints from controller drivers sharing the
- * same endpoint naming convention.  By example:
- *
- * - ep1, ep2, ... address is fixed, not direction or type
- * - ep1in, ep2out, ... address and direction are fixed, not type
- * - ep1-bulk, ep2-bulk, ... address and type are fixed, not direction
- * - ep1in-bulk, ep2out-iso, ... all three are fixed
- * - ep-* ... no functionality restrictions
- *
- * Type suffixes are -bulk, -iso, or -int.  Numbers are decimal.
- * Less common restrictions are implied by gadget_is_*().
- *
- * NOTE:  each endpoint is unidirectional, as specified by its USB
- * descriptor; and isn't specific to a configuration or altsetting.
- */
 static int
 ep_matches (
struct usb_gadget   *gadget,
@@ -47,7 +31,6 @@ ep_matches (
 )
 {
u8  type;
-   const char  *tmp;
u16 max;
 
int num_req_streams = 0;
@@ -56,58 +39,39 @@ ep_matches (
if (ep-claimed)
return 0;
 
-   /* only support ep0 for portable CONTROL traffic */
type = usb_endpoint_type(desc);
-   if (USB_ENDPOINT_XFER_CONTROL == type)
-   return 0;
-
-   /* some other naming convention */
-   if ('e' != ep-name[0])
+   switch (type) {
+   case USB_ENDPOINT_XFER_CONTROL:
+   /* only support ep0 for portable CONTROL traffic */
return 0;
+   case USB_ENDPOINT_XFER_ISOC:
+   if (!ep-caps.type_iso)
+   return 0;
+   break;
+   case USB_ENDPOINT_XFER_BULK:
+   if (!ep-caps.type_bulk)
+   return 0;
+   break;
+   case USB_ENDPOINT_XFER_INT:
+   /* bulk endpoints handle interrupt transfers,
+* except the toggle-quirky iso-synch kind
+*/
+   if (!ep-caps.type_int  !ep-caps.type_bulk)
+   return 0;
+   /* for now, avoid PXA interrupt-in;
+* it's documented as never using DATA1.
+*/
+   if (gadget_is_pxa(gadget)  ep-caps.type_int)
+   return 0;
+   break;
+   }
 
-   /* type-restriction:  -iso, -bulk, or -int.
-* direction-restriction:  in, out.
-*/
-   if ('-' != ep-name[2]) {
-   tmp = strrchr (ep-name, '-');
-   if (tmp) {
-   switch (type) {
-   case USB_ENDPOINT_XFER_INT:
-   /* bulk endpoints handle interrupt transfers,
-* except the toggle-quirky iso-synch kind
-*/
-   if ('s' == tmp[2])  // == -iso
-   return 0;
-   /* for now, avoid PXA interrupt-in;
-* it's documented as never using DATA1.
-*/
-   if (gadget_is_pxa (gadget)
-'i' == tmp [1])
-   return 0;
-   break;
-   case USB_ENDPOINT_XFER_BULK:
-   if ('b' != tmp[1])  // != -bulk
-   return 0;
-   break;
-   case USB_ENDPOINT_XFER_ISOC:
-   if ('s' != tmp[2])  // != -iso
-   return 0;
-   }
-   } else {
-   tmp = ep-name + strlen (ep-name);
-   }
-
-   /* direction-restriction:  ..in-.., out-.. */
-   tmp--;
-   if (!isdigit (*tmp)) {
-   if (desc-bEndpointAddress  USB_DIR_IN) {
-   if ('n' != *tmp)
-   return 0;
-   } else {
-   if ('t' != *tmp)
-   return 0;
-   

[PATCH v2 41/48] usb: gadget: add 'ep_match' callback to usb_gadget_ops

2015-07-14 Thread Robert Baldyga
This callback will be called by epautoconf to allow UDC driver match best
endpoint for specific descriptor. It's intended to supply mechanism which
allows to get rid of chip-specific endpoint matching code from epautoconf.

Signed-off-by: Robert Baldyga r.bald...@samsung.com
---
 include/linux/usb/gadget.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
index e6cbc25..0041bb9 100644
--- a/include/linux/usb/gadget.h
+++ b/include/linux/usb/gadget.h
@@ -534,6 +534,9 @@ struct usb_gadget_ops {
int (*udc_start)(struct usb_gadget *,
struct usb_gadget_driver *);
int (*udc_stop)(struct usb_gadget *);
+   struct usb_ep *(*match_ep)(struct usb_gadget *,
+   struct usb_endpoint_descriptor *,
+   struct usb_ss_ep_comp_descriptor *);
 };
 
 /**
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 36/48] usb: gadget: atmel_usba_udc: add ep capabilities support

2015-07-14 Thread Robert Baldyga
Convert endpoint configuration to new capabilities model.

Signed-off-by: Robert Baldyga r.bald...@samsung.com
---
 drivers/usb/gadget/udc/atmel_usba_udc.c | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.c 
b/drivers/usb/gadget/udc/atmel_usba_udc.c
index 37d414e..267d84f 100644
--- a/drivers/usb/gadget/udc/atmel_usba_udc.c
+++ b/drivers/usb/gadget/udc/atmel_usba_udc.c
@@ -2067,6 +2067,17 @@ static struct usba_ep * usba_udc_pdata(struct 
platform_device *pdev,
ep-can_dma = pdata-ep[i].can_dma;
ep-can_isoc = pdata-ep[i].can_isoc;
 
+   if (i == 0) {
+   ep-ep.caps.type_control = true;
+   } else {
+   ep-ep.caps.type_iso = ep-can_isoc;
+   ep-ep.caps.type_bulk = true;
+   ep-ep.caps.type_int = true;
+   }
+
+   ep-ep.caps.dir_in = true;
+   ep-ep.caps.dir_out = true;
+
if (i)
list_add_tail(ep-ep.ep_list, udc-gadget.ep_list);
}
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 35/48] usb: renesas: gadget: add ep capabilities support

2015-07-14 Thread Robert Baldyga
Convert endpoint configuration to new capabilities model.

Signed-off-by: Robert Baldyga r.bald...@samsung.com
---
 drivers/usb/renesas_usbhs/mod_gadget.c | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/drivers/usb/renesas_usbhs/mod_gadget.c 
b/drivers/usb/renesas_usbhs/mod_gadget.c
index dc2aa32..ed8d890 100644
--- a/drivers/usb/renesas_usbhs/mod_gadget.c
+++ b/drivers/usb/renesas_usbhs/mod_gadget.c
@@ -1041,12 +1041,18 @@ int usbhs_mod_gadget_probe(struct usbhs_priv *priv)
if (usbhsg_is_dcp(uep)) {
gpriv-gadget.ep0 = uep-ep;
usb_ep_set_maxpacket_limit(uep-ep, 64);
+   uep-ep.caps.type_control = true;
}
/* init normal pipe */
else {
usb_ep_set_maxpacket_limit(uep-ep, 512);
+   uep-ep.caps.type_iso = true;
+   uep-ep.caps.type_bulk = true;
+   uep-ep.caps.type_int = true;
list_add_tail(uep-ep.ep_list, gpriv-gadget.ep_list);
}
+   uep-ep.caps.dir_in = true;
+   uep-ep.caps.dir_out = true;
}
 
ret = usb_add_gadget_udc(dev, gpriv-gadget);
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 39/48] usb: gadget: epautoconf: remove ep and desc configuration from ep_matches()

2015-07-14 Thread Robert Baldyga
As function ep_matches() is used to match endpoint with usb descriptor it's
highly unintuitive that it modifies endpoint and descriptor structures fields.
This patch moves code configuring ep and desc from ep_matches() to
usb_ep_autoconfig_ss(), so now function ep_matches() does nothing more than
its name is suggesting.

Signed-off-by: Robert Baldyga r.bald...@samsung.com
---
 drivers/usb/gadget/epautoconf.c | 66 +
 1 file changed, 34 insertions(+), 32 deletions(-)

diff --git a/drivers/usb/gadget/epautoconf.c b/drivers/usb/gadget/epautoconf.c
index 4f66e9d73..d00b443 100644
--- a/drivers/usb/gadget/epautoconf.c
+++ b/drivers/usb/gadget/epautoconf.c
@@ -82,13 +82,6 @@ ep_matches (
 
}
 
-   /*
-* If the protocol driver hasn't yet decided on wMaxPacketSize
-* and wants to know the maximum possible, provide the info.
-*/
-   if (desc-wMaxPacketSize == 0)
-   desc-wMaxPacketSize = cpu_to_le16(ep-maxpacket_limit);
-
/* endpoint maxpacket size is an input parameter, except for bulk
 * where it's an output parameter representing the full speed limit.
 * the usb spec fixes high speed bulk maxpacket at 512 bytes.
@@ -119,31 +112,6 @@ ep_matches (
 
/* MATCH!! */
 
-   /* report address */
-   desc-bEndpointAddress = USB_DIR_IN;
-   if (isdigit (ep-name [2])) {
-   u8  num = simple_strtoul (ep-name [2], NULL, 10);
-   desc-bEndpointAddress |= num;
-   } else if (desc-bEndpointAddress  USB_DIR_IN) {
-   if (++gadget-in_epnum  15)
-   return 0;
-   desc-bEndpointAddress = USB_DIR_IN | gadget-in_epnum;
-   } else {
-   if (++gadget-out_epnum  15)
-   return 0;
-   desc-bEndpointAddress |= gadget-out_epnum;
-   }
-
-   /* report (variable) full speed bulk maxpacket */
-   if ((USB_ENDPOINT_XFER_BULK == type)  !ep_comp) {
-   int size = ep-maxpacket_limit;
-
-   /* min() doesn't work on bitfields with gcc-3.5 */
-   if (size  64)
-   size = 64;
-   desc-wMaxPacketSize = cpu_to_le16(size);
-   }
-   ep-address = desc-bEndpointAddress;
return 1;
 }
 
@@ -280,6 +248,40 @@ struct usb_ep *usb_ep_autoconfig_ss(
/* Fail */
return NULL;
 found_ep:
+
+   /*
+* If the protocol driver hasn't yet decided on wMaxPacketSize
+* and wants to know the maximum possible, provide the info.
+*/
+   if (desc-wMaxPacketSize == 0)
+   desc-wMaxPacketSize = cpu_to_le16(ep-maxpacket_limit);
+
+   /* report address */
+   desc-bEndpointAddress = USB_DIR_IN;
+   if (isdigit(ep-name[2])) {
+   u8 num = simple_strtoul(ep-name[2], NULL, 10);
+   desc-bEndpointAddress |= num;
+   } else if (desc-bEndpointAddress  USB_DIR_IN) {
+   if (++gadget-in_epnum  15)
+   return 0;
+   desc-bEndpointAddress = USB_DIR_IN | gadget-in_epnum;
+   } else {
+   if (++gadget-out_epnum  15)
+   return 0;
+   desc-bEndpointAddress |= gadget-out_epnum;
+   }
+
+   /* report (variable) full speed bulk maxpacket */
+   if ((USB_ENDPOINT_XFER_BULK == type)  !ep_comp) {
+   int size = ep-maxpacket_limit;
+
+   /* min() doesn't work on bitfields with gcc-3.5 */
+   if (size  64)
+   size = 64;
+   desc-wMaxPacketSize = cpu_to_le16(size);
+   }
+
+   ep-address = desc-bEndpointAddress;
ep-desc = NULL;
ep-comp_desc = NULL;
ep-claimed = true;
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v5 6/6] ARM: dts: am335x-boneblack: Use new binding for HDMI

2015-07-14 Thread Tony Lindgren
* Jyri Sarha jsa...@ti.com [150508 04:29]:
 Use new binding for the external tda19988 HDMI encoder.

Applying this into omap-for-v4.3/dt thanks.

Tony
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [GIT PULL] clk: ti: clock driver code migration to drivers

2015-07-14 Thread Tony Lindgren
* Tero Kristo t-kri...@ti.com [150714 03:34]:
 On 07/14/2015 12:54 PM, Tony Lindgren wrote:
 * Tero Kristo t-kri...@ti.com [150714 01:56]:
 
 This pull request contains the TI clock driver set to move the clock
 implementations under clock driver. Some small portions of the clock driver
 code still remain under mach-omap2 after this, it should be decided whether
 this code is now obsolete and should be deleted or should someone try to fix
 it.
 
 Hmm care to clarify what is obsolete or broken after this series?
 
 Not after this series, was broken/obsolete already before.
 
 A couple of omap2/omap3 specific clock files still remain under mach-omap2,
 they are DVFS related. OMAP3 core dvfs support is currently completely
 unused (this could probably be removed, or shall we re-introduce the painful
 core dvfs at some point again?), and parts of the omap2 core dpll handling
 code should probably be re-written; or at least verified that it actually
 works properly. I can't test OMAP2 DVFS myself so don't dare to fiddle with
 it I could probably try to get some sort of DVFS test case to work on
 the board farm OMAP2 board I have access to though, I can investigate this.

People seem to still want the 1 GiHz support, but I think that only
depends on the SmartReflex and some kind of replacement for
voltagedomains. So if the core DVFS support is unused, I doubt it's
very high on anybody's list right now.
 
 And I take it's not obsolete or broken because of this series? :)
 
 No, this series does not touch the above mentioned pieces of code, so this
 definitely should not break anything. :)

OK thanks for confirming that.

Regards,

Tony
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 3/3] ARM: dts: dra7: Add syscon-pllreset syscon to SATA PHY

2015-07-14 Thread Roger Quadros
On 14/07/15 13:34, Tony Lindgren wrote:
 * Roger Quadros rog...@ti.com [150512 09:08]:
 This register is required to be passed to the SATA PHY driver
 to workaround errata i783 (SATA Lockup After SATA DPLL Unlock/Relock).

 Signed-off-by: Roger Quadros rog...@ti.com
 Signed-off-by: Sekhar Nori nsek...@ti.com
 ---
  arch/arm/boot/dts/dra7.dtsi | 1 +
  1 file changed, 1 insertion(+)

 diff --git a/arch/arm/boot/dts/dra7.dtsi b/arch/arm/boot/dts/dra7.dtsi
 index f03a091..260f300 100644
 --- a/arch/arm/boot/dts/dra7.dtsi
 +++ b/arch/arm/boot/dts/dra7.dtsi
 @@ -1135,6 +1135,7 @@
  ctrl-module = omap_control_sata;
  clocks = sys_clkin1, sata_ref_clk;
  clock-names = sysclk, refclk;
 +syscon-pllreset = dra7_ctrl_core 0x3fc;
  #phy-cells = 0;
  };
  
 
 Looks like this one is still pending driver changes, please
 resend when those are resolved. I'll untag this one for now.

I've sent a v2 of this series here
http://thread.gmane.org/gmane.linux.kernel/1967419

cheers,
-roger
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 42/48] usb: gadget: epautoconf: use 'ep_match' gadget callback

2015-07-14 Thread Sergei Shtylyov

Hello.

On 7/14/2015 12:39 PM, Robert Baldyga wrote:


If gadget has set 'ep_match' callback we prefer to call it first to allow
UDC driver to find the best matching endpoint basing on chip-specific best
usage knowledge.



Signed-off-by: Robert Baldyga r.bald...@samsung.com
---
  drivers/usb/gadget/epautoconf.c | 6 ++
  1 file changed, 6 insertions(+)



diff --git a/drivers/usb/gadget/epautoconf.c b/drivers/usb/gadget/epautoconf.c
index ee0d4e6..92a1a4c 100644
--- a/drivers/usb/gadget/epautoconf.c
+++ b/drivers/usb/gadget/epautoconf.c
@@ -165,6 +165,12 @@ struct usb_ep *usb_ep_autoconfig_ss(

type = desc-bmAttributes  USB_ENDPOINT_XFERTYPE_MASK;

+   if (gadget-ops-match_ep) {
+   ep = gadget-ops-match_ep(gadget, desc, ep_comp);
+   if (ep)
+   goto found_ep;
+   }
+


   I think this patch should be merged with the previous one.

[...]

WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 0/2] CLK: TI: add dpll_clksel_mac_clk node

2015-07-14 Thread Tony Lindgren
* Keerthy a0393...@ti.com [150625 06:48]:
 
 On Thursday 18 June 2015 02:36 PM, Mugunthan V N wrote:
 On Thursday 18 June 2015 01:31 PM, Keerthy wrote:
 The series adds the missing clock node needed for cpsw.
 
 Keerthy (2):
CLK: TI: add dpll_clksel_mac_clk node
ARM: dts: am4372: Set the default clock rate for dpll_clksel_mac_clk
  clock
 
   arch/arm/boot/dts/am4372.dtsi| 7 +--
   arch/arm/boot/dts/am43xx-clocks.dtsi | 9 +
   drivers/clk/ti/clk-43xx.c| 1 +
   3 files changed, 15 insertions(+), 2 deletions(-)
 
 
 Tested-by: Mugunthan V N mugunthan...@ti.com
 
 Thanks Mugunthan.
 
 A gentle ping on this series.

Tero, care to review this series?

Regards,

Tony
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 48/48] usb: gadget: epautoconf: cleanup dead code

2015-07-14 Thread Robert Baldyga
Function find_ep() is no longer needed here, so we can remove it.
We also don't use anything from gadget_chips.h header any longer.

Signed-off-by: Robert Baldyga r.bald...@samsung.com
---
 drivers/usb/gadget/epautoconf.c | 14 --
 1 file changed, 14 deletions(-)

diff --git a/drivers/usb/gadget/epautoconf.c b/drivers/usb/gadget/epautoconf.c
index e9a8682..9a80925 100644
--- a/drivers/usb/gadget/epautoconf.c
+++ b/drivers/usb/gadget/epautoconf.c
@@ -20,20 +20,6 @@
 #include linux/usb/ch9.h
 #include linux/usb/gadget.h
 
-#include gadget_chips.h
-
-static struct usb_ep *
-find_ep (struct usb_gadget *gadget, const char *name)
-{
-   struct usb_ep   *ep;
-
-   list_for_each_entry (ep, gadget-ep_list, ep_list) {
-   if (0 == strcmp (ep-name, name))
-   return ep;
-   }
-   return NULL;
-}
-
 /**
  * usb_ep_autoconfig_ss() - choose an endpoint matching the ep
  * descriptor and ep companion descriptor
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 43/48] usb: gadget: udc: add usb_gadget_ep_match_desc() function

2015-07-14 Thread Robert Baldyga
Add function matching endpoint with ep descriptor. This function checks if
hardware endponit can fulfill requirements requested in descriptor. This
function can be used by UDC drivers in match_ep() callback to avoid writing
lots of repetitive code.

Signed-off-by: Robert Baldyga r.bald...@samsung.com
---
 drivers/usb/gadget/udc/udc-core.c | 69 +++
 include/linux/usb/gadget.h|  8 +
 2 files changed, 77 insertions(+)

diff --git a/drivers/usb/gadget/udc/udc-core.c 
b/drivers/usb/gadget/udc/udc-core.c
index d69c355..2dff8df 100644
--- a/drivers/usb/gadget/udc/udc-core.c
+++ b/drivers/usb/gadget/udc/udc-core.c
@@ -129,6 +129,75 @@ EXPORT_SYMBOL_GPL(usb_gadget_giveback_request);
 
 /* - */
 
+int usb_gadget_ep_match_desc(struct usb_gadget *gadget,
+   struct usb_ep *ep, struct usb_endpoint_descriptor *desc,
+   struct usb_ss_ep_comp_descriptor *ep_comp)
+{
+   u8  type;
+   u16 max;
+   int num_req_streams = 0;
+
+   /* endpoint already claimed? */
+   if (ep-claimed)
+   return 0;
+
+   type = usb_endpoint_type(desc);
+   max = 0x7ff  usb_endpoint_maxp(desc);
+
+   if (usb_endpoint_dir_in(desc)  !ep-caps.dir_in)
+   return 0;
+   else if (!ep-caps.dir_out)
+   return 0;
+
+   if (max  ep-maxpacket_limit)
+   return 0;
+
+   /* high bandwidth works only at high speed */
+   if (!gadget_is_dualspeed(gadget)  usb_endpoint_maxp(desc)  (311))
+   return 0;
+
+   switch (type) {
+   case USB_ENDPOINT_XFER_CONTROL:
+   /* only support ep0 for portable CONTROL traffic */
+   return 0;
+   case USB_ENDPOINT_XFER_ISOC:
+   if (!ep-caps.type_iso)
+   return 0;
+   /* ISO:  limit 1023 bytes full speed, 1024 high/super speed */
+   if (!gadget_is_dualspeed(gadget)  max  1023)
+   return 0;
+   break;
+   case USB_ENDPOINT_XFER_BULK:
+   if (!ep-caps.type_bulk)
+   return 0;
+   if (ep_comp  gadget_is_superspeed(gadget)) {
+   /* Get the number of required streams from the
+* EP companion descriptor and see if the EP
+* matches it
+*/
+   num_req_streams = ep_comp-bmAttributes  0x1f;
+   if (num_req_streams  ep-max_streams)
+   return 0;
+   }
+   break;
+   case USB_ENDPOINT_XFER_INT:
+   /* Bulk endpoints handle interrupt transfers,
+* except the toggle-quirky iso-synch kind
+*/
+   if (!ep-caps.type_int  !ep-caps.type_bulk)
+   return 0;
+   /* INT:  limit 64 bytes full speed, 1024 high/super speed */
+   if (!gadget_is_dualspeed(gadget)  max  64)
+   return 0;
+   break;
+   }
+
+   return 1;
+}
+EXPORT_SYMBOL_GPL(usb_gadget_ep_match_desc);
+
+/* - */
+
 static void usb_gadget_state_work(struct work_struct *work)
 {
struct usb_gadget *gadget = work_to_gadget(work);
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
index 0041bb9..77e2c1e 100644
--- a/include/linux/usb/gadget.h
+++ b/include/linux/usb/gadget.h
@@ -1079,6 +1079,14 @@ extern void usb_gadget_giveback_request(struct usb_ep 
*ep,
 
 /*-*/
 
+/* utility to check if endpoint caps match descriptor needs */
+
+extern int usb_gadget_ep_match_desc(struct usb_gadget *gadget,
+   struct usb_ep *ep, struct usb_endpoint_descriptor *desc,
+   struct usb_ss_ep_comp_descriptor *ep_comp);
+
+/*-*/
+
 /* utility to update vbus status for udc core, it may be scheduled */
 extern void usb_udc_vbus_handler(struct usb_gadget *gadget, bool status);
 
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 38/48] usb: gadget: epautoconf: remove pxa quirk from ep_matches()

2015-07-14 Thread Robert Baldyga
The same effect can be achieved by using capabilities flags, so now we can
get rid of handing of hardware specific limitations in generic code.

Signed-off-by: Robert Baldyga r.bald...@samsung.com
---
 drivers/usb/gadget/epautoconf.c | 5 -
 drivers/usb/gadget/udc/pxa25x_udc.c | 9 +++--
 2 files changed, 3 insertions(+), 11 deletions(-)

diff --git a/drivers/usb/gadget/epautoconf.c b/drivers/usb/gadget/epautoconf.c
index af4b10a..4f66e9d73 100644
--- a/drivers/usb/gadget/epautoconf.c
+++ b/drivers/usb/gadget/epautoconf.c
@@ -58,11 +58,6 @@ ep_matches (
 */
if (!ep-caps.type_int  !ep-caps.type_bulk)
return 0;
-   /* for now, avoid PXA interrupt-in;
-* it's documented as never using DATA1.
-*/
-   if (gadget_is_pxa(gadget)  ep-caps.type_int)
-   return 0;
break;
}
 
diff --git a/drivers/usb/gadget/udc/pxa25x_udc.c 
b/drivers/usb/gadget/udc/pxa25x_udc.c
index 1301e29..f53e526 100644
--- a/drivers/usb/gadget/udc/pxa25x_udc.c
+++ b/drivers/usb/gadget/udc/pxa25x_udc.c
@@ -1898,8 +1898,7 @@ static struct pxa25x_udc memory = {
.name   = ep5in-int,
.ops= pxa25x_ep_ops,
.maxpacket  = INT_FIFO_SIZE,
-   .caps   = USB_EP_CAPS(USB_EP_CAPS_TYPE_INT,
-   USB_EP_CAPS_DIR_IN),
+   .caps   = USB_EP_CAPS(0, 0),
},
.dev= memory,
.fifo_size  = INT_FIFO_SIZE,
@@ -1977,8 +1976,7 @@ static struct pxa25x_udc memory = {
.name   = ep10in-int,
.ops= pxa25x_ep_ops,
.maxpacket  = INT_FIFO_SIZE,
-   .caps   = USB_EP_CAPS(USB_EP_CAPS_TYPE_INT,
-   USB_EP_CAPS_DIR_IN),
+   .caps   = USB_EP_CAPS(0, 0),
},
.dev= memory,
.fifo_size  = INT_FIFO_SIZE,
@@ -2056,8 +2054,7 @@ static struct pxa25x_udc memory = {
.name   = ep15in-int,
.ops= pxa25x_ep_ops,
.maxpacket  = INT_FIFO_SIZE,
-   .caps   = USB_EP_CAPS(USB_EP_CAPS_TYPE_INT,
-   USB_EP_CAPS_DIR_IN),
+   .caps   = USB_EP_CAPS(0, 0),
},
.dev= memory,
.fifo_size  = INT_FIFO_SIZE,
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 04/48] staging: emxx_udc: add ep capabilities support

2015-07-14 Thread Robert Baldyga
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),
+
+#undef EP_INFO
 };
 
 /*-*/
@@ -3200,7 +3197,8 @@ static void __init nbu2ss_drv_ep_init(struct nbu2ss_udc 
*udc)
ep-desc = NULL;
 
ep-ep.driver_data = NULL;
-   ep-ep.name = gp_ep_name[i];
+   ep-ep.name = ep_info[i].name;
+   ep-ep.caps = ep_info[i].caps;
ep-ep.ops = nbu2ss_ep_ops;
 
usb_ep_set_maxpacket_limit(ep-ep,
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 07/48] usb: dwc3: gadget: add ep capabilities support

2015-07-14 Thread Robert Baldyga
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;
+   } else {
+   dep-endpoint.caps.type_iso = true;
+   dep-endpoint.caps.type_bulk = true;
+   dep-endpoint.caps.type_int = true;
+   }
+
+   if (epnum  1)
+   dep-endpoint.caps.dir_in = true;
+   else
+   dep-endpoint.caps.dir_out = true;
+
INIT_LIST_HEAD(dep-request_list);
INIT_LIST_HEAD(dep-req_queued);
}
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 08/48] usb: gadget: amd5536udc: add ep capabilities support

2015-07-14 Thread Robert Baldyga
Convert endpoint configuration to new capabilities model.

Signed-off-by: Robert Baldyga r.bald...@samsung.com
---
 drivers/usb/gadget/udc/amd5536udc.c | 57 ++---
 1 file changed, 47 insertions(+), 10 deletions(-)

diff --git a/drivers/usb/gadget/udc/amd5536udc.c 
b/drivers/usb/gadget/udc/amd5536udc.c
index de7e5e2..1a1d91c 100644
--- a/drivers/usb/gadget/udc/amd5536udc.c
+++ b/drivers/usb/gadget/udc/amd5536udc.c
@@ -138,15 +138,51 @@ static DECLARE_TASKLET(disconnect_tasklet, 
udc_tasklet_disconnect,
 
 /* endpoint names used for print */
 static const char ep0_string[] = ep0in;
-static const char *const ep_string[] = {
-   ep0_string,
-   ep1in-int, ep2in-bulk, ep3in-bulk, ep4in-bulk, ep5in-bulk,
-   ep6in-bulk, ep7in-bulk, ep8in-bulk, ep9in-bulk, ep10in-bulk,
-   ep11in-bulk, ep12in-bulk, ep13in-bulk, ep14in-bulk,
-   ep15in-bulk, ep0out, ep1out-bulk, ep2out-bulk, ep3out-bulk,
-   ep4out-bulk, ep5out-bulk, ep6out-bulk, ep7out-bulk,
-   ep8out-bulk, ep9out-bulk, ep10out-bulk, ep11out-bulk,
-   ep12out-bulk, ep13out-bulk, ep14out-bulk, ep15out-bulk
+static const struct {
+   const char *name;
+   const struct usb_ep_caps caps;
+} ep_info[] = {
+#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_string, CONTROL, IN),
+   EP_INFO(ep1in-int,BULK,   IN),
+   EP_INFO(ep2in-bulk,   BULK,   IN),
+   EP_INFO(ep3in-bulk,   BULK,   IN),
+   EP_INFO(ep4in-bulk,   BULK,   IN),
+   EP_INFO(ep5in-bulk,   BULK,   IN),
+   EP_INFO(ep6in-bulk,   BULK,   IN),
+   EP_INFO(ep7in-bulk,   BULK,   IN),
+   EP_INFO(ep8in-bulk,   BULK,   IN),
+   EP_INFO(ep9in-bulk,   BULK,   IN),
+   EP_INFO(ep10in-bulk,  BULK,   IN),
+   EP_INFO(ep11in-bulk,  BULK,   IN),
+   EP_INFO(ep12in-bulk,  BULK,   IN),
+   EP_INFO(ep13in-bulk,  BULK,   IN),
+   EP_INFO(ep14in-bulk,  BULK,   IN),
+   EP_INFO(ep15in-bulk,  BULK,   IN),
+   EP_INFO(ep0out,   CONTROL, OUT),
+   EP_INFO(ep1out-bulk,  BULK,   OUT),
+   EP_INFO(ep2out-bulk,  BULK,   OUT),
+   EP_INFO(ep3out-bulk,  BULK,   OUT),
+   EP_INFO(ep4out-bulk,  BULK,   OUT),
+   EP_INFO(ep5out-bulk,  BULK,   OUT),
+   EP_INFO(ep6out-bulk,  BULK,   OUT),
+   EP_INFO(ep7out-bulk,  BULK,   OUT),
+   EP_INFO(ep8out-bulk,  BULK,   OUT),
+   EP_INFO(ep9out-bulk,  BULK,   OUT),
+   EP_INFO(ep10out-bulk, BULK,   OUT),
+   EP_INFO(ep11out-bulk, BULK,   OUT),
+   EP_INFO(ep12out-bulk, BULK,   OUT),
+   EP_INFO(ep13out-bulk, BULK,   OUT),
+   EP_INFO(ep14out-bulk, BULK,   OUT),
+   EP_INFO(ep15out-bulk, BULK,   OUT),
+
+#undef EP_INFO
 };
 
 /* DMA usage flag */
@@ -1517,7 +1553,8 @@ static void udc_setup_endpoints(struct udc *dev)
for (tmp = 0; tmp  UDC_EP_NUM; tmp++) {
ep = dev-ep[tmp];
ep-dev = dev;
-   ep-ep.name = ep_string[tmp];
+   ep-ep.name = ep_info[tmp].name;
+   ep-ep.caps = ep_info[tmp].caps;
ep-num = tmp;
/* txfifo size is calculated at enable time */
ep-txfifo = dev-txfifo;
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 05/48] usb: chipidea: udc: add ep capabilities support

2015-07-14 Thread Robert Baldyga
Convert endpoint configuration to new capabilities model.

Signed-off-by: Robert Baldyga r.bald...@samsung.com
---
 drivers/usb/chipidea/udc.c | 14 ++
 1 file changed, 14 insertions(+)

diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c
index 764f668..eff7cfb 100644
--- a/drivers/usb/chipidea/udc.c
+++ b/drivers/usb/chipidea/udc.c
@@ -1624,6 +1624,20 @@ static int init_eps(struct ci_hdrc *ci)
 
hwep-ep.name  = hwep-name;
hwep-ep.ops   = usb_ep_ops;
+
+   if (i == 0) {
+   hwep-ep.caps.type_control = true;
+   } else {
+   hwep-ep.caps.type_iso = true;
+   hwep-ep.caps.type_bulk = true;
+   hwep-ep.caps.type_int = true;
+   }
+
+   if (j == TX)
+   hwep-ep.caps.dir_in = true;
+   else
+   hwep-ep.caps.dir_out = true;
+
/*
 * for ep0: maxP defined in desc, for other
 * eps, maxP is set by epautoconfig() called
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 06/48] usb: dwc2: gadget: add ep capabilities support

2015-07-14 Thread Robert Baldyga
Convert endpoint configuration to new capabilities model.

Signed-off-by: Robert Baldyga r.bald...@samsung.com
---
 drivers/usb/dwc2/gadget.c | 13 +
 1 file changed, 13 insertions(+)

diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
index 4d47b7c..8771b66 100644
--- a/drivers/usb/dwc2/gadget.c
+++ b/drivers/usb/dwc2/gadget.c
@@ -3289,6 +3289,19 @@ static void s3c_hsotg_initep(struct dwc2_hsotg *hsotg,
usb_ep_set_maxpacket_limit(hs_ep-ep, epnum ? 1024 : EP0_MPS_LIMIT);
hs_ep-ep.ops = s3c_hsotg_ep_ops;
 
+   if (epnum == 0) {
+   hs_ep-ep.caps.type_control = true;
+   } else {
+   hs_ep-ep.caps.type_iso = true;
+   hs_ep-ep.caps.type_bulk = true;
+   hs_ep-ep.caps.type_int = true;
+   }
+
+   if (dir_in)
+   hs_ep-ep.caps.dir_in = true;
+   else
+   hs_ep-ep.caps.dir_out = true;
+
/*
 * if we're using dma, we need to set the next-endpoint pointer
 * to be something valid.
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 09/48] usb: gadget: at91_udc: add ep capabilities support

2015-07-14 Thread Robert Baldyga
Convert endpoint configuration to new capabilities model.

Signed-off-by: Robert Baldyga r.bald...@samsung.com
---
 drivers/usb/gadget/udc/at91_udc.c | 33 -
 1 file changed, 24 insertions(+), 9 deletions(-)

diff --git a/drivers/usb/gadget/udc/at91_udc.c 
b/drivers/usb/gadget/udc/at91_udc.c
index fc42264..a04b073 100644
--- a/drivers/usb/gadget/udc/at91_udc.c
+++ b/drivers/usb/gadget/udc/at91_udc.c
@@ -59,15 +59,29 @@
 #defineDRIVER_VERSION  3 May 2006
 
 static const char driver_name [] = at91_udc;
-static const char * const ep_names[] = {
-   ep0,
-   ep1,
-   ep2,
-   ep3-int,
-   ep4,
-   ep5,
+
+static const struct {
+   const char *name;
+   const struct usb_ep_caps caps;
+} ep_info[] = {
+#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,  ALL,ALL),
+   EP_INFO(ep2,  ALL,ALL),
+   EP_INFO(ep3-int,  INT,ALL),
+   EP_INFO(ep4,  ALL,ALL),
+   EP_INFO(ep5,  ALL,ALL),
+
+#undef EP_INFO
 };
-#define ep0nameep_names[0]
+
+#define ep0nameep_info[0].name
 
 #define VBUS_POLL_TIMEOUT  msecs_to_jiffies(1000)
 
@@ -1830,7 +1844,8 @@ static int at91udc_probe(struct platform_device *pdev)
 
for (i = 0; i  NUM_ENDPOINTS; i++) {
ep = udc-ep[i];
-   ep-ep.name = ep_names[i];
+   ep-ep.name = ep_info[i].name;
+   ep-ep.caps = ep_info[i].caps;
ep-ep.ops = at91_ep_ops;
ep-udc = udc;
ep-int_mask = BIT(i);
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 3/3] ARM: dts: dra7: Add syscon-pllreset syscon to SATA PHY

2015-07-14 Thread Tony Lindgren
* Roger Quadros rog...@ti.com [150512 09:08]:
 This register is required to be passed to the SATA PHY driver
 to workaround errata i783 (SATA Lockup After SATA DPLL Unlock/Relock).
 
 Signed-off-by: Roger Quadros rog...@ti.com
 Signed-off-by: Sekhar Nori nsek...@ti.com
 ---
  arch/arm/boot/dts/dra7.dtsi | 1 +
  1 file changed, 1 insertion(+)
 
 diff --git a/arch/arm/boot/dts/dra7.dtsi b/arch/arm/boot/dts/dra7.dtsi
 index f03a091..260f300 100644
 --- a/arch/arm/boot/dts/dra7.dtsi
 +++ b/arch/arm/boot/dts/dra7.dtsi
 @@ -1135,6 +1135,7 @@
   ctrl-module = omap_control_sata;
   clocks = sys_clkin1, sata_ref_clk;
   clock-names = sysclk, refclk;
 + syscon-pllreset = dra7_ctrl_core 0x3fc;
   #phy-cells = 0;
   };
  

Looks like this one is still pending driver changes, please
resend when those are resolved. I'll untag this one for now.

Regards,

Tony
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v5] clk: change clk_ops' -determine_rate() prototype

2015-07-14 Thread Boris Brezillon
On Mon, 13 Jul 2015 16:02:18 -0700
Stephen Boyd sb...@codeaurora.org wrote:

 On 07/09, Boris Brezillon wrote:
  Hi Stephen,
  
  On Wed, 08 Jul 2015 11:07:42 -0700
  Stephen Boyd sb...@codeaurora.org wrote:
  
   On 07/08/2015 02:00 AM, Boris Brezillon wrote:
Hi Stephen,
   
On Tue, 7 Jul 2015 17:57:48 -0700
Stephen Boyd sb...@codeaurora.org wrote:
   
On 07/07, Boris Brezillon wrote:
   
  } else {
  pr_err(clk: clk_composite_determine_rate function 
called, but no mux or rate callback set!\n);
+ req-rate = 0;
  return 0;
Shouldn't this return an error now? And then assigning req-rate
wouldn't be necessary. Sorry I must have missed this last round.
   
Actually I wanted to keep the existing behavior: return a 0 rate (not
an error) when there is no mux or rate ops.
   
That's something we can change afterwards, but it might reveals
new bugs if some users are checking for a 0 rate to detect errors.
   
   
   Ok. Care to send the patch now to do that while we're thinking about it?
   We can test it out for a month or two.
   
  
  Here is a patch modifying a few drivers to return errors instead of a 0
  rate. Feel free to squash it in the previous one if you think this is
  better.
  
  Best Regards,
  
  Boris
  
  --- 8 ---
  
  From dca9c28301042cf19dad4b1e4555cdb7c1063745 Mon Sep 17 00:00:00 2001
  From: Boris Brezillon boris.brezil...@free-electrons.com
  Date: Thu, 9 Jul 2015 12:20:21 +0200
  Subject: [PATCH] clk: fix some determine_rate implementations
  
  Some determine_rate implementations are not returning an error when then
  failed to adapt the rate according to the rate request.
  Fix them so that they return an error instead of silently returning 0.
  
  Signed-off-by: Boris Brezillon boris.brezil...@free-electrons.com
 
 The linewrap is seriously messed up here. Please fix your mailer
 next time. I had to hand edit the patch to get it to apply. I've
 applied this in top of the original patch as a different commit,
 in case we need to revert it later.

Sorry about that, I forgot to remove the line wrapper when copying the
content of the patch into my mailer :-/.


-- 
Boris Brezillon, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 0/7] serial: 8250_omap: workaround for IP errata

2015-07-14 Thread Peter Hurley
On 07/14/2015 04:02 AM, Sekhar Nori wrote:
 This series works around Advisory 21 as documented in
 AM437x SoC errata[1]. This errata prevents UART module
 from idling after DMA is used. AM335x and DRA7x also suffer
 from the same errata and chip design team is in the process
 of updating the errata documents of those devices as well.
 
 Patch 1/7 fixes a related bug but can be applied independently.

Looks good. Thanks Sekhar!

For series,

Reviewed-by: Peter Hurley pe...@hurleysoftware.com

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH - resend for 4.2-rc2] ARM: DTS: dra7x: Integrate sDMA crossbar

2015-07-14 Thread Tony Lindgren
* Peter Ujfalusi peter.ujfal...@ti.com [150701 05:54]:
 The sDMA requests are routed through the DMA crossbar and without the
 crossbar only peripherals using DMA request 0-127 can be used.
 
 Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
 ---
 Hi Tony,
 
 as you have suggested: 
 http://permalink.gmane.org/gmane.linux.ports.arm.omap/125999
 the DTS change has not been taken by Vinod.
 Now that the dmaengine pull request is in for 4.2 it would be great if you 
 could
 pick up the DTS part of the series and send it for -rc2.

Thanks, looks like I also had the original patch still tagged.
Applying this one instead although they look the same.

Tony
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 00/20] ARM: DTS: am335x/am43xx: Audio support and fixes for audio

2015-07-14 Thread Tony Lindgren
* Peter Ujfalusi peter.ujfal...@ti.com [150702 07:08]:
 Hi,
 
 Changes since v1:
 - Add patch for omap2plus_defconfig to enable needed audio drivers
 - Included other board patches since they all need the change in
   omap2plus_defconfig
 
 Enable the simple card in omap2plus_defconfig as more boards are using that 
 for
 audio support.
 
 am437x-sk-evm, am335x-evmsk and am335x-evm:
 There is no reason to use the davinci-evm machine driver's compatible for 
 audio
 support since the setup is simple and the common simple-audio-card can handle 
 it
 just fine.
 
 am43xx-epos-evm, am437x-gp-evm:
 Add audio support via simple-card

Applying all into omap-for-v4.3/dt thanks.

Tony
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] i2c: omap: fix cleanup regression

2015-07-14 Thread Wolfram Sang
Patch i2c: omap: abolish variable name confusion triggered a
coccinelle warning which we fix here:

drivers/i2c/busses/i2c-omap.c:1333:5-24: pm_runtime_get_sync returns  0 as 
error. Unecessary IS_ERR_VALUE at line 1334

Signed-off-by: Wolfram Sang w...@the-dreams.de
---
 drivers/i2c/busses/i2c-omap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
index 133dd0db6f5b76..edc4261191ba4d 100644
--- a/drivers/i2c/busses/i2c-omap.c
+++ b/drivers/i2c/busses/i2c-omap.c
@@ -1331,7 +1331,7 @@ omap_i2c_probe(struct platform_device *pdev)
pm_runtime_use_autosuspend(omap-dev);
 
r = pm_runtime_get_sync(omap-dev);
-   if (IS_ERR_VALUE(r))
+   if (r  0)
goto err_free_mem;
 
/*
-- 
2.1.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] i2c: omap: fix bus recovery setup

2015-07-14 Thread Grygorii Strashko
Hi Wolfram,

On 07/14/2015 02:10 PM, Wolfram Sang wrote:
 On Wed, Jul 08, 2015 at 04:35:27PM +0200, Jan Luebbe wrote:
 At least on the AM335x, enabling OMAP_I2C_SYSTEST_ST_EN is not enough to
 
 Felipe: it seems you did not need this; is this AM335x specific?

We need it (Felipe's reply can be delayed).

It's not AM335x specific. TMODE has to be configured for all OMAP4+ SoCs too.

 
 allow direct access to the SCL and SDA pins. In addition to ST_EN, we
 need to set the TMODE to 0b11 (Loop back  SDA/SCL IO mode select).
 Also, as the reset values of SCL_O and SDA_O are 0 (which means drive
 low level), we need to set them to 1 (which means high-impedance) to
 avoid unwanted changes on the pins.

 As a precaution, reset all these bits to their default values after
 recovery is complete.

Reviewed-by: Grygorii Strashko grygorii.stras...@ti.com 


 Signed-off-by: Jan Luebbe j...@pengutronix.de
 ---
   drivers/i2c/busses/i2c-omap.c | 11 +++
   1 file changed, 11 insertions(+)

 diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
 index d1c22e3fdd14..fc9bf7f30e35 100644
 --- a/drivers/i2c/busses/i2c-omap.c
 +++ b/drivers/i2c/busses/i2c-omap.c
 @@ -1247,7 +1247,14 @@ static void omap_i2c_prepare_recovery(struct 
 i2c_adapter *adap)
  u32 reg;
   
  reg = omap_i2c_read_reg(dev, OMAP_I2C_SYSTEST_REG);
 +/* enable test mode */
  reg |= OMAP_I2C_SYSTEST_ST_EN;
 +/* select SDA/SCL IO mode */
 +reg |= 3  OMAP_I2C_SYSTEST_TMODE_SHIFT;
 +/* set SCL to high-impedance state (reset value is 0) */
 +reg |= OMAP_I2C_SYSTEST_SCL_O;
 +/* set SDA to high-impedance state (reset value is 0) */
 +reg |= OMAP_I2C_SYSTEST_SDA_O;
  omap_i2c_write_reg(dev, OMAP_I2C_SYSTEST_REG, reg);
   }
   
 @@ -1257,7 +1264,11 @@ static void omap_i2c_unprepare_recovery(struct 
 i2c_adapter *adap)
  u32 reg;
   
  reg = omap_i2c_read_reg(dev, OMAP_I2C_SYSTEST_REG);
 +/* restore reset values */
  reg = ~OMAP_I2C_SYSTEST_ST_EN;
 +reg = ~OMAP_I2C_SYSTEST_TMODE_MASK;
 +reg = ~OMAP_I2C_SYSTEST_SCL_O;
 +reg = ~OMAP_I2C_SYSTEST_SDA_O;
  omap_i2c_write_reg(dev, OMAP_I2C_SYSTEST_REG, reg);
   }
   
 -- 
 2.1.4



-- 
regards,
-grygorii
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] i2c: omap: fix bus recovery setup

2015-07-14 Thread Wolfram Sang
On Tue, Jul 14, 2015 at 03:10:01PM +0300, Grygorii Strashko wrote:
 Hi Wolfram,
 
 On 07/14/2015 02:10 PM, Wolfram Sang wrote:
  On Wed, Jul 08, 2015 at 04:35:27PM +0200, Jan Luebbe wrote:
  At least on the AM335x, enabling OMAP_I2C_SYSTEST_ST_EN is not enough to
  
  Felipe: it seems you did not need this; is this AM335x specific?
 
 We need it (Felipe's reply can be delayed).

So, how did it work for him?

 It's not AM335x specific. TMODE has to be configured for all OMAP4+ SoCs too.

Okay, thanks for the stepping in!



signature.asc
Description: Digital signature


Re: [PATCH 0/2] CLK: TI: add dpll_clksel_mac_clk node

2015-07-14 Thread Tero Kristo

On 07/14/2015 02:06 PM, Tony Lindgren wrote:

* Keerthy a0393...@ti.com [150625 06:48]:


On Thursday 18 June 2015 02:36 PM, Mugunthan V N wrote:

On Thursday 18 June 2015 01:31 PM, Keerthy wrote:

The series adds the missing clock node needed for cpsw.

Keerthy (2):
   CLK: TI: add dpll_clksel_mac_clk node
   ARM: dts: am4372: Set the default clock rate for dpll_clksel_mac_clk
 clock

  arch/arm/boot/dts/am4372.dtsi| 7 +--
  arch/arm/boot/dts/am43xx-clocks.dtsi | 9 +
  drivers/clk/ti/clk-43xx.c| 1 +
  3 files changed, 15 insertions(+), 2 deletions(-)



Tested-by: Mugunthan V N mugunthan...@ti.com


Thanks Mugunthan.

A gentle ping on this series.


Tero, care to review this series?


Acked-by: Tero Kristo t-kri...@ti.com

I guess this should go through your tree as this is mostly dts changes?

-Tero



Regards,

Tony
--
To unsubscribe from this list: send the line unsubscribe linux-clk in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html



--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 48/48] usb: gadget: epautoconf: cleanup dead code

2015-07-14 Thread Sergei Shtylyov

Hello.

On 7/14/2015 12:39 PM, Robert Baldyga wrote:


Function find_ep() is no longer needed here, so we can remove it.
We also don't use anything from gadget_chips.h header any longer.



Signed-off-by: Robert Baldyga r.bald...@samsung.com
---
  drivers/usb/gadget/epautoconf.c | 14 --
  1 file changed, 14 deletions(-)



diff --git a/drivers/usb/gadget/epautoconf.c b/drivers/usb/gadget/epautoconf.c
index e9a8682..9a80925 100644
--- a/drivers/usb/gadget/epautoconf.c
+++ b/drivers/usb/gadget/epautoconf.c
@@ -20,20 +20,6 @@
  #include linux/usb/ch9.h
  #include linux/usb/gadget.h

-#include gadget_chips.h
-
-static struct usb_ep *
-find_ep (struct usb_gadget *gadget, const char *name)
-{
-   struct usb_ep   *ep;
-
-   list_for_each_entry (ep, gadget-ep_list, ep_list) {
-   if (0 == strcmp (ep-name, name))
-   return ep;
-   }
-   return NULL;
-}
-


   I don't think duplicating the function in each driver that needs it is 
better than turniong this function into public.


WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 0/3] ARM: dts: Changes for Gumstix Pepper dts

2015-07-14 Thread Kevin Hilman
Arun Bharadwaj a...@gumstix.com writes:

 These 3 patches are included to fix the following issues
 with pepper device tree source. The patches are based against
 linux-omap/master.

I tested this series on top of linus/master with omap2plus_defconfig and
it seems to successfully boot now (used to hang after disabling
vdd_mpu.)

However, it still hangs during boot when testing with multi_v7_defconfig
(boot log below.)

Anyways, it's a step in the right direction.  Feel free to add 

Tested-by: Kevin Hilman khil...@linaro.org

Kevin


[1] full console log: linus/master, mutli_v7_defconfig + $SUBJECT series:

Connected to pepper console [channel connected] (~$quit to exit)
(user:khilman) is already connected


# PYBOOT: console: connected.
~$hardreset

Command(pepper console) hardreset
(user:khilman) Reboot pepper

U-Boot SPL 2014.10 (Feb 24 2015 - 21:56:40)
Booting with DDR
reading u-boot.img
reading u-boot.img


U-Boot 2014.10 (Feb 24 2015 - 21:56:40)

AM335X-GP rev 1.0
   Watchdog enabled
I2C:   ready
DRAM:  512 MiB
MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
Using default environment

Net:   cpsw
Hit any key to stop autoboot:  1 

# PYBOOT: u-boot: taking control.
 0 
pepper# 
pepper# version
version

U-Boot 2014.10 (Feb 24 2015 - 21:56:40)
arm-poky-linux-gnueabi-gcc (GCC) 4.9.1
GNU ld (GNU Binutils) 2.24
pepper# if test -n ${initenv}; then run initenv; fi
if test -n ${initenv}; then run initenv; fi
pepper# if test -n ${preboot}; then run preboot; fi
if test -n ${preboot}; then run preboot; fi
pepper# setenv autoload no; setenv autoboot no
setenv autoload no; setenv autoboot no
pepper# dhcp
dhcp
cpsw Waiting for PHY auto negotiation to complete... done
link up on port 0, speed 100, full duplex
BOOTP broadcast 1
BOOTP broadcast 2
DHCP client bound to address 192.168.1.190 (322 ms)
pepper# setenv serverip 192.168.1.2
setenv serverip 192.168.1.2
pepper# if test -n ${netargs}; then run netargs; fi
if test -n ${netargs}; then run netargs; fi
pepper# tftp 0x8100 192.168.1.2:tmp/pepper-B3cJIV/zImage
tftp 0x8100 192.168.1.2:tmp/pepper-B3cJIV/zImage
link up on port 0, speed 100, full duplex
Using cpsw device
TFTP from server 192.168.1.2; our IP address is 192.168.1.190
Filename 'tmp/pepper-B3cJIV/zImage'.
Load address: 0x8100
Loading: *#
 #
 #
 #
 #
 #
 #
 2.8 MiB/s
done
Bytes transferred = 6146272 (5dc8e0 hex)
pepper# tftp 0x8200 192.168.1.2:tmp/pepper-B3cJIV/rootfs.cpio.gz
tftp 0x8200 192.168.1.2:tmp/pepper-B3cJIV/rootfs.cpio.gz
link up on port 0, speed 100, full duplex
Using cpsw device
TFTP from server 192.168.1.2; our IP address is 192.168.1.190
Filename 'tmp/pepper-B3cJIV/rootfs.cpio.gz'.
Load address: 0x8200
Loading: *#
 #
 #
 #
 #
 #
 2.7 MiB/s
done
Bytes transferred = 4956631 (4ba1d7 hex)
pepper#tftp 0x81f0 192.168.1.2:tmp/pepper-B3cJIV/tmpW6fNjj.dtb
 tftp 0x81f0 192.168.1.2:tmp/pepper-B3cJIV/tmpW6fNjj.dtb
link up on port 0, speed 100, full duplex
Using cpsw device
TFTP from server 192.168.1.2; our IP address is 192.168.1.190
Filename 'tmp/pepper-B3cJIV/tmpW6fNjj.dtb'.
Load address: 0x81f0
Loading: *###
 2.5 MiB/s
done
Bytes transferred = 33734 (83c6 hex)
pepper# printenv bootargs
printenv bootargs
## Error: bootargs not defined
pepper# bootz 0x8100 - 0x81f0

# PYBOOT: u-boot: jumping to kernel image
bootz 0x8100 - 0x81f0
Kernel image @ 0x8100 [ 0x00 - 0x5dc8e0 ]
## Flattened Device Tree blob at 81f0
   Booting using the fdt blob at 0x81f0
   Loading Device Tree to 8fff4000, end 83c5 ... OK

Starting kernel ...

[0.00] Booting Linux on physical CPU 0x0
[0.00] Linux version 4.2.0-rc2-00080-g9ea52aaed426 (khilman@paris) (gcc 
version 4.7.3 (Ubuntu/Linaro 4.7.3-12ubuntu1) ) #6 SMP Tue Jul 14 05:13:16 PDT 
2015
[0.00] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c5387d
[0.00] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing 
instruction cache
[0.00] Machine model: Gumstix Pepper
[0.00] cma: Reserved 64 MiB at 0x9b80
[0.00] Memory policy: Data cache writeback
[0.00] CPU: All CPU(s) started in SVC mode.
[0.00] AM335X ES1.0 (sgx neon )
[0.00] PERCPU: Embedded 11 pages/cpu @dfaa4000 s14784 r8192 d22080 
u45056
[  

Re: [PATCH v2 0/7] serial: 8250_omap: workaround for IP errata

2015-07-14 Thread Tony Lindgren
* Peter Hurley pe...@hurleysoftware.com [150714 05:24]:
 On 07/14/2015 04:02 AM, Sekhar Nori wrote:
  This series works around Advisory 21 as documented in
  AM437x SoC errata[1]. This errata prevents UART module
  from idling after DMA is used. AM335x and DRA7x also suffer
  from the same errata and chip design team is in the process
  of updating the errata documents of those devices as well.
  
  Patch 1/7 fixes a related bug but can be applied independently.
 
 Looks good. Thanks Sekhar!
 
 For series,
 
 Reviewed-by: Peter Hurley pe...@hurleysoftware.com

Also things still work for me, and the dts changes should
not cause merge conflicts during v4.3 merge window based on
what I have queued. So please feel free to queue these
all via the tty tree and add:

Acked-by: Tony Lindgren t...@atomide.com 
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/2] V4 regmap: Use reg_sequence for multi_reg_write / register_patch

2015-07-14 Thread Nariman Poushin
Add support for writing sequences of registers / patches with specified
delays (in microseconds). Logically separates the functionality using
sequences of register writes from the functions that take register
defaults, as adding a delay field on the reg_defaults can increase
memory usage substantially.

This also updates all the clients of multi_reg_write/register_patch.

Signed-off-by: Nariman Poushin nari...@opensource.wolfsonmicro.com
---
 drivers/base/regmap/internal.h |  2 +-
 drivers/base/regmap/regmap.c   | 22 +++---
 drivers/gpu/drm/i2c/adv7511.c  |  2 +-
 drivers/input/misc/drv260x.c   |  6 +++---
 drivers/input/misc/drv2665.c   |  2 +-
 drivers/input/misc/drv2667.c   |  4 ++--
 drivers/mfd/arizona-core.c |  2 +-
 drivers/mfd/twl6040.c  |  2 +-
 drivers/mfd/wm5102-tables.c|  6 +++---
 drivers/mfd/wm5110-tables.c|  6 +++---
 drivers/mfd/wm8994-core.c  |  8 
 drivers/mfd/wm8997-tables.c|  2 +-
 include/linux/regmap.h | 21 ++---
 sound/soc/codecs/arizona.c |  2 +-
 sound/soc/codecs/cs35l32.c |  2 +-
 sound/soc/codecs/cs42l52.c |  2 +-
 sound/soc/codecs/da7210.c  |  4 ++--
 sound/soc/codecs/rt5640.c  |  2 +-
 sound/soc/codecs/rt5645.c  |  4 ++--
 sound/soc/codecs/rt5651.c  |  2 +-
 sound/soc/codecs/rt5670.c  |  2 +-
 sound/soc/codecs/rt5677.c  |  2 +-
 sound/soc/codecs/tlv320aic3x.c |  2 +-
 sound/soc/codecs/wm2200.c  |  2 +-
 sound/soc/codecs/wm5100.c  |  2 +-
 sound/soc/codecs/wm8962.c  |  2 +-
 sound/soc/codecs/wm8993.c  |  2 +-
 27 files changed, 66 insertions(+), 51 deletions(-)

diff --git a/drivers/base/regmap/internal.h b/drivers/base/regmap/internal.h
index b2b2849..873ddf9 100644
--- a/drivers/base/regmap/internal.h
+++ b/drivers/base/regmap/internal.h
@@ -136,7 +136,7 @@ struct regmap {
/* if set, the HW registers are known to match map-reg_defaults */
bool no_sync_defaults;
 
-   struct reg_default *patch;
+   struct reg_sequence *patch;
int patch_regs;
 
/* if set, converts bulk rw to single rw */
diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c
index dd63bcb..0a849ee 100644
--- a/drivers/base/regmap/regmap.c
+++ b/drivers/base/regmap/regmap.c
@@ -1755,7 +1755,7 @@ EXPORT_SYMBOL_GPL(regmap_bulk_write);
  * relative. The page register has been written if that was neccessary.
  */
 static int _regmap_raw_multi_reg_write(struct regmap *map,
-  const struct reg_default *regs,
+  const struct reg_sequence *regs,
   size_t num_regs)
 {
int ret;
@@ -1812,12 +1812,12 @@ static unsigned int _regmap_register_page(struct regmap 
*map,
 }
 
 static int _regmap_range_multi_paged_reg_write(struct regmap *map,
-  struct reg_default *regs,
+  struct reg_sequence *regs,
   size_t num_regs)
 {
int ret;
int i, n;
-   struct reg_default *base;
+   struct reg_sequence *base;
unsigned int this_page = 0;
/*
 * the set of registers are not neccessarily in order, but
@@ -1855,7 +1855,7 @@ static int _regmap_range_multi_paged_reg_write(struct 
regmap *map,
 }
 
 static int _regmap_multi_reg_write(struct regmap *map,
-  const struct reg_default *regs,
+  const struct reg_sequence *regs,
   size_t num_regs)
 {
int i;
@@ -1907,8 +1907,8 @@ static int _regmap_multi_reg_write(struct regmap *map,
struct regmap_range_node *range;
range = _regmap_range_lookup(map, reg);
if (range) {
-   size_t len = sizeof(struct reg_default)*num_regs;
-   struct reg_default *base = kmemdup(regs, len,
+   size_t len = sizeof(struct reg_sequence)*num_regs;
+   struct reg_sequence *base = kmemdup(regs, len,
   GFP_KERNEL);
if (!base)
return -ENOMEM;
@@ -1941,7 +1941,7 @@ static int _regmap_multi_reg_write(struct regmap *map,
  * A value of zero will be returned on success, a negative errno will be
  * returned in error cases.
  */
-int regmap_multi_reg_write(struct regmap *map, const struct reg_default *regs,
+int regmap_multi_reg_write(struct regmap *map, const struct reg_sequence *regs,
   int num_regs)
 {
int ret;
@@ -1974,7 +1974,7 @@ EXPORT_SYMBOL_GPL(regmap_multi_reg_write);
  * be returned in error cases.
  */
 int regmap_multi_reg_write_bypassed(struct regmap *map,
-   const struct reg_default *regs,
+   const struct 

[PATCH 2/2] V4 regmap: Apply optional delay in multi_reg_write/register_patch

2015-07-14 Thread Nariman Poushin
We treat a delay in a sequence the same way we treat a page change as
they are logically similar in that you can coalesce all write before
a delay (in the same way you can coalesce all writes before a page
change is needed)

Signed-off-by: Nariman Poushin nari...@opensource.wolfsonmicro.com
---
 drivers/base/regmap/regmap.c | 65 
 1 file changed, 59 insertions(+), 6 deletions(-)

diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c
index 0a849ee..a67473c2 100644
--- a/drivers/base/regmap/regmap.c
+++ b/drivers/base/regmap/regmap.c
@@ -18,6 +18,7 @@
 #include linux/of.h
 #include linux/rbtree.h
 #include linux/sched.h
+#include linux/delay.h
 
 #define CREATE_TRACE_POINTS
 #include trace.h
@@ -47,6 +48,17 @@ static int _regmap_bus_reg_write(void *context, unsigned int 
reg,
 static int _regmap_bus_raw_write(void *context, unsigned int reg,
 unsigned int val);
 
+static void regmap_sequence_delay(unsigned int delay_us)
+{
+   /* For small delays it isn't worth setting up the hrtimers
+* so fall back on udelay
+*/
+   if (delay_us  10)
+   udelay(delay_us);
+   else
+   usleep_range(delay_us, delay_us * 2);
+}
+
 bool regmap_reg_in_ranges(unsigned int reg,
  const struct regmap_range *ranges,
  unsigned int nranges)
@@ -1819,10 +1831,12 @@ static int _regmap_range_multi_paged_reg_write(struct 
regmap *map,
int i, n;
struct reg_sequence *base;
unsigned int this_page = 0;
+   unsigned int page_change = 0;
/*
 * the set of registers are not neccessarily in order, but
 * since the order of write must be preserved this algorithm
-* chops the set each time the page changes
+* chops the set each time the page changes. This also applies
+* if there is a delay required at any point in the sequence.
 */
base = regs;
for (i = 0, n = 0; i  num_regs; i++, n++) {
@@ -1838,16 +1852,48 @@ static int _regmap_range_multi_paged_reg_write(struct 
regmap *map,
this_page = win_page;
if (win_page != this_page) {
this_page = win_page;
+   page_change = 1;
+   }
+   }
+
+   /* If we have both a page change and a delay make sure to
+* write the regs and apply the delay before we change the
+* page.
+*/
+
+   if (page_change || regs[i].delay_us) {
+
+   /* For situations where the first write requires
+* a delay we need to make sure we don't call
+* raw_multi_reg_write with n=0
+* This can't occur with page breaks as we
+* never write on the first iteration
+*/
+   if (regs[i].delay_us  i == 0)
+   n = 1;
+
ret = _regmap_raw_multi_reg_write(map, base, n);
if (ret != 0)
return ret;
+
+   if (regs[i].delay_us)
+   regmap_sequence_delay(regs[i].delay_us);
+
base += n;
n = 0;
-   }
-   ret = _regmap_select_page(map, base[n].reg, range, 1);
-   if (ret != 0)
-   return ret;
+
+   if (page_change) {
+   ret = _regmap_select_page(map,
+ base[n].reg,
+ range, 1);
+   if (ret != 0)
+   return ret;
+
+   page_change = 0;
+   }
+
}
+
}
if (n  0)
return _regmap_raw_multi_reg_write(map, base, n);
@@ -1866,6 +1912,9 @@ static int _regmap_multi_reg_write(struct regmap *map,
ret = _regmap_write(map, regs[i].reg, regs[i].def);
if (ret != 0)
return ret;
+
+   if (regs[i].delay_us)
+   regmap_sequence_delay(regs[i].delay_us);
}
return 0;
}
@@ -1905,8 +1954,12 @@ static int _regmap_multi_reg_write(struct regmap *map,
for (i = 0; i  num_regs; i++) {
unsigned int reg = regs[i].reg;
struct regmap_range_node 

Re: [PATCH 0/3] ARM: OMAP2+: hwmod: RTC: Add lock and unlock hooks

2015-07-14 Thread Tero Kristo

On 07/14/2015 01:09 PM, Lokesh Vutla wrote:

Hi,
On Wednesday 10 June 2015 02:56 PM, Lokesh Vutla wrote:

Some IP blocks like RTC, needs an additional unlocking mechanism for
writing to its registers. This patch adds optional lock and unlock
function pointers to the IP block's hwmod data which gets executed
before and after writing into IP sysconfig register.
And also hook lock and unlock functions to AMx3xx, DRA7 RTC hwmod data,
so that sysconfig registers are updated properly.

ping on this series.

Thanks and regards,
Lokesh


This looks kind of hackish to have the unlock + lock functionality copy 
pasted to both driver and hwmod.


It is also racy, as there is no locking in place to avoid concurrent 
access to the lock/unlock registers across hwmod+driver.


Can we avoid these issues somehow?

-Tero



Tested on:
DRA7-evm: http://pastebin.ubuntu.com/1169/
DRA72-evm: http://pastebin.ubuntu.com/11688901/
BeagleBoard-x15: http://pastebin.ubuntu.com/11688907/
BeagleBoneBlack: http://pastebin.ubuntu.com/11688923/
AM437x-gp-evm: http://pastebin.ubuntu.com/11689157/ (Used an out of tree patch 
to enable RTC)

Lokesh Vutla (3):
   ARM: OMAP2+: hwmod: add support for lock and unlock hooks
   ARM: DRA: hwmod: RTC: Add lock and unlock functions
   ARM: AMx3xx: RTC: Add lock and unlock functions

  arch/arm/mach-omap2/omap_hwmod.c   | 13 ++
  arch/arm/mach-omap2/omap_hwmod.h   |  6 +++
  .../mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c |  2 +
  arch/arm/mach-omap2/omap_hwmod_7xx_data.c  |  2 +
  arch/arm/mach-omap2/omap_hwmod_reset.c | 47 ++
  5 files changed, 70 insertions(+)





--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 0/2] Add missing #iommu-cells on IOMMU nodes

2015-07-14 Thread Tony Lindgren
* Suman Anna s-a...@ti.com [150710 10:31]:
 Hi Tony,
 
 This series adds the #iommu-cells property to the existing
 IOMMU nodes on OMAP4  OMAP5. It was already fixed for OMAP3
 in commit 2055088b5e17 (ARM: dts: omap3: Add #iommu-cells to
 isp and iva iommu).
 
 OMAP4 and OMAP5 do not yet have users for these IOMMUs (remoteproc
 nodes), so the warning as seen with the fix added for OMAP3 is not
 seen yet, but will as soon as a user is added.

Applying both into omap-for-v4.2/fixes thanks.

Tony
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 5/7] serial: 8250_omap: workaround errata around idling UART after using DMA

2015-07-14 Thread Sekhar Nori
AM335x, AM437x and DRA7x SoCs have an errata[1] due to which UART
cannot be idled after it has been used with DMA.

OMAP3 has a similar sounding errata which has been worked around
in a2fc36613ac1af2e9 (ARM: OMAP3: Use manual idle for UARTs
because of DMA errata). But the workaround used there does not
apply to AM335x, AM437x SoCs.

After using DMA, the UART module on these SoCs must be soft reset
to go to idle.

This patch implements that errata workaround. It is expected that
UART will be used with DMA so no explicit check for DMA usage
has been added for errata applicability.

MDR1 register needs to be restored right after soft-reset because
UART mode must be set in that register for module wake-up on AM335x
to work. As a result, SCR register is now used to determine if
context was lost during sleep.

[1] See Advisory 21 in AM437x errata SPRZ408B, updated April 2015.
http://www.ti.com/lit/er/sprz408b/sprz408b.pdf

Signed-off-by: Sekhar Nori nsek...@ti.com
---
v2:
- introduce a new function to do the UART softreset
- restore MDR1 unconditionally
- update subject line and description according to comments received.

 drivers/tty/serial/8250/8250_omap.c | 65 +
 1 file changed, 59 insertions(+), 6 deletions(-)

diff --git a/drivers/tty/serial/8250/8250_omap.c 
b/drivers/tty/serial/8250/8250_omap.c
index fff026f3d0bb..a2ee75dee070 100644
--- a/drivers/tty/serial/8250/8250_omap.c
+++ b/drivers/tty/serial/8250/8250_omap.c
@@ -33,6 +33,11 @@
 #define UART_ERRATA_i202_MDR1_ACCESS   (1  0)
 #define OMAP_UART_WER_HAS_TX_WAKEUP(1  1)
 #define OMAP_DMA_TX_KICK   (1  2)
+/*
+ * See Advisory 21 in AM437x errata SPRZ408B, updated April 2015.
+ * The same errata is applicable to AM335x and DRA7x processors too.
+ */
+#define UART_ERRATA_CLOCK_DISABLE  (1  3)
 
 #define OMAP_UART_FCR_RX_TRIG  6
 #define OMAP_UART_FCR_TX_TRIG  4
@@ -54,6 +59,12 @@
 #define OMAP_UART_MVR_MAJ_SHIFT8
 #define OMAP_UART_MVR_MIN_MASK 0x3f
 
+/* SYSC register bitmasks */
+#define OMAP_UART_SYSC_SOFTRESET   (1  1)
+
+/* SYSS register bitmasks */
+#define OMAP_UART_SYSS_RESETDONE   (1  0)
+
 #define UART_TI752_TLR_TX  0
 #define UART_TI752_TLR_RX  4
 
@@ -1062,13 +1073,15 @@ static int omap8250_no_handle_irq(struct uart_port 
*port)
return 0;
 }
 
-static const u8 am3352_habit = OMAP_DMA_TX_KICK;
+static const u8 am3352_habit = OMAP_DMA_TX_KICK | UART_ERRATA_CLOCK_DISABLE;
+static const u8 am4372_habit = UART_ERRATA_CLOCK_DISABLE;
 
 static const struct of_device_id omap8250_dt_ids[] = {
{ .compatible = ti,omap2-uart },
{ .compatible = ti,omap3-uart },
{ .compatible = ti,omap4-uart },
{ .compatible = ti,am3352-uart, .data = am3352_habit, },
+   { .compatible = ti,am4372-uart, .data = am4372_habit, },
{},
 };
 MODULE_DEVICE_TABLE(of, omap8250_dt_ids);
@@ -1282,17 +1295,46 @@ static int omap8250_lost_context(struct uart_8250_port 
*up)
 {
u32 val;
 
-   val = serial_in(up, UART_OMAP_MDR1);
+   val = serial_in(up, UART_OMAP_SCR);
/*
-* If we lose context, then MDR1 is set to its reset value which is
-* UART_OMAP_MDR1_DISABLE. After set_termios() we set it either to 13x
-* or 16x but never to disable again.
+* If we lose context, then SCR is set to its reset value of zero.
+* After set_termios() we set bit 3 of SCR (TX_EMPTY_CTL_IT) to 1,
+* among other bits, to never set the register back to zero again.
 */
-   if (val == UART_OMAP_MDR1_DISABLE)
+   if (!val)
return 1;
return 0;
 }
 
+/* TODO: in future, this should happen via API in drivers/reset/ */
+static int omap8250_soft_reset(struct device *dev)
+{
+   struct omap8250_priv *priv = dev_get_drvdata(dev);
+   struct uart_8250_port *up = serial8250_get_port(priv-line);
+   int timeout = 100;
+   int sysc;
+   int syss;
+
+   sysc = serial_in(up, UART_OMAP_SYSC);
+
+   /* softreset the UART */
+   sysc |= OMAP_UART_SYSC_SOFTRESET;
+   serial_out(up, UART_OMAP_SYSC, sysc);
+
+   /* By experiments, 1us enough for reset complete on AM335x */
+   do {
+   udelay(1);
+   syss = serial_in(up, UART_OMAP_SYSS);
+   } while (--timeout  !(syss  OMAP_UART_SYSS_RESETDONE));
+
+   if (!timeout) {
+   dev_err(dev, timed out waiting for reset done\n);
+   return -ETIMEDOUT;
+   }
+
+   return 0;
+}
+
 static int omap8250_runtime_suspend(struct device *dev)
 {
struct omap8250_priv *priv = dev_get_drvdata(dev);
@@ -1310,6 +1352,17 @@ static int omap8250_runtime_suspend(struct device *dev)
return -EBUSY;
}
 
+   if (priv-habit  UART_ERRATA_CLOCK_DISABLE) {
+   int ret;
+
+   ret = omap8250_soft_reset(dev);
+   if (ret)
+   return ret;

[PATCH v2 7/7] ARM: dts: dra7: workaround UART module disable errata

2015-07-14 Thread Sekhar Nori
Add ti,dra742-uart to the compatible list so the driver
workaround for UART module disable errata is enabled.

This does not break backward compatibility as existing DTBs
should continue to work with newer kernels albeit without the
capability to idle the UART module when DMA is used.

Signed-off-by: Sekhar Nori nsek...@ti.com
---
v2:
- no change.

 arch/arm/boot/dts/dra7.dtsi | 20 ++--
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/arch/arm/boot/dts/dra7.dtsi b/arch/arm/boot/dts/dra7.dtsi
index 8f1e25bcecbd..49940e516f0f 100644
--- a/arch/arm/boot/dts/dra7.dtsi
+++ b/arch/arm/boot/dts/dra7.dtsi
@@ -397,7 +397,7 @@
};
 
uart1: serial@4806a000 {
-   compatible = ti,omap4-uart;
+   compatible = ti,dra742-uart, ti,omap4-uart;
reg = 0x4806a000 0x100;
interrupts-extended = crossbar_mpu GIC_SPI 67 
IRQ_TYPE_LEVEL_HIGH;
ti,hwmods = uart1;
@@ -408,7 +408,7 @@
};
 
uart2: serial@4806c000 {
-   compatible = ti,omap4-uart;
+   compatible = ti,dra742-uart, ti,omap4-uart;
reg = 0x4806c000 0x100;
interrupts = GIC_SPI 68 IRQ_TYPE_LEVEL_HIGH;
ti,hwmods = uart2;
@@ -419,7 +419,7 @@
};
 
uart3: serial@4802 {
-   compatible = ti,omap4-uart;
+   compatible = ti,dra742-uart, ti,omap4-uart;
reg = 0x4802 0x100;
interrupts = GIC_SPI 69 IRQ_TYPE_LEVEL_HIGH;
ti,hwmods = uart3;
@@ -430,7 +430,7 @@
};
 
uart4: serial@4806e000 {
-   compatible = ti,omap4-uart;
+   compatible = ti,dra742-uart, ti,omap4-uart;
reg = 0x4806e000 0x100;
interrupts = GIC_SPI 65 IRQ_TYPE_LEVEL_HIGH;
ti,hwmods = uart4;
@@ -441,7 +441,7 @@
};
 
uart5: serial@48066000 {
-   compatible = ti,omap4-uart;
+   compatible = ti,dra742-uart, ti,omap4-uart;
reg = 0x48066000 0x100;
interrupts = GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH;
ti,hwmods = uart5;
@@ -452,7 +452,7 @@
};
 
uart6: serial@48068000 {
-   compatible = ti,omap4-uart;
+   compatible = ti,dra742-uart, ti,omap4-uart;
reg = 0x48068000 0x100;
interrupts = GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH;
ti,hwmods = uart6;
@@ -463,7 +463,7 @@
};
 
uart7: serial@4842 {
-   compatible = ti,omap4-uart;
+   compatible = ti,dra742-uart, ti,omap4-uart;
reg = 0x4842 0x100;
interrupts = GIC_SPI 218 IRQ_TYPE_LEVEL_HIGH;
ti,hwmods = uart7;
@@ -472,7 +472,7 @@
};
 
uart8: serial@48422000 {
-   compatible = ti,omap4-uart;
+   compatible = ti,dra742-uart, ti,omap4-uart;
reg = 0x48422000 0x100;
interrupts = GIC_SPI 219 IRQ_TYPE_LEVEL_HIGH;
ti,hwmods = uart8;
@@ -481,7 +481,7 @@
};
 
uart9: serial@48424000 {
-   compatible = ti,omap4-uart;
+   compatible = ti,dra742-uart, ti,omap4-uart;
reg = 0x48424000 0x100;
interrupts = GIC_SPI 220 IRQ_TYPE_LEVEL_HIGH;
ti,hwmods = uart9;
@@ -490,7 +490,7 @@
};
 
uart10: serial@4ae2b000 {
-   compatible = ti,omap4-uart;
+   compatible = ti,dra742-uart, ti,omap4-uart;
reg = 0x4ae2b000 0x100;
interrupts = GIC_SPI 221 IRQ_TYPE_LEVEL_HIGH;
ti,hwmods = uart10;
-- 
2.4.4.408.g16da57c

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


  1   2   >