diff options
Diffstat (limited to 'drivers/mtd/onenand')
-rw-r--r-- | drivers/mtd/onenand/omap2.c | 36 |
1 files changed, 8 insertions, 28 deletions
diff --git a/drivers/mtd/onenand/omap2.c b/drivers/mtd/onenand/omap2.c index c849cacf4b2f..14a49abe057e 100644 --- a/drivers/mtd/onenand/omap2.c +++ b/drivers/mtd/onenand/omap2.c | |||
@@ -63,7 +63,7 @@ struct omap2_onenand { | |||
63 | struct completion dma_done; | 63 | struct completion dma_done; |
64 | int dma_channel; | 64 | int dma_channel; |
65 | int freq; | 65 | int freq; |
66 | int (*setup)(void __iomem *base, int freq); | 66 | int (*setup)(void __iomem *base, int *freq_ptr); |
67 | struct regulator *regulator; | 67 | struct regulator *regulator; |
68 | }; | 68 | }; |
69 | 69 | ||
@@ -148,11 +148,9 @@ static int omap2_onenand_wait(struct mtd_info *mtd, int state) | |||
148 | wait_err("controller error", state, ctrl, intr); | 148 | wait_err("controller error", state, ctrl, intr); |
149 | return -EIO; | 149 | return -EIO; |
150 | } | 150 | } |
151 | if ((intr & intr_flags) != intr_flags) { | 151 | if ((intr & intr_flags) == intr_flags) |
152 | wait_err("timeout", state, ctrl, intr); | 152 | return 0; |
153 | return -EIO; | 153 | /* Continue in wait for interrupt branch */ |
154 | } | ||
155 | return 0; | ||
156 | } | 154 | } |
157 | 155 | ||
158 | if (state != FL_READING) { | 156 | if (state != FL_READING) { |
@@ -581,7 +579,7 @@ static int __adjust_timing(struct device *dev, void *data) | |||
581 | 579 | ||
582 | /* DMA is not in use so this is all that is needed */ | 580 | /* DMA is not in use so this is all that is needed */ |
583 | /* Revisit for OMAP3! */ | 581 | /* Revisit for OMAP3! */ |
584 | ret = c->setup(c->onenand.base, c->freq); | 582 | ret = c->setup(c->onenand.base, &c->freq); |
585 | 583 | ||
586 | return ret; | 584 | return ret; |
587 | } | 585 | } |
@@ -673,7 +671,7 @@ static int __devinit omap2_onenand_probe(struct platform_device *pdev) | |||
673 | } | 671 | } |
674 | 672 | ||
675 | if (pdata->onenand_setup != NULL) { | 673 | if (pdata->onenand_setup != NULL) { |
676 | r = pdata->onenand_setup(c->onenand.base, c->freq); | 674 | r = pdata->onenand_setup(c->onenand.base, &c->freq); |
677 | if (r < 0) { | 675 | if (r < 0) { |
678 | dev_err(&pdev->dev, "Onenand platform setup failed: " | 676 | dev_err(&pdev->dev, "Onenand platform setup failed: " |
679 | "%d\n", r); | 677 | "%d\n", r); |
@@ -718,8 +716,8 @@ static int __devinit omap2_onenand_probe(struct platform_device *pdev) | |||
718 | } | 716 | } |
719 | 717 | ||
720 | dev_info(&pdev->dev, "initializing on CS%d, phys base 0x%08lx, virtual " | 718 | dev_info(&pdev->dev, "initializing on CS%d, phys base 0x%08lx, virtual " |
721 | "base %p\n", c->gpmc_cs, c->phys_base, | 719 | "base %p, freq %d MHz\n", c->gpmc_cs, c->phys_base, |
722 | c->onenand.base); | 720 | c->onenand.base, c->freq); |
723 | 721 | ||
724 | c->pdev = pdev; | 722 | c->pdev = pdev; |
725 | c->mtd.name = dev_name(&pdev->dev); | 723 | c->mtd.name = dev_name(&pdev->dev); |
@@ -754,24 +752,6 @@ static int __devinit omap2_onenand_probe(struct platform_device *pdev) | |||
754 | if ((r = onenand_scan(&c->mtd, 1)) < 0) | 752 | if ((r = onenand_scan(&c->mtd, 1)) < 0) |
755 | goto err_release_regulator; | 753 | goto err_release_regulator; |
756 | 754 | ||
757 | switch ((c->onenand.version_id >> 4) & 0xf) { | ||
758 | case 0: | ||
759 | c->freq = 40; | ||
760 | break; | ||
761 | case 1: | ||
762 | c->freq = 54; | ||
763 | break; | ||
764 | case 2: | ||
765 | c->freq = 66; | ||
766 | break; | ||
767 | case 3: | ||
768 | c->freq = 83; | ||
769 | break; | ||
770 | case 4: | ||
771 | c->freq = 104; | ||
772 | break; | ||
773 | } | ||
774 | |||
775 | #ifdef CONFIG_MTD_PARTITIONS | 755 | #ifdef CONFIG_MTD_PARTITIONS |
776 | r = parse_mtd_partitions(&c->mtd, part_probes, &c->parts, 0); | 756 | r = parse_mtd_partitions(&c->mtd, part_probes, &c->parts, 0); |
777 | if (r > 0) | 757 | if (r > 0) |