devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/5 v10] dt/bindings: Add binding for the DA8xx MUSB driver
@ 2016-03-11  8:29 Petr Kulhavy
       [not found] ` <1457684989-13318-1-git-send-email-petr-Qh/3xLP0EvwAvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 22+ messages in thread
From: Petr Kulhavy @ 2016-03-11  8:29 UTC (permalink / raw)
  To: devicetree-u79uwXL29TY76Z2rM5mHXA, b-liu-l0cyMroinI0
  Cc: robh+dt-DgEjT+Ai2ygdnm+yROfE0A, pawel.moll-5wv7dgnIgG8,
	mark.rutland-5wv7dgnIgG8, ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg,
	galak-sgV2jX0FEOL9JmXXK+q4OQ, petr-Qh/3xLP0EvwAvxtiuMwx3w,
	linux-usb-u79uwXL29TY76Z2rM5mHXA, balbi-DgEjT+Ai2ygdnm+yROfE0A,
	sergei.shtylyov-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8

DT binding for the TI DA8xx/OMAP-L1x/AM17xx/AM18xx MUSB driver.

Signed-off-by: Petr Kulhavy <petr-Qh/3xLP0EvwAvxtiuMwx3w@public.gmane.org>
---
v1: <initial>

v2:
 - using standard properties "dr_mode", "mentor,power", "mentor,num-eps", "mentor,multipoint", "mentor,ram-bits"
 - using "ti," prefix instead of "da8xx," for specific property names
 - no wildcards in compatibility string

v3:
 - added "reg", "interrupts" and "interrupt-names" properties
 - wildcards in compatibility string

v4:
 - compatibility string set to "ti,da830-musb"
 - "mentor,num-eps", "mentor,multipoint", "mentor,ram-bits" properties removed and hardcoded
 - "ti,phy20-clkmux-cfg" renamed to "ti,phy20-clkmux-pll" and changed to boolean
 - removed "ti,hwmods"

v5:
 - "ti,phy20-refclock-frequency" property made mandatory

v6:
 - using "ti,usb2-phy-" prefix instead of "ti,phy20-" for the specific properties

v7:
 - removed the "mentor,power" property; hard coded to 500mA in the code

v8:
 - "ti,usb2-phy-refclock-frequency" renamed to "ti,usb2-phy-refclock-hz" and description amended
 - "ti,usb2-phy-clkmux-pll" changed to "ti,usb2-phy-clkmux-refclkin" to reflect the more common case
 - USB maximum power modelled via a regulator "vbus-supply"

v9: <no change>
v10: <no change>

 .../devicetree/bindings/usb/da8xx-usb.txt          | 45 ++++++++++++++++++++++
 1 file changed, 45 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/usb/da8xx-usb.txt

diff --git a/Documentation/devicetree/bindings/usb/da8xx-usb.txt b/Documentation/devicetree/bindings/usb/da8xx-usb.txt
new file mode 100644
index 0000000..a6eda5b
--- /dev/null
+++ b/Documentation/devicetree/bindings/usb/da8xx-usb.txt
@@ -0,0 +1,45 @@
+TI DA8xx MUSB
+~~~~~~~~~~~~~
+For DA8xx/OMAP-L1x/AM17xx/AM18xx platforms.
+
+Required properties:
+~~~~~~~~~~~~~~~~~~~~
+ - compatible : Should be set to "ti,da830-musb".
+
+ - reg: Offset and length of the USB controller register set.
+
+ - interrupts: The USB interrupt number.
+
+ - interrupt-names: Should be set to "mc".
+
+ - dr_mode: The USB operation mode. Should be one of "host", "peripheral" or "otg".
+
+ - vbus-supply: Phandle to a regulator providing the USB bus power.
+
+ - ti,usb2-phy-refclock-hz : Integer. Frequency in Hz of the USB 2.0 PHY reference clock,
+     either provided by the internal PLL or an external source.
+     The supported values are: 12MHz, 13MHz, 19.2MHz, 20MHz, 24MHz, 26MHz, 38.4MHz, 40MHz, 48MHz.
+
+
+Optional properties:
+~~~~~~~~~~~~~~~~~~~~
+ - ti,usb2-phy-clkmux-refclkin: Boolean. Defines the USB 2.0 PHY reference clock source.
+     If present the the external USB_REFCLKIN pin is used as a clock source, otherwise
+     the internal PLL is used.
+
+Example:
+
+	usb20: usb@1e00000 {
+		compatible = "ti,da830-musb";
+		reg =   <0x00200000 0x10000>;
+		interrupt-parent = <&intc>;
+		interrupts = <58>;
+		interrupt-names = "mc";
+
+		dr_mode = "host";
+		vbus-supply = <&usb_vbus>;
+
+		ti,usb2-phy-refclock-hz = <24000000>;
+
+		status = "okay";
+	};
-- 
1.9.1

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

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 2/5 v10] usb: musb: core: added helper function for parsing DT
       [not found] ` <1457684989-13318-1-git-send-email-petr-Qh/3xLP0EvwAvxtiuMwx3w@public.gmane.org>
