Re: [PATCH v6 1/3] usb: dwc3: add ST dwc3 glue layer to manage dwc3 HC

2014-09-05 Thread Peter Griffin
Hi Felipe,

On Fri, 05 Sep 2014, Felipe Balbi wrote:
> > > +
> > > + device_for_each_child(&pdev->dev, NULL, st_dwc3_remove_child);
> > 
> > same as before, of_platform_depopulate(). I can fix this one myself this
> > time.

Oh sorry, not sure what happened there, thanks for fixing it up:-)
> 
> it's in my testign/next branch, please make sure it looks alright.

Just checked and it looks good.

regards,

Peter.



--
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 v6 2/3] usb: dwc3: dwc3-st: Add st-dwc3 devicetree bindings documentation

2014-09-05 Thread Peter Griffin
This patch documents the device tree documentation required for
the ST usb3 controller glue layer found in STiH407 devices.

Signed-off-by: Giuseppe Cavallaro 
Signed-off-by: Peter Griffin 
Acked-by: Lee Jones 
---
 Documentation/devicetree/bindings/usb/dwc3-st.txt | 68 +++
 1 file changed, 68 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/usb/dwc3-st.txt

diff --git a/Documentation/devicetree/bindings/usb/dwc3-st.txt 
b/Documentation/devicetree/bindings/usb/dwc3-st.txt
new file mode 100644
index 000..f9d7025
--- /dev/null
+++ b/Documentation/devicetree/bindings/usb/dwc3-st.txt
@@ -0,0 +1,68 @@
+ST DWC3 glue logic
+
+This file documents the parameters for the dwc3-st driver.
+This driver controls the glue logic used to configure the dwc3 core on
+STiH407 based platforms.
+
+Required properties:
+ - compatible  : must be "st,stih407-dwc3"
+ - reg : glue logic base address and USB syscfg ctrl register offset
+ - reg-names   : should be "reg-glue" and "syscfg-reg"
+ - st,syscon   : should be phandle to system configuration node which
+ encompasses the glue registers
+ - resets  : list of phandle and reset specifier pairs. There should be 
two entries, one
+ for the powerdown and softreset lines of the usb3 IP
+ - reset-names : list of reset signal names. Names should be "powerdown" and 
"softreset"
+See: Documentation/devicetree/bindings/reset/st,sti-powerdown.txt
+See: Documentation/devicetree/bindings/reset/reset.txt
+
+ - #address-cells, #size-cells : should be '1' if the device has sub-nodes
+   with 'reg' property
+
+ - pinctl-names: A pinctrl state named "default" must be defined
+See: Documentation/devicetree/bindings/pinctrl/pinctrl-binding.txt
+
+ - pinctrl-0   : Pin control group
+See: Documentation/devicetree/bindings/pinctrl/pinctrl-binding.txt
+
+ - ranges  : allows valid 1:1 translation between child's address space and
+ parent's address space
+
+Sub-nodes:
+The dwc3 core should be added as subnode to ST DWC3 glue as shown in the
+example below. The DT binding details of dwc3 can be found in:
+Documentation/devicetree/bindings/usb/dwc3.txt
+
+NB: The dr_mode property described in [1] is NOT optional for this driver, as 
the default value
+is "otg", which isn't supported by this SoC. Valid dr_mode values for dwc3-st 
are either "host"
+or "device".
+
+[1] Documentation/devicetree/bindings/usb/generic.txt
+
+Example:
+
+st_dwc3: dwc3@8f94000 {
+   status  = "disabled";
+   compatible  = "st,stih407-dwc3";
+   reg = <0x08f94000 0x1000>, <0x110 0x4>;
+   reg-names   = "reg-glue", "syscfg-reg";
+   st,syscfg   = <&syscfg_core>;
+   resets  = <&powerdown STIH407_USB3_POWERDOWN>,
+ <&softreset STIH407_MIPHY2_SOFTRESET>;
+   reset-names = "powerdown",
+ "softreset";
+   #address-cells  = <1>;
+   #size-cells = <1>;
+   pinctrl-names   = "default";
+   pinctrl-0   = <&pinctrl_usb3>;
+   ranges;
+
+   dwc3: dwc3@990 {
+   compatible  = "snps,dwc3";
+   reg = <0x0990 0x10>;
+   interrupts  = ;
+   dr_mode = "host";
+   phys-names  = "usb2-phy", "usb3-phy";
+   phys= <&usb2_picophy2>, <&phy_port2 MIPHY_TYPE_USB>;
+   };
+};
-- 
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 v6 1/3] usb: dwc3: add ST dwc3 glue layer to manage dwc3 HC

2014-09-05 Thread Peter Griffin
This patch adds the ST glue logic to manage the DWC3 HC
on STiH407 SoC family. It manages the powerdown signal,
and configures the internal glue logic and syscfg registers.

Signed-off-by: Giuseppe Cavallaro 
Signed-off-by: Peter Griffin 
Acked-by: Lee Jones 
---
 drivers/usb/dwc3/Kconfig   |   9 ++
 drivers/usb/dwc3/Makefile  |   1 +
 drivers/usb/dwc3/dwc3-st.c | 377 +
 3 files changed, 387 insertions(+)
 create mode 100644 drivers/usb/dwc3/dwc3-st.c

diff --git a/drivers/usb/dwc3/Kconfig b/drivers/usb/dwc3/Kconfig
index 785510a..5238251 100644
--- a/drivers/usb/dwc3/Kconfig
+++ b/drivers/usb/dwc3/Kconfig
@@ -80,6 +80,15 @@ config USB_DWC3_KEYSTONE
  Support of USB2/3 functionality in TI Keystone2 platforms.
  Say 'Y' or 'M' here if you have one such device
 
+config USB_DWC3_ST
+   tristate "STMicroelectronics Platforms"
+   depends on ARCH_STI && OF
+   default USB_DWC3
+   help
+ STMicroelectronics SoCs with one DesignWare Core USB3 IP
+ inside (i.e. STiH407).
+ Say 'Y' or 'M' if you have one such device.
+
 comment "Debugging features"
 
 config USB_DWC3_DEBUG
diff --git a/drivers/usb/dwc3/Makefile b/drivers/usb/dwc3/Makefile
index 10ac3e7..11c9f54 100644
--- a/drivers/usb/dwc3/Makefile
+++ b/drivers/usb/dwc3/Makefile
@@ -33,3 +33,4 @@ obj-$(CONFIG_USB_DWC3_OMAP)   += dwc3-omap.o
 obj-$(CONFIG_USB_DWC3_EXYNOS)  += dwc3-exynos.o
 obj-$(CONFIG_USB_DWC3_PCI) += dwc3-pci.o
 obj-$(CONFIG_USB_DWC3_KEYSTONE)+= dwc3-keystone.o
+obj-$(CONFIG_USB_DWC3_ST)  += dwc3-st.o
diff --git a/drivers/usb/dwc3/dwc3-st.c b/drivers/usb/dwc3/dwc3-st.c
new file mode 100644
index 000..c4c1717
--- /dev/null
+++ b/drivers/usb/dwc3/dwc3-st.c
@@ -0,0 +1,377 @@
+/**
+ * dwc3-st.c Support for dwc3 platform devices on ST Microelectronics platforms
+ *
+ * This is a small driver for the dwc3 to provide the glue logic
+ * to configure the controller. Tested on STi platforms.
+ *
+ * Copyright (C) 2014 Stmicroelectronics
+ *
+ * Author: Giuseppe Cavallaro 
+ * Contributors: Aymen Bouattay 
+ *   Peter Griffin 
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * Inspired by dwc3-omap.c and dwc3-exynos.c.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "core.h"
+#include "io.h"
+
+/* glue registers */
+#define CLKRST_CTRL0x00
+#define AUX_CLK_EN BIT(0)
+#define SW_PIPEW_RESET_N   BIT(4)
+#define EXT_CFG_RESET_NBIT(8)
+/*
+ * 1'b0 : The host controller complies with the xHCI revision 0.96
+ * 1'b1 : The host controller complies with the xHCI revision 1.0
+ */
+#define XHCI_REVISION  BIT(12)
+
+#define USB2_VBUS_MNGMNT_SEL1  0x2C
+/*
+ * For all fields in USB2_VBUS_MNGMNT_SEL1
+ * 2’b00 : Override value from Reg 0x30 is selected
+ * 2’b01 : utmiotg_ from usb3_top is selected
+ * 2’b10 : pipew_ from PIPEW instance is selected
+ * 2’b11 : value is 1'b0
+ */
+#define USB2_VBUS_REG300x0
+#define USB2_VBUS_UTMIOTG  0x1
+#define USB2_VBUS_PIPEW0x2
+#define USB2_VBUS_ZERO 0x3
+
+#define SEL_OVERRIDE_VBUSVALID(n)  (n << 0)
+#define SEL_OVERRIDE_POWERPRESENT(n)   (n << 4)
+#define SEL_OVERRIDE_BVALID(n) (n << 8)
+
+/* Static DRD configuration */
+#define USB3_CONTROL_MASK  0xf77
+
+#define USB3_DEVICE_NOT_HOST   BIT(0)
+#define USB3_FORCE_VBUSVALID   BIT(1)
+#define USB3_DELAY_VBUSVALID   BIT(2)
+#define USB3_SEL_FORCE_OPMODE  BIT(4)
+#define USB3_FORCE_OPMODE(n)   (n << 5)
+#define USB3_SEL_FORCE_DPPULLDOWN2 BIT(8)
+#define USB3_FORCE_DPPULLDOWN2 BIT(9)
+#define USB3_SEL_FORCE_DMPULLDOWN2 BIT(10)
+#define USB3_FORCE_DMPULLDOWN2 BIT(11)
+
+/**
+ * struct st_dwc3 - dwc3-st driver private structure
+ * @dev:   device pointer
+ * @glue_base: ioaddr for the glue registers
+ * @regmap:regmap pointer for getting syscfg
+ * @syscfg_reg_off:usb syscfg control offset
+ * @dr_mode:   drd static host/device config
+ * @rstc_pwrdn:rest controller for powerdown signal
+ * @rstc_rst:  reset controller for softreset signal
+ */
+
+struct st_dwc3 {
+   struct device *dev;
+   void __iomem *glue_base;
+   struct regmap *regmap;
+   int syscfg_reg_off;
+   enum usb_dr_mode dr_mode;
+   struct reset_control *rstc_pwrdn;
+   struct reset_control *rstc_rst;
+};

[PATCH v6 0/3] Add ST dwc3 glue layer driver

2014-09-05 Thread Peter Griffin
This series adds support for the ST glue logic which wraps the DWC3 controller
on STiH407 SoC family chipsets.

Changes since v5
 - Use of_platform_depopulate

Changes since v4
 - Fix bug with setting bits in usb control register
 - Remove superflous '\n'
 - Change default Kconfig to make default same as other platforms
 - Update dt doc example so that both usb2 and usb3 phys are using generic 
drivers/phy instead of drivers/usb/phy
 - Reconfigure ST glue logic regs in resume callback

Changes since v3
 - Various formating nits

Changes since v2
 - Use dr_mode for host/device static configuration
 - Manage shared reset signal to usbss to avoid hang if probing before usb3 phy
 - Remove DT checks and make driver depend on OF
 - Change some #define to use BIT macro
 - Make some comments clearer
 - Use kerneldoc for struct documentation
 - Remove udelay
 - Let DT create platform_devices, and remove legacy alloc
 - Change some logging levels to dev_dbg
 - Various whitespace and formatting cleanup
 - Use SIMPLE_DEV_PM_OPS()
 - Add const to of_device struct
 - Reorder header files alphabetically
 - Use devm_ioremap_resource instead of devm_request_and_ioremap
 - Remove of_match_ptr()

Changes since v1
 - Fix Kconfig mistake

Peter Griffin (3):
  usb: dwc3: add ST dwc3 glue layer to manage dwc3 HC
  usb: dwc3: dwc3-st: Add st-dwc3 devicetree bindings documentation
  MAINTAINERS: Add dwc3-st.c file to ARCH/STI architecture

 Documentation/devicetree/bindings/usb/dwc3-st.txt |  68 
 MAINTAINERS   |   1 +
 drivers/usb/dwc3/Kconfig  |   9 +
 drivers/usb/dwc3/Makefile |   1 +
 drivers/usb/dwc3/dwc3-st.c| 377 ++
 5 files changed, 456 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/usb/dwc3-st.txt
 create mode 100644 drivers/usb/dwc3/dwc3-st.c

-- 
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 v6 3/3] MAINTAINERS: Add dwc3-st.c file to ARCH/STI architecture

2014-09-05 Thread Peter Griffin
This patch adds the new dwc3-st.c glue driver found on
STMicroelectronics stih407 consumer electronics SoC's into the STI
arch section of the maintainers file.

Signed-off-by: Peter Griffin 
Acked-by: Lee Jones 
---
 MAINTAINERS | 1 +
 1 file changed, 1 insertion(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index cf24bb5..55381955 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1398,6 +1398,7 @@ F:drivers/media/rc/st_rc.c
 F: drivers/i2c/busses/i2c-st.c
 F: drivers/tty/serial/st-asc.c
 F: drivers/mmc/host/sdhci-st.c
+F: drivers/usb/dwc3/dwc3-st.c
 
 ARM/TECHNOLOGIC SYSTEMS TS7250 MACHINE SUPPORT
 M: Lennert Buytenhek 
-- 
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 v5 0/3] Add ST dwc3 glue layer driver

2014-09-02 Thread Peter Griffin
This series adds support for the ST glue logic which wraps the DWC3 controller
on STiH407 SoC family chipsets.

Changes since v4
 - Fix bug with setting bits in usb control register
 - Remove superflous '\n'
 - Change default Kconfig to make default same as other platforms
 - Update dt doc example so that both usb2 and usb3 phys are using generic 
drivers/phy instead of drivers/usb/phy
 - Reconfigure ST glue logic regs in resume callback

Changes since v3
 - Various formating nits

Changes since v2
 - Use dr_mode for host/device static configuration
 - Manage shared reset signal to usbss to avoid hang if probing before usb3 phy
 - Remove DT checks and make driver depend on OF
 - Change some #define to use BIT macro
 - Make some comments clearer
 - Use kerneldoc for struct documentation
 - Remove udelay
 - Let DT create platform_devices, and remove legacy alloc
 - Change some logging levels to dev_dbg
 - Various whitespace and formatting cleanup
 - Use SIMPLE_DEV_PM_OPS()
 - Add const to of_device struct
 - Reorder header files alphabetically
 - Use devm_ioremap_resource instead of devm_request_and_ioremap
 - Remove of_match_ptr()

Changes since v1
 - Fix Kconfig mistake

