Merge branch 'x86-olpc-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[pandora-kernel.git] / arch / arm / mach-omap2 / mux.h
index f5f7f49..a4ab17a 100644 (file)
 #define OMAP_MUX_REG_8BIT              (1 << 0)
 #define OMAP_MUX_GPIO_IN_MODE3         (1 << 1)
 
+/**
+ * struct omap_board_data - board specific device data
+ * @id: instance id
+ * @flags: additional flags for platform init code
+ * @pads: array of device specific pads
+ * @pads_cnt: ARRAY_SIZE() of pads
+ */
+struct omap_board_data {
+       int                     id;
+       u32                     flags;
+       struct omap_device_pad  *pads;
+       int                     pads_cnt;
+};
+
 /**
  * struct mux_partition - contain partition related information
  * @name: name of the current partition
@@ -145,6 +159,34 @@ struct omap_board_mux {
        u16     value;
 };
 
+#define OMAP_DEVICE_PAD_ENABLED                BIT(7)  /* Not needed for board-*.c */
+#define OMAP_DEVICE_PAD_REMUX          BIT(1)  /* Dynamically remux a pad,
+                                                  needs enable, idle and off
+                                                  values */
+#define OMAP_DEVICE_PAD_WAKEUP         BIT(0)  /* Pad is wake-up capable */
+
+/**
+ * struct omap_device_pad - device specific pad configuration
+ * @name:              signal name
+ * @flags:             pad specific runtime flags
+ * @enable:            runtime value for a pad
+ * @idle:              idle value for a pad
+ * @off:               off value for a pad, defaults to safe mode
+ * @partition:         mux partition
+ * @mux:               mux register
+ */
+struct omap_device_pad {
+       char                            *name;
+       u8                              flags;
+       u16                             enable;
+       u16                             idle;
+       u16                             off;
+       struct omap_mux_partition       *partition;
+       struct omap_mux                 *mux;
+};
+
+struct omap_hwmod_mux_info;
+
 #if defined(CONFIG_OMAP_MUX)
 
 /**
@@ -161,6 +203,23 @@ int omap_mux_init_gpio(int gpio, int val);
  */
 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);
+
 #else
 
 static inline int omap_mux_init_gpio(int gpio, int val)
@@ -172,6 +231,16 @@ 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 __initdata __maybe_unused;
 
 #endif