@ 2016-03-11  8:29   ` Petr Kulhavy
  2016-03-11  8:29   ` [PATCH 3/5 v10] usb: musb: core: added missing const qualifier to musb_hdrc_platform_data::config Petr Kulhavy
                     ` (6 subsequent siblings)
  7 siblings, 0 replies; 22+ messages in thread
From: Petr Kulhavy @ 2016-03-11  8:29 UTC (permalink / raw)
  To: devicetree-u79uwXL29TY76Z2rM5mHXA, b-liu-l0cyMroinI0
  Cc: robh+dt-DgEjT+Ai2ygdnm+yROfE0A, pawel.moll-5wv7dgnIgG8,
	mark.rutland-5wv7dgnIgG8, ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg,
	galak-sgV2jX0FEOL9JmXXK+q4OQ, petr-Qh/3xLP0EvwAvxtiuMwx3w,
	linux-usb-u79uwXL29TY76Z2rM5mHXA, balbi-DgEjT+Ai2ygdnm+yROfE0A,
	sergei.shtylyov-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8

This adds the function musb_get_mode() to get the DT property "dr_mode"

Signed-off-by: Petr Kulhavy <petr-Qh/3xLP0EvwAvxtiuMwx3w@public.gmane.org>
Acked-by: Sergei Shtylyov <sergei.shtylyov-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>
---
v4: <initial>
 - created musb_get_dr_mode()

v5:
 - musb_get_dr_mode() renamed to musb_get_mode()
 - added musb_get_power()

v6:
 - musb_get_power() : added missing boundary check for the maximum value 510mA
 - formatting
 - added empty implementation of musb_get_power()

v7:
 - removed empty implementation of musb_get_power()
 - musb_get_mode() returns MUSB_OTG if the property is not found

v8:
 - musb_get_power() removed

v9: <no change>
v10: <no change>

 drivers/usb/musb/musb_core.c | 19 +++++++++++++++++++
 drivers/usb/musb/musb_core.h |  5 +++++
 2 files changed, 24 insertions(+)

diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index c3791a0..6a2d6d3 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -100,6 +100,7 @@
 #include <linux/io.h>
 #include <linux/dma-mapping.h>
 #include <linux/usb.h>
+#include <linux/usb/of.h>
 
 #include "musb_core.h"
 
@@ -129,6 +130,24 @@ static inline struct musb *dev_to_musb(struct device *dev)
 	return dev_get_drvdata(dev);
 }
 
+enum musb_mode musb_get_mode(struct device *dev)
+{
+	enum usb_dr_mode mode;
+
+	mode = usb_get_dr_mode(dev);
+	switch (mode) {
+	case USB_DR_MODE_HOST:
+		return MUSB_HOST;
+	case USB_DR_MODE_PERIPHERAL:
+		return MUSB_PERIPHERAL;
+	case USB_DR_MODE_OTG:
+	case USB_DR_MODE_UNKNOWN:
+	default:
+		return MUSB_OTG;
+	}
+}
+EXPORT_SYMBOL_GPL(musb_get_mode);
+
 /*-------------------------------------------------------------------------*/
 
 #ifndef CONFIG_BLACKFIN
diff --git a/drivers/usb/musb/musb_core.h b/drivers/usb/musb/musb_core.h
index fd215fb..3f7a325 100644
--- a/drivers/usb/musb/musb_core.h
+++ b/drivers/usb/musb/musb_core.h
@@ -614,4 +614,9 @@ static inline void musb_platform_post_root_reset_end(struct musb *musb)
 		musb->ops->post_root_reset_end(musb);
 }
 
+/* gets the "dr_mode" property from DT and converts it into musb_mode
+ * if the property is not found or not recognized returns MUSB_OTG
+ */
+extern enum musb_mode musb_get_mode(struct device *dev);
+
 #endif	/* __MUSB_CORE_H__ */
-- 
1.9.1

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

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 3/5 v10] usb: musb: core: added missing const qualifier to musb_hdrc_platform_data::config
       [not found] ` <1457684989-13318-1-git-send-email-petr-Qh/3xLP0EvwAvxtiuMwx3w@public.gmane.org>
  2016-03-11  8:29   ` [PATCH 2/5 v10] usb: musb: core: added helper function for parsing DT Petr Kulhavy
@ 2016-03-11  8:29   ` Petr Kulhavy
       [not found]     ` <1457684989-13318-3-git-send-email-petr-Qh/3xLP0EvwAvxtiuMwx3w@public.gmane.org>
  2016-03-11  8:29   ` [PATCH 4/5 v10] ARM: davinci: defined missing CFGCHIP2_REFFREQ_* macros for MUSB PHY Petr Kulhavy
                     ` (5 subsequent siblings)
  7 siblings, 1 reply; 22+ messages in thread
From: Petr Kulhavy @ 2016-03-11  8:29 UTC (permalink / raw)
  To: devicetree-u79uwXL29TY76Z2rM5mHXA, b-liu-l0cyMroinI0
  Cc: robh+dt-DgEjT+Ai2ygdnm+yROfE0A, pawel.moll-5wv7dgnIgG8,
	mark.rutland-5wv7dgnIgG8, ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg,
	galak-sgV2jX0FEOL9JmXXK+q4OQ, petr-Qh/3xLP0EvwAvxtiuMwx3w,
	linux-usb-u79uwXL29TY76Z2rM5mHXA, balbi-DgEjT+Ai2ygdnm+yROfE0A,
	sergei.shtylyov-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8

The musb_hdrc_platform_data::config was defined as a non-const pointer.
However some drivers (e.g. the ux500) set up this pointer to point to a
static structure, which is potentially dangerous. Since the musb core
uses the pointer in a read-only manner the const qualifier was added to
protect the content of the config.

Signed-off-by: Petr Kulhavy <petr-Qh/3xLP0EvwAvxtiuMwx3w@public.gmane.org>
Acked-by: Sergei Shtylyov <sergei.shtylyov-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>
Signed-off-by: Bin Liu <b-liu-l0cyMroinI0@public.gmane.org>
---
v5: <initial>

v6:
 - whitespace formatting corrected

v7: <no change>
v8: <no change>
v9: <no change>
v10: <no change>

 drivers/usb/musb/musb_core.c | 2 +-
 drivers/usb/musb/musb_core.h | 2 +-
 include/linux/usb/musb.h     | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index 6a2d6d3..b0be1a9 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -1920,7 +1920,7 @@ static void musb_recover_from_babble(struct musb *musb)
  */
 
 static struct musb *allocate_instance(struct device *dev,
-		struct musb_hdrc_config *config, void __iomem *mbase)
+		const struct musb_hdrc_config *config, void __iomem *mbase)
 {
 	struct musb		*musb;
 	struct musb_hw_ep	*ep;
diff --git a/drivers/usb/musb/musb_core.h b/drivers/usb/musb/musb_core.h
index 3f7a325..a062185 100644
--- a/drivers/usb/musb/musb_core.h
+++ b/drivers/usb/musb/musb_core.h
@@ -438,7 +438,7 @@ struct musb {
 	 */
 	unsigned                double_buffer_not_ok:1;
 
-	struct musb_hdrc_config	*config;
+	const struct musb_hdrc_config *config;
 
 	int			xceiv_old_state;
 #ifdef CONFIG_DEBUG_FS
diff --git a/include/linux/usb/musb.h b/include/linux/usb/musb.h
index 96ddfb7..0b3da40 100644
--- a/include/linux/usb/musb.h
+++ b/include/linux/usb/musb.h
@@ -124,7 +124,7 @@ struct musb_hdrc_platform_data {
 	int		(*set_power)(int state);
 
 	/* MUSB configuration-specific details */
-	struct musb_hdrc_config	*config;
+	const struct musb_hdrc_config *config;
 
 	/* Architecture specific board data	*/
 	void		*board_data;
-- 
1.9.1

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

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 4/5 v10] ARM: davinci: defined missing CFGCHIP2_REFFREQ_* macros for MUSB PHY
       [not found] ` <1457684989-13318-1-git-send-email-petr-Qh/3xLP0EvwAvxtiuMwx3w@public.gmane.org>
  2016-03-11  8:29   ` [PATCH 2/5 v10] usb: musb: core: added helper function for parsing DT Petr Kulhavy
  2016-03-11  8:29   ` [PATCH 3/5 v10] usb: musb: core: added missing const qualifier to musb_hdrc_platform_data::config Petr Kulhavy
@ 2016-03-11  8:29   ` Petr Kulhavy
  2016-03-11  8:29   ` [PATCH 5/5 v10] usb: musb: da8xx: Add DT support for the DA8xx driver Petr Kulhavy
                     ` (4 subsequent siblings)
  7 siblings, 0 replies; 22+ messages in thread
From: Petr Kulhavy @ 2016-03-11  8:29 UTC (permalink / raw)
  To: devicetree-u79uwXL29TY76Z2rM5mHXA, b-liu-l0cyMroinI0
  Cc: robh+dt-DgEjT+Ai2ygdnm+yROfE0A, pawel.moll-5wv7dgnIgG8,
	mark.rutland-5wv7dgnIgG8, ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg,
	galak-sgV2jX0FEOL9JmXXK+q4OQ, petr-Qh/3xLP0EvwAvxtiuMwx3w,
	linux-usb-u79uwXL29TY76Z2rM5mHXA, balbi-DgEjT+Ai2ygdnm+yROfE0A,
	sergei.shtylyov-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8

Only few MUSB PHY reference clock  frequencies were defined.
This patch defines macros for the missing frequencies:
19.2MHz, 38.4MHz, 13MHz, 26MHz, 20MHz, 40MHz

Signed-off-by: Petr Kulhavy <petr-Qh/3xLP0EvwAvxtiuMwx3w@public.gmane.org>
Acked-by: Sergei Shtylyov <sergei.shtylyov-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>
Signed-off-by: Bin Liu <b-liu-l0cyMroinI0@public.gmane.org>
---
v5: <initial>
v6: <no change>
v7: <no change>
v8: <no change>
v9: <no change>
v10: <no change>

 include/linux/platform_data/usb-davinci.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/include/linux/platform_data/usb-davinci.h b/include/linux/platform_data/usb-davinci.h
index e0bc4ab..961d3dc 100644
--- a/include/linux/platform_data/usb-davinci.h
+++ b/include/linux/platform_data/usb-davinci.h
@@ -33,6 +33,12 @@
 #define CFGCHIP2_REFFREQ_12MHZ	(1 << 0)
 #define CFGCHIP2_REFFREQ_24MHZ	(2 << 0)
 #define CFGCHIP2_REFFREQ_48MHZ	(3 << 0)
+#define CFGCHIP2_REFFREQ_19_2MHZ	(4 << 0)
+#define CFGCHIP2_REFFREQ_38_4MHZ	(5 << 0)
+#define CFGCHIP2_REFFREQ_13MHZ	(6 << 0)
+#define CFGCHIP2_REFFREQ_26MHZ	(7 << 0)
+#define CFGCHIP2_REFFREQ_20MHZ	(8 << 0)
+#define CFGCHIP2_REFFREQ_40MHZ	(9 << 0)
 
 struct	da8xx_ohci_root_hub;
 
-- 
1.9.1

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

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 5/5 v10] usb: musb: da8xx: Add DT support for the DA8xx driver
       [not found] ` <1457684989-13318-1-git-send-email-petr-Qh/3xLP0EvwAvxtiuMwx3w@public.gmane.org>
                     ` (2 preceding siblings ...)
  2016-03-11  8:29   ` [PATCH 4/5 v10] ARM: davinci: defined missing CFGCHIP2_REFFREQ_* macros for MUSB PHY Petr Kulhavy
@ 2016-03-11  8:29   ` Petr Kulhavy
       [not found]     ` <1457684989-13318-5-git-send-email-petr-Qh/3xLP0EvwAvxtiuMwx3w@public.gmane.org>
  2016-03-11 11:24   ` [PATCH 1/5 v10] dt/bindings: Add binding for the DA8xx MUSB driver Sergei Shtylyov
                     ` (3 subsequent siblings)
  7 siblings, 1 reply; 22+ messages in thread
