forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-08 01573e231f18eb2d99162747186f59511f56b64d
kernel/arch/mips/alchemy/devboards/db1300.c
....@@ -19,8 +19,7 @@
1919 #include <linux/mmc/host.h>
2020 #include <linux/module.h>
2121 #include <linux/mtd/mtd.h>
22
-#include <linux/mtd/rawnand.h>
23
-#include <linux/mtd/partitions.h>
22
+#include <linux/mtd/platnand.h>
2423 #include <linux/platform_device.h>
2524 #include <linux/smsc911x.h>
2625 #include <linux/wm97xx.h>
....@@ -149,11 +148,12 @@
149148
150149 /**********************************************************************/
151150
152
-static void au1300_nand_cmd_ctrl(struct mtd_info *mtd, int cmd,
151
+static u64 au1300_all_dmamask = DMA_BIT_MASK(32);
152
+
153
+static void au1300_nand_cmd_ctrl(struct nand_chip *this, int cmd,
153154 unsigned int ctrl)
154155 {
155
- struct nand_chip *this = mtd_to_nand(mtd);
156
- unsigned long ioaddr = (unsigned long)this->IO_ADDR_W;
156
+ unsigned long ioaddr = (unsigned long)this->legacy.IO_ADDR_W;
157157
158158 ioaddr &= 0xffffff00;
159159
....@@ -165,14 +165,14 @@
165165 /* assume we want to r/w real data by default */
166166 ioaddr += MEM_STNAND_DATA;
167167 }
168
- this->IO_ADDR_R = this->IO_ADDR_W = (void __iomem *)ioaddr;
168
+ this->legacy.IO_ADDR_R = this->legacy.IO_ADDR_W = (void __iomem *)ioaddr;
169169 if (cmd != NAND_CMD_NONE) {
170
- __raw_writeb(cmd, this->IO_ADDR_W);
170
+ __raw_writeb(cmd, this->legacy.IO_ADDR_W);
171171 wmb();
172172 }
173173 }
174174
175
-static int au1300_nand_device_ready(struct mtd_info *mtd)
175
+static int au1300_nand_device_ready(struct nand_chip *this)
176176 {
177177 return alchemy_rdsmem(AU1000_MEM_STSTAT) & 1;
178178 }
....@@ -440,6 +440,8 @@
440440
441441 static struct platform_device db1300_ide_dev = {
442442 .dev = {
443
+ .dma_mask = &au1300_all_dmamask,
444
+ .coherent_dma_mask = DMA_BIT_MASK(32),
443445 .platform_data = &db1300_ide_info,
444446 },
445447 .name = "pata_platform",
....@@ -562,7 +564,9 @@
562564
563565 static struct platform_device db1300_sd1_dev = {
564566 .dev = {
565
- .platform_data = &db1300_sd1_platdata,
567
+ .dma_mask = &au1300_all_dmamask,
568
+ .coherent_dma_mask = DMA_BIT_MASK(32),
569
+ .platform_data = &db1300_sd1_platdata,
566570 },
567571 .name = "au1xxx-mmc",
568572 .id = 1,
....@@ -627,7 +631,9 @@
627631
628632 static struct platform_device db1300_sd0_dev = {
629633 .dev = {
630
- .platform_data = &db1300_sd0_platdata,
634
+ .dma_mask = &au1300_all_dmamask,
635
+ .coherent_dma_mask = DMA_BIT_MASK(32),
636
+ .platform_data = &db1300_sd0_platdata,
631637 },
632638 .name = "au1xxx-mmc",
633639 .id = 0,
....@@ -654,10 +660,18 @@
654660
655661 static struct platform_device db1300_sndac97_dev = {
656662 .name = "db1300-ac97",
663
+ .dev = {
664
+ .dma_mask = &au1300_all_dmamask,
665
+ .coherent_dma_mask = DMA_BIT_MASK(32),
666
+ },
657667 };
658668
659669 static struct platform_device db1300_sndi2s_dev = {
660670 .name = "db1300-i2s",
671
+ .dev = {
672
+ .dma_mask = &au1300_all_dmamask,
673
+ .coherent_dma_mask = DMA_BIT_MASK(32),
674
+ },
661675 };
662676
663677 /**********************************************************************/
....@@ -702,13 +716,12 @@
702716 }
703717 };
704718
705
-static u64 au1300_lcd_dmamask = DMA_BIT_MASK(32);
706719
707720 static struct platform_device db1300_lcd_dev = {
708721 .name = "au1200-lcd",
709722 .id = 0,
710723 .dev = {
711
- .dma_mask = &au1300_lcd_dmamask,
724
+ .dma_mask = &au1300_all_dmamask,
712725 .coherent_dma_mask = DMA_BIT_MASK(32),
713726 .platform_data = &db1300fb_pd,
714727 },
....@@ -718,6 +731,7 @@
718731
719732 /**********************************************************************/
720733
734
+#if IS_ENABLED(CONFIG_TOUCHSCREEN_WM97XX)
721735 static void db1300_wm97xx_irqen(struct wm97xx *wm, int enable)
722736 {
723737 if (enable)
....@@ -749,6 +763,12 @@
749763
750764 return wm97xx_register_mach_ops(wm, &db1300_wm97xx_ops);
751765 }
766
+#else
767
+static int db1300_wm97xx_probe(struct platform_device *pdev)
768
+{
769
+ return -ENODEV;
770
+}
771
+#endif
752772
753773 static struct platform_driver db1300_wm97xx_driver = {
754774 .driver.name = "wm97xx-touch",