Peter Griffin (3):
  usb: dwc3: add ST dwc3 glue layer to manage dwc3 HC
  usb: dwc3: dwc3-st: Add st-dwc3 devicetree bindings documentation
  MAINTAINERS: Add dwc3-st.c file to ARCH/STI architecture

 Documentation/devicetree/bindings/usb/dwc3-st.txt |  68 
 MAINTAINERS   |   1 +
 drivers/usb/dwc3/Kconfig  |   9 +
 drivers/usb/dwc3/Makefile |   1 +
 drivers/usb/dwc3/dwc3-st.c| 377 ++
 5 files changed, 456 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/usb/dwc3-st.txt
 create mode 100644 drivers/usb/dwc3/dwc3-st.c

-- 
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 v5 2/3] usb: dwc3: dwc3-st: Add st-dwc3 devicetree bindings documentation

2014-09-02 Thread Peter Griffin
This patch documents the device tree documentation required for
the ST usb3 controller glue layer found in STiH407 devices.

Signed-off-by: Giuseppe Cavallaro 
Signed-off-by: Peter Griffin 
Acked-by: Lee Jones 
---
 Documentation/devicetree/bindings/usb/dwc3-st.txt | 68 +++
 1 file changed, 68 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/usb/dwc3-st.txt

diff --git a/Documentation/devicetree/bindings/usb/dwc3-st.txt 
b/Documentation/devicetree/bindings/usb/dwc3-st.txt
new file mode 100644
index 000..f9d7025
--- /dev/null
+++ b/Documentation/devicetree/bindings/usb/dwc3-st.txt
@@ -0,0 +1,68 @@
+ST DWC3 glue logic
+
+This file documents the parameters for the dwc3-st driver.
+This driver controls the glue logic used to configure the dwc3 core on
+STiH407 based platforms.
+
+Required properties:
+ - compatible  : must be "st,stih407-dwc3"
+ - reg : glue logic base address and USB syscfg ctrl register offset
+ - reg-names   : should be "reg-glue" and "syscfg-reg"
+ - st,syscon   : should be phandle to system configuration node which
+ encompasses the glue registers
+ - resets  : list of phandle and reset specifier pairs. There should be 
two entries, one
+ for the powerdown and softreset lines of the usb3 IP
+ - reset-names : list of reset signal names. Names should be "powerdown" and 
"softreset"
+See: Documentation/devicetree/bindings/reset/st,sti-powerdown.txt
+See: Documentation/devicetree/bindings/reset/reset.txt
+
+ - #address-cells, #size-cells : should be '1' if the device has sub-nodes
+   with 'reg' property
+
+ - pinctl-names: A pinctrl state named "default" must be defined
+See: Documentation/devicetree/bindings/pinctrl/pinctrl-binding.txt
+
+ - pinctrl-0   : Pin control group
+See: Documentation/devicetree/bindings/pinctrl/pinctrl-binding.txt
+
+ - ranges  : allows valid 1:1 translation between child's address space and
+ parent's address space
+
+Sub-nodes:
+The dwc3 core should be added as subnode to ST DWC3 glue as shown in the
+example below. The DT binding details of dwc3 can be found in:
+Documentation/devicetree/bindings/usb/dwc3.txt
+
+NB: The dr_mode property described in [1] is NOT optional for this driver, as 
the default value
+is "otg", which isn't supported by this SoC. Valid dr_mode values for dwc3-st 
are either "host"
+or "device".
+
+[1] Documentation/devicetree/bindings/usb/generic.txt
+
+Example:
+
+st_dwc3: dwc3@8f94000 {
+   status  = "disabled";
+   compatible  = "st,stih407-dwc3";
+   reg = <0x08f94000 0x1000>, <0x110 0x4>;
+   reg-names   = "reg-glue", "syscfg-reg";
+   st,syscfg   = <&syscfg_core>;
+   resets  = <&powerdown STIH407_USB3_POWERDOWN>,
+ <&softreset STIH407_MIPHY2_SOFTRESET>;
+   reset-names = "powerdown",
+ "softreset";
+   #address-cells  = <1>;
+   #size-cells = <1>;
+   pinctrl-names   = "default";
+   pinctrl-0   = <&pinctrl_usb3>;
+   ranges;
+
+   dwc3: dwc3@990 {
+   compatible  = "snps,dwc3";
+   reg = <0x0990 0x10>;
+   interrupts  = ;
+   dr_mode = "host";
+   phys-names  = "usb2-phy", "usb3-phy";
+   phys= <&usb2_picophy2>, <&phy_port2 MIPHY_TYPE_USB>;
+   };
+};
-- 
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 v5 1/3] usb: dwc3: add ST dwc3 glue layer to manage dwc3 HC

2014-09-02 Thread Peter Griffin
This patch adds the ST glue logic to manage the DWC3 HC
on STiH407 SoC family. It manages the powerdown signal,
and configures the internal glue logic and syscfg registers.

Signed-off-by: Giuseppe Cavallaro 
Signed-off-by: Peter Griffin 
Acked-by: Lee Jones 
---
 drivers/usb/dwc3/Kconfig   |   9 ++
 drivers/usb/dwc3/Makefile  |   1 +
 drivers/usb/dwc3/dwc3-st.c | 377 +
 3 files changed, 387 insertions(+)
 create mode 100644 drivers/usb/dwc3/dwc3-st.c

diff --git a/drivers/usb/dwc3/Kconfig b/drivers/usb/dwc3/Kconfig
index 785510a..5238251 100644
--- a/drivers/usb/dwc3/Kconfig
+++ b/drivers/usb/dwc3/Kconfig
@@ -80,6 +80,15 @@ config USB_DWC3_KEYSTONE
  Support of USB2/3 functionality in TI Keystone2 platforms.
  Say 'Y' or 'M' here if you have one such device
 
+config USB_DWC3_ST
+   tristate "STMicroelectronics Platforms"
+   depends on ARCH_STI && OF
+   default USB_DWC3
+   help
+ STMicroelectronics SoCs with one DesignWare Core USB3 IP
+ inside (i.e. STiH407).
+ Say 'Y' or 'M' if you have one such device.
+
 comment "Debugging features"
 
 config USB_DWC3_DEBUG
diff --git a/drivers/usb/dwc3/Makefile b/drivers/usb/dwc3/Makefile
index 10ac3e7..11c9f54 100644
--- a/drivers/usb/dwc3/Makefile
+++ b/drivers/usb/dwc3/Makefile
@@ -33,3 +33,4 @@ obj-$(CONFIG_USB_DWC3_OMAP)   += dwc3-omap.o
 obj-$(CONFIG_USB_DWC3_EXYNOS)  += dwc3-exynos.o
 obj-$(CONFIG_USB_DWC3_PCI) += dwc3-pci.o
 obj-$(CONFIG_USB_DWC3_KEYSTONE)+= dwc3-keystone.o
+obj-$(CONFIG_USB_DWC3_ST)  += dwc3-st.o
diff --git a/drivers/usb/dwc3/dwc3-st.c b/drivers/usb/dwc3/dwc3-st.c
new file mode 100644
index 000..c4c1717
--- /dev/null
+++ b/drivers/usb/dwc3/dwc3-st.c
@@ -0,0 +1,377 @@
+/**
+ * dwc3-st.c Support for dwc3 platform devices on ST Microelectronics platforms
+ *
+ * This is a small driver for the dwc3 to provide the glue logic
+ * to configure the controller. Tested on STi platforms.
+ *
+ * Copyright (C) 2014 Stmicroelectronics
+ *
+ * Author: Giuseppe Cavallaro 
+ * Contributors: Aymen Bouattay 
+ *   Peter Griffin 
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * Inspired by dwc3-omap.c and dwc3-exynos.c.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "core.h"
+#include "io.h"
+
+/* glue registers */
+#define CLKRST_CTRL0x00
+#define AUX_CLK_EN BIT(0)
+#define SW_PIPEW_RESET_N   BIT(4)
+#define EXT_CFG_RESET_NBIT(8)
+/*
+ * 1'b0 : The host controller complies with the xHCI revision 0.96
+ * 1'b1 : The host controller complies with the xHCI revision 1.0
+ */
+#define XHCI_REVISION  BIT(12)
+
+#define USB2_VBUS_MNGMNT_SEL1  0x2C
+/*
+ * For all fields in USB2_VBUS_MNGMNT_SEL1
+ * 2’b00 : Override value from Reg 0x30 is selected
+ * 2’b01 : utmiotg_ from usb3_top is selected
+ * 2’b10 : pipew_ from PIPEW instance is selected
+ * 2’b11 : value is 1'b0
+ */
+#define USB2_VBUS_REG300x0
+#define USB2_VBUS_UTMIOTG  0x1
+#define USB2_VBUS_PIPEW0x2
+#define USB2_VBUS_ZERO 0x3
+
+#define SEL_OVERRIDE_VBUSVALID(n)  (n << 0)
+#define SEL_OVERRIDE_POWERPRESENT(n)   (n << 4)
+#define SEL_OVERRIDE_BVALID(n) (n << 8)
+
+/* Static DRD configuration */
+#define USB3_CONTROL_MASK  0xf77
+
+#define USB3_DEVICE_NOT_HOST   BIT(0)
+#define USB3_FORCE_VBUSVALID   BIT(1)
+#define USB3_DELAY_VBUSVALID   BIT(2)
+#define USB3_SEL_FORCE_OPMODE  BIT(4)
+#define USB3_FORCE_OPMODE(n)   (n << 5)
+#define USB3_SEL_FORCE_DPPULLDOWN2 BIT(8)
+#define USB3_FORCE_DPPULLDOWN2 BIT(9)
+#define USB3_SEL_FORCE_DMPULLDOWN2 BIT(10)
+#define USB3_FORCE_DMPULLDOWN2 BIT(11)
+
+/**
+ * struct st_dwc3 - dwc3-st driver private structure
+ * @dev:   device pointer
+ * @glue_base: ioaddr for the glue registers
+ * @regmap:regmap pointer for getting syscfg
+ * @syscfg_reg_off:usb syscfg control offset
+ * @dr_mode:   drd static host/device config
+ * @rstc_pwrdn:rest controller for powerdown signal
+ * @rstc_rst:  reset controller for softreset signal
+ */
+
+struct st_dwc3 {
+   struct device *dev;
+   void __iomem *glue_base;
+   struct regmap *regmap;
+   int syscfg_reg_off;
+   enum usb_dr_mode dr_mode;
+   struct reset_control *rstc_pwrdn;
+   struct reset_control *rstc_rst;
+};

[PATCH v5 3/3] MAINTAINERS: Add dwc3-st.c file to ARCH/STI architecture

2014-09-02 Thread Peter Griffin
This patch adds the new dwc3-st.c glue driver found on
STMicroelectronics stih407 consumer electronics SoC's into the STI
arch section of the maintainers file.

Signed-off-by: Peter Griffin 
Acked-by: Lee Jones 
---
 MAINTAINERS | 1 +
 1 file changed, 1 insertion(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index cf24bb5..55381955 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1398,6 +1398,7 @@ F:drivers/media/rc/st_rc.c
 F: drivers/i2c/busses/i2c-st.c
 F: drivers/tty/serial/st-asc.c
 F: drivers/mmc/host/sdhci-st.c
+F: drivers/usb/dwc3/dwc3-st.c
 
 ARM/TECHNOLOGIC SYSTEMS TS7250 MACHINE SUPPORT
 M: Lennert Buytenhek 
-- 
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 v4 1/3] usb: dwc3: add ST dwc3 glue layer to manage dwc3 HC

2014-09-02 Thread Peter Griffin
Hi Felipe,

Sorry for the delay in replying to this mail, I've been trying to get answers 
to the suspend/resume
questions you had.

> > +config USB_DWC3_ST
> > +   tristate "STMicroelectronics Platforms"
> > +   depends on ARCH_STI && OF
> > +   default USB_DWC3_HOST
> 
> this seems wrong as USB_DWC3_{HOST,GADGET,DUAL_ROLE} are booleans and
> USB_DWC3_ST is a tristate. Better to stick with defaulting to USB_DWC3
> instead like all the others.

Ok will fix.

> > +static inline void st_dwc3_writel(void __iomem *base, u32 offset, u32 
> > value)
> > +{
> > +   writel_relaxed(value, base + offset);
> 
> why relaxed ?

The writel and readl implementations on ARM are quite expensive.

The writel, does a memory barrier, and also a outer_sync(), which involves 
taking a spinlock, and draining the cache store buffers.
The readl also does a memory barrier.

These barriers / cache operations are unnecessary here as the peripheral memory 
has been ioremap'ed as device memory, and
it is only one device we are writing to, so the writel/readl_relaxed variants 
are good enough as the ARM arch guarentees they
will arrive in program order.

There is some more info about this here 
http://permalink.gmane.org/gmane.linux.ports.arm.kernel/117658

Note: It's only possible when we know the driver is not being used on other 
architectures which may have different constraints.
However for this driver, we know this IP (st glue logic) has only been used on 
ARM based SoC's.

> 
> > +}
> > +
> > +/**
> > + * st_dwc3_drd_init: program the port
> > + * @dwc3_data: driver private structure
> > + * Description: this function is to program the port as either host or 
> > device
> > + * according to the static configuration passed from devicetree.
> > + * OTG and dual role are not yet supported!
> > + */
> > +static int st_dwc3_drd_init(struct st_dwc3 *dwc3_data)
> > +{
> > +   u32 val;
> > +   int err;
> > +
> > +   err = regmap_read(dwc3_data->regmap, dwc3_data->syscfg_reg_off, &val);
> > +   if (err)
> > +   return err;
> > +
> > +   switch (dwc3_data->dr_mode) {
> > +   case USB_DR_MODE_PERIPHERAL:
> > +   val |= USB_SET_PORT_DEVICE;
> > +   dev_dbg(dwc3_data->dev, "Configuring as Device\n");
> > +   break;
> > +
> > +   case USB_DR_MODE_HOST:
> > +   val &= USB_HOST_DEFAULT_MASK;
> 
> are you missing a ~ here ? Also, shouldn't you mask off the bits before
> this switch ?

Yes your right, good spot! In the next iteration I've defined macros for the 
bits in
this control register and explitcitly set/clear them for both cases, also 
adding a comment regarding
the USB3_DELAY_VBUSVALID bit.

By chance host mode still worked with this bug present as the reset value of 
the register on 
this SoC is OK to have working host mode.

> 
> > +   dev_dbg(dwc3_data->dev, "Configuring as Host\n");
> > +   break;
> > +
> > +   default:
> > +   dev_err(dwc3_data->dev, "Unsupported mode of operation %d\n",
> > +   dwc3_data->dr_mode);
> > +   return -EINVAL;
> > +   }
> > +
> > +   return regmap_write(dwc3_data->regmap, dwc3_data->syscfg_reg_off, val);
> > +}
> > +
> > +/**
> > + * st_dwc3_init: init the controller via glue logic
> > + * @dwc3_data: driver private structure
> > + */
> > +static void st_dwc3_init(struct st_dwc3 *dwc3_data)
> > +{
> > +
> 
> this blank line isn't necessary.

Ok, removed in next iteration



> > +
> > +   res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "syscfg-reg");
> > +   if (!res) {
> > +   ret = -ENXIO;
> > +   goto undo_platform_dev_alloc;
> > +   }
> > +
> > +   dwc3_data->syscfg_reg_off = res->start;
> > +
> > +   dev_dbg(&pdev->dev, "glue-logic addr 0x%p, syscfg-reg offset 0x%x\n",
> > +   dwc3_data->glue_base, dwc3_data->syscfg_reg_off);
> 
> looks like this message would be more of a dev_vdbg().

