--- zzzz-none-000/linux-3.10.107/arch/arm/mach-davinci/board-da830-evm.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/arch/arm/mach-davinci/board-da830-evm.c 2021-02-04 17:41:59.000000000 +0000 @@ -17,22 +17,24 @@ #include #include #include -#include +#include #include #include #include #include +#include +#include +#include +#include +#include #include #include +#include #include #include -#include #include -#include -#include -#include #define DA830_EVM_PHY_ID "" /* @@ -74,12 +76,12 @@ if (handler != NULL) { da830_evm_usb_ocic_handler = handler; - error = request_irq(irq, da830_evm_usb_ocic_irq, IRQF_DISABLED | + error = request_irq(irq, da830_evm_usb_ocic_irq, IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, "OHCI over-current indicator", NULL); if (error) - printk(KERN_ERR "%s: could not request IRQ to watch " - "over-current indicator changes\n", __func__); + pr_err("%s: could not request IRQ to watch over-current indicator changes\n", + __func__); } else free_irq(irq, NULL); @@ -143,8 +145,7 @@ /* USB_REFCLKIN is not used. */ ret = davinci_cfg_reg(DA830_USB0_DRVVBUS); if (ret) - pr_warning("%s: USB 2.0 PinMux setup failed: %d\n", - __func__, ret); + pr_warn("%s: USB 2.0 PinMux setup failed: %d\n", __func__, ret); else { /* * TPS2065 switch @ 5V supplies 1 A (sustains 1.5 A), @@ -152,43 +153,37 @@ */ ret = da8xx_register_usb20(1000, 3); if (ret) - pr_warning("%s: USB 2.0 registration failed: %d\n", - __func__, ret); + pr_warn("%s: USB 2.0 registration failed: %d\n", + __func__, ret); } ret = davinci_cfg_reg_list(da830_evm_usb11_pins); if (ret) { - pr_warning("%s: USB 1.1 PinMux setup failed: %d\n", - __func__, ret); + pr_warn("%s: USB 1.1 PinMux setup failed: %d\n", __func__, ret); return; } ret = gpio_request(ON_BD_USB_DRV, "ON_BD_USB_DRV"); if (ret) { - printk(KERN_ERR "%s: failed to request GPIO for USB 1.1 port " - "power control: %d\n", __func__, ret); + pr_err("%s: failed to request GPIO for USB 1.1 port power control: %d\n", + __func__, ret); return; } gpio_direction_output(ON_BD_USB_DRV, 0); ret = gpio_request(ON_BD_USB_OVC, "ON_BD_USB_OVC"); if (ret) { - printk(KERN_ERR "%s: failed to request GPIO for USB 1.1 port " - "over-current indicator: %d\n", __func__, ret); + pr_err("%s: failed to request GPIO for USB 1.1 port over-current indicator: %d\n", + __func__, ret); return; } gpio_direction_input(ON_BD_USB_OVC); ret = da8xx_register_usb11(&da830_evm_usb11_pdata); if (ret) - pr_warning("%s: USB 1.1 registration failed: %d\n", - __func__, ret); + pr_warn("%s: USB 1.1 registration failed: %d\n", __func__, ret); } -static struct davinci_uart_config da830_evm_uart_config __initdata = { - .enabled_uarts = 0x7, -}; - static const short da830_evm_mcasp1_pins[] = { DA830_AHCLKX1, DA830_ACLKX1, DA830_AFSX1, DA830_AHCLKR1, DA830_AFSR1, DA830_AMUTE1, DA830_AXR1_0, DA830_AXR1_1, DA830_AXR1_2, DA830_AXR1_5, @@ -254,31 +249,29 @@ ret = davinci_cfg_reg_list(da830_evm_mmc_sd_pins); if (ret) { - pr_warning("da830_evm_init: mmc/sd mux setup failed: %d\n", - ret); + pr_warn("%s: mmc/sd mux setup failed: %d\n", __func__, ret); return; } ret = gpio_request(DA830_MMCSD_WP_PIN, "MMC WP"); if (ret) { - pr_warning("da830_evm_init: can not open GPIO %d\n", - DA830_MMCSD_WP_PIN); + pr_warn("%s: can not open GPIO %d\n", + __func__, DA830_MMCSD_WP_PIN); return; } gpio_direction_input(DA830_MMCSD_WP_PIN); ret = gpio_request(DA830_MMCSD_CD_PIN, "MMC CD\n"); if (ret) { - pr_warning("da830_evm_init: can not open GPIO %d\n", - DA830_MMCSD_CD_PIN); + pr_warn("%s: can not open GPIO %d\n", + __func__, DA830_MMCSD_CD_PIN); return; } gpio_direction_input(DA830_MMCSD_CD_PIN); ret = da8xx_register_mmcsd0(&da830_evm_mmc_config); if (ret) { - pr_warning("da830_evm_init: mmc/sd registration failed: %d\n", - ret); + pr_warn("%s: mmc/sd registration failed: %d\n", __func__, ret); gpio_free(DA830_MMCSD_WP_PIN); } } @@ -406,20 +399,21 @@ 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"); + pr_warn("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); + pr_warn("%s: emif25 mux setup failed: %d\n", __func__, ret); ret = platform_device_register(&da830_evm_nand_device); if (ret) - pr_warning("da830_evm_init: NAND device not registered.\n"); + pr_warn("%s: NAND device not registered\n", __func__); + + if (davinci_aemif_setup(&da830_evm_nand_device)) + pr_warn("%s: Cannot configure AEMIF\n", __func__); gpio_direction_output(mux_mode, 1); } @@ -434,12 +428,11 @@ ret = davinci_cfg_reg_list(da830_lcdcntl_pins); if (ret) - pr_warning("da830_evm_init: lcdcntl mux setup failed: %d\n", - ret); + pr_warn("%s: lcdcntl mux setup failed: %d\n", __func__, ret); ret = da8xx_register_lcdc(&sharp_lcd035q3dg01_pdata); if (ret) - pr_warning("da830_evm_init: lcd setup failed: %d\n", ret); + pr_warn("%s: lcd setup failed: %d\n", __func__, ret); gpio_direction_output(mux_mode, 0); } @@ -595,20 +588,21 @@ struct davinci_soc_info *soc_info = &davinci_soc_info; int ret; + ret = da830_register_gpio(); + if (ret) + pr_warn("%s: GPIO init failed: %d\n", __func__, ret); + ret = da830_register_edma(da830_edma_rsv); if (ret) - pr_warning("da830_evm_init: edma registration failed: %d\n", - ret); + pr_warn("%s: edma registration failed: %d\n", __func__, ret); ret = davinci_cfg_reg_list(da830_i2c0_pins); if (ret) - pr_warning("da830_evm_init: i2c0 mux setup failed: %d\n", - ret); + pr_warn("%s: i2c0 mux setup failed: %d\n", __func__, ret); ret = da8xx_register_i2c(0, &da830_evm_i2c_0_pdata); if (ret) - pr_warning("da830_evm_init: i2c0 registration failed: %d\n", - ret); + pr_warn("%s: i2c0 registration failed: %d\n", __func__, ret); da830_evm_usb_init(); @@ -617,27 +611,24 @@ ret = davinci_cfg_reg_list(da830_cpgmac_pins); if (ret) - pr_warning("da830_evm_init: cpgmac mux setup failed: %d\n", - ret); + pr_warn("%s: cpgmac mux setup failed: %d\n", __func__, ret); ret = da8xx_register_emac(); if (ret) - pr_warning("da830_evm_init: emac registration failed: %d\n", - ret); + pr_warn("%s: emac registration failed: %d\n", __func__, ret); ret = da8xx_register_watchdog(); if (ret) - pr_warning("da830_evm_init: watchdog registration failed: %d\n", - ret); + pr_warn("%s: watchdog registration failed: %d\n", + __func__, ret); - davinci_serial_init(&da830_evm_uart_config); + davinci_serial_init(da8xx_serial_device); i2c_register_board_info(1, da830_evm_i2c_devices, ARRAY_SIZE(da830_evm_i2c_devices)); ret = davinci_cfg_reg_list(da830_evm_mcasp1_pins); if (ret) - pr_warning("da830_evm_init: mcasp1 mux setup failed: %d\n", - ret); + pr_warn("%s: mcasp1 mux setup failed: %d\n", __func__, ret); da8xx_register_mcasp(1, &da830_evm_snd_data); @@ -645,18 +636,17 @@ ret = da8xx_register_rtc(); if (ret) - pr_warning("da830_evm_init: rtc setup failed: %d\n", ret); + pr_warn("%s: rtc setup failed: %d\n", __func__, ret); ret = spi_register_board_info(da830evm_spi_info, ARRAY_SIZE(da830evm_spi_info)); if (ret) - pr_warn("%s: spi info registration failed: %d\n", __func__, - ret); + pr_warn("%s: spi info registration failed: %d\n", + __func__, ret); ret = da8xx_register_spi_bus(0, ARRAY_SIZE(da830evm_spi_info)); if (ret) - pr_warning("da830_evm_init: spi 0 registration failed: %d\n", - ret); + pr_warn("%s: spi 0 registration failed: %d\n", __func__, ret); } #ifdef CONFIG_SERIAL_8250_CONSOLE