From: Petr Kulhavy @ 2016-03-11  8:29 UTC (permalink / raw)
  To: devicetree-u79uwXL29TY76Z2rM5mHXA, b-liu-l0cyMroinI0
  Cc: robh+dt-DgEjT+Ai2ygdnm+yROfE0A, pawel.moll-5wv7dgnIgG8,
	mark.rutland-5wv7dgnIgG8, ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg,
	galak-sgV2jX0FEOL9JmXXK+q4OQ, petr-Qh/3xLP0EvwAvxtiuMwx3w,
	linux-usb-u79uwXL29TY76Z2rM5mHXA, balbi-DgEjT+Ai2ygdnm+yROfE0A,
	sergei.shtylyov-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8

This adds DT support for TI DA8xx/OMAP-L1x/AM17xx/AM18xx MUSB driver

Signed-off-by: Petr Kulhavy <petr-Qh/3xLP0EvwAvxtiuMwx3w@public.gmane.org>
Tested-by: Petr Kulhavy <petr-Qh/3xLP0EvwAvxtiuMwx3w@public.gmane.org>
---
v1: <initial>

v2:
 - using standard MUSB properties "dr_mode", "mentor,power", "mentor,num-eps", "mentor,multipoint", "mentor,ram-bits"
 - using "ti," prefix instead of "da8xx," for specific property names
 - no wilcards in compatibility string
 - using CFGCHIP2_USB2PHYCLKMUX_SHIFT instead of CFGCHIP2_USB2PHYCLKMUX_OFFSET

v3:
 - DMA mask initialization corrected
 - removed extra #ifdef CONFIG_OF

v4:
 - compatibility string set to "ti,da830-musb"
 - "mentor,num-eps", "mentor,multipoint", "mentor,ram-bits" properties removed and hardcoded
 - "ti,phy20-clkmux-cfg" renamed to "ti,phy20-clkmux-pll" and changed to boolean
 - removed use of the DA8XX_SYSCFG0_VIRT macro

v5:
 - using CFGCHIP2_REFFREQ_ in get_phy_refclk_cfg()
 - simplified initialization of the hard coded config parameters
 - optimization CFGCHIP2 register update

v6:
 - using "ti,usb2-phy-" prefix instead of "ti,phy20-" for the specific properties
 - optimization CFGCHIP2 register update
 
v7:
 - pdata::power hard coded to 500mA

v8:
 - USB maximum power modelled via a regulator "vbus-supply"
 - "ti,usb2-phy-refclock-frequency" renamed to "ti,usb2-phy-refclock-hz"
 - "ti,usb2-phy-clkmux-pll" changed to "ti,usb2-phy-clkmux-refclkin" and the boolean meaning inverted to reflect the more common case

v9:
 - power regulator used only to get the current

v10:
 - corrected current calculation in get_vbus_power (missing divide by 2)

 drivers/usb/musb/da8xx.c | 106 +++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 106 insertions(+)

diff --git a/drivers/usb/musb/da8xx.c b/drivers/usb/musb/da8xx.c
index b03d3b8..52f2c3d 100644
--- a/drivers/usb/musb/da8xx.c
+++ b/drivers/usb/musb/da8xx.c
@@ -6,6 +6,9 @@
  * Based on the DaVinci "glue layer" code.
  * Copyright (C) 2005-2006 by Texas Instruments
  *
+ * DT support
+ * Copyright (c) 2016 Petr Kulhavy, Barix AG <petr-Qh/3xLP0EvwAvxtiuMwx3w@public.gmane.org>
+ *
  * This file is part of the Inventra Controller Driver for Linux.
  *
  * The Inventra Controller Driver for Linux is free software; you
@@ -33,9 +36,11 @@
 #include <linux/platform_device.h>
 #include <linux/dma-mapping.h>
 #include <linux/usb/usb_phy_generic.h>
+#include <linux/regulator/consumer.h>
 
 #include <mach/da8xx.h>
 #include <linux/platform_data/usb-davinci.h>
+#include <linux/of_platform.h>
 
 #include "musb_core.h"
 
@@ -134,6 +139,55 @@ static inline void phy_off(void)
 	__raw_writel(cfgchip2, CFGCHIP2);
 }
 
+static inline int get_phy_refclk_cfg(struct device_node *np)
+{
+	u32 freq;
+
+	if (of_property_read_u32(np, "ti,usb2-phy-refclock-hz", &freq))
+		return -EINVAL;
+
+	switch (freq) {
+	case 12000000:
+		return CFGCHIP2_REFFREQ_12MHZ;
+	case 13000000:
+		return CFGCHIP2_REFFREQ_13MHZ;
+	case 19200000:
+		return CFGCHIP2_REFFREQ_19_2MHZ;
+	case 20000000:
+		return CFGCHIP2_REFFREQ_20MHZ;
+	case 24000000:
+		return CFGCHIP2_REFFREQ_24MHZ;
+	case 26000000:
+		return CFGCHIP2_REFFREQ_26MHZ;
+	case 38400000:
+		return CFGCHIP2_REFFREQ_38_4MHZ;
+	case 40000000:
+		return CFGCHIP2_REFFREQ_40MHZ;
+	case 48000000:
+		return CFGCHIP2_REFFREQ_48MHZ;
+	default:
+		return -EINVAL;
+	}
+}
+
+static inline u8 get_vbus_power(struct device *dev)
+{
+	struct regulator *vbus_supply;
+	int current_uA;
+
+	vbus_supply = regulator_get(dev, "vbus");
+	if (IS_ERR(vbus_supply))
+		return 255;
+
+	current_uA = regulator_get_current_limit(vbus_supply);
+	regulator_put(vbus_supply);
+
+	if (current_uA <= 0 || current_uA > 510000)
+		return 255;
+
+	return current_uA / 1000 / 2;
+}
+
 /*
  * Because we don't set CTRL.UINT, it's "important" to:
  *	- not read/write INTRUSB/INTRUSBE (except during
@@ -482,6 +536,12 @@ static const struct platform_device_info da8xx_dev_info = {
 	.dma_mask	= DMA_BIT_MASK(32),
 };
 
+static const struct musb_hdrc_config da8xx_config = {
+	.ram_bits = 10,
+	.num_eps = 5,
+	.multipoint = 1,
+};
+
 static int da8xx_probe(struct platform_device *pdev)
 {
 	struct resource musb_resources[2];
@@ -490,6 +550,7 @@ static int da8xx_probe(struct platform_device *pdev)
 	struct da8xx_glue		*glue;
 	struct platform_device_info	pinfo;
 	struct clk			*clk;
+	struct device_node		*np = pdev->dev.of_node;
 
 	int				ret = -ENOMEM;
 
@@ -515,6 +576,42 @@ static int da8xx_probe(struct platform_device *pdev)
 	glue->dev			= &pdev->dev;
 	glue->clk			= clk;
 
+	if (IS_ENABLED(CONFIG_OF) && np) {
+		int refclk_cfg;
+		u32 cfgchip2;
+
+		pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
+		if (!pdata) {
+			ret = -ENOMEM;
+			goto err5;
+		}
+
+		pdata->config	= &da8xx_config;
+		pdata->mode	= musb_get_mode(&pdev->dev);
+		pdata->power	= get_vbus_power(&pdev->dev);
+
+		refclk_cfg = get_phy_refclk_cfg(np);
+		if (refclk_cfg < 0) {
+			dev_err(&pdev->dev,
+				"PHY 2.0 clock frequency invalid or undefined\n");
+			ret = -EINVAL;
+			goto err5;
+		}
+
+		cfgchip2 = __raw_readl(CFGCHIP2);
+		cfgchip2 &= ~(CFGCHIP2_USB2PHYCLKMUX | CFGCHIP2_REFFREQ);
+
+		/*
+		 * optional parameter reference clock source
+		 * false = use PLL, true = use the external clock pin
+		 */
+		if (!of_property_read_bool(np, "ti,usb2-phy-clkmux-refclkin"))
+			cfgchip2 |=  CFGCHIP2_USB2PHYCLKMUX;
+		cfgchip2 |=  refclk_cfg;
+
+		__raw_writel(cfgchip2, CFGCHIP2);
+	}
+
 	pdata->platform_ops		= &da8xx_ops;
 
 	glue->phy = usb_phy_generic_register();
@@ -582,11 +679,20 @@ static int da8xx_remove(struct platform_device *pdev)
 	return 0;
 }
 
+static const struct of_device_id da8xx_id_table[] = {
+	{
+		.compatible = "ti,da830-musb",
+	},
+	{},
+};
+MODULE_DEVICE_TABLE(of, da8xx_id_table);
+
 static struct platform_driver da8xx_driver = {
 	.probe		= da8xx_probe,
 	.remove		= da8xx_remove,
 	.driver		= {
 		.name	= "musb-da8xx",
+		.of_match_table = of_match_ptr(da8xx_id_table),
 	},
 };
 