Ok, changed to dev_vdbg in next iteration



> > +
> > +#ifdef CONFIG_PM_SLEEP
> > +static int st_dwc3_suspend(struct device *dev)
> > +{
> > +   struct st_dwc3 *dwc3_data = dev_get_drvdata(dev);
> > +
> > +   reset_control_assert(dwc3_data->rstc_pwrdn);
> > +   reset_control_assert(dwc3_data->rstc_rst);
> 
> Two questions:
> 
> 1) how would you handle the case when this device is a wakeup source ?

I've confirmed with ST the usb3 IP can't be a wakeup source on this SoC.

> 2) when resuming, wouldn't you have to reinitialize the entire core ?

I asked ST to test this, as a full working suspend / resume setup involves some 
firmware for the
standby controller which I don't currently have access to (and it is only with 
the SBC running that all
power will be removed from this part of the SoC). They have confirmed that the 
usb3 port works after a suspend / resume
and devices are correctly enumerated etc after a resume with the code as it was 
submitted.

What I did notice though after re-reading it, is that we are not re-configuring 
the ST glue logic registers
on a resume. So the controller could end 

Re: [PATCH v4 2/3] usb: dwc3: dwc3-st: Add st-dwc3 devicetree bindings documentation

2014-08-21 Thread Peter Griffin
Hi Felipe,

On Thu, 21 Aug 2014, Felipe Balbi wrote:

> > Currently (in the vendor tree) one of the phys lives in
> > drivers/usb/phy and the other in drivers/phy.
> > I believe that is because one is only a usb phy and the other is a
> > multi function phy which can drive PCI-E or USB3.
> 
> right, but for mainline, we can have both PHYs in drivers/phy only.

Ah ok, I didn't know that, so thanks for that info.
> 
> > So to make that work, when dwc3/core.c gets the PHYS in
> > dwc3_core_get_phy() we need to use the different bindings.
> > 
> > I think we are the only platform using "one of each", but luckily
> > dwc3_core_get_phy() has been written generically enough that it "just
> > works" :-).
> 
> true, but I want to drop support for the legacy drivers/usb/phy layer
> from dwc3. I'll try to move all PHYs to drivers/phy for v3.18.

Ok, so for the next re-spin I will change this to just use the generic phy 
binding
for both usb2 & usb3 phys.

In parallel I will also migrate over the drivers/usb/phy driver to be just a 
generic phy
before I attempt to upstream it.

regards,

Peter



--
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 v4 2/3] usb: dwc3: dwc3-st: Add st-dwc3 devicetree bindings documentation

2014-08-21 Thread Peter Griffin
Hi Felipe,

Thanks for reviewing, see my comments below: -

On Wed, 20 Aug 2014, Felipe Balbi wrote:

> > +   dwc3: dwc3@990 {
> > +   compatible  = "snps,dwc3";
> > +   reg = <0x0990 0x10>;
> > +   interrupts  = ;
> > +   dr_mode = "host"
> > +   usb-phy = <&usb3_phy>;
> > +   phy-names   = "usb2-phy";
> > +   phys= <&usb2_picophy2>;
> 
> why are you using different binding for usb2 and usb3 phys ? Why can't
> you just:
> 
>   phys-names  = "usb2-phy", "usb3-phy";
>   phys= <&usb2_picophy2>, <&usb3_phy>;
> 
> ??

Currently (in the vendor tree) one of the phys lives in drivers/usb/phy and the 
other in drivers/phy.
I believe that is because one is only a usb phy and the other is a multi 
function phy which can drive
PCI-E or USB3.

So to make that work, when dwc3/core.c gets the PHYS in dwc3_core_get_phy() we 
need to use the different
bindings.

I think we are the only platform using "one of each", but luckily 
dwc3_core_get_phy()
has been written generically enough that it "just works" :-).

regards,

Peter.
--
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 v4 3/3] MAINTAINERS: Add dwc3-st.c file to ARCH/STI architecture

2014-08-21 Thread Peter Griffin
Hi Felipe,

Will fix the commit log and rebase onto 3.17-rc1 for the next iteration.

regards,

Peter.


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


Re: [PATCH 1/5] mmc: remove .owner field for drivers using module_platform_driver

2014-08-21 Thread Peter Griffin
Hi Michal,

On Mon, 18 Aug 2014, Michal Simek wrote:

> I have checked this for all xilinx drivers we have in the tree
> and I have sent similar patches.
> This problem is probably in all subsystems.

Yep

> With communication with Mark Brown. Don't you have
> cocinelle script for fixing this everywhere?

Nope. Never really looked at cocinelle until now, but it looks like
a useful tool for these sort of mass updates.

regards,

Peter.


--
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/5] mmc: dw_mmc-pci: Remove superflous #else condition on CONFIG_PM_SLEEP

2014-08-12 Thread Peter Griffin
As the code is using SIMPLE_DEV_PM_OPS helper, this compiles away to
nothing if CONFIG_PM_SLEEP is disabled. Thus we don't need to #define
the suspend/resume callbacks to NULL.

Signed-off-by: Peter Griffin 
---
 drivers/mmc/host/dw_mmc-pci.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/mmc/host/dw_mmc-pci.c b/drivers/mmc/host/dw_mmc-pci.c
index f70546a..5523b84 100644
--- a/drivers/mmc/host/dw_mmc-pci.c
+++ b/drivers/mmc/host/dw_mmc-pci.c
@@ -95,9 +95,6 @@ static int dw_mci_pci_resume(struct device *dev)
 
return dw_mci_resume(host);
 }
-#else
-#define dw_mci_pci_suspend NULL
-#define dw_mci_pci_resume  NULL
 #endif /* CONFIG_PM_SLEEP */
 
 static SIMPLE_DEV_PM_OPS(dw_mci_pci_pmops, dw_mci_pci_suspend, 
dw_mci_pci_resume);
-- 
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 1/5] mmc: remove .owner field for drivers using module_platform_driver

2014-08-12 Thread Peter Griffin
This patch removes the superflous .owner field for drivers which
use the module_platform_driver API, as this is overriden in
platform_driver_register anyway.

Signed-off-by: Peter Griffin 
---
 drivers/mmc/host/jz4740_mmc.c  | 1 -
 drivers/mmc/host/moxart-mmc.c  | 1 -
 drivers/mmc/host/mxcmmc.c  | 1 -
 drivers/mmc/host/mxs-mmc.c | 1 -
 drivers/mmc/host/omap.c| 1 -
 drivers/mmc/host/omap_hsmmc.c  | 1 -
 drivers/mmc/host/pxamci.c  | 1 -
 drivers/mmc/host/rtsx_pci_sdmmc.c  | 1 -
 drivers/mmc/host/rtsx_usb_sdmmc.c  | 1 -
 drivers/mmc/host/s3cmci.c  | 1 -
 drivers/mmc/host/sdhci-bcm-kona.c  | 1 -
 drivers/mmc/host/sdhci-bcm2835.c   | 1 -
 drivers/mmc/host/sdhci-cns3xxx.c   | 1 -
 drivers/mmc/host/sdhci-dove.c  | 1 -
 drivers/mmc/host/sdhci-esdhc-imx.c | 1 -
 drivers/mmc/host/sdhci-msm.c   | 1 -
 drivers/mmc/host/sdhci-of-arasan.c | 1 -
 drivers/mmc/host/sdhci-of-esdhc.c  | 1 -
 drivers/mmc/host/sdhci-of-hlwd.c   | 1 -
 drivers/mmc/host/sdhci-pxav2.c | 1 -
 drivers/mmc/host/sdhci-pxav3.c | 1 -
 drivers/mmc/host/sdhci-s3c.c   | 1 -
 drivers/mmc/host/sdhci-sirf.c  | 1 -
 drivers/mmc/host/sdhci-spear.c | 1 -
 drivers/mmc/host/sdhci-tegra.c | 1 -
 drivers/mmc/host/sh_mmcif.c| 1 -
 drivers/mmc/host/sh_mobile_sdhi.c  | 1 -
 drivers/mmc/host/sunxi-mmc.c   | 1 -
 28 files changed, 28 deletions(-)

diff --git a/drivers/mmc/host/jz4740_mmc.c b/drivers/mmc/host/jz4740_mmc.c
index 537d6c7..e89b37d 100644
--- a/drivers/mmc/host/jz4740_mmc.c
+++ b/drivers/mmc/host/jz4740_mmc.c
@@ -909,7 +909,6 @@ static struct platform_driver jz4740_mmc_driver = {
.remove = jz4740_mmc_remove,
.driver = {
.name = "jz4740-mmc",
-   .owner = THIS_MODULE,
.pm = JZ4740_MMC_PM_OPS,
},
 };
diff --git a/drivers/mmc/host/moxart-mmc.c b/drivers/mmc/host/moxart-mmc.c
index 74924a0..e9f909e 100644
--- a/drivers/mmc/host/moxart-mmc.c
+++ b/drivers/mmc/host/moxart-mmc.c
@@ -718,7 +718,6 @@ static struct platform_driver moxart_mmc_driver = {
.remove = moxart_remove,
.driver = {
.name   = "mmc-moxart",
-   .owner  = THIS_MODULE,
.of_match_table = moxart_mmc_match,
},
 };
