Hello.
On 02/24/2016 06:27 PM, Petr Kulhavy wrote:
This adds two functions to get DT properties "mentor,power" and "dr_mode":
musb_get_power() and musb_get_mode()
Signed-off-by: Petr Kulhavy <[email protected]>
---
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
[...]
diff --git a/drivers/usb/musb/musb_core.h b/drivers/usb/musb/musb_core.h
index fd215fb..c2ee702 100644
--- a/drivers/usb/musb/musb_core.h
+++ b/drivers/usb/musb/musb_core.h
@@ -614,4 +614,19 @@ 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);
+
+#if IS_ENABLED(CONFIG_OF)
+/* gets the "mentor,power" property from DT
+ * and converts it from mA to 2mA units for the "power" parameter
+ * in struct musb_hdrc_platform_data
+ *
+ * in case the property is not found returns 0
+ */
+extern u8 musb_get_power(struct device *dev);
+#endif
+
Now that you hard-coded the value, you don't need this function any more.
[...]
MBR, Sergei
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html