[PATCH v2 2/2] ARM: dts: am57xx-beagle-x15: use palmas-usb for USB2

2015-07-27 Thread Roger Quadros
The VBUS line of USB2 is connected to VBUS detect logic on
the PMIC. Use the palmas-usb driver to report VBUS events
to the USB driver.

As the palmas-usb driver supports GPIO based ID reporting
provide the GPIO for ID pin as well.

Signed-off-by: Roger Quadros rog...@ti.com
---
 arch/arm/boot/dts/am57xx-beagle-x15.dts | 29 -
 1 file changed, 16 insertions(+), 13 deletions(-)

diff --git a/arch/arm/boot/dts/am57xx-beagle-x15.dts 
b/arch/arm/boot/dts/am57xx-beagle-x15.dts
index a63bf78..f32cf20 100644
--- a/arch/arm/boot/dts/am57xx-beagle-x15.dts
+++ b/arch/arm/boot/dts/am57xx-beagle-x15.dts
@@ -98,13 +98,6 @@
pinctrl-0 = extcon_usb1_pins;
};
 
-   extcon_usb2: extcon_usb2 {
-   compatible = linux,extcon-usb-gpio;
-   id-gpio = gpio7 24 GPIO_ACTIVE_HIGH;
-   pinctrl-names = default;
-   pinctrl-0 = extcon_usb2_pins;
-   };
-
hdmi0: connector {
compatible = hdmi-connector;
label = hdmi;
@@ -326,12 +319,6 @@
;
};
 
-   extcon_usb2_pins: extcon_usb2_pins {
-   pinctrl-single,pins = 
-   0x3e8 (PIN_INPUT_PULLUP | MUX_MODE14) /* 
uart1_ctsn.gpio7_24 */
-   ;
-   };
-
tpd12s015_pins: pinmux_tpd12s015_pins {
pinctrl-single,pins = 
0x3b0 (PIN_OUTPUT | MUX_MODE14) /* gpio7_10 
CT_CP_HPD */
@@ -495,6 +482,14 @@
gpio-controller;
#gpio-cells = 2;
};
+
+   extcon_usb2: tps659038_usb {
+   compatible = ti,palmas-usb-vid;
+   ti,enable-vbus-detection;
+   ti,enable-id-detection;
+   id-gpios = gpio7 24 GPIO_ACTIVE_HIGH;
+   };
+
};
 
tmp102: tmp102@48 {
@@ -624,6 +619,14 @@
 };
 
 usb2 {
+   /*
+* Stand alone usage is peripheral only.
+* However, with some resistor modifications
+* this port can be used via expansion connectors
+* as host or dual-role. If so, provide
+* the necessary dr_mode override in the expansion
+* board's DT.
+*/
dr_mode = peripheral;
 };
 
-- 
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


[PATCH v2 1/2] extcon: palmas: Support GPIO based USB ID detection

2015-07-27 Thread Roger Quadros
Some palmas based chip variants do not have OTG based ID logic.
For these variants we rely on GPIO based USB ID detection.

These chips do have VBUS comparator for VBUS detection so we
continue to use the old way of detecting VBUS.

Signed-off-by: Roger Quadros rog...@ti.com
---
 .../devicetree/bindings/extcon/extcon-palmas.txt   |   5 +-
 drivers/extcon/extcon-palmas.c | 114 ++---
 include/linux/mfd/palmas.h |   6 ++
 3 files changed, 109 insertions(+), 16 deletions(-)

diff --git a/Documentation/devicetree/bindings/extcon/extcon-palmas.txt 
b/Documentation/devicetree/bindings/extcon/extcon-palmas.txt
index 45414bb..f61d5af 100644
--- a/Documentation/devicetree/bindings/extcon/extcon-palmas.txt
+++ b/Documentation/devicetree/bindings/extcon/extcon-palmas.txt
@@ -10,8 +10,11 @@ Required Properties:
 
 Optional Properties:
  - ti,wakeup : To enable the wakeup comparator in probe
- - ti,enable-id-detection: Perform ID detection.
+ - ti,enable-id-detection: Perform ID detection. If id-gpio is specified
+   it performs id-detection using GPIO else using OTG core.
  - ti,enable-vbus-detection: Perform VBUS detection.