diff --git a/drivers/mmc/host/mxcmmc.c b/drivers/mmc/host/mxcmmc.c
index ed1cb93..ad11142 100644
--- a/drivers/mmc/host/mxcmmc.c
+++ b/drivers/mmc/host/mxcmmc.c
@@ -1238,7 +1238,6 @@ static struct platform_driver mxcmci_driver = {
.id_table   = mxcmci_devtype,
.driver = {
.name   = DRIVER_NAME,
-   .owner  = THIS_MODULE,
.pm = &mxcmci_pm_ops,
.of_match_table = mxcmci_of_match,
}
diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c
index babfea0..d7db40b 100644
--- a/drivers/mmc/host/mxs-mmc.c
+++ b/drivers/mmc/host/mxs-mmc.c
@@ -734,7 +734,6 @@ static struct platform_driver mxs_mmc_driver = {
.id_table   = mxs_ssp_ids,
.driver = {
.name   = DRIVER_NAME,
-   .owner  = THIS_MODULE,
 #ifdef CONFIG_PM
.pm = &mxs_mmc_pm_ops,
 #endif
diff --git a/drivers/mmc/host/omap.c b/drivers/mmc/host/omap.c
index 81974ec..68dd6c7 100644
--- a/drivers/mmc/host/omap.c
+++ b/drivers/mmc/host/omap.c
@@ -1494,7 +1494,6 @@ static struct platform_driver mmc_omap_driver = {
.remove = mmc_omap_remove,
.driver = {
.name   = DRIVER_NAME,
-   .owner  = THIS_MODULE,
.of_match_table = of_match_ptr(mmc_omap_match),
},
 };
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 6b7b755..3508121 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -2248,7 +2248,6 @@ static struct platform_driver omap_hsmmc_driver = {
.remove = omap_hsmmc_remove,
.driver = {
.name = DRIVER_NAME,
-   .owner = THIS_MODULE,
.pm = &omap_hsmmc_dev_pm_ops,
.of_match_table = of_match_ptr(omap_mmc_of_match),
},
diff --git a/drivers/mmc/host/pxamci.c b/drivers/mmc/host/pxamci.c
index 32fe113..0971a23 100644
--- a/drivers/mmc/host/pxamci.c
+++ b/drivers/mmc/host/pxamci.c
@@ -885,7 +885,6 @@ static struct platform_driver pxamci_driver = {
.remove = pxamci_remove,
.driver = {
.name   = DRIVER_NAME,
-   .owner  = THIS_MODULE,
.of_match_table = of_match_ptr(pxa_mmc_dt_ids),
},
 };
diff --git a/drivers/mmc/host/rtsx_pci_sdmmc.c 
b/drivers/mmc/host/rtsx_pci_sdmmc.c
index 0d51964..6b21982 100644
--- a/drivers/mmc/host/rtsx_pci_sdmmc.c
+++ b/drivers/mmc/host/rtsx_pci_sdmmc.c
@@ -1295,7 +1295,6 @@ static struct platform_driver rtsx_pci_

[PATCH 4/5] mmc: sdhci-pci: Use SET_RUNTIME_PM_OPS macro to set runtime pm callbacks

2014-08-12 Thread Peter Griffin
This allows us to get rid of the #else condition, as the macro compiles
away to nothing if not enabled.

Signed-off-by: Peter Griffin 
---
 drivers/mmc/host/sdhci-pci.c | 11 ++-
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/drivers/mmc/host/sdhci-pci.c b/drivers/mmc/host/sdhci-pci.c
index 52c42fc..745629d 100644
--- a/drivers/mmc/host/sdhci-pci.c
+++ b/drivers/mmc/host/sdhci-pci.c
@@ -1267,20 +1267,13 @@ static int sdhci_pci_runtime_idle(struct device *dev)
return 0;
 }
 
-#else
-
-#define sdhci_pci_runtime_suspend  NULL
-#define sdhci_pci_runtime_resume   NULL
-#define sdhci_pci_runtime_idle NULL
-
 #endif
 
 static const struct dev_pm_ops sdhci_pci_pm_ops = {
.suspend = sdhci_pci_suspend,
.resume = sdhci_pci_resume,
-   .runtime_suspend = sdhci_pci_runtime_suspend,
-   .runtime_resume = sdhci_pci_runtime_resume,
-   .runtime_idle = sdhci_pci_runtime_idle,
+   SET_RUNTIME_PM_OPS(sdhci_pci_runtime_suspend,
+   sdhci_pci_runtime_resume, sdhci_pci_runtime_idle)
 };
 
 /*\
-- 
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 3/5] mmc: dw_mmc-pltfm: Remove superflous #else condition on CONFIG_PM_SLEEP

2014-08-12 Thread Peter Griffin
As the code is using SIMPLE_DEV_PM_OPS helper, this compiles away to
nothing if CONFIG_PM_SLEEP is disabled. Thus we don't need to #define
the suspend/resume callbacks to NULL.

Signed-off-by: Peter Griffin 
---
 drivers/mmc/host/dw_mmc-pltfm.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/mmc/host/dw_mmc-pltfm.c b/drivers/mmc/host/dw_mmc-pltfm.c
index d4a47a9..fbcb5a3 100644
--- a/drivers/mmc/host/dw_mmc-pltfm.c
+++ b/drivers/mmc/host/dw_mmc-pltfm.c
@@ -84,9 +84,6 @@ static int dw_mci_pltfm_resume(struct device *dev)
 
return dw_mci_resume(host);
 }
-#else
-#define dw_mci_pltfm_suspend   NULL
-#define dw_mci_pltfm_resumeNULL
 #endif /* CONFIG_PM_SLEEP */
 
 SIMPLE_DEV_PM_OPS(dw_mci_pltfm_pmops, dw_mci_pltfm_suspend, 
dw_mci_pltfm_resume);
-- 
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 5/5] mmc: sdhci-acpi.c: Use SET_RUNTIME_PM_OPS macro to set runtime pm callbacks

2014-08-12 Thread Peter Griffin
This allows us to get rid of the #else condition, as the macro compiles
away to nothing if not enabled.

Signed-off-by: Peter Griffin 
---
 drivers/mmc/host/sdhci-acpi.c | 11 ++-
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c
index 8ce3c28..3a42540 100644
--- a/drivers/mmc/host/sdhci-acpi.c
+++ b/drivers/mmc/host/sdhci-acpi.c
@@ -383,20 +383,13 @@ static int sdhci_acpi_runtime_idle(struct device *dev)
return 0;
 }
 
-#else
-
-#define sdhci_acpi_runtime_suspend NULL
-#define sdhci_acpi_runtime_resume  NULL
-#define sdhci_acpi_runtime_idleNULL
-
 #endif
 
 static const struct dev_pm_ops sdhci_acpi_pm_ops = {
.suspend= sdhci_acpi_suspend,
.resume = sdhci_acpi_resume,
-   .runtime_suspend= sdhci_acpi_runtime_suspend,
-   .runtime_resume = sdhci_acpi_runtime_resume,
-   .runtime_idle   = sdhci_acpi_runtime_idle,
+   SET_RUNTIME_PM_OPS(sdhci_acpi_runtime_suspend,
+   sdhci_acpi_runtime_resume, sdhci_acpi_runtime_idle)
 };
 
 static struct platform_driver sdhci_acpi_driver = {
-- 
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 0/5] MMC cleanup of dev_pm_ops and .owner

2014-08-12 Thread Peter Griffin
This series cleans up a few platform drivers in how they are declaring there
dev_pm_ops structs, and gets rid of a few now redundant #else conditions.

Also it removes the .owner field of drivers which use module_platform_driver
api to register themselves, as this field gets overwritten.

Peter Griffin (5):
  mmc: remove .owner field for drivers using module_platform_driver
  mmc: dw_mmc-pci: Remove superflous #else condition on CONFIG_PM_SLEEP
  mmc: dw_mmc-pltfm: Remove superflous #else condition on
CONFIG_PM_SLEEP
  mmc: sdhci-pci: Use SET_RUNTIME_PM_OPS macro to set runtime pm
callbacks
  mmc: sdhci-acpi.c: Use SET_RUNTIME_PM_OPS macro to set runtime pm
callbacks

 drivers/mmc/host/dw_mmc-pci.c  |  3 ---
 drivers/mmc/host/dw_mmc-pltfm.c|  3 ---
 drivers/mmc/host/jz4740_mmc.c  |  1 -
 drivers/mmc/host/moxart-mmc.c  |  1 -
 drivers/mmc/host/mxcmmc.c  |  1 -
 drivers/mmc/host/mxs-mmc.c |  1 -
 drivers/mmc/host/omap.c|  1 -
 drivers/mmc/host/omap_hsmmc.c  |  1 -
 drivers/mmc/host/pxamci.c  |  1 -
 drivers/mmc/host/rtsx_pci_sdmmc.c  |  1 -
 drivers/mmc/host/rtsx_usb_sdmmc.c  |  1 -
 drivers/mmc/host/s3cmci.c  |  1 -
 drivers/mmc/host/sdhci-acpi.c  | 11 ++-
 drivers/mmc/host/sdhci-bcm-kona.c  |  1 -
 drivers/mmc/host/sdhci-bcm2835.c   |  1 -
 drivers/mmc/host/sdhci-cns3xxx.c   |  1 -
 drivers/mmc/host/sdhci-dove.c  |  1 -
 drivers/mmc/host/sdhci-esdhc-imx.c |  1 -
 drivers/mmc/host/sdhci-msm.c   |  1 -
 drivers/mmc/host/sdhci-of-arasan.c |  1 -
 drivers/mmc/host/sdhci-of-esdhc.c  |  1 -
 drivers/mmc/host/sdhci-of-hlwd.c   |  1 -
 drivers/mmc/host/sdhci-pci.c   | 11 ++-
 drivers/mmc/host/sdhci-pxav2.c |  1 -
 drivers/mmc/host/sdhci-pxav3.c |  1 -
 drivers/mmc/host/sdhci-s3c.c   |  1 -
 drivers/mmc/host/sdhci-sirf.c  |  1 -
 drivers/mmc/host/sdhci-spear.c |  1 -
 drivers/mmc/host/sdhci-tegra.c |  1 -
 drivers/mmc/host/sh_mmcif.c|  1 -
 drivers/mmc/host/sh_mobile_sdhi.c  |  1 -
 drivers/mmc/host/sunxi-mmc.c   |  1 -
 32 files changed, 4 insertions(+), 52 deletions(-)

-- 
1.9.1

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


[PATCH v4 2/3] usb: dwc3: dwc3-st: Add st-dwc3 devicetree bindings documentation

2014-07-30 Thread Peter Griffin
This patch documents the device tree documentation required for
the ST usb3 controller glue layer found in STiH407 devices.

Signed-off-by: Giuseppe Cavallaro 
Signed-off-by: Peter Griffin 
Acked-by: Lee Jones 
---
 Documentation/devicetree/bindings/usb/dwc3-st.txt | 69 +++
 1 file changed, 69 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/usb/dwc3-st.txt

diff --git a/Documentation/devicetree/bindings/usb/dwc3-st.txt 
b/Documentation/devicetree/bindings/usb/dwc3-st.txt
new file mode 100644
index 000..de3fea3
--- /dev/null
+++ b/Documentation/devicetree/bindings/usb/dwc3-st.txt
@@ -0,0 +1,69 @@
+ST DWC3 glue logic
+
+This file documents the parameters for the dwc3-st driver.
+This driver controls the glue logic used to configure the dwc3 core on
+STiH407 based platforms.
+
+Required properties:
+ - compatible  : must be "st,stih407-dwc3"
+ - reg : glue logic base address and USB syscfg ctrl register offset
+ - reg-names   : should be "reg-glue" and "syscfg-reg"
+ - st,syscon   : should be phandle to system configuration node which
+ encompasses the glue registers
+ - resets  : list of phandle and reset specifier pairs. There should be 
two entries, one
+ for the powerdown and softreset lines of the usb3 IP
+ - reset-names : list of reset signal names. Names should be "powerdown" and 
"softreset"
+See: Documentation/devicetree/bindings/reset/st,sti-powerdown.txt
+See: Documentation/devicetree/bindings/reset/reset.txt
+
+ - #address-cells, #size-cells : should be '1' if the device has sub-nodes
+ with 'reg' property
+
+ - pinctl-names: A pinctrl state named "default" must be defined
+See: Documentation/devicetree/bindings/pinctrl/pinctrl-binding.txt
+
+ - pinctrl-0   : Pin control group
+See: Documentation/devicetree/bindings/pinctrl/pinctrl-binding.txt
+
+ - ranges  : allows valid 1:1 translation between child's address space and
+ parent's address space
+
+Sub-nodes:
+The dwc3 core should be added as subnode to ST DWC3 glue as shown in the
+example below. The DT binding details of dwc3 can be found in:
+Documentation/devicetree/bindings/usb/dwc3.txt
+
+NB: The dr_mode property described in [1] is NOT optional for this driver, as 
the default value
+is "otg", which isn't supported by this SoC. Valid dr_mode values for dwc3-st 
are either "host"
+or "device".
+
+[1] Documentation/devicetree/bindings/usb/generic.txt
+
+Example:
+
+st_dwc3: dwc3@8f94000 {
+   status  = "disabled";
+   compatible  = "st,stih407-dwc3";
+   reg = <0x08f94000 0x1000>, <0x110 0x4>;
+   reg-names   = "reg-glue", "syscfg-reg";
+   st,syscfg   = <&syscfg_core>;
+   resets  = <&powerdown STIH407_USB3_POWERDOWN>;
+ <&softreset STIH407_MIPHY2_SOFTRESET>;
+   reset-names = "powerdown",
+ "softreset";
+   #address-cells  = <1>;
+   #size-cells = <1>;
+   pinctrl-names   = "default";
+   pinctrl-0   = <&pinctrl_usb3>;
+   ranges;
+
+   dwc3: dwc3@990 {
+   compatible  = "snps,dwc3";
+   reg = <0x0990 0x10>;
+   interrupts  = ;
+   dr_mode = "host"
+   usb-phy = <&usb3_phy>;
+   phy-names   = "usb2-phy";
+   phys= <&usb2_picophy2>;
+   };
+};
-- 
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 3/3] MAINTAINERS: Add dwc3-st.c file to ARCH/STI architecture

2014-07-30 Thread Peter Griffin
Signed-off-by: Peter Griffin 
Acked-by: Lee Jones 
---
 MAINTAINERS | 1 +
 1 file changed, 1 insertion(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 702ca10..269ad3b 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1325,6 +1325,7 @@ F:drivers/pinctrl/pinctrl-st.c
 F: drivers/media/rc/st_rc.c
 F: drivers/i2c/busses/i2c-st.c
 F: drivers/tty/serial/st-asc.c
+F: drivers/usb/dwc3/dwc3-st.c
 
 ARM/TECHNOLOGIC SYSTEMS TS7250 MACHINE SUPPORT
 M: Lennert Buytenhek 
-- 
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 1/3] usb: dwc3: add ST dwc3 glue layer to manage dwc3 HC

2014-07-30 Thread Peter Griffin
This patch adds the ST glue logic to manage the DWC3 HC
on STiH407 SoC family. It manages the powerdown signal,
and configures the internal glue logic and syscfg registers.

Signed-off-by: Giuseppe Cavallaro 
Signed-off-by: Peter Griffin 
Acked-by: Lee Jones 
---
 drivers/usb/dwc3/Kconfig   |   9 ++
 drivers/usb/dwc3/Makefile  |   1 +
 drivers/usb/dwc3/dwc3-st.c | 336 +
 3 files changed, 346 insertions(+)
 create mode 100644 drivers/usb/dwc3/dwc3-st.c

diff --git a/drivers/usb/dwc3/Kconfig b/drivers/usb/dwc3/Kconfig
index 8eb996e..6c85c43 100644
--- a/drivers/usb/dwc3/Kconfig
+++ b/drivers/usb/dwc3/Kconfig
@@ -79,6 +79,15 @@ config USB_DWC3_KEYSTONE
  Support of USB2/3 functionality in TI Keystone2 platforms.
  Say 'Y' or 'M' here if you have one such device
 
+config USB_DWC3_ST
+   tristate "STMicroelectronics Platforms"
+   depends on ARCH_STI && OF
+   default USB_DWC3_HOST
+   help
+ STMicroelectronics SoCs with one DesignWare Core USB3 IP
+ inside (i.e. STiH407).
+ Say 'Y' or 'M' if you have one such device.
+
 comment "Debugging features"
 
 config USB_DWC3_DEBUG
diff --git a/drivers/usb/dwc3/Makefile b/drivers/usb/dwc3/Makefile
index 10ac3e7..11c9f54 100644
--- a/drivers/usb/dwc3/Makefile
+++ b/drivers/usb/dwc3/Makefile
@@ -33,3 +33,4 @@ obj-$(CONFIG_USB_DWC3_OMAP)   += dwc3-omap.o
 obj-$(CONFIG_USB_DWC3_EXYNOS)  += dwc3-exynos.o
 obj-$(CONFIG_USB_DWC3_PCI) += dwc3-pci.o
 obj-$(CONFIG_USB_DWC3_KEYSTONE)+= dwc3-keystone.o
