|
@@ -188,3 +188,121 @@ struct omap_device_pad {
|
|
char *name;
|
|
char *name;
|
|
u8 flags;
|
|
u8 flags;
|
|
u16 enable;
|
|
u16 enable;
|
|
|
|
+ u16 idle;
|
|
|
|
+ u16 off;
|
|
|
|
+ struct omap_mux_partition *partition;
|
|
|
|
+ struct omap_mux *mux;
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+struct omap_hwmod_mux_info;
|
|
|
|
+
|
|
|
|
+#define OMAP_MUX_STATIC(signal, mode) \
|
|
|
|
+{ \
|
|
|
|
+ .name = (signal), \
|
|
|
|
+ .enable = (mode), \
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+#if defined(CONFIG_OMAP_MUX)
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * omap_mux_init_gpio - initialize a signal based on the GPIO number
|
|
|
|
+ * @gpio: GPIO number
|
|
|
|
+ * @val: Options for the mux register value
|
|
|
|
+ */
|
|
|
|
+int omap_mux_init_gpio(int gpio, int val);
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * omap_mux_init_signal - initialize a signal based on the signal name
|
|
|
|
+ * @muxname: Mux name in mode0_name.signal_name format
|
|
|
|
+ * @val: Options for the mux register value
|
|
|
|
+ */
|
|
|
|
+int omap_mux_init_signal(const char *muxname, int val);
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * omap_hwmod_mux_init - initialize hwmod specific mux data
|
|
|
|
+ * @bpads: Board specific device signal names
|
|
|
|
+ * @nr_pads: Number of signal names for the device
|
|
|
|
+ */
|
|
|
|
+extern struct omap_hwmod_mux_info *
|
|
|
|
+omap_hwmod_mux_init(struct omap_device_pad *bpads, int nr_pads);
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * omap_hwmod_mux - omap hwmod specific pin muxing
|
|
|
|
+ * @hmux: Pads for a hwmod
|
|
|
|
+ * @state: Desired _HWMOD_STATE
|
|
|
|
+ *
|
|
|
|
+ * Called only from omap_hwmod.c, do not use.
|
|
|
|
+ */
|
|
|
|
+void omap_hwmod_mux(struct omap_hwmod_mux_info *hmux, u8 state);
|
|
|
|
+
|
|
|
|
+int omap_mux_get_by_name(const char *muxname,
|
|
|
|
+ struct omap_mux_partition **found_partition,
|
|
|
|
+ struct omap_mux **found_mux);
|
|
|
|
+#else
|
|
|
|
+
|
|
|
|
+static inline int omap_mux_get_by_name(const char *muxname,
|
|
|
|
+ struct omap_mux_partition **found_partition,
|
|
|
|
+ struct omap_mux **found_mux)
|
|
|
|
+{
|
|
|
|
+ return 0;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static inline int omap_mux_init_gpio(int gpio, int val)
|
|
|
|
+{
|
|
|
|
+ return 0;
|
|
|
|
+}
|
|
|
|
+static inline int omap_mux_init_signal(char *muxname, int val)
|
|
|
|
+{
|
|
|
|
+ return 0;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static inline struct omap_hwmod_mux_info *
|
|
|
|
+omap_hwmod_mux_init(struct omap_device_pad *bpads, int nr_pads)
|
|
|
|
+{
|
|
|
|
+ return NULL;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static inline void omap_hwmod_mux(struct omap_hwmod_mux_info *hmux, u8 state)
|
|
|
|
+{
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static struct omap_board_mux *board_mux __maybe_unused;
|
|
|
|
+
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * omap_mux_get_gpio() - get mux register value based on GPIO number
|
|
|
|
+ * @gpio: GPIO number
|
|
|
|
+ *
|
|
|
|
+ */
|
|
|
|
+u16 omap_mux_get_gpio(int gpio);
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * omap_mux_set_gpio() - set mux register value based on GPIO number
|
|
|
|
+ * @val: New mux register value
|
|
|
|
+ * @gpio: GPIO number
|
|
|
|
+ *
|
|
|
|
+ */
|
|
|
|
+void omap_mux_set_gpio(u16 val, int gpio);
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * omap_mux_get() - get a mux partition by name
|
|
|
|
+ * @name: Name of the mux partition
|
|
|
|
+ *
|
|
|
|
+ */
|
|
|
|
+struct omap_mux_partition *omap_mux_get(const char *name);
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * omap_mux_read() - read mux register
|
|
|
|
+ * @partition: Mux partition
|
|
|
|
+ * @mux_offset: Offset of the mux register
|
|
|
|
+ *
|
|
|
|
+ */
|
|
|
|
+u16 omap_mux_read(struct omap_mux_partition *p, u16 mux_offset);
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * omap_mux_write() - write mux register
|
|
|
|
+ * @partition: Mux partition
|
|
|
|
+ * @val: New mux register value
|
|
|
|
+ * @mux_offset: Offset of the mux register
|
|
|
|
+ *
|