+ - id-gpio: gpio for GPIO ID detection. See gpio binding.
+ - debounce-delay-ms: debounce delay for GPIO ID pin in milliseconds.
 
 palmas-usb {
compatible = ti,twl6035-usb, ti,palmas-usb;
diff --git a/drivers/extcon/extcon-palmas.c b/drivers/extcon/extcon-palmas.c
index 080d5cc..d0ed764 100644
--- a/drivers/extcon/extcon-palmas.c
+++ b/drivers/extcon/extcon-palmas.c
@@ -28,6 +28,9 @@
 #include linux/mfd/palmas.h
 #include linux/of.h
 #include linux/of_platform.h
+#include linux/of_gpio.h
+
+#define USB_GPIO_DEBOUNCE_MS   20  /* ms */
 
 static const unsigned int palmas_extcon_cable[] = {
EXTCON_USB,
@@ -120,19 +123,52 @@ static irqreturn_t palmas_id_irq_handler(int irq, void 
*_palmas_usb)
return IRQ_HANDLED;
 }
 
+static void palmas_gpio_id_detect(struct palmas_usb *palmas_usb)
+{
+   int id;
+
+   if (!palmas_usb-id_gpiod)
+   return;
+
+   id = gpiod_get_value_cansleep(palmas_usb-id_gpiod);
+
+   if (id) {
+   extcon_set_cable_state(palmas_usb-edev, USB-HOST, false);
+   dev_info(palmas_usb-dev, USB-HOST cable is detached\n);
+   } else {
+   extcon_set_cable_state(palmas_usb-edev, USB-HOST, true);
+   dev_info(palmas_usb-dev, USB-HOST cable is attached\n);
+   }
+}
+
+static irqreturn_t palmas_gpio_id_irq_handler(int irq, void *_palmas_usb)
+{
+   struct palmas_usb *palmas_usb = _palmas_usb;
+
+   if (palmas_usb-sw_debounce_ms)
+   mdelay(palmas_usb-sw_debounce_ms);
+
+   palmas_gpio_id_detect(palmas_usb);
+
+   return IRQ_HANDLED;
+}
+
 static void palmas_enable_irq(struct palmas_usb *palmas_usb)
 {
palmas_write(palmas_usb-palmas, PALMAS_USB_OTG_BASE,
PALMAS_USB_VBUS_CTRL_SET,
PALMAS_USB_VBUS_CTRL_SET_VBUS_ACT_COMP);
 
-   palmas_write(palmas_usb-palmas, PALMAS_USB_OTG_BASE,
-   PALMAS_USB_ID_CTRL_SET, PALMAS_USB_ID_CTRL_SET_ID_ACT_COMP);
+   if (palmas_usb-enable_id_detection) {
+   palmas_write(palmas_usb-palmas, PALMAS_USB_OTG_BASE,
+PALMAS_USB_ID_CTRL_SET,
+PALMAS_USB_ID_CTRL_SET_ID_ACT_COMP);
 
-   palmas_write(palmas_usb-palmas, PALMAS_USB_OTG_BASE,
-   PALMAS_USB_ID_INT_EN_HI_SET,
-   PALMAS_USB_ID_INT_EN_HI_SET_ID_GND |
-   PALMAS_USB_ID_INT_EN_HI_SET_ID_FLOAT);
+   palmas_write(palmas_usb-palmas, PALMAS_USB_OTG_BASE,
+PALMAS_USB_ID_INT_EN_HI_SET,
+PALMAS_USB_ID_INT_EN_HI_SET_ID_GND |
+PALMAS_USB_ID_INT_EN_HI_SET_ID_FLOAT);
+   }
 
if (palmas_usb-enable_vbus_detection)
palmas_vbus_irq_handler(palmas_usb-vbus_irq, palmas_usb);
@@ -171,20 +207,34 @@ static int palmas_usb_probe(struct platform_device *pdev)
palmas_usb-wakeup = pdata-wakeup;
}
 
+   palmas_usb-id_gpiod = devm_gpiod_get_optional(pdev-dev, id);
+   if (IS_ERR(palmas_usb-id_gpiod)) {
+   dev_err(pdev-dev, failed to get id gpio\n);
+   return PTR_ERR(palmas_usb-id_gpiod);
+   }
+
+   if (palmas_usb-enable_id_detection  palmas_usb-id_gpiod) {
+   palmas_usb-enable_id_detection = false;
+   palmas_usb-enable_gpio_id_detection = true;
+   }
+
+   if (palmas_usb-enable_gpio_id_detection) {
+   u32 debounce;
+
+   if (of_property_read_u32(node, debounce-delay-ms, debounce))
+   debounce = USB_GPIO_DEBOUNCE_MS;
+
+   status = gpiod_set_debounce(palmas_usb-id_gpiod,
+   debounce * 1000);
+   if (status  0)
+  

[PATCH v2 0/2] extcon: palmas: am57xx-beagle-x15: use palmas for VBUS/ID detection

2015-07-27 Thread Roger Quadros
Hi,

am57xx-beagle-x15 uses a variant of the Palmas chip and has
USB1 port's VBUS and ID connected to it.

However this Palmas variant does not support OTG ID detection but
does have GPIO support on the pin where ID line is connected.

This series adds GPIO based ID detection to the Palmas extcon
driver and updates am57xx-beagle-x15.dts to use Palmas
for VBUS and ID detection for USB1 port.

v2:
- Add debounce-delay-ms property. Re-use enable-id-detection property
to enable GPIO based ID detection based on availability of id-gpio.

cheers,
-roger

Roger Quadros (2):
  extcon: palmas: Support GPIO based USB ID detection
  ARM: dts: am57xx-beagle-x15: use palmas-usb for USB2

 .../devicetree/bindings/extcon/extcon-palmas.txt   |   5 +-
 arch/arm/boot/dts/am57xx-beagle-x15.dts|  29 +++---
 drivers/extcon/extcon-palmas.c | 114 ++---
 include/linux/mfd/palmas.h |   6 ++
 4 files changed, 125 insertions(+), 29 deletions(-)

-- 
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


[PATCH 2/2] regulator: pbias: Fix broken pbias disable functionality

2015-07-27 Thread Kishon Vijay Abraham I
regulator_disable of pbias always writes '0' to the enable_reg.
However actual disable value of pbias regulator is not always '0'.
Fix it by populating the disable_val in pbias_reg_info for the
various platforms and assign it to the disable_val of
pbias regulator descriptor. This will be used by
regulator_disable_regmap while disabling pbias regulator.

Cc: sta...@vger.kernel.org # 3.18+
Signed-off-by: Kishon Vijay Abraham I kis...@ti.com
---
 drivers/regulator/pbias-regulator.c |5 +
 1 file changed, 5 insertions(+)

diff --git a/drivers/regulator/pbias-regulator.c 
b/drivers/regulator/pbias-regulator.c
index a24cb43..ddf2c8e 100644
--- a/drivers/regulator/pbias-regulator.c
+++ b/drivers/regulator/pbias-regulator.c
@@ -31,6 +31,7 @@
 struct pbias_reg_info {
u32 enable;
u32 enable_mask;
+   u32 disable_val;
u32 vmode;
unsigned int enable_time;
char *name;
@@ -63,6 +64,7 @@ static const struct pbias_reg_info pbias_mmc_omap2430 = {
.enable = BIT(1),
.enable_mask = BIT(1),
.vmode = BIT(0),
+   .disable_val = 0,
.enable_time = 100,
.name = pbias_mmc_omap2430
 };
@@ -78,6 +80,7 @@ static const struct pbias_reg_info pbias_sim_omap3 = {
 static const struct pbias_reg_info pbias_mmc_omap4 = {
.enable = BIT(26) | BIT(22),
.enable_mask = BIT(26) | BIT(25) | BIT(22),
+   .disable_val = BIT(25),
.vmode = BIT(21),
.enable_time = 100,
.name = pbias_mmc_omap4
@@ -86,6 +89,7 @@ static const struct pbias_reg_info pbias_mmc_omap4 = {
 static const struct pbias_reg_info pbias_mmc_omap5 = {
.enable = BIT(27) | BIT(26),
.enable_mask = BIT(27) | BIT(25) | BIT(26),
+   .disable_val = BIT(25),
.vmode = BIT(21),
.enable_time = 100,
.name = pbias_mmc_omap5
@@ -165,6 +169,7 @@ static int pbias_regulator_probe(struct platform_device 
*pdev)
drvdata[data_idx].desc.enable_reg = reg;
drvdata[data_idx].desc.enable_mask = info-enable_mask;
drvdata[data_idx].desc.enable_val = info-enable;
+   drvdata[data_idx].desc.disable_val = info-disable_val;
 
cfg.init_data = pbias_matches[idx].init_data;
cfg.driver_data = drvdata[data_idx];
-- 
1.7.9.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 3/4] ARM: dts: OMAP5: Fix broken pbias device creation

2015-07-27 Thread Kishon Vijay Abraham I
commit ed8509edddeb (ARM: dts: omap5: add minimal l4 bus
layout with control module support) moved pbias_regulator dt node
from being a child node of ocp to be the child node of
omap5_padconf_global. After this device for pbias_regulator is
not created.

Fix it by adding simple-bus compatible property to
omap5_padconf_global dt node.

Fixes: ed8509edddeb (ARM: dts: omap5: add minimal l4 bus
layout with control module support)

Cc: sta...@vger.kernel.org
Signed-off-by: Kishon Vijay Abraham I kis...@ti.com
---
 arch/arm/boot/dts/omap5.dtsi |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/omap5.dtsi b/arch/arm/boot/dts/omap5.dtsi
index c8fd648..b1a1263 100644
--- a/arch/arm/boot/dts/omap5.dtsi
+++ b/arch/arm/boot/dts/omap5.dtsi
@@ -180,7 +180,8 @@
};
 
omap5_padconf_global: omap5_padconf_global@5a0 {
-   compatible = syscon;
+   compatible = syscon,
+simple-bus;
reg = 0x5a0 0xec;
#address-cells = 1;
#size-cells = 1;
-- 
1.7.9.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 4/4] ARM: dts: dra7: Fix broken pbias device creation

2015-07-27 Thread Kishon Vijay Abraham I
commit d919501feffa (ARM: dts: dra7: add minimal l4 bus
layout with control module support) moved pbias_regulator dt node
from being a child node of ocp to be the child node of
scm_conf. After this device for pbias_regulator is
not created.

Fix it by adding simple-bus compatible property to
scm_conf dt node.

Fixes: d919501feffa (ARM: dts: dra7: add minimal l4 bus
layout with control module support)

Cc: sta...@vger.kernel.org
Suggested-by: Tero Kristo t-kri...@ti.com
Signed-off-by: Kishon Vijay Abraham I kis...@ti.com
---
 arch/arm/boot/dts/dra7.dtsi |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/dra7.dtsi b/arch/arm/boot/dts/dra7.dtsi
index 8f1e25b..3062b1f 100644
--- a/arch/arm/boot/dts/dra7.dtsi
+++ b/arch/arm/boot/dts/dra7.dtsi
@@ -116,7 +116,7 @@
ranges = 0 0x2000 0x2000;
 
scm_conf: scm_conf@0 {
-   compatible = syscon;
+   compatible = syscon, simple-bus;
reg = 0x0 0x1400;
#address-cells = 1;
#size-cells = 1;
-- 
1.7.9.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


Re: [GIT PULL 1/2] omap soc changes for v4.3

2015-07-27 Thread Olof Johansson
On Fri, Jul 24, 2015 at 05:06:10AM -0700, Tony Lindgren wrote:
 The following changes since commit bc0195aad0daa2ad5b0d76cce22b167bc3435590:
 
   Linux 4.2-rc2 (2015-07-12 15:10:30 -0700)
 
 are available in the git repository at:
 
   git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap 
 tags/omap-for-v4.3/soc-signed
 
 for you to fetch changes up to 24da741c678f865de3182194604dbddcc7fc7f3c:
 
   Merge branch 'dm814x-soc' into omap-for-v4.3/soc (2015-07-23 21:59:18 -0700)
 
 
 SoC changes for omaps for v4.3 merge window:
 
 - Clean-up omap4_local_timer_init to drop deal legacy code
 
 - Provide proper IO map table for dra7
 
 - Clean-up IOMMU layer init code as it now uses IOMMU framework
 
 - A series of changes to fix up dm814x support that's been in a broken
   half-merged state for quite some time
 
 - A series of PRCM and hwmod changes via Paul Walmsley p...@pwsan.com:
 
   - I/O wakeup support for AM43xx
   - register lock and unlock support to the hwmod code (needed for the RTC
 IP blocks on some chips)
   - several fixes for sparse warnings and an unnecessary null pointer test
   - a DRA7xx clockdomain configuration workaround, to deal with some hardware
 bugs

Merged, thanks!

-Olof
--
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 v3] ARM: OMAP2+: hwmod: Fix _wait_target_ready() for hwmods without sysc

2015-07-27 Thread Roger Quadros
Hi,

On 16/07/15 16:16, Roger Quadros wrote:
 For hwmods without sysc, _init_mpu_rt_base(oh) won't be called and so
 _find_mpu_rt_port(oh) will return NULL thus preventing ready state check
 on those modules after the module is enabled.
 
 This can potentially cause a bus access error if the module is accessed
 before the module is ready.
 
 Fix this by unconditionally calling _init_mpu_rt_base() during hwmod
 _init(). Do ioremap only if we need SYSC access.
 
 Eventhough _wait_target_ready() check doesn't really need MPU RT port but
 just the PRCM registers, we still mandate that the hwmod must have an
 MPU RT port if ready state check needs to be done. Else it would mean that
 the module is not accessible by MPU so there is no point in waiting
 for target to be ready.
 
 e.g. this fixes the below DCAN bus access error on AM437x-gp-evm.
 
 [   16.672978] [ cut here ]
 [   16.677885] WARNING: CPU: 0 PID: 1580 at drivers/bus/omap_l3_noc.c:147 
 l3_interrupt_handler+0x234/0x35c()
 [   16.687946] 4400.ocp:L3 Custom Error: MASTER M2 (64-bit) TARGET 
 L4_PER_0 (Read): Data Access in User mode during Functional access
 [   16.700654] Modules linked in: xhci_hcd btwilink ti_vpfe dwc3 
 videobuf2_core ov2659 bluetooth v4l2_common videodev ti_am335x_adc kfifo_buf 
 industrialio c_can_platform videobuf2_dma_contig media snd_soc_tlv320aic3x 
 pixcir_i2c_ts c_can dc
 [   16.731144] CPU: 0 PID: 1580 Comm: rpc.statd Not tainted 
 3.14.26-02561-gf733aa036398 #180
 [   16.739747] Backtrace:
 [   16.742336] [c0011108] (dump_backtrace) from [c00112a4] 
 (show_stack+0x18/0x1c)
 [   16.750285]  r6:0093 r5:0009 r4:eab5b8a8 r3:
 [   16.756252] [c001128c] (show_stack) from [c05a4418] 
 (dump_stack+0x20/0x28)
 [   16.763870] [c05a43f8] (dump_stack) from [c0037120] 
 (warn_slowpath_common+0x6c/0x8c)
 [   16.772408] [c00370b4] (warn_slowpath_common) from [c00371e4] 
 (warn_slowpath_fmt+0x38/0x40)
 [   16.781550]  r8:c05d1f90 r7:c0730844 r6:c0730448 r5:80080003 r4:ed0cd210
 [   16.788626] [c00371b0] (warn_slowpath_fmt) from [c027fa94] 
 (l3_interrupt_handler+0x234/0x35c)
 [   16.797968]  r3:ed0cd480 r2:c0730508
 [   16.801747] [c027f860] (l3_interrupt_handler) from [c0063758] 
 (handle_irq_event_percpu+0x54/0x1bc)
 [   16.811533]  r10:ed005600 r9:c084855b r8:002a r7: r6: 
 r5:002a
 [   16.819780]  r4:ed0e6d80
 [   16.822453] [c0063704] (handle_irq_event_percpu) from [c00638f0] 
 (handle_irq_event+0x30/0x40)
 [   16.831789]  r10:eb2b6938 r9:eb2b6960 r8:bf011420 r7:fa240100 r6: 
 r5:002a
 [   16.840052]  r4:ed005600
 [   16.842744] [c00638c0] (handle_irq_event) from [c00661d8] 
 (handle_fasteoi_irq+0x74/0x128)
 [   16.851702]  r4:ed005600 r3:
 [   16.855479] [c0066164] (handle_fasteoi_irq) from [c0063068] 
 (generic_handle_irq+0x28/0x38)
 [   16.864523]  r4:002a r3:c0066164
 [   16.868294] [c0063040] (generic_handle_irq) from [c000ef60] 
 (handle_IRQ+0x38/0x8c)
 [   16.876612]  r4:c081c640 r3:0202
 [   16.880380] [c000ef28] (handle_IRQ) from [c00084f0] 
 (gic_handle_irq+0x30/0x5c)
 [   16.888328]  r6:eab5ba38 r5:c0804460 r4:fa24010c r3:0100
 [   16.894303] [c00084c0] (gic_handle_irq) from [c05a8d80] 
 (__irq_svc+0x40/0x50)
 [   16.902193] Exception stack(0xeab5ba38 to 0xeab5ba80)
 [   16.907499] ba20:   
  0006
 [   16.916108] ba40: fa1d fa1d0008 ed3d3000 eab5bab4 ed3d3460 c0842af4 
 bf011420 eb2b6960
 [   16.924716] ba60: eb2b6938 eab5ba8c eab5ba90 eab5ba80 bf035220 bf07702c 
 600f0013 
 [   16.933317]  r7:eab5ba6c r6: r5:600f0013 r4:bf07702c
 [   16.939317] [bf077000] (c_can_plat_read_reg_aligned_to_16bit 
 [c_can_platform]) from [bf035220] (c_can_get_berr_counter+0x38/0x64 [c_can])
 [   16.952696] [bf0351e8] (c_can_get_berr_counter [c_can]) from 
 [bf010294] (can_fill_info+0x124/0x15c [can_dev])
 [   16.963480]  r5:ec8c9740 r4:ed3d3000
 [   16.967253] [bf010170] (can_fill_info [can_dev]) from [c0502fa8] 
 (rtnl_fill_ifinfo+0x58c/0x8fc)
 [   16.976749]  r6:ec8c9740 r5:ed3d3000 r4:eb2b6780
 [   16.981613] [c0502a1c] (rtnl_fill_ifinfo) from [c0503408] 
 (rtnl_dump_ifinfo+0xf0/0x1dc)
 [   16.990401]  r10:ec8c9740 r9: r8: r7: r6:ebd4d1b4 
 r5:ed3d3000
 [   16.998671]  r4:
 [   17.001342] [c0503318] (rtnl_dump_ifinfo) from [c050e6e4] 
 (netlink_dump+0xa8/0x1e0)
 [   17.009772]  r10: r9: r8:c0503318 r7:ebf3e6c0 r6:ebd4d1b4 
 r5:ec8c9740
 [   17.018050]  r4:ebd4d000
 [   17.020714] [c050e63c] (netlink_dump) from [c050ec10] 
 (__netlink_dump_start+0x104/0x154)
 [   17.029591]  r6:eab5bd34 r5:ec8c9980 r4:ebd4d000
 [   17.034454] [c050eb0c] (__netlink_dump_start) from [c0505604] 
 (rtnetlink_rcv_msg+0x110/0x1f4)
 [   17.043778]  r7: r6:ec8c9980 r5:0f40 r4:ebf3e6c0
 [   17.049743] [c05054f4] (rtnetlink_rcv_msg) from [c05108e8] 
 (netlink_rcv_skb+0xb4/0xc8)
 [   17.058449]  r8:eab5bdac r7:ec8c9980 

Re: [PATCH v3 1/2] input: touchscreen: pixcir_i2c_ts: Add support for optional wakeup interrupt

2015-07-27 Thread Vignesh R


On 07/27/2015 04:19 PM, Roger Quadros wrote:
 Hi,
 
 On 23/07/15 17:54, Vignesh R wrote:
 On am437x-gp-evm, pixcir touchscreen can wake the system from low power
 state by generating wake-up interrupt via pinctrl and IO daisy chain.
 Add support for optional wakeup interrupt source by regsitering to
 automated wake IRQ framework introduced by commit 4990d4fe327b (PM /
 Wakeirq: Add automated device wake IRQ handling).
 This is similar in approach to commit 2a0b965cfb6e (serial: omap: Add
 support for optional wake-up)

 Signed-off-by: Vignesh R vigne...@ti.com
 ---

 v3:
  * handle error code returned by of_irq_get_byname()

 v2:
  * use of_irq_get_byname()
  * remove enable/disable_wake_irq()

  drivers/input/touchscreen/pixcir_i2c_ts.c | 22 ++
  include/linux/input/pixcir_ts.h   |  1 +
  2 files changed, 19 insertions(+), 4 deletions(-)

 diff --git a/drivers/input/touchscreen/pixcir_i2c_ts.c 
 b/drivers/input/touchscreen/pixcir_i2c_ts.c
 index 8f3e243a62bf..3a4ab358bf52 100644
 --- a/drivers/input/touchscreen/pixcir_i2c_ts.c
 +++ b/drivers/input/touchscreen/pixcir_i2c_ts.c
 @@ -29,6 +29,8 @@
  #include linux/of.h
  #include linux/of_gpio.h
  #include linux/of_device.h
 +#include linux/of_irq.h
 +#include linux/pm_wakeirq.h
  
  #define PIXCIR_MAX_SLOTS   5 /* Max fingers supported by driver */
  
 @@ -364,8 +366,6 @@ static int __maybe_unused pixcir_i2c_ts_suspend(struct 
 device *dev)
  goto unlock;
  }
  }
 -
 -enable_irq_wake(client-irq);
  } else if (input-users) {
  ret = pixcir_stop(ts);
  }
 @@ -386,8 +386,6 @@ static int __maybe_unused pixcir_i2c_ts_resume(struct 
 device *dev)
  mutex_lock(input-mutex);
  
  if (device_may_wakeup(client-dev)) {
 -disable_irq_wake(client-irq);
 -
  if (!input-users) {
  ret = pixcir_stop(ts);
  if (ret) {
 @@ -445,6 +443,13 @@ static struct pixcir_ts_platform_data 
 *pixcir_parse_dt(struct device *dev)
  dev_dbg(dev, %s: x %d, y %d, gpio %d\n, __func__,
  pdata-x_max + 1, pdata-y_max + 1, pdata-gpio_attb);
  
 +pdata-wakeirq = of_irq_get_byname(dev-of_node, wakeup);
 +if (pdata-wakeirq  0  pdata-wakeirq != -ENODATA 
 +pdata-wakeirq != -EINVAL) {
 +dev_err(dev, Failed to get wakeirq\n);
 +return ERR_PTR(pdata-wakeirq);
 +}
 +
  return pdata;
  }
  #else
 @@ -564,11 +569,20 @@ static int pixcir_i2c_ts_probe(struct i2c_client 
 *client,
  i2c_set_clientdata(client, tsdata);
  device_init_wakeup(client-dev, 1);
  
 +/* Register wakeirq */
 +error = (pdata-wakeirq  0) ?
 +dev_pm_set_dedicated_wake_irq(dev, pdata-wakeirq) :
 +dev_pm_set_wake_irq(dev, client-irq);
 
 Can 0 be a valid wakeirq or client-irq?
 If yes then this logic is broken.
 

AFAIK, IRQ 0 is always assigned to system timer interrupt (cannot find
reliable source to quote).

 I would set wakeirq to -EINVAL or something if it is not available
 during probe and check for that condition.
 

Not sure, if I understand you correctly
pdata-wakeirq will have -ENODATA or -EINVAL(as returned by
of_irq_get_byname()), if wakeirq is not available. Do you want me to
check for these two conditions specifically rather than
(pdata-wakeirq  0) ?

-- 
Regards
Vignesh
--
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 2/2] omap dts changes for dm814x for v4.3

2015-07-27 Thread Olof Johansson
On Fri, Jul 24, 2015 at 05:06:11AM -0700, Tony Lindgren wrote:
 The following changes since commit f9d50fef4b6447527c2be1ad07499221c2511391:
 
   ARM: OMAP2+: omap3-pandora: add wifi support (2015-07-21 04:07:42 -0700)
 
 are available in the git repository at:
 
   git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap 
 tags/omap-for-v4.3/dt-dm814x
 
 for you to fetch changes up to f5887fe5d14181aef0653ab04f60988252d42461:
 
   ARM: OMAP2+: Add custom abort handler for t410 (2015-07-23 22:33:19 -0700)
 
 
 omap dts changes for minimal dm814x support for v4.3 merge window.
 
 These changes make dm814x boot and adds minimal board support for
 dm814x-evm and hp t410.
 
 Note that to boot these depend on omap-for-v4.3/soc-signed branch,
 but as dm814x support is currently broken, these can be merged
 separately with the other dts changes.
 
 
 Tony Lindgren (5):
   ARM: dts: Add minimal dm814x support
   ARM: dts: Add minimal clocks for dm814x
   ARM: dts: Add minimal dts support for dm8148-evm
   ARM: dts: Add minimal support for HP T410
   ARM: OMAP2+: Add custom abort handler for t410

Thanks, merged.


-Olof
--
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] gpio: omap: use raw locks for locking

2015-07-27 Thread Linus Walleij
On Tue, Jul 21, 2015 at 6:26 PM, Sebastian Andrzej Siewior
bige...@linutronix.de wrote:

 This patch converts gpio_bank.lock from a spin_lock into a
 raw_spin_lock. The call path is to access this lock is always under a
 raw_spin_lock, for instance
 - __setup_irq() holds desc-lock with irq off
   + __irq_set_trigger()
+ omap_gpio_irq_type()

 - handle_level_irq() (runs with irqs off therefore raw locks)
   + mask_ack_irq()
+ omap_gpio_mask_irq()

 This fixes the obvious backtrace on -RT. However the locking vs context
 is not and this is not limited to -RT:
 - omap_gpio_irq_type() is called with IRQ off and has an conditional
   call to pm_runtime_get_sync() which may sleep. Either it may happen or
   it may not happen but pm_runtime_get_sync() should not be called with
   irqs off.

 - omap_gpio_debounce() is holding the lock with IRQs off.
   + omap2_set_gpio_debounce()
+ clk_prepare_enable()
 + clk_prepare() this one might sleep.
   The number of users of gpiod_set_debounce() / gpio_set_debounce()
   looks low but still this is not good.

 Acked-by: Javier Martinez Canillas jav...@dowhile0.org
 Acked-by: Santosh Shilimkar ssant...@kernel.org
 Signed-off-by: Sebastian Andrzej Siewior bige...@linutronix.de

Patch applied.

Now this question appear in my head:

Is drivers/gpio full of stuff that will not work with the -RT kernel,
and is this a change that should be done mutatis mutandis on
all the GPIO drivers?

Yours,
Linus Walleij
--
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 v3 1/2] input: touchscreen: pixcir_i2c_ts: Add support for optional wakeup interrupt

2015-07-27 Thread Roger Quadros
Hi,

On 23/07/15 17:54, Vignesh R wrote:
 On am437x-gp-evm, pixcir touchscreen can wake the system from low power
 state by generating wake-up interrupt via pinctrl and IO daisy chain.
 Add support for optional wakeup interrupt source by regsitering to
 automated wake IRQ framework introduced by commit 4990d4fe327b (PM /
 Wakeirq: Add automated device wake IRQ handling).
 This is similar in approach to commit 2a0b965cfb6e (serial: omap: Add
 support for optional wake-up)
 
 Signed-off-by: Vignesh R vigne...@ti.com
 ---
 
 v3:
  * handle error code returned by of_irq_get_byname()
 
 v2:
  * use of_irq_get_byname()
  * remove enable/disable_wake_irq()
 
  drivers/input/touchscreen/pixcir_i2c_ts.c | 22 ++
  include/linux/input/pixcir_ts.h   |  1 +
  2 files changed, 19 insertions(+), 4 deletions(-)
 
 diff --git a/drivers/input/touchscreen/pixcir_i2c_ts.c 
 b/drivers/input/touchscreen/pixcir_i2c_ts.c
 index 8f3e243a62bf..3a4ab358bf52 100644
 --- a/drivers/input/touchscreen/pixcir_i2c_ts.c
 +++ b/drivers/input/touchscreen/pixcir_i2c_ts.c
 @@ -29,6 +29,8 @@
  #include linux/of.h
  #include linux/of_gpio.h
  #include linux/of_device.h
 +#include linux/of_irq.h
 +#include linux/pm_wakeirq.h
  
  #define PIXCIR_MAX_SLOTS   5 /* Max fingers supported by driver */
  
 @@ -364,8 +366,6 @@ static int __maybe_unused pixcir_i2c_ts_suspend(struct 
 device *dev)
   goto unlock;
   }
   }
 -
 - enable_irq_wake(client-irq);
   } else if (input-users) {
   ret = pixcir_stop(ts);
   }
 @@ -386,8 +386,6 @@ static int __maybe_unused pixcir_i2c_ts_resume(struct 
 device *dev)
   mutex_lock(input-mutex);
  
   if (device_may_wakeup(client-dev)) {
 - disable_irq_wake(client-irq);
 -
   if (!input-users) {
   ret = pixcir_stop(ts);
   if (ret) {
 @@ -445,6 +443,13 @@ static struct pixcir_ts_platform_data 
 *pixcir_parse_dt(struct device *dev)
   dev_dbg(dev, %s: x %d, y %d, gpio %d\n, __func__,
   pdata-x_max + 1, pdata-y_max + 1, pdata-gpio_attb);
  
 + pdata-wakeirq = of_irq_get_byname(dev-of_node, wakeup);
 + if (pdata-wakeirq  0  pdata-wakeirq != -ENODATA 
 + pdata-wakeirq != -EINVAL) {
 + dev_err(dev, Failed to get wakeirq\n);
 + return ERR_PTR(pdata-wakeirq);
 + }
 +
   return pdata;
  }
  #else
 @@ -564,11 +569,20 @@ static int pixcir_i2c_ts_probe(struct i2c_client 
 *client,
   i2c_set_clientdata(client, tsdata);
   device_init_wakeup(client-dev, 1);
  
 + /* Register wakeirq */
 + error = (pdata-wakeirq  0) ?
 + dev_pm_set_dedicated_wake_irq(dev, pdata-wakeirq) :
 + dev_pm_set_wake_irq(dev, client-irq);

Can 0 be a valid wakeirq or client-irq?
If yes then this logic is broken.

I would set wakeirq to -EINVAL or something if it is not available
during probe and check for that condition.

 + if (error)
 + dev_info(dev, unable to setup wakeirq %d\n,
 +  error);
 +
   return 0;
  }
  
  static int pixcir_i2c_ts_remove(struct i2c_client *client)
  {
 + dev_pm_clear_wake_irq(client-dev);
   device_init_wakeup(client-dev, 0);
  
   return 0;
 diff --git a/include/linux/input/pixcir_ts.h b/include/linux/input/pixcir_ts.h
 index 7bae83b7c396..da573de5a5ee 100644
 --- a/include/linux/input/pixcir_ts.h
 +++ b/include/linux/input/pixcir_ts.h
 @@ -58,6 +58,7 @@ struct pixcir_ts_platform_data {
   int x_max;
   int y_max;
   int gpio_attb;  /* GPIO connected to ATTB line */
 + int wakeirq;
   struct pixcir_i2c_chip_data chip;
  };
  
 

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


[PATCH 0/2] pbias regulator fixes

2015-07-27 Thread Kishon Vijay Abraham I
Patch series contains a couple of fixes. One that disables pbias
properly (write the correct value to disable regulator instead of
writing 0). And the other is to get the correct address to
enable/disable the pbias regulator.

Tested on DRA7 (tests pbias_mmc_omap5) and OMAP5 panda (tests
pbias_mmc_omap4).

Kishon Vijay Abraham I (2):
  regulator: pbias: use untranslated address to program pbias regulator
  regulator: pbias: Fix broken pbias disable functionality

 drivers/regulator/pbias-regulator.c |   21 -
 1 file changed, 16 insertions(+), 5 deletions(-)

-- 
1.7.9.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 1/2] regulator: pbias: use untranslated address to program pbias regulator

2015-07-27 Thread Kishon Vijay Abraham I
vsel_reg and enable_reg of the pbias regulator descriptor should actually
have the offset from syscon. However after the pbias device tree node
is moved as a child node of syscon, vsel_reg and enable_reg has the
absolute address because of the address translation that happens while
creating device from device tree node.
So avoid using platform_get_resource and use of_get_address in order to
get only the offset (untranslated address) and populate these in
vsel_reg and enable_reg.

Cc: sta...@vger.kernel.org
Cc: Tero Kristo t-kri...@ti.com
Signed-off-by: Kishon Vijay Abraham I kis...@ti.com
---
 drivers/regulator/pbias-regulator.c |   16 +++-
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/drivers/regulator/pbias-regulator.c 
b/drivers/regulator/pbias-regulator.c
index bd2b75c..a24cb43 100644
--- a/drivers/regulator/pbias-regulator.c
+++ b/drivers/regulator/pbias-regulator.c
@@ -22,6 +22,7 @@
 #include linux/regulator/driver.h
 #include linux/regulator/machine.h
 #include linux/regulator/of_regulator.h
+#include linux/of_address.h
 #include linux/regmap.h
 #include linux/slab.h
 #include linux/of.h
@@ -108,12 +109,14 @@ static int pbias_regulator_probe(struct platform_device 
*pdev)
 {
struct device_node *np = pdev-dev.of_node;
struct pbias_regulator_data *drvdata;
-   struct resource *res;
struct regulator_config cfg = { };
struct regmap *syscon;
const struct pbias_reg_info *info;
int ret = 0;
int count, idx, data_idx = 0;
+   const __be32 *addrp;
+   int ns;
+   unsigned int reg;
 
count = of_regulator_match(pdev-dev, np, pbias_matches,
PBIAS_NUM_REGS);
@@ -141,10 +144,13 @@ static int pbias_regulator_probe(struct platform_device 
*pdev)
if (!info)
return -ENODEV;
 
-   res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-   if (!res)
+   addrp = of_get_address(np, 0, NULL, NULL);
+   if (!addrp)
return -EINVAL;
 
+   ns = of_n_size_cells(np);
+   reg = of_read_number(addrp, ns);
+
drvdata[data_idx].syscon = syscon;
drvdata[data_idx].info = info;
drvdata[data_idx].desc.name = info-name;
@@ -154,9 +160,9 @@ static int pbias_regulator_probe(struct platform_device 
*pdev)
drvdata[data_idx].desc.volt_table = pbias_volt_table;
drvdata[data_idx].desc.n_voltages = 2;
drvdata[data_idx].desc.enable_time = info-enable_time;
-   drvdata[data_idx].desc.vsel_reg = res-start;
+   drvdata[data_idx].desc.vsel_reg = reg;
drvdata[data_idx].desc.vsel_mask = info-vmode;
-   drvdata[data_idx].desc.enable_reg = res-start;
+   drvdata[data_idx].desc.enable_reg = reg;
drvdata[data_idx].desc.enable_mask = info-enable_mask;
drvdata[data_idx].desc.enable_val = info-enable;
 
-- 
1.7.9.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


[RFT PATCH 1/4] ARM: dts: omap24xx: Fix broken pbias device creation

2015-07-27 Thread Kishon Vijay Abraham I
commit 72b10ac00eb1 (ARM: dts: omap24xx: add minimal l4 bus
layout with control module support) moved pbias_regulator dt node
from being a child node of ocp to be the child node of
scm_conf. After this device for pbias_regulator is
not created.

Fix it by adding simple-bus compatible property to
scm_conf dt node.

Fixes: 72b10ac00eb1 (ARM: dts: omap24xx: add minimal l4 bus
layout with control module support)

Cc: sta...@vger.kernel.org
Signed-off-by: Kishon Vijay Abraham I kis...@ti.com
---
 arch/arm/boot/dts/omap2430.dtsi |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/omap2430.dtsi b/arch/arm/boot/dts/omap2430.dtsi
index 11a7963..2390f38 100644
--- a/arch/arm/boot/dts/omap2430.dtsi
+++ b/arch/arm/boot/dts/omap2430.dtsi
@@ -51,7 +51,8 @@
};
 
scm_conf: scm_conf@270 {
-   compatible = syscon;
+   compatible = syscon,
+simple-bus;
reg = 0x270 0x240;
#address-cells = 1;
#size-cells = 1;
-- 
1.7.9.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 0/4] omap: Fix broken pbias device creation

2015-07-27 Thread Kishon Vijay Abraham I
pbias device creation got broken once SCM cleanup got merged.
This patch series re-enables device creation by adding
simple-bus in the compatible property of the syscon
dt node.

validated this series in DRA72, OMAP4 PANDA and OMAP5 UEVM
boards.

Kishon Vijay Abraham I (4):
  ARM: dts: omap24xx: Fix broken pbias device creation
  ARM: dts: OMAP4: Fix broken pbias device creation
  ARM: dts: OMAP5: Fix broken pbias device creation
  ARM: dts: dra7: Fix broken pbias device creation

 arch/arm/boot/dts/dra7.dtsi |2 +-
 arch/arm/boot/dts/omap2430.dtsi |3 ++-
 arch/arm/boot/dts/omap4.dtsi|3 ++-
 arch/arm/boot/dts/omap5.dtsi|3 ++-
 4 files changed, 7 insertions(+), 4 deletions(-)

-- 
1.7.9.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 2/4] ARM: dts: OMAP4: Fix broken pbias device creation

2015-07-27 Thread Kishon Vijay Abraham I
commit 7415b0b4c645 (ARM: dts: omap4: add minimal l4 bus layout
with control module support) moved pbias_regulator dt node
from being a child node of ocp to be the child node of
omap4_padconf_global. After this device for pbias_regulator
is not created.

Fix it by adding simple-bus compatible property to
omap4_padconf_global dt node.

Fixes: 7415b0b4c645 (ARM: dts: omap4: add minimal l4 bus layout
with control module support)

Cc: sta...@vger.kernel.org
Signed-off-by: Kishon Vijay Abraham I kis...@ti.com
---
 arch/arm/boot/dts/omap4.dtsi |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/omap4.dtsi b/arch/arm/boot/dts/omap4.dtsi
index 7d31c6f..abc4473 100644
--- a/arch/arm/boot/dts/omap4.dtsi
+++ b/arch/arm/boot/dts/omap4.dtsi
@@ -191,7 +191,8 @@
};
 
