Re: [PATCH 2/5] usb: musb: core: added helper functions for parsing DT

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 02/12/2016 05:58 PM, Petr Kulhavy wrote:

This adds two functions to get DT properties "mentor,power" and "dr_mode":
musb_get_power() and musb_mode musb_get_mode()

   s/musb_mode//.

Signed-off-by: Petr Kulhavy <petr@xxxxxxxxx>

[...]

diff --git a/drivers/usb/musb/musb_core.h b/drivers/usb/musb/musb_core.h
index fd215fb..89d6290 100644
--- a/drivers/usb/musb/musb_core.h
+++ b/drivers/usb/musb/musb_core.h
@@ -614,4 +614,24 @@ 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 returns MUSB_UNDEFINED
+ */
+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);
+#else
+static inline u8 musb_get_power(struct device *dev)
+{
+	return 0;
+}
+#endif
+

Hm, do we need an empty implementation? In that case, I'd prefer to avoid #ifdef in musb_core.c...

MBR, Sergei

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



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux