|
@@ -1024,3 +1024,78 @@ static struct omap_mux * __init omap_mux_list_add(
|
|
|
struct omap_mux *m;
|
|
|
|
|
|
entry = kzalloc(sizeof(struct omap_mux_entry), GFP_KERNEL);
|
|
|
+ if (!entry)
|
|
|
+ return NULL;
|
|
|
+
|
|
|
+ m = &entry->mux;
|
|
|
+ entry->mux = *src;
|
|
|
+
|
|
|
+#ifdef CONFIG_OMAP_MUX
|
|
|
+ if (omap_mux_copy_names(src, m)) {
|
|
|
+ kfree(entry);
|
|
|
+ return NULL;
|
|
|
+ }
|
|
|
+#endif
|
|
|
+
|
|
|
+ mutex_lock(&muxmode_mutex);
|
|
|
+ list_add_tail(&entry->node, &partition->muxmodes);
|
|
|
+ mutex_unlock(&muxmode_mutex);
|
|
|
+
|
|
|
+ return m;
|
|
|
+}
|
|
|
+
|
|
|
+/*
|
|
|
+ * Note if CONFIG_OMAP_MUX is not selected, we will only initialize
|
|
|
+ * the GPIO to mux offset mapping that is needed for dynamic muxing
|
|
|
+ * of GPIO pins for off-idle.
|
|
|
+ */
|
|
|
+static void __init omap_mux_init_list(struct omap_mux_partition *partition,
|
|
|
+ struct omap_mux *superset)
|
|
|
+{
|
|
|
+ while (superset->reg_offset != OMAP_MUX_TERMINATOR) {
|
|
|
+ struct omap_mux *entry;
|
|
|
+
|
|
|
+#ifdef CONFIG_OMAP_MUX
|
|
|
+ if (!superset->muxnames || !superset->muxnames[0]) {
|
|
|
+ superset++;
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+#else
|
|
|
+ /* Skip pins that are not muxed as GPIO by bootloader */
|
|
|
+ if (!OMAP_MODE_GPIO(partition, omap_mux_read(partition,
|
|
|
+ superset->reg_offset))) {
|
|
|
+ superset++;
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+#endif
|
|
|
+
|
|
|
+ entry = omap_mux_list_add(partition, superset);
|
|
|
+ if (!entry) {
|
|
|
+ pr_err("%s: Could not add entry\n", __func__);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ superset++;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+#ifdef CONFIG_OMAP_MUX
|
|
|
+
|
|
|
+static void omap_mux_init_package(struct omap_mux *superset,
|
|
|
+ struct omap_mux *package_subset,
|
|
|
+ struct omap_ball *package_balls)
|
|
|
+{
|
|
|
+ if (package_subset)
|
|
|
+ omap_mux_package_fixup(package_subset, superset);
|
|
|
+ if (package_balls)
|
|
|
+ omap_mux_package_init_balls(package_balls, superset);
|
|
|
+}
|
|
|
+
|
|
|
+static void __init omap_mux_init_signals(struct omap_mux_partition *partition,
|
|
|
+ struct omap_board_mux *board_mux)
|
|
|
+{
|
|
|
+ omap_mux_set_cmdline_signals();
|
|
|
+ omap_mux_write_array(partition, board_mux);
|
|
|
+}
|
|
|
+
|
|
|
+#else
|
|
|
+
|