+obj-$(CONFIG_USB_DWC3_ST)  += dwc3-st.o
diff --git a/drivers/usb/dwc3/dwc3-st.c b/drivers/usb/dwc3/dwc3-st.c
new file mode 100644
index 000..227698f
--- /dev/null
+++ b/drivers/usb/dwc3/dwc3-st.c
@@ -0,0 +1,336 @@
+/**
+ * dwc3-st.c Support for dwc3 platform devices on ST Microelectronics platforms
+ *
+ * This is a small driver for the dwc3 to provide the glue logic
+ * to configure the controller. Tested on STi platforms.
+ *
+ * Copyright (C) 2014 Stmicroelectronics
+ *
+ * Author: Giuseppe Cavallaro 
+ * Contributors: Aymen Bouattay 
+ *   Peter Griffin 
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * Inspired by dwc3-omap.c and dwc3-exynos.c.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "core.h"
+#include "io.h"
+
+/* glue registers */
+#define CLKRST_CTRL0x00
+#define AUX_CLK_EN BIT(0)
+#define SW_PIPEW_RESET_N   BIT(4)
+#define EXT_CFG_RESET_NBIT(8)
+/*
+ * 1'b0 : The host controller complies with the xHCI revision 0.96
+ * 1'b1 : The host controller complies with the xHCI revision 1.0
+ */
+#define XHCI_REVISION  BIT(12)
+
+#define USB2_VBUS_MNGMNT_SEL1  0x2C
+/*
+ * For all fields in USB2_VBUS_MNGMNT_SEL1
+ * 2’b00 : Override value from Reg 0x30 is selected
+ * 2’b01 : utmiotg_ from usb3_top is selected
+ * 2’b10 : pipew_ from PIPEW instance is selected
+ * 2’b11 : value is 1'b0
+ */
+#define USB2_VBUS_REG300x0
+#define USB2_VBUS_UTMIOTG  0x1
+#define USB2_VBUS_PIPEW0x2
+#define USB2_VBUS_ZERO 0x3
+
+#define SEL_OVERRIDE_VBUSVALID(n)  (n << 0)
+#define SEL_OVERRIDE_POWERPRESENT(n)   (n << 4)
+#define SEL_OVERRIDE_BVALID(n) (n << 8)
+
+/* Static DRD configuration */
+#define USB_HOST_DEFAULT_MASK  0xffe
+#define USB_SET_PORT_DEVICE0x1
+
+/**
+ * struct st_dwc3 - dwc3-st driver private structure
+ * @dev:   device pointer
+ * @glue_base: ioaddr for the glue registers
+ * @regmap:regmap pointer for getting syscfg
+ * @syscfg_reg_off:usb syscfg control offset
+ * @dr_mode:   drd static host/device config
+ * @rstc_pwrdn:rest controller for powerdown signal
+ * @rstc_rst:  reset controller for softreset signal
+ */
+
+struct st_dwc3 {
+   struct device *dev;
+   void __iomem *glue_base;
+   struct regmap *regmap;
+   int syscfg_reg_off;
+   enum usb_dr_mode dr_mode;
+   struct reset_control *rstc_pwrdn;
+   struct reset_control *rstc_rst;
+};
+
+static inline u32 st_dwc3_readl(void __iomem *base, u32 offset)
+{
+   return readl_relaxed(base + offset);
+}
+
+static inline void st_dwc3_writel(void __iomem *base, u32 offset, u32 value)
+{
+   writel_relaxed(value, base + offset);
+}
+
+/**
+ * st_dwc3_drd_init: program the port
+ * @dwc3_data: driver private structure
+ * Description: this function is to program the port as either hos

[PATCH v4 0/3] Add ST dwc3 glue layer driver

2014-07-30 Thread Peter Griffin
This series adds support for the ST glue logic which wraps the DWC3 controller
on STiH407 SoC family chipsets.

Changes since v3
 - Various formating nits

Changes since v2
 - Use dr_mode for host/device static configuration
 - Manage shared reset signal to usbss to avoid hang if probing before usb3 phy
 - Remove DT checks and make driver depend on OF
 - Change some #define to use BIT macro
 - Make some comments clearer
 - Use kerneldoc for struct documentation
 - Remove udelay
 - Let DT create platform_devices, and remove legacy alloc
 - Change some logging levels to dev_dbg
 - Various whitespace and formatting cleanup
 - Use SIMPLE_DEV_PM_OPS()
 - Add const to of_device struct
 - Reorder header files alphabetically
 - Use devm_ioremap_resource instead of devm_request_and_ioremap
 - Remove of_match_ptr()

Changes since v1
 - Fix Kconfig mistake

Peter Griffin (3):
  usb: dwc3: add ST dwc3 glue layer to manage dwc3 HC
  usb: dwc3: dwc3-st: Add st-dwc3 devicetree bindings documentation
  MAINTAINERS: Add dwc3-st.c file to ARCH/STI architecture

 Documentation/devicetree/bindings/usb/dwc3-st.txt |  69 +
 MAINTAINERS   |   1 +
 drivers/usb/dwc3/Kconfig  |   9 +
 drivers/usb/dwc3/Makefile |   1 +
 drivers/usb/dwc3/dwc3-st.c| 336 ++
 5 files changed, 416 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/usb/dwc3-st.txt
 create mode 100644 drivers/usb/dwc3/dwc3-st.c

-- 
1.9.1

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


[PATCH v3 1/3] usb: dwc3: add ST dwc3 glue layer to manage dwc3 HC

2014-07-23 Thread Peter Griffin
This patch adds the ST glue logic to manage the DWC3 HC
on STiH407 SoC family. It manages the powerdown signal,
and configures the internal glue logic and syscfg registers.

Signed-off-by: Giuseppe Cavallaro 
Signed-off-by: Peter Griffin 
---
 drivers/usb/dwc3/Kconfig   |   9 ++
 drivers/usb/dwc3/Makefile  |   1 +
 drivers/usb/dwc3/dwc3-st.c | 338 +
 3 files changed, 348 insertions(+)
 create mode 100644 drivers/usb/dwc3/dwc3-st.c

diff --git a/drivers/usb/dwc3/Kconfig b/drivers/usb/dwc3/Kconfig
index 8eb996e..6c85c43 100644
--- a/drivers/usb/dwc3/Kconfig
+++ b/drivers/usb/dwc3/Kconfig
@@ -79,6 +79,15 @@ config USB_DWC3_KEYSTONE
  Support of USB2/3 functionality in TI Keystone2 platforms.
  Say 'Y' or 'M' here if you have one such device
 
+config USB_DWC3_ST
+   tristate "STMicroelectronics Platforms"
+   depends on ARCH_STI && OF
+   default USB_DWC3_HOST
+   help
+ STMicroelectronics SoCs with one DesignWare Core USB3 IP
+ inside (i.e. STiH407).
+ Say 'Y' or 'M' if you have one such device.
+
 comment "Debugging features"
 
 config USB_DWC3_DEBUG
diff --git a/drivers/usb/dwc3/Makefile b/drivers/usb/dwc3/Makefile
index 10ac3e7..11c9f54 100644
--- a/drivers/usb/dwc3/Makefile
+++ b/drivers/usb/dwc3/Makefile
@@ -33,3 +33,4 @@ obj-$(CONFIG_USB_DWC3_OMAP)   += dwc3-omap.o
 obj-$(CONFIG_USB_DWC3_EXYNOS)  += dwc3-exynos.o
 obj-$(CONFIG_USB_DWC3_PCI) += dwc3-pci.o
 obj-$(CONFIG_USB_DWC3_KEYSTONE)+= dwc3-keystone.o
+obj-$(CONFIG_USB_DWC3_ST)  += dwc3-st.o
diff --git a/drivers/usb/dwc3/dwc3-st.c b/drivers/usb/dwc3/dwc3-st.c
new file mode 100644
index 000..a93ea19
--- /dev/null
+++ b/drivers/usb/dwc3/dwc3-st.c
@@ -0,0 +1,338 @@
+/**
+ * dwc3-st.c Support for dwc3 platform devices on ST Microelectronics platforms
+ *
+ * This is a small driver for the dwc3 to provide the glue logic
+ * to configure the controller. Tested on STi platforms.
+ *
+ * Copyright (C) 2014 Stmicroelectronics
+ *
+ * Author: Giuseppe Cavallaro 
+ * Contributors: Aymen Bouattay 
+ *   Peter Griffin 
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * Inspired by dwc3-omap.c and dwc3-exynos.c.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "core.h"
+#include "io.h"
+
+/* glue registers */
+#define CLKRST_CTRL0x00
+#define AUX_CLK_EN BIT(0)
+#define SW_PIPEW_RESET_N   BIT(4)
+#define EXT_CFG_RESET_NBIT(8)
+/*
+ * 1'b0 : The host controller complies with the xHCI revision 0.96
+ * 1'b1 : The host controller complies with the xHCI revision 1.0
+ */
+#define XHCI_REVISION  BIT(12)
+
+#define USB2_VBUS_MNGMNT_SEL1  0x2C
+/*
+ * For all fields in USB2_VBUS_MNGMNT_SEL1
+ * 2’b00 : Override value from Reg 0x30 is selected
+ * 2’b01 : utmiotg_ from usb3_top is selected
+ * 2’b10 : pipew_ from PIPEW instance is selected
+ * 2’b11 : value is 1'b0
+ */
+#define REG30  0x0
+#define UTMIOTG0x1
+#define PIPEW  0x2
+#define ZERO   0x3
+
+#define SEL_OVERRIDE_VBUSVALID(n)  (n << 0)
+#define SEL_OVERRIDE_POWERPRESENT(n)   (n << 4)
+#define SEL_OVERRIDE_BVALID(n) (n << 8)
+
+/* Static DRD configuration */
+#define USB_HOST_DEFAULT_MASK  0xffe
+#define USB_SET_PORT_DEVICE0x1
+
+/**
+ * struct st_dwc3 - st-dwc3 driver private structure
+ * @dwc3:  platform device pointer
+ * @dev:   device pointer
+ * @glue_base  ioaddr for the glue registers
+ * @regmap regmap pointer for getting syscfg
+ * @syscfg_reg_off usb syscfg control offset
+ * @dr_modedrd static host/device config
+ * @rstc_pwrdn rest controller for powerdown signal
+ * @rstc_rst   reset controller for softreset signal
+ *
+ */
+
+struct st_dwc3 {
+   struct device *dev;
+   void __iomem *glue_base;
+   struct regmap *regmap;
+   int syscfg_reg_off;
+   enum usb_dr_mode dr_mode;
+   struct reset_control *rstc_pwrdn;
+   struct reset_control *rstc_rst;
+};
+
+static inline u32 st_dwc3_readl(void __iomem *base, u32 offset)
+{
+   return readl_relaxed(base + offset);
+}
+
+static inline void st_dwc3_writel(void __iomem *base, u32 offset, u32 value)
+{
+   writel_relaxed(value, base + offset);
+}
+
+/**
+ * st_dwc3_drd_init: program the port
+ * @dwc3_data: driver private structure
+ * Description: this function is to program the port as either host or device
+ * according to the static configurat

[PATCH v3 0/3] Add ST dwc3 glue layer driver

2014-07-23 Thread Peter Griffin
This series adds support for the ST glue logic which wraps the DWC3 controller
on STiH407 SoC family chipsets.

Changes since v2
 - Use dr_mode for host/device static configuration
 - Manage shared reset signal to usbss to avoid hang if probing before usb3 phy
 - Remove DT checks and make driver depend on OF
 - Change some #define to use BIT macro
 - Make some comments clearer
 - Use kerneldoc for struct documentation
 - Remove udelay
 - Let DT create platform_devices, and remove legacy alloc
 - Change some logging levels to dev_dbg
 - Various whitespace and formatting cleanup
 - Use SIMPLE_DEV_PM_OPS()
 - Add const to of_device struct
 - Reorder header files alphabetically
 - Use devm_ioremap_resource instead of devm_request_and_ioremap
 - Remove of_match_ptr()

Peter Griffin (3):
  usb: dwc3: add ST dwc3 glue layer to manage dwc3 HC
  usb: dwc3: dwc3-st: Add st-dwc3 devicetree bindings documentation
  MAINTAINERS: Add dwc3-st.c file to ARCH/STI architecture

 Documentation/devicetree/bindings/usb/dwc3-st.txt |  69 +
 MAINTAINERS   |   1 +
 drivers/usb/dwc3/Kconfig  |   9 +
 drivers/usb/dwc3/Makefile |   1 +
 drivers/usb/dwc3/dwc3-st.c| 337 ++
 5 files changed, 417 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/usb/dwc3-st.txt
 create mode 100644 drivers/usb/dwc3/dwc3-st.c

-- 
1.9.1

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


[PATCH v3 2/3] usb: dwc3: dwc3-st: Add st-dwc3 devicetree bindings documentation

2014-07-23 Thread Peter Griffin
This patch documents the device tree documentation required for
the ST usb3 controller glue layer found in STiH407 devices.

Signed-off-by: Giuseppe Cavallaro 
Signed-off-by: Peter Griffin 
---
 Documentation/devicetree/bindings/usb/dwc3-st.txt | 69 +++
 1 file changed, 69 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/usb/dwc3-st.txt

diff --git a/Documentation/devicetree/bindings/usb/dwc3-st.txt 
b/Documentation/devicetree/bindings/usb/dwc3-st.txt
new file mode 100644
index 000..de3fea3
--- /dev/null
+++ b/Documentation/devicetree/bindings/usb/dwc3-st.txt
@@ -0,0 +1,69 @@
+ST DWC3 glue logic
+
+This file documents the parameters for the dwc3-st driver.
+This driver controls the glue logic used to configure the dwc3 core on
+STiH407 based platforms.
+
+Required properties:
+ - compatible  : must be "st,stih407-dwc3"
+ - reg : glue logic base address and USB syscfg ctrl register offset
+ - reg-names   : should be "reg-glue" and "syscfg-reg"
+ - st,syscon   : should be phandle to system configuration node which
+ encompasses the glue registers
+ - resets  : list of phandle and reset specifier pairs. There should be 
two entries, one
+ for the powerdown and softreset lines of the usb3 IP
+ - reset-names : list of reset signal names. Names should be "powerdown" and 
"softreset"
+See: Documentation/devicetree/bindings/reset/st,sti-powerdown.txt
+See: Documentation/devicetree/bindings/reset/reset.txt
+
+ - #address-cells, #size-cells : should be '1' if the device has sub-nodes
+ with 'reg' property
+
+ - pinctl-names: A pinctrl state named "default" must be defined
+See: Documentation/devicetree/bindings/pinctrl/pinctrl-binding.txt
+
+ - pinctrl-0   : Pin control group
+See: Documentation/devicetree/bindings/pinctrl/pinctrl-binding.txt
+
+ - ranges  : allows valid 1:1 translation between child's address space and
+ parent's address space
+
+Sub-nodes:
+The dwc3 core should be added as subnode to ST DWC3 glue as shown in the
+example below. The DT binding details of dwc3 can be found in:
+Documentation/devicetree/bindings/usb/dwc3.txt
+
+NB: The dr_mode property described in [1] is NOT optional for this driver, as 
the default value
+is "otg", which isn't supported by this SoC. Valid dr_mode values for dwc3-st 
are either "host"
+or "device".
+
+[1] Documentation/devicetree/bindings/usb/generic.txt
+
+Example:
+
+st_dwc3: dwc3@8f94000 {
+   status  = "disabled";
+   compatible  = "st,stih407-dwc3";
+   reg = <0x08f94000 0x1000>, <0x110 0x4>;
+   reg-names   = "reg-glue", "syscfg-reg";
+   st,syscfg   = <&syscfg_core>;
+   resets  = <&powerdown STIH407_USB3_POWERDOWN>;
+ <&softreset STIH407_MIPHY2_SOFTRESET>;
+   reset-names = "powerdown",
+ "softreset";
+   #address-cells  = <1>;
+   #size-cells = <1>;
+   pinctrl-names   = "default";
+   pinctrl-0   = <&pinctrl_usb3>;
+   ranges;
+
+   dwc3: dwc3@990 {
+   compatible  = "snps,dwc3";
+   reg = <0x0990 0x10>;
+   interrupts  = ;
+   dr_mode = "host"
+   usb-phy = <&usb3_phy>;
+   phy-names   = "usb2-phy";
+   phys= <&usb2_picophy2>;
+   };
+};
-- 
1.9.1

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


[PATCH v3 3/3] MAINTAINERS: Add dwc3-st.c file to ARCH/STI architecture

2014-07-23 Thread Peter Griffin
Signed-off-by: Peter Griffin 
---
 MAINTAINERS | 1 +
 1 file changed, 1 insertion(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 702ca10..269ad3b 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1325,6 +1325,7 @@ F:drivers/pinctrl/pinctrl-st.c
 F: drivers/media/rc/st_rc.c
 F: drivers/i2c/busses/i2c-st.c
 F: drivers/tty/serial/st-asc.c
+F: drivers/usb/dwc3/dwc3-st.c
 
 ARM/TECHNOLOGIC SYSTEMS TS7250 MACHINE SUPPORT
 M: Lennert Buytenhek 
-- 
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 v2 1/3] usb: dwc3: add ST dwc3 glue layer to manage dwc3 HC

2014-07-23 Thread Peter Griffin
Hi Felipe,

Thanks for reviewing, see my comments inline: -

> > > Just use {read,write}l_relaxed() directly.
> > 
> > Ok, unabstracted in v3
> 
> no, no... all other glues add their own local helpers for register
> access. This is good for tracing, it's very easy to add a tracepoint to
> this sort of function and get very low overhead tracing of every
> register access.

I've put the IO accessors back in for V3

> > They are just bit setting macros, I've converted them over to use BIT macro 
> > now,
> > so it no longer takes a parameter.
> 
> the macros are better, but make them upper case as everybody else.

Fixed in v3.


> > I've asked ST how this value was derirved and why. It came from validation. 
> > The docs don't mention that it is necessary, and removing it
> > seems to have no ill effects. So I've removed this udelay in v3.
> 
> make sure to test with many, many iterations just to make sure.

Yes will do, I've been booting my board all day, and so far no failures.

> > Ok. Do the DT folks have any comment on this?
> 
> look at the child's dr-mode property instead of adding your own.

Thanks for the hint, now using dr-mode binding in V3 :-)
 
> 
> > > > +   dwc3_data->glue_base = devm_request_and_ioremap(dev, res);
> 
> use devm_ioremap_resource()

Fixed in V3

> > Your right, this was wrong. It was some legacy code which is
> > unnecessary and I've removed this in v3.
> 
> if you're going for DT, why don't you create the parent and the child
> from DT as omap/exynos/qcom are doing ?

Now creating parent and child from DT like OMAP in v3

> > > > +   reset_control_assert(dwc3_data->rstc_pwrdn);
> > > > +
> > > > +   pinctrl_pm_select_sleep_state(dev);
> 
> pinctrl will select sleep and default states automatically for you.

I've left this in v3, as greping around I couldn't see how that could happen 
automatically.

Also I just double checked with linusw on irc who confirmed that the only state 
which is 
ever auto-selected is "default". All other states, as well as going back to 
default
state need to be explicitly called.

Hope thats ok.

regards,

Peter.
--
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/3] usb: dwc3: add ST dwc3 glue layer to manage dwc3 HC

2014-07-22 Thread Peter Griffin
Hi Jingoo,

Sorry for the delay in replying. Thanks for reviewing, 
see my comments inline below: -


> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> 
> Would you re-order these headers alphabetically?
> It enhances the readability.

Ok fixed in V3

> > +
> > +   res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "reg-glue");
> > +   if (!res)
> > +   return -ENXIO;
> > +
> > +   dwc3_data->glue_base = devm_request_and_ioremap(dev, res);
> 
> Please don't use devm_request_and_ioremap() any more. It was deprecated
> and will be removed from 3.17-rc1.
> 
> Please, use devm_ioremap_resource() instead.

Ok changed over to use devm_ioremap_resource in V3.

> 
> + dwc3_data->glue_base = devm_ioremap_resource(dev, res);
> + if (IS_ERR(dwc3_data->glue_base))
> + return PTR_ERR(dwc3_data->glue_base);
> 
> > +   if (!dwc3_data->glue_base)
> > +   return -EADDRNOTAVAIL;
> > +

> > +
> > +static const struct dev_pm_ops st_dwc3_dev_pm_ops = {
> > +   SET_SYSTEM_SLEEP_PM_OPS(st_dwc3_suspend, st_dwc3_resume)
> > +};
> > +
> > +static struct of_device_id st_dwc3_match[] = {
> 
> Please add 'const' as below. This is because all OF functions
> handle of_device_id as const.
> 
> static const struct of_device_id st_dwc3_match[] = {

Ok, fixed in V3

> 
> > +   { .compatible = "st,stih407-dwc3" },
> > +   { /* sentinel */ },
> > +};
> > +
> > +MODULE_DEVICE_TABLE(of, st_dwc3_match);
> > +
> > +static struct platform_driver st_dwc3_driver = {
> > +   .probe = st_dwc3_probe,
> > +   .remove = st_dwc3_remove,
> > +   .driver = {
> > +   .name = "usb-st-dwc3",
> > +   .owner = THIS_MODULE,
> > +   .of_match_table = of_match_ptr(st_dwc3_match),
> 
> You already use OF dependency as below. So, of_match_ptr() is
> NOT necessary.
> 
> +config USB_DWC3_ST
> + tristate "STMicroelectronics Platforms"
> + depends on ARCH_STI && OF
> 
> Please remove of_match_ptr() as below.
> 
> + .of_match_table = st_dwc3_match,

Ok fixed in V3

regards,

Peter.
--
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/3] usb: dwc3: add ST dwc3 glue layer to manage dwc3 HC

2014-07-22 Thread Peter Griffin
Hi Lee,

Thanks for reviewing, see my comments inline below: -

On Mon, 07 Jul 2014, Lee Jones wrote:

> On Sat, 05 Jul 2014, Peter Griffin wrote:
> 
> > This patch adds the ST glue logic to manage the DWC3 HC
> > on STiH407 SoC family. It manages the powerdown signal,
> > and configures the internal glue logic and syscfg registers.
> > 
> > Signed-off-by: Giuseppe Cavallaro 
> > Signed-off-by: Peter Griffin 
> > ---
> >  drivers/usb/dwc3/Kconfig   |   9 ++
> >  drivers/usb/dwc3/Makefile  |   1 +
> >  drivers/usb/dwc3/dwc3-st.c | 325 
> > +
> >  3 files changed, 335 insertions(+)
> >  create mode 100644 drivers/usb/dwc3/dwc3-st.c
> > 
> > diff --git a/drivers/usb/dwc3/Kconfig b/drivers/usb/dwc3/Kconfig
> > index 8eb996e..6c85c43 100644
> > --- a/drivers/usb/dwc3/Kconfig
> > +++ b/drivers/usb/dwc3/Kconfig
> > @@ -79,6 +79,15 @@ config USB_DWC3_KEYSTONE
> >   Support of USB2/3 functionality in TI Keystone2 platforms.
> >   Say 'Y' or 'M' here if you have one such device
> >  
> > +config USB_DWC3_ST
> > +   tristate "STMicroelectronics Platforms"
> > +   depends on ARCH_STI && OF
> > +   default USB_DWC3_HOST
> > +   help
> > + STMicroelectronics SoCs with one DesignWare Core USB3 IP
> > + inside (i.e. STiH407).
> > + Say 'Y' or 'M' if you have one such device.
> > +
> >  comment "Debugging features"
> >  
> >  config USB_DWC3_DEBUG
> > diff --git a/drivers/usb/dwc3/Makefile b/drivers/usb/dwc3/Makefile
> > index 10ac3e7..11c9f54 100644
> > --- a/drivers/usb/dwc3/Makefile
> > +++ b/drivers/usb/dwc3/Makefile
> > @@ -33,3 +33,4 @@ obj-$(CONFIG_USB_DWC3_OMAP)   += dwc3-omap.o
> >  obj-$(CONFIG_USB_DWC3_EXYNOS)  += dwc3-exynos.o
> >  obj-$(CONFIG_USB_DWC3_PCI) += dwc3-pci.o
> >  obj-$(CONFIG_USB_DWC3_KEYSTONE)+= dwc3-keystone.o
> > +obj-$(CONFIG_USB_DWC3_ST)  += dwc3-st.o
> > diff --git a/drivers/usb/dwc3/dwc3-st.c b/drivers/usb/dwc3/dwc3-st.c
> > new file mode 100644
> > index 000..2cae9d3
> > --- /dev/null
> > +++ b/drivers/usb/dwc3/dwc3-st.c
> > @@ -0,0 +1,325 @@
> > +/**
> > + * dwc3-st.c Support for dwc3 platform devices on ST Microelectronics 
> > platforms
> > + *
> > + * This is a small platform driver for the dwc3 to provide the glue logic
> > + * to configure the controller. Tested on STi platforms.
> 
> Not sure about the use of the term 'platform driver' here and in the
> title.  We don't normally differentiate.  I can find examples to the
> contrary, but not many.

Ok, removed 'platform' in V3
> 
> > + * Copyright (C) 2014 Stmicroelectronics
> > + *
> > + * Author: Giuseppe Cavallaro 
> > + * Contributors: Aymen Bouattay 
> > + *   Peter Griffin 
> > + *
> > + * This program is free software; you can redistribute it and/or modify
> > + * it under the terms of the GNU General Public License as published by
> > + * the Free Software Foundation; either version 2 of the License, or
> > + * (at your option) any later version.
> > + *
> > + * Inspired by dwc3-omap.c and dwc3-exynos.c.
> > + */
> > +
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +
> > +#include "core.h"
> > +#include "io.h"
> > +
> > +/* Reg glue registers */
> > +#define USB2_CLKRST_CTRL 0x00
> > +#define aux_clk_en(n) ((n)<<0)
> > +#define sw_pipew_reset_n(n) ((n)<<4)
> > +#define ext_cfg_reset_n(n) ((n)<<8)
> > +#define xhci_revision(n) ((n)<<12)
> 
> These all need reformatting, see CodingStyle - 3.1: Spaces

Ok I have added a space either side of the shift operator and aligned
using tabs.

> 
>   #define xhci_revision(n) ((n) << 12)
> 
> Lining them up with TABs would make them easier to read.

Ok fixed in v3

> 
> Also, I don't think there is a requirement to encapsulate the 'n'.

Ok removed brackets around the 'n'

> 
> > +#define USB2_VBUS_MNGMNT_SEL1 0x2C
> > +/*
> > + * 2'b00 : Override value from Reg 0x30 is selected
> > + * 2'b01 : utmiotg_vbusvalid from usb3_top top is selected
> > + * 2'b10 : pipew_powerpresent from PIPEW

Re: [PATCH v2 3/3] MAINTAINERS: Add dwc3-st.c file to ARCH/STI architecture

2014-07-10 Thread Peter Griffin
Hi Felipe,

> > Maxime,
> >   Once Acked by Felipe, I think this should go in via your tree to
> > avoid conflicts with other ARM/STI ARCHITECTURE additions.
> 
> there are still many unresolved comments on patches 1 and 2.

Yes, sorry I've been a bit busy this week on other activities to send a V3.

I will get this fixed up addressing the comments received so far, and sent out
a V3 early next week.

regards,

Peter.


--
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: sti: Add st-dwc3 devicetree bindings documentation

2014-07-04 Thread Peter Griffin
This patch documents the device tree documentation required for
the ST usb3 controller glue layer found in STiH407 devices.

Signed-off-by: Giuseppe Cavallaro 
Signed-off-by: Peter Griffin 
---
 Documentation/devicetree/bindings/usb/dwc3-st.txt | 58 +++
 1 file changed, 58 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/usb/dwc3-st.txt

diff --git a/Documentation/devicetree/bindings/usb/dwc3-st.txt 
b/Documentation/devicetree/bindings/usb/dwc3-st.txt
new file mode 100644
index 000..befd964
--- /dev/null
+++ b/Documentation/devicetree/bindings/usb/dwc3-st.txt
@@ -0,0 +1,58 @@
+ST DWC3 glue logic
+
+This file documents the parameters for the dwc3-st driver.
+This driver provides the glue logic to use the dwc3 on STiH407 based platforms.
+
+Required properties:
+ - compatible  : must be "st,stih407-dwc3"
+ - reg : glue logic base address and USB syscfg ctrl register offset
+ - reg-names   : should be "reg-glue" and "syscfg-reg"
+ - st,syscon   : should be phandle to system configuration node which
+ encompasses the glue registers
+ - resets  : phandle pointing to the system powerdown controller
+See: Documentation/devicetree/bindings/reset/st,sti-powerdown.txt
+See: Documentation/devicetree/bindings/reset/reset.txt
+
+ - #address-cells, #size-cells : should be '1' if the device has sub-nodes
+ with 'reg' property
+
+ - pinctl-names: A pinctrl state named "default" must be defined
+See: Documentation/devicetree/bindings/pinctrl/pinctrl-binding.txt
+
+ - pinctrl-0   : Pin control group
+See: Documentation/devicetree/bindings/pinctrl/pinctrl-binding.txt
+
+ - ranges  : allows valid 1:1 translation between child's address space and
+ parent's address space
+
+Optional properties:
+ - st,dwc3-drd-device: to program the HC as "device" (static setup)
+
+Sub-nodes:
+The dwc3 core should be added as subnode to ST DWC3 glue as shown in the
+example below. The DT binding details of dwc3 can be found in:
+Documentation/devicetree/bindings/usb/dwc3.txt
+
+Example:
+
+st_dwc3: dwc3@8f94000 {
+   status  = "disabled";
+   compatible  = "st,stih407-dwc3";
+   reg = <0x08f94000 0x1000>, <0x110 0x4>;
+   reg-names   = "reg-glue", "syscfg-reg";
+   st,syscfg   = <&syscfg_core>;
+   resets  = <&powerdown STIH407_USB3_POWERDOWN>;
+   #address-cells  = <1>;
+   #size-cells = <1>;
+   pinctrl-names   = "default";
+   pinctrl-0   = <&pinctrl_usb3>;
+   ranges;
+
+   dwc3: dwc3@990 {
+   compatible  = "synopsys,dwc3";
+   reg = <0x0990 0x10>;
+   interrupts  =  ;
+
+   usb-phy = <&usb2_phy>, <&usb3_phy>;
+   };
+};
-- 
1.9.1

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


[PATCH v2 3/3] MAINTAINERS: Add dwc3-st.c file to ARCH/STI architecture

2014-07-04 Thread Peter Griffin
Signed-off-by: Peter Griffin 
---
 MAINTAINERS | 1 +
 1 file changed, 1 insertion(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 702ca10..269ad3b 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1325,6 +1325,7 @@ F:drivers/pinctrl/pinctrl-st.c
 F: drivers/media/rc/st_rc.c
 F: drivers/i2c/busses/i2c-st.c
 F: drivers/tty/serial/st-asc.c
+F: drivers/usb/dwc3/dwc3-st.c
 
 ARM/TECHNOLOGIC SYSTEMS TS7250 MACHINE SUPPORT
 M: Lennert Buytenhek 
-- 
1.9.1

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


[PATCH v2 0/3] Add ST dwc3 glue layer driver.

2014-07-04 Thread Peter Griffin
This series adds support for the ST glue logic to manage the DWC3 HC
on STiH407 SoC family chipsets.

Peter Griffin (3):
  usb: dwc3: add ST dwc3 glue layer to manage dwc3 HC
  ARM: dts: sti: Add st-dwc3 devicetree bindings documentation
  MAINTAINERS: Add dwc3-st.c file to ARCH/STI architecture

 Documentation/devicetree/bindings/usb/dwc3-st.txt |  58 
 MAINTAINERS   |   1 +
 drivers/usb/dwc3/Kconfig  |   9 +
 drivers/usb/dwc3/Makefile |   1 +
 drivers/usb/dwc3/dwc3-st.c| 325 ++
 5 files changed, 394 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/usb/dwc3-st.txt
 create mode 100644 drivers/usb/dwc3/dwc3-st.c

-- 
1.9.1

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


[PATCH v2 1/3] usb: dwc3: add ST dwc3 glue layer to manage dwc3 HC

2014-07-04 Thread Peter Griffin
This patch adds the ST glue logic to manage the DWC3 HC
on STiH407 SoC family. It manages the powerdown signal,
and configures the internal glue logic and syscfg registers.

Signed-off-by: Giuseppe Cavallaro 
Signed-off-by: Peter Griffin 
---
 drivers/usb/dwc3/Kconfig   |   9 ++
 drivers/usb/dwc3/Makefile  |   1 +
 drivers/usb/dwc3/dwc3-st.c | 325 +
 3 files changed, 335 insertions(+)
 create mode 100644 drivers/usb/dwc3/dwc3-st.c

diff --git a/drivers/usb/dwc3/Kconfig b/drivers/usb/dwc3/Kconfig
index 8eb996e..6c85c43 100644
--- a/drivers/usb/dwc3/Kconfig
+++ b/drivers/usb/dwc3/Kconfig
@@ -79,6 +79,15 @@ config USB_DWC3_KEYSTONE
  Support of USB2/3 functionality in TI Keystone2 platforms.
  Say 'Y' or 'M' here if you have one such device
 
+config USB_DWC3_ST
+   tristate "STMicroelectronics Platforms"
+   depends on ARCH_STI && OF
+   default USB_DWC3_HOST
+   help
+ STMicroelectronics SoCs with one DesignWare Core USB3 IP
+ inside (i.e. STiH407).
+ Say 'Y' or 'M' if you have one such device.
+
 comment "Debugging features"
 
 config USB_DWC3_DEBUG
diff --git a/drivers/usb/dwc3/Makefile b/drivers/usb/dwc3/Makefile
index 10ac3e7..11c9f54 100644
--- a/drivers/usb/dwc3/Makefile
+++ b/drivers/usb/dwc3/Makefile
@@ -33,3 +33,4 @@ obj-$(CONFIG_USB_DWC3_OMAP)   += dwc3-omap.o
 obj-$(CONFIG_USB_DWC3_EXYNOS)  += dwc3-exynos.o
 obj-$(CONFIG_USB_DWC3_PCI) += dwc3-pci.o
 obj-$(CONFIG_USB_DWC3_KEYSTONE)+= dwc3-keystone.o
+obj-$(CONFIG_USB_DWC3_ST)  += dwc3-st.o
diff --git a/drivers/usb/dwc3/dwc3-st.c b/drivers/usb/dwc3/dwc3-st.c
new file mode 100644
index 000..2cae9d3
--- /dev/null
+++ b/drivers/usb/dwc3/dwc3-st.c
@@ -0,0 +1,325 @@
+/**
+ * dwc3-st.c Support for dwc3 platform devices on ST Microelectronics platforms
+ *
+ * This is a small platform driver for the dwc3 to provide the glue logic
+ * to configure the controller. Tested on STi platforms.
+ *
+ * Copyright (C) 2014 Stmicroelectronics
+ *
+ * Author: Giuseppe Cavallaro 
+ * Contributors: Aymen Bouattay 
+ *   Peter Griffin 
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * Inspired by dwc3-omap.c and dwc3-exynos.c.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "core.h"
+#include "io.h"
+
+/* Reg glue registers */
+#define USB2_CLKRST_CTRL 0x00
+#define aux_clk_en(n) ((n)<<0)
+#define sw_pipew_reset_n(n) ((n)<<4)
+#define ext_cfg_reset_n(n) ((n)<<8)
+#define xhci_revision(n) ((n)<<12)
+
+#define USB2_VBUS_MNGMNT_SEL1 0x2C
+/*
+ * 2'b00 : Override value from Reg 0x30 is selected
+ * 2'b01 : utmiotg_vbusvalid from usb3_top top is selected
+ * 2'b10 : pipew_powerpresent from PIPEW instance is selected
+ * 2'b11 : value is 1'b0
+ */
+#define SEL_OVERRIDE_VBUSVALID(n) ((n)<<0)
+#define SEL_OVERRIDE_POWERPRESENT(n) ((n)<<4)
+#define SEL_OVERRIDE_BVALID(n) ((n)<<8)
+
+#define USB2_VBUS_MNGMNT_VAL1 0x30
+#define OVERRIDE_VBUSVALID_VAL (1 << 0)
+#define OVERRIDE_POWERPRESENT_VAL (1 << 4)
+#define OVERRIDE_BVALID_VAL (1 << 8)
+
+/* Static DRD configuration */
+#define USB_HOST_DEFAULT_MASK  0xffe
+#define USB_SET_PORT_DEVICE0x1
+
+struct st_dwc3 {
+   struct platform_device *dwc3;   /* platform device pointer */
+   struct device *dev; /* device pointer */
+   void __iomem *glue_base;/* ioaddr for programming the glue */
+   struct regmap *regmap;  /* regmap for getting syscfg */
+   int syscfg_reg_off; /* usb syscfg control offset */
+   bool drd_device_conf;   /* DRD static host/device conf */
+   struct reset_control *rstc_pwrdn;/* Rst control for powerdown*/
+};
+
+static inline u32 st_dwc3_readl(void __iomem *base, u32 offset)
+{
+   return readl_relaxed(base + offset);
+}
+
+static inline void st_dwc3_writel(void __iomem *base, u32 offset, u32 value)
+{
+   writel_relaxed(value, base + offset);
+}
+
+/**
+ * st_dwc3_drd_init: program the port
+ * @dwc3_data: driver private structure
+ * Description: this function is to program the port as either host or device
+ * according to the static configuration passed from devicetree.
+ * OTG and dual role are not yet supported!
+ */
+static int st_dwc3_drd_init(struct st_dwc3 *dwc3_data)
+{
+   u32 val;
+
+   regmap_read(dwc3_data->regmap, dwc3_data->syscfg_reg_off, &val);
+
+   if (dwc3_data->drd_device_conf)
+   val |= USB_SET_PORT_DEVICE;
+   else
+   

Re: [PATCH 2/3] ARM: dts: sti: Add st-dwc3 devicetree bindings documentation

2014-07-04 Thread Peter Griffin
Hi Daniele,

Thanks for reviewing.

On Fri, 04 Jul 2014, Daniele Forsi wrote:
> 2014-07-04 13:13 GMT+02:00 Peter Griffin:
> 
> > +Required properties:
> > + - compatible  : must be "st,stih407-dwc3"
> > + - reg : glue logic base address and USB syscfg ctrl register 
> > offest
> > + - reg-names   : Should be "reg-glue" and "syscfg-reg".
> > + - st,syscon: should be phandle to system configuration node which
> > + encompases the glue registers.
> > + - resets   : phandle pointing to the system powerdown controller
> 
> minor knits:
> s/offest/offset/
> s/encompases/encompasses/
> "Should" is upper case while all other lines in this block start with
> a lower case letter;
> two lines end with a full stop, three lines without;
> colons the last lines do not align to the first three

All fixed in V2.

Regards,

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


Re: [PATCH 1/3] usb: dwc3: add ST dwc3 glue layer to manage dwc3 HC

2014-07-04 Thread Peter Griffin
Hi Daniele,

Thankyou for reviewing.

> > +config USB_DWC3_ST
> > +   tristate "STMicroelectronics Platforms"
> > +   depends on ARCH_STI && OF
> > +   default USB_DWC3_HOST
> > +   help
> > + STMicroelectronics SoCs chip with one DesignWare Core USB3 IP
> > + inside (i.e. STiH407).
> > +
> >   Say 'Y' or 'M' here if you have one such device
> >
> >  comment "Debugging features"
> 
> you are actually removing the line "Say 'Y' or 'M' here if you have
> one such device" from the previous item

Whoops, good spot. I've fixed in V2, and added the same sentence for this
new entry as well.

I've also replaced "STMicroelectronics SoCs chip with one DesignWare Core"
with "STMicroelectronics SoCs with one DesignWare Core".

regards,

Peter.

--
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/3] ARM: dts: sti: Add st-dwc3 devicetree bindings documentation

2014-07-04 Thread Peter Griffin
This patch documents the device tree documentation required for
the ST usb3 controller glue layer found in STiH407 devices.

Signed-off-by: Giuseppe Cavallaro 
Signed-off-by: Peter Griffin 
---
 Documentation/devicetree/bindings/usb/dwc3-st.txt | 58 +++
 1 file changed, 58 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/usb/dwc3-st.txt

diff --git a/Documentation/devicetree/bindings/usb/dwc3-st.txt 
b/Documentation/devicetree/bindings/usb/dwc3-st.txt
new file mode 100644
index 000..f14e5da
--- /dev/null
+++ b/Documentation/devicetree/bindings/usb/dwc3-st.txt
@@ -0,0 +1,58 @@
+ST DWC3 glue logic
+
+This file documents the parameters for the dwc3-st driver.
+This driver provides the glue logic to use the dwc3 on STiH407 based platforms.
+
+Required properties:
+ - compatible  : must be "st,stih407-dwc3"
+ - reg : glue logic base address and USB syscfg ctrl register offest
+ - reg-names   : Should be "reg-glue" and "syscfg-reg".
+ - st,syscon: should be phandle to system configuration node which
+ encompases the glue registers.
+ - resets   : phandle pointing to the system powerdown controller
+See: Documentation/devicetree/bindings/reset/st,sti-powerdown.txt
+See: Documentation/devicetree/bindings/reset/reset.txt
+
+ - #address-cells, #size-cells : should be '1' if the device has sub-nodes
+ with 'reg' property.
+
+ - pinctl-names : A pinctrl state named "default" must be defined.
+See: Documentation/devicetree/bindings/pinctrl/pinctrl-binding.txt.
+
+ - pinctrl-0   : Pin control group
+See: Documentation/devicetree/bindings/pinctrl/pinctrl-binding.txt.
+
+ - ranges: allows valid 1:1 translation between child's address space and
+   parent's address space.
+
+Optional properties:
+ - st,dwc3-drd-device: to program the HC as "device" (static setup)
+
+Sub-nodes:
+The dwc3 core should be added as subnode to ST DWC3 glue as shown in the
+example below. The DT binding details of dwc3 can be found in:
+Documentation/devicetree/bindings/usb/dwc3.txt
+
+Example:
+
+st_dwc3: dwc3@8f94000 {
+   status  = "disabled";
+   compatible  = "st,stih407-dwc3";
+   reg = <0x08f94000 0x1000>, <0x110 0x4>;
+   reg-names   = "reg-glue", "syscfg-reg";
+   st,syscfg   = <&syscfg_core>;
+   resets  = <&powerdown STIH407_USB3_POWERDOWN>;
+   #address-cells  = <1>;
+   #size-cells = <1>;
+   pinctrl-names   = "default";
+   pinctrl-0   = <&pinctrl_usb3>;
+   ranges;
+
+   dwc3: dwc3@990 {
+   compatible  = "synopsys,dwc3";
+   reg = <0x0990 0x10>;
+   interrupts  =  ;
+
+   usb-phy = <&usb2_phy>, <&usb3_phy>;
+   };
+};
-- 
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 3/3] MAINTAINERS: Add dwc3-st.c file to ARCH/STI architecture

