Commit 385ed291ae862d71c14b821cfa1f5091f10931c5

Authored by Afzal Mohammed
1 parent 904a2d7eec
Exists in master

arm:omap:am33xx: Add pin mux initialization in board_init

Signed-off-by: Afzal Mohammed <afzal@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>

Showing 2 changed files with 36 additions and 0 deletions Side-by-side Diff

arch/arm/mach-omap2/Makefile
... ... @@ -44,6 +44,7 @@
44 44 obj-$(CONFIG_SOC_OMAP2430) += mux2430.o
45 45 obj-$(CONFIG_ARCH_OMAP3) += mux34xx.o
46 46 obj-$(CONFIG_ARCH_OMAP4) += mux44xx.o
  47 +obj-$(CONFIG_SOC_OMAPAM33XX) += mux33xx.o
47 48  
48 49 # SMS/SDRC
49 50 obj-$(CONFIG_ARCH_OMAP2) += sdrc2xxx.o
arch/arm/mach-omap2/board-am335xevm.c
... ... @@ -14,6 +14,7 @@
14 14 */
15 15 #include <linux/kernel.h>
16 16 #include <linux/init.h>
  17 +#include <linux/i2c.h>
17 18  
18 19 #include <mach/hardware.h>
19 20 #include <asm/mach-types.h>
20 21  
... ... @@ -24,11 +25,45 @@
24 25 #include <plat/board.h>
25 26 #include <plat/common.h>
26 27  
  28 +#include "mux.h"
  29 +
  30 +#ifdef CONFIG_OMAP_MUX
  31 +static struct omap_board_mux board_mux[] __initdata = {
  32 + AM33XX_MUX(I2C0_SDA, OMAP_MUX_MODE0 | AM33XX_SLEWCTRL_SLOW |
  33 + AM33XX_INPUT_EN | AM33XX_PIN_OUTPUT),
  34 + AM33XX_MUX(I2C0_SCL, OMAP_MUX_MODE0 | AM33XX_SLEWCTRL_SLOW |
  35 + AM33XX_INPUT_EN | AM33XX_PIN_OUTPUT),
  36 + { .reg_offset = OMAP_MUX_TERMINATOR },
  37 +};
  38 +#else
  39 +#define board_mux NULL
  40 +#endif
  41 +
  42 +/* module pin mux structure */
  43 +struct pinmux_config {
  44 + const char *string_name; /* signal name format */
  45 + int val; /* Options for the mux register value */
  46 +};
  47 +
  48 +/*
  49 +* @pin_mux - single module pin-mux structure which defines pin-mux
  50 +* details for all its pins.
  51 +*/
  52 +static void setup_pin_mux(struct pinmux_config *pin_mux)
  53 +{
  54 + int i;
  55 +
  56 + for (i = 0; pin_mux->string_name != NULL; pin_mux++)
  57 + omap_mux_init_signal(pin_mux->string_name, pin_mux->val);
  58 +
  59 +}
  60 +
27 61 static struct omap_board_config_kernel am335x_evm_config[] __initdata = {
28 62 };
29 63  
30 64 static void __init am335x_evm_init(void)
31 65 {
  66 + am33xx_mux_init(board_mux);
32 67 omap_serial_init();
33 68 omap_sdrc_init(NULL, NULL);
34 69 omap_board_config = am335x_evm_config;