-- 
1.9.1

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

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* Re: [PATCH 5/5 v10] usb: musb: da8xx: Add DT support for the DA8xx driver
       [not found]     ` <1457684989-13318-5-git-send-email-petr-Qh/3xLP0EvwAvxtiuMwx3w@public.gmane.org>
@ 2016-03-11 11:22       ` Sergei Shtylyov
  0 siblings, 0 replies; 22+ messages in thread
From: Sergei Shtylyov @ 2016-03-11 11:22 UTC (permalink / raw)
  To: Petr Kulhavy, devicetree-u79uwXL29TY76Z2rM5mHXA, b-liu-l0cyMroinI0
  Cc: robh+dt-DgEjT+Ai2ygdnm+yROfE0A, pawel.moll-5wv7dgnIgG8,
	mark.rutland-5wv7dgnIgG8, ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg,
	galak-sgV2jX0FEOL9JmXXK+q4OQ, linux-usb-u79uwXL29TY76Z2rM5mHXA,
	balbi-DgEjT+Ai2ygdnm+yROfE0A

Hello.

On 3/11/2016 11:29 AM, Petr Kulhavy wrote:

> This adds DT support for TI DA8xx/OMAP-L1x/AM17xx/AM18xx MUSB driver
>
> Signed-off-by: Petr Kulhavy <petr-Qh/3xLP0EvwAvxtiuMwx3w@public.gmane.org>
> Tested-by: Petr Kulhavy <petr-Qh/3xLP0EvwAvxtiuMwx3w@public.gmane.org>

    Author's own "Tested-by:" tag is assumed, no need to specify it.

Acked-by: Sergei Shtylyov <sergei.shtylyov-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>

    Though using the clk API seems a good idea still...

[...]

MBR, Sergei

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

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 1/5 v10] dt/bindings: Add binding for the DA8xx MUSB driver
       [not found] ` <1457684989-13318-1-git-send-email-petr-Qh/3xLP0EvwAvxtiuMwx3w@public.gmane.org>
                     ` (3 preceding siblings ...)
  2016-03-11  8:29   ` [PATCH 5/5 v10] usb: musb: da8xx: Add DT support for the DA8xx driver Petr Kulhavy
@ 2016-03-11 11:24   ` Sergei Shtylyov
  2016-03-11 15:51   ` Bin Liu
                     ` (2 subsequent siblings)
  7 siblings, 0 replies; 22+ messages in thread
From: Sergei Shtylyov @ 2016-03-11 11:24 UTC (permalink / raw)
  To: Petr Kulhavy, devicetree-u79uwXL29TY76Z2rM5mHXA, b-liu-l0cyMroinI0
  Cc: robh+dt-DgEjT+Ai2ygdnm+yROfE0A, pawel.moll-5wv7dgnIgG8,
	mark.rutland-5wv7dgnIgG8, ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg,
	galak-sgV2jX0FEOL9JmXXK+q4OQ, linux-usb-u79uwXL29TY76Z2rM5mHXA,
	balbi-DgEjT+Ai2ygdnm+yROfE0A

On 3/11/2016 11:29 AM, Petr Kulhavy wrote:

> DT binding for the TI DA8xx/OMAP-L1x/AM17xx/AM18xx MUSB driver.
>
> Signed-off-by: Petr Kulhavy <petr-Qh/3xLP0EvwAvxtiuMwx3w@public.gmane.org>

Acked-by: Sergei Shtylyov <sergei.shtylyov-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>

MBR, Sergei

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

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 1/5 v10] dt/bindings: Add binding for the DA8xx MUSB driver
       [not found] ` <1457684989-13318-1-git-send-email-petr-Qh/3xLP0EvwAvxtiuMwx3w@public.gmane.org>
                     ` (4 preceding siblings ...)
  2016-03-11 11:24   ` [PATCH 1/5 v10] dt/bindings: Add binding for the DA8xx MUSB driver Sergei Shtylyov
@ 2016-03-11 15:51   ` Bin Liu
  2016-03-11 15:58     ` Petr Kulhavy
  2016-03-11 18:27     ` Sergei Shtylyov
  2016-03-14  7:00   ` Felipe Balbi
  2016-03-18 19:14   ` Rob Herring
  7 siblings, 2 replies; 22+ messages in thread
From: Bin Liu @ 2016-03-11 15:51 UTC (permalink / raw)
  To: Petr Kulhavy
  Cc: devicetree-u79uwXL29TY76Z2rM5mHXA,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A, pawel.moll-5wv7dgnIgG8,
	mark.rutland-5wv7dgnIgG8, ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg,
	galak-sgV2jX0FEOL9JmXXK+q4OQ, linux-usb-u79uwXL29TY76Z2rM5mHXA,
	balbi-DgEjT+Ai2ygdnm+yROfE0A,
	sergei.shtylyov-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8

Hi,

On Fri, Mar 11, 2016 at 09:29:45AM +0100, Petr Kulhavy wrote:
> DT binding for the TI DA8xx/OMAP-L1x/AM17xx/AM18xx MUSB driver.

It seems the dts(i) file is not touched in this patch set, so DA8xx MUSB
still does not use DT with these patches?  Or did I miss anything?

Thanks,
-Bin.

> 
> Signed-off-by: Petr Kulhavy <petr-Qh/3xLP0EvwAvxtiuMwx3w@public.gmane.org>
> ---
> v1: <initial>
> 
> v2:
>  - using standard properties "dr_mode", "mentor,power", "mentor,num-eps", "mentor,multipoint", "mentor,ram-bits"
>  - using "ti," prefix instead of "da8xx," for specific property names
>  - no wildcards in compatibility string
> 
> v3:
>  - added "reg", "interrupts" and "interrupt-names" properties
>  - wildcards in compatibility string
> 
> v4:
>  - compatibility string set to "ti,da830-musb"
>  - "mentor,num-eps", "mentor,multipoint", "mentor,ram-bits" properties removed and hardcoded
>  - "ti,phy20-clkmux-cfg" renamed to "ti,phy20-clkmux-pll" and changed to boolean
>  - removed "ti,hwmods"
> 
> v5:
>  - "ti,phy20-refclock-frequency" property made mandatory
> 
> v6:
>  - using "ti,usb2-phy-" prefix instead of "ti,phy20-" for the specific properties
> 
> v7:
>  - removed the "mentor,power" property; hard coded to 500mA in the code
> 
> v8:
>  - "ti,usb2-phy-refclock-frequency" renamed to "ti,usb2-phy-refclock-hz" and description amended
>  - "ti,usb2-phy-clkmux-pll" changed to "ti,usb2-phy-clkmux-refclkin" to reflect the more common case
>  - USB maximum power modelled via a regulator "vbus-supply"
> 
> v9: <no change>
> v10: <no change>
> 
>  .../devicetree/bindings/usb/da8xx-usb.txt          | 45 ++++++++++++++++++++++
>  1 file changed, 45 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/usb/da8xx-usb.txt
> 
> diff --git a/Documentation/devicetree/bindings/usb/da8xx-usb.txt b/Documentation/devicetree/bindings/usb/da8xx-usb.txt
> new file mode 100644
> index 0000000..a6eda5b
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/usb/da8xx-usb.txt
> @@ -0,0 +1,45 @@
> +TI DA8xx MUSB
> +~~~~~~~~~~~~~
> +For DA8xx/OMAP-L1x/AM17xx/AM18xx platforms.
> +
> +Required properties:
> +~~~~~~~~~~~~~~~~~~~~
> + - compatible : Should be set to "ti,da830-musb".
> +
> + - reg: Offset and length of the USB controller register set.
> +
> + - interrupts: The USB interrupt number.
> +
> + - interrupt-names: Should be set to "mc".
> +
> + - dr_mode: The USB operation mode. Should be one of "host", "peripheral" or "otg".
> +
> + - vbus-supply: Phandle to a regulator providing the USB bus power.
> +
> + - ti,usb2-phy-refclock-hz : Integer. Frequency in Hz of the USB 2.0 PHY reference clock,
> +     either provided by the internal PLL or an external source.
> +     The supported values are: 12MHz, 13MHz, 19.2MHz, 20MHz, 24MHz, 26MHz, 38.4MHz, 40MHz, 48MHz.
> +
> +
> +Optional properties:
> +~~~~~~~~~~~~~~~~~~~~
> + - ti,usb2-phy-clkmux-refclkin: Boolean. Defines the USB 2.0 PHY reference clock source.
> +     If present the the external USB_REFCLKIN pin is used as a clock source, otherwise
> +     the internal PLL is used.
> +
> +Example:
> +
> +	usb20: usb@1e00000 {
> +		compatible = "ti,da830-musb";
> +		reg =   <0x00200000 0x10000>;
> +		interrupt-parent = <&intc>;
> +		interrupts = <58>;
> +		interrupt-names = "mc";
> +
> +		dr_mode = "host";
> +		vbus-supply = <&usb_vbus>;
> +
> +		ti,usb2-phy-refclock-hz = <24000000>;
> +
> +		status = "okay";
> +	};
> -- 
> 1.9.1
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 3/5 v10] usb: musb: core: added missing const qualifier to musb_hdrc_platform_data::config
       [not found]     ` <1457684989-13318-3-git-send-email-petr-Qh/3xLP0EvwAvxtiuMwx3w@public.gmane.org>
@ 2016-03-11 15:54       ` Bin Liu
  0 siblings, 0 replies; 22+ messages in thread
