index f35d65ea10987dc8ed2952559778d2ebb6fbeffb..cd8ca3ab958c856b2a12735f1f81dfe95aae7158 100644 (file)
#include <linux/gpio.h>
#include <linux/spi/spi.h>
#include <linux/spi/flash.h>
+#include <linux/gpio_keys.h>
#include <linux/input.h>
#include <linux/input/matrix_keypad.h>
#include <linux/mtd/mtd.h>
/* TSc controller */
#include <linux/input/ti_tscadc.h>
+#include <linux/lis3lv02d.h>
static struct resource tsc_resources[] = {
[0] = {
}
}
+
+/* pinmux for keypad device */
+static struct pinmux_config volume_keys_pin_mux[] = {
+ {"spi0_sclk.gpio0_2", OMAP_MUX_MODE7 | AM33XX_PIN_INPUT},
+ {"spi0_d0.gpio0_3", OMAP_MUX_MODE7 | AM33XX_PIN_INPUT},
+ {NULL, 0},
+};
+
+/* Configure GPIOs for Volume Keys */
+static struct gpio_keys_button am335x_evm_volume_gpio_buttons[] = {
+ {
+ .code = KEY_VOLUMEUP,
+ .gpio = GPIO_TO_PIN(0, 2),
+ .active_low = true,
+ .desc = "volume-up",
+ .type = EV_KEY,
+ .wakeup = 1,
+ },
+ {
+ .code = KEY_VOLUMEDOWN,
+ .gpio = GPIO_TO_PIN(0, 3),
+ .active_low = true,
+ .desc = "volume-down",
+ .type = EV_KEY,
+ .wakeup = 1,
+ },
+};
+
+static struct gpio_keys_platform_data am335x_evm_volume_gpio_key_info = {
+ .buttons = am335x_evm_volume_gpio_buttons,
+ .nbuttons = ARRAY_SIZE(am335x_evm_volume_gpio_buttons),
+};
+
+static struct platform_device am335x_evm_volume_keys = {
+ .name = "gpio-keys",
+ .id = -1,
+ .dev = {
+ .platform_data = &am335x_evm_volume_gpio_key_info,
+ },
+};
+
+static void volume_keys_init(int evm_id, int profile)
+{
+ int err;
+
+ setup_pin_mux(volume_keys_pin_mux);
+ err = platform_device_register(&am335x_evm_volume_keys);
+ if (err)
+ pr_err("failed to register matrix keypad (2x3) device\n");
+}
+
/*
* @evm_id - evm id which needs to be configured
* @dev_cfg - single evm structure which includes
{NULL, 0},
};
+/* pinmux for profibus */
+static struct pinmux_config profibus_pin_mux[] = {
+ {"uart1_rxd.pr1_uart0_rxd_mux1", OMAP_MUX_MODE5 | AM33XX_PIN_INPUT},
+ {"uart1_txd.pr1_uart0_txd_mux1", OMAP_MUX_MODE5 | AM33XX_PIN_OUTPUT},
+ {"mcasp0_fsr.pr1_pru0_pru_r30_5", OMAP_MUX_MODE5 | AM33XX_PIN_OUTPUT},
+ {NULL, 0},
+};
+
/* Module pin mux for eCAP0 */
static struct pinmux_config ecap0_pin_mux[] = {
{"ecap0_in_pwm0_out.gpio0_7", AM33XX_PIN_OUTPUT},
static struct pinmux_config wl12xx_pin_mux_evm_rev1_1a[] = {
{"gpmc_a0.gpio1_16", OMAP_MUX_MODE7 | AM33XX_PIN_OUTPUT},
{"mcasp0_ahclkr.gpio3_17", OMAP_MUX_MODE7 | AM33XX_PIN_INPUT},
- {"mcasp0_ahclkx.gpio0_17", OMAP_MUX_MODE7 | AM33XX_PIN_OUTPUT},
+ {"mcasp0_ahclkx.gpio3_21", OMAP_MUX_MODE7 | AM33XX_PIN_OUTPUT},
{NULL, 0},
};
ARRAY_SIZE(am335x_nand_partitions), 0, 0);
}
+static struct lis3lv02d_platform_data lis331dlh_pdata = {
+ .click_flags = LIS3_CLICK_SINGLE_X |
+ LIS3_CLICK_SINGLE_Y |
+ LIS3_CLICK_SINGLE_Z,
+ .wakeup_flags = LIS3_WAKEUP_X_LO | LIS3_WAKEUP_X_HI |
+ LIS3_WAKEUP_Y_LO | LIS3_WAKEUP_Y_HI |
+ LIS3_WAKEUP_Z_LO | LIS3_WAKEUP_Z_HI,
+ .irq_cfg = LIS3_IRQ1_CLICK | LIS3_IRQ2_CLICK,
+ .wakeup_thresh = 10,
+ .click_thresh_x = 10,
+ .click_thresh_y = 10,
+ .click_thresh_z = 10,
+ .g_range = 2,
+ .st_min_limits[0] = 120,
+ .st_min_limits[1] = 120,
+ .st_min_limits[2] = 140,
+ .st_max_limits[0] = 550,
+ .st_max_limits[1] = 550,
+ .st_max_limits[2] = 750,
+};
+
static struct i2c_board_info am335x_i2c_boardinfo1[] = {
{
I2C_BOARD_INFO("tlv320aic3x", 0x1b),
},
+ {
+ I2C_BOARD_INFO("lis331dlh", 0x18),
+ .platform_data = &lis331dlh_pdata,
+ },
+ {
+ I2C_BOARD_INFO("tsl2550", 0x39),
+ },
+ {
+ I2C_BOARD_INFO("tmp275", 0x48),
+ },
};
static void i2c1_init(int evm_id, int profile)
static int wl12xx_set_power(struct device *dev, int slot, int on, int vdd)
{
- if (on)
+ if (on) {
gpio_set_value(am335xevm_wlan_data.wlan_enable_gpio, 1);
+ mdelay(70);
+ }
else
gpio_set_value(am335xevm_wlan_data.wlan_enable_gpio, 0);
/* Register WLAN and BT enable pins based on the evm board revision */
if (gp_evm_revision == GP_EVM_REV_IS_1_1A) {
am335xevm_wlan_data.wlan_enable_gpio = GPIO_TO_PIN(1, 16);
- am335xevm_wlan_data.bt_enable_gpio = GPIO_TO_PIN(0, 17);
+ am335xevm_wlan_data.bt_enable_gpio = GPIO_TO_PIN(3, 21);
}
else {
am335xevm_wlan_data.wlan_enable_gpio = GPIO_TO_PIN(1, 30);
}
#endif
+static void profibus_init(int evm_id, int profile)
+{
+ setup_pin_mux(profibus_pin_mux);
+ return;
+}
/* Low-Cost EVM */
static struct evm_dev_cfg low_cost_evm_dev_cfg[] = {
{usb1_init, DEV_ON_BASEBOARD, PROFILE_ALL},
{evm_nand_init, DEV_ON_DGHTR_BRD,
(PROFILE_ALL & ~PROFILE_2 & ~PROFILE_3)},
- {i2c1_init, DEV_ON_DGHTR_BRD, (PROFILE_0 | PROFILE_3 | PROFILE_7)},
+ {i2c1_init, DEV_ON_DGHTR_BRD, (PROFILE_ALL & ~PROFILE_2)},
{mcasp1_init, DEV_ON_DGHTR_BRD, (PROFILE_0 | PROFILE_3 | PROFILE_7)},
{mmc1_init, DEV_ON_DGHTR_BRD, PROFILE_2},
{mmc2_wl12xx_init, DEV_ON_BASEBOARD, (PROFILE_0 | PROFILE_3 |
{wl12xx_init, DEV_ON_BASEBOARD, (PROFILE_0 | PROFILE_3 | PROFILE_5)},
{d_can_init, DEV_ON_DGHTR_BRD, PROFILE_1},
{matrix_keypad_init, DEV_ON_DGHTR_BRD, PROFILE_0},
+ {volume_keys_init, DEV_ON_DGHTR_BRD, PROFILE_0},
{NULL, 0, 0},
};
{mii1_init, DEV_ON_DGHTR_BRD, PROFILE_ALL},
{usb0_init, DEV_ON_BASEBOARD, PROFILE_ALL},
{usb1_init, DEV_ON_BASEBOARD, PROFILE_ALL},
+ {profibus_init, DEV_ON_DGHTR_BRD, PROFILE_ALL},
{evm_nand_init, DEV_ON_DGHTR_BRD, PROFILE_ALL},
{spi1_init, DEV_ON_DGHTR_BRD, PROFILE_ALL},
{uart3_init, DEV_ON_DGHTR_BRD, PROFILE_ALL},
usb_musb_init(&musb_board_data);
omap_board_config = am335x_evm_config;
omap_board_config_size = ARRAY_SIZE(am335x_evm_config);
+ /* Create an alias for icss clock */
+ if (clk_add_alias("pruss", NULL, "icss_uart_gclk", NULL))
+ pr_err("failed to create an alias: icss_uart_gclk --> pruss\n");
+ /* Create an alias for gfx/sgx clock */
+ if (clk_add_alias("sgx_ck", NULL, "gfx_fclk", NULL))
+ pr_err("failed to create an alias: gfx_fclk --> sgx_ck\n");
}
static void __init am335x_evm_map_io(void)