omap4_padconf_global: omap4_padconf_global@5a0 {
-   compatible = syscon;
+   compatible = syscon,
+simple-bus;
reg = 0x5a0 0x170;
#address-cells = 1;
#size-cells = 1;
-- 
1.7.9.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


Re: [PATCH] gpio: omap: use raw locks for locking

2015-07-27 Thread Sebastian Andrzej Siewior
On 07/27/2015 02:50 PM, Linus Walleij wrote:
 Patch applied.
thanks.

 
 Now this question appear in my head:
 
 Is drivers/gpio full of stuff that will not work with the -RT kernel,
 and is this a change that should be done mutatis mutandis on
 all the GPIO drivers?

I described two call paths where you need a rawlock_t. If your gpio
driver uses irq_chip_generic then you a rawlock here and things should
be fine.

In general: If your gpio controller acts as an interrupts controller
(that is via chained handler) then you need the raw-locks if you need
any locking (if you have a write 1 to mask/unmask/enable/disable
register then you probably don't need any locking here at all). If the
gpio controller does not act as an interrupt controller than the
spinlock_t type should be enough.
If your gpio-interrupt controller requests its interrupt via
requested_threaded_irq() then it should do handle_nested_irq() and a
mutex is probably used for locking.

Using request_irq() with 0 flags is kind of broken. It works in
IRQ-context and delivers the interrupts with generic_handle_irq() and
this one passes it the handler (like handle_edge_irq() /
handle_level_irq()) which takes a raw_lock. Now, if you boot the
vanilla kernel with threadedirq then the irq-handler runs in threaded
context and you can't take a spinlock here anymore. So I think you
should use here IRQF_NO_THREAD here (and the raw lock type). I added
tglx on Cc: to back up because it is Monday.

 Yours,
 Linus Walleij
 

Sebastian
--
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/2] ARM: dts: Add support for phyCORE-AM335x SoM

2015-07-27 Thread Matt Porter
On Thu, Jul 16, 2015 at 10:30:48AM +0200, Teresa Remmet wrote:
 phyCORE-AM335x is a SoM (System on Module) containing
 a AM335x SOC. The module can be connected to different
 carrier boards.
 
 Some hardware parts are configurable on the phyCORE-AM335x.
 So they are disabled on default in this som dtsi file.
 They will be enabled in the board dts files, when populated.
 
 * RAM up to 1GiB
 * PMIC
 * NAND flash up to 1GiB
 * Eth PHY on SOM: 1x RMII
 * SPI NOR flash 8MiB (optional)
 * i2c RTC (optional)
 * i2c EEPROM 4kiB (optional)
 
 Signed-off-by: Teresa Remmet t.rem...@phytec.de
 ---
  arch/arm/boot/dts/am335x-phycore-som.dtsi | 368 
 ++
  1 file changed, 368 insertions(+)
  create mode 100644 arch/arm/boot/dts/am335x-phycore-som.dtsi
 
 diff --git a/arch/arm/boot/dts/am335x-phycore-som.dtsi 
 b/arch/arm/boot/dts/am335x-phycore-som.dtsi
 new file mode 100644
 index 000..4d28fc3
 --- /dev/null
 +++ b/arch/arm/boot/dts/am335x-phycore-som.dtsi
 @@ -0,0 +1,368 @@
 +/*
 + * Copyright (C) 2015 Phytec Messtechnik GmbH
 + * Author: Teresa Remmet t.rem...@phytec.de
 + *
 + * This program is free software; you can redistribute it and/or modify
 + * it under the terms of the GNU General Public License version 2 as
 + * published by the Free Software Foundation.
 + */
 +
 +#include am33xx.dtsi
 +
 +/ {
 + model = Phytec AM335x phyCORE;
 + compatible = phytec,am335x-phycore-som, ti,am33xx;

One minor thing here...wildcards in compatible strings aren't permitted.
However, family compatibles like ti,am33xx that came in before this
was enforced are grandfathered. Ideally, the newly introced board/som
specific strings should not propagate that wildcard. i.e. something
like phytec,am3352-phycore-som or whatever is the base family part
on these SOMs.

-Matt

 +
 + aliases {
 + rtc0 = i2c_rtc;
 + rtc1 = rtc;
 + };
 +
 + cpus {
 + cpu@0 {
 + cpu0-supply = vdd1_reg;
 + };
 + };
 +
 + memory {
 + device_type = memory;
 + reg = 0x8000 0x1000; /* 256 MB */
 + };
 +
 + vbat: fixedregulator@0 {
 + compatible = regulator-fixed;
 + };
 +};
 +
 +/* Crypto Module */
 +aes {
 + status = okay;
 +};
 +
 +sham {
 + status = okay;
 +};
 +
 +/* Ethernet */
 +am33xx_pinmux {
 + ethernet0_pins: pinmux_ethernet0 {
 + pinctrl-single,pins = 
 + 0x10c (PIN_INPUT_PULLDOWN | MUX_MODE1)  /* 
 mii1_crs.rmii1_crs_dv */
 + 0x110 (PIN_INPUT_PULLDOWN | MUX_MODE1)  /* 
 mii1_rxerr.rmii1_rxerr */
 + 0x114 (PIN_OUTPUT | MUX_MODE1)  /* 
 mii1_txen.rmii1_txen */
 + 0x124 (PIN_OUTPUT | MUX_MODE1)  /* 
 mii1_txd1.rmii1_txd1 */
 + 0x128 (PIN_OUTPUT | MUX_MODE1)  /* 
 mii1_txd0.rmii1_txd0 */
 + 0x13c (PIN_INPUT_PULLDOWN | MUX_MODE1)  /* 
 mii1_rxd1.rmii1_rxd1 */
 + 0x140 (PIN_INPUT_PULLDOWN | MUX_MODE1)  /* 
 mii1_rxd0.rmii1_rxd0 */
 + 0x144 (PIN_INPUT_PULLDOWN | MUX_MODE0)  /* 
 rmii1_refclk.rmii1_refclk */
 + ;
 + };
 +
 + mdio_pins: pinmux_mdio {
 + pinctrl-single,pins = 
 + /* MDIO */
 + 0x148 (PIN_INPUT_PULLUP | SLEWCTRL_FAST | MUX_MODE0)
 /* mdio_data.mdio_data */
 + 0x14c (PIN_OUTPUT_PULLUP | MUX_MODE0)   
 /* mdio_clk.mdio_clk */
 + ;
 + };
 +};
 +
 +cpsw_emac0 {
 + phy_id = davinci_mdio, 0;
 + phy-mode = rmii;
 + dual_emac_res_vlan = 1;
 +};
 +
 +davinci_mdio {
 + pinctrl-names = default;
 + pinctrl-0 = mdio_pins;
 + status = okay;
 +};
 +
 +mac {
 + slaves = 1;
 + pinctrl-names = default;
 + pinctrl-0 = ethernet0_pins;
 + status = okay;
 +};
 +
 +phy_sel {
 + rmii-clock-ext;
 +};
 +
 +/* I2C Busses */
 +am33xx_pinmux {
 + i2c0_pins: pinmux_i2c0 {
 + pinctrl-single,pins = 
 + 0x188 (PIN_INPUT | MUX_MODE0)   /* i2c0_sda.i2c0_sda */
 + 0x18c (PIN_INPUT | MUX_MODE0)   /* i2c0_scl.i2c0_scl */
 + ;
 + };
 +};
 +
 +i2c0 {
 + pinctrl-names = default;
 + pinctrl-0 = i2c0_pins;
 + clock-frequency = 40;
 + status = okay;
 +
 + tps: pmic@2d {
 + reg = 0x2d;
 + };
 +
 + i2c_eeprom: eeprom@52 {
 + compatible = atmel,24c32;
 + pagesize = 32;
 + reg = 0x52;
 + status = disabled;
 + };
 +
 + i2c_rtc: rtc@68 {
 + compatible = rv4162;
 + reg = 0x68;
 + status = disabled;
 + };
 +};
 +
 +/* NAND memory */
 +am33xx_pinmux {
 + nandflash_pins: pinmux_nandflash {
 + pinctrl-single,pins = 
 + 0x0 (PIN_INPUT_PULLUP | MUX_MODE0)  /* 
 gpmc_ad0.gpmc_ad0 */
 + 

Re: [PATCH 2/3] drivers: usb: dwc3: Add adjust_frame_length_quirk

2015-07-27 Thread Felipe Balbi
On Mon, Jul 27, 2015 at 06:56:48AM +, Badola Nikhil wrote:
  -Original Message-
  From: Felipe Balbi [mailto:ba...@ti.com]
  Sent: Thursday, July 23, 2015 8:39 PM
  To: Felipe Balbi
  Cc: Badola Nikhil-B46172; linux-ker...@vger.kernel.org; linux-
  u...@vger.kernel.org; linux-omap@vger.kernel.org;
  gre...@linuxfoundation.org
  Subject: Re: [PATCH 2/3] drivers: usb: dwc3: Add adjust_frame_length_quirk
  
  Hi again,
  
  On Thu, Jul 23, 2015 at 09:55:32AM -0500, Felipe Balbi wrote:
diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h index
0447788..b7a5119 100644
--- a/drivers/usb/dwc3/core.h
+++ b/drivers/usb/dwc3/core.h
@@ -124,6 +124,7 @@
 #define DWC3_GEVNTCOUNT(n) (0xc40c + (n * 0x10))
   
 #define DWC3_GHWPARAMS80xc600
+#define DWC3_GFLADJ0xc630
   
 /* Device Registers */
 #define DWC3_DCFG  0xc700
@@ -234,6 +235,10 @@
 /* Global HWPARAMS6 Register */
 #define DWC3_GHWPARAMS6_EN_FPGA(1  7)
   
+/* Global Frame Length Adjustment Register */
+#define GFLADJ_30MHZ_REG_SEL   (1  7)
  
   always prepend with DWC3_ like *all* other macros in this file.
  
   Also, match docs to ease grepping. This should be called
   DWC3_GFLADJ_30MHZ_SDBND_SEL
 
 GFLADJ_30MHZ_REG_SEL is the field's name in LS1021A Reference Manual
 as well as dwc3 databook. Though DWC3_GFLADJ_30MHZ_SDBND_SEL seems
 more relevant. 

databook calls it GFLADJ_30MHZ_SDBND_SEL, I checked before sending my
email.

  yet another problem is that this register doesn't exist in *all* versions of
  DWC3. It was introduced in version 2.50a so the branch I typed above needs
  one extra check, and since it's getting so large, it deserves be factored 
  out
  into its own function.
  
  static int dwc3_frame_length_adjustment(struct dwc3 *dwc, u32 fladj) {
  u32 reg;
  u32 dft;
  
  if (dwc-revision = DWC3_REVISION_250A)
  return 0;
  
  if (fladj == 0)
  return 0;
  
  reg = dwc3_readl(dwc-regs, DWC3_GFLADJ);
  dft = reg  0x3f; /* needs a mask macro */
  
  if (!dev_WARN_ONCE(dwc-dev, dft == fladj,
  requested value same as default, ignoring\n)) {
  reg = ~0x3f; /* needs a mask macro */
  reg |= DWC3_GFLADJ_30MHZ_SDBND_SEL |
  DWC3_GFLADJ_30MHZ(fladj_value);
  
  dwc3_writel(dwc-regs, DWC3_GFLADJ, reg);
  }
  }
  
  you really *MUST* check this sort of this out when writing patches. It's not
  only about *your* SoC. You gotta remember we have a ton of different
  users and those a prone to major grumpyness should a completely unrelated
  patch break their use case.
  
  You have access to the IP's documentation, and that contains the entire
  history of the IP itself, so it's easy to figure all of this out with a 
  simple search
  in the documentation.
  
  One extra detail is that you were very careless when writing to the GFLADJ
  register too. You simply wrote your 30MHz sideband value, potentially
  clearing other bits which shouldn't be touched. That alone can add
  regressions.
  
  When resending, make sure all 3 patches reach linux-usb. I still can't find
  patch 3/3.
 
 
 Will take care of above scenarios and resend patches cc'ing linux-usb
 in each of them.
 
 Regarding acceptance of the patch only when it's used in glue layer,
 there is no freescale's glue layer present for dwc3 as of now.

if there is no glue layer, how are you testing your patch ?

 Furthermore, there is not any platform specific code required in glue
 layer apart from the ones present in dwc3/core.c. 

sorry ? core.c is generic for all users, the glue layer should somewhat
hide platform details such as clocks and PM. It's surprising if you
don't need anything on that side.

-- 
balbi


signature.asc
Description: Digital signature


Re: [PATCH 3/3] ARM: errata 430973: move !ARCH_MULTIPLATFORM to Kconfig

2015-07-27 Thread Sebastian Reichel
Hi Ben,

On Mon, Jul 27, 2015 at 10:59:56AM +0100, Ben Dooks wrote:
  I think you missed the part adding the !ARCH_MULTIPLATFORM 
  dependency in Kconfig for ARM_ERRATA_430973. I only removed the 
  check in the sourcecode, since it is no longer required with the 
  dependency being in Kconfig.
  
  So I guess there are 3 options now:
  
  1. Add !ARCH_MULTIPLATFORM dependency to Kconfig, keep extra check 
  in the sourcecode 2. Add !ARCH_MULTIPLATFORM dependency to Kconfig,
  remove extra check in the sourcecode 3. Remove !ARCH_MULTIPLATFORM
  dependency alltogether
  
  I will send an appropriate patch, if you tell me your preferred 
  option.
 
 This isn't the only place ARM_ERRATA_430973 is used, [...]

The dependency on ARM_ERRATA_430973 has been removed from
arch/arm/mm/proc-v7-2level.S in 4.1 (commit id e748994), so
that it always flushes. The only additional places are in the
Nokia N900 boardcode and the N900 pdata-quirk, which are
removed in PATCH 1/3.

So actually it is the only place.

-- Sebastian


signature.asc
Description: Digital signature


Re: [PATCH v3 1/2] input: touchscreen: pixcir_i2c_ts: Add support for optional wakeup interrupt

2015-07-27 Thread Dmitry Torokhov
On Mon, Jul 27, 2015 at 04:49:22PM +0530, Vignesh R wrote:
 
 
 On 07/27/2015 04:19 PM, Roger Quadros wrote:
  Hi,
  
  On 23/07/15 17:54, Vignesh R wrote:
  On am437x-gp-evm, pixcir touchscreen can wake the system from low power
  state by generating wake-up interrupt via pinctrl and IO daisy chain.
  Add support for optional wakeup interrupt source by regsitering to
  automated wake IRQ framework introduced by commit 4990d4fe327b (PM /
  Wakeirq: Add automated device wake IRQ handling).
  This is similar in approach to commit 2a0b965cfb6e (serial: omap: Add
  support for optional wake-up)
 
  Signed-off-by: Vignesh R vigne...@ti.com
  ---
 
  v3:
   * handle error code returned by of_irq_get_byname()
 
  v2:
   * use of_irq_get_byname()
   * remove enable/disable_wake_irq()
 
   drivers/input/touchscreen/pixcir_i2c_ts.c | 22 ++
   include/linux/input/pixcir_ts.h   |  1 +
   2 files changed, 19 insertions(+), 4 deletions(-)
 
  diff --git a/drivers/input/touchscreen/pixcir_i2c_ts.c 
  b/drivers/input/touchscreen/pixcir_i2c_ts.c
  index 8f3e243a62bf..3a4ab358bf52 100644
  --- a/drivers/input/touchscreen/pixcir_i2c_ts.c
  +++ b/drivers/input/touchscreen/pixcir_i2c_ts.c
  @@ -29,6 +29,8 @@
   #include linux/of.h
   #include linux/of_gpio.h
   #include linux/of_device.h
  +#include linux/of_irq.h
  +#include linux/pm_wakeirq.h
   
   #define PIXCIR_MAX_SLOTS   5 /* Max fingers supported by driver */
   
  @@ -364,8 +366,6 @@ static int __maybe_unused pixcir_i2c_ts_suspend(struct 
  device *dev)
 goto unlock;
 }
 }
  -
  -  enable_irq_wake(client-irq);
 } else if (input-users) {
 ret = pixcir_stop(ts);
 }
  @@ -386,8 +386,6 @@ static int __maybe_unused pixcir_i2c_ts_resume(struct 
  device *dev)
 mutex_lock(input-mutex);
   
 if (device_may_wakeup(client-dev)) {
  -  disable_irq_wake(client-irq);
  -
 if (!input-users) {
 ret = pixcir_stop(ts);
 if (ret) {
  @@ -445,6 +443,13 @@ static struct pixcir_ts_platform_data 
  *pixcir_parse_dt(struct device *dev)
 dev_dbg(dev, %s: x %d, y %d, gpio %d\n, __func__,
 pdata-x_max + 1, pdata-y_max + 1, pdata-gpio_attb);
   
  +  pdata-wakeirq = of_irq_get_byname(dev-of_node, wakeup);
  +  if (pdata-wakeirq  0  pdata-wakeirq != -ENODATA 
  +  pdata-wakeirq != -EINVAL) {
  +  dev_err(dev, Failed to get wakeirq\n);
  +  return ERR_PTR(pdata-wakeirq);
  +  }
  +
 return pdata;
   }
   #else
  @@ -564,11 +569,20 @@ static int pixcir_i2c_ts_probe(struct i2c_client 
  *client,
 i2c_set_clientdata(client, tsdata);
 device_init_wakeup(client-dev, 1);
   
  +  /* Register wakeirq */
  +  error = (pdata-wakeirq  0) ?
  +  dev_pm_set_dedicated_wake_irq(dev, pdata-wakeirq) :
  +  dev_pm_set_wake_irq(dev, client-irq);
  
  Can 0 be a valid wakeirq or client-irq?
  If yes then this logic is broken.
  
 
 AFAIK, IRQ 0 is always assigned to system timer interrupt (cannot find
 reliable source to quote).
 
  I would set wakeirq to -EINVAL or something if it is not available
  during probe and check for that condition.
  
 
 Not sure, if I understand you correctly
 pdata-wakeirq will have -ENODATA or -EINVAL(as returned by
 of_irq_get_byname()), if wakeirq is not available. Do you want me to
 check for these two conditions specifically rather than
 (pdata-wakeirq  0) ?

0 is not really valid general IRQ number; I2C for example sets
client-irq to 0 when there is no IRQ.

BTW, what do you think about my patch pushing this into i2c core? Could
you try and see if it works for you?

Thanks.

-- 
Dmitry
--
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] ARM: kill off set_irq_flags usage

2015-07-27 Thread Rob Herring
set_irq_flags is ARM specific with custom flags which have genirq
equivalents. Convert drivers to use the genirq interfaces directly, so we
can kill off set_irq_flags. The translation of flags is as follows:

IRQF_VALID - !IRQ_NOREQUEST
IRQF_PROBE - !IRQ_NOPROBE
IRQF_NOAUTOEN - IRQ_NOAUTOEN

For IRQs managed by an irqdomain, the irqdomain core code handles clearing
and setting IRQ_NOREQUEST already, so there is no need to do this in
.map() functions and we can simply remove the set_irq_flags calls. Some
users also modify IRQ_NOPROBE and this has been maintained although it
is not clear that is really needed. There appears to be a great deal of
blind copy and paste of this code.

Signed-off-by: Rob Herring r...@kernel.org
Cc: Russell King li...@arm.linux.org.uk
Cc: Sekhar Nori nsek...@ti.com
Cc: Kevin Hilman khil...@deeprootsystems.com
Cc: Jason Cooper ja...@lakedaemon.net
Cc: Andrew Lunn and...@lunn.ch
Cc: Sebastian Hesselbarth sebastian.hesselba...@gmail.com
Cc: Gregory Clement gregory.clem...@free-electrons.com
Acked-by: Hans Ulli Kroll ulli.kr...@googlemail.com
Acked-by: Shawn Guo shawn...@kernel.org
Cc: Sascha Hauer ker...@pengutronix.de
Cc: Imre Kaloz ka...@openwrt.org
Acked-by: Krzysztof Halasa khal...@piap.pl
Cc: Greg Ungerer g...@uclinux.org
Cc: Roland Stigge sti...@antcom.de
Cc: Tony Lindgren t...@atomide.com
Cc: Daniel Mack dan...@zonque.org
Cc: Haojian Zhuang haojian.zhu...@gmail.com
Cc: Robert Jarzmik robert.jarz...@free.fr
Cc: Simtec Linux Team li...@simtec.co.uk
Cc: Kukjin Kim kg...@kernel.org
Cc: Krzysztof Kozlowski k.kozlow...@samsung.com
Acked-by: Wan ZongShun mcuos@gmail.com
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-omap@vger.kernel.org
Cc: linux-samsung-...@vger.kernel.org
Tested-by: Kevin Hilman khil...@linaro.org
---
Thomas asked that this be merged thru subsystem trees instead of arm-soc,
so please apply just this patch to your tree.

Rob

 arch/arm/common/it8152.c |  2 +-
 arch/arm/common/locomo.c |  2 +-
 arch/arm/common/sa.c |  4 ++--
 arch/arm/mach-davinci/cp_intc.c  |  2 +-
 arch/arm/mach-dove/irq.c |  2 +-
 arch/arm/mach-ebsa110/core.c |  2 +-
 arch/arm/mach-footbridge/common.c|  2 +-
 arch/arm/mach-footbridge/isa-irq.c   |  8 
 arch/arm/mach-gemini/gpio.c  |  2 +-
 arch/arm/mach-gemini/irq.c   |  2 +-
 arch/arm/mach-imx/3ds_debugboard.c   |  2 +-
 arch/arm/mach-imx/mach-mx31ads.c |  2 +-
 arch/arm/mach-iop13xx/irq.c  |  2 +-
 arch/arm/mach-iop32x/irq.c   |  2 +-
 arch/arm/mach-iop33x/irq.c   |  2 +-
 arch/arm/mach-ixp4xx/common.c|  2 +-
 arch/arm/mach-ks8695/irq.c   |  2 +-
 arch/arm/mach-lpc32xx/irq.c  |  2 +-
 arch/arm/mach-netx/generic.c |  2 +-
 arch/arm/mach-omap1/fpga.c   |  2 +-
 arch/arm/mach-omap1/irq.c|  2 +-
 arch/arm/mach-pxa/balloon3.c |  2 +-
 arch/arm/mach-pxa/irq.c  |  1 -
 arch/arm/mach-pxa/lpd270.c   |  2 +-
 arch/arm/mach-pxa/pcm990-baseboard.c |  2 +-
 arch/arm/mach-pxa/pxa3xx.c   |  2 +-
 arch/arm/mach-pxa/viper.c|  2 +-
 arch/arm/mach-pxa/zeus.c |  2 +-
 arch/arm/mach-rpc/ecard.c|  2 +-
 arch/arm/mach-rpc/irq.c  | 16 
 arch/arm/mach-s3c24xx/bast-irq.c |  2 +-
 arch/arm/mach-s3c64xx/common.c   |  2 +-
 arch/arm/mach-sa1100/neponset.c  |  4 ++--
 arch/arm/mach-w90x900/irq.c  |  2 +-
 drivers/irqchip/irq-sa11x0.c |  1 -
 35 files changed, 45 insertions(+), 47 deletions(-)

diff --git a/arch/arm/common/it8152.c b/arch/arm/common/it8152.c
index 5114b68..96dabcb 100644
--- a/arch/arm/common/it8152.c
+++ b/arch/arm/common/it8152.c
@@ -91,7 +91,7 @@ void it8152_init_irq(void)
for (irq = IT8152_IRQ(0); irq = IT8152_LAST_IRQ; irq++) {
irq_set_chip_and_handler(irq, it8152_irq_chip,
 handle_level_irq);
-   set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
+   irq_clear_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE);
}
 }

diff --git a/arch/arm/common/locomo.c b/arch/arm/common/locomo.c
index b55c362..339fc41 100644
--- a/arch/arm/common/locomo.c
+++ b/arch/arm/common/locomo.c
@@ -205,7 +205,7 @@ static void locomo_setup_irq(struct locomo *lchip)
for ( ; irq = lchip-irq_base + 3; irq++) {
irq_set_chip_and_handler(irq, locomo_chip, handle_level_irq);
irq_set_chip_data(irq, lchip);
-   set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
+   irq_clear_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE);
}
 }