From: Bin Liu @ 2016-03-11 15:54 UTC (permalink / raw)
  To: Petr Kulhavy
  Cc: devicetree-u79uwXL29TY76Z2rM5mHXA,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A, pawel.moll-5wv7dgnIgG8,
	mark.rutland-5wv7dgnIgG8, ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg,
	galak-sgV2jX0FEOL9JmXXK+q4OQ, linux-usb-u79uwXL29TY76Z2rM5mHXA,
	balbi-DgEjT+Ai2ygdnm+yROfE0A,
	sergei.shtylyov-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8

Hi,

On Fri, Mar 11, 2016 at 09:29:47AM +0100, Petr Kulhavy wrote:
> The musb_hdrc_platform_data::config was defined as a non-const pointer.
> However some drivers (e.g. the ux500) set up this pointer to point to a
> static structure, which is potentially dangerous. Since the musb core
> uses the pointer in a read-only manner the const qualifier was added to
> protect the content of the config.
> 
> Signed-off-by: Petr Kulhavy <petr-Qh/3xLP0EvwAvxtiuMwx3w@public.gmane.org>
> Acked-by: Sergei Shtylyov <sergei.shtylyov-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>
> Signed-off-by: Bin Liu <b-liu-l0cyMroinI0@public.gmane.org>

It is okay now, but I don't remember I've given my Signed-off-by to this
patch yet.

Regards,
-Bin.

> ---
> v5: <initial>
> 
> v6:
>  - whitespace formatting corrected
> 
> v7: <no change>
> v8: <no change>
> v9: <no change>
> v10: <no change>
> 
>  drivers/usb/musb/musb_core.c | 2 +-
>  drivers/usb/musb/musb_core.h | 2 +-
>  include/linux/usb/musb.h     | 2 +-
>  3 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
> index 6a2d6d3..b0be1a9 100644
> --- a/drivers/usb/musb/musb_core.c
> +++ b/drivers/usb/musb/musb_core.c
> @@ -1920,7 +1920,7 @@ static void musb_recover_from_babble(struct musb *musb)
>   */
>  
>  static struct musb *allocate_instance(struct device *dev,
> -		struct musb_hdrc_config *config, void __iomem *mbase)
> +		const struct musb_hdrc_config *config, void __iomem *mbase)
>  {
>  	struct musb		*musb;
>  	struct musb_hw_ep	*ep;
> diff --git a/drivers/usb/musb/musb_core.h b/drivers/usb/musb/musb_core.h
> index 3f7a325..a062185 100644
> --- a/drivers/usb/musb/musb_core.h
> +++ b/drivers/usb/musb/musb_core.h
> @@ -438,7 +438,7 @@ struct musb {
>  	 */
>  	unsigned                double_buffer_not_ok:1;
>  
> -	struct musb_hdrc_config	*config;
> +	const struct musb_hdrc_config *config;
>  
>  	int			xceiv_old_state;
>  #ifdef CONFIG_DEBUG_FS
> diff --git a/include/linux/usb/musb.h b/include/linux/usb/musb.h
> index 96ddfb7..0b3da40 100644
> --- a/include/linux/usb/musb.h
> +++ b/include/linux/usb/musb.h
> @@ -124,7 +124,7 @@ struct musb_hdrc_platform_data {
>  	int		(*set_power)(int state);
>  
>  	/* MUSB configuration-specific details */
> -	struct musb_hdrc_config	*config;
> +	const struct musb_hdrc_config *config;
>  
>  	/* Architecture specific board data	*/
>  	void		*board_data;
> -- 
> 1.9.1
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 1/5 v10] dt/bindings: Add binding for the DA8xx MUSB driver
  2016-03-11 15:51   ` Bin Liu
@ 2016-03-11 15:58     ` Petr Kulhavy
       [not found]       ` <56E2EB3C.6080602-Qh/3xLP0EvwAvxtiuMwx3w@public.gmane.org>
  2016-03-11 18:27     ` Sergei Shtylyov
  1 sibling, 1 reply; 22+ messages in thread
From: Petr Kulhavy @ 2016-03-11 15:58 UTC (permalink / raw)
  To: Bin Liu
  Cc: devicetree-u79uwXL29TY76Z2rM5mHXA,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A, pawel.moll-5wv7dgnIgG8,
	mark.rutland-5wv7dgnIgG8, ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg,
	galak-sgV2jX0FEOL9JmXXK+q4OQ, linux-usb-u79uwXL29TY76Z2rM5mHXA,
	balbi-DgEjT+Ai2ygdnm+yROfE0A,
	sergei.shtylyov-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8



On 11.03.2016 16:51, Bin Liu wrote:
> Hi,
>
> On Fri, Mar 11, 2016 at 09:29:45AM +0100, Petr Kulhavy wrote:
>> DT binding for the TI DA8xx/OMAP-L1x/AM17xx/AM18xx MUSB driver.
> It seems the dts(i) file is not touched in this patch set, so DA8xx MUSB
> still does not use DT with these patches?  Or did I miss anything?
>
> Thanks,
> -Bin.
Hi Bin,

I have not touched the DA8xx dtsi file as I have these changes in my own 
board specific dts.
But I can create another patch if you find it sensible. For me it makes 
sense.

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

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 1/5 v10] dt/bindings: Add binding for the DA8xx MUSB driver
       [not found]       ` <56E2EB3C.6080602-Qh/3xLP0EvwAvxtiuMwx3w@public.gmane.org>
@ 2016-03-11 16:06         ` Bin Liu
  2016-03-11 16:21           ` Petr Kulhavy
  0 siblings, 1 reply; 22+ messages in thread
From: Bin Liu @ 2016-03-11 16:06 UTC (permalink / raw)
  To: Petr Kulhavy
  Cc: devicetree-u79uwXL29TY76Z2rM5mHXA,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A, pawel.moll-5wv7dgnIgG8,
	mark.rutland-5wv7dgnIgG8, ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg,
	galak-sgV2jX0FEOL9JmXXK+q4OQ, linux-usb-u79uwXL29TY76Z2rM5mHXA,
	balbi-DgEjT+Ai2ygdnm+yROfE0A,
	sergei.shtylyov-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8

Hi,

On Fri, Mar 11, 2016 at 04:58:52PM +0100, Petr Kulhavy wrote:
> 
> 
> On 11.03.2016 16:51, Bin Liu wrote:
> >Hi,
> >
> >On Fri, Mar 11, 2016 at 09:29:45AM +0100, Petr Kulhavy wrote:
> >>DT binding for the TI DA8xx/OMAP-L1x/AM17xx/AM18xx MUSB driver.
> >It seems the dts(i) file is not touched in this patch set, so DA8xx MUSB
> >still does not use DT with these patches?  Or did I miss anything?
> >
> >Thanks,
> >-Bin.
> Hi Bin,
> 
> I have not touched the DA8xx dtsi file as I have these changes in my
> own board specific dts.
> But I can create another patch if you find it sensible. For me it
> makes sense.

Okay, that is up to you, you can submit that patch whenever you are
ready. I will take this patch set when all comments are sorted out.

I am having 2nd thought on parsing the clock prop, Sergei's comment
might be better. I will look more on this over this weekend. (DT is not
in my expertise...)

Regards,
-Bin.

> 
> Petr
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 1/5 v10] dt/bindings: Add binding for the DA8xx MUSB driver
  2016-03-11 16:06         ` Bin Liu
@ 2016-03-11 16:21           ` Petr Kulhavy
       [not found]             ` <56E2F078.9020708-Qh/3xLP0EvwAvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 22+ messages in thread
From: Petr Kulhavy @ 2016-03-11 16:21 UTC (permalink / raw)
  To: Bin Liu
  Cc: devicetree-u79uwXL29TY76Z2rM5mHXA,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A, pawel.moll-5wv7dgnIgG8,
	mark.rutland-5wv7dgnIgG8, ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg,
	galak-sgV2jX0FEOL9JmXXK+q4OQ, linux-usb-u79uwXL29TY76Z2rM5mHXA,
	balbi-DgEjT+Ai2ygdnm+yROfE0A,
	sergei.shtylyov-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8



On 11.03.2016 17:06, Bin Liu wrote:
> Hi,
>
> On Fri, Mar 11, 2016 at 04:58:52PM +0100, Petr Kulhavy wrote:
>>
>> On 11.03.2016 16:51, Bin Liu wrote:
>>> Hi,
>>>
>>> On Fri, Mar 11, 2016 at 09:29:45AM +0100, Petr Kulhavy wrote:
>>>> DT binding for the TI DA8xx/OMAP-L1x/AM17xx/AM18xx MUSB driver.
>>> It seems the dts(i) file is not touched in this patch set, so DA8xx MUSB
>>> still does not use DT with these patches?  Or did I miss anything?
>>>
>>> Thanks,
>>> -Bin.
>> Hi Bin,
>>
>> I have not touched the DA8xx dtsi file as I have these changes in my
>> own board specific dts.
>> But I can create another patch if you find it sensible. For me it
>> makes sense.
> Okay, that is up to you, you can submit that patch whenever you are
> ready. I will take this patch set when all comments are sorted out.
I will submit that patch once the DT is there.

> I am having 2nd thought on parsing the clock prop, Sergei's comment
> might be better. I will look more on this over this weekend. (DT is not
> in my expertise...)
>
> Regards,
> -Bin.

I like Sergei's comment as well, but cannot see (yet) how the clock 
input selection would be done.
I mean, it makes sense to do the clock abstraction only if it can be 
done properly and the clock input selection can be covered as well.
The DA8xx platform is missing the real clock framework and therefore the 
different clocks cannot be referenced in DT.
There is a fake clock framework in arch/arm/mach-davinci/clock.c - I've 
already been through that and then gave up.

So if you come up with some good idea it's appreciated.

Regards
Petr
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 1/5 v10] dt/bindings: Add binding for the DA8xx MUSB driver
       [not found]             ` <56E2F078.9020708-Qh/3xLP0EvwAvxtiuMwx3w@public.gmane.org>
@ 2016-03-11 18:24               ` Sergei Shtylyov
       [not found]                 ` <56E30D43.9030508-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>
  0 siblings, 1 reply; 22+ messages in thread
From: Sergei Shtylyov @ 2016-03-11 18:24 UTC (permalink / raw)
  To: Petr Kulhavy, Bin Liu
  Cc: devicetree-u79uwXL29TY76Z2rM5mHXA,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A, pawel.moll-5wv7dgnIgG8,
	mark.rutland-5wv7dgnIgG8, ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg,
	galak-sgV2jX0FEOL9JmXXK+q4OQ, linux-usb-u79uwXL29TY76Z2rM5mHXA,
	balbi-DgEjT+Ai2ygdnm+yROfE0A

On 03/11/2016 07:21 PM, Petr Kulhavy wrote:

>> I am having 2nd thought on parsing the clock prop, Sergei's comment
>> might be better. I will look more on this over this weekend. (DT is not
>> in my expertise...)
>>
>> Regards,
>> -Bin.
>
> I like Sergei's comment as well, but cannot see (yet) how the clock input
> selection would be done.

    The same way as now, of course. Only getting the clock frequency would be 
different, via clk_get_rate()...

> I mean, it makes sense to do the clock abstraction only if it can be done
> properly and the clock input selection can be covered as well.

    No, this item has never been covered by the clk layer IIRC. That's what 
the device node props are for.

> The DA8xx platform is missing the real clock framework and therefore the
> different clocks cannot be referenced in DT.

    You mean more than one clock per device?

> There is a fake clock framework in arch/arm/mach-davinci/clock.c - I've
> already been through that and then gave up.

    I'm not sure why you call it "fake". It's a normal clk implementation, 
just not converted to the common clk framework.

> Regards
> Petr

MBR, Sergei

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

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 1/5 v10] dt/bindings: Add binding for the DA8xx MUSB driver
  2016-03-11 15:51   ` Bin Liu
  2016-03-11 15:58     ` Petr Kulhavy
@ 2016-03-11 18:27     ` Sergei Shtylyov
       [not found]       ` <56E30E0B.7020203-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>
  1 sibling, 1 reply; 22+ messages in thread
From: Sergei Shtylyov @ 2016-03-11 18:27 UTC (permalink / raw)
  To: Bin Liu, Petr Kulhavy, devicetree-u79uwXL29TY76Z2rM5mHXA,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A, pawel.moll-5wv7dgnIgG8,
	mark.rutland-5wv7dgnIgG8, ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg,
	galak-sgV2jX0FEOL9JmXXK+q4OQ, linux-usb-u79uwXL29TY76Z2rM5mHXA,
	balbi-DgEjT+Ai2ygdnm+yROfE0A

On 03/11/2016 06:51 PM, Bin Liu wrote:

>> DT binding for the TI DA8xx/OMAP-L1x/AM17xx/AM18xx MUSB driver.
>
> It seems the dts(i) file is not touched in this patch set, so DA8xx MUSB
> still does not use DT with these patches?  Or did I miss anything?

    The .dts[i] patches go thru the arm-soc tree. This patch only documents 
the bindings, that's all.

> Thanks,
> -Bin.

    Please cut out the part of mail you're not replying to -- this saves 
everybody's time.

MBR, Sergei

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

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 1/5 v10] dt/bindings: Add binding for the DA8xx MUSB driver
       [not found]       ` <56E30E0B.7020203-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>
