|
@@ -404,3 +404,127 @@ static struct platform_device da830_evm_nand_device = {
|
|
|
},
|
|
|
.num_resources = ARRAY_SIZE(da830_evm_nand_resources),
|
|
|
.resource = da830_evm_nand_resources,
|
|
|
+};
|
|
|
+
|
|
|
+static inline void da830_evm_init_nand(int mux_mode)
|
|
|
+{
|
|
|
+ int ret;
|
|
|
+
|
|
|
+ if (HAS_MMC) {
|
|
|
+ pr_warning("WARNING: both MMC/SD and NAND are "
|
|
|
+ "enabled, but they share AEMIF pins.\n"
|
|
|
+ "\tDisable MMC/SD for NAND support.\n");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ ret = davinci_cfg_reg_list(da830_evm_emif25_pins);
|
|
|
+ if (ret)
|
|
|
+ pr_warning("da830_evm_init: emif25 mux setup failed: %d\n",
|
|
|
+ ret);
|
|
|
+
|
|
|
+ ret = platform_device_register(&da830_evm_nand_device);
|
|
|
+ if (ret)
|
|
|
+ pr_warning("da830_evm_init: NAND device not registered.\n");
|
|
|
+
|
|
|
+ gpio_direction_output(mux_mode, 1);
|
|
|
+}
|
|
|
+#else
|
|
|
+static inline void da830_evm_init_nand(int mux_mode) { }
|
|
|
+#endif
|
|
|
+
|
|
|
+#ifdef CONFIG_DA830_UI_LCD
|
|
|
+static inline void da830_evm_init_lcdc(int mux_mode)
|
|
|
+{
|
|
|
+ int ret;
|
|
|
+
|
|
|
+ ret = davinci_cfg_reg_list(da830_lcdcntl_pins);
|
|
|
+ if (ret)
|
|
|
+ pr_warning("da830_evm_init: lcdcntl mux setup failed: %d\n",
|
|
|
+ ret);
|
|
|
+
|
|
|
+ ret = da8xx_register_lcdc(&sharp_lcd035q3dg01_pdata);
|
|
|
+ if (ret)
|
|
|
+ pr_warning("da830_evm_init: lcd setup failed: %d\n", ret);
|
|
|
+
|
|
|
+ gpio_direction_output(mux_mode, 0);
|
|
|
+}
|
|
|
+#else
|
|
|
+static inline void da830_evm_init_lcdc(int mux_mode) { }
|
|
|
+#endif
|
|
|
+
|
|
|
+static struct at24_platform_data da830_evm_i2c_eeprom_info = {
|
|
|
+ .byte_len = SZ_256K / 8,
|
|
|
+ .page_size = 64,
|
|
|
+ .flags = AT24_FLAG_ADDR16,
|
|
|
+ .setup = davinci_get_mac_addr,
|
|
|
+ .context = (void *)0x7f00,
|
|
|
+};
|
|
|
+
|
|
|
+static int __init da830_evm_ui_expander_setup(struct i2c_client *client,
|
|
|
+ int gpio, unsigned ngpio, void *context)
|
|
|
+{
|
|
|
+ gpio_request(gpio + 6, "UI MUX_MODE");
|
|
|
+
|
|
|
+ /* Drive mux mode low to match the default without UI card */
|
|
|
+ gpio_direction_output(gpio + 6, 0);
|
|
|
+
|
|
|
+ da830_evm_init_lcdc(gpio + 6);
|
|
|
+
|
|
|
+ da830_evm_init_nand(gpio + 6);
|
|
|
+
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+static int da830_evm_ui_expander_teardown(struct i2c_client *client, int gpio,
|
|
|
+ unsigned ngpio, void *context)
|
|
|
+{
|
|
|
+ gpio_free(gpio + 6);
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+static struct pcf857x_platform_data __initdata da830_evm_ui_expander_info = {
|
|
|
+ .gpio_base = DAVINCI_N_GPIO,
|
|
|
+ .setup = da830_evm_ui_expander_setup,
|
|
|
+ .teardown = da830_evm_ui_expander_teardown,
|
|
|
+};
|
|
|
+
|
|
|
+static struct i2c_board_info __initdata da830_evm_i2c_devices[] = {
|
|
|
+ {
|
|
|
+ I2C_BOARD_INFO("24c256", 0x50),
|
|
|
+ .platform_data = &da830_evm_i2c_eeprom_info,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ I2C_BOARD_INFO("tlv320aic3x", 0x18),
|
|
|
+ },
|
|
|
+ {
|
|
|
+ I2C_BOARD_INFO("pcf8574", 0x3f),
|
|
|
+ .platform_data = &da830_evm_ui_expander_info,
|
|
|
+ },
|
|
|
+};
|
|
|
+
|
|
|
+static struct davinci_i2c_platform_data da830_evm_i2c_0_pdata = {
|
|
|
+ .bus_freq = 100, /* kHz */
|
|
|
+ .bus_delay = 0, /* usec */
|
|
|
+};
|
|
|
+
|
|
|
+/*
|
|
|
+ * The following EDMA channels/slots are not being used by drivers (for
|
|
|
+ * example: Timer, GPIO, UART events etc) on da830/omap-l137 EVM, hence
|
|
|
+ * they are being reserved for codecs on the DSP side.
|
|
|
+ */
|
|
|
+static const s16 da830_dma_rsv_chans[][2] = {
|
|
|
+ /* (offset, number) */
|
|
|
+ { 8, 2},
|
|
|
+ {12, 2},
|
|
|
+ {24, 4},
|
|
|
+ {30, 2},
|
|
|
+ {-1, -1}
|
|
|
+};
|
|
|
+
|
|
|
+static const s16 da830_dma_rsv_slots[][2] = {
|
|
|
+ /* (offset, number) */
|
|
|
+ { 8, 2},
|
|
|
+ {12, 2},
|
|
|
+ {24, 4},
|
|
|
+ {30, 26},
|
|
|
+ {-1, -1}
|