diff --git a/arch/arm/common/sa.c b/arch/arm/common/sa.c
index 93ee70d..680374d 100644
--- a/arch/arm/common/sa.c
+++ b/arch/arm/common/sa.c
@@ -486,7 +486,7 @@ static int sa_setup_irq(struct sa *sachip, unsigned 
irq_base)
irq_set_chip_and_handler(irq, sa_low_chip,
  

[PATCH v3] PCI: kill off set_irq_flags usage

2015-07-27 Thread Rob Herring
set_irq_flags is ARM specific with custom flags which have genirq
equivalents. Convert drivers to use the genirq interfaces directly, so we
can kill off set_irq_flags. The translation of flags is as follows:

IRQF_VALID - !IRQ_NOREQUEST
IRQF_PROBE - !IRQ_NOPROBE
IRQF_NOAUTOEN - IRQ_NOAUTOEN

For IRQs managed by an irqdomain, the irqdomain core code handles clearing
and setting IRQ_NOREQUEST already, so there is no need to do this in
.map() functions and we can simply remove the set_irq_flags calls. Some
users also modify IRQ_NOPROBE and this has been maintained although it
is not clear that is really needed. There appears to be a great deal of
blind copy and paste of this code.

Signed-off-by: Rob Herring r...@kernel.org
Cc: Kishon Vijay Abraham I kis...@ti.com
Acked-by: Bjorn Helgaas bhelg...@google.com
Cc: Murali Karicheri m-kariche...@ti.com
Cc: Thierry Reding thierry.red...@gmail.com
Cc: Stephen Warren swar...@wwwdotorg.org
Cc: Alexandre Courbot gnu...@gmail.com
Cc: Jingoo Han jingooh...@gmail.com
Cc: Pratyush Anand pratyush.an...@gmail.com
Cc: Simon Horman ho...@verge.net.au
Cc: Michal Simek michal.si...@xilinx.com
Cc: Sören Brinkmann soren.brinkm...@xilinx.com
Cc: linux-omap@vger.kernel.org
Cc: linux-...@vger.kernel.org
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-te...@vger.kernel.org
Cc: linux...@vger.kernel.org
---
Thomas asked that this be merged thru subsystem trees instead of arm-soc,
so please apply this to your tree.

Rob

 drivers/pci/host/pci-dra7xx.c  | 1 -
 drivers/pci/host/pci-keystone-dw.c | 2 --
 drivers/pci/host/pci-tegra.c   | 1 -
 drivers/pci/host/pci-xgene-msi.c   | 1 -
 drivers/pci/host/pcie-designware.c | 1 -
 drivers/pci/host/pcie-rcar.c   | 1 -
 drivers/pci/host/pcie-xilinx.c | 2 --
 7 files changed, 9 deletions(-)

diff --git a/drivers/pci/host/pci-dra7xx.c b/drivers/pci/host/pci-dra7xx.c
index 80db09e..1a0d124 100644
--- a/drivers/pci/host/pci-dra7xx.c
+++ b/drivers/pci/host/pci-dra7xx.c
@@ -155,7 +155,6 @@ static int dra7xx_pcie_intx_map(struct irq_domain *domain, 
unsigned int irq,
 {
irq_set_chip_and_handler(irq, dummy_irq_chip, handle_simple_irq);
irq_set_chip_data(irq, domain-host_data);
-   set_irq_flags(irq, IRQF_VALID);

return 0;
 }
diff --git a/drivers/pci/host/pci-keystone-dw.c 
b/drivers/pci/host/pci-keystone-dw.c
index f34892e..f1d0749 100644
--- a/drivers/pci/host/pci-keystone-dw.c
+++ b/drivers/pci/host/pci-keystone-dw.c
@@ -196,7 +196,6 @@ static int ks_dw_pcie_msi_map(struct irq_domain *domain, 
unsigned int irq,
irq_set_chip_and_handler(irq, ks_dw_pcie_msi_irq_chip,
 handle_level_irq);
irq_set_chip_data(irq, domain-host_data);
-   set_irq_flags(irq, IRQF_VALID);

return 0;
 }
@@ -277,7 +276,6 @@ static int ks_dw_pcie_init_legacy_irq_map(struct irq_domain 
*d,
irq_set_chip_and_handler(irq, ks_dw_pcie_legacy_irq_chip,
 handle_level_irq);
irq_set_chip_data(irq, d-host_data);
-   set_irq_flags(irq, IRQF_VALID);

return 0;
 }
diff --git a/drivers/pci/host/pci-tegra.c b/drivers/pci/host/pci-tegra.c
index 10c0571..81df0c1 100644
--- a/drivers/pci/host/pci-tegra.c
+++ b/drivers/pci/host/pci-tegra.c
@@ -1248,7 +1248,6 @@ static int tegra_msi_map(struct irq_domain *domain, 
unsigned int irq,
 {
irq_set_chip_and_handler(irq, tegra_msi_irq_chip, handle_simple_irq);
irq_set_chip_data(irq, domain-host_data);
-   set_irq_flags(irq, IRQF_VALID);

tegra_cpuidle_pcie_irqs_in_use();

diff --git a/drivers/pci/host/pci-xgene-msi.c b/drivers/pci/host/pci-xgene-msi.c
index 2d31d4d..8e559d1 100644
--- a/drivers/pci/host/pci-xgene-msi.c
+++ b/drivers/pci/host/pci-xgene-msi.c
@@ -223,7 +223,6 @@ static int xgene_irq_domain_alloc(struct irq_domain 
*domain, unsigned int virq,
irq_domain_set_info(domain, virq, msi_irq,
xgene_msi_bottom_irq_chip, domain-host_data,
handle_simple_irq, NULL, NULL);
-   set_irq_flags(virq, IRQF_VALID);

return 0;
 }
diff --git a/drivers/pci/host/pcie-designware.c 
b/drivers/pci/host/pcie-designware.c
index 69486be..5c6b562 100644
--- a/drivers/pci/host/pcie-designware.c
+++ b/drivers/pci/host/pcie-designware.c
@@ -350,7 +350,6 @@ static int dw_pcie_msi_map(struct irq_domain *domain, 
unsigned int irq,
 {
irq_set_chip_and_handler(irq, dw_msi_irq_chip, handle_simple_irq);
irq_set_chip_data(irq, domain-host_data);
-   set_irq_flags(irq, IRQF_VALID);

return 0;
 }
diff --git a/drivers/pci/host/pcie-rcar.c b/drivers/pci/host/pcie-rcar.c
index c086210..7678fe0 100644
--- a/drivers/pci/host/pcie-rcar.c
+++ b/drivers/pci/host/pcie-rcar.c
@@ -664,7 +664,6 @@ static int rcar_msi_map(struct irq_domain *domain, unsigned 
int irq,
 {
irq_set_chip_and_handler(irq, rcar_msi_irq_chip, handle_simple_irq);
irq_set_chip_data(irq, domain-host_data);
-   

[PATCH v3] mfd: kill off set_irq_flags usage

2015-07-27 Thread Rob Herring
set_irq_flags is ARM specific with custom flags which have genirq
equivalents. Convert drivers to use the genirq interfaces directly, so we
can kill off set_irq_flags. The translation of flags is as follows:

IRQF_VALID - !IRQ_NOREQUEST
IRQF_PROBE - !IRQ_NOPROBE
IRQF_NOAUTOEN - IRQ_NOAUTOEN

For IRQs managed by an irqdomain, the irqdomain core code handles clearing
and setting IRQ_NOREQUEST already, so there is no need to do this in
.map() functions and we can simply remove the set_irq_flags calls. Some
users also modify IRQ_NOPROBE and this has been maintained although it
is not clear that is really needed. There appears to be a great deal of
blind copy and paste of this code.

Signed-off-by: Rob Herring r...@kernel.org
Cc: Samuel Ortiz sa...@linux.intel.com
Acked-by: Lee Jones lee.jo...@linaro.org
Acked-by: Linus Walleij linus.wall...@linaro.org
Cc: Milo Kim milo@ti.com
Cc: Kumar Gala ga...@codeaurora.org
Cc: Andy Gross agr...@codeaurora.org
Cc: David Brown dav...@codeaurora.org
Cc: Tony Lindgren t...@atomide.com
Cc: linux-arm-ker...@lists.infradead.org
Cc: patc...@opensource.wolfsonmicro.com
Cc: linux-arm-...@vger.kernel.org
Cc: linux-...@vger.kernel.org
Cc: linux-omap@vger.kernel.org
---
Thomas asked that this be merged thru subsystem trees instead of arm-soc,
so please apply this to your tree.

Rob

 drivers/mfd/88pm860x-core.c |  4 
 drivers/mfd/ab8500-core.c   |  4 
 drivers/mfd/arizona-irq.c   |  7 ---
 drivers/mfd/asic3.c |  4 ++--
 drivers/mfd/db8500-prcmu.c  |  1 -
 drivers/mfd/ezx-pcap.c  |  6 +-
 drivers/mfd/htc-egpio.c |  4 ++--
 drivers/mfd/htc-i2cpld.c|  6 +-
 drivers/mfd/lp8788-irq.c|  5 -
 drivers/mfd/max8925-core.c  |  5 +
 drivers/mfd/max8997-irq.c   |  5 +
 drivers/mfd/max8998-irq.c   |  5 +
 drivers/mfd/mt6397-core.c   |  4 
 drivers/mfd/pm8921-core.c   |  5 +
 drivers/mfd/rc5t583-irq.c   |  4 +---
 drivers/mfd/stmpe.c |  7 ---
 drivers/mfd/t7l66xb.c   |  6 --
 drivers/mfd/tc3589x.c   |  7 ---
 drivers/mfd/tc6393xb.c  |  4 ++--
 drivers/mfd/tps6586x.c  |  7 ---
 drivers/mfd/tps65912-irq.c  |  8 +---
 drivers/mfd/twl4030-irq.c   | 11 +--
 drivers/mfd/twl6030-irq.c   | 13 -
 drivers/mfd/ucb1x00-core.c  |  2 +-
 drivers/mfd/wm831x-irq.c|  7 ---
 drivers/mfd/wm8350-irq.c|  8 +---
 drivers/mfd/wm8994-irq.c|  7 ---
 27 files changed, 17 insertions(+), 139 deletions(-)

diff --git a/drivers/mfd/88pm860x-core.c b/drivers/mfd/88pm860x-core.c
index e03b7f4..bc0f3c0 100644
--- a/drivers/mfd/88pm860x-core.c
+++ b/drivers/mfd/88pm860x-core.c
@@ -558,11 +558,7 @@ static int pm860x_irq_domain_map(struct irq_domain *d, 
unsigned int virq,
irq_set_chip_data(virq, d-host_data);
irq_set_chip_and_handler(virq, pm860x_irq_chip, handle_edge_irq);
irq_set_nested_thread(virq, 1);
-#ifdef CONFIG_ARM
-   set_irq_flags(virq, IRQF_VALID);
-#else
irq_set_noprobe(virq);
-#endif
return 0;
 }

diff --git a/drivers/mfd/ab8500-core.c b/drivers/mfd/ab8500-core.c
index 000da72..fefbe4c 100644
--- a/drivers/mfd/ab8500-core.c
+++ b/drivers/mfd/ab8500-core.c
@@ -565,11 +565,7 @@ static int ab8500_irq_map(struct irq_domain *d, unsigned 
int virq,
irq_set_chip_and_handler(virq, ab8500_irq_chip,
handle_simple_irq);
irq_set_nested_thread(virq, 1);
-#ifdef CONFIG_ARM
-   set_irq_flags(virq, IRQF_VALID);
-#else
irq_set_noprobe(virq);
-#endif

return 0;
 }
diff --git a/drivers/mfd/arizona-irq.c b/drivers/mfd/arizona-irq.c
index 2b9965d5..7d66aec 100644
--- a/drivers/mfd/arizona-irq.c
+++ b/drivers/mfd/arizona-irq.c
@@ -174,14 +174,7 @@ static int arizona_irq_map(struct irq_domain *h, unsigned 
int virq,
irq_set_chip_data(virq, data);
irq_set_chip_and_handler(virq, arizona_irq_chip, handle_simple_irq);
irq_set_nested_thread(virq, 1);
-
-   /* ARM needs us to explicitly flag the IRQ as valid
-* and will set them noprobe when we do so. */
-#ifdef CONFIG_ARM
-   set_irq_flags(virq, IRQF_VALID);
-#else
irq_set_noprobe(virq);
-#endif

return 0;
 }
diff --git a/drivers/mfd/asic3.c b/drivers/mfd/asic3.c
index 120df5c..4b54128 100644
--- a/drivers/mfd/asic3.c
+++ b/drivers/mfd/asic3.c
@@ -411,7 +411,7 @@ static int __init asic3_irq_probe(struct platform_device 
*pdev)

irq_set_chip_data(irq, asic);
irq_set_handler(irq, handle_level_irq);
-   set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
+   irq_clear_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE);
}

asic3_write_register(asic, ASIC3_OFFSET(INTR, INT_MASK),
@@ -431,7 +431,7 @@ static void asic3_irq_remove(struct platform_device *pdev)
irq_base = asic-irq_base;

for (irq = irq_base; irq  irq_base + ASIC3_NR_IRQS; irq++) {
-   set_irq_flags(irq, 0);
+   

[PATCH v3] memory: kill off set_irq_flags usage

2015-07-27 Thread Rob Herring
set_irq_flags is ARM specific with custom flags which have genirq
equivalents. Convert drivers to use the genirq interfaces directly, so we
can kill off set_irq_flags. The translation of flags is as follows:

IRQF_VALID - !IRQ_NOREQUEST
IRQF_PROBE - !IRQ_NOPROBE
IRQF_NOAUTOEN - IRQ_NOAUTOEN

For IRQs managed by an irqdomain, the irqdomain core code handles clearing
and setting IRQ_NOREQUEST already, so there is no need to do this in
.map() functions and we can simply remove the set_irq_flags calls. Some
users also modify IRQ_NOPROBE and this has been maintained although it
is not clear that is really needed. There appears to be a great deal of
blind copy and paste of this code.

Signed-off-by: Rob Herring r...@kernel.org
Acked-by: Roger Quadros rog...@ti.com
Cc: Tony Lindgren t...@atomide.com
Cc: linux-omap@vger.kernel.org
---
Thomas asked that this be merged thru subsystem trees instead of arm-soc,
so please apply this to your tree.

Rob

 drivers/memory/omap-gpmc.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/memory/omap-gpmc.c b/drivers/memory/omap-gpmc.c
index 3a27a84..9722099 100644
--- a/drivers/memory/omap-gpmc.c
+++ b/drivers/memory/omap-gpmc.c
@@ -1176,8 +1176,8 @@ static int gpmc_setup_irq(void)
gpmc_client_irq[i].irq = gpmc_irq_start + i;
irq_set_chip_and_handler(gpmc_client_irq[i].irq,
gpmc_irq_chip, handle_simple_irq);
-   set_irq_flags(gpmc_client_irq[i].irq,
-   IRQF_VALID | IRQF_NOAUTOEN);
+   irq_modify_status(gpmc_client_irq[i].irq, IRQ_NOREQUEST,
+ IRQ_NOAUTOEN);
}

/* Disable interrupts */
@@ -1200,7 +1200,6 @@ static int gpmc_free_irq(void)
for (i = 0; i  GPMC_NR_IRQ; i++) {
irq_set_handler(gpmc_client_irq[i].irq, NULL);
irq_set_chip(gpmc_client_irq[i].irq, no_irq_chip);
-   irq_modify_status(gpmc_client_irq[i].irq, 0, 0);
}

irq_free_descs(gpmc_irq_start, GPMC_NR_IRQ);
--
2.1.0

--
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 4/4] ARM: omap2: restore OMAP4 barrier behaviour

2015-07-27 Thread Dan Murphy
Russell

On 07/15/2015 12:47 PM, Russell King wrote:
 Restore the OMAP4 barrier behaviour using the new implementation which
 allows multiplatform systems to hook into the mb() and wmb() ARM
 implementations to perform any necessary additional barrier maintanence.

 Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk
 ---
  arch/arm/mach-omap2/Kconfig | 28 +++--
  arch/arm/mach-omap2/common.h| 12 +++-
  arch/arm/mach-omap2/include/mach/barriers.h | 33 ---
  arch/arm/mach-omap2/omap-secure.h   |  7 ---
  arch/arm/mach-omap2/omap4-common.c  | 90 
 +++--
  arch/arm/mach-omap2/sleep44xx.S | 10 +---
  6 files changed, 90 insertions(+), 90 deletions(-)
  delete mode 100644 arch/arm/mach-omap2/include/mach/barriers.h

 diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
 index 2128441430ad..8427997e09c4 100644
 --- a/arch/arm/mach-omap2/Kconfig
 +++ b/arch/arm/mach-omap2/Kconfig
 @@ -29,6 +29,7 @@ config ARCH_OMAP4
   select HAVE_ARM_SCU if SMP
   select HAVE_ARM_TWD if SMP
   select OMAP_INTERCONNECT
 + select OMAP_INTERCONNECT_BARRIER
   select PL310_ERRATA_588369 if CACHE_L2X0
   select PL310_ERRATA_727915 if CACHE_L2X0
   select PM_OPP if PM
 @@ -46,6 +47,7 @@ config SOC_OMAP5
   select HAVE_ARM_TWD if SMP
   select HAVE_ARM_ARCH_TIMER
   select ARM_ERRATA_798181 if SMP
 + select OMAP_INTERCONNECT_BARRIER
  
  config SOC_AM33XX
   bool TI AM33XX
 @@ -70,6 +72,7 @@ config SOC_DRA7XX
   select HAVE_ARM_ARCH_TIMER
   select IRQ_CROSSBAR
   select ARM_ERRATA_798181 if SMP
 + select OMAP_INTERCONNECT_BARRIER
  
  config ARCH_OMAP2PLUS
   bool
 @@ -91,6 +94,10 @@ config ARCH_OMAP2PLUS
   help
 Systems based on OMAP2, OMAP3, OMAP4 or OMAP5
  
 +config OMAP_INTERCONNECT_BARRIER
 + bool
 + select ARM_HEAVY_MB
 + 
  
  if ARCH_OMAP2PLUS
  
 @@ -240,27 +247,6 @@ config OMAP3_SDRC_AC_TIMING
 wish to say no.  Selecting yes without understanding what is
 going on could result in system crashes;
  
 -config OMAP4_ERRATA_I688
 - bool OMAP4 errata: Async Bridge Corruption
 - depends on (ARCH_OMAP4 || SOC_OMAP5)  !ARCH_MULTIPLATFORM
 - select ARCH_HAS_BARRIERS
 - help
 -   If a data is stalled inside asynchronous bridge because of back
 -   pressure, it may be accepted multiple times, creating pointer
 -   misalignment that will corrupt next transfers on that data path
 -   until next reset of the system (No recovery procedure once the
 -   issue is hit, the path remains consistently broken). Async bridge
 -   can be found on path between MPU to EMIF and MPU to L3 interconnect.
 -   This situation can happen only when the idle is initiated by a
 -   Master Request Disconnection (which is trigged by software when
 -   executing WFI on CPU).
 -   The work-around for this errata needs all the initiators connected
 -   through async bridge must ensure that data path is properly drained
 -   before issuing WFI. This condition will be met if one Strongly ordered
 -   access is performed to the target right before executing the WFI.
 -   In MPU case, L3 T2ASYNC FIFO and DDR T2ASYNC FIFO needs to be drained.
 -   IO barrier ensure that there is no synchronisation loss on initiators
 -   operating on both interconnect port simultaneously.
  endmenu
  
  endif
 diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h
 index 46e24581d624..82f88b4ec15f 100644
 --- a/arch/arm/mach-omap2/common.h
 +++ b/arch/arm/mach-omap2/common.h
 @@ -189,6 +189,15 @@ static inline void omap44xx_restart(enum reboot_mode 
 mode, const char *cmd)
  }
  #endif
  
 +#ifdef CONFIG_OMAP_INTERCONNECT_BARRIER
 +void omap_barrier_reserve_memblock(void);
 +void omap_barriers_init(void);
 +#else
 +static inline void omap_barrier_reserve_memblock(void)
 +{
 +}
 +#endif
 +
  /* This gets called from mach-omap2/io.c, do not call this */
  void __init omap2_set_globals_tap(u32 class, void __iomem *tap);
  
 @@ -200,9 +209,6 @@ void __init omap4_map_io(void);
  void __init omap5_map_io(void);
  void __init ti81xx_map_io(void);
  
 -/* omap_barriers_init() is OMAP4 only */
 -void omap_barriers_init(void);
 -
  /**
   * omap_test_timeout - busy-loop, testing a condition
   * @cond: condition to test until it evaluates to true
 diff --git a/arch/arm/mach-omap2/include/mach/barriers.h 
 b/arch/arm/mach-omap2/include/mach/barriers.h
 deleted file mode 100644
 index 1c582a8592b9..
 --- a/arch/arm/mach-omap2/include/mach/barriers.h
 +++ /dev/null
 @@ -1,33 +0,0 @@
 -/*
 - * OMAP memory barrier header.
 - *
 - * Copyright (C) 2011 Texas Instruments, Inc.
 - *  Santosh Shilimkar santosh.shilim...@ti.com
 - *  Richard Woodruff r-woodru...@ti.com
 - *
 - * This program is free software; you can redistribute it and/or modify
 - * it under the terms of 

Re: [PATCH v3] mfd: kill off set_irq_flags usage

2015-07-27 Thread Lee Jones
On Mon, 27 Jul 2015, Rob Herring wrote:

 set_irq_flags is ARM specific with custom flags which have genirq
 equivalents. Convert drivers to use the genirq interfaces directly, so we
 can kill off set_irq_flags. The translation of flags is as follows:
 
 IRQF_VALID - !IRQ_NOREQUEST
 IRQF_PROBE - !IRQ_NOPROBE
 IRQF_NOAUTOEN - IRQ_NOAUTOEN
 
 For IRQs managed by an irqdomain, the irqdomain core code handles clearing
 and setting IRQ_NOREQUEST already, so there is no need to do this in
 .map() functions and we can simply remove the set_irq_flags calls. Some
 users also modify IRQ_NOPROBE and this has been maintained although it
 is not clear that is really needed. There appears to be a great deal of
 blind copy and paste of this code.
 
 Signed-off-by: Rob Herring r...@kernel.org
 Cc: Samuel Ortiz sa...@linux.intel.com
 Acked-by: Lee Jones lee.jo...@linaro.org
 Acked-by: Linus Walleij linus.wall...@linaro.org
 Cc: Milo Kim milo@ti.com
 Cc: Kumar Gala ga...@codeaurora.org
 Cc: Andy Gross agr...@codeaurora.org
 Cc: David Brown dav...@codeaurora.org
 Cc: Tony Lindgren t...@atomide.com
 Cc: linux-arm-ker...@lists.infradead.org
 Cc: patc...@opensource.wolfsonmicro.com
 Cc: linux-arm-...@vger.kernel.org
 Cc: linux-...@vger.kernel.org
 Cc: linux-omap@vger.kernel.org
 ---
 Thomas asked that this be merged thru subsystem trees instead of arm-soc,
 so please apply this to your tree.
 
 Rob
 
  drivers/mfd/88pm860x-core.c |  4 
  drivers/mfd/ab8500-core.c   |  4 
  drivers/mfd/arizona-irq.c   |  7 ---
  drivers/mfd/asic3.c |  4 ++--
  drivers/mfd/db8500-prcmu.c  |  1 -
  drivers/mfd/ezx-pcap.c  |  6 +-
  drivers/mfd/htc-egpio.c |  4 ++--
  drivers/mfd/htc-i2cpld.c|  6 +-
  drivers/mfd/lp8788-irq.c|  5 -
  drivers/mfd/max8925-core.c  |  5 +
  drivers/mfd/max8997-irq.c   |  5 +
  drivers/mfd/max8998-irq.c   |  5 +
  drivers/mfd/mt6397-core.c   |  4 
  drivers/mfd/pm8921-core.c   |  5 +
  drivers/mfd/rc5t583-irq.c   |  4 +---
  drivers/mfd/stmpe.c |  7 ---
  drivers/mfd/t7l66xb.c   |  6 --
  drivers/mfd/tc3589x.c   |  7 ---
  drivers/mfd/tc6393xb.c  |  4 ++--
  drivers/mfd/tps6586x.c  |  7 ---
  drivers/mfd/tps65912-irq.c  |  8 +---
  drivers/mfd/twl4030-irq.c   | 11 +--
  drivers/mfd/twl6030-irq.c   | 13 -
  drivers/mfd/ucb1x00-core.c  |  2 +-
  drivers/mfd/wm831x-irq.c|  7 ---
  drivers/mfd/wm8350-irq.c|  8 +---
  drivers/mfd/wm8994-irq.c|  7 ---
  27 files changed, 17 insertions(+), 139 deletions(-)

Applied, thanks.

 diff --git a/drivers/mfd/88pm860x-core.c b/drivers/mfd/88pm860x-core.c
 index e03b7f4..bc0f3c0 100644
 --- a/drivers/mfd/88pm860x-core.c
 +++ b/drivers/mfd/88pm860x-core.c
 @@ -558,11 +558,7 @@ static int pm860x_irq_domain_map(struct irq_domain *d, 
 unsigned int virq,
   irq_set_chip_data(virq, d-host_data);
   irq_set_chip_and_handler(virq, pm860x_irq_chip, handle_edge_irq);
   irq_set_nested_thread(virq, 1);
 -#ifdef CONFIG_ARM
 - set_irq_flags(virq, IRQF_VALID);
 -#else
   irq_set_noprobe(virq);
 -#endif
   return 0;
  }
 
 diff --git a/drivers/mfd/ab8500-core.c b/drivers/mfd/ab8500-core.c
 index 000da72..fefbe4c 100644
 --- a/drivers/mfd/ab8500-core.c
 +++ b/drivers/mfd/ab8500-core.c
 @@ -565,11 +565,7 @@ static int ab8500_irq_map(struct irq_domain *d, unsigned 
 int virq,
   irq_set_chip_and_handler(virq, ab8500_irq_chip,
   handle_simple_irq);
   irq_set_nested_thread(virq, 1);
 -#ifdef CONFIG_ARM
 - set_irq_flags(virq, IRQF_VALID);
 -#else
   irq_set_noprobe(virq);
 -#endif
 
   return 0;
  }
 diff --git a/drivers/mfd/arizona-irq.c b/drivers/mfd/arizona-irq.c
 index 2b9965d5..7d66aec 100644
 --- a/drivers/mfd/arizona-irq.c
 +++ b/drivers/mfd/arizona-irq.c
 @@ -174,14 +174,7 @@ static int arizona_irq_map(struct irq_domain *h, 
 unsigned int virq,
   irq_set_chip_data(virq, data);
   irq_set_chip_and_handler(virq, arizona_irq_chip, handle_simple_irq);
   irq_set_nested_thread(virq, 1);
 -
 - /* ARM needs us to explicitly flag the IRQ as valid
 -  * and will set them noprobe when we do so. */
 -#ifdef CONFIG_ARM
 - set_irq_flags(virq, IRQF_VALID);
 -#else
   irq_set_noprobe(virq);
 -#endif
 
   return 0;
  }
 diff --git a/drivers/mfd/asic3.c b/drivers/mfd/asic3.c
 index 120df5c..4b54128 100644
 --- a/drivers/mfd/asic3.c
 +++ b/drivers/mfd/asic3.c
 @@ -411,7 +411,7 @@ static int __init asic3_irq_probe(struct platform_device 
 *pdev)
 
   irq_set_chip_data(irq, asic);
   irq_set_handler(irq, handle_level_irq);
 - set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
 + irq_clear_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE);
   }
 
   asic3_write_register(asic, ASIC3_OFFSET(INTR, INT_MASK),
 @@ -431,7 +431,7 @@ static void asic3_irq_remove(struct platform_device *pdev)
   irq_base = 

Re: [PATCH v2 1/2] extcon: fix hang and extcon_get/set_cable_state().

2015-07-27 Thread Chanwoo Choi
Hi Roger,

On 07/27/2015 07:39 PM, Roger Quadros wrote:
 Chanwoo,
 
 On 10/07/15 18:54, Chanwoo Choi wrote:
 Hi Roger,

 Thanks for your working.

 I'll review, test and apply it on next week because I'm on vacation now.
 
 Can you please take this for -rc cycle? Thanks.

I'm sorry for delay review. I'll do it within this week.

Thanks,
Chanwoo Choi

 
 cheers,
 -roger
 

 Thanks,
 Chanwoo Choi

 On Tue, Jul 7, 2015 at 3:06 PM, Roger Quadros rog...@ti.com wrote:
 Users of find_cable_index_by_name() will cause a kernel hang
 as the while loop counter is never incremented and end condition
 is never reached.

 extcon_get_cable_state() and extcon_set_cable_state() are broken
 because they use cable index instead of cable id. This causes
 the first cable state (cable.0) to be always invalid in sysfs
 or extcon_get_cable_state() users.

 Introduce a new function find_cable_id_by_name() that fixes
 both of the above issues.

 Fixes: commit 73b6ecdb93e8 (extcon: Redefine the unique id of supported 
 external connectors without 'enum extcon' type)
 Cc: Greg Kroah-Hartman gre...@linuxfoundation.org
 Signed-off-by: Roger Quadros rog...@ti.com
 ---
  drivers/extcon/extcon.c | 38 +-
  1 file changed, 29 insertions(+), 9 deletions(-)

 diff --git a/drivers/extcon/extcon.c b/drivers/extcon/extcon.c
 index 76157ab..987dd3c 100644
 --- a/drivers/extcon/extcon.c
 +++ b/drivers/extcon/extcon.c
 @@ -124,22 +124,34 @@ static int find_cable_index_by_id(struct extcon_dev 
 *edev, const unsigned int id
 return -EINVAL;
  }

 -static int find_cable_index_by_name(struct extcon_dev *edev, const char 
 *name)
 +static int find_cable_id_by_name(struct extcon_dev *edev, const char *name)
  {
 -   unsigned int id = EXTCON_NONE;
 +   unsigned int id = -EINVAL;
 int i = 0;

 -   if (edev-max_supported == 0)
 -   return -EINVAL;
 -
 -   /* Find the the number of extcon cable */
 +   /* Find the id of extcon cable */
 while (extcon_name[i]) {
 if (!strncmp(extcon_name[i], name, CABLE_NAME_MAX)) {
 id = i;
 break;
 }
 +
 +   i++;
 }

 +   return id;
 +};
 +
 +static int find_cable_index_by_name(struct extcon_dev *edev, const char 
 *name)
 +{
 +   unsigned int id = EXTCON_NONE;
 +
 +   if (edev-max_supported == 0)
 +   return -EINVAL;
 +
 +   /* Find the the number of extcon cable */
 +   id = find_cable_id_by_name(edev, name);
 +
 if (id == EXTCON_NONE)
 return -EINVAL;

 @@ -228,9 +240,11 @@ static ssize_t cable_state_show(struct device *dev,
 struct extcon_cable *cable = container_of(attr, struct extcon_cable,
   attr_state);

 +   int i = cable-cable_index;
 +
 return sprintf(buf, %d\n,
extcon_get_cable_state_(cable-edev,
 -  cable-cable_index));
 +  
 cable-edev-supported_cable[i]));
  }

  /**
 @@ -341,6 +355,9 @@ int extcon_get_cable_state_(struct extcon_dev *edev, 
 const unsigned int id)
  {
 int index;

 +   if (id == EXTCON_NONE)
 +   return -EINVAL;
 +
 index = find_cable_index_by_id(edev, id);
 if (index  0)
 return index;
 @@ -361,7 +378,7 @@ EXPORT_SYMBOL_GPL(extcon_get_cable_state_);
   */
  int extcon_get_cable_state(struct extcon_dev *edev, const char *cable_name)
  {
 -   return extcon_get_cable_state_(edev, find_cable_index_by_name
 +   return extcon_get_cable_state_(edev, find_cable_id_by_name
 (edev, cable_name));
  }
  EXPORT_SYMBOL_GPL(extcon_get_cable_state);
 @@ -380,6 +397,9 @@ int extcon_set_cable_state_(struct extcon_dev *edev, 
 unsigned int id,
 u32 state;
 int index;

 +   if (id == EXTCON_NONE)
 +   return -EINVAL;
 +
 index = find_cable_index_by_id(edev, id);
 if (index  0)
 return index;
 @@ -404,7 +424,7 @@ EXPORT_SYMBOL_GPL(extcon_set_cable_state_);
  int extcon_set_cable_state(struct extcon_dev *edev,
 const char *cable_name, bool cable_state)
  {
 -   return extcon_set_cable_state_(edev, find_cable_index_by_name
 +   return extcon_set_cable_state_(edev, find_cable_id_by_name
 (edev, cable_name), cable_state);
  }
  EXPORT_SYMBOL_GPL(extcon_set_cable_state);
 --
 2.1.4

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

Re: [PATCH v3] PCI: kill off set_irq_flags usage

2015-07-27 Thread Jingoo Han

On 2015. 7. 28., at AM 5:55, Rob Herring r...@kernel.org wrote:
 
 set_irq_flags is ARM specific with custom flags which have genirq
 equivalents. Convert drivers to use the genirq interfaces directly, so we
 can kill off set_irq_flags. The translation of flags is as follows:
 
 IRQF_VALID - !IRQ_NOREQUEST
 IRQF_PROBE - !IRQ_NOPROBE
 IRQF_NOAUTOEN - IRQ_NOAUTOEN
 
 For IRQs managed by an irqdomain, the irqdomain core code handles clearing
 and setting IRQ_NOREQUEST already, so there is no need to do this in
 .map() functions and we can simply remove the set_irq_flags calls. Some
 users also modify IRQ_NOPROBE and this has been maintained although it
 is not clear that is really needed. There appears to be a great deal of
 blind copy and paste of this code.
 
 Signed-off-by: Rob Herring r...@kernel.org
 Cc: Kishon Vijay Abraham I kis...@ti.com
 Acked-by: Bjorn Helgaas bhelg...@google.com
 Cc: Murali Karicheri m-kariche...@ti.com
 Cc: Thierry Reding thierry.red...@gmail.com
 Cc: Stephen Warren swar...@wwwdotorg.org
 Cc: Alexandre Courbot gnu...@gmail.com
 Cc: Jingoo Han jingooh...@gmail.com

Acked-by: Jingoo Han jingooh...@gmail.com

Best regards,
Jingoo Han

 Cc: Pratyush Anand pratyush.an...@gmail.com
 Cc: Simon Horman ho...@verge.net.au
 Cc: Michal Simek michal.si...@xilinx.com
 Cc: Sören Brinkmann soren.brinkm...@xilinx.com
 Cc: linux-omap@vger.kernel.org
 Cc: linux-...@vger.kernel.org
 Cc: linux-arm-ker...@lists.infradead.org
 Cc: linux-te...@vger.kernel.org
 Cc: linux...@vger.kernel.org
 ---
 Thomas asked that this be merged thru subsystem trees instead of arm-soc,
 so please apply this to your tree.
 
 Rob
 
 drivers/pci/host/pci-dra7xx.c  | 1 -
 drivers/pci/host/pci-keystone-dw.c | 2 --
 drivers/pci/host/pci-tegra.c   | 1 -
 drivers/pci/host/pci-xgene-msi.c   | 1 -
 drivers/pci/host/pcie-designware.c | 1 -
 drivers/pci/host/pcie-rcar.c   | 1 -
 drivers/pci/host/pcie-xilinx.c | 2 --
 7 files changed, 9 deletions(-)
 
 diff --git a/drivers/pci/host/pci-dra7xx.c b/drivers/pci/host/pci-dra7xx.c
 index 80db09e..1a0d124 100644
 --- a/drivers/pci/host/pci-dra7xx.c
 +++ b/drivers/pci/host/pci-dra7xx.c
 @@ -155,7 +155,6 @@ static int dra7xx_pcie_intx_map(struct irq_domain 
 *domain, unsigned int irq,
 {
irq_set_chip_and_handler(irq, dummy_irq_chip, handle_simple_irq);
irq_set_chip_data(irq, domain-host_data);
 -set_irq_flags(irq, IRQF_VALID);
 
return 0;
 }
 diff --git a/drivers/pci/host/pci-keystone-dw.c 
 b/drivers/pci/host/pci-keystone-dw.c
 index f34892e..f1d0749 100644
 --- a/drivers/pci/host/pci-keystone-dw.c
 +++ b/drivers/pci/host/pci-keystone-dw.c
 @@ -196,7 +196,6 @@ static int ks_dw_pcie_msi_map(struct irq_domain *domain, 
 unsigned int irq,
irq_set_chip_and_handler(irq, ks_dw_pcie_msi_irq_chip,
 handle_level_irq);
irq_set_chip_data(irq, domain-host_data);
 -set_irq_flags(irq, IRQF_VALID);
 
return 0;
 }
 @@ -277,7 +276,6 @@ static int ks_dw_pcie_init_legacy_irq_map(struct 
 irq_domain *d,
irq_set_chip_and_handler(irq, ks_dw_pcie_legacy_irq_chip,
 handle_level_irq);
irq_set_chip_data(irq, d-host_data);
 -set_irq_flags(irq, IRQF_VALID);
 
return 0;
 }
 diff --git a/drivers/pci/host/pci-tegra.c b/drivers/pci/host/pci-tegra.c
 index 10c0571..81df0c1 100644
 --- a/drivers/pci/host/pci-tegra.c
 +++ b/drivers/pci/host/pci-tegra.c
 @@ -1248,7 +1248,6 @@ static int tegra_msi_map(struct irq_domain *domain, 
 unsigned int irq,
 {
irq_set_chip_and_handler(irq, tegra_msi_irq_chip, handle_simple_irq);
irq_set_chip_data(irq, domain-host_data);
 -set_irq_flags(irq, IRQF_VALID);
 
tegra_cpuidle_pcie_irqs_in_use();
 
 diff --git a/drivers/pci/host/pci-xgene-msi.c 
 b/drivers/pci/host/pci-xgene-msi.c
 index 2d31d4d..8e559d1 100644
 --- a/drivers/pci/host/pci-xgene-msi.c
 +++ b/drivers/pci/host/pci-xgene-msi.c
 @@ -223,7 +223,6 @@ static int xgene_irq_domain_alloc(struct irq_domain 
 *domain, unsigned int virq,
irq_domain_set_info(domain, virq, msi_irq,
xgene_msi_bottom_irq_chip, domain-host_data,
handle_simple_irq, NULL, NULL);
 -set_irq_flags(virq, IRQF_VALID);
 
return 0;
 }
 diff --git a/drivers/pci/host/pcie-designware.c 
 b/drivers/pci/host/pcie-designware.c
 index 69486be..5c6b562 100644
 --- a/drivers/pci/host/pcie-designware.c
 +++ b/drivers/pci/host/pcie-designware.c
 @@ -350,7 +350,6 @@ static int dw_pcie_msi_map(struct irq_domain *domain, 
 unsigned int irq,
 {
irq_set_chip_and_handler(irq, dw_msi_irq_chip, handle_simple_irq);
irq_set_chip_data(irq, domain-host_data);
 -set_irq_flags(irq, IRQF_VALID);
 
return 0;
 }
 diff --git a/drivers/pci/host/pcie-rcar.c b/drivers/pci/host/pcie-rcar.c
 index c086210..7678fe0 100644
 --- a/drivers/pci/host/pcie-rcar.c
 +++ b/drivers/pci/host/pcie-rcar.c
 @@ -664,7 +664,6 @@ static int rcar_msi_map(struct irq_domain *domain, 
 unsigned int irq,
 {
irq_set_chip_and_handler(irq, rcar_msi_irq_chip, 

Re: [PATCH 5/5] Input: tsc2005 - convert to gpiod

2015-07-27 Thread Dmitry Torokhov
On Wed, Jul 22, 2015 at 10:04:45PM +0200, Sebastian Reichel wrote:
 The GPIOD API can be used from boardcode, so that
 the DT check can be removed. To avoid breaking
 existing boardcode, _optional() variant has been
 chosen. For completly removing the DT check, the
 regulator has also been made optional, so that it
 could be supplied from boardcode.
 
 As a side-effect the patch fixes the after-probe
 reset GPIO state, so that the device is not kept
 in reset state.
 
 Signed-off-by: Sebastian Reichel s...@kernel.org
 ---
  drivers/input/touchscreen/tsc2005.c | 47 
 ++---
  1 file changed, 18 insertions(+), 29 deletions(-)
 
 diff --git a/drivers/input/touchscreen/tsc2005.c 
 b/drivers/input/touchscreen/tsc2005.c
 index f82b860..bf1b782 100644
 --- a/drivers/input/touchscreen/tsc2005.c
 +++ b/drivers/input/touchscreen/tsc2005.c
 @@ -30,11 +30,11 @@
  #include linux/delay.h
  #include linux/pm.h
  #include linux/of.h
 -#include linux/of_gpio.h
  #include linux/spi/spi.h
  #include linux/spi/tsc2005.h
  #include linux/regulator/consumer.h
  #include linux/regmap.h
 +#include linux/gpio/consumer.h
  
  /*
   * The touchscreen interface operates as follows:
 @@ -180,7 +180,7 @@ struct tsc2005 {
  
   struct regulator*vio;
  
 - int reset_gpio;
 + struct gpio_desc*reset_gpio;
   void(*set_reset)(bool enable);
  };
  
 @@ -318,8 +318,8 @@ static void tsc2005_stop_scan(struct tsc2005 *ts)
  
  static void tsc2005_set_reset(struct tsc2005 *ts, bool enable)
  {
 - if (ts-reset_gpio = 0)
 - gpio_set_value(ts-reset_gpio, enable);
 + if (ts-reset_gpio)
 + gpiod_set_value_cansleep(ts-reset_gpio, enable);
   else if (ts-set_reset)
   ts-set_reset(enable);
  }
 @@ -611,34 +611,23 @@ static int tsc2005_probe(struct spi_device *spi)
   ts-x_plate_ohm = x_plate_ohm;
   ts-esd_timeout = esd_timeout;
  
 - if (np) {
 - ts-reset_gpio = of_get_named_gpio(np, reset-gpios, 0);
 - if (ts-reset_gpio == -EPROBE_DEFER)
 - return ts-reset_gpio;
 - if (ts-reset_gpio  0) {
 - dev_err(spi-dev, error acquiring reset gpio: %d\n,
 - ts-reset_gpio);
 - return ts-reset_gpio;
 - }
 + ts-reset_gpio = devm_gpiod_get_optional(spi-dev, reset,
 +  GPIOD_OUT_HIGH);
 + if (IS_ERR(ts-reset_gpio)) {
 + error = PTR_ERR(ts-reset_gpio);
 + dev_err(spi-dev, error acquiring reset gpio: %d\n, error);
 + return error;
 + }
  
 - error = devm_gpio_request_one(spi-dev, ts-reset_gpio, 0,
 -   reset-gpios);
 - if (error) {
 - dev_err(spi-dev, error requesting reset gpio: %d\n,
 - error);
 - return error;
 - }
 + ts-vio = devm_regulator_get_optional(spi-dev, vio);
 + if (IS_ERR(ts-vio)) {
 + error = PTR_ERR(ts-vio);
 + dev_err(spi-dev, vio regulator missing (%d), error);
 + return error;
 + }

I wonder if we should actually make it devm_regulator_get()because if we
have full constraints then we'll simply get a dummy regulator here if
vio-supply is not defined.

Can be done as a follow-up though.

I've applied all 5.

Thanks.

-- 
Dmitry
--
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 v3 07/11] usb: otg: add OTG core

2015-07-27 Thread Roger Quadros
Hi,

On 21/07/15 13:52, Li Jun wrote:
 Hi,
 
 [...]
 
 +  otg_timer_init(A_WAIT_ENUM, otgd, set_tmout, TB_SRP_FAIL, NULL);

 2 timers are missing: B_DATA_PLS, B_SSEND_SRP.

 Those 2 are not used by usb-otg-fsm.c. We can add it when usb-otg-fsm.c is 
 updated.

 
 ok.
 

 +}
 
 [...]
 
 +
 +/**
 + * OTG FSM ops function to start/stop host
 + */
 +static int usb_otg_start_host(struct otg_fsm *fsm, int on)
 +{
 +  struct otg_data *otgd = container_of(fsm, struct otg_data, fsm);
 +  struct otg_hcd_ops *hcd_ops;
 +
 +  dev_dbg(otgd-dev, otg: %s %d\n, __func__, on);
 +  if (!fsm-otg-host) {
 +  WARN_ONCE(1, otg: fsm running without host\n);
 +  return 0;
 +  }
 +
 +  if (on) {
 +  /* OTG device operations */
 +  if (otgd-start_host)
 +  otgd-start_host(fsm, on);
 +
 +  /* start host */
 +  hcd_ops = otgd-primary_hcd.ops;
 +  hcd_ops-add(otgd-primary_hcd.hcd, otgd-primary_hcd.irqnum,
 +   otgd-primary_hcd.irqflags);
 +  if (otgd-shared_hcd.hcd) {
 +  hcd_ops = otgd-shared_hcd.ops;
 +  hcd_ops-add(otgd-shared_hcd.hcd,
 +   otgd-shared_hcd.irqnum,
 +   otgd-shared_hcd.irqflags);
 +  }
 +  } else {
 +  /* stop host */
 +  if (otgd-shared_hcd.hcd) {
 +  hcd_ops = otgd-shared_hcd.ops;
 +  hcd_ops-remove(otgd-shared_hcd.hcd);
 +  }
 +  hcd_ops = otgd-primary_hcd.ops;
 +  hcd_ops-remove(otgd-primary_hcd.hcd);
 +
 +  /* OTG device operations */
 +  if (otgd-start_host)
 +  otgd-start_host(fsm, on);
 +  }
 +
 +  return 0;
 +}

 I do not see much benefit by this override function, usb_add/remove_hcd
 can be simply included by controller's start_host function, also there
 maybe some additional operations after usb_add_hcd, but this override
 function limit usb_add_hcd() is the last step.

 I had tried host start/stop way before but Alan's suggestion was to use
 bind/unbind the host controller completely as that is much simpler

 [1] http://article.gmane.org/gmane.linux.usb.general/123842

 
 I did not mean host start/stop in your first version, I agree using
 usb_add/remove_hcd() for simple.
 

 Maybe your intention is to make usb_add_hcd is the only operation required
 to start host, so ideally controller driver need not define its start_host
 routine for this otg ops, I am not sure if this can work for different otg

 Yes that was the intention.

 platforms. If the shared code is only usb_add/remove_hcd(), maybe leave this
 ops defined by controller driver can make core code simple and give 
 flexibility
 to controller drivers.

 We don't completely override start/stop_host(). The flexibility is still 
 there.
 We call controllers start_host(1) before starting the controller and 
 controllers
 start_host(0) after stopping the controller.
 So the the controller can still do what they want in 
 otg_fsm_ops.start_host/gadget().

 
 But if controller driver wants to do something after usb_otg_add_hcd(),
 it's impossible with your current usb_otg_start_host().

Agree with that point. I can't forsee if any driver will need to do that but
we don't want to limit it so i'll consider your point of letting the controller 
drivers
do whatever they want in start/stop ops.

I can move the existing starts/stop to a library function so they can re-use it 
if they
don't want anything special.

 
 The OTG core only takes care of actually starting/stopping the host 
 controller.

 If we don't do that then the code in usb_otg_start_host() has to be pasted
 in every OTG controller driver. This is code duplication.

 
 Actually the only duplication code may be a function call to original
 usb_add/remove_hcd().

For USB hosts having primary and shared controllers it is not that simple
but they can use the library function in that case.

 

 +
 +/**
 + * OTG FSM ops function to start/stop gadget
 + */
 +static int usb_otg_start_gadget(struct otg_fsm *fsm, int on)
 +{
 +  struct otg_data *otgd = container_of(fsm, struct otg_data, fsm);
 +  struct usb_gadget *gadget = fsm-otg-gadget;
 +
 +  dev_dbg(otgd-dev, otg: %s %d\n, __func__, on);
 +  if (!gadget) {
 +  WARN_ONCE(1, otg: fsm running without gadget\n);
 +  return 0;
 +  }
 +
 +  if (on) {
 +  /* OTG device operations */
 +  if (otgd-start_gadget)
 +  otgd-start_gadget(fsm, on);
 +
 +  otgd-gadget_ops-start(fsm-otg-gadget);
 +  } else {
 +  otgd-gadget_ops-stop(fsm-otg-gadget);
 +
 +  /* OTG device operations */
 +  if (otgd-start_gadget)
 +  otgd-start_gadget(fsm, on);
 +  }
 +
 +  return 0;
 +}
 +
 +/**
 + * OTG FSM work function
 + */
 +static void usb_otg_work(struct work_struct *work)
 +{
 +  struct otg_data *otgd = container_of(work, struct otg_data, work);
 +
 +  otg_statemachine(otgd-fsm);

 Need 

Re: [PATCH v3 0/3] phy: ti-pipe3: dra7: sata: allow suspend to RAM (core-retention)

2015-07-27 Thread Roger Quadros
Kishon  Tony,

You can please pick the first 2 patches for -next.

The 3rd patch is not required for SATA and I will send it as
a separate series.

cheers,
-roger

On 17/07/15 16:47, Roger Quadros wrote:
 Hi,
 
 Implement workaround for SATA errata i783 (SATA Lockup After SATA DPLL 
 Unlock/Relock)
 so that we can now turn off sata_refclk to support suspend-to-ram without 
 preventing
 core-retention.
 
 Depends on http://article.gmane.org/gmane.linux.ports.arm.omap/126670.
 
 Changelog:
 v3:
 - used scm_conf node in dra7.dtsi for control register access.
 
 v2:
 - Fixed pcie disable_clocks. Addressed review comments.
 
 cheers,
 -roger
 
 Roger Quadros (3):
   phy: ti-pipe3: i783 workaround for SATA lockup after dpll
 unlock/relock
   ARM: dts: dra7: Add syscon-pllreset syscon to SATA PHY
   ARM: dts: dra7: Add scm_conf1 node and remove redundant nodes
 
  Documentation/devicetree/bindings/phy/ti-phy.txt | 16 +++
  arch/arm/boot/dts/dra7.dtsi  | 20 
  drivers/phy/phy-ti-pipe3.c   | 61 
 +---
  3 files changed, 80 insertions(+), 17 deletions(-)
 
--
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 0/3] ARM: dts: dra7: scm_conf node cleanup

2015-07-27 Thread Roger Quadros
Hi,

This series cleans up the scm_conf node.

v2:
- split patch. use only core_sma_sw registers for the new scm_conf child.

cheers,
-roger

Roger Quadros (3):
  ARM: dts: dra7: Remove ctrl_core and ctrl_general nodes
  ARM: dts: dra7: fix pinmux@1400 resource length
  ARM: dts: dra7: Add scm_conf@1c04 node

 arch/arm/boot/dts/dra7.dtsi | 19 ---
 1 file changed, 8 insertions(+), 11 deletions(-)

-- 
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


[PATCH v2 3/3] ARM: dts: dra7: Add scm_conf@1c04 node

2015-07-27 Thread Roger Quadros
This region contains CTRL_CORE_SMA_SW2..9 registers which
are not specific to any domain and can be reasonably
accessed via syscon driver.

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

diff --git a/arch/arm/boot/dts/dra7.dtsi b/arch/arm/boot/dts/dra7.dtsi
index 913032b..43b5074 100644
--- a/arch/arm/boot/dts/dra7.dtsi
+++ b/arch/arm/boot/dts/dra7.dtsi
@@ -149,6 +149,13 @@
pinctrl-single,register-width = 32;
pinctrl-single,function-mask = 
0x3fff;
};
+
+   scm_conf1: scm_conf@1c04 {
+   compatible = syscon;
+   reg = 0x1c04 0x0020;
+   #address-cells = 1;
+   #size-cells = 1;
+   };
};
 
cm_core_aon: cm_core_aon@5000 {
-- 
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


[PATCH v2 1/3] ARM: dts: dra7: Remove ctrl_core and ctrl_general nodes

2015-07-27 Thread Roger Quadros
These nodes are wrongly placed. They must come under the
scm node. Nobody uses them either so get rid of them.

Signed-off-by: Roger Quadros rog...@ti.com
---
 arch/arm/boot/dts/dra7.dtsi | 10 --
 1 file changed, 10 deletions(-)

diff --git a/arch/arm/boot/dts/dra7.dtsi b/arch/arm/boot/dts/dra7.dtsi
index 4a0718c..cf2931e 100644
--- a/arch/arm/boot/dts/dra7.dtsi
+++ b/arch/arm/boot/dts/dra7.dtsi
@@ -286,16 +286,6 @@
#thermal-sensor-cells = 1;
};
 
-   dra7_ctrl_core: ctrl_core@4a002000 {
-   compatible = syscon;
-   reg = 0x4a002000 0x6d0;
-   };
-
-   dra7_ctrl_general: tisyscon@4a002e00 {
-   compatible = syscon;
-   reg = 0x4a002e00 0x7c;
-   };
-
sdma: dma-controller@4a056000 {
compatible = ti,omap4430-sdma;
reg = 0x4a056000 0x1000;
-- 
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


[PATCH v2 2/3] ARM: dts: dra7: fix pinmux@1400 resource length

2015-07-27 Thread Roger Quadros
We need to add 4 bytes to include the last 32-bit register space.

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

diff --git a/arch/arm/boot/dts/dra7.dtsi b/arch/arm/boot/dts/dra7.dtsi
index cf2931e..913032b 100644
--- a/arch/arm/boot/dts/dra7.dtsi
+++ b/arch/arm/boot/dts/dra7.dtsi
@@ -141,7 +141,7 @@
dra7_pmx_core: pinmux@1400 {
compatible = ti,dra7-padconf,
 pinctrl-single;
-   reg = 0x1400 0x0464;
+   reg = 0x1400 0x0468;
#address-cells = 1;
#size-cells = 0;
#interrupt-cells = 1;
-- 
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 v3 0/3] phy: ti-pipe3: dra7: sata: allow suspend to RAM (core-retention)

2015-07-27 Thread Roger Quadros
On 27/07/15 13:21, Roger Quadros wrote:
 Kishon  Tony,
 
 You can please pick the first 2 patches for -next.

Sorry, I meant for -rc.

 
 The 3rd patch is not required for SATA and I will send it as
 a separate series.

This can go in -next.

cheers,
-roger

 
 cheers,
 -roger
 
 On 17/07/15 16:47, Roger Quadros wrote:
 Hi,

 Implement workaround for SATA errata i783 (SATA Lockup After SATA DPLL 
 Unlock/Relock)
 so that we can now turn off sata_refclk to support suspend-to-ram without 
 preventing
 core-retention.

 Depends on http://article.gmane.org/gmane.linux.ports.arm.omap/126670.

 Changelog:
 v3:
 - used scm_conf node in dra7.dtsi for control register access.

 v2:
 - Fixed pcie disable_clocks. Addressed review comments.

 cheers,
 -roger

 Roger Quadros (3):
   phy: ti-pipe3: i783 workaround for SATA lockup after dpll
 unlock/relock
   ARM: dts: dra7: Add syscon-pllreset syscon to SATA PHY
   ARM: dts: dra7: Add scm_conf1 node and remove redundant nodes

  Documentation/devicetree/bindings/phy/ti-phy.txt | 16 +++
  arch/arm/boot/dts/dra7.dtsi  | 20 
  drivers/phy/phy-ti-pipe3.c   | 61 
 +---
  3 files changed, 80 insertions(+), 17 deletions(-)

--
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 1/2] extcon: fix hang and extcon_get/set_cable_state().

2015-07-27 Thread Roger Quadros
Chanwoo,

On 10/07/15 18:54, Chanwoo Choi wrote:
 Hi Roger,
 
 Thanks for your working.
 
 I'll review, test and apply it on next week because I'm on vacation now.

Can you please take this for -rc cycle? Thanks.

cheers,
-roger

 
 Thanks,
 Chanwoo Choi
 
 On Tue, Jul 7, 2015 at 3:06 PM, Roger Quadros rog...@ti.com wrote:
 Users of find_cable_index_by_name() will cause a kernel hang
 as the while loop counter is never incremented and end condition
 is never reached.

 extcon_get_cable_state() and extcon_set_cable_state() are broken
 because they use cable index instead of cable id. This causes
 the first cable state (cable.0) to be always invalid in sysfs
 or extcon_get_cable_state() users.

 Introduce a new function find_cable_id_by_name() that fixes
 both of the above issues.

 Fixes: commit 73b6ecdb93e8 (extcon: Redefine the unique id of supported 
 external connectors without 'enum extcon' type)
 Cc: Greg Kroah-Hartman gre...@linuxfoundation.org
 Signed-off-by: Roger Quadros rog...@ti.com
 ---
  drivers/extcon/extcon.c | 38 +-
  1 file changed, 29 insertions(+), 9 deletions(-)

 diff --git a/drivers/extcon/extcon.c b/drivers/extcon/extcon.c
 index 76157ab..987dd3c 100644
 --- a/drivers/extcon/extcon.c
 +++ b/drivers/extcon/extcon.c
 @@ -124,22 +124,34 @@ static int find_cable_index_by_id(struct extcon_dev 
 *edev, const unsigned int id
 return -EINVAL;
  }

 -static int find_cable_index_by_name(struct extcon_dev *edev, const char 
 *name)
 +static int find_cable_id_by_name(struct extcon_dev *edev, const char *name)
  {
 -   unsigned int id = EXTCON_NONE;
 +   unsigned int id = -EINVAL;
 int i = 0;

 -   if (edev-max_supported == 0)
 -   return -EINVAL;
 -
 -   /* Find the the number of extcon cable */
 +   /* Find the id of extcon cable */
 while (extcon_name[i]) {
 if (!strncmp(extcon_name[i], name, CABLE_NAME_MAX)) {
 id = i;
 break;
 }
 +
 +   i++;
 }

 +   return id;
 +};
 +
 +static int find_cable_index_by_name(struct extcon_dev *edev, const char 
 *name)
 +{
 +   unsigned int id = EXTCON_NONE;
 +
 +   if (edev-max_supported == 0)
 +   return -EINVAL;
 +
 +   /* Find the the number of extcon cable */
 +   id = find_cable_id_by_name(edev, name);
 +
 if (id == EXTCON_NONE)
 return -EINVAL;

 @@ -228,9 +240,11 @@ static ssize_t cable_state_show(struct device *dev,
 struct extcon_cable *cable = container_of(attr, struct extcon_cable,
   attr_state);

 +   int i = cable-cable_index;
 +
 return sprintf(buf, %d\n,
extcon_get_cable_state_(cable-edev,
 -  cable-cable_index));
 +  
 cable-edev-supported_cable[i]));
  }

  /**
 @@ -341,6 +355,9 @@ int extcon_get_cable_state_(struct extcon_dev *edev, 
 const unsigned int id)
  {
 int index;

 +   if (id == EXTCON_NONE)
 +   return -EINVAL;
 +
 index = find_cable_index_by_id(edev, id);
 if (index  0)
 return index;
 @@ -361,7 +378,7 @@ EXPORT_SYMBOL_GPL(extcon_get_cable_state_);
   */
  int extcon_get_cable_state(struct extcon_dev *edev, const char *cable_name)
  {
 -   return extcon_get_cable_state_(edev, find_cable_index_by_name
 +   return extcon_get_cable_state_(edev, find_cable_id_by_name
 (edev, cable_name));
  }
  EXPORT_SYMBOL_GPL(extcon_get_cable_state);
 @@ -380,6 +397,9 @@ int extcon_set_cable_state_(struct extcon_dev *edev, 
 unsigned int id,
 u32 state;
 int index;

 +   if (id == EXTCON_NONE)
 +   return -EINVAL;
 +
 index = find_cable_index_by_id(edev, id);
 if (index  0)
 return index;
 @@ -404,7 +424,7 @@ EXPORT_SYMBOL_GPL(extcon_set_cable_state_);
  int extcon_set_cable_state(struct extcon_dev *edev,
 const char *cable_name, bool cable_state)
  {
 -   return extcon_set_cable_state_(edev, find_cable_index_by_name
 +   return extcon_set_cable_state_(edev, find_cable_id_by_name
 (edev, cable_name), cable_state);
  }
  EXPORT_SYMBOL_GPL(extcon_set_cable_state);
 --
 2.1.4

 --
 To unsubscribe from this list: send the line unsubscribe linux-kernel in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
 Please read the FAQ at  http://www.tux.org/lkml/
--
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: errata 430973: move !ARCH_MULTIPLATFORM to Kconfig

2015-07-27 Thread Russell King - ARM Linux
On Mon, Jul 27, 2015 at 10:59:56AM +0100, Ben Dooks wrote:
 This isn't the only place ARM_ERRATA_430973 is used, and if
 you make it configurable on !ARCH_MULTIPLATFORM then it makes
 it impossible to use a ARCH_MULTIPLATFORM kernel on something
 that is an Cortex-A8.
 
 See arch/arm/mm/proc-v7-2level.S

That has been fixed so that the BTAC/BTB always gets flushed on each
context switch for all Cortex-A8 CPUs, but none of the other v7 CPUs.

-- 
FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up
according to speedtest.net.
--
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] usb: dwc3: ep0: preparation for handling non maxpacket aligned transfers 512

2015-07-27 Thread Kishon Vijay Abraham I
No functional change. This is in preparation for handling non maxpacket
aligned transfers greater than bounce buffer size. This is basically to
avoid code duplication when using chained TRB transfers to handle
non maxpacket aligned transfers greater than bounce buffer size.

Signed-off-by: Kishon Vijay Abraham I kis...@ti.com
---
 drivers/usb/dwc3/ep0.c |   25 +
 1 file changed, 17 insertions(+), 8 deletions(-)

diff --git a/drivers/usb/dwc3/ep0.c b/drivers/usb/dwc3/ep0.c
index 713e46a..4998074 100644
--- a/drivers/usb/dwc3/ep0.c
+++ b/drivers/usb/dwc3/ep0.c
@@ -779,7 +779,11 @@ static void dwc3_ep0_complete_data(struct dwc3 *dwc,
struct usb_request  *ur;
struct dwc3_trb *trb;
struct dwc3_ep  *ep0;
-   u32 transferred;
+   unsignedtransfer_size = 0;
+   unsignedmaxp;
+   unsignedremaining_ur_length;
+   void*buf;
+   u32 transferred = 0;
u32 status;
u32 length;
u8  epnum;
@@ -808,20 +812,24 @@ static void dwc3_ep0_complete_data(struct dwc3 *dwc,
}
 
ur = r-request;
+   buf = ur-buf;
+   remaining_ur_length = ur-length;
 
length = trb-size  DWC3_TRB_SIZE_MASK;
 
+   maxp = ep0-endpoint.maxpacket;
+
if (dwc-ep0_bounced) {
-   unsigned maxp = ep0-endpoint.maxpacket;
-   unsigned transfer_size = roundup(ur-length, maxp);
+   transfer_size = roundup((ur-length - transfer_size),
+   maxp);
 
/* Maximum of DWC3_EP0_BOUNCE_SIZE can only be received */
if (transfer_size  DWC3_EP0_BOUNCE_SIZE)
transfer_size = DWC3_EP0_BOUNCE_SIZE;
 
-   transferred = min_t(u32, ur-length,
-   transfer_size - length);
-   memcpy(ur-buf, dwc-ep0_bounce, transferred);
+   transferred = min_t(u32, remaining_ur_length,
+   transfer_size - length);
+   memcpy(buf, dwc-ep0_bounce, transferred);
} else {
transferred = ur-length - length;
}
@@ -930,7 +938,7 @@ static void __dwc3_ep0_do_control_data(struct dwc3 *dwc,
DWC3_TRBCTL_CONTROL_DATA);
} else if (!IS_ALIGNED(req-request.length, dep-endpoint.maxpacket)
 (dep-number == 0)) {
-   u32 transfer_size;
+   u32 transfer_size = 0;
u32 maxpacket;
 
ret = usb_gadget_map_request(dwc-gadget, req-request,
@@ -941,7 +949,8 @@ static void __dwc3_ep0_do_control_data(struct dwc3 *dwc,
}
 
maxpacket = dep-endpoint.maxpacket;
-   transfer_size = roundup(req-request.length, maxpacket);
+   transfer_size = roundup((req-request.length - transfer_size),
+   maxpacket);
 
if (transfer_size  DWC3_EP0_BOUNCE_SIZE) {
dev_WARN(dwc-dev, bounce buf can't handle req len\n);
-- 
1.7.9.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 2/6] usb: dwc3: ep0: use _roundup_ to calculate the transfer size

2015-07-27 Thread Kishon Vijay Abraham I
No functional change. Used _roundup_ macro to calculate the transfer
size aligned to maxpacket in  dwc3_ep0_complete_data. It also makes it
similar to how transfer size is calculated in __dwc3_ep0_do_control_data.

Signed-off-by: Kishon Vijay Abraham I kis...@ti.com
---
 drivers/usb/dwc3/ep0.c |4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/usb/dwc3/ep0.c b/drivers/usb/dwc3/ep0.c
index 8858c60..713e46a 100644
--- a/drivers/usb/dwc3/ep0.c
+++ b/drivers/usb/dwc3/ep0.c
@@ -812,10 +812,8 @@ static void dwc3_ep0_complete_data(struct dwc3 *dwc,
length = trb-size  DWC3_TRB_SIZE_MASK;
 
if (dwc-ep0_bounced) {
-   unsigned transfer_size = ur-length;
unsigned maxp = ep0-endpoint.maxpacket;
-
-   transfer_size += (maxp - (transfer_size % maxp));
+   unsigned transfer_size = roundup(ur-length, maxp);
 
/* Maximum of DWC3_EP0_BOUNCE_SIZE can only be received */
if (transfer_size  DWC3_EP0_BOUNCE_SIZE)
-- 
1.7.9.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


RE: [PATCH 2/3] drivers: usb: dwc3: Add adjust_frame_length_quirk

2015-07-27 Thread Badola Nikhil
 -Original Message-
 From: Felipe Balbi [mailto:ba...@ti.com]
 Sent: Thursday, July 23, 2015 8:39 PM
 To: Felipe Balbi
 Cc: Badola Nikhil-B46172; linux-ker...@vger.kernel.org; linux-
 u...@vger.kernel.org; linux-omap@vger.kernel.org;
 gre...@linuxfoundation.org
 Subject: Re: [PATCH 2/3] drivers: usb: dwc3: Add adjust_frame_length_quirk
 
 Hi again,
 
 On Thu, Jul 23, 2015 at 09:55:32AM -0500, Felipe Balbi wrote:
   diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h index
   0447788..b7a5119 100644
   --- a/drivers/usb/dwc3/core.h
   +++ b/drivers/usb/dwc3/core.h
   @@ -124,6 +124,7 @@
#define DWC3_GEVNTCOUNT(n)   (0xc40c + (n * 0x10))
  
#define DWC3_GHWPARAMS8  0xc600
   +#define DWC3_GFLADJ  0xc630
  
/* Device Registers */
#define DWC3_DCFG0xc700
   @@ -234,6 +235,10 @@
/* Global HWPARAMS6 Register */
#define DWC3_GHWPARAMS6_EN_FPGA  (1  7)
  
   +/* Global Frame Length Adjustment Register */
   +#define GFLADJ_30MHZ_REG_SEL (1  7)
 
  always prepend with DWC3_ like *all* other macros in this file.
 
  Also, match docs to ease grepping. This should be called
  DWC3_GFLADJ_30MHZ_SDBND_SEL

GFLADJ_30MHZ_REG_SEL is the field's name in LS1021A Reference Manual as well 
as dwc3 databook. Though DWC3_GFLADJ_30MHZ_SDBND_SEL seems more
relevant. 

 
 yet another problem is that this register doesn't exist in *all* versions of
 DWC3. It was introduced in version 2.50a so the branch I typed above needs
 one extra check, and since it's getting so large, it deserves be factored out
 into its own function.
 
 static int dwc3_frame_length_adjustment(struct dwc3 *dwc, u32 fladj) {
   u32 reg;
   u32 dft;
 
   if (dwc-revision = DWC3_REVISION_250A)
   return 0;
 
   if (fladj == 0)
   return 0;
 
   reg = dwc3_readl(dwc-regs, DWC3_GFLADJ);
   dft = reg  0x3f; /* needs a mask macro */
 
   if (!dev_WARN_ONCE(dwc-dev, dft == fladj,
   requested value same as default, ignoring\n)) {
   reg = ~0x3f; /* needs a mask macro */
   reg |= DWC3_GFLADJ_30MHZ_SDBND_SEL |
   DWC3_GFLADJ_30MHZ(fladj_value);
 
   dwc3_writel(dwc-regs, DWC3_GFLADJ, reg);
   }
 }
 
 you really *MUST* check this sort of this out when writing patches. It's not
 only about *your* SoC. You gotta remember we have a ton of different
 users and those a prone to major grumpyness should a completely unrelated
 patch break their use case.
 
 You have access to the IP's documentation, and that contains the entire
 history of the IP itself, so it's easy to figure all of this out with a 
 simple search
 in the documentation.
 
 One extra detail is that you were very careless when writing to the GFLADJ
 register too. You simply wrote your 30MHz sideband value, potentially
 clearing other bits which shouldn't be touched. That alone can add
 regressions.
 
 When resending, make sure all 3 patches reach linux-usb. I still can't find
 patch 3/3.


Will take care of above scenarios and resend patches cc'ing linux-usb in each 
of them.

Regarding acceptance of the patch only when it's used in glue layer, there is 
no freescale's
glue layer present for dwc3 as of now. Furthermore, there is not any platform 
specific 
code required in glue layer apart from the ones present in dwc3/core.c. 

Please suggest.


--
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 4/6] usb: dwc3; ep0: Modify _dwc3_ep0_start_trans_ API to take 'chain' parameter

2015-07-27 Thread Kishon Vijay Abraham I
No functional change. Added a new parameter in _dwc3_ep0_start_trans_ to
indicate whether the TRB is a chained TRB or last TRB. This is in
preparation for adding chained TRB support for ep0.

Signed-off-by: Kishon Vijay Abraham I kis...@ti.com
---
 drivers/usb/dwc3/ep0.c |   15 ---
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/usb/dwc3/ep0.c b/drivers/usb/dwc3/ep0.c
index 4998074..01411a8 100644
--- a/drivers/usb/dwc3/ep0.c
+++ b/drivers/usb/dwc3/ep0.c
@@ -56,7 +56,7 @@ static const char *dwc3_ep0_state_string(enum dwc3_ep0_state 
state)
 }
 
 static int dwc3_ep0_start_trans(struct dwc3 *dwc, u8 epnum, dma_addr_t buf_dma,
-   u32 len, u32 type)
+   u32 len, u32 type, bool chain)
 {
struct dwc3_gadget_ep_cmd_params params;
struct dwc3_trb *trb;
@@ -302,7 +302,7 @@ void dwc3_ep0_out_start(struct dwc3 *dwc)
int ret;
 
ret = dwc3_ep0_start_trans(dwc, 0, dwc-ctrl_req_addr, 8,
-   DWC3_TRBCTL_CONTROL_SETUP);
+   DWC3_TRBCTL_CONTROL_SETUP, false);
WARN_ON(ret  0);
 }
 
@@ -851,7 +851,7 @@ static void dwc3_ep0_complete_data(struct dwc3 *dwc,
 
ret = dwc3_ep0_start_trans(dwc, epnum,
dwc-ctrl_req_addr, 0,
-   DWC3_TRBCTL_CONTROL_DATA);
+   DWC3_TRBCTL_CONTROL_DATA, false);
WARN_ON(ret  0);
}
}
@@ -935,7 +935,7 @@ static void __dwc3_ep0_do_control_data(struct dwc3 *dwc,
if (req-request.length == 0) {
ret = dwc3_ep0_start_trans(dwc, dep-number,
dwc-ctrl_req_addr, 0,
-   DWC3_TRBCTL_CONTROL_DATA);
+   DWC3_TRBCTL_CONTROL_DATA, false);
} else if (!IS_ALIGNED(req-request.length, dep-endpoint.maxpacket)
 (dep-number == 0)) {
u32 transfer_size = 0;
@@ -966,7 +966,7 @@ static void __dwc3_ep0_do_control_data(struct dwc3 *dwc,
 */
ret = dwc3_ep0_start_trans(dwc, dep-number,
dwc-ep0_bounce_addr, transfer_size,
-   DWC3_TRBCTL_CONTROL_DATA);
+   DWC3_TRBCTL_CONTROL_DATA, false);
} else {
ret = usb_gadget_map_request(dwc-gadget, req-request,
dep-number);
@@ -976,7 +976,8 @@ static void __dwc3_ep0_do_control_data(struct dwc3 *dwc,
}
 
ret = dwc3_ep0_start_trans(dwc, dep-number, req-request.dma,
-   req-request.length, DWC3_TRBCTL_CONTROL_DATA);
+   req-request.length, DWC3_TRBCTL_CONTROL_DATA,
+   false);
}
 
WARN_ON(ret  0);
@@ -991,7 +992,7 @@ static int dwc3_ep0_start_control_status(struct dwc3_ep 
*dep)
: DWC3_TRBCTL_CONTROL_STATUS2;
 
return dwc3_ep0_start_trans(dwc, dep-number,
-   dwc-ctrl_req_addr, 0, type);
+   dwc-ctrl_req_addr, 0, type, false);
 }
 
 static void __dwc3_ep0_do_control_status(struct dwc3 *dwc, struct dwc3_ep *dep)
-- 
1.7.9.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/3] dra7xx: Add PM support to PCIe

2015-07-27 Thread Kishon Vijay Abraham I
This series adds PM support to pci-dra7xx so that PCI clocks can be disabled
during suspend and enabled back during resume without affecting
PCI functionality.

Changes from v2:
*) Used SET_SYSTEM_SLEEP_PM_OPS and SET_NOIRQ_SYSTEM_SLEEP_PM_OPS for
   populating PM ops.

Changes from v1:
*) Moved resetting and setting of MSE bit to pci-dra7xx.

The comment to reset and set ISE is not done now since I don't have a card
with IO space. Once I get to test that, I'll post a separate patch for
handling that.

Kishon Vijay Abraham I (3):
  PCI: host: pci-dra7xx: Disable pm_runtime on get_sync failure
  PCI: host: pci-dra7xx: add pm support to pci dra7xx
  PCI: host: pci-dra7xx: Idle the module by disabling MSE bit

 drivers/pci/host/pci-dra7xx.c |   95 -
 1 file changed, 94 insertions(+), 1 deletion(-)

-- 
1.7.9.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 1/3] PCI: host: pci-dra7xx: Disable pm_runtime on get_sync failure

2015-07-27 Thread Kishon Vijay Abraham I
Fix the error handling code in case pm_runtime_get_sync fails. Now
when pm_runtime_get_sync fails pm_runtime_disable is invoked so that
there is no unbalanced pm_runtime_enable calls.

Signed-off-by: Kishon Vijay Abraham I kis...@ti.com
---
 drivers/pci/host/pci-dra7xx.c |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/pci/host/pci-dra7xx.c b/drivers/pci/host/pci-dra7xx.c
index 80db09e..d8b6d66 100644
--- a/drivers/pci/host/pci-dra7xx.c
+++ b/drivers/pci/host/pci-dra7xx.c
@@ -384,7 +384,7 @@ static int __init dra7xx_pcie_probe(struct platform_device 
*pdev)
ret = pm_runtime_get_sync(dev);
if (IS_ERR_VALUE(ret)) {
dev_err(dev, pm_runtime_get_sync failed\n);
-   goto err_phy;
+   goto err_get_sync;
}
 
reg = dra7xx_pcie_readl(dra7xx, PCIECTRL_DRA7XX_CONF_DEVICE_CMD);
@@ -401,6 +401,8 @@ static int __init dra7xx_pcie_probe(struct platform_device 
*pdev)
 
 err_add_port:
pm_runtime_put(dev);
+
+err_get_sync:
pm_runtime_disable(dev);
 
 err_phy:
-- 
1.7.9.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 2/3] PCI: host: pci-dra7xx: add pm support to pci dra7xx

2015-07-27 Thread Kishon Vijay Abraham I
Add PM support to pci-dra7xx so that PCI clocks can be disabled
during suspend and enabled back during resume without affecting
PCI functionality.

Signed-off-by: Kishon Vijay Abraham I kis...@ti.com
---
 drivers/pci/host/pci-dra7xx.c |   72 +
 1 file changed, 72 insertions(+)

diff --git a/drivers/pci/host/pci-dra7xx.c b/drivers/pci/host/pci-dra7xx.c
index d8b6d66..7599201 100644
--- a/drivers/pci/host/pci-dra7xx.c
+++ b/drivers/pci/host/pci-dra7xx.c
@@ -433,6 +433,77 @@ static int __exit dra7xx_pcie_remove(struct 
platform_device *pdev)
return 0;
 }
 