@ 2016-03-11 18:32         ` Bin Liu
  0 siblings, 0 replies; 22+ messages in thread
From: Bin Liu @ 2016-03-11 18:32 UTC (permalink / raw)
  To: Sergei Shtylyov
  Cc: Petr Kulhavy, devicetree-u79uwXL29TY76Z2rM5mHXA,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A, pawel.moll-5wv7dgnIgG8,
	mark.rutland-5wv7dgnIgG8, ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg,
	galak-sgV2jX0FEOL9JmXXK+q4OQ, linux-usb-u79uwXL29TY76Z2rM5mHXA,
	balbi-DgEjT+Ai2ygdnm+yROfE0A

Hi,

On Fri, Mar 11, 2016 at 09:27:23PM +0300, Sergei Shtylyov wrote:
> On 03/11/2016 06:51 PM, Bin Liu wrote:
> 
> >>DT binding for the TI DA8xx/OMAP-L1x/AM17xx/AM18xx MUSB driver.
> >
> >It seems the dts(i) file is not touched in this patch set, so DA8xx MUSB
> >still does not use DT with these patches?  Or did I miss anything?
> 
>    The .dts[i] patches go thru the arm-soc tree. This patch only
> documents the bindings, that's all.
> 
> >Thanks,
> >-Bin.
> 
>    Please cut out the part of mail you're not replying to -- this
> saves everybody's time.

Ok, will do. Thanks.

> 
> MBR, Sergei
> 

Regards,
-Bin.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 1/5 v10] dt/bindings: Add binding for the DA8xx MUSB driver
       [not found] ` <1457684989-13318-1-git-send-email-petr-Qh/3xLP0EvwAvxtiuMwx3w@public.gmane.org>
                     ` (5 preceding siblings ...)
  2016-03-11 15:51   ` Bin Liu
@ 2016-03-14  7:00   ` Felipe Balbi
       [not found]     ` <87fuvtbl26.fsf-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
  2016-03-18 19:14   ` Rob Herring
  7 siblings, 1 reply; 22+ messages in thread
From: Felipe Balbi @ 2016-03-14  7:00 UTC (permalink / raw)
  To: devicetree-u79uwXL29TY76Z2rM5mHXA, b-liu-l0cyMroinI0
  Cc: robh+dt-DgEjT+Ai2ygdnm+yROfE0A, pawel.moll-5wv7dgnIgG8,
	mark.rutland-5wv7dgnIgG8, ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg,
	galak-sgV2jX0FEOL9JmXXK+q4OQ, petr-Qh/3xLP0EvwAvxtiuMwx3w,
	linux-usb-u79uwXL29TY76Z2rM5mHXA,
	sergei.shtylyov-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8,
	Michael Turquette

[-- Attachment #1: Type: text/plain, Size: 529 bytes --]


Hi,

Petr Kulhavy <petr-Qh/3xLP0EvwAvxtiuMwx3w@public.gmane.org> writes:
> + - ti,usb2-phy-refclock-hz : Integer. Frequency in Hz of the USB 2.0 PHY reference clock,
> +     either provided by the internal PLL or an external source.
> +     The supported values are: 12MHz, 13MHz, 19.2MHz, 20MHz, 24MHz, 26MHz, 38.4MHz, 40MHz, 48MHz.

why isn't this an actual clock phandle ? Driver could, then, use
clk_get_rate() to figure this one out. You could just use a fixed clock
here to satisfy the clock API.

-- 
balbi

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 1/5 v10] dt/bindings: Add binding for the DA8xx MUSB driver
       [not found]     ` <87fuvtbl26.fsf-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
