| .. | .. |
|---|
| 17 | 17 | #include <linux/interrupt.h> |
|---|
| 18 | 18 | #include <linux/ata_platform.h> |
|---|
| 19 | 19 | #include <linux/mmc/host.h> |
|---|
| 20 | | -#include <linux/module.h> |
|---|
| 21 | 20 | #include <linux/mtd/mtd.h> |
|---|
| 22 | | -#include <linux/mtd/rawnand.h> |
|---|
| 23 | | -#include <linux/mtd/partitions.h> |
|---|
| 21 | +#include <linux/mtd/platnand.h> |
|---|
| 24 | 22 | #include <linux/platform_device.h> |
|---|
| 25 | 23 | #include <linux/smsc911x.h> |
|---|
| 26 | 24 | #include <linux/wm97xx.h> |
|---|
| .. | .. |
|---|
| 149 | 147 | |
|---|
| 150 | 148 | /**********************************************************************/ |
|---|
| 151 | 149 | |
|---|
| 152 | | -static void au1300_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, |
|---|
| 150 | +static u64 au1300_all_dmamask = DMA_BIT_MASK(32); |
|---|
| 151 | + |
|---|
| 152 | +static void au1300_nand_cmd_ctrl(struct nand_chip *this, int cmd, |
|---|
| 153 | 153 | unsigned int ctrl) |
|---|
| 154 | 154 | { |
|---|
| 155 | | - struct nand_chip *this = mtd_to_nand(mtd); |
|---|
| 156 | | - unsigned long ioaddr = (unsigned long)this->IO_ADDR_W; |
|---|
| 155 | + unsigned long ioaddr = (unsigned long)this->legacy.IO_ADDR_W; |
|---|
| 157 | 156 | |
|---|
| 158 | 157 | ioaddr &= 0xffffff00; |
|---|
| 159 | 158 | |
|---|
| .. | .. |
|---|
| 165 | 164 | /* assume we want to r/w real data by default */ |
|---|
| 166 | 165 | ioaddr += MEM_STNAND_DATA; |
|---|
| 167 | 166 | } |
|---|
| 168 | | - this->IO_ADDR_R = this->IO_ADDR_W = (void __iomem *)ioaddr; |
|---|
| 167 | + this->legacy.IO_ADDR_R = this->legacy.IO_ADDR_W = (void __iomem *)ioaddr; |
|---|
| 169 | 168 | if (cmd != NAND_CMD_NONE) { |
|---|
| 170 | | - __raw_writeb(cmd, this->IO_ADDR_W); |
|---|
| 169 | + __raw_writeb(cmd, this->legacy.IO_ADDR_W); |
|---|
| 171 | 170 | wmb(); |
|---|
| 172 | 171 | } |
|---|
| 173 | 172 | } |
|---|
| 174 | 173 | |
|---|
| 175 | | -static int au1300_nand_device_ready(struct mtd_info *mtd) |
|---|
| 174 | +static int au1300_nand_device_ready(struct nand_chip *this) |
|---|
| 176 | 175 | { |
|---|
| 177 | 176 | return alchemy_rdsmem(AU1000_MEM_STSTAT) & 1; |
|---|
| 178 | 177 | } |
|---|
| .. | .. |
|---|
| 440 | 439 | |
|---|
| 441 | 440 | static struct platform_device db1300_ide_dev = { |
|---|
| 442 | 441 | .dev = { |
|---|
| 442 | + .dma_mask = &au1300_all_dmamask, |
|---|
| 443 | + .coherent_dma_mask = DMA_BIT_MASK(32), |
|---|
| 443 | 444 | .platform_data = &db1300_ide_info, |
|---|
| 444 | 445 | }, |
|---|
| 445 | 446 | .name = "pata_platform", |
|---|
| .. | .. |
|---|
| 449 | 450 | |
|---|
| 450 | 451 | /**********************************************************************/ |
|---|
| 451 | 452 | |
|---|
| 453 | +#ifdef CONFIG_MMC_AU1X |
|---|
| 452 | 454 | static irqreturn_t db1300_mmc_cd(int irq, void *ptr) |
|---|
| 453 | 455 | { |
|---|
| 454 | 456 | disable_irq_nosync(irq); |
|---|
| .. | .. |
|---|
| 457 | 459 | |
|---|
| 458 | 460 | static irqreturn_t db1300_mmc_cdfn(int irq, void *ptr) |
|---|
| 459 | 461 | { |
|---|
| 460 | | - void (*mmc_cd)(struct mmc_host *, unsigned long); |
|---|
| 461 | | - |
|---|
| 462 | | - /* link against CONFIG_MMC=m. We can only be called once MMC core has |
|---|
| 463 | | - * initialized the controller, so symbol_get() should always succeed. |
|---|
| 464 | | - */ |
|---|
| 465 | | - mmc_cd = symbol_get(mmc_detect_change); |
|---|
| 466 | | - mmc_cd(ptr, msecs_to_jiffies(200)); |
|---|
| 467 | | - symbol_put(mmc_detect_change); |
|---|
| 462 | + mmc_detect_change(ptr, msecs_to_jiffies(200)); |
|---|
| 468 | 463 | |
|---|
| 469 | 464 | msleep(100); /* debounce */ |
|---|
| 470 | 465 | if (irq == DB1300_SD1_INSERT_INT) |
|---|
| .. | .. |
|---|
| 562 | 557 | |
|---|
| 563 | 558 | static struct platform_device db1300_sd1_dev = { |
|---|
| 564 | 559 | .dev = { |
|---|
| 565 | | - .platform_data = &db1300_sd1_platdata, |
|---|
| 560 | + .dma_mask = &au1300_all_dmamask, |
|---|
| 561 | + .coherent_dma_mask = DMA_BIT_MASK(32), |
|---|
| 562 | + .platform_data = &db1300_sd1_platdata, |
|---|
| 566 | 563 | }, |
|---|
| 567 | 564 | .name = "au1xxx-mmc", |
|---|
| 568 | 565 | .id = 1, |
|---|
| .. | .. |
|---|
| 627 | 624 | |
|---|
| 628 | 625 | static struct platform_device db1300_sd0_dev = { |
|---|
| 629 | 626 | .dev = { |
|---|
| 630 | | - .platform_data = &db1300_sd0_platdata, |
|---|
| 627 | + .dma_mask = &au1300_all_dmamask, |
|---|
| 628 | + .coherent_dma_mask = DMA_BIT_MASK(32), |
|---|
| 629 | + .platform_data = &db1300_sd0_platdata, |
|---|
| 631 | 630 | }, |
|---|
| 632 | 631 | .name = "au1xxx-mmc", |
|---|
| 633 | 632 | .id = 0, |
|---|
| 634 | 633 | .resource = au1300_sd0_res, |
|---|
| 635 | 634 | .num_resources = ARRAY_SIZE(au1300_sd0_res), |
|---|
| 636 | 635 | }; |
|---|
| 636 | +#endif /* CONFIG_MMC_AU1X */ |
|---|
| 637 | 637 | |
|---|
| 638 | 638 | /**********************************************************************/ |
|---|
| 639 | 639 | |
|---|
| .. | .. |
|---|
| 654 | 654 | |
|---|
| 655 | 655 | static struct platform_device db1300_sndac97_dev = { |
|---|
| 656 | 656 | .name = "db1300-ac97", |
|---|
| 657 | + .dev = { |
|---|
| 658 | + .dma_mask = &au1300_all_dmamask, |
|---|
| 659 | + .coherent_dma_mask = DMA_BIT_MASK(32), |
|---|
| 660 | + }, |
|---|
| 657 | 661 | }; |
|---|
| 658 | 662 | |
|---|
| 659 | 663 | static struct platform_device db1300_sndi2s_dev = { |
|---|
| 660 | 664 | .name = "db1300-i2s", |
|---|
| 665 | + .dev = { |
|---|
| 666 | + .dma_mask = &au1300_all_dmamask, |
|---|
| 667 | + .coherent_dma_mask = DMA_BIT_MASK(32), |
|---|
| 668 | + }, |
|---|
| 661 | 669 | }; |
|---|
| 662 | 670 | |
|---|
| 663 | 671 | /**********************************************************************/ |
|---|
| .. | .. |
|---|
| 702 | 710 | } |
|---|
| 703 | 711 | }; |
|---|
| 704 | 712 | |
|---|
| 705 | | -static u64 au1300_lcd_dmamask = DMA_BIT_MASK(32); |
|---|
| 706 | 713 | |
|---|
| 707 | 714 | static struct platform_device db1300_lcd_dev = { |
|---|
| 708 | 715 | .name = "au1200-lcd", |
|---|
| 709 | 716 | .id = 0, |
|---|
| 710 | 717 | .dev = { |
|---|
| 711 | | - .dma_mask = &au1300_lcd_dmamask, |
|---|
| 718 | + .dma_mask = &au1300_all_dmamask, |
|---|
| 712 | 719 | .coherent_dma_mask = DMA_BIT_MASK(32), |
|---|
| 713 | 720 | .platform_data = &db1300fb_pd, |
|---|
| 714 | 721 | }, |
|---|
| .. | .. |
|---|
| 718 | 725 | |
|---|
| 719 | 726 | /**********************************************************************/ |
|---|
| 720 | 727 | |
|---|
| 728 | +#if IS_ENABLED(CONFIG_TOUCHSCREEN_WM97XX) |
|---|
| 721 | 729 | static void db1300_wm97xx_irqen(struct wm97xx *wm, int enable) |
|---|
| 722 | 730 | { |
|---|
| 723 | 731 | if (enable) |
|---|
| .. | .. |
|---|
| 749 | 757 | |
|---|
| 750 | 758 | return wm97xx_register_mach_ops(wm, &db1300_wm97xx_ops); |
|---|
| 751 | 759 | } |
|---|
| 760 | +#else |
|---|
| 761 | +static int db1300_wm97xx_probe(struct platform_device *pdev) |
|---|
| 762 | +{ |
|---|
| 763 | + return -ENODEV; |
|---|
| 764 | +} |
|---|
| 765 | +#endif |
|---|
| 752 | 766 | |
|---|
| 753 | 767 | static struct platform_driver db1300_wm97xx_driver = { |
|---|
| 754 | 768 | .driver.name = "wm97xx-touch", |
|---|
| .. | .. |
|---|
| 764 | 778 | &db1300_5waysw_dev, |
|---|
| 765 | 779 | &db1300_nand_dev, |
|---|
| 766 | 780 | &db1300_ide_dev, |
|---|
| 781 | +#ifdef CONFIG_MMC_AU1X |
|---|
| 767 | 782 | &db1300_sd0_dev, |
|---|
| 768 | 783 | &db1300_sd1_dev, |
|---|
| 784 | +#endif |
|---|
| 769 | 785 | &db1300_lcd_dev, |
|---|
| 770 | 786 | &db1300_ac97_dev, |
|---|
| 771 | 787 | &db1300_i2s_dev, |
|---|