+#ifdef CONFIG_PM_SLEEP
+static int dra7xx_pcie_suspend(struct device *dev)
+{
+   struct dra7xx_pcie *dra7xx = dev_get_drvdata(dev);
+   struct pcie_port *pp = dra7xx-pp;
+
+   dw_pcie_suspend_rc(pp);
+
+   return 0;
+}
+
+static int dra7xx_pcie_resume(struct device *dev)
+{
+   struct dra7xx_pcie *dra7xx = dev_get_drvdata(dev);
+   struct pcie_port *pp = dra7xx-pp;
+
+   dw_pcie_resume_rc(pp);
+
+   return 0;
+}
+
+static int dra7xx_pcie_suspend_noirq(struct device *dev)
+{
+   struct dra7xx_pcie *dra7xx = dev_get_drvdata(dev);
+   int count = dra7xx-phy_count;
+
+   while (count--) {
+   phy_power_off(dra7xx-phy[count]);
+   phy_exit(dra7xx-phy[count]);
+   }
+
+   return 0;
+}
+
+static int dra7xx_pcie_resume_noirq(struct device *dev)
+{
+   struct dra7xx_pcie *dra7xx = dev_get_drvdata(dev);
+   int phy_count = dra7xx-phy_count;
+   int ret;
+   int i;
+
+   for (i = 0; i  phy_count; i++) {
+   ret = phy_init(dra7xx-phy[i]);
+   if (ret  0)
+   goto err_phy;
+
+   ret = phy_power_on(dra7xx-phy[i]);
+   if (ret  0) {
+   phy_exit(dra7xx-phy[i]);
+   goto err_phy;
+   }
+   }
+
+   return 0;
+
+err_phy:
+   while (--i = 0) {
+   phy_power_off(dra7xx-phy[i]);
+   phy_exit(dra7xx-phy[i]);
+   }
+
+   return ret;
+}
+#endif
+
+static const struct dev_pm_ops dra7xx_pcie_pm_ops = {
+   SET_SYSTEM_SLEEP_PM_OPS(dra7xx_pcie_suspend, dra7xx_pcie_resume)
+   SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(dra7xx_pcie_suspend_noirq,
+ dra7xx_pcie_resume_noirq)
+};
+
 static const struct of_device_id of_dra7xx_pcie_match[] = {
{ .compatible = ti,dra7-pcie, },
{},
@@ -444,6 +515,7 @@ static struct platform_driver dra7xx_pcie_driver = {
.driver = {
.name   = dra7-pcie,
.of_match_table = of_dra7xx_pcie_match,
+   .pm = dra7xx_pcie_pm_ops,
},
 };
 
-- 
1.7.9.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 3/3] PCI: host: pci-dra7xx: Idle the module by disabling MSE bit