@ 2016-03-15  2:07       ` David Lechner
       [not found]         ` <56E76E5A.5060801-nq/r/kbU++upp/zk7JDF2g@public.gmane.org>
  0 siblings, 1 reply; 22+ messages in thread
From: David Lechner @ 2016-03-15  2:07 UTC (permalink / raw)
  To: Felipe Balbi, Petr Kulhavy, devicetree-u79uwXL29TY76Z2rM5mHXA,
	b-liu-l0cyMroinI0
  Cc: robh+dt-DgEjT+Ai2ygdnm+yROfE0A, pawel.moll-5wv7dgnIgG8,
	mark.rutland-5wv7dgnIgG8, ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg,
	galak-sgV2jX0FEOL9JmXXK+q4OQ, linux-usb-u79uwXL29TY76Z2rM5mHXA,
	sergei.shtylyov-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8,
	Michael Turquette

On 03/14/2016 02:00 AM, Felipe Balbi wrote:
>
> Hi,
>
> Petr Kulhavy <petr-Qh/3xLP0EvwAvxtiuMwx3w@public.gmane.org> writes:
>> + - ti,usb2-phy-refclock-hz : Integer. Frequency in Hz of the USB 2.0 PHY reference clock,
>> +     either provided by the internal PLL or an external source.
>> +     The supported values are: 12MHz, 13MHz, 19.2MHz, 20MHz, 24MHz, 26MHz, 38.4MHz, 40MHz, 48MHz.
>
> why isn't this an actual clock phandle ? Driver could, then, use
> clk_get_rate() to figure this one out. You could just use a fixed clock
> here to satisfy the clock API.
>


I've actually been working on getting the da8xx ohci driver working with 
device tree. It has similar clock issues (in fact, the ohci clock is a 
child of the musb clock). Petr, give me a day or two and will have post 
some patches. It will have a clock that can be used here for clk_get_rate().
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 1/5 v10] dt/bindings: Add binding for the DA8xx MUSB driver
       [not found]         ` <56E76E5A.5060801-nq/r/kbU++upp/zk7JDF2g@public.gmane.org>
@ 2016-03-15  7:52           ` Felipe Balbi
  2016-04-04  8:45           ` Petr Kulhavy
  1 sibling, 0 replies; 22+ messages in thread
From: Felipe Balbi @ 2016-03-15  7:52 UTC (permalink / raw)
  To: David Lechner, Petr Kulhavy, devicetree-u79uwXL29TY76Z2rM5mHXA,
	b-liu-l0cyMroinI0
  Cc: robh+dt-DgEjT+Ai2ygdnm+yROfE0A, pawel.moll-5wv7dgnIgG8,
	mark.rutland-5wv7dgnIgG8, ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg,
	galak-sgV2jX0FEOL9JmXXK+q4OQ, linux-usb-u79uwXL29TY76Z2rM5mHXA,
	sergei.shtylyov-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8,
	Michael Turquette

[-- Attachment #1: Type: text/plain, Size: 1041 bytes --]


Hi,

David Lechner <david-nq/r/kbU++upp/zk7JDF2g@public.gmane.org> writes:
> [ text/plain ]
> On 03/14/2016 02:00 AM, Felipe Balbi wrote:
>>
>> Hi,
>>
>> Petr Kulhavy <petr-Qh/3xLP0EvwAvxtiuMwx3w@public.gmane.org> writes:
>>> + - ti,usb2-phy-refclock-hz : Integer. Frequency in Hz of the USB 2.0 PHY reference clock,
>>> +     either provided by the internal PLL or an external source.
>>> +     The supported values are: 12MHz, 13MHz, 19.2MHz, 20MHz, 24MHz, 26MHz, 38.4MHz, 40MHz, 48MHz.
>>
>> why isn't this an actual clock phandle ? Driver could, then, use
>> clk_get_rate() to figure this one out. You could just use a fixed clock
>> here to satisfy the clock API.
>>
>
>
> I've actually been working on getting the da8xx ohci driver working with 
> device tree. It has similar clock issues (in fact, the ohci clock is a 
> child of the musb clock). Petr, give me a day or two and will have post 
> some patches. It will have a clock that can be used here for clk_get_rate().

sounds good, cool.

-- 
balbi

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 1/5 v10] dt/bindings: Add binding for the DA8xx MUSB driver
       [not found]                 ` <56E30D43.9030508-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>
@ 2016-03-16 14:56                   ` Petr Kulhavy
  0 siblings, 0 replies; 22+ messages in thread
From: Petr Kulhavy @ 2016-03-16 14:56 UTC (permalink / raw)
  To: Sergei Shtylyov, Bin Liu
  Cc: devicetree-u79uwXL29TY76Z2rM5mHXA,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A, pawel.moll-5wv7dgnIgG8,
	mark.rutland-5wv7dgnIgG8, ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg,
	galak-sgV2jX0FEOL9JmXXK+q4OQ, linux-usb-u79uwXL29TY76Z2rM5mHXA,
	balbi-DgEjT+Ai2ygdnm+yROfE0A



On 11.03.2016 19:24, Sergei Shtylyov wrote:
> On 03/11/2016 07:21 PM, Petr Kulhavy wrote:
>
>>> I am having 2nd thought on parsing the clock prop, Sergei's comment
>>> might be better. I will look more on this over this weekend. (DT is not
>>> in my expertise...)
>>>
>>> Regards,
>>> -Bin.
>>
>> I like Sergei's comment as well, but cannot see (yet) how the clock 
>> input
>> selection would be done.
>
>    The same way as now, of course. Only getting the clock frequency 
> would be different, via clk_get_rate()...
>
>> I mean, it makes sense to do the clock abstraction only if it can be 
>> done
>> properly and the clock input selection can be covered as well.
>
>    No, this item has never been covered by the clk layer IIRC. That's 
> what the device node props are for.

>> The DA8xx platform is missing the real clock framework and therefore the
>> different clocks cannot be referenced in DT.
>
>    You mean more than one clock per device?
>
>> There is a fake clock framework in arch/arm/mach-davinci/clock.c - I've
>> already been through that and then gave up.
>
>    I'm not sure why you call it "fake". It's a normal clk 
> implementation, just not converted to the common clk framework.
>

Hi Sergei,

what I mean is that the DA8xx platform does not use the common clock 
framework. It uses its own clock implementation instead which is 
incompatible with the common clock framework, since it uses the same 
function names. So the common clock framework cannot be even compiled 
with this architecture.

With common clock framework the USB 2.0 clock would be modelled as a 
multiplexer between AUXCLK and USB_REFCLKIN.
The AUXCLK would be a phandle to the respective internal clock. 
USB_REFCLKIN then a phandle to either fixed clock or another clock source.
Providing the right parent phandle, internally calling set_parent() 
would do the job and no extra property would be needed.
Or did I miss something?

If the common clock framework is not available for this platform then 
the only option I see is what I did in my patch -  to set the frequency 
via an integer property and control the multiplexer with another 
property. We cannot even do what you suggested as the fixed clock simply 
does not exist due to the lack of the common clock framework.
Or do you see another way?

Regards
Petr
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 1/5 v10] dt/bindings: Add binding for the DA8xx MUSB driver
       [not found] ` <1457684989-13318-1-git-send-email-petr-Qh/3xLP0EvwAvxtiuMwx3w@public.gmane.org>
                     ` (6 preceding siblings ...)
  2016-03-14  7:00   ` Felipe Balbi