2014-07-04 Thread Peter Griffin
Signed-off-by: Peter Griffin 
---
 MAINTAINERS | 1 +
 1 file changed, 1 insertion(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 702ca10..269ad3b 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1325,6 +1325,7 @@ F:drivers/pinctrl/pinctrl-st.c
 F: drivers/media/rc/st_rc.c
 F: drivers/i2c/busses/i2c-st.c
 F: drivers/tty/serial/st-asc.c
+F: drivers/usb/dwc3/dwc3-st.c
 
 ARM/TECHNOLOGIC SYSTEMS TS7250 MACHINE SUPPORT
 M: Lennert Buytenhek 
-- 
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 1/3] usb: dwc3: add ST dwc3 glue layer to manage dwc3 HC

2014-07-04 Thread Peter Griffin
This patch adds the ST glue logic to manage the DWC3 HC
on STiH407 SoC family. It manages the powerdown signal,
and configures the internal glue logic and syscfg registers.

Signed-off-by: Giuseppe Cavallaro 
Signed-off-by: Peter Griffin 
---
 drivers/usb/dwc3/Kconfig   |   9 ++
 drivers/usb/dwc3/Makefile  |   1 +
 drivers/usb/dwc3/dwc3-st.c | 325 +
 3 files changed, 335 insertions(+)
 create mode 100644 drivers/usb/dwc3/dwc3-st.c