2015-07-27 Thread Kishon Vijay Abraham I
DRA7xx require MSE bit to be cleared to set the master in
standby mode. (In DRA7xx TRM_vE, section 24.9.4.5.2.2.1 PCIe
Controller Master Standby Behavior advises to use the clearing
of the local MSE bit to set the master in standby. Without this
some of the clocks do not idle).

Cleared the MSE bit on suspend and enabled it back on resume.
Clearing MSE bit is required to get clocks to be idled after
suspend.

Signed-off-by: Kishon Vijay Abraham I kis...@ti.com
Signed-off-by: Sekhar Nori nsek...@ti.com
---
 drivers/pci/host/pci-dra7xx.c |   23 +--
 1 file changed, 21 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/host/pci-dra7xx.c b/drivers/pci/host/pci-dra7xx.c
index 7599201..7acc833 100644
--- a/drivers/pci/host/pci-dra7xx.c
+++ b/drivers/pci/host/pci-dra7xx.c
@@ -83,6 +83,17 @@ static inline void dra7xx_pcie_writel(struct dra7xx_pcie 
*pcie, u32 offset,
writel(value, pcie-base + offset);
 }
 
+static inline u32 dra7xx_pcie_readl_rc(struct pcie_port *pp, u32 offset)
+{
+   return readl(pp-dbi_base + offset);
+}
+
+static inline void dra7xx_pcie_writel_rc(struct pcie_port *pp, u32 offset,
+u32 value)
+{
+   writel(value, pp-dbi_base + offset);
+}
+
 static int dra7xx_pcie_link_up(struct pcie_port *pp)
 {
struct dra7xx_pcie *dra7xx = to_dra7xx_pcie(pp);
@@ -438,8 +449,12 @@ static int dra7xx_pcie_suspend(struct device *dev)
 {
struct dra7xx_pcie *dra7xx = dev_get_drvdata(dev);
struct pcie_port *pp = dra7xx-pp;
+   u32 val;
 
-   dw_pcie_suspend_rc(pp);
+   /* clear MSE */
+   val = dra7xx_pcie_readl_rc(pp, PCI_COMMAND);
+   val = ~PCI_COMMAND_MEMORY;
+   dra7xx_pcie_writel_rc(pp, PCI_COMMAND, val);
 
return 0;
 }
@@ -448,8 +463,12 @@ static int dra7xx_pcie_resume(struct device *dev)
 {
struct dra7xx_pcie *dra7xx = dev_get_drvdata(dev);
struct pcie_port *pp = dra7xx-pp;
+   u32 val;
 
-   dw_pcie_resume_rc(pp);
+   /* clear MSE */
+   val = dra7xx_pcie_readl_rc(pp, PCI_COMMAND);
+   val |= PCI_COMMAND_MEMORY;
+   dra7xx_pcie_writel_rc(pp, PCI_COMMAND, val);
 
return 0;
 }
-- 
1.7.9.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 6/6] usb: dwc3: ep0: handle non maxpacket aligned transfers 512

