X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/b6dbd839010e50246278038736b43b54a5da95a6..e3c5dcc5ee15c3b744cdd5bef8cf0ea8d20e4021:/target/linux/ar71xx/files/drivers/mtd/nand/rb4xx_nand.c diff --git a/target/linux/ar71xx/files/drivers/mtd/nand/rb4xx_nand.c b/target/linux/ar71xx/files/drivers/mtd/nand/rb4xx_nand.c index 17920e9f4..f73137d10 100644 --- a/target/linux/ar71xx/files/drivers/mtd/nand/rb4xx_nand.c +++ b/target/linux/ar71xx/files/drivers/mtd/nand/rb4xx_nand.c @@ -1,7 +1,7 @@ /* * NAND flash driver for the MikroTik RouterBoard 4xx series * - * Copyright (C) 2008-2010 Gabor Juhos + * Copyright (C) 2008-2011 Gabor Juhos * Copyright (C) 2008 Imre Kaloz * * This file was based on the driver for Linux 2.6.22 published by @@ -71,7 +71,7 @@ static struct mtd_partition rb4xx_nand_partitions[] = { static int rb4xx_nand_dev_ready(struct mtd_info *mtd) { - return gpio_get_value(RB4XX_NAND_GPIO_READY); + return gpio_get_value_cansleep(RB4XX_NAND_GPIO_READY); } static void rb4xx_nand_write_cmd(unsigned char cmd) @@ -88,9 +88,12 @@ static void rb4xx_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl) { if (ctrl & NAND_CTRL_CHANGE) { - gpio_set_value(RB4XX_NAND_GPIO_CLE, (ctrl & NAND_CLE) ? 1 : 0); - gpio_set_value(RB4XX_NAND_GPIO_ALE, (ctrl & NAND_ALE) ? 1 : 0); - gpio_set_value(RB4XX_NAND_GPIO_NCE, (ctrl & NAND_NCE) ? 0 : 1); + gpio_set_value_cansleep(RB4XX_NAND_GPIO_CLE, + (ctrl & NAND_CLE) ? 1 : 0); + gpio_set_value_cansleep(RB4XX_NAND_GPIO_ALE, + (ctrl & NAND_ALE) ? 1 : 0); + gpio_set_value_cansleep(RB4XX_NAND_GPIO_NCE, + (ctrl & NAND_NCE) ? 0 : 1); } if (cmd != NAND_CMD_NONE) @@ -131,7 +134,7 @@ static void rb4xx_nand_read_buf(struct mtd_info *mtd, unsigned char *buf, pr_err("rb4xx_nand: read buf failed, err=%d\n", err); } -static int __init rb4xx_nand_probe(struct platform_device *pdev) +static int __devinit rb4xx_nand_probe(struct platform_device *pdev) { struct rb4xx_nand_info *info; int ret; @@ -210,7 +213,9 @@ static int __init rb4xx_nand_probe(struct platform_device *pdev) info->chip.read_byte = rb4xx_nand_read_byte; info->chip.write_buf = rb4xx_nand_write_buf; info->chip.read_buf = rb4xx_nand_read_buf; -// info->chip.verify_buf = rb4xx_nand_verify_buf; +#if 0 + info->chip.verify_buf = rb4xx_nand_verify_buf; +#endif info->chip.chip_delay = 25; info->chip.ecc.mode = NAND_ECC_SOFT; @@ -218,7 +223,7 @@ static int __init rb4xx_nand_probe(struct platform_device *pdev) platform_set_drvdata(pdev, info); - ret = nand_scan_ident(&info->mtd, 1); + ret = nand_scan_ident(&info->mtd, 1, NULL); if (ret) { ret = -ENXIO; goto err_free_info;