diff --git a/drivers/usb/dwc3/Kconfig b/drivers/usb/dwc3/Kconfig
index 8eb996e..f7b0518 100644
--- a/drivers/usb/dwc3/Kconfig
+++ b/drivers/usb/dwc3/Kconfig
@@ -77,6 +77,15 @@ config USB_DWC3_KEYSTONE
default USB_DWC3
help
  Support of USB2/3 functionality in TI Keystone2 platforms.
+
+config USB_DWC3_ST
+   tristate "STMicroelectronics Platforms"
+   depends on ARCH_STI && OF
+   default USB_DWC3_HOST
+   help
+ STMicroelectronics SoCs chip with one DesignWare Core USB3 IP
+ inside (i.e. STiH407).
+
  Say 'Y' or 'M' here if you have one such device
 
 comment "Debugging features"
diff --git a/drivers/usb/dwc3/Makefile b/drivers/usb/dwc3/Makefile
index 10ac3e7..11c9f54 100644
--- a/drivers/usb/dwc3/Makefile
+++ b/drivers/usb/dwc3/Makefile
@@ -33,3 +33,4 @@ obj-$(CONFIG_USB_DWC3_OMAP)   += dwc3-omap.o
 obj-$(CONFIG_USB_DWC3_EXYNOS)  += dwc3-exynos.o
 obj-$(CONFIG_USB_DWC3_PCI) += dwc3-pci.o
 obj-$(CONFIG_USB_DWC3_KEYSTONE)+= dwc3-keystone.o
