| @@ -28,6 +28,7 @@ · 27 unmodified lines |
| 28 | 28 | #include <linux/mtd/nand_bch.h> |
| 29 | 29 | #include <linux/platform_data/elm.h> |
| 30 | 30 | |
| 31 | +#include <linux/omap-gpmc.h> |
| 31 | 32 | #include <linux/platform_data/mtd-nand-omap2.h> |
| 32 | 33 | |
| 33 | 34 | #define DRIVER_NAME "omap2-nand" |
| @@ -168,7 +169,9 @@ struct omap_nand_info { · 134 unmodified lines |
| 168 | 169 | } iomode; |
| 169 | 170 | u_char *buf; |
| 170 | 171 | int buf_len; |
| 172 | + /* Interface to GPMC */ |
| 171 | 173 | struct gpmc_nand_regs reg; |
| 174 | + struct gpmc_nand_ops *ops; |
| 172 | 175 | /* generated at runtime depending on ECC algorithm and layout selected */ |
| 173 | 176 | struct nand_ecclayout oobinfo; |
| 174 | 177 | /* fields specific for BCHx_HW ECC scheme */ |
| @@ -1665,9 +1668,13 @@ static int omap_nand_probe(struct platform_device *pdev) · 1490 unmodified lines |
| 1665 | 1668 | |
| 1666 | 1669 | platform_set_drvdata(pdev, info); |
| 1667 | 1670 | |
| 1671 | + info->ops = gpmc_omap_get_nand_ops(&info->reg, info->gpmc_cs); |
| 1672 | + if (!info->ops) { |
| 1673 | + dev_err(&pdev->dev, "Failed to get GPMC->NAND interface\n"); |
| 1674 | + return -ENODEV; |
| 1675 | + } |
| 1668 | 1676 | info->pdev = pdev; |
| 1669 | 1677 | info->gpmc_cs = pdata->cs; |
| 1670 | | − info->reg = pdata->reg; |
| 1671 | 1678 | info->of_node = pdata->of_node; |
| 1672 | 1679 | info->ecc_opt = pdata->ecc_opt; |
| 1673 | 1680 | nand_chip = &info->nand; |