@ 2016-03-18 19:14   ` Rob Herring
  7 siblings, 0 replies; 22+ messages in thread
From: Rob Herring @ 2016-03-18 19:14 UTC (permalink / raw)
  To: Petr Kulhavy
  Cc: devicetree-u79uwXL29TY76Z2rM5mHXA, b-liu-l0cyMroinI0,
	pawel.moll-5wv7dgnIgG8, mark.rutland-5wv7dgnIgG8,
	ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg,
	galak-sgV2jX0FEOL9JmXXK+q4OQ, linux-usb-u79uwXL29TY76Z2rM5mHXA,
	balbi-DgEjT+Ai2ygdnm+yROfE0A,
	sergei.shtylyov-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8

On Fri, Mar 11, 2016 at 09:29:45AM +0100, Petr Kulhavy wrote:
> DT binding for the TI DA8xx/OMAP-L1x/AM17xx/AM18xx MUSB driver.
> 
> Signed-off-by: Petr Kulhavy <petr-Qh/3xLP0EvwAvxtiuMwx3w@public.gmane.org>
> ---
> v1: <initial>
> 
> v2:
>  - using standard properties "dr_mode", "mentor,power", "mentor,num-eps", "mentor,multipoint", "mentor,ram-bits"
>  - using "ti," prefix instead of "da8xx," for specific property names
>  - no wildcards in compatibility string
> 
> v3:
>  - added "reg", "interrupts" and "interrupt-names" properties
>  - wildcards in compatibility string
> 
> v4:
>  - compatibility string set to "ti,da830-musb"
>  - "mentor,num-eps", "mentor,multipoint", "mentor,ram-bits" properties removed and hardcoded
>  - "ti,phy20-clkmux-cfg" renamed to "ti,phy20-clkmux-pll" and changed to boolean
>  - removed "ti,hwmods"
> 
> v5:
>  - "ti,phy20-refclock-frequency" property made mandatory
> 
> v6:
>  - using "ti,usb2-phy-" prefix instead of "ti,phy20-" for the specific properties
> 
> v7:
>  - removed the "mentor,power" property; hard coded to 500mA in the code
> 
> v8:
>  - "ti,usb2-phy-refclock-frequency" renamed to "ti,usb2-phy-refclock-hz" and description amended
>  - "ti,usb2-phy-clkmux-pll" changed to "ti,usb2-phy-clkmux-refclkin" to reflect the more common case
>  - USB maximum power modelled via a regulator "vbus-supply"
> 
> v9: <no change>
> v10: <no change>
> 
>  .../devicetree/bindings/usb/da8xx-usb.txt          | 45 ++++++++++++++++++++++
>  1 file changed, 45 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/usb/da8xx-usb.txt

Acked-by: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 1/5 v10] dt/bindings: Add binding for the DA8xx MUSB driver
       [not found]         ` <56E76E5A.5060801-nq/r/kbU++upp/zk7JDF2g@public.gmane.org>
  2016-03-15  7:52           ` Felipe Balbi
@ 2016-04-04  8:45           ` Petr Kulhavy
       [not found]             ` <57022992.4060008-Qh/3xLP0EvwAvxtiuMwx3w@public.gmane.org>
  1 sibling, 1 reply; 22+ messages in thread
From: Petr Kulhavy @ 2016-04-04  8:45 UTC (permalink / raw)
  To: David Lechner, Felipe Balbi, devicetree-u79uwXL29TY76Z2rM5mHXA,
	b-liu-l0cyMroinI0
  Cc: robh+dt-DgEjT+Ai2ygdnm+yROfE0A, pawel.moll-5wv7dgnIgG8,
	mark.rutland-5wv7dgnIgG8, ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg,
	galak-sgV2jX0FEOL9JmXXK+q4OQ, linux-usb-u79uwXL29TY76Z2rM5mHXA,
	sergei.shtylyov-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8,
	Michael Turquette



On 15.03.2016 03:07, David Lechner wrote:
> On 03/14/2016 02:00 AM, Felipe Balbi wrote:
>>
>> Hi,
>>
>> why isn't this an actual clock phandle ? Driver could, then, use
>> clk_get_rate() to figure this one out. You could just use a fixed clock
>> here to satisfy the clock API.
>>
>
> I've actually been working on getting the da8xx ohci driver working 
> with device tree. It has similar clock issues (in fact, the ohci clock 
> is a child of the musb clock). Petr, give me a day or two and will 
> have post some patches. It will have a clock that can be used here for 
> clk_get_rate().

Hi David,

I'm trying to move on with my USB2.0 patch set because my projects is 
blocked waiting for it.
I've seen your PHY patch but it contains only on/off functions and does 
not handle the clocks, which IMHO should be moved to the PHY driver as 
well if we decided to do it properly.

How shall we proceed if both of us are working on the same piece of code?

Thanks
Petr

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

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 1/5 v10] dt/bindings: Add binding for the DA8xx MUSB driver
       [not found]             ` <57022992.4060008-Qh/3xLP0EvwAvxtiuMwx3w@public.gmane.org>
@ 2016-04-04 16:25               ` David Lechner
  0 siblings, 0 replies; 22+ messages in thread
From: David Lechner @ 2016-04-04 16:25 UTC (permalink / raw)
  To: Petr Kulhavy, Felipe Balbi, devicetree-u79uwXL29TY76Z2rM5mHXA,
	b-liu-l0cyMroinI0
  Cc: robh+dt-DgEjT+Ai2ygdnm+yROfE0A, pawel.moll-5wv7dgnIgG8,
	mark.rutland-5wv7dgnIgG8, ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg,
	galak-sgV2jX0FEOL9JmXXK+q4OQ, linux-usb-u79uwXL29TY76Z2rM5mHXA,
	sergei.shtylyov-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8,
	Michael Turquette

On 04/04/2016 03:45 AM, Petr Kulhavy wrote:
> I'm trying to move on with my USB2.0 patch set because my projects is
> blocked waiting for it.
> I've seen your PHY patch but it contains only on/off functions and does
> not handle the clocks, which IMHO should be moved to the PHY driver as
> well if we decided to do it properly.

Have a closer look at my (v3) patchset. It does handle clocks in the phy 
driver. The clocks themselves are implemented in mach-davinici similar 
to the rest of the SoC clocks and the phy driver uses clk_get(), 
clk_prepare_enable(), etc.


> How shall we proceed if both of us are working on the same piece of code?

I have never submitted patches for the Linux kernel before last month, 
so I have not yet experienced the whole process of getting a patch 
accepted. So, I don't know an answer to this question.

Perhaps someone with more experience can offer advice?
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2016-04-04 16:25 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-11  8:29 [PATCH 1/5 v10] dt/bindings: Add binding for the DA8xx MUSB driver Petr Kulhavy
     [not found] ` <1457684989-13318-1-git-send-email-petr-Qh/3xLP0EvwAvxtiuMwx3w@public.gmane.org>
2016-03-11  8:29   ` [PATCH 2/5 v10] usb: musb: core: added helper function for parsing DT Petr Kulhavy
2016-03-11  8:29   ` [PATCH 3/5 v10] usb: musb: core: added missing const qualifier to musb_hdrc_platform_data::config Petr Kulhavy
     [not found]     ` <1457684989-13318-3-git-send-email-petr-Qh/3xLP0EvwAvxtiuMwx3w@public.gmane.org>
2016-03-11 15:54       ` Bin Liu
2016-03-11  8:29   ` [PATCH 4/5 v10] ARM: davinci: defined missing CFGCHIP2_REFFREQ_* macros for MUSB PHY Petr Kulhavy
2016-03-11  8:29   ` [PATCH 5/5 v10] usb: musb: da8xx: Add DT support for the DA8xx driver Petr Kulhavy
     [not found]     ` <1457684989-13318-5-git-send-email-petr-Qh/3xLP0EvwAvxtiuMwx3w@public.gmane.org>
2016-03-11 11:22       ` Sergei Shtylyov
2016-03-11 11:24   ` [PATCH 1/5 v10] dt/bindings: Add binding for the DA8xx MUSB driver Sergei Shtylyov
2016-03-11 15:51   ` Bin Liu
2016-03-11 15:58     ` Petr Kulhavy
     [not found]       ` <56E2EB3C.6080602-Qh/3xLP0EvwAvxtiuMwx3w@public.gmane.org>
2016-03-11 16:06         ` Bin Liu
2016-03-11 16:21           ` Petr Kulhavy
     [not found]             ` <56E2F078.9020708-Qh/3xLP0EvwAvxtiuMwx3w@public.gmane.org>
2016-03-11 18:24               ` Sergei Shtylyov
     [not found]                 ` <56E30D43.9030508-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>
2016-03-16 14:56                   ` Petr Kulhavy
2016-03-11 18:27     ` Sergei Shtylyov
     [not found]       ` <56E30E0B.7020203-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>
2016-03-11 18:32         ` Bin Liu
2016-03-14  7:00   ` Felipe Balbi
     [not found]     ` <87fuvtbl26.fsf-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2016-03-15  2:07       ` David Lechner
     [not found]         ` <56E76E5A.5060801-nq/r/kbU++upp/zk7JDF2g@public.gmane.org>
2016-03-15  7:52           ` Felipe Balbi
2016-04-04  8:45           ` Petr Kulhavy
     [not found]             ` <57022992.4060008-Qh/3xLP0EvwAvxtiuMwx3w@public.gmane.org>
2016-04-04 16:25               ` David Lechner
2016-03-18 19:14   ` Rob Herring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).