+obj-$(CONFIG_USB_DWC3_ST)  += dwc3-st.o
diff --git a/drivers/usb/dwc3/dwc3-st.c b/drivers/usb/dwc3/dwc3-st.c
new file mode 100644
index 000..80b1b8f
--- /dev/null
+++ b/drivers/usb/dwc3/dwc3-st.c
@@ -0,0 +1,325 @@
+/**
+ * dwc3-st.c Support for dwc3 platform devices on ST Microelectronics platforms
+ *
+ * This is a small platform driver for the dwc3 to provide the glue logic
+ * to configure the controller. Tested on STi platforms.
+ *
+ * Copyright (C) 2014 Stmicroelectronics
+ *
+ * Author: Giuseppe Cavallaro 
+ * Contributors: Aymen Bouattay 
+ *   Peter Griffin 
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * Inspired by dwc3-omap.c and dwc3-exynos.c.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "core.h"
+#include "io.h"
+
+/* Reg glue registers */
+#define USB2_CLKRST_CTRL 0x00
+#define aux_clk_en(n) ((n)<<0)
+#define sw_pipew_reset_n(n) ((n)<<4)
+#define ext_cfg_reset_n(n) ((n)<<8)
+#define xhci_revision(n) ((n)<<12)
+
+#define USB2_VBUS_MNGMNT_SEL1 0x2C
+/*
+ * 2'b00 : Override value from Reg 0x30 is selected
+ * 2'b01 : utmiotg_vbusvalid from usb3_top top is selected
+ * 2'b10 : pipew_powerpresent from PIPEW instance is selected
+ * 2'b11 : value is 1'b0
+ */
+#define SEL_OVERRIDE_VBUSVALID(n) ((n)<<0)
+#define SEL_OVERRIDE_POWERPRESENT(n) ((n)<<4)
+#define SEL_OVERRIDE_BVALID(n) ((n)<<8)
+
+#define USB2_VBUS_MNGMNT_VAL1 0x30
+#define OVERRIDE_VBUSVALID_VAL (1 << 0)
+#define OVERRIDE_POWERPRESENT_VAL (1 << 4)
+#define OVERRIDE_BVALID_VAL (1 << 8)
+
+/* Static DRD configuration */
+#define USB_HOST_DEFAULT_MASK  0xffe
+#define USB_SET_PORT_DEVICE0x1
+
+struct st_dwc3 {
+   struct platform_device *dwc3;   /* platform device pointer */
+   struct device *dev; /* device pointer */
+   void __iomem *glue_base;/* ioaddr for programming the glue */
+   struct regmap *regmap;  /* regmap for getting syscfg */
+   int syscfg_reg_off; /* usb syscfg control offset */
+   bool drd_device_conf;   /* DRD static host/device conf */
+   struct reset_control *rstc_pwrdn;/* Rst control for powerdown*/
+};
+
+static inline u32 st_dwc3_readl(void __iomem *base, u32 offset)
+{
+   return readl_relaxed(base + offset);
+}
+
+static inline void st_dwc3_writel(void __iomem *base, u32 offset, u32 value)
+{
+   writel_relaxed(value, base + offset);
+}
+
+/**
+ * st_dwc3_drd_init: program the port
+ * @dwc3_data: driver private structure
+ * Description: this function is to program the port as either host or device
+ * according to the static configuration passed from devicetree.
+ * OTG and dual role are not yet supported!
+ */
+static int st_dwc3_drd_init(struct st_dwc3 *dwc3_data)
+{
+   u32 val;
+
+   regmap_read(dwc3_data->regmap, dwc3_data->syscfg_reg_off, &val);
+
+   if (dwc3_data->drd_device_conf)
+   val |= USB_SET_PORT_DEVICE;
+   else
+   val &= USB_HOST_DEFAULT_MASK;
+
+  

[PATCH 0/3] Add ST dwc3 glue layer driver.

2014-07-04 Thread Peter Griffin
This series adds support for the ST glue logic to manage the DWC3 HC
on STiH407 SoC family chipsets.

Peter Griffin (3):
  usb: dwc3: add ST dwc3 glue layer to manage dwc3 HC
  ARM: dts: sti: Add st-dwc3 devicetree bindings documentation
  MAINTAINERS: Add dwc3-st.c file to ARCH/STI architecture

 Documentation/devicetree/bindings/usb/dwc3-st.txt |  58 
 MAINTAINERS   |   1 +
 drivers/usb/dwc3/Kconfig  |   9 +
 drivers/usb/dwc3/Makefile |   1 +
 drivers/usb/dwc3/dwc3-st.c| 325 ++
 5 files changed, 394 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/usb/dwc3-st.txt
 create mode 100644 drivers/usb/dwc3/dwc3-st.c

-- 
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 13/13] video: omap: allow building on !MMU

2014-04-24 Thread Peter Griffin
From: Arnd Bergmann 

The omap lcdc driver has an elaborate mmap_kern function
to map the frame buffer into kernel address space as
write-combined. This uses functions that are only available
on MMU-enabled builds.

It does seem equivalent to ioremap_wc though, so we should
be able to just use that instead.

This patch is build-tested only, it needs to be run on real
hardware before applying.

Signed-off-by: Arnd Bergmann 
Signed-off-by: Peter Griffin 
Cc: Jean-Christophe Plagniol-Villard 
Cc: Tomi Valkeinen 
Cc: linux-fb...@vger.kernel.org
Cc: linux-omap@vger.kernel.org
---
 drivers/video/fbdev/omap/lcdc.c |   28 +---
 1 file changed, 5 insertions(+), 23 deletions(-)

diff --git a/drivers/video/fbdev/omap/lcdc.c b/drivers/video/fbdev/omap/lcdc.c
index b52f625..40e8200 100644
--- a/drivers/video/fbdev/omap/lcdc.c
+++ b/drivers/video/fbdev/omap/lcdc.c
@@ -613,29 +613,11 @@ static void lcdc_dma_handler(u16 status, void *data)
 
 static int mmap_kern(void)
 {
-   struct vm_struct*kvma;
-   struct vm_area_struct   vma;
-   pgprot_tpgprot;
-   unsigned long   vaddr;
-
-   kvma = get_vm_area(lcdc.vram_size, VM_IOREMAP);
-   if (kvma == NULL) {
-   dev_err(lcdc.fbdev->dev, "can't get kernel vm area\n");
+   void __iomem *vaddr;
+
+   vaddr = ioremap_wc(lcdc.vram_phys, lcdc.vram_size);
+   if (!vaddr)
return -ENOMEM;
-   }
-   vma.vm_mm = &init_mm;
-
-   vaddr = (unsigned long)kvma->addr;
-   vma.vm_start = vaddr;
-   vma.vm_end = vaddr + lcdc.vram_size;
-
-   pgprot = pgprot_writecombine(pgprot_kernel);
-   if (io_remap_pfn_range(&vma, vaddr,
-  lcdc.vram_phys >> PAGE_SHIFT,
-  lcdc.vram_size, pgprot) < 0) {
-   dev_err(lcdc.fbdev->dev, "kernel mmap for FB memory failed\n");
-   return -EAGAIN;
-   }
 
lcdc.vram_virt = (void *)vaddr;
 
@@ -644,7 +626,7 @@ static int mmap_kern(void)
 
 static void unmap_kern(void)
 {
-   vunmap(lcdc.vram_virt);
+   iounmap(lcdc.vram_virt);
 }
 
 static int alloc_palette_ram(void)
-- 
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 04/13] video/omap: fix modular build

2014-04-24 Thread Peter Griffin
From: Arnd Bergmann 

The framebuffer layer can be a loadable module, which forces
omapfb to be a module as well. However, this breaks the lcd
drivers, which are linked into the omapfb driver but each
have their own module_init() function. To solve this,
we split out the lcd drivers into separate modules and
export omapfb_register_panel, which is the only interface
required between the main omapfb driver and the lcd panel
drivers.

We also have to introduce a new Kconfig symbol for H3, since
that lcd driver has a dependency on TPS65010, which we can
express better in Kconfig than Makefile syntax.

Signed-off-by: Arnd Bergmann 
Signed-off-by: Peter Griffin 
Cc: Jean-Christophe Plagniol-Villard 
Cc: Tomi Valkeinen 
Cc: linux-fb...@vger.kernel.org
Cc: linux-omap@vger.kernel.org
---
 drivers/video/fbdev/omap/Kconfig   |9 +
 drivers/video/fbdev/omap/Makefile  |   23 ---
 drivers/video/fbdev/omap/omapfb_main.c |1 +
 include/linux/omap-dma.h   |2 +-
 4 files changed, 23 insertions(+), 12 deletions(-)

diff --git a/drivers/video/fbdev/omap/Kconfig b/drivers/video/fbdev/omap/Kconfig
index 0bc3a93..18c4cb0 100644
--- a/drivers/video/fbdev/omap/Kconfig
+++ b/drivers/video/fbdev/omap/Kconfig
@@ -39,6 +39,15 @@ config FB_OMAP_LCD_MIPID
  the Mobile Industry Processor Interface DBI-C/DCS
  specification. (Supported LCDs: Philips LPH8923, Sharp LS041Y3)
 
+config FB_OMAP_LCD_H3
+   bool "TPS65010 LCD controller on OMAP-H3"
+   depends on MACH_OMAP_H3
+   depends on TPS65010
+   default y
+   help
+ Say Y here if you want to have support for the LCD on the
+ H3 board.
+
 config FB_OMAP_DMA_TUNE
 bool "Set DMA SDRAM access priority high"
 depends on FB_OMAP
diff --git a/drivers/video/fbdev/omap/Makefile 
b/drivers/video/fbdev/omap/Makefile
index 1927faf..732e071 100644
--- a/drivers/video/fbdev/omap/Makefile
+++ b/drivers/video/fbdev/omap/Makefile
@@ -10,17 +10,18 @@ objs-y$(CONFIG_FB_OMAP_LCDC_EXTERNAL) += sossi.o
 
 objs-y$(CONFIG_FB_OMAP_LCDC_HWA742) += hwa742.o
 
-objs-y$(CONFIG_MACH_AMS_DELTA) += lcd_ams_delta.o
-objs-y$(CONFIG_MACH_OMAP_H3) += lcd_h3.o
-objs-y$(CONFIG_MACH_OMAP_PALMTE) += lcd_palmte.o
-objs-y$(CONFIG_MACH_OMAP_PALMTT) += lcd_palmtt.o
-objs-y$(CONFIG_MACH_OMAP_PALMZ71) += lcd_palmz71.o
-objs-$(CONFIG_ARCH_OMAP16XX)$(CONFIG_MACH_OMAP_INNOVATOR) += lcd_inn1610.o
-objs-$(CONFIG_ARCH_OMAP15XX)$(CONFIG_MACH_OMAP_INNOVATOR) += lcd_inn1510.o
-objs-y$(CONFIG_MACH_OMAP_OSK) += lcd_osk.o
-
-objs-y$(CONFIG_FB_OMAP_LCD_MIPID) += lcd_mipid.o
-objs-y$(CONFIG_MACH_HERALD) += lcd_htcherald.o
+lcds-y$(CONFIG_MACH_AMS_DELTA) += lcd_ams_delta.o
+lcds-y$(CONFIG_FB_OMAP_LCD_H3) += lcd_h3.o
+lcds-y$(CONFIG_MACH_OMAP_PALMTE) += lcd_palmte.o
+lcds-y$(CONFIG_MACH_OMAP_PALMTT) += lcd_palmtt.o
+lcds-y$(CONFIG_MACH_OMAP_PALMZ71) += lcd_palmz71.o
+lcds-$(CONFIG_ARCH_OMAP16XX)$(CONFIG_MACH_OMAP_INNOVATOR) += lcd_inn1610.o
+lcds-$(CONFIG_ARCH_OMAP15XX)$(CONFIG_MACH_OMAP_INNOVATOR) += lcd_inn1510.o
+lcds-y$(CONFIG_MACH_OMAP_OSK) += lcd_osk.o
+
+lcds-y$(CONFIG_FB_OMAP_LCD_MIPID) += lcd_mipid.o
+lcds-y$(CONFIG_MACH_HERALD) += lcd_htcherald.o
 
 omapfb-objs := $(objs-yy)
 
+obj-$(CONFIG_FB_OMAP) += $(lcds-yy)
diff --git a/drivers/video/fbdev/omap/omapfb_main.c 
b/drivers/video/fbdev/omap/omapfb_main.c
index e4fc6d9..d8d028d 100644
--- a/drivers/video/fbdev/omap/omapfb_main.c
+++ b/drivers/video/fbdev/omap/omapfb_main.c
@@ -1823,6 +1823,7 @@ void omapfb_register_panel(struct lcd_panel *panel)
if (fbdev_pdev != NULL)
omapfb_do_probe(fbdev_pdev, fbdev_panel);
 }
+EXPORT_SYMBOL_GPL(omapfb_register_panel);
 
 /* Called when the device is being detached from the driver */
 static int omapfb_remove(struct platform_device *pdev)
diff --git a/include/linux/omap-dma.h b/include/linux/omap-dma.h
index 41a13e7..0a1a2e2 100644
--- a/include/linux/omap-dma.h
+++ b/include/linux/omap-dma.h
@@ -393,7 +393,7 @@ extern int omap_modify_dma_chain_params(int chain_id,
 extern int omap_dma_chain_status(int chain_id);
 #endif
 
-#if defined(CONFIG_ARCH_OMAP1) && defined(CONFIG_FB_OMAP)
+#if defined(CONFIG_ARCH_OMAP1) && IS_ENABLED(CONFIG_FB_OMAP)
 #include 
 #else
 static inline int omap_lcd_dma_running(void)
-- 
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 02/13] video: omap2dss: fix LPAE warnings

2014-04-24 Thread Peter Griffin
From: Arnd Bergmann 

If LPAE is enabled, dma_addr_t is 64 bit, so we have to
change a few type for everything in this driver to match
again.

Signed-off-by: Arnd Bergmann 
Signed-off-by: Peter Griffin 
Cc: Jean-Christophe Plagniol-Villard 
Cc: Tomi Valkeinen 
Cc: linux-fb...@vger.kernel.org
Cc: linux-omap@vger.kernel.org
---
 drivers/video/fbdev/omap2/dss/dispc.c |6 +++---
 include/video/omapdss.h   |4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/video/fbdev/omap2/dss/dispc.c 
b/drivers/video/fbdev/omap2/dss/dispc.c
index f18397c..4fe1431 100644
--- a/drivers/video/fbdev/omap2/dss/dispc.c
+++ b/drivers/video/fbdev/omap2/dss/dispc.c
@@ -2577,9 +2577,9 @@ int dispc_ovl_setup(enum omap_plane plane, const struct 
omap_overlay_info *oi,
 
channel = dispc_ovl_get_channel_out(plane);
 
-   DSSDBG("dispc_ovl_setup %d, pa %x, pa_uv %x, sw %d, %d,%d, %dx%d -> "
-   "%dx%d, cmode %x, rot %d, mir %d, chan %d repl %d\n",
-   plane, oi->paddr, oi->p_uv_addr, oi->screen_width, oi->pos_x,
+   DSSDBG("dispc_ovl_setup %d, pa %pad, pa_uv %pad, sw %d, %d,%d, %dx%d ->"
+   " %dx%d, cmode %x, rot %d, mir %d, chan %d repl %d\n",
+   plane, &oi->paddr, &oi->p_uv_addr, oi->screen_width, oi->pos_x,
oi->pos_y, oi->width, oi->height, oi->out_width, oi->out_height,
oi->color_mode, oi->rotation, oi->mirror, channel, replication);
 
diff --git a/include/video/omapdss.h b/include/video/omapdss.h
index 6adb445..ded61a9 100644
--- a/include/video/omapdss.h
+++ b/include/video/omapdss.h
@@ -388,8 +388,8 @@ struct omap_dss_cpr_coefs {
 };
 
 struct omap_overlay_info {
-   u32 paddr;
-   u32 p_uv_addr;  /* for NV12 format */
+   dma_addr_t paddr;
+   dma_addr_t p_uv_addr;  /* for NV12 format */
u16 screen_width;
u16 width;
u16 height;
-- 
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