2015-07-27 Thread Kishon Vijay Abraham I
Use chained TRB mechanism to handle non maxpacket aligned transfers
greater than bounce buffer size. With this the first TRB will be programmed
to receive 'ALIGN(ur-length - maxp, maxp)' data and the second TRB
will be programmed to receive the remaining data using bounce buffer.

Signed-off-by: Kishon Vijay Abraham I kis...@ti.com
---
 drivers/usb/dwc3/ep0.c |   42 --
 1 file changed, 28 insertions(+), 14 deletions(-)

diff --git a/drivers/usb/dwc3/ep0.c b/drivers/usb/dwc3/ep0.c
index 73500d3..f6c3c73 100644
--- a/drivers/usb/dwc3/ep0.c
+++ b/drivers/usb/dwc3/ep0.c
@@ -830,13 +830,26 @@ static void dwc3_ep0_complete_data(struct dwc3 *dwc,
maxp = ep0-endpoint.maxpacket;
 
if (dwc-ep0_bounced) {
+   /*
+* Handle the first TRB before handling the bounce buffer if
+* the request length is greater than the bounce buffer size
+*/
+   if (ur-length  DWC3_EP0_BOUNCE_SIZE) {
+   transfer_size = ALIGN(ur-length - maxp, maxp);
+   transferred = transfer_size - length;
+   buf = (u8 *)buf + transferred;
+   ur-actual += transferred;
+   remaining_ur_length -= transferred;
+
+   trb++;
+   length = trb-size  DWC3_TRB_SIZE_MASK;
+
+   ep0-free_slot = 0;
+   }
+
transfer_size = roundup((ur-length - transfer_size),
maxp);
 
-   /* Maximum of DWC3_EP0_BOUNCE_SIZE can only be received */
-   if (transfer_size  DWC3_EP0_BOUNCE_SIZE)
-   transfer_size = DWC3_EP0_BOUNCE_SIZE;
-
transferred = min_t(u32, remaining_ur_length,
transfer_size - length);
memcpy(buf, dwc-ep0_bounce, transferred);
@@ -959,21 +972,22 @@ static void __dwc3_ep0_do_control_data(struct dwc3 *dwc,
}
 
maxpacket = dep-endpoint.maxpacket;
-   transfer_size = roundup((req-request.length - transfer_size),
-   maxpacket);
 
-   if (transfer_size  DWC3_EP0_BOUNCE_SIZE) {
-   dev_WARN(dwc-dev, bounce buf can't handle req len\n);
-   transfer_size = DWC3_EP0_BOUNCE_SIZE;
+   if (req-request.length  DWC3_EP0_BOUNCE_SIZE) {
+   transfer_size = ALIGN(req-request.length - maxpacket,
+ maxpacket);
+   ret = dwc3_ep0_start_trans(dwc, dep-number,
+  req-request.dma,
+  transfer_size,
+  DWC3_TRBCTL_CONTROL_DATA,
+  true);
}
 
+   transfer_size = roundup((req-request.length - transfer_size),
+   maxpacket);
+
dwc-ep0_bounced = true;
 
-   /*
-* REVISIT in case request length is bigger than
-* DWC3_EP0_BOUNCE_SIZE we will need two chained
-* TRBs to handle the transfer.
-*/
ret = dwc3_ep0_start_trans(dwc, dep-number,
dwc-ep0_bounce_addr, transfer_size,
DWC3_TRBCTL_CONTROL_DATA, false);
-- 
1.7.9.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 5/6] usb: dwc3: ep0: Add chained TRB support

2015-07-27 Thread Kishon Vijay Abraham I
Add chained TRB support to ep0. Now TRB's can be chained just by
invoking _dwc3_ep0_start_trans_ with 'chain' parameter set to true.

Signed-off-by: Kishon Vijay Abraham I kis...@ti.com
---
 drivers/usb/dwc3/ep0.c|   16 +---
 drivers/usb/dwc3/gadget.c |2 +-
 2 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/dwc3/ep0.c b/drivers/usb/dwc3/ep0.c
index 01411a8..73500d3 100644
--- a/drivers/usb/dwc3/ep0.c
+++ b/drivers/usb/dwc3/ep0.c
@@ -70,7 +70,10 @@ static int dwc3_ep0_start_trans(struct dwc3 *dwc, u8 epnum, 
dma_addr_t buf_dma,
return 0;
}
 
-   trb = dwc-ep0_trb;
+   trb = dwc-ep0_trb[dep-free_slot];
+
+   if (chain)
+   dep-free_slot++;
 
trb-bpl = lower_32_bits(buf_dma);
trb-bph = upper_32_bits(buf_dma);
@@ -78,10 +81,17 @@ static int dwc3_ep0_start_trans(struct dwc3 *dwc, u8 epnum, 
dma_addr_t buf_dma,
trb-ctrl = type;
 
trb-ctrl |= (DWC3_TRB_CTRL_HWO
-   | DWC3_TRB_CTRL_LST
-   | DWC3_TRB_CTRL_IOC
| DWC3_TRB_CTRL_ISP_IMI);
 
+   if (chain)
+   trb-ctrl |= DWC3_TRB_CTRL_CHN;
+   else
+   trb-ctrl |= (DWC3_TRB_CTRL_IOC
+   | DWC3_TRB_CTRL_LST);
+
+   if (chain)
+   return 0;
+
memset(params, 0, sizeof(params));
params.param0 = upper_32_bits(dwc-ep0_trb_addr);
params.param1 = lower_32_bits(dwc-ep0_trb_addr);
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index d97fcfa..2feed9e 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -2687,7 +2687,7 @@ int dwc3_gadget_init(struct dwc3 *dwc)
goto err0;
}
 
-   dwc-ep0_trb = dma_alloc_coherent(dwc-dev, sizeof(*dwc-ep0_trb),
+   dwc-ep0_trb = dma_alloc_coherent(dwc-dev, sizeof(*dwc-ep0_trb) * 2,
dwc-ep0_trb_addr, GFP_KERNEL);
if (!dwc-ep0_trb) {
dev_err(dwc-dev, failed to allocate ep0 trb\n);
-- 
1.7.9.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] usb: dwc3: handle non maxpacket aligned transfers 512

2015-07-27 Thread Kishon Vijay Abraham I
Patch series first fixes memory corruption and then adds support to
handle non maxpacket aligned transfers.

Patch series adds support to handle non maxpacket aligned transfers
greater than bounce buffer size (512). It first adds chained TRB
support and then uses it to handle non maxpacket aligned transfers
greater than bounce buffer size.

Also included a cleanup patch to use 'roundup' macro.

Changes from v2:
*) fixed the stable mail address
*) Used bool for the argument instead of unsigned.

Changes from v1:
*) Included the patch to fix memory corruption in this series. (Also
   marked it for stable release).

Non maxpacket aligned transfers can be initiated by
./testusb -t 14 -c 1 -s 520 -v 1

Before this series: (Causes memory corruption)
unknown speed   /dev/bus/usb/010/0090
/dev/bus/usb/010/009 test 14,0.219638 secs

After the 1st patch of this series:
unknown speed   /dev/bus/usb/001/0180
/dev/bus/usb/001/018 test 14 -- 110 (Connection timed out)

After this series: (No memory corruption)
unknown speed   /dev/bus/usb/001/0230
/dev/bus/usb/001/023 test 14,0.000486 secs

Tested this patch using USB3 Gen X CV (ch9 tests: usb2 and usb3,
link layer testing and MSC tests) and using USB2 X CV (ch9 tests,
MSC tests) and verified this doesn't cause additional failures.

Lecroy compliance tests fail even without this patch series so
deferred testing it. 

Kishon Vijay Abraham I (6):
  usb: dwc3: ep0: Fix mem corruption on OUT transfers of more than 512
bytes
  usb: dwc3: ep0: use _roundup_ to calculate the transfer size
  usb: dwc3: ep0: preparation for handling non maxpacket aligned
transfers  512
  usb: dwc3; ep0: Modify _dwc3_ep0_start_trans_ API to take 'chain'
parameter
  usb: dwc3: ep0: Add chained TRB support
  usb: dwc3: ep0: handle non maxpacket aligned transfers  512

 drivers/usb/dwc3/ep0.c|   92 -
 drivers/usb/dwc3/gadget.c |2 +-
 2 files changed, 67 insertions(+), 27 deletions(-)

-- 
1.7.9.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 1/6] usb: dwc3: ep0: Fix mem corruption on OUT transfers of more than 512 bytes

2015-07-27 Thread Kishon Vijay Abraham I
DWC3 uses bounce buffer to handle non max packet aligned OUT transfers and
the size of bounce buffer is 512 bytes. However if the host initiates OUT
transfers of size more than 512 bytes (and non max packet aligned), the
driver throws a WARN dump but still programs the TRB to receive more than
512 bytes. This will cause bounce buffer to overflow and corrupt the
adjacent memory locations which can be fatal.

Fix it by programming the TRB to receive a maximum of DWC3_EP0_BOUNCE_SIZE
(512) bytes.

Cc: sta...@vger.kernel.org # 3.4+
Signed-off-by: Kishon Vijay Abraham I kis...@ti.com
---
 drivers/usb/dwc3/ep0.c |   12 ++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/dwc3/ep0.c b/drivers/usb/dwc3/ep0.c
index 2ef3c8d..8858c60 100644
--- a/drivers/usb/dwc3/ep0.c
+++ b/drivers/usb/dwc3/ep0.c
@@ -816,6 +816,11 @@ static void dwc3_ep0_complete_data(struct dwc3 *dwc,
unsigned maxp = ep0-endpoint.maxpacket;
 
transfer_size += (maxp - (transfer_size % maxp));
+
+   /* Maximum of DWC3_EP0_BOUNCE_SIZE can only be received */
+   if (transfer_size  DWC3_EP0_BOUNCE_SIZE)
+   transfer_size = DWC3_EP0_BOUNCE_SIZE;
+
transferred = min_t(u32, ur-length,
transfer_size - length);
memcpy(ur-buf, dwc-ep0_bounce, transferred);
@@ -937,11 +942,14 @@ static void __dwc3_ep0_do_control_data(struct dwc3 *dwc,
return;
}
 
-   WARN_ON(req-request.length  DWC3_EP0_BOUNCE_SIZE);
-
maxpacket = dep-endpoint.maxpacket;
transfer_size = roundup(req-request.length, maxpacket);
 
+   if (transfer_size  DWC3_EP0_BOUNCE_SIZE) {
+   dev_WARN(dwc-dev, bounce buf can't handle req len\n);
+   transfer_size = DWC3_EP0_BOUNCE_SIZE;
+   }
+
dwc-ep0_bounced = true;
 
/*
-- 
1.7.9.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


Re: n900 in 4.2-rc0: repeating oopses

2015-07-27 Thread Pali Rohár
On Monday 27 July 2015 00:31:19 Pavel Machek wrote:
 On Wed 2015-07-01 23:16:21, Tony Lindgren wrote:
  * Pavel Machek pa...@ucw.cz [150701 06:11]:
   On Wed 2015-07-01 03:34:22, Tony Lindgren wrote:

Works for me after enabling the idle timeouts with the following
script and blanking the screen and disconnecting USB:
   
   Um. I'm forcing suspend with echo mem  /sys/power/state . (It
   worked in 4.1). That should just make it sleep, no autosuspend-related
   trickery... (But yes, I guess I should set up the leds and try
   autosuspend, too.)
  
  That too works just fine for me with omap2plus_defconfig after
  echo enabled  /sys/class/tty/ttyO2/power/wakeup as I have n900
  in my test rack.
 
 Going through that. AFAICT, you are not using devicetree on n900?
 
 CONFIG_MACH_NOKIA_RX51=y
 
 Unfortunately, not having serials, it is tricky to get any output from
 that cnofiguration, so I don't know what I got wrong...
   Pavel

You can try to test it in qemu. It has emulation also of serial.

-- 
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 v4 00/46] usb: gadget: rework ep matching and claiming mechanism

2015-07-27 Thread Robert Baldyga
Hello,

This patch series reworks endpoint matching and claiming mechanism in
epautoconf. From v2 there are couple of new patches adding 'ep_match'
to usb_gadget_ops and removing chip-specific quirk handling from generic
code of autoconfig.

I'm not sure if this patch set isn't too long, as it has 46 patches,
but I decided to send it as single series to avoid problems with patch
applying order.

The aim of whole patchset is to rework epautoconf code to get rid of
things like name-based endpoint matching and UDC name-based quirks in
generic code. These needed to do some modifications in framework like
adding 'endpoint capabilities flags' feature or adding 'match_ep'.

Following paragraphs contain brief description of what modifications are
done by particular parts of this patch set:

Patch (1) introduces new safer endpoint claiming method, basing on new
'claimed' flag. It was discussed here [1]. I proposed this solution over
year ago and it was accepted, but I apparently forgot to send the final
version of my patch.

Patches (2-3) add the 'capabilities flags' structure and helper macros.
This solution is inspired by the 'feature flags' originally proposed
by Felipe Balbi in 2013 [2], but unfortunately implementation of this
feature has never been completed.

Patches (4-36) add' capabilites flags' support to all UDC drivers present
in the kernel tree. It's needed to be done before replacing old endpoint
matching mechanism, otherwise UDC drivers which doesn't set 'capabilities
flags' won't work with new matching function.

Patch (37) finally replaces old endpoint matching method with the new
one basing on capabilities flags.

These changes aims to get rid of code, which guesses endpoint capabilities
basing on it's name, and introduce new better replacement. In result
we have better way to describe types and directions supported by each
endpoint.

For example the old name-based method didn't allow to have endpoint
supporing two types of transfers - there were only ability to support
one or all of endpoint types. The 'capabilities flags' feature supply
precise, flexible and extensible mechanism of description of endpoint
hardware limitations, which is desired for proper endpoint matching.

Patch (38) removes chip-specific quirk from ep_matches() function.

Patches (39-40) remove code modifying endpoint and descriptor structures
from ep_matches() function and cleans it up to make it simpler and more
readable.

Patch (41) add 'match_ep' callback to usb_gadget_ops and make use of
it in epautoconf. This callback allows UDC drivers to supply non-standard
endpoint matching algorithms.

Patches (42-43) move ep_matches() and find_ep() functions outside
epautoconf and rename them to usb_gadget_ep_match_desc() and
gadget_find_ep_by_name(). It's because they may be useful in 'match_ep'
callbacks in UDC drivers to avoid writing repetitive code.

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

In the result we have epautoconf source free of chip-specific code, plus
two new mechanisms allowing to handle non-standard hardware limitations.

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

Best regards,
Robert Baldyga

Changelog:

v4:
- addressed comments from Krzysztof Opasiak and Felipe Balbi

v3: https://lkml.org/lkml/2015/7/15/68
- addressed comments from Sergei Shtylyov

v2: https://lkml.org/lkml/2015/7/14/172
- 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 (46):
  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 

[PATCH v4 16/46] usb: gadget: fusb300_udc: add ep capabilities support

2015-07-27 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


Re: [PATCH v3 0/5] ARM: dts: OMAP2+: Enable USB dual-role on supported boards

2015-07-27 Thread Roger Quadros
Tony,

On 21/07/15 13:54, Tony Lindgren wrote:
 * Roger Quadros rog...@ti.com [150708 03:45]:
 Hi,

 Enables dual-role feaure on supported boards.

 Depends on
 [1] - core USB DRD support - 
 http://thread.gmane.org/gmane.linux.kernel/1991413
 [2] - dwc3 DRD support - 
 http://thread.gmane.org/gmane.linux.usb.general/127890
 
 Is this series safe to apply separately actually? Adding the
 interrupts and the mode name may not be a problem without
 the related driver changes?

The interrupt changes (patches 1 to 3) should be fine but let's not
add the otg mode change yet till we have the driver OTG patches in.

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


[PATCH v4 31/46] usb: gadget: s3c2410_udc: add ep capabilities support

2015-07-27 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 v4 28/46] usb: gadget: pxa27x_udc: add ep capabilities support

2015-07-27 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 v4 21/46] usb: gadget: mv_u3d_core: add ep capabilities support

2015-07-27 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 v4 34/46] usb: musb: gadget: add ep capabilities support

2015-07-27 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 v4 36/46] usb: gadget: atmel_usba_udc: add ep capabilities support

2015-07-27 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 v4 35/46] usb: renesas: gadget: add ep capabilities support

2015-07-27 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 494dfe0..de4f97d 100644
--- a/drivers/usb/renesas_usbhs/mod_gadget.c
+++ b/drivers/usb/renesas_usbhs/mod_gadget.c
@@ -1103,12 +1103,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 v4 17/46] usb: gadget: goku_udc: add ep capabilities support

2015-07-27 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 v4 20/46] usb: gadget: m66592-udc: add ep capabilities support

2015-07-27 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 v4 27/46] usb: gadget: pxa25x_udc: add ep capabilities support

2015-07-27 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,
+   

[PATCH v4 29/46] usb: gadget: r8a66597-udc: add ep capabilities support

2015-07-27 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 v4 19/46] usb: gadget: lpc32xx_udc: add ep capabilities support

2015-07-27 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 v4 24/46] usb: gadget: net2280: add ep capabilities support

2015-07-27 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 v4 30/46] usb: gadget: s3c-hsudc: add ep capabilities support

2015-07-27 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 v4 23/46] usb: gadget: net2272: add ep capabilities support

2015-07-27 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 c2ed5da..18f5ebd 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 v4 26/46] usb: gadget: pch_udc: add ep capabilities support

2015-07-27 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 dcf5def..fa9eb3c 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 v4 33/46] usb: isp1760: udc: add ep capabilities support

2015-07-27 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 v4 25/46] usb: gadget: omap_udc: add ep capabilities support

2015-07-27 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


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

2015-07-27 Thread Roger Quadros
On 20/07/15 15:08, Tero Kristo wrote:
 On 07/17/2015 04:47 PM, Roger Quadros wrote:
 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
 ---
   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 8f1e25b..4a0718c 100644
 --- a/arch/arm/boot/dts/dra7.dtsi
 +++ b/arch/arm/boot/dts/dra7.dtsi
 @@ -1140,6 +1140,7 @@
   ctrl-module = omap_control_sata;
   clocks = sys_clkin1, sata_ref_clk;
   clock-names = sysclk, refclk;
 +syscon-pllreset = scm_conf 0x3fc;
   #phy-cells = 0;
   };


 
 Looks fine to me.
 
 Make sure you use this register via regmap_update_bits only, seeing there is 
 another potential user for the same register.

Yes. Patch 1 is the user using regmap_update_bits.

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


[PATCH v4 12/46] usb: gadget: dummy-hcd: add ep capabilities support

2015-07-27 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 v4 09/46] usb: gadget: at91_udc: add ep capabilities support

2015-07-27 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


[PATCH v4 03/46] usb: gadget: add endpoint capabilities helper macros

2015-07-27 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 2e85b86..c71b1de 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 v4 11/46] usb: gadget: bdc: add ep capabilities support

2015-07-27 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


Re: [PATCH v3 10/11] usb: otg: Add dual-role device (DRD) support

2015-07-27 Thread Roger Quadros
On 20/07/15 04:23, Peter Chen wrote:
 On Fri, Jul 17, 2015 at 01:47:12PM +0300, Roger Quadros wrote:
 + * DRD mode hardware Inputs
 + *
 + * @id:   TRUE for B-device, FALSE for A-device.
 + * @vbus: VBUS voltage in regulation.
 + *
   * OTG hardware Inputs
   *
   *Common inputs for A and B device
 @@ -122,7 +127,8 @@ enum otg_fsm_timer {
   */
  struct otg_fsm {
/* Input */
 -  int id;
 +  int id; /* DRD + OTG */
 +  int vbus;   /* DRD only */

 Existing b_sess_vld can be also used for drd only case, no need create
 a new flag.

 b_sess_vld is a bit confusing to people not familiar with OTG.
 My suggestion is to use dedicated 'vbus' flag for DRD case
 for simplicity.

 
 Since OTG DRD is the subset in OTG FSM (FSM, data structure, APIs, etc),
 I agree with Jun to reuse existing variables, and we can add some comments
 for b_sess_vld if needed.

OK then. I'll get rid of vbus and use b_sess_vld.

cheers,
-roger

 
 

int adp_change;
int power_up;
int a_srp_det;

--
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 v4 15/46] usb: gadget: fsl_udc_core: add ep capabilities support

2015-07-27 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 v4 13/46] usb: gadget: fotg210-udc: add ep capabilities support

2015-07-27 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 1137e33..bf6bbee 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 v4 02/46] usb: gadget: add endpoint capabilities flags

2015-07-27 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 9c5e486..2e85b86 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 v4 01/46] usb: gadget: encapsulate endpoint claiming mechanism

2015-07-27 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 because if some function doesn't
set this field autoconfig could return the same endpoint more than one
time.

To help to avoid such bugs this patch adds claimed flag to struct usb_ep,
and  encapsulates endpoint claiming mechanism inside usb_ep_autoconfig_ss()
and usb_ep_autoconfig_reset(), so now usb functions don't need to perform
any additional actions to mark endpoint obtained from autoconfig as claimed.

Signed-off-by: Robert Baldyga r.bald...@samsung.com
---
 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 cea0511..9c5e486 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 v4 05/46] usb: chipidea: udc: add ep capabilities support

2015-07-27 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 b7cca3e..4aaa476 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 v4 18/46] usb: gadget: gr_udc: add ep capabilities support

2015-07-27 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


[PATCH v4 10/46] usb: gadget: bcm63xx_udc: add ep capabilities support

2015-07-27 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 v4 06/46] usb: dwc2: gadget: add ep capabilities support

2015-07-27 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 731b13d..3ee5b4c 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 v4 04/46] staging: emxx_udc: add ep capabilities support

2015-07-27 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 v4 14/46] usb: gadget: fsl_qe_udc: add ep capabilities support

2015-07-27 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


Re: [PATCH v3 3/3] ARM: dts: dra7: Add scm_conf1 node and remove redundant nodes

2015-07-27 Thread Roger Quadros
On 21/07/15 08:11, Kishon Vijay Abraham I wrote:
 Hi,
 
 On Monday 20 July 2015 05:34 PM, Tero Kristo wrote:
 On 07/17/2015 04:47 PM, Roger Quadros wrote:
 scm_conf1 maps the control register address space after the
 padconf till the end.

 Fix the scm_conf and pmx_core resource lengths. We need to add
 4 bytes to include the last 32-bit register space.

 Remove the redundant dra7_ctrl_core and dra7_ctrl_general nodes.
 They are not used by anyone and no longer needed as they are
 covered by scm_conf and scm_conf1.

 Looks like you are doing three things in this patch, maybe split it up 
 as such?


 Signed-off-by: Roger Quadros rog...@ti.com
 ---
   arch/arm/boot/dts/dra7.dtsi | 19 ---
   1 file changed, 8 insertions(+), 11 deletions(-)

 diff --git a/arch/arm/boot/dts/dra7.dtsi b/arch/arm/boot/dts/dra7.dtsi
 index 4a0718c..d07c34c 100644
 --- a/arch/arm/boot/dts/dra7.dtsi
 +++ b/arch/arm/boot/dts/dra7.dtsi
 @@ -141,7 +141,7 @@
 dra7_pmx_core: pinmux@1400 {
 compatible = ti,dra7-padconf,
  pinctrl-single;
 -   reg = 0x1400 0x0464;
 +   reg = 0x1400 0x0468;
 #address-cells = 1;
 #size-cells = 0;
 #interrupt-cells = 1;
 @@ -149,6 +149,13 @@
 pinctrl-single,register-width = 32;
 pinctrl-single,function-mask = 
 0x3fff;
 };
 +
 +   scm_conf1: scm_conf@1 {

 Should be ... scm_conf@1868?

 Are there any users for this area anyway? I don't think we should map 
 this area just for fun of it. Mostly it looks like this contains efuse 
 values for OPPs, which should be mapped from the OPP layer, not as a 
 generic syscon.
 
 The last few registers are used for PCIe PHY and I'll be needing it for the
 next version of my patch series.

OK noted. Will exclude the PCIe registers from this region.

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 v3 3/3] ARM: dts: dra7: Add scm_conf1 node and remove redundant nodes

2015-07-27 Thread Roger Quadros
On 20/07/15 15:04, Tero Kristo wrote:
 On 07/17/2015 04:47 PM, Roger Quadros wrote:
 scm_conf1 maps the control register address space after the
 padconf till the end.

 Fix the scm_conf and pmx_core resource lengths. We need to add
 4 bytes to include the last 32-bit register space.

 Remove the redundant dra7_ctrl_core and dra7_ctrl_general nodes.
 They are not used by anyone and no longer needed as they are
 covered by scm_conf and scm_conf1.
 
 Looks like you are doing three things in this patch, maybe split it up as 
 such?

OK.

 

 Signed-off-by: Roger Quadros rog...@ti.com
 ---
   arch/arm/boot/dts/dra7.dtsi | 19 ---
   1 file changed, 8 insertions(+), 11 deletions(-)

 diff --git a/arch/arm/boot/dts/dra7.dtsi b/arch/arm/boot/dts/dra7.dtsi
 index 4a0718c..d07c34c 100644
 --- a/arch/arm/boot/dts/dra7.dtsi
 +++ b/arch/arm/boot/dts/dra7.dtsi
 @@ -141,7 +141,7 @@
   dra7_pmx_core: pinmux@1400 {
   compatible = ti,dra7-padconf,
pinctrl-single;
 -reg = 0x1400 0x0464;
 +reg = 0x1400 0x0468;
   #address-cells = 1;
   #size-cells = 0;
   #interrupt-cells = 1;
 @@ -149,6 +149,13 @@
   pinctrl-single,register-width = 32;
   pinctrl-single,function-mask = 0x3fff;
   };
 +
 +scm_conf1: scm_conf@1 {
 
 Should be ... scm_conf@1868?

OK.

 
 Are there any users for this area anyway? I don't think we should map this 
 area just for fun of it. Mostly it looks like this contains efuse values for 
 OPPs, which should be mapped from the OPP layer, not as a generic syscon.

OK then, I'll only include the CTRL_CORE_SMA_SW_2..9 registers in this region.


cheers,
-roger

 
 +compatible = syscon;
 +reg = 0x1868 0x03e0;
 +#address-cells = 1;
 +#size-cells = 1;
 +};
   };

   cm_core_aon: cm_core_aon@5000 {
 @@ -286,16 +293,6 @@
   #thermal-sensor-cells = 1;
   };

 -dra7_ctrl_core: ctrl_core@4a002000 {
 -compatible = syscon;
 -reg = 0x4a002000 0x6d0;
 -};
 -
 -dra7_ctrl_general: tisyscon@4a002e00 {
 -compatible = syscon;
 -reg = 0x4a002e00 0x7c;
 -};
 
 I thought I had removed these already and yes... this was done in commit 
 d919501feffa8715147582c3ffce96fad0c7016f already, but seems they were added 
 back in a resolution for a merge conflict later.
 
 -Tero
 
 -
   sdma: dma-controller@4a056000 {
   compatible = ti,omap4430-sdma;
   reg = 0x4a056000 0x1000;

 
--
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: errata 430973: move !ARCH_MULTIPLATFORM to Kconfig

2015-07-27 Thread Ben Dooks
On 27/07/15 02:14, Sebastian Reichel wrote:
 Hi,
 
 On Sun, Jul 26, 2015 at 11:51:45PM +0100, Russell King - ARM Linux 
 wrote:
 On Fri, Jul 24, 2015 at 02:16:06AM +0200, Sebastian Reichel 
 wrote:
 On Thu, Jul 23, 2015 at 01:35:53PM +0100, Russell King - ARM 
 Linux wrote:
 On Thu, Jul 23, 2015 at 02:48:03AM +0200, Sebastian Reichel 
 wrote:
 Having the !ARCH_MULTIPLATFORM dependency in the Kconfig 
 file results in one option less to think about when 
 configuring the kernel.
 
 -#if defined(CONFIG_ARM_ERRATA_430973)  
 !defined(CONFIG_ARCH_MULTIPLATFORM) +#ifdef 
 CONFIG_ARM_ERRATA_430973 teq  r3, #0x0010 @ only 
 present in r1p* mrceq p15, 0, r0, c1, c0, 1   @ read aux 
 control register orreqr0, r0, #(1  6)   @ set IBE to 1
 
 NAK.  Please read the mailing list history, I'm not
 repeating myself again on this.  Thanks.
 
 It's a bit hard to search the mailing list history without a 
 bit more information.
 
 You were Cc'd on the previous round of review...
 
 But that discussion was about removing the check alltogether iirc.
  This patch does not remove the !ARCH_MULTIPLATFORM check. It just
  *moves* it from the sourcecode to the errata's Kconfig entry.
 
 The intention was to hide the Kconfig option on multiplatform 
 kernels, since it's completely useless there after the N900 
 boardcode has been changed (PATCH 1/3).
 
 I guess you prefer to just add the !ARCH_MULTIPLATFORM 
 dependency to the Kconfig entry without removing the
 additional check in the code?
 
 I was referring to the above change.
 
 However, having discussed with Will Deacon and checked the 
 manuals, I think the change is okay after all: the auxillary 
 control register is banked on secure parts, and the bit we'll be 
 trying to change will be read-only in non-secure mode - and 
 importantly won't fault.
 
 So, the change is fine, thanks.
 
 I think you missed the part adding the !ARCH_MULTIPLATFORM 
 dependency in Kconfig for ARM_ERRATA_430973. I only removed the 
 check in the sourcecode, since it is no longer required with the 
 dependency being in Kconfig.
 
 So I guess there are 3 options now:
 
 1. Add !ARCH_MULTIPLATFORM dependency to Kconfig, keep extra check 
 in the sourcecode 2. Add !ARCH_MULTIPLATFORM dependency to Kconfig,
 remove extra check in the sourcecode 3. Remove !ARCH_MULTIPLATFORM
 dependency alltogether
 
 I will send an appropriate patch, if you tell me your preferred 
 option.

This isn't the only place ARM_ERRATA_430973 is used, and if
you make it configurable on !ARCH_MULTIPLATFORM then it makes
it impossible to use a ARCH_MULTIPLATFORM kernel on something
that is an Cortex-A8.

See arch/arm/mm/proc-v7-2level.S

-- 
Ben Dooks   http://www.codethink.co.uk/
Senior Engineer Codethink - Providing Genius
--
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 v4 08/46] usb: gadget: amd5536udc: add ep capabilities support

2015-07-27 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 v4 07/46] usb: dwc3: gadget: add ep capabilities support

2015-07-27 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 d97fcfa..65fd959 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -1715,6 +1715,19 @@ static int dwc3_gadget_init_hw_endpoints(struct dwc3 
*dwc,
return ret;
}
 
+   if (epnum == 0 || epnum == 1) {
+   dep-endpoint.caps.type_control = true;
+   } else {
+   dep-endpoint.caps.type_iso = true;
+   dep-endpoint.caps.type_bulk = true;
+   dep-endpoint.caps.type_int = true;
+   }
+
+   if (direction)
+   dep-endpoint.caps.dir_in = true;
+   else
+   dep-endpoint.caps.dir_out = true;
+
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 v4 32/46] usb: gadget: udc-xilinx: add ep capabilities support

2015-07-27 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 v4 22/46] usb: gadget: mv_udc_core: add ep capabilities support

2015-07-27 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 v4 41/46] usb: gadget: add 'ep_match' callback to usb_gadget_ops

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

If gadget has set 'ep_match' callback we prefer to call it first, and
if it fails to find matching endpoint, then we try to use default matching
algorithm.

Signed-off-by: Robert Baldyga r.bald...@samsung.com
---
 drivers/usb/gadget/epautoconf.c | 6 ++
 include/linux/usb/gadget.h  | 3 +++
 2 files changed, 9 insertions(+)

diff --git a/drivers/usb/gadget/epautoconf.c b/drivers/usb/gadget/epautoconf.c
index 4fa6f5d..1b1fee0 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 ...
 */
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
index c71b1de..6de3688 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 v4 40/46] usb: gadget: epautoconf: rework ep_matches() function

2015-07-27 Thread Robert Baldyga
Rework ep_matches() function to make it shorter and more 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 7bb28f1..4fa6f5d 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 v4 44/46] usb: gadget: net2280: add net2280_match_ep() function

2015-07-27 Thread Robert Baldyga
Add 'match_ep' callback to utilize chip-specific knowledge in endpoint matching
process. Function 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 | 31 +++
 2 files changed, 32 insertions(+), 22 deletions(-)

diff --git a/drivers/usb/gadget/epautoconf.c b/drivers/usb/gadget/epautoconf.c
index cc0b084..d41fd82 100644
--- a/drivers/usb/gadget/epautoconf.c
+++ b/drivers/usb/gadget/epautoconf.c
@@ -86,28 +86,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 = gadget_find_ep_by_name(gadget, ep-e);
-   if (ep  usb_gadget_ep_match_desc(gadget,
-   ep, desc, ep_comp))
-   goto found_ep;
-   ep = gadget_find_ep_by_name(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 = gadget_find_ep_by_name(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 = gadget_find_ep_by_name(gadget, ep3-bulk);
diff --git a/drivers/usb/gadget/udc/net2280.c b/drivers/usb/gadget/udc/net2280.c
index 0295cf7..41e6568 100644
--- a/drivers/usb/gadget/udc/net2280.c
+++ b/drivers/usb/gadget/udc/net2280.c
@@ -1533,6 +1533,36 @@ static int net2280_pullup(struct usb_gadget *_gadget, 
int is_on)
return 0;
 }
 
+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 = gadget_find_ep_by_name(_gadget, ep-e);
+   if (ep  usb_gadget_ep_match_desc(_gadget, ep, desc, ep_comp))
+   return ep;
+   ep = gadget_find_ep_by_name(_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 = gadget_find_ep_by_name(_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 +1574,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 v4 42/46] usb: gadget: move ep_matches() from epautoconf to udc-core

2015-07-27 Thread Robert Baldyga
Move ep_matches() function to udc-core and rename it to
usb_gadget_ep_match_desc(). This function can be used by UDC drivers
in 'match_ep' callback to avoid writing lots of repetitive code.

Replace all calls of ep_matches() with usb_gadget_ep_match_desc().

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

diff --git a/drivers/usb/gadget/epautoconf.c b/drivers/usb/gadget/epautoconf.c
index 1b1fee0..3f0a380